")[1],r=r.substring(0,r.indexOf("
"," ").replace("\n",""),c=i[s].split("")[1],c=c.substring(c.indexOf("")+8,c.indexOf("")),d.push({img:o,url:"http://www.ted.com"+n,author:r,profession:c,type:l.TYPE_FOLDER,system:{type:a.TYPE_SPEAKER}});t(u,d)};break;case a.TYPE_SPEAKER:i=e.url,o=function(i){var s,n,o,r,c,u,d=!1,p=[];if((u=i.split("
")[1])&&(u=u.substring(0,u.indexOf("’"))),i=i.split("")[1],void 0===i||e.page>0)return void t(d,[]);for(i=i.split(""),s=1;s')[1],c=c.substring(0,c.indexOf("")),n=i[s].split("href='")[1],n="http://www.ted.com"+n.substring(0,n.indexOf("'>")),r=i[s].split("")[1],r=r.substring(r.indexOf(">")+1,r.indexOf("")),p.push({img:o,url:n,duration:c,title:r,type:l.TYPE_MOVIE,author:u,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_EVENT_LIST:if(r="json",i=e.url,e.page>0)return void t(!1,[]);o=function(i){var s=[],o=[];i.forEach(function(t){-1===o.indexOf(t.year)&&(o.push(t.year),s.push({title:t.year,url:e.url+"/"+t.year,type:n.TYPE_FOLDER,system:{type:a.TYPE_EVENT_SUB_LIST}}))}),t(!1,s)};break;case a.TYPE_EVENT_SUB_LIST:if(r="json",i="http://www.ted.com/talks/events",e.page>0)return void t(!1,[]);o=function(i){var s=[],o=e.url.substring(e.url.lastIndexOf("/")+1);i.forEach(function(e){e.year===o&&s.push({title:e.label,url:"http://www.ted.com/talks?event="+e.value+"&page=%n&sort=newest",type:n.TYPE_CATEGORY,system:{type:a.TYPE_THEME}})}),t(!1,s)};break;case a.TYPE_VIDEO:if(i=e.url,e.page>0)return void t(!1,[]);o=function(e){var i;if(e=e.split('"talkPage.init",')[1],void 0===e)return void t(!0,[]);e=e.substring(0,e.indexOf(")"));try{i=JSON.parse(e)}catch(s){return void t(!0,[])}t(!1,[i.talks[0]])};break;case a.TYPE_SEARCH:i=e.url.replace("%n",e.page+1),o=function(i){var s,o,r,l,c,u=!1,d=[];if(i=i.split("")[1].split("")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),c=o.substr(0,o.indexOf(":")),o=o.substring(o.indexOf(":")+2),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"'))+"quality=89&w=320",r=i[s].split('')),d.push({title:o,img:l,author:c,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(u,d)}}e.page--,o?s("GET",i,o,r):t(!1,{})},n.getCursor=function(e,t){var i=!1,s=e.item.system.type,n=e.item.url;e=e||{},e.searchText&&(n="http://www.ted.com/search?cat=talks&page=%n&per_page=12&q="+e.searchText,s=a.TYPE_SEARCH),e.sortType&&(n=e.sortType.url),t(i,{page:-1,url:n,system:{type:s,letters:e.item.system.letters}})},n.getInfo=function(e,t){t(e)},e.exports=n},function(e,t,i){"use strict";function s(e){n.call(this),this.data=e||{}}var n=i(14);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.idName="id",s.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},s.prototype.init=function(e){return e?(this.clear(),this.data=e,this.events.init&&this.emit("init",{data:e}),!0):!1},s.prototype.has=function(e){return this.data.hasOwnProperty(e)},s.prototype.get=function(e){return this.data[e]},s.prototype.set=function(e,t){var i=e in this.data,s={name:e,curr:t};return i?(s.prev=this.data[e],t!==s.prev?(this.data[e]=t,this.events.change&&this.emit("change",s),!0):!1):(this.data[e]=t,this.events.change&&this.emit("change",s),!0)},s.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=s},function(e,t,i){"use strict";function s(e){var t=this;this.isPLaying=!1,this.playUrl="",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||{},o.call(this,e),this.$node.classList.add("player"),this.init(e),n.addListener("media",function(e){s.prototype.mediaListener.call(t,e)})}var n=i(5),a=i(1),o=i(2);s.prototype=Object.create(o.prototype),s.prototype.constructor=s,s.prototype.ASPECT_TYPE_FIT=16,s.prototype.ASPECT_TYPE_BIG=64,s.prototype.ASPECT_TYPE_OPTIMAL=80,s.prototype.ASPECT_TYPE_ZOOM=0,s.prototype.aspects=[{name:"fit",mode:s.prototype.ASPECT_TYPE_FIT},{name:"big",mode:s.prototype.ASPECT_TYPE_BIG},{name:"opt",mode:s.prototype.ASPECT_TYPE_OPTIMAL},{name:"exp",mode:s.prototype.ASPECT_TYPE_ZOOM}],s.prototype.STEREO_MODE_OFF=0,s.prototype.STEREO_MODE_OVER_UNDER=1,s.prototype.STEREO_MODE_OVER_UNDER_HD=2,s.prototype.STEREO_MODE_SIDE_BY_SIDE=3,s.prototype.stereoModes=[{mode:s.prototype.STEREO_MODE_OFF,name:"Off"},{mode:s.prototype.STEREO_MODE_OVER_UNDER,name:"Over-Under"},{mode:s.prototype.STEREO_MODE_OVER_UNDER_HD,name:"Over-Under HD"},{mode:s.prototype.STEREO_MODE_SIDE_BY_SIDE,name:"Side-by-side"}],s.prototype.defaultEvents={keydown:function(e){switch(e.code){case a.ok:case a.playPause:this.playPause();break;case a.stop:this.stop();break;case a.forward:case a.right:this.rewind(!0);break;case a.rewind:case a.left:this.rewind(!1);break;case a.f4:case 117:this.nextAspect();break;case a.f1:this.nextAudioTrack();break;case a.f2:this.nextSubtitle();break;case a.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)}}},s.prototype.mediaListener=function(e){var t,i,s,a,o,r,l=this,c={};switch(e.code){case n.EVENT_PLAYBACK_BEGIN:l.isPLaying=!0,l.durationInterval&&(clearInterval(l.durationInterval),l.durationInterval=0),l.durationInterval=setInterval(function(){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 n.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{o=gSTB.GetAudioPIDs().replace(/pid:/g,'"pid":').replace(/lang:/g,'"lang":'),l.audioPIDs=JSON.parse(o)}catch(u){}try{r=gSTB.GetSubtitlePIDs().replace(/pid:/g,'"pid":').replace(/lang:/g,'"lang":'),l.subtitlePIDs=JSON.parse(r)}catch(u){}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.emit("get:info",c);break;case n.EVENT_CONTENT_ERROR:l.isPLaying=!1,l.emit("content:error");break;case n.EVENT_END_OF_FILE:l.currentSec=l.totalDurationSec,l.isPLaying=!1,l.emit("content:end");break;case n.EVENT_SUBTITLE_LOAD_ERROR:l.subtitlePIDs.pop();break;case n.EVENT_HDMI_DISCONNECT:if(s=parseInt(JSON.parse(gSTB.GetEnv('{"varList":["hdmi_event_delay"]}')).result.hdmi_event_delay,10),0===s)return;l.hdmiEventTimeout=setTimeout(function(){l.isPLaying&&stbStorage.setItem("standByPlayback",JSON.stringify({url:l.playUrl,position:l.currentSec})),gSTB.StandBy(!0),l.hdmiEventTimeout=null},s);break;case n.EVENT_HDMI_CONNECT:if(s=parseInt(JSON.parse(gSTB.GetEnv('{"varList":["hdmi_event_delay"]}')).result.hdmi_event_delay,10),0===s)return;if(l.hdmiEventTimeout)return clearTimeout(l.hdmiEventTimeout),void(l.hdmiEventTimeout=null);gSTB.StandBy(!1),a=JSON.parse(stbStorage.getItem("standByPlayback")),s&&(l.play(a.url,{position:a.position}),stbStorage.removeItem("standByPlayback"))}},s.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)},s.prototype.play=function(e,t){var i,s;this.totalDurationSec=0,this.currentSec=0,this.playUrl=e,t=t||{},i=t.solution?t.solution:"auto",s=" position:"+t.position,gSTB.Play(i+" "+e+s,t.proxy)},s.prototype.stop=function(){gSTB.Stop(),clearInterval(this.durationInterval),this.isPLaying=!1,this.isPause=!1},s.prototype.playPause=function(){this.isPause?gSTB.Continue():gSTB.Pause(),this.isPause=!this.isPause,this.emit("pause",{state:this.isPause})},s.prototype.rewind=function(e,t){var i=this;t=t||this.rewindHelper.duration||15,this.rewindHelper.isActive||(this.rewindHelper.isActive=!0,this.rewindHelper.startTime=this.currentSec,this.rewindHelper.time=this.currentSec,this.emit("rewind:start")),e?this.rewindHelper.time+t0?this.rewindHelper.time-=t:this.rewindHelper.time=0,this.rewindHelper.timeout&&clearTimeout(this.rewindHelper.timeout),this.emit("rewind",{time:this.rewindHelper.time,shift:this.rewindHelper.time-this.rewindHelper.startTime}),this.rewindHelper.timeoutDuration?this.rewindHelper.timeout=setTimeout(function(){return clearInterval(i.durationInterval),i.durationInterval=0,i.rewindHelper.isActive=!1,i.emit("rewind:apply"),i.currentSec=i.rewindHelper.time,i.rewindHelper.timeout=0,i.rewindHelper.time===i.totalDurationSec?void i.emit("content:end"):void gSTB.SetPosTime(i.rewindHelper.time)},this.rewindHelper.timeoutDuration):(clearInterval(i.durationInterval),i.durationInterval=0,gSTB.SetPosTime(i.rewindHelper.time),i.currentSec=i.rewindHelper.time,i.rewindHelper.isActive=!1,i.emit("rewind:apply"))},s.prototype.nextAudioTrack=function(){var e=this;return this.audioPIDs.length<=1?!1:(this.currentAudioPIDthis.aspects.length-1&&(this.activeAspect=0),gSTB.SetAspect(this.aspects[this.activeAspect].mode),this.emit("aspect:change",{type:this.aspects[this.activeAspect].mode,name:this.aspects[this.activeAspect].name})},s.prototype.setAspect=function(e){this.activeAspect=e,gSTB.SetAspect(this.aspects[this.activeAspect].mode),this.emit("aspect:change",{type:this.aspects[this.activeAspect].type,name:this.aspects[this.activeAspect].name})},s.prototype.nextSubtitle=function(){return this.subtitlePIDs.length<=0?(this.emit("subtitles:change",null),!1):(null===this.currentSubtitle?this.currentSubtitle=0:this.currentSubtitlee?e++:e=0,this.emit("viewmode:change",{type:this.stereoModes[e].mode,name:this.stereoModes[e].name}),gSTB.Set3DConversionMode(e)},s.prototype.setViewMode=function(e){e>0&&3>=e&&(gSTB.Set3DConversionMode(e),this.emit("viewmode:change",{type:this.stereoModes[e].mode,name:this.stereoModes[e].name}))},s.prototype.inputPosition=function(e){var t,i,s,n,a=this,o=parseInt(e,10)-48,r=[],l=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.emit("position:input",{time:"00:00:00",start:!0,sec:0}):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(o),r=this.setModeHelper.time.slice(0,this.setModeHelper.length+1),6===this.setModeHelper.length?this.setModeHelper.timeStr=r[0].toString()+r[1].toString()+":"+r[2].toString()+r[3].toString()+":"+r[4].toString()+r[5].toString():this.setModeHelper.timeStr=r[0].toString()+r[1].toString()+":"+r[2].toString()+r[3].toString(),this.setModeHelper.count++,6===this.setModeHelper.length&&(i=r.shift()+r.shift().toString(),l+=3600*parseInt(i,10)),s=r.shift()+r.shift().toString(),l+=60*parseInt(s,10),n=r.shift()+r.shift().toString(),l+=parseInt(n,10),l>this.totalDurationSec&&(l=this.totalDurationSec),this.setModeHelper.sec=l,this.emit("position:input",{time:a.setModeHelper.timeStr,sec:l})),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.emit("position:input",{time:a.setModeHelper.timeStr,sec:a.setModeHelper.sec,end:!0})},t))},s.prototype.setPosition=function(e){gSTB.SetPosTime(e),this.emit("position:set",{sec:e})},s.prototype.parseTime=function(e){var t,i,s;return e>=0?(t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),s=e-3600*t-60*i,10>t&&(t="0"+t),10>s&&(s="0"+s),10>i&&(i="0"+i)):(e=Math.abs(e),t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),s=e-3600*t-60*i,10>t&&(t="0"+t),10>s&&(s="0"+s),10>i&&(i="0"+i),t="-"+t),{hour:t,min:i,sec:s}},e.exports=s},function(e,t){"use strict";if(!("classList"in document.documentElement)){var i=Array.prototype,s=i.indexOf,n=i.slice,a=i.push,o=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=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})},s.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&&ee&&(--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)},s.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)},s.prototype.setValue=function(e){var t,i,s=this.value.length,n=e.length,a=0;if(e!==this.value){if(n>0){if(this.$placeholder.parentNode===this.$line&&this.$line.removeChild(this.$placeholder),this.$line.removeChild(this.$caret),n!==s)if(i=n-s,i>0)for(a=0;i>a;a++)t=this.$line.appendChild(document.createElement("div")),t.className="char";else for(a=0;a>i;a--)this.$line.removeChild(this.$line.lastChild);for(a=0;n>a;a++)t=this.$line.children[a],this.type===this.TYPE_PASSWORD?t.innerHTML="*":" "===e[a]?t.innerHTML=" ":t.innerText=e[a];this.value=e,this.$caret.index=n,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=s},function(e,t,i){"use strict";function s(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||""),n.call(this,e),this.$value=this.$body.appendChild(document.createElement("div")),this.$value.className="value",this.init(e)}var n=i(2);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.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},s.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=s},function(e,t){"use strict";e.exports={en:[[1,2,3,4,5,6,7,8,9,0,{value:"",id:"keyBackspace",img:"key.del",underline:"red"}],["q","w","e","r","t","y","u","i","o","p","@"],["a","s","d","f","g","h","j","k","l","_","&"],["z","x","c","v","b","n","m",",",".","-","?"],["#",{value:"",id:"keyUp",img:"key.up"},{value:" ",id:"keySpace",colSpan:7},{value:"",id:"keyLeft",img:"key.left"},{value:"",id:"keyRight",img:"key.right"}]],ru:[[1,2,3,4,5,6,7,8,9,0,"@",{value:"",id:"keyBackspace",
-img:"key.del",underline:"red"}],["й","ц","у","к","е","н","г","ш","щ","з","х","ъ"],["ф","ы","в","а","п","р","о","л","д","ж","э","?"],["я","ч","с","м","и","т","ь","б","ю",",",".","-"],[{value:"Ру",id:"keyLang",underline:"yellow"},{value:"",id:"keyUp",img:"key.up"},{value:" ",id:"keySpace",colSpan:7},{value:"",id:"keyLeft",img:"key.left"},{value:"",id:"keyRight",img:"key.right"},{value:"",disable:!0}]]}},function(e,t){"use strict";e.exports={480:{height:480,width:720,availTop:24,availBottom:24,availRight:32,availLeft:48},576:{height:576,width:720,availTop:24,availBottom:24,availRight:28,availLeft:54},720:{height:720,width:1280,availTop:20,availBottom:20,availRight:20,availLeft:20},1080:{height:1080,width:1920,availTop:15,availBottom:15,availRight:15,availLeft:15}}}]);
\ No newline at end of file
+/*! Ted: v1.0.6 (webpack: v1.12.6) */
+!function(e){function t(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return e[s].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";var s,n,a=i(5),o=i(4),r=i(1),l=i(3),c=i(11);a.addListeners({load:function(){o.init([i(22),i(28),i(13),i(23),i(12)])},done:function(){var e=document.createElement("iframe");e.src="about:blank",e.style.display="none",n=i(21),s=i(22),l.environment=JSON.parse(gSTB.GetEnv('{"varList":["hdmi_event_delay"]}')).result,c.authorize(function(){s.route()}),document.body.appendChild(e),window.XMLHttpRequest=e.contentWindow.XMLHttpRequest},keydown:function(e){switch(e.code){case r.volumeDown:case r.volumeUp:case r.mute:n.changeVolume(e.code);break;case 2085:gSTB.GetStandByStatus()?gSTB.StandBy(!1):(gSTB.StandBy(!0),o.navigate("pageMenu"),location.reload());break;case r.exit:window.parent===window?o.navigate("pageService"):window.parent.postMessage("hide","*")}}})},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";function s(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,n.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"+o++,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 n=i(14),a=i(4),o=0;s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.defaultEvents=null,s.prototype.add=function(e){var t;for(t=0;tt;t++)s=e[t],this.ids[s.id]=s,s.active&&(this.current=s);return this.events.init&&this.emit("init",{pages:e}),!0}return!1},s.parse=function(e){var t={name:"",data:[]};return t.data=e.split("/").map(decodeURIComponent),t.name=t.data.shift().slice(1),t},s.stringify=function(e,t){return t=Array.isArray(t)?t:[],e=encodeURIComponent(e),t=t.map(encodeURIComponent),t.unshift(e),t.join("/")},s.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},s.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},s.navigate=function(e,t){var i=this.current,s=this.ids[e];return s&&!s.active?(location.hash=this.stringify(e,t),this.hide(this.current),this.show(s,t),this.events.navigate&&this.emit("navigate",{from:i,to:s}),this.history.push(s),!0):!1},s.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=s},function(e,t,i){"use strict";var s,n,a=i(31),o=i(4),r=i(1),l={};i(33),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),s=new a({debug:!1,host:!0,frame:window!==window.parent,screen:null,time:{init:+new Date,load:0,done:0}}),s.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},s.EVENT_END_OF_FILE=1,s.EVENT_GET_MEDIA_INFO=2,s.EVENT_PLAYBACK_BEGIN=4,s.EVENT_CONTENT_ERROR=5,s.EVENT_DUAL_MONO_DETECT=6,s.EVENT_INFO_GET=7,s.EVENT_SUBTITLE_LOAD_ERROR=8,s.EVENT_SUBTITLE_FIND=9,s.EVENT_HDMI_CONNECT=32,s.EVENT_HDMI_DISCONNECT=33,s.EVENT_RECORD_FINISH_SUCCESSFULL=34,s.EVENT_RECORD_FINISH_ERROR=35,s.EVENT_DVB_SCANING=40,s.EVENT_DVB_FOUND=41,s.EVENT_DVB_CHANELL_EPG_UPDATE=42,s.EVENT_DVB_ANTENNA_OFF=43,s.setScreen(i(37)[screen.height]);for(n in r)"volumeUp"!==n&&"volumeDown"!==n&&(l[r[n]]=!0);s.defaultEvents={load:function(e){s.data.time.load=e.timeStamp,s.events[e.type]&&s.emit(e.type,e),o.pages.forEach(function(t){t.events[e.type]&&t.emit(e.type,e)}),s.data.time.done=+new Date,s.events.done&&s.emit("done",e)},unload:function(e){s.events[e.type]&&s.emit(e.type,e),o.pages.forEach(function(t){t.events[e.type]&&t.emit(e.type,e)})},error:function(e){},keydown:function(e){var t,i=o.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||s.events[e.type]&&s.emit(e.type,e)),s.data.host&&l[e.code]&&e.preventDefault())},keypress:function(e){var t=o.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=o.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(n in s.defaultEvents)window.addEventListener(n,s.defaultEvents[n]);window.stbEvent={},window.stbEvent.onEvent=function(e,t){if(s.events.media){if(t)try{t=JSON.parse(t)}catch(i){}s.emit("media",{code:parseInt(e,10),info:t})}},window.stbEvent.onBroadcastMessage=function(e,t,i){s.events.message&&s.emit("message",{broadcast:!0,windowId:e,message:t,data:i})},window.stbEvent.onMessage=function(e,t,i){s.events.message&&s.emit("message",{broadcast:!1,windowId:e,message:t,data:i})},window.stbEvent.onMount=function(e){s.events["device:mount"]&&s.emit("device:mount",{state:e})},window.stbEvent.onMediaAvailable=function(){s.events["media:available"]&&s.emit("media:available")},window.stbEvent.onNetworkStateChange=function(e){s.events["internet:state"]&&s.emit("internet:state",{state:e})},window.stbEvent.onWebBrowserProgress=function(e){s.events["browser:progress"]&&s.emit("browser:progress",{progress:e})},window.stbEvent.onWindowActivated=function(){s.events["window:focus"]&&s.emit("window:focus")},window.gSTB&&gSTB.SetNativeStringMode&&gSTB.SetNativeStringMode(!0),e.exports=s},function(e,t,i){"use strict";var s={array:[],current:{}},n=i(3),a=i(30);s.loadPlugin=function(e,t){var i=this;return null===e&&n.singleMode.active===!0?(s.current.plugin=a,void t(i.current)):void 0},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},this.active=!1,this.activeComponent=null,e.className="page "+(e.className||""),n.call(this,e),this.active=this.$node.classList.contains("active"),null===this.$node.parentNode&&document.body.appendChild(this.$node),this.page=this}var n=i(2);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},e.className="button "+(e.className||""),n.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 n=i(2),a=i(1);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.clickDuration=200,s.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===a.ok&&this.events.click&&this.emit("click",{event:e})}},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},e.className="modalBox "+(e.className||""),e.$body=document.createElement("div"),e.$body.className="body",n.call(this,e),this.$node.appendChild(document.createElement("div").appendChild(this.$body).parentNode)}var n=i(2);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},e.focusable=e.focusable||!1,e.className="panel "+(e.className||""),n.call(this,e)}var n=i(2);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";var s,n={profile:{},playback:{},token:void 0,favorite:{data:[]}},a=i(3),o=i(24);n.authorize=function(e){var t=gSTB.LoadUserData("ted.com.json");""===t?o.ajax(a.backend.url.authorization,{onload:function(t){var i=JSON.parse(t);200===i.code?(n.token=i.data.sid,gSTB.SaveUserData("ted.com.json",JSON.stringify({tokens:{active:n.token,guest:n.token}})),e(),n.isAuthorize=!0,n.profile.save({playNext:!0,buffer:5})):(n.isAuthorize=!1,e())},onerror:function(){e()},timeout:6e3}):(n.token=JSON.parse(t).tokens.active,n.profile.load(function(){e(),n.isAuthorize=!0}))},n.profile.load=function(e){var t;s=i(21),o.ajax(a.backend.url.profile,{onload:function(i){var n;if(t=JSON.parse(i),null===i.info)return void(e&&e());if(200===t.code){if(a.playNext=t.data.info.playNext,a.bufferSize=t.data.info.buffer,a.appRating=t.data.info.appRating,t.data.info.volume){a.volume=t.data.info.volume;try{s.setValue(a.volume)}catch(o){}}n=Math.floor(768*a.bufferSize*1e3),gSTB.SetBufferSize(1e3*a.bufferSize,n)}e&&e(i)},onerror:function(){e&&e()},method:"GET",headers:{Authorization:n.token},timeout:6e3})},n.profile.save=function(e,t){void 0===e&&(e={playNext:a.playNext,buffer:a.bufferSize,appRating:a.appRating,volume:a.volume}),o.ajax(a.backend.url.profile,{onload:function(e){t&&t()},timeout:6e3,method:"PUT",data:e,headers:{"Content-Type":"application/json",Authorization:n.token}})},n.playback.send=function(e){n.isAuthorize&&o.ajax(a.backend.url.playbackHistory,{method:"POST",timeout:6e3,data:e,headers:{"Content-Type":"application/json",Authorization:n.token},onload:function(e){200===JSON.parse(e).code}})},n.playback.load=function(e){n.isAuthorize&&o.ajax(a.backend.url.playbackHistory,{method:"GET",headers:{Authorization:n.token},timeout:6e3,onload:function(t){var i=JSON.parse(t);200!==i.code||e(i.data)},onerror:function(){}})},n.favorite.send=function(e,t){n.isAuthorize&&o.ajax(a.backend.url.favorite,{method:"POST",data:e,timeout:6e3,headers:{"Content-Type":"application/json",Authorization:n.token},onload:function(e){200===JSON.parse(e).code,t()},onerror:function(){t()}})},n.favorite.load=function(e,t){n.isAuthorize&&o.ajax(a.backend.url.favorite+"?info.categoryId="+e,{method:"GET",headers:{Authorization:n.token},timeout:6e3,onload:function(e){var i=JSON.parse(e);200!==i.code||t(i.data)}})},n.favorite.checkState=function(e,t){return n.isAuthorize?void o.ajax(a.backend.url.favorite+"?info.id="+e,{method:"GET",headers:{Authorization:n.token},timeout:6e3,onload:function(e){var i=JSON.parse(e);200!==i.code?t(null):0!==i.data.length?t(!0,i.data[0].id):t(!1)},onerror:function(){t(null)}}):void t(null)},n.favorite.deleteItem=function(e,t){return n.isAuthorize?void o.ajax(a.backend.url.favorite+"/"+e,{method:"DELETE",headers:{Authorization:n.token},timeout:6e3,onload:function(e){var i=JSON.parse(e);t(200===i.code?!0:!1)},onerror:function(){t(!1)}}):void t(!1)},e.exports=n},function(e,t,i){"use strict";var s,n,a="pageSearch",o=document.getElementById(a),r=i(7),l=new r({$node:o}),c=i(4),u=i(1),d=i(5),p=i(20),h=i(18),m=i(19),g=i(15),w=i(8),f=i(9),v=i(10),y=new f({visible:!1,events:{show:function(){y.okBtn.focus()},hide:function(){n.focus()}}}),b=document.getElementById("pageSearchStory"),T=document.createElement("span");l.addListener("load",function(){b.innerText="Search history ",T.classList.add("searchType"),b.appendChild(T),n=new w({$node:document.getElementById("pageSearchStoryClear"),value:"Clear history"}),l.add(n),n.addListener("keydown",function(e){switch(e.code){case u.up:h.input.focus();break;case u.down:s?s.focus():m.keys.focus()}}),n.addListener("click",function(){y.show()}),h.input.addListener("keydown",function(e){e.code===u.down&&"pageSearch"===c.current.id&&n.focus()}),l.add(y),y.add(y.title=new v),y.title.$body.innerText="Clear search history ?",y.add(y.okBtn=new w({value:"Clear",events:{keydown:function(e){switch(w.prototype.defaultEvents.keydown.call(this,e),e.code){case u.right:y.cancelBtn.focus();break;case u.back:case u.exit:y.hide(),e.stop=!0}},click:function(){p.clearStorage(function(e){e?l.initSearch(l.lastSearchData,function(){n.focus(),y.hide()}):y.hide()})}}})),y.add(y.cancelBtn=new w({value:"Cancel",events:{keydown:function(e){switch(w.prototype.defaultEvents.keydown.call(this,e),e.code){case u.left:y.okBtn.focus();break;case u.back:case u.exit:y.hide(),e.stop=!0}},click:function(){y.hide()}}}))}),l.addListener("show",function(){l.add(m),l.add(h),h.show(),m.show(),m.showBg(0),m.keys.focus(),m.keys.focusItem(m.keys.map[2][5]),m.overflowTop(function(){s?s.focus():n.focus()}),m.button.addListener("keydown",function(e){e.code===u.up&&("pageSearch"===c.current.id?s?(s.focus(),s.focusItem(s.map[4][1])):n.focus():"pageVideoList"===c.current.id&&h.input.focus())})}),l.addListener("keydown",function(e){switch(e.code){case u.back:m.hide(),h.hide(),c.navigate("pageService");break;case u.exit:d.data.frame||(m.hide(),h.hide())}}),l.initSearch=function(e,t){this.lastSearchData=e,p.getData(function(e){var t=e;if(null!==t){if(s)try{s.remove(),s=null}catch(i){}s=new g({data:t,cycleY:!1,render:function(e,t){var i=document.createElement("span");i.innerText=t.value,e.appendChild(i)}}),l.add(s),s.addListener("overflow",function(e){switch(e.direction){case u.up:n.focus();break;case u.down:m.keys.focus()}}),s.addListener("click:item",function(e){h.setValue(e.$item.data.value),m.button.focus()})}else if(s)try{s.remove(),s=null}catch(i){}}),t()},e.exports=l},function(e,t,i){"use strict";function s(e){switch(e.$item.movieObj.type){case x.current.plugin.TYPE_FOLDER:L.push(u),m.initVideoList(k.dataProviderType.TYPE_SERVICE,{item:e.$item.movieObj},function(){});break;case x.current.plugin.TYPE_MOVIE:I.play(a.data,e.$item.x)}}var n,a,o,r,l,c,u,d="pageVideoList",p=document.getElementById(d),h=i(7),m=new h({$node:p}),g=i(4),w=i(1),f=i(5),v=i(10),y=i(15),b=i(16),T=i(8),E=i(9),k=i(3),S=i(27),x=i(6),_=i(12),I=i(23),P=new E({visible:!1,events:{show:function(){P.list.focus(),P.list.focusIndex(0)},hide:function(){l.focus()}}}),D=document.getElementById("pageVideoListBreadCrumb"),L=[];m.addListener("load",function(){n=new v({$node:document.getElementById("pageVideoListHeader")}),o=new v({$node:document.getElementById("pageVideoListContentWrapper")}),m.add(o),o.add(n),r=new T({$node:document.getElementById("pageVideoListButtonSearch"),value:"Sort"}),n.add(r),r.hide(),m.add(P)}),m.initVideoList=function(e,t,i){var l,d=[],p=[];if(u=t,e===k.dataProviderType.TYPE_SERVICE?(c=S,n.show(),breadcrumb[breadcrumb.length-1]!==t.item.title&&window.breadcrumb.push(t.item.title||t.item.author),D.innerText=window.breadcrumb.join(" | ")):e===k.dataProviderType.TYPE_SEARCH&&(c=S,n.show(),breadcrumb[breadcrumb.length-1]!==t.searchText&&(window.breadcrumb.push(t.searchText),D.innerText=window.breadcrumb.join(" | "))),c.state?c.state++:c.state=1,a){try{a.remove()}catch(h){}c.type===k.dataProviderType.TYPE_SERVICE&&window.breadcrumb.splice(1)}r.$body.innerText="Sort",t.item.sortTypes&&t.item.sortTypes.length>0?(P.active=!0,t.item.sortTypes.forEach(function(e){p.push({value:e})}),P.list&&(P.list.remove(),P.list=null),P.list=new b({data:p,size:p.length>5?5:p.length,render:function(e,t){var i=document.createElement("div");e.innerHTML="",i.className="text",i.innerText=t.value.name,e.appendChild(i),e.data.sortObject=t.value},events:{keydown:function(e){b.prototype.defaultEvents.keydown.call(this,e),(e.code===w.exit||e.code===w.back)&&(P.hide(),e.stop=!0)},"click:item":function(e){m.initVideoList(k.dataProviderType.TYPE_SERVICE,{item:u.item,sortType:e.$item.data.value},function(){P.hide(),L[L.length-1]=u,r.$body.innerText=e.$item.data.value.name})}}}),P.add(P.list),r.show()):(P.active=!1,r.hide()),c.getFirst(t,function(e){for(d[0]=e.slice(0,k.movieList.perLine),l=1;3>l;l++)d[l]=e.slice(k.movieList.perLine*l,k.movieList.perLine*l+k.movieList.perLine);a=new y({focusable:!0,data:d,cycleY:!1,render:function(e,t){var i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("div"),a=document.createElement("div"),o=document.createElement("div"),r=document.createElement("div");f.data.metrics.height<720&&t.value.imgSmall&&(t.value.img=t.value.imgSmall),e.ready?(e.img.style.backgroundImage="url("+t.value.img+")",e.txt.innerText=t.value.author||"",e.txt.innerText+=t.value.title||"",e.movieObj=t.value,e.duration.innerText=t.value.duration||"",t.value.profession&&(e.img.classList.add("profession"),e.profession.innerText=t.value.profession),t.value.invisible?(e.classList.add("invisible"),e.data.disable=!0):(e.classList.remove("invisible"),e.data.disable=!1)):(s.classList.add("cover"),s.style.backgroundImage="url("+t.value.img+")",t.value.profession&&(s.classList.add("profession"),o.innerText=t.value.profession),n.className="duration",n.innerText=t.value.duration||"",i.className="movieItem",a.className="movieDescription",r.className="name",r.innerText=t.value.author||"",r.innerText+=t.value.title||"",o.classList.add("speakerProf"),i.appendChild(o),i.appendChild(s),s.appendChild(n),a.appendChild(r),i.appendChild(a),e.appendChild(i),t.value.invisible&&e.classList.add("invisible"),e.img=s,e.duration=n,e.txt=r,e.profession=o,e.ready=!0,e.movieObj=t.value)},events:{keydown:function(e){switch(e.code){case w.right:case w.left:this.move(e.code);break;case w.ok:void 0!==this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:e});break;case w.down:m.nextData();break;case w.up:m.prevData()}},"click:item":s}}),o.add(a),m.videoList=a,i(),a.focus(),a.map[1][2]&&!a.map[1][2].data.disable&&5===k.movieList.perLine?a.focusItem(a.map[1][2]):a.focusItem(a.map[1][0])})},m.nextData=function(){var e,t,i=c.getNext();if(null!==i){for(a.data[0]=a.data[1],a.data[1]=a.data[2],a.data[2]=i,i=a.data,e=0;3>e;e++)for(t=0;te;e++)for(t=0;t0&&r.show()}),m.addListener("hide",function(){n.hide(),r.hide()}),m.addListener("keydown",function(e){switch(e.code){case w.back:L.length>0?(breadcrumb.pop(),m.initVideoList(k.dataProviderType.TYPE_SERVICE,L.pop(),function(){})):c.type===k.dataProviderType.TYPE_SEARCH?(g.navigate("pageSearch"),_.initSearch(_.lastSearchData,function(){g.navigate("pageSearch")})):c.type===k.dataProviderType.TYPE_SERVICE&&g.navigate("pageService");break;case w.exit:break;case w.f1:P.active&&(l=g.current.activeComponent,P.show())}}),e.exports=m},function(e,t,i){"use strict";function s(){this.events={}}s.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 s(n){t(n),i.removeListener(e,s)})},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,s=this.events[e];if(s)for(i=0;io;o++){for(e.lengthr;r++)e[o].length0?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})}}},s.prototype.init=function(e){var t,i,s,a,r,l,c,u=this,d=!1,p=function(e){this.data.disable!==!0&&(u.focusItem(this),u.events["click:item"]&&u.emit("click:item",{$item:this,event:e}))};if(void 0!==e.cycleX&&(this.cycleX=e.cycleX),void 0!==e.cycleY&&(this.cycleY=e.cycleY),e.data&&this.data!==e.data&&(this.data=e.data,d=!0),e.render&&this.renderItem!==e.render&&(this.renderItem=e.render,d=!0),d){for(this.$table=document.createElement("table"),r=document.createElement("tbody"),this.data=n(this.data),t=0;t0?i--:this.cycleY?(i=this.map.length-1,a=!0):n=!0;break;case l.down:i0?t--:this.cycleX?(t=this.map[i].length-1,a=!0):n=!0}t===this.focusX&&i===this.focusY&&(s=!1),this.map[i][t]!==this.map[this.focusY][this.focusX]&&this.map[i][t].data.disable!==!0&&(s=!1),n&&(s=!1,this.map[i][t].data.disable===!0&&(t=this.focusX,i=this.focusY))}a&&this.events.cycle&&this.emit("cycle",{direction:e}),n&&this.events.overflow&&this.emit("overflow",{direction:e}),this.focusItem(this.map[i][t]),this.focusX=t,this.focusY=i},s.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},s.prototype.markItem=function(e,t){t?e.classList.add("mark"):e.classList.remove("mark"),e.data.mark=t},e.exports=s},function(e,t,i){"use strict";function s(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"),a.call(this,e),this.init(e)}function n(e){var t,i;for(t=0;t0?o.up:o.down),this.type===this.TYPE_HORIZONTAL&&e.wheelDeltaX&&this.move(e.wheelDeltaX>0?o.left:o.right)},keydown:function(e){switch(e.code){case o.up:case o.down:case o.right:case o.left:case o.pageUp:case o.pageDown:case o.home:case o.end:this.move(e.code);break;case o.ok:this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:e})}}},s.prototype.init=function(e){var t,i,s=this,a=this.$body.children.length,o=function(e){this.data&&(s.focusItem(this),s.events["click:item"]&&s.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=n(e.data)),e.render&&(this.renderItem=e.render),e.size&&(this.size=e.size),this.size!==a)for(a>0&&(this.$body.innerText=null),i=0;i0?this.$focusItem===this.$body.firstChild?this.renderView(this.viewIndex-1):this.focusItem(this.$focusItem.previousSibling):this.cycle?(this.move(o.end),this.events.cycle&&this.emit("cycle",{direction:e})):this.events.overflow&&this.emit("overflow",{direction:e})),(e===o.down&&this.type===this.TYPE_VERTICAL||e===o.right&&this.type===this.TYPE_HORIZONTAL)&&(this.$focusItem&&this.$focusItem.indexthis.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===o.home&&(this.renderView(0),this.focusItem(this.$body.firstChild)),e===o.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]))},s.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},s.prototype.focusIndex=function(e){var t=this.viewIndex||0;e>=t+this.size?(e=ee?(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]))},s.prototype.markItem=function(e,t){t?e.classList.add("mark"):e.classList.remove("mark"),e.data.mark=t},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},e.focusable=e.focusable||!1,e.visible=e.visible||!1,e.className="widget "+(e.className||""),n.call(this,e)}var n=i(2);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";var s="inputWidgetWrapper",n=document.getElementById(s),a=i(17),o=new a({$node:n,visible:!1,focusable:!0}),r=i(1),l=i(34),c=new l({
+$node:document.getElementById("inputWidget")});o.add(c),o.$node.classList.remove("invisible"),o.addChar=function(e){c.addChar(e)},o.removeChar=function(){c.removeChar()},o.getValue=function(){return c.value},o.setValue=function(e){c.setValue(e),setTimeout(function(){c.setValue(e)},0)},o.delChar=function(){c.removeChar(c.value.length-1)},o.input=c,c.addListener("keydown",function(e){var t;e.code===r.ok&&c.value.length>0?(t=i(19),t.button.focus()):e.code===r.back&&(e.stop=!0)}),o.overflowBot=function(e){c.addListener("keydown",function(t){t.code===r.down&&e()})},e.exports=o},function(e,t,i){"use strict";var s,n="keyboardWidgetWrapper",a=document.getElementById(n),o=i(17),r=new o({$node:a,visible:!1,focusable:!0}),l=i(1),c=i(5),u=i(4),d=i(15),p=i(8),h=i(3),m=i(36),g=i(18),w=i(20),f=i(6),v=new d({$node:document.getElementById("keyboardWidget"),data:m.en,cycleY:!1,cycleX:!1,render:function(e,t){var i,s=document.createElement("div");s.classList.add("keyboardButton"),t.id&&(e.id=t.id),s.innerText=t.value,e.appendChild(s),t.img&&(i=document.createElement("img"),i.src="./img/"+c.data.metrics.height+"/"+t.img+".png",s.appendChild(i))}}),y=new p({$node:document.getElementById("keyboardWidgetSearchBtn"),value:"Search"});r.$node.classList.remove("invisible"),r.add(v),r.add(y),r.isUpper=!1,r.lang="en",v.addListener("overflow",function(e){switch(e.direction){case l.right:y.focus()}}),v.addListener("click:item",function(e){if(g.visible)if(e.$item.data.id)switch(e.$item.data.id){case"keyUp":r.upper();break;case"keyBackspace":g.delChar();break;case"keySpace":g.addChar(" ");break;case"keyLeft":g.input.emit("keydown",{code:l.left});break;case"keyRight":g.input.emit("keydown",{code:l.right});break;case"keyLang":r.changeLang()}else r.isUpper?g.addChar(e.$item.data.value.toString().toUpperCase()):g.addChar(e.$item.data.value.toString())}),v.addListener("keydown",function(e){switch(e.code){case 112:e.stop=!0,g.delChar();break;case 115:y.emit("click",{});break;case 114:break;case 113:g.addChar(" ")}}),y.addListener("keydown",function(e){switch(e.code){case l.left:v.focus()}}),r.setSearchObj=function(){},y.addListener("click",function(){s=i(13),g.visible&&g.getValue().length>0&&s.initVideoList(h.dataProviderType.TYPE_SEARCH,{item:f.current.plugin.root,searchText:g.getValue()},function(){r.hide(),g.hide(),y.blur(),u.navigate("pageVideoList"),w.add(g.getValue())})}),r.upper=function(){this.isUpper?(this.isUpper=!1,this.$node.classList.remove("upperCase")):(this.isUpper=!0,this.$node.classList.add("upperCase"))},r.overflowTop=function(e){var t=u.current.id;v.addListener("overflow",function(i){i.direction===l.up&&u.current.id===t&&e()})},r.changeLang=function(){"ru"===r.lang?(v.init({data:m.en}),r.lang="en"):(v.init({data:m.ru}),r.lang="ru"),v.focusItem(v.map[2][5])},r.showBg=function(e){1===e?r.$node.classList.add("background"):0===e&&r.$node.classList.remove("background")},r.button=y,r.keys=v,e.exports=r},function(e,t,i){"use strict";var s={},n=[],a=i(3),o=i(11),r=i(24);s.getData=function(e){var t,i,s=[];n=[],o.isAuthorize?r.ajax(a.backend.url.searchHistory,{method:"GET",headers:{Authorization:o.token},timeout:6e3,onload:function(a){var o,r=JSON.parse(a).data;if(r.forEach(function(e){n.push(e.info)}),n.length>0){for(n.length%2!==0&&n.push({value:"",disable:!0}),i=n.length/2,s[0]=[],s[0].push(n[0]),s[0].push(n[i]),t=1;i>t;t++)s[t]=[],s[t].push(n[t]),o=t+parseFloat(i),s[t].push(n[o]);e(s)}else e(null)}}):e(null)},s.clearStorage=function(e){n=[],r.ajax(a.backend.url.searchHistory,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:o.token},timeout:6e3,onload:function(t){var i=JSON.parse(t);e(200===i.code?!0:!1)},onerror:function(){e(!1)}})},s.removeLast=function(){n.pop()},s.add=function(e){n.length&&e===n[0].value||(n.pop(),n.unshift({value:e}),e&&r.ajax(a.backend.url.searchHistory,{method:"POST",headers:{"Content-Type":"application/json",Authorization:o.token},data:{value:e},timeout:6e3,onload:function(){}}))},e.exports=s},function(e,t,i){"use strict";function s(){u.isMuted&&(gSTB.SetMute(0),u.isMuted=!1,g.classList.remove("muted")),m>=v&&(m-=v,g.innerText=m.toString(),0!==m&&m-v>0?w.innerText=(m-v).toString():w.innerText="",f.innerText=(m+v).toString(),gSTB.SetVolume(m))}function n(){u.isMuted&&(gSTB.SetMute(0),u.isMuted=!1,g.classList.remove("muted")),100>=m+v&&(m+=v,g.innerText=m.toString(),100!==m?f.innerText=(m+v).toString():f.innerText="",gSTB.SetVolume(m),w.innerText=(m-v).toString())}function a(){u.isMuted?(gSTB.SetMute(0),u.isMuted=!1,g.classList.remove("muted")):(gSTB.SetMute(1),u.isMuted=!0,g.classList.add("muted"))}var o,r="volumeWidget",l=document.getElementById(r),c=i(17),u=new c({$node:l,visible:!1,focusable:!0}),d=i(1),p=i(3),h=i(11),m=p.volume,g=document.getElementById("volumeCurrentValue"),w=document.getElementById("volumeBotValue"),f=document.getElementById("volumeTopValue"),v=10;gSTB.SetVolume(m),g.innerText=m.toString(),100-v>=m&&(f.innerText=(m+v).toString()),m>=v?w.innerText=(m-v).toString():w.innerText="0",u.isMuted=Boolean(gSTB.GetMute()),u.$node.classList.remove("invisible"),u.changeVolume=function(e){switch(e){case d.volumeDown:s();break;case d.volumeUp:n();break;case d.mute:a()}this.display(2),p.volume=m,h.profile.save()},u.display=function(e){u.visible&&clearTimeout(o),void 0!==e&&(o=setTimeout(function(){u.hide()},1e3*e)),this.show()},u.setValue=function(e){0>e||e>100||(m=e,g.innerText=m.toString(),0!==m&&m-v>0?w.innerText=(m-v).toString():w.innerText="",100!==m?f.innerText=(m+v).toString():f.innerText="")},e.exports=u},function(e,t,i){"use strict";var s="pageInit",n=i(7),a=new n({$node:document.getElementById(s)}),o=i(5),r=i(4),l=i(3);a.route=function(){switch(o.data.metrics.height){case 1080:l.movieList.perLine=4;break;case 720:l.movieList.perLine=3;break;case 576:case 480:l.movieList.perLine=2}r.navigate("pageService")},e.exports=a},function(e,t,i){"use strict";var s,n,a,o="pagePlayer",r=document.getElementById(o),l=i(7),c=new l({$node:r}),u=i(4),d=i(1),p=i(5),h=i(25),m=i(32),g=i(16),w=i(35),f=i(9),v=i(6),y=!1,b=new w({$node:document.getElementById("playerProgressBar")}),T=new f({visible:!1,events:{show:function(){T.list.focus(),T.list.focusIndex(0)},hide:function(){a.focus()}}}),E={current:0,list:[],currentMedia:{}},k={aspects:{fit:"Original",big:"Big",opt:"Optimal",exp:"Zoom"}},S=document.getElementById("playerTitle"),x=document.getElementById("playerTotalDuration"),_=document.getElementById("playerCurrentDuration"),I={author:document.getElementById("playerAuthor")},P=document.getElementById("playerButtonPlay"),D=document.getElementById("playerHD"),L=document.getElementById("playerAspect");c.play=function(e,t){var i;E.list=e,E.current=t,s=v.current.plugin,i=E.list[1][E.current].value,b.set(0),S.innerHTML=i.title,x.innerText="00:00",_.innerText="00:00",I.author.innerText=i.author||"",P.className="icon-pause2",D.innerText="Subtitles: No",s.getCursor({item:i},function(e,t){s.getNext(t,function(e,t){var i=[];t=t[0],T.list&&(T.list.remove(),T.list=void 0),a.currentSubtitle="No subtitle",t.subtitledDownloads&&Object.keys(t.subtitledDownloads).length>0&&(i.push({value:{name:"No subtitle",url:t.resources.h264[0].file},type:0}),Object.keys(t.subtitledDownloads).forEach(function(e){i.push({value:t.subtitledDownloads[e],type:1})}),T.list=new g({data:i,size:i.length>5?5:i.length,render:function(e,t){var i=document.createElement("div");e.innerHTML="",i.className="text",i.innerText=t.value.name,e.appendChild(i),e.data.subtitle=t.value},events:{keydown:function(e){g.prototype.defaultEvents.keydown.call(this,e),(e.code===d.back||e.code===d.exit)&&(T.hide(),e.stop=!0)},"click:item":function(e){return e.$item.data.value.name===a.currentSubtitle?void T.hide():(1===e.$item.data.type?(a.play(e.$item.data.value.high,{position:a.currentSec}),D.innerText="Subtitles: "+e.$item.data.value.name):0===e.$item.data.type&&(a.play(e.$item.data.value.url,{position:a.currentSec}),D.innerText="Subtitles: No"),P.className="icon-pause2",y=!0,void T.hide())}}}),T.add(T.list)),a.play(t.resources.h264[0].file)})}),u.navigate("pagePlayer")},c.addListener("load",function(){a=new m({$node:document.getElementById("tedPlayer"),rewindTimeout:600,events:{keydown:function(e){switch(e.code){case d.info:return void n.display();case d.ok:case d.playPause:this.playPause();break;case d.stop:this.stop();break;case d.forward:case d.right:this.rewind(!0);break;case d.rewind:case d.left:this.rewind(!1);break;case d.f2:T.show();break;case d.f4:case 117:this.nextAspect()}n.display(5)}}}),n=new h({$node:document.getElementById("playerPanel")}),c.add(a),a.add(n),L.innerText="Aspect: Original",a.addListeners({duration:function(e){this.rewindHelper.isActive||this.setModeHelper.active||y||(b.set(e.sec),_.innerText=e.time)},"get:info":function(e){x.innerText=e.totalDuration,b.init({value:0,max:e.totalDurationSec}),n.display(5)},rewind:function(e){var t=a.parseTime(e.time),i="";b.set(e.time),+t.hour&&(i+=t.hour+":"),i+=t.min+":"+t.sec,_.innerText=i},"aspect:change":function(e){L.innerText="Aspect:"+k.aspects[e.name]},"content:end":function(){u.back()},"content:error":function(){u.back()},pause:function(e){e.state?P.className="icon-play3":P.className="icon-pause2"}}),p.addListener("media",function(e){e.code===p.EVENT_PLAYBACK_BEGIN&&y&&(y=!1)}),c.add(T)}),c.addListener("show",function(){a.focus()}),c.addListener("keydown",function(e){switch(e.code){case d.back:a.stop(),u.navigate("pageVideoList");break;case d.stop:a.stop(),u.navigate("pageVideoList");break;case d.exit:a.stop(),window.parent!==window&&u.navigate("pageVideoList")}}),c.addListener("hide",function(){}),e.exports=c},function(e,t,i){"use strict";var s={},n={method:"GET",async:!0,headers:{},type:"text",data:null,timeout:3e4,onload:null,onerror:null,ontimeout:null},a=Object.keys(n);s.ajax=function(e,t){var i,s,o;if(t=t||{},e&&("string"==typeof e||e instanceof String)&&e.length>0){if(t&&"object"==typeof t)for(i=0;i0)return s.join("&")}return null},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},n.call(this,e),this.displayTimeout=0,this.attach=!1,this.$node.classList.add("playerPanel")}var n=i(10);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.display=function(e){var t=this;if(e){if(this.attach)return;e=1e3*e,this.show(),this.displayTimeout&&(clearTimeout(this.displayTimeout),this.displayTimeout=0),this.displayTimeout=setTimeout(function(){t.hide(),t.displayTimeout=0},e)}else this.displayTimeout?(clearTimeout(this.displayTimeout),this.displayTimeout=0):this.attach?(this.hide(),this.attach=!1):(this.show(),this.attach=!0)},e.exports=s},function(e,t){"use strict";function i(){this.type=null,this.page=1,this.cache={data:[],head:null,tail:null}}i.prototype.getFirst=function(){},i.prototype.getNext=function(){},i.prototype.getPrev=function(){},e.exports=i},function(e,t,i){"use strict";var s,n,a,o,r,l,c=i(26),u=new c,d=i(3),p=i(6),h=30,m=40;u.getFirst=function(e,t){var i=this,c=[];for(s=d.movieList.perLine,i.page=1,i.type=d.dataProviderType.TYPE_SERVICE,i.cache.tail=0,i.cache.head=0,i.cache.data=[],n=p.current.plugin,r=0,i.cache.botEmptyLine=!1,l=0;s>l;l++)i.cache.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disabled:!0});i.cache.topEmptyLine=!0,e.searchText&&(i.type=d.dataProviderType.TYPE_SEARCH),n.getCursor(e,function(r,l){a=l,n.getCursor(e,function(e,t){o=t}),n.getNext(a,function(e,n){e||(n.forEach(function(e){i.cache.data.push({value:e})}),i.cache.data.length>=3*s?(c=i.cache.data.slice(0,3*s),i.cache.head=3*s,t(c),i.cache.checkNext()):i.cache.checkNext(function(){c=i.cache.data.slice(0,3*s),i.cache.head=3*s,t(c)}))})})},u.cache.checkNext=function(e){var t=this,i=u.state;t.botEmptyLine||(t.data.length0){if(u.state&&i!==u.state)return!1;a.forEach(function(e){t.data.push({value:e})}),t.data.length>=3*s&&e?e():t.checkNext(e)}else{for(l=0;ll;l++)t.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disabled:!0});r+=s,t.botEmptyLine=!0,e&&e()}}),t.tail>=m+3*s&&n.getNext(o,function(e,i){var n,a;if(e);else{for(a=i.length,t.topEmptyLine&&(a+=s,t.topEmptyLine=!1),n=0;a>n;n++)t.data.shift();t.head-=a,t.tail-=a}}))},u.cache.checkPrev=function(){var e=this;e.topEmptyLine||(e.tail0){for(l=i.length-1;l>=0;l--)e.data.unshift({value:i[l]});e.head+=i.length,e.tail+=i.length}else if(!e.topEmptyLine){for(l=0;s>l;l++)e.data.unshift({value:{date:"",img:"",title:"",url:"",invisible:!0},disabled:!0});e.head+=s,e.tail+=s,e.topEmptyLine=!0}}),e.data.length-e.head>h&&n.getPrev(a,function(t,i){var s;s=i.length,e.botEmptyLine&&(s+=r,e.botEmptyLine=!1),e.data.splice(e.data.length-s,s)}))},u.getNext=function(){var e=this,t=[];if(e.cache.head+s<=e.cache.data.length)t=e.cache.data.slice(e.cache.head,e.cache.head+s),e.cache.head+=s,e.cache.tail+=s,this.page++,e.cache.checkNext();else if(1===e.page&&e.cache.data.length%s!==0){for(l=0;l=0?(t=e.cache.data.slice(e.cache.tail-s,e.cache.tail),e.cache.head-=s,e.cache.tail-=s,this.page--,e.cache.checkPrev()):t=null,t},e.exports=u},function(e,t,i){"use strict";function s(e){switch(e.$item.data.value.type){case I.TYPE_CATEGORY:E.initVideoList(b.dataProviderType.TYPE_SERVICE,{item:e.$item.data.value},function(){m.navigate("pageVideoList")});break;case I.TYPE_FOLDER:n(e.$item.data.value);break;case D.TYPE_BACK:a();break;case D.TYPE_SEARCH:k.initSearch({url:e.$item.data.value.url},function(){m.navigate("pageSearch")})}}function n(e){P.push(e),I.getCursor({item:e},function(e,t){I.getNext(t,function(e,t){var i=[];0!==t.length&&(i.push(L.back),t.forEach(function(e){i.push({value:e})}),l.viewIndex=-1,l.init({data:i,size:i.length}),l.$body.children[1]?l.focusItem(l.$body.children[1]):l.focusItem(l.$body.children[0]))})})}function a(){1===P.length?window.parent.postMessage("hide","*"):2===P.length?h.initService(null,function(){l.focus()}):(P.pop(),I.getCursor({item:P[P.length-1]},function(e,t){var i=[];I.getNext(t,function(e,t){0!==P.length&&i.push(L.back),t.forEach(function(e){i.push({value:e})}),l.viewIndex=-1,l.init({data:i,size:i.length}),l.focusItem(l.$body.children[0])})}))}var o,r,l,c,u="pageService",d=document.getElementById(u),p=i(7),h=new p({$node:d}),m=i(4),g=i(1),w=(i(5),i(10)),f=i(16),v=i(9),y=i(8),b=i(3),T=i(6),E=i(13),k=i(12),S=new v({visible:!1,events:{show:function(){S.okBtn.focus()},hide:function(){c.focus()}}}),x=document.getElementById("pageServiceCatImg"),_=document.getElementById("pageServiceLogo"),I={},P=[],D={TYPE_BACK:20,TYPE_SEARCH_LIST:12,TYPE_SEARCH:13},L={back:{value:{title:"Back",specialClass:"backItem",type:D.TYPE_BACK}},searchArr:[]},B=[];h.addListener("load",function(){o=new w({focusable:!1,$node:document.getElementById("pageServiceWrapper")}),h.add(o),r=new w({$node:document.getElementById("pageServiceRightPanel")}),o.add(r),h.initService(null,function(){}),h.add(S),S.add(S.title=new w),S.title.$body.innerText="Are you sure you want to exit?",S.add(S.okBtn=new y({value:"Exit",events:{keydown:function(e){switch(y.prototype.defaultEvents.keydown.call(this,e),e.code){case g.right:S.cancelBtn.focus();break;case g.back:case g.exit:S.hide(),e.stop=!0}},click:function(){window.location.href=i(39)()||"file:///home/web/services.html"}}})),S.add(S.cancelBtn=new y({value:"Cancel",events:{keydown:function(e){switch(y.prototype.defaultEvents.keydown.call(this,e),e.code){case g.left:S.okBtn.focus();break;case g.back:case g.exit:S.hide(),e.stop=!0}},click:function(){S.hide()}}}))}),h.addListener("show",function(){try{l.focus(),l.focusItem(l.$focusItem)}catch(e){}window.breadcrumb=[]}),h.initService=function(e,t,i){var n=document.getElementById("pageServiceDescription");_.classList.add("logo"),B=[],n.innerText="TED is a platform for ideas worth spreading. Started in 1984 as a conference where technology, entertainment and design converged, TED today shares ideas from a broad spectrum — from science to business to global issues — in more than 100 languages. Meanwhile, independent TEDx events help share ideas in communities around the world.",T.loadPlugin(e,function(){I=T.current.plugin,I.info={serviceId:e},P=[I.root],window.breadcrumb=[],I.getCursor({item:I.root},function(e,n){e&&i(),I.getNext(n,function(e,i){i.forEach(function(e){var t={};t.value=e,B.push(t)}),I.root.searchable&&B.unshift({value:{title:"Search",type:D.TYPE_SEARCH,img:"1_Search.png"}}),l&&l.remove(),l=new f({data:B,size:B.length,render:function(e,t){var i=document.createElement("div"),s=document.createElement("div");e.innerHTML="",s.className="text",i.className="wrapper",s.innerText=t.value.title,t.value.specialClass?i.classList.add(t.value.specialClass):i.className="wrapper",t.value.searchType&&(e.data.value.searchType=t.value.searchType),i.appendChild(s),e.appendChild(i)}}),r.add(l),l.addListeners({"click:item":s,"focus:item":function(e){l.$node.style.top=h.$node.offsetHeight/2-l.$focusItem.index*l.$focusItem.offsetHeight-l.$focusItem.offsetHeight/2+"px",e.$curr.data.value.img&&(x.src="./img/icons/"+e.$curr.data.value.img)}}),l.$node.style.top=h.$node.offsetHeight/2-l.$node.firstChild.offsetHeight/2+"px",l.focus(),l.focusIndex(0),t()})})})},h.addListener("keydown",function(e){switch(e.code){case g.back:a();break;case g.exit:e.stop=!0,window.parent===window?P.length>1?h.initService(null,function(){l.focus()}):(c=m.current.activeComponent,S.show()):window.parent.postMessage("hide","*")}}),e.exports=h},function(e,t){"use strict";e.exports={main:[{title:"Themes",url:"themes",img:"2_Themes.png",type:3,system:{type:2}},{title:"Speakers",url:"http://www.ted.com/people/speakers?page=%n&per_page=30&sort=last",img:"3_Speakers.png",type:2,sortTypes:[{name:"last name",url:"http://www.ted.com/people/speakers?page=%n&per_page=30&sort=last"},{name:"first name",url:"http://www.ted.com/people/speakers?page=%n&per_page=30&sort=first"},{name:"Most recent",url:"http://www.ted.com/people/speakers?page=%n&per_page=30&sort=tals"}],system:{type:5}},{title:"Events",url:"http://www.ted.com/talks/events",img:"4_Evenrs.png",type:3,system:{type:8}},{title:"Languages",url:"lang",img:"5_Languages.png",type:3,system:{type:2}}],themes:[{title:"Technology",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=technology",img:"1Technology.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=technology"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=technology"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=technology"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=technology"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=technology"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=technology"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=technology"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=technology"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=technology"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=technology"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=technology"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=technology"}]},{title:"Entertainment",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=entertainment",img:"2Entertaiment.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=entertainment"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=entertainment"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=entertainment"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=entertainment"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=entertainment"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=entertainment"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=entertainment"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=entertainment"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=entertainment"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=entertainment"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=entertainment"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=entertainment"}]},{title:"Design",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=design",img:"3Design.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=design"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=design"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=design"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=design"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=design"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=design"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=design"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=design"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=design"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=design"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=design"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=design"}]},{title:"Business",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=business",img:"4Business.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=business"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=business"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=business"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=business"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=business"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=business"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=business"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=business"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=business"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=business"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=business"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=business"}]},{title:"Science",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=science",img:"5Science.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=science"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=science"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=science"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=science"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=science"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=science"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=science"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=science"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=science"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=science"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=science"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=science"}]},{title:"Global issues",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=global+issues",img:"6Globalissues.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=global+issues"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=global+issues"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=global+issues"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=global+issues"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=global+issues"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=global+issues"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=global+issues"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=global+issues"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=global+issues"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=global+issues"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=global+issues"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=global+issues"}]},{title:"All themes",url:"allThemes",img:"2_Themes.png",type:3,system:{type:2}}],lang:[{title:"English",url:"http://www.ted.com/talks?page=%n&language=en&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=en&sort=newest"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=en&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=en&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=en&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=en&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=en&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=en&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=en&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=en&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=en&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=en&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=en&sort=informative"}]},{title:"EspaГ±ol",url:"http://www.ted.com/talks?page=%n&language=es&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=es&sort=newest"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=es&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=es&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=es&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=es&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=es&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=es&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=es&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=es&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=es&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=es&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=es&sort=informative"}]},{title:"German",url:"http://www.ted.com/talks?page=%n&language=de&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=de&sort=newest"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=de&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=de&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=de&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=de&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=de&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=de&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=de&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=de&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=de&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=de&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=de&sort=informative"}]},{title:"Russian",url:"http://www.ted.com/talks?page=%n&language=ru&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=ru&sort=newest"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=ru&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=ru&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=ru&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=ru&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=ru&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=ru&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=ru&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=ru&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=ru&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=ru&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=ru&sort=informative"}]},{title:"Turkish",url:"http://www.ted.com/talks?page=%n&language=tr&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=tr&sort=newest"
+},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=tr&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=tr&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=tr&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=tr&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=tr&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=tr&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=tr&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=tr&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=tr&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=tr&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=tr&sort=informative"}]},{title:"Ukrainian",url:"http://www.ted.com/talks?page=%n&language=uk&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=uk&sort=newest"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=uk&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=uk&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=uk&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=uk&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=uk&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=uk&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=uk&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=uk&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=uk&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=uk&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=uk&sort=informative"}]}],allThemes:[{title:"A-B",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["A","B"]}},{title:"C",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["C"]}},{title:"D-E",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["D","E"]}},{title:"F-H",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["F","G","H"]}},{title:"I-L",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["I","J","K","L"]}},{title:"M-N",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["M","N"]}},{title:"O-R",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["O","P","Q","R"]}},{title:"S",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["S"]}},{title:"T-Z",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["T","U","V","W","X","Y","Z"]}}]}},function(e,t,i){"use strict";function s(e,t,i,s){var n=new XMLHttpRequest;return"callback"===s?(i(),!0):(n.onreadystatechange=function(){var e;4===n.readyState&&(e="xml"===s?n.responseXML:"json"===s?JSON.parse(n.responseText):n.responseText,i(e,n.status))},n.open(e,t,!0),"json"===s&&n.setRequestHeader("Accept","application/json"),n.send(),n)}var n={TYPE_ROOT:1,TYPE_CATEGORY:2,TYPE_FOLDER:3,TYPE_MOVIE:4,TYPE_FILE:5},a={TYPE_ROOT:1,TYPE_MENU_LIST:2,TYPE_THEME:3,TYPE_THEME_LIST:4,TYPE_SPEAKERS_LIST:5,TYPE_VIDEO:6,TYPE_SPEAKER:7,TYPE_EVENT_LIST:8,TYPE_EVENT_SUB_LIST:9,TYPE_SEARCH:10},o=i(29);n.root={title:"ted.com",url:"https://ted.com",img:"",type:n.TYPE_ROOT,system:{type:a.TYPE_ROOT,search:[]},searchable:!0},n.getNext=function(e,t){var i,r,l,c=this;switch(e.page++,e.system.type){case a.TYPE_ROOT:if(l="callback",e.page>0)return void t(!1,[]);r=function(){t(!1,o.main)};break;case a.TYPE_MENU_LIST:if(l="callback",e.page>0)return void t(!1,[]);r=function(){t(!1,o[e.url])};break;case a.TYPE_THEME_LIST:i=e.url,r=function(i){var s,n,o,r=!1,l=[];if(i=i.split("")[1],void 0===i&&e.page>0)return void t(r,[]);for(i=i.split("class='topics__list__topic'"),s=1;s")),-1!==e.system.letters.indexOf(n[0])&&l.push({title:n,url:o,system:{type:a.TYPE_THEME},type:2});t(r,l)};break;case a.TYPE_THEME:i=e.url.replace("%n",e.page+1),r=function(i){var s,o,r,l,c,u,d=!1,p=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(d,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"')).replace("&","&"),c=i[s].split("talk-link__speaker'>")[1],c=c.substring(0,c.indexOf("')[1],u=u.substring(0,u.indexOf("")),r=i[s].split("class='media__message'")[1].split("href=")[1],r="http://www.ted.com"+r.substring(1,r.indexOf("'>")),p.push({title:o,img:l,author:c,duration:u,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_SPEAKERS_LIST:i=e.url.replace("%n",e.page+1),r=function(i){var s,n,o,r,l,u=!1,d=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")),o=i[s].split("")[1].split("")[1],r=r.substring(0,r.indexOf("
"," ").replace("\n",""),l=i[s].split("")[1],l=l.substring(l.indexOf("")+8,l.indexOf("")),d.push({img:o,url:"http://www.ted.com"+n,author:r,profession:l,type:c.TYPE_FOLDER,system:{type:a.TYPE_SPEAKER}});t(u,d)};break;case a.TYPE_SPEAKER:i=e.url,r=function(i){var s,n,o,r,l,u,d=!1,p=[];if((u=i.split("
")[1])&&(u=u.substring(0,u.indexOf("’"))),i=i.split("")[1],void 0===i||e.page>0)return void t(d,[]);for(i=i.split(""),s=1;s')[1],l=l.substring(0,l.indexOf("")),n=i[s].split("href='")[1],n="http://www.ted.com"+n.substring(0,n.indexOf("'>")),r=i[s].split("")[1],r=r.substring(r.indexOf(">")+1,r.indexOf("")),p.push({img:o,url:n,duration:l,title:r,type:c.TYPE_MOVIE,author:u,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_EVENT_LIST:if(l="json",i=e.url,e.page>0)return void t(!1,[]);r=function(i){var s=[],o=[];i.forEach(function(t){-1===o.indexOf(t.year)&&(o.push(t.year),s.push({title:t.year,url:e.url+"/"+t.year,type:n.TYPE_FOLDER,system:{type:a.TYPE_EVENT_SUB_LIST}}))}),t(!1,s)};break;case a.TYPE_EVENT_SUB_LIST:if(l="json",i="http://www.ted.com/talks/events",e.page>0)return void t(!1,[]);r=function(i){var s=[],o=e.url.substring(e.url.lastIndexOf("/")+1);i.forEach(function(e){e.year===o&&s.push({title:e.label,url:"http://www.ted.com/talks?event="+e.value+"&page=%n&sort=newest",type:n.TYPE_CATEGORY,system:{type:a.TYPE_THEME}})}),t(!1,s)};break;case a.TYPE_VIDEO:if(i=e.url,e.page>0)return void t(!1,[]);r=function(e){var i;if(e=e.split('"talkPage.init",')[1],void 0===e)return void t(!0,[]);e=e.substring(0,e.indexOf(")"));try{i=JSON.parse(e)}catch(s){return void t(!0,[])}t(!1,[i.talks[0]])};break;case a.TYPE_SEARCH:i=e.url.replace("%n",e.page+1),r=function(i){var s,o,r,l,c,u=!1,d=[];if(i=i.split("")[1].split("")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),c=o.substr(0,o.indexOf(":")),o=o.substring(o.indexOf(":")+2),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"'))+"quality=89&w=320",r=i[s].split('')),d.push({title:o,img:l,author:c,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(u,d)}}r?s("GET",i,r,l):t(!1,{})},n.getPrev=function(e,t){var i,o,r,l=this;if(e.page<0)return void t(!1,[]);switch(e.system.type){case a.TYPE_ROOT:if(r="json",i="http://192.168.1.53:8033/main.json",e.page>0)return void t(!1,[]);o=function(e){e?t(!1,e):t(!0,[])};break;case a.TYPE_MENU_LIST:if(r="json",i=e.url,e.page>0)return void t(!1,[]);o=function(e){e?t(!1,e):t(!0,[])};break;case a.TYPE_THEME_LIST:i=e.url,o=function(i){var s,n,o,r=!1,l=[];if(i=i.split("")[1],void 0===i&&e.page>0)return void t(r,[]);for(i=i.split("class='topics__list__topic'"),s=1;s")),-1!==e.system.letters.indexOf(n[0])&&l.push({title:n,url:o,system:{type:a.TYPE_THEME},type:2});t(r,l)};break;case a.TYPE_THEME:i=e.url.replace("%n",e.page+1),o=function(i){var s,o,r,l,c,u,d=!1,p=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(d,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"')).replace("&","&"),c=i[s].split("talk-link__speaker'>")[1],c=c.substring(0,c.indexOf("')[1],u=u.substring(0,u.indexOf("")),r=i[s].split("class='media__message'")[1].split("href=")[1],r="http://www.ted.com"+r.substring(1,r.indexOf("'>")),p.push({title:o,img:l,author:c,duration:u,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_SPEAKERS_LIST:i=e.url.replace("%n",e.page+1),o=function(i){var s,n,o,r,c,u=!1,d=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")),o=i[s].split("")[1].split("")[1],r=r.substring(0,r.indexOf("
"," ").replace("\n",""),c=i[s].split("")[1],c=c.substring(c.indexOf("")+8,c.indexOf("")),d.push({img:o,url:"http://www.ted.com"+n,author:r,profession:c,type:l.TYPE_FOLDER,system:{type:a.TYPE_SPEAKER}});t(u,d)};break;case a.TYPE_SPEAKER:i=e.url,o=function(i){var s,n,o,r,c,u,d=!1,p=[];if((u=i.split("
")[1])&&(u=u.substring(0,u.indexOf("’"))),i=i.split("
")[1],r=r.substring(r.indexOf(">")+1,r.indexOf("")),p.push({img:o,url:n,duration:c,title:r,type:l.TYPE_MOVIE,author:u,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_EVENT_LIST:if(r="json",i=e.url,e.page>0)return void t(!1,[]);o=function(i){var s=[],o=[];i.forEach(function(t){-1===o.indexOf(t.year)&&(o.push(t.year),s.push({title:t.year,url:e.url+"/"+t.year,type:n.TYPE_FOLDER,system:{type:a.TYPE_EVENT_SUB_LIST}}))}),t(!1,s)};break;case a.TYPE_EVENT_SUB_LIST:if(r="json",i="http://www.ted.com/talks/events",e.page>0)return void t(!1,[]);o=function(i){var s=[],o=e.url.substring(e.url.lastIndexOf("/")+1);i.forEach(function(e){e.year===o&&s.push({title:e.label,url:"http://www.ted.com/talks?event="+e.value+"&page=%n&sort=newest",type:n.TYPE_CATEGORY,system:{type:a.TYPE_THEME}})}),t(!1,s)};break;case a.TYPE_VIDEO:if(i=e.url,e.page>0)return void t(!1,[]);o=function(e){var i;if(e=e.split('"talkPage.init",')[1],void 0===e)return void t(!0,[]);e=e.substring(0,e.indexOf(")"));try{i=JSON.parse(e)}catch(s){return void t(!0,[])}t(!1,[i.talks[0]])};break;case a.TYPE_SEARCH:i=e.url.replace("%n",e.page+1),o=function(i){var s,o,r,l,c,u=!1,d=[];if(i=i.split("")[1].split("")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),c=o.substr(0,o.indexOf(":")),o=o.substring(o.indexOf(":")+2),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"'))+"quality=89&w=320",r=i[s].split('')),d.push({title:o,img:l,author:c,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(u,d)}}e.page--,o?s("GET",i,o,r):t(!1,{})},n.getCursor=function(e,t){var i=!1,s=e.item.system.type,n=e.item.url;e=e||{},e.searchText&&(n="http://www.ted.com/search?cat=talks&page=%n&per_page=12&q="+e.searchText,s=a.TYPE_SEARCH),e.sortType&&(n=e.sortType.url),t(i,{page:-1,url:n,system:{type:s,letters:e.item.system.letters}})},n.getInfo=function(e,t){t(e)},e.exports=n},function(e,t,i){"use strict";function s(e){n.call(this),this.data=e||{}}var n=i(14);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.idName="id",s.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},s.prototype.init=function(e){return e?(this.clear(),this.data=e,this.events.init&&this.emit("init",{data:e}),!0):!1},s.prototype.has=function(e){return this.data.hasOwnProperty(e)},s.prototype.get=function(e){return this.data[e]},s.prototype.set=function(e,t){var i=e in this.data,s={name:e,curr:t};return i?(s.prev=this.data[e],t!==s.prev?(this.data[e]=t,this.events.change&&this.emit("change",s),!0):!1):(this.data[e]=t,this.events.change&&this.emit("change",s),!0)},s.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=s},function(e,t,i){"use strict";function s(e){var t=this;this.isPLaying=!1,this.playUrl="",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||{},o.call(this,e),this.$node.classList.add("player"),this.init(e),n.addListener("media",function(e){s.prototype.mediaListener.call(t,e)})}var n=i(5),a=i(1),o=i(2);s.prototype=Object.create(o.prototype),s.prototype.constructor=s,s.prototype.ASPECT_TYPE_FIT=16,s.prototype.ASPECT_TYPE_BIG=64,s.prototype.ASPECT_TYPE_OPTIMAL=80,s.prototype.ASPECT_TYPE_ZOOM=0,s.prototype.aspects=[{name:"fit",mode:s.prototype.ASPECT_TYPE_FIT},{name:"big",mode:s.prototype.ASPECT_TYPE_BIG},{name:"opt",mode:s.prototype.ASPECT_TYPE_OPTIMAL},{name:"exp",mode:s.prototype.ASPECT_TYPE_ZOOM}],s.prototype.STEREO_MODE_OFF=0,s.prototype.STEREO_MODE_OVER_UNDER=1,s.prototype.STEREO_MODE_OVER_UNDER_HD=2,s.prototype.STEREO_MODE_SIDE_BY_SIDE=3,s.prototype.stereoModes=[{mode:s.prototype.STEREO_MODE_OFF,name:"Off"},{mode:s.prototype.STEREO_MODE_OVER_UNDER,name:"Over-Under"},{mode:s.prototype.STEREO_MODE_OVER_UNDER_HD,name:"Over-Under HD"},{mode:s.prototype.STEREO_MODE_SIDE_BY_SIDE,name:"Side-by-side"}],s.prototype.defaultEvents={keydown:function(e){switch(e.code){case a.ok:case a.playPause:this.playPause();break;case a.stop:this.stop();break;case a.forward:case a.right:this.rewind(!0);break;case a.rewind:case a.left:this.rewind(!1);break;case a.f4:case 117:this.nextAspect();break;case a.f1:this.nextAudioTrack();break;case a.f2:this.nextSubtitle();break;case a.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)}}},s.prototype.mediaListener=function(e){var t,i,s,a,o,r,l=this,c={};switch(e.code){case n.EVENT_PLAYBACK_BEGIN:l.isPLaying=!0,l.durationInterval&&(clearInterval(l.durationInterval),l.durationInterval=0),l.durationInterval=setInterval(function(){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 n.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{o=gSTB.GetAudioPIDs().replace(/pid:/g,'"pid":').replace(/lang:/g,'"lang":'),l.audioPIDs=JSON.parse(o)}catch(u){}try{r=gSTB.GetSubtitlePIDs().replace(/pid:/g,'"pid":').replace(/lang:/g,'"lang":'),l.subtitlePIDs=JSON.parse(r)}catch(u){}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.emit("get:info",c);break;case n.EVENT_CONTENT_ERROR:l.isPLaying=!1,l.emit("content:error");break;case n.EVENT_END_OF_FILE:l.currentSec=l.totalDurationSec,l.isPLaying=!1,l.emit("content:end");break;case n.EVENT_SUBTITLE_LOAD_ERROR:l.subtitlePIDs.pop();break;case n.EVENT_HDMI_DISCONNECT:if(s=parseInt(JSON.parse(gSTB.GetEnv('{"varList":["hdmi_event_delay"]}')).result.hdmi_event_delay,10),0===s)return;l.hdmiEventTimeout=setTimeout(function(){l.isPLaying&&stbStorage.setItem("standByPlayback",JSON.stringify({url:l.playUrl,position:l.currentSec})),gSTB.StandBy(!0),l.hdmiEventTimeout=null},s);break;case n.EVENT_HDMI_CONNECT:if(s=parseInt(JSON.parse(gSTB.GetEnv('{"varList":["hdmi_event_delay"]}')).result.hdmi_event_delay,10),0===s)return;if(l.hdmiEventTimeout)return clearTimeout(l.hdmiEventTimeout),void(l.hdmiEventTimeout=null);gSTB.StandBy(!1),a=JSON.parse(stbStorage.getItem("standByPlayback")),s&&(l.play(a.url,{position:a.position}),stbStorage.removeItem("standByPlayback"))}},s.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)},s.prototype.play=function(e,t){var i,s;this.totalDurationSec=0,this.currentSec=0,this.playUrl=e,t=t||{},i=t.solution?t.solution:"auto",s=" position:"+t.position,gSTB.Play(i+" "+e+s,t.proxy)},s.prototype.stop=function(){gSTB.Stop(),clearInterval(this.durationInterval),this.isPLaying=!1,this.isPause=!1},s.prototype.playPause=function(){this.isPause?gSTB.Continue():gSTB.Pause(),this.isPause=!this.isPause,this.emit("pause",{state:this.isPause})},s.prototype.rewind=function(e,t){var i=this;t=t||this.rewindHelper.duration||15,this.rewindHelper.isActive||(this.rewindHelper.isActive=!0,this.rewindHelper.startTime=this.currentSec,this.rewindHelper.time=this.currentSec,this.emit("rewind:start")),e?this.rewindHelper.time+t0?this.rewindHelper.time-=t:this.rewindHelper.time=0,this.rewindHelper.timeout&&clearTimeout(this.rewindHelper.timeout),this.emit("rewind",{time:this.rewindHelper.time,shift:this.rewindHelper.time-this.rewindHelper.startTime}),this.rewindHelper.timeoutDuration?this.rewindHelper.timeout=setTimeout(function(){return clearInterval(i.durationInterval),i.durationInterval=0,i.rewindHelper.isActive=!1,i.emit("rewind:apply"),i.currentSec=i.rewindHelper.time,i.rewindHelper.timeout=0,i.rewindHelper.time===i.totalDurationSec?void i.emit("content:end"):void gSTB.SetPosTime(i.rewindHelper.time)},this.rewindHelper.timeoutDuration):(clearInterval(i.durationInterval),i.durationInterval=0,gSTB.SetPosTime(i.rewindHelper.time),i.currentSec=i.rewindHelper.time,i.rewindHelper.isActive=!1,i.emit("rewind:apply"))},s.prototype.nextAudioTrack=function(){var e=this;return this.audioPIDs.length<=1?!1:(this.currentAudioPIDthis.aspects.length-1&&(this.activeAspect=0),gSTB.SetAspect(this.aspects[this.activeAspect].mode),this.emit("aspect:change",{type:this.aspects[this.activeAspect].mode,name:this.aspects[this.activeAspect].name})},s.prototype.setAspect=function(e){this.activeAspect=e,gSTB.SetAspect(this.aspects[this.activeAspect].mode),this.emit("aspect:change",{type:this.aspects[this.activeAspect].type,name:this.aspects[this.activeAspect].name})},s.prototype.nextSubtitle=function(){return this.subtitlePIDs.length<=0?(this.emit("subtitles:change",null),!1):(null===this.currentSubtitle?this.currentSubtitle=0:this.currentSubtitlee?e++:e=0,this.emit("viewmode:change",{type:this.stereoModes[e].mode,name:this.stereoModes[e].name}),gSTB.Set3DConversionMode(e)},s.prototype.setViewMode=function(e){e>0&&3>=e&&(gSTB.Set3DConversionMode(e),this.emit("viewmode:change",{type:this.stereoModes[e].mode,name:this.stereoModes[e].name}))},s.prototype.inputPosition=function(e){var t,i,s,n,a=this,o=parseInt(e,10)-48,r=[],l=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.emit("position:input",{time:"00:00:00",start:!0,sec:0}):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(o),r=this.setModeHelper.time.slice(0,this.setModeHelper.length+1),6===this.setModeHelper.length?this.setModeHelper.timeStr=r[0].toString()+r[1].toString()+":"+r[2].toString()+r[3].toString()+":"+r[4].toString()+r[5].toString():this.setModeHelper.timeStr=r[0].toString()+r[1].toString()+":"+r[2].toString()+r[3].toString(),this.setModeHelper.count++,6===this.setModeHelper.length&&(i=r.shift()+r.shift().toString(),l+=3600*parseInt(i,10)),s=r.shift()+r.shift().toString(),l+=60*parseInt(s,10),n=r.shift()+r.shift().toString(),l+=parseInt(n,10),l>this.totalDurationSec&&(l=this.totalDurationSec),this.setModeHelper.sec=l,this.emit("position:input",{time:a.setModeHelper.timeStr,sec:l})),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.emit("position:input",{time:a.setModeHelper.timeStr,sec:a.setModeHelper.sec,end:!0})},t))},s.prototype.setPosition=function(e){gSTB.SetPosTime(e),this.emit("position:set",{sec:e})},s.prototype.parseTime=function(e){var t,i,s;return e>=0?(t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),s=e-3600*t-60*i,10>t&&(t="0"+t),10>s&&(s="0"+s),10>i&&(i="0"+i)):(e=Math.abs(e),t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),s=e-3600*t-60*i,10>t&&(t="0"+t),10>s&&(s="0"+s),10>i&&(i="0"+i),t="-"+t),{hour:t,min:i,sec:s}},e.exports=s},function(e,t){"use strict";if(!("classList"in document.documentElement)){var i=Array.prototype,s=i.indexOf,n=i.slice,a=i.push,o=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=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})},s.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&&ee&&(--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)},s.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)},s.prototype.setValue=function(e){var t,i,s=this.value.length,n=e.length,a=0;if(e!==this.value){if(n>0){if(this.$placeholder.parentNode===this.$line&&this.$line.removeChild(this.$placeholder),this.$line.removeChild(this.$caret),n!==s)if(i=n-s,i>0)for(a=0;i>a;a++)t=this.$line.appendChild(document.createElement("div")),t.className="char";else for(a=0;a>i;a--)this.$line.removeChild(this.$line.lastChild);for(a=0;n>a;a++)t=this.$line.children[a],this.type===this.TYPE_PASSWORD?t.innerHTML="*":" "===e[a]?t.innerHTML=" ":t.innerText=e[a];this.value=e,this.$caret.index=n,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=s},function(e,t,i){"use strict";function s(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||""),n.call(this,e),this.$value=this.$body.appendChild(document.createElement("div")),this.$value.className="value",this.init(e)}var n=i(2);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.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},s.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=s},function(e,t){"use strict";e.exports={en:[[1,2,3,4,5,6,7,8,9,0,{value:"",id:"keyBackspace",img:"key.del",underline:"red"}],["q","w","e","r","t","y","u","i","o","p","@"],["a","s","d","f","g","h","j","k","l","_","&"],["z","x","c","v","b","n","m",",",".","-","?"],["#",{value:"",id:"keyUp",img:"key.up"},{value:" ",id:"keySpace",colSpan:7},{value:"",id:"keyLeft",img:"key.left"},{value:"",id:"keyRight",img:"key.right"}]],ru:[[1,2,3,4,5,6,7,8,9,0,"@",{value:"",id:"keyBackspace",
-img:"key.del",underline:"red"}],["й","ц","у","к","е","н","г","ш","щ","з","х","ъ"],["ф","ы","в","а","п","р","о","л","д","ж","э","?"],["я","ч","с","м","и","т","ь","б","ю",",",".","-"],[{value:"Ру",id:"keyLang",underline:"yellow"},{value:"",id:"keyUp",img:"key.up"},{value:" ",id:"keySpace",colSpan:7},{value:"",id:"keyLeft",img:"key.left"},{value:"",id:"keyRight",img:"key.right"},{value:"",disable:!0}]]}},function(e,t){"use strict";e.exports={480:{height:480,width:720,availTop:24,availBottom:24,availRight:32,availLeft:48},576:{height:576,width:720,availTop:24,availBottom:24,availRight:28,availLeft:54},720:{height:720,width:1280,availTop:20,availBottom:20,availRight:20,availLeft:20},1080:{height:1080,width:1920,availTop:15,availBottom:15,availRight:15,availLeft:15}}}]);
\ No newline at end of file
+/*! Ted: v1.0.6 (webpack: v1.12.6) */
+!function(e){function t(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return e[s].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";var s,n,a=i(5),o=i(4),r=i(1),l=i(3),c=i(11);a.addListeners({load:function(){o.init([i(22),i(28),i(13),i(23),i(12)])},done:function(){var e=document.createElement("iframe");e.src="about:blank",e.style.display="none",n=i(21),s=i(22),l.environment=JSON.parse(gSTB.GetEnv('{"varList":["hdmi_event_delay"]}')).result,c.authorize(function(){s.route()}),document.body.appendChild(e),window.XMLHttpRequest=e.contentWindow.XMLHttpRequest},keydown:function(e){switch(e.code){case r.volumeDown:case r.volumeUp:case r.mute:n.changeVolume(e.code);break;case 2085:gSTB.GetStandByStatus()?gSTB.StandBy(!1):(gSTB.StandBy(!0),o.navigate("pageMenu"),location.reload());break;case r.exit:window.parent===window?o.navigate("pageService"):window.parent.postMessage("hide","*")}}})},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";function s(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,n.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"+o++,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 n=i(14),a=i(4),o=0;s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.defaultEvents=null,s.prototype.add=function(e){var t;for(t=0;tt;t++)s=e[t],this.ids[s.id]=s,s.active&&(this.current=s);return this.events.init&&this.emit("init",{pages:e}),!0}return!1},s.parse=function(e){var t={name:"",data:[]};return t.data=e.split("/").map(decodeURIComponent),t.name=t.data.shift().slice(1),t},s.stringify=function(e,t){return t=Array.isArray(t)?t:[],e=encodeURIComponent(e),t=t.map(encodeURIComponent),t.unshift(e),t.join("/")},s.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},s.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},s.navigate=function(e,t){var i=this.current,s=this.ids[e];return s&&!s.active?(location.hash=this.stringify(e,t),this.hide(this.current),this.show(s,t),this.events.navigate&&this.emit("navigate",{from:i,to:s}),this.history.push(s),!0):!1},s.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=s},function(e,t,i){"use strict";var s,n,a=i(31),o=i(4),r=i(1),l={};i(33),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),s=new a({debug:!1,host:!0,frame:window!==window.parent,screen:null,time:{init:+new Date,load:0,done:0}}),s.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},s.EVENT_END_OF_FILE=1,s.EVENT_GET_MEDIA_INFO=2,s.EVENT_PLAYBACK_BEGIN=4,s.EVENT_CONTENT_ERROR=5,s.EVENT_DUAL_MONO_DETECT=6,s.EVENT_INFO_GET=7,s.EVENT_SUBTITLE_LOAD_ERROR=8,s.EVENT_SUBTITLE_FIND=9,s.EVENT_HDMI_CONNECT=32,s.EVENT_HDMI_DISCONNECT=33,s.EVENT_RECORD_FINISH_SUCCESSFULL=34,s.EVENT_RECORD_FINISH_ERROR=35,s.EVENT_DVB_SCANING=40,s.EVENT_DVB_FOUND=41,s.EVENT_DVB_CHANELL_EPG_UPDATE=42,s.EVENT_DVB_ANTENNA_OFF=43,s.setScreen(i(37)[screen.height]);for(n in r)"volumeUp"!==n&&"volumeDown"!==n&&(l[r[n]]=!0);s.defaultEvents={load:function(e){s.data.time.load=e.timeStamp,s.events[e.type]&&s.emit(e.type,e),o.pages.forEach(function(t){t.events[e.type]&&t.emit(e.type,e)}),s.data.time.done=+new Date,s.events.done&&s.emit("done",e)},unload:function(e){s.events[e.type]&&s.emit(e.type,e),o.pages.forEach(function(t){t.events[e.type]&&t.emit(e.type,e)})},error:function(e){},keydown:function(e){var t,i=o.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||s.events[e.type]&&s.emit(e.type,e)),s.data.host&&l[e.code]&&e.preventDefault())},keypress:function(e){var t=o.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=o.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(n in s.defaultEvents)window.addEventListener(n,s.defaultEvents[n]);window.stbEvent={},window.stbEvent.onEvent=function(e,t){if(s.events.media){if(t)try{t=JSON.parse(t)}catch(i){}s.emit("media",{code:parseInt(e,10),info:t})}},window.stbEvent.onBroadcastMessage=function(e,t,i){s.events.message&&s.emit("message",{broadcast:!0,windowId:e,message:t,data:i})},window.stbEvent.onMessage=function(e,t,i){s.events.message&&s.emit("message",{broadcast:!1,windowId:e,message:t,data:i})},window.stbEvent.onMount=function(e){s.events["device:mount"]&&s.emit("device:mount",{state:e})},window.stbEvent.onMediaAvailable=function(){s.events["media:available"]&&s.emit("media:available")},window.stbEvent.onNetworkStateChange=function(e){s.events["internet:state"]&&s.emit("internet:state",{state:e})},window.stbEvent.onWebBrowserProgress=function(e){s.events["browser:progress"]&&s.emit("browser:progress",{progress:e})},window.stbEvent.onWindowActivated=function(){s.events["window:focus"]&&s.emit("window:focus")},window.gSTB&&gSTB.SetNativeStringMode&&gSTB.SetNativeStringMode(!0),e.exports=s},function(e,t,i){"use strict";var s={array:[],current:{}},n=i(3),a=i(30);s.loadPlugin=function(e,t){var i=this;return null===e&&n.singleMode.active===!0?(s.current.plugin=a,void t(i.current)):void 0},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},this.active=!1,this.activeComponent=null,e.className="page "+(e.className||""),n.call(this,e),this.active=this.$node.classList.contains("active"),null===this.$node.parentNode&&document.body.appendChild(this.$node),this.page=this}var n=i(2);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},e.className="button "+(e.className||""),n.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 n=i(2),a=i(1);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.clickDuration=200,s.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===a.ok&&this.events.click&&this.emit("click",{event:e})}},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},e.className="modalBox "+(e.className||""),e.$body=document.createElement("div"),e.$body.className="body",n.call(this,e),this.$node.appendChild(document.createElement("div").appendChild(this.$body).parentNode)}var n=i(2);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},e.focusable=e.focusable||!1,e.className="panel "+(e.className||""),n.call(this,e)}var n=i(2);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";var s,n={profile:{},playback:{},token:void 0,favorite:{data:[]}},a=i(3),o=i(24);n.authorize=function(e){var t=gSTB.LoadUserData("ted.com.json");""===t?o.ajax(a.backend.url.authorization,{onload:function(t){var i=JSON.parse(t);200===i.code?(n.token=i.data.sid,gSTB.SaveUserData("ted.com.json",JSON.stringify({tokens:{active:n.token,guest:n.token}})),e(),n.isAuthorize=!0,n.profile.save({playNext:!0,buffer:5})):(n.isAuthorize=!1,e())},onerror:function(){e()},timeout:6e3}):(n.token=JSON.parse(t).tokens.active,n.profile.load(function(){e(),n.isAuthorize=!0}))},n.profile.load=function(e){var t;s=i(21),o.ajax(a.backend.url.profile,{onload:function(i){var n;if(t=JSON.parse(i),null===i.info)return void(e&&e());if(200===t.code){if(a.playNext=t.data.info.playNext,a.bufferSize=t.data.info.buffer,a.appRating=t.data.info.appRating,t.data.info.volume){a.volume=t.data.info.volume;try{s.setValue(a.volume)}catch(o){}}n=Math.floor(768*a.bufferSize*1e3),gSTB.SetBufferSize(1e3*a.bufferSize,n)}e&&e(i)},onerror:function(){e&&e()},method:"GET",headers:{Authorization:n.token},timeout:6e3})},n.profile.save=function(e,t){void 0===e&&(e={playNext:a.playNext,buffer:a.bufferSize,appRating:a.appRating,volume:a.volume}),o.ajax(a.backend.url.profile,{onload:function(e){t&&t()},timeout:6e3,method:"PUT",data:e,headers:{"Content-Type":"application/json",Authorization:n.token}})},n.playback.send=function(e){n.isAuthorize&&o.ajax(a.backend.url.playbackHistory,{method:"POST",timeout:6e3,data:e,headers:{"Content-Type":"application/json",Authorization:n.token},onload:function(e){200===JSON.parse(e).code}})},n.playback.load=function(e){n.isAuthorize&&o.ajax(a.backend.url.playbackHistory,{method:"GET",headers:{Authorization:n.token},timeout:6e3,onload:function(t){var i=JSON.parse(t);200!==i.code||e(i.data)},onerror:function(){}})},n.favorite.send=function(e,t){n.isAuthorize&&o.ajax(a.backend.url.favorite,{method:"POST",data:e,timeout:6e3,headers:{"Content-Type":"application/json",Authorization:n.token},onload:function(e){200===JSON.parse(e).code,t()},onerror:function(){t()}})},n.favorite.load=function(e,t){n.isAuthorize&&o.ajax(a.backend.url.favorite+"?info.categoryId="+e,{method:"GET",headers:{Authorization:n.token},timeout:6e3,onload:function(e){var i=JSON.parse(e);200!==i.code||t(i.data)}})},n.favorite.checkState=function(e,t){return n.isAuthorize?void o.ajax(a.backend.url.favorite+"?info.id="+e,{method:"GET",headers:{Authorization:n.token},timeout:6e3,onload:function(e){var i=JSON.parse(e);200!==i.code?t(null):0!==i.data.length?t(!0,i.data[0].id):t(!1)},onerror:function(){t(null)}}):void t(null)},n.favorite.deleteItem=function(e,t){return n.isAuthorize?void o.ajax(a.backend.url.favorite+"/"+e,{method:"DELETE",headers:{Authorization:n.token},timeout:6e3,onload:function(e){var i=JSON.parse(e);t(200===i.code?!0:!1)},onerror:function(){t(!1)}}):void t(!1)},e.exports=n},function(e,t,i){"use strict";var s,n,a="pageSearch",o=document.getElementById(a),r=i(7),l=new r({$node:o}),c=i(4),u=i(1),d=i(5),p=i(20),h=i(18),m=i(19),g=i(15),w=i(8),f=i(9),v=i(10),y=new f({visible:!1,events:{show:function(){y.okBtn.focus()},hide:function(){n.focus()}}}),b=document.getElementById("pageSearchStory"),T=document.createElement("span");l.addListener("load",function(){b.innerText="Search history ",T.classList.add("searchType"),b.appendChild(T),n=new w({$node:document.getElementById("pageSearchStoryClear"),value:"Clear history"}),l.add(n),n.addListener("keydown",function(e){switch(e.code){case u.up:h.input.focus();break;case u.down:s?s.focus():m.keys.focus()}}),n.addListener("click",function(){y.show()}),h.input.addListener("keydown",function(e){e.code===u.down&&"pageSearch"===c.current.id&&n.focus()}),l.add(y),y.add(y.title=new v),y.title.$body.innerText="Clear search history ?",y.add(y.okBtn=new w({value:"Clear",events:{keydown:function(e){switch(w.prototype.defaultEvents.keydown.call(this,e),e.code){case u.right:y.cancelBtn.focus();break;case u.back:case u.exit:y.hide(),e.stop=!0}},click:function(){p.clearStorage(function(e){e?l.initSearch(l.lastSearchData,function(){n.focus(),y.hide()}):y.hide()})}}})),y.add(y.cancelBtn=new w({value:"Cancel",events:{keydown:function(e){switch(w.prototype.defaultEvents.keydown.call(this,e),e.code){case u.left:y.okBtn.focus();break;case u.back:case u.exit:y.hide(),e.stop=!0}},click:function(){y.hide()}}}))}),l.addListener("show",function(){l.add(m),l.add(h),h.show(),m.show(),m.showBg(0),m.keys.focus(),m.keys.focusItem(m.keys.map[2][5]),m.overflowTop(function(){s?s.focus():n.focus()}),m.button.addListener("keydown",function(e){e.code===u.up&&("pageSearch"===c.current.id?s?(s.focus(),s.focusItem(s.map[4][1])):n.focus():"pageVideoList"===c.current.id&&h.input.focus())})}),l.addListener("keydown",function(e){switch(e.code){case u.back:m.hide(),h.hide(),c.navigate("pageService");break;case u.exit:d.data.frame||(m.hide(),h.hide())}}),l.initSearch=function(e,t){this.lastSearchData=e,p.getData(function(e){var t=e;if(null!==t){if(s)try{s.remove(),s=null}catch(i){}s=new g({data:t,cycleY:!1,render:function(e,t){var i=document.createElement("span");i.innerText=t.value,e.appendChild(i)}}),l.add(s),s.addListener("overflow",function(e){switch(e.direction){case u.up:n.focus();break;case u.down:m.keys.focus()}}),s.addListener("click:item",function(e){h.setValue(e.$item.data.value),m.button.focus()})}else if(s)try{s.remove(),s=null}catch(i){}}),t()},e.exports=l},function(e,t,i){"use strict";function s(e){switch(e.$item.movieObj.type){case x.current.plugin.TYPE_FOLDER:L.push(u),m.initVideoList(k.dataProviderType.TYPE_SERVICE,{item:e.$item.movieObj},function(){});break;case x.current.plugin.TYPE_MOVIE:I.play(a.data,e.$item.x)}}var n,a,o,r,l,c,u,d="pageVideoList",p=document.getElementById(d),h=i(7),m=new h({$node:p}),g=i(4),w=i(1),f=i(5),v=i(10),y=i(15),b=i(16),T=i(8),E=i(9),k=i(3),S=i(27),x=i(6),_=i(12),I=i(23),P=new E({visible:!1,events:{show:function(){P.list.focus(),P.list.focusIndex(0)},hide:function(){l.focus()}}}),D=document.getElementById("pageVideoListBreadCrumb"),L=[];m.addListener("load",function(){n=new v({$node:document.getElementById("pageVideoListHeader")}),o=new v({$node:document.getElementById("pageVideoListContentWrapper")}),m.add(o),o.add(n),r=new T({$node:document.getElementById("pageVideoListButtonSearch"),value:"Sort"}),n.add(r),r.hide(),m.add(P)}),m.initVideoList=function(e,t,i){var l,d=[],p=[];if(u=t,e===k.dataProviderType.TYPE_SERVICE?(c=S,n.show(),breadcrumb[breadcrumb.length-1]!==t.item.title&&window.breadcrumb.push(t.item.title||t.item.author),D.innerText=window.breadcrumb.join(" | ")):e===k.dataProviderType.TYPE_SEARCH&&(c=S,n.show(),breadcrumb[breadcrumb.length-1]!==t.searchText&&(window.breadcrumb.push(t.searchText),D.innerText=window.breadcrumb.join(" | "))),c.state?c.state++:c.state=1,a){try{a.remove()}catch(h){}c.type===k.dataProviderType.TYPE_SERVICE&&window.breadcrumb.splice(1)}r.$body.innerText="Sort",t.item.sortTypes&&t.item.sortTypes.length>0?(P.active=!0,t.item.sortTypes.forEach(function(e){p.push({value:e})}),P.list&&(P.list.remove(),P.list=null),P.list=new b({data:p,size:p.length>5?5:p.length,render:function(e,t){var i=document.createElement("div");e.innerHTML="",i.className="text",i.innerText=t.value.name,e.appendChild(i),e.data.sortObject=t.value},events:{keydown:function(e){b.prototype.defaultEvents.keydown.call(this,e),(e.code===w.exit||e.code===w.back)&&(P.hide(),e.stop=!0)},"click:item":function(e){m.initVideoList(k.dataProviderType.TYPE_SERVICE,{item:u.item,sortType:e.$item.data.value},function(){P.hide(),L[L.length-1]=u,r.$body.innerText=e.$item.data.value.name})}}}),P.add(P.list),r.show()):(P.active=!1,r.hide()),c.getFirst(t,function(e){for(d[0]=e.slice(0,k.movieList.perLine),l=1;3>l;l++)d[l]=e.slice(k.movieList.perLine*l,k.movieList.perLine*l+k.movieList.perLine);a=new y({focusable:!0,data:d,cycleY:!1,render:function(e,t){var i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("div"),a=document.createElement("div"),o=document.createElement("div"),r=document.createElement("div");f.data.metrics.height<720&&t.value.imgSmall&&(t.value.img=t.value.imgSmall),e.ready?(e.img.style.backgroundImage="url("+t.value.img+")",e.txt.innerText=t.value.author||"",e.txt.innerText+=t.value.title||"",e.movieObj=t.value,e.duration.innerText=t.value.duration||"",t.value.profession&&(e.img.classList.add("profession"),e.profession.innerText=t.value.profession),t.value.invisible?(e.classList.add("invisible"),e.data.disable=!0):(e.classList.remove("invisible"),e.data.disable=!1)):(s.classList.add("cover"),s.style.backgroundImage="url("+t.value.img+")",t.value.profession&&(s.classList.add("profession"),o.innerText=t.value.profession),n.className="duration",n.innerText=t.value.duration||"",i.className="movieItem",a.className="movieDescription",r.className="name",r.innerText=t.value.author||"",r.innerText+=t.value.title||"",o.classList.add("speakerProf"),i.appendChild(o),i.appendChild(s),s.appendChild(n),a.appendChild(r),i.appendChild(a),e.appendChild(i),t.value.invisible&&e.classList.add("invisible"),e.img=s,e.duration=n,e.txt=r,e.profession=o,e.ready=!0,e.movieObj=t.value)},events:{keydown:function(e){switch(e.code){case w.right:case w.left:this.move(e.code);break;case w.ok:void 0!==this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:e});break;case w.down:m.nextData();break;case w.up:m.prevData()}},"click:item":s}}),o.add(a),m.videoList=a,i(),a.focus(),a.map[1][2]&&!a.map[1][2].data.disable&&5===k.movieList.perLine?a.focusItem(a.map[1][2]):a.focusItem(a.map[1][0])})},m.nextData=function(){var e,t,i=c.getNext();if(null!==i){for(a.data[0]=a.data[1],a.data[1]=a.data[2],a.data[2]=i,i=a.data,e=0;3>e;e++)for(t=0;te;e++)for(t=0;t0&&r.show()}),m.addListener("hide",function(){n.hide(),r.hide()}),m.addListener("keydown",function(e){switch(e.code){case w.back:L.length>0?(breadcrumb.pop(),m.initVideoList(k.dataProviderType.TYPE_SERVICE,L.pop(),function(){})):c.type===k.dataProviderType.TYPE_SEARCH?(g.navigate("pageSearch"),_.initSearch(_.lastSearchData,function(){g.navigate("pageSearch")})):c.type===k.dataProviderType.TYPE_SERVICE&&g.navigate("pageService");break;case w.exit:break;case w.f1:P.active&&(l=g.current.activeComponent,P.show())}}),e.exports=m},function(e,t,i){"use strict";function s(){this.events={}}s.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 s(n){t(n),i.removeListener(e,s)})},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,s=this.events[e];if(s)for(i=0;io;o++){for(e.lengthr;r++)e[o].length0?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})}}},s.prototype.init=function(e){var t,i,s,a,r,l,c,u=this,d=!1,p=function(e){this.data.disable!==!0&&(u.focusItem(this),u.events["click:item"]&&u.emit("click:item",{$item:this,event:e}))};if(void 0!==e.cycleX&&(this.cycleX=e.cycleX),void 0!==e.cycleY&&(this.cycleY=e.cycleY),e.data&&this.data!==e.data&&(this.data=e.data,d=!0),e.render&&this.renderItem!==e.render&&(this.renderItem=e.render,d=!0),d){for(this.$table=document.createElement("table"),r=document.createElement("tbody"),this.data=n(this.data),t=0;t0?i--:this.cycleY?(i=this.map.length-1,a=!0):n=!0;break;case l.down:i0?t--:this.cycleX?(t=this.map[i].length-1,a=!0):n=!0}t===this.focusX&&i===this.focusY&&(s=!1),this.map[i][t]!==this.map[this.focusY][this.focusX]&&this.map[i][t].data.disable!==!0&&(s=!1),n&&(s=!1,this.map[i][t].data.disable===!0&&(t=this.focusX,i=this.focusY))}a&&this.events.cycle&&this.emit("cycle",{direction:e}),n&&this.events.overflow&&this.emit("overflow",{direction:e}),this.focusItem(this.map[i][t]),this.focusX=t,this.focusY=i},s.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},s.prototype.markItem=function(e,t){t?e.classList.add("mark"):e.classList.remove("mark"),e.data.mark=t},e.exports=s},function(e,t,i){"use strict";function s(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"),a.call(this,e),this.init(e)}function n(e){var t,i;for(t=0;t0?o.up:o.down),this.type===this.TYPE_HORIZONTAL&&e.wheelDeltaX&&this.move(e.wheelDeltaX>0?o.left:o.right)},keydown:function(e){switch(e.code){case o.up:case o.down:case o.right:case o.left:case o.pageUp:case o.pageDown:case o.home:case o.end:this.move(e.code);break;case o.ok:this.events["click:item"]&&this.emit("click:item",{$item:this.$focusItem,event:e})}}},s.prototype.init=function(e){var t,i,s=this,a=this.$body.children.length,o=function(e){this.data&&(s.focusItem(this),s.events["click:item"]&&s.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=n(e.data)),e.render&&(this.renderItem=e.render),e.size&&(this.size=e.size),this.size!==a)for(a>0&&(this.$body.innerText=null),i=0;i0?this.$focusItem===this.$body.firstChild?this.renderView(this.viewIndex-1):this.focusItem(this.$focusItem.previousSibling):this.cycle?(this.move(o.end),this.events.cycle&&this.emit("cycle",{direction:e})):this.events.overflow&&this.emit("overflow",{direction:e})),(e===o.down&&this.type===this.TYPE_VERTICAL||e===o.right&&this.type===this.TYPE_HORIZONTAL)&&(this.$focusItem&&this.$focusItem.indexthis.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===o.home&&(this.renderView(0),this.focusItem(this.$body.firstChild)),e===o.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]))},s.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},s.prototype.focusIndex=function(e){var t=this.viewIndex||0;e>=t+this.size?(e=ee?(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]))},s.prototype.markItem=function(e,t){t?e.classList.add("mark"):e.classList.remove("mark"),e.data.mark=t},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},e.focusable=e.focusable||!1,e.visible=e.visible||!1,e.className="widget "+(e.className||""),n.call(this,e)}var n=i(2);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";var s="inputWidgetWrapper",n=document.getElementById(s),a=i(17),o=new a({$node:n,visible:!1,focusable:!0}),r=i(1),l=i(34),c=new l({
+$node:document.getElementById("inputWidget")});o.add(c),o.$node.classList.remove("invisible"),o.addChar=function(e){c.addChar(e)},o.removeChar=function(){c.removeChar()},o.getValue=function(){return c.value},o.setValue=function(e){c.setValue(e),setTimeout(function(){c.setValue(e)},0)},o.delChar=function(){c.removeChar(c.value.length-1)},o.input=c,c.addListener("keydown",function(e){var t;e.code===r.ok&&c.value.length>0?(t=i(19),t.button.focus()):e.code===r.back&&(e.stop=!0)}),o.overflowBot=function(e){c.addListener("keydown",function(t){t.code===r.down&&e()})},e.exports=o},function(e,t,i){"use strict";var s,n="keyboardWidgetWrapper",a=document.getElementById(n),o=i(17),r=new o({$node:a,visible:!1,focusable:!0}),l=i(1),c=i(5),u=i(4),d=i(15),p=i(8),h=i(3),m=i(36),g=i(18),w=i(20),f=i(6),v=new d({$node:document.getElementById("keyboardWidget"),data:m.en,cycleY:!1,cycleX:!1,render:function(e,t){var i,s=document.createElement("div");s.classList.add("keyboardButton"),t.id&&(e.id=t.id),s.innerText=t.value,e.appendChild(s),t.img&&(i=document.createElement("img"),i.src="./img/"+c.data.metrics.height+"/"+t.img+".png",s.appendChild(i))}}),y=new p({$node:document.getElementById("keyboardWidgetSearchBtn"),value:"Search"});r.$node.classList.remove("invisible"),r.add(v),r.add(y),r.isUpper=!1,r.lang="en",v.addListener("overflow",function(e){switch(e.direction){case l.right:y.focus()}}),v.addListener("click:item",function(e){if(g.visible)if(e.$item.data.id)switch(e.$item.data.id){case"keyUp":r.upper();break;case"keyBackspace":g.delChar();break;case"keySpace":g.addChar(" ");break;case"keyLeft":g.input.emit("keydown",{code:l.left});break;case"keyRight":g.input.emit("keydown",{code:l.right});break;case"keyLang":r.changeLang()}else r.isUpper?g.addChar(e.$item.data.value.toString().toUpperCase()):g.addChar(e.$item.data.value.toString())}),v.addListener("keydown",function(e){switch(e.code){case 112:e.stop=!0,g.delChar();break;case 115:y.emit("click",{});break;case 114:break;case 113:g.addChar(" ")}}),y.addListener("keydown",function(e){switch(e.code){case l.left:v.focus()}}),r.setSearchObj=function(){},y.addListener("click",function(){s=i(13),g.visible&&g.getValue().length>0&&s.initVideoList(h.dataProviderType.TYPE_SEARCH,{item:f.current.plugin.root,searchText:g.getValue()},function(){r.hide(),g.hide(),y.blur(),u.navigate("pageVideoList"),w.add(g.getValue())})}),r.upper=function(){this.isUpper?(this.isUpper=!1,this.$node.classList.remove("upperCase")):(this.isUpper=!0,this.$node.classList.add("upperCase"))},r.overflowTop=function(e){var t=u.current.id;v.addListener("overflow",function(i){i.direction===l.up&&u.current.id===t&&e()})},r.changeLang=function(){"ru"===r.lang?(v.init({data:m.en}),r.lang="en"):(v.init({data:m.ru}),r.lang="ru"),v.focusItem(v.map[2][5])},r.showBg=function(e){1===e?r.$node.classList.add("background"):0===e&&r.$node.classList.remove("background")},r.button=y,r.keys=v,e.exports=r},function(e,t,i){"use strict";var s={},n=[],a=i(3),o=i(11),r=i(24);s.getData=function(e){var t,i,s=[];n=[],o.isAuthorize?r.ajax(a.backend.url.searchHistory,{method:"GET",headers:{Authorization:o.token},timeout:6e3,onload:function(a){var o,r=JSON.parse(a).data;if(r.forEach(function(e){n.push(e.info)}),n.length>0){for(n.length%2!==0&&n.push({value:"",disable:!0}),i=n.length/2,s[0]=[],s[0].push(n[0]),s[0].push(n[i]),t=1;i>t;t++)s[t]=[],s[t].push(n[t]),o=t+parseFloat(i),s[t].push(n[o]);e(s)}else e(null)}}):e(null)},s.clearStorage=function(e){n=[],r.ajax(a.backend.url.searchHistory,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:o.token},timeout:6e3,onload:function(t){var i=JSON.parse(t);e(200===i.code?!0:!1)},onerror:function(){e(!1)}})},s.removeLast=function(){n.pop()},s.add=function(e){n.length&&e===n[0].value||(n.pop(),n.unshift({value:e}),e&&r.ajax(a.backend.url.searchHistory,{method:"POST",headers:{"Content-Type":"application/json",Authorization:o.token},data:{value:e},timeout:6e3,onload:function(){}}))},e.exports=s},function(e,t,i){"use strict";function s(){u.isMuted&&(gSTB.SetMute(0),u.isMuted=!1,g.classList.remove("muted")),m>=v&&(m-=v,g.innerText=m.toString(),0!==m&&m-v>0?w.innerText=(m-v).toString():w.innerText="",f.innerText=(m+v).toString(),gSTB.SetVolume(m))}function n(){u.isMuted&&(gSTB.SetMute(0),u.isMuted=!1,g.classList.remove("muted")),100>=m+v&&(m+=v,g.innerText=m.toString(),100!==m?f.innerText=(m+v).toString():f.innerText="",gSTB.SetVolume(m),w.innerText=(m-v).toString())}function a(){u.isMuted?(gSTB.SetMute(0),u.isMuted=!1,g.classList.remove("muted")):(gSTB.SetMute(1),u.isMuted=!0,g.classList.add("muted"))}var o,r="volumeWidget",l=document.getElementById(r),c=i(17),u=new c({$node:l,visible:!1,focusable:!0}),d=i(1),p=i(3),h=i(11),m=p.volume,g=document.getElementById("volumeCurrentValue"),w=document.getElementById("volumeBotValue"),f=document.getElementById("volumeTopValue"),v=10;gSTB.SetVolume(m),g.innerText=m.toString(),100-v>=m&&(f.innerText=(m+v).toString()),m>=v?w.innerText=(m-v).toString():w.innerText="0",u.isMuted=Boolean(gSTB.GetMute()),u.$node.classList.remove("invisible"),u.changeVolume=function(e){switch(e){case d.volumeDown:s();break;case d.volumeUp:n();break;case d.mute:a()}this.display(2),p.volume=m,h.profile.save()},u.display=function(e){u.visible&&clearTimeout(o),void 0!==e&&(o=setTimeout(function(){u.hide()},1e3*e)),this.show()},u.setValue=function(e){0>e||e>100||(m=e,g.innerText=m.toString(),0!==m&&m-v>0?w.innerText=(m-v).toString():w.innerText="",100!==m?f.innerText=(m+v).toString():f.innerText="")},e.exports=u},function(e,t,i){"use strict";var s="pageInit",n=i(7),a=new n({$node:document.getElementById(s)}),o=i(5),r=i(4),l=i(3);a.route=function(){switch(o.data.metrics.height){case 1080:l.movieList.perLine=4;break;case 720:l.movieList.perLine=3;break;case 576:case 480:l.movieList.perLine=2}r.navigate("pageService")},e.exports=a},function(e,t,i){"use strict";var s,n,a,o="pagePlayer",r=document.getElementById(o),l=i(7),c=new l({$node:r}),u=i(4),d=i(1),p=i(5),h=i(25),m=i(32),g=i(16),w=i(35),f=i(9),v=i(6),y=!1,b=new w({$node:document.getElementById("playerProgressBar")}),T=new f({visible:!1,events:{show:function(){T.list.focus(),T.list.focusIndex(0)},hide:function(){a.focus()}}}),E={current:0,list:[],currentMedia:{}},k={aspects:{fit:"Original",big:"Big",opt:"Optimal",exp:"Zoom"}},S=document.getElementById("playerTitle"),x=document.getElementById("playerTotalDuration"),_=document.getElementById("playerCurrentDuration"),I={author:document.getElementById("playerAuthor")},P=document.getElementById("playerButtonPlay"),D=document.getElementById("playerHD"),L=document.getElementById("playerAspect");c.play=function(e,t){var i;E.list=e,E.current=t,s=v.current.plugin,i=E.list[1][E.current].value,b.set(0),S.innerHTML=i.title,x.innerText="00:00",_.innerText="00:00",I.author.innerText=i.author||"",P.className="icon-pause2",D.innerText="Subtitles: No",s.getCursor({item:i},function(e,t){s.getNext(t,function(e,t){var i=[];t=t[0],T.list&&(T.list.remove(),T.list=void 0),a.currentSubtitle="No subtitle",t.subtitledDownloads&&Object.keys(t.subtitledDownloads).length>0&&(i.push({value:{name:"No subtitle",url:t.resources.h264[0].file},type:0}),Object.keys(t.subtitledDownloads).forEach(function(e){i.push({value:t.subtitledDownloads[e],type:1})}),T.list=new g({data:i,size:i.length>5?5:i.length,render:function(e,t){var i=document.createElement("div");e.innerHTML="",i.className="text",i.innerText=t.value.name,e.appendChild(i),e.data.subtitle=t.value},events:{keydown:function(e){g.prototype.defaultEvents.keydown.call(this,e),(e.code===d.back||e.code===d.exit)&&(T.hide(),e.stop=!0)},"click:item":function(e){return e.$item.data.value.name===a.currentSubtitle?void T.hide():(1===e.$item.data.type?(a.play(e.$item.data.value.high,{position:a.currentSec}),D.innerText="Subtitles: "+e.$item.data.value.name):0===e.$item.data.type&&(a.play(e.$item.data.value.url,{position:a.currentSec}),D.innerText="Subtitles: No"),P.className="icon-pause2",y=!0,void T.hide())}}}),T.add(T.list)),a.play(t.resources.h264[0].file)})}),u.navigate("pagePlayer")},c.addListener("load",function(){a=new m({$node:document.getElementById("tedPlayer"),rewindTimeout:600,events:{keydown:function(e){switch(e.code){case d.info:return void n.display();case d.ok:case d.playPause:this.playPause();break;case d.stop:this.stop();break;case d.forward:case d.right:this.rewind(!0);break;case d.rewind:case d.left:this.rewind(!1);break;case d.f2:T.show();break;case d.f4:case 117:this.nextAspect()}n.display(5)}}}),n=new h({$node:document.getElementById("playerPanel")}),c.add(a),a.add(n),L.innerText="Aspect: Original",a.addListeners({duration:function(e){this.rewindHelper.isActive||this.setModeHelper.active||y||(b.set(e.sec),_.innerText=e.time)},"get:info":function(e){x.innerText=e.totalDuration,b.init({value:0,max:e.totalDurationSec}),n.display(5)},rewind:function(e){var t=a.parseTime(e.time),i="";b.set(e.time),+t.hour&&(i+=t.hour+":"),i+=t.min+":"+t.sec,_.innerText=i},"aspect:change":function(e){L.innerText="Aspect:"+k.aspects[e.name]},"content:end":function(){u.back()},"content:error":function(){u.back()},pause:function(e){e.state?P.className="icon-play3":P.className="icon-pause2"}}),p.addListener("media",function(e){e.code===p.EVENT_PLAYBACK_BEGIN&&y&&(y=!1)}),c.add(T)}),c.addListener("show",function(){a.focus()}),c.addListener("keydown",function(e){switch(e.code){case d.back:a.stop(),u.navigate("pageVideoList");break;case d.stop:a.stop(),u.navigate("pageVideoList");break;case d.exit:a.stop(),window.parent!==window&&u.navigate("pageVideoList")}}),c.addListener("hide",function(){}),e.exports=c},function(e,t,i){"use strict";var s={},n={method:"GET",async:!0,headers:{},type:"text",data:null,timeout:3e4,onload:null,onerror:null,ontimeout:null},a=Object.keys(n);s.ajax=function(e,t){var i,s,o;if(t=t||{},e&&("string"==typeof e||e instanceof String)&&e.length>0){if(t&&"object"==typeof t)for(i=0;i0)return s.join("&")}return null},e.exports=s},function(e,t,i){"use strict";function s(e){e=e||{},n.call(this,e),this.displayTimeout=0,this.attach=!1,this.$node.classList.add("playerPanel")}var n=i(10);s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.display=function(e){var t=this;if(e){if(this.attach)return;e=1e3*e,this.show(),this.displayTimeout&&(clearTimeout(this.displayTimeout),this.displayTimeout=0),this.displayTimeout=setTimeout(function(){t.hide(),t.displayTimeout=0},e)}else this.displayTimeout?(clearTimeout(this.displayTimeout),this.displayTimeout=0):this.attach?(this.hide(),this.attach=!1):(this.show(),this.attach=!0)},e.exports=s},function(e,t){"use strict";function i(){this.type=null,this.page=1,this.cache={data:[],head:null,tail:null}}i.prototype.getFirst=function(){},i.prototype.getNext=function(){},i.prototype.getPrev=function(){},e.exports=i},function(e,t,i){"use strict";var s,n,a,o,r,l,c=i(26),u=new c,d=i(3),p=i(6),h=30,m=40;u.getFirst=function(e,t){var i=this,c=[];for(s=d.movieList.perLine,i.page=1,i.type=d.dataProviderType.TYPE_SERVICE,i.cache.tail=0,i.cache.head=0,i.cache.data=[],n=p.current.plugin,r=0,i.cache.botEmptyLine=!1,l=0;s>l;l++)i.cache.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disabled:!0});i.cache.topEmptyLine=!0,e.searchText&&(i.type=d.dataProviderType.TYPE_SEARCH),n.getCursor(e,function(r,l){a=l,n.getCursor(e,function(e,t){o=t}),n.getNext(a,function(e,n){e||(n.forEach(function(e){i.cache.data.push({value:e})}),i.cache.data.length>=3*s?(c=i.cache.data.slice(0,3*s),i.cache.head=3*s,t(c),i.cache.checkNext()):i.cache.checkNext(function(){c=i.cache.data.slice(0,3*s),i.cache.head=3*s,t(c)}))})})},u.cache.checkNext=function(e){var t=this,i=u.state;t.botEmptyLine||(t.data.length0){if(u.state&&i!==u.state)return!1;a.forEach(function(e){t.data.push({value:e})}),t.data.length>=3*s&&e?e():t.checkNext(e)}else{for(l=0;ll;l++)t.data.push({value:{date:"",img:"",title:"",url:"",invisible:!0},disabled:!0});r+=s,t.botEmptyLine=!0,e&&e()}}),t.tail>=m+3*s&&n.getNext(o,function(e,i){var n,a;if(e);else{for(a=i.length,t.topEmptyLine&&(a+=s,t.topEmptyLine=!1),n=0;a>n;n++)t.data.shift();t.head-=a,t.tail-=a}}))},u.cache.checkPrev=function(){var e=this;e.topEmptyLine||(e.tail0){for(l=i.length-1;l>=0;l--)e.data.unshift({value:i[l]});e.head+=i.length,e.tail+=i.length}else if(!e.topEmptyLine){for(l=0;s>l;l++)e.data.unshift({value:{date:"",img:"",title:"",url:"",invisible:!0},disabled:!0});e.head+=s,e.tail+=s,e.topEmptyLine=!0}}),e.data.length-e.head>h&&n.getPrev(a,function(t,i){var s;s=i.length,e.botEmptyLine&&(s+=r,e.botEmptyLine=!1),e.data.splice(e.data.length-s,s)}))},u.getNext=function(){var e=this,t=[];if(e.cache.head+s<=e.cache.data.length)t=e.cache.data.slice(e.cache.head,e.cache.head+s),e.cache.head+=s,e.cache.tail+=s,this.page++,e.cache.checkNext();else if(1===e.page&&e.cache.data.length%s!==0){for(l=0;l=0?(t=e.cache.data.slice(e.cache.tail-s,e.cache.tail),e.cache.head-=s,e.cache.tail-=s,this.page--,e.cache.checkPrev()):t=null,t},e.exports=u},function(e,t,i){"use strict";function s(e){switch(e.$item.data.value.type){case I.TYPE_CATEGORY:E.initVideoList(b.dataProviderType.TYPE_SERVICE,{item:e.$item.data.value},function(){m.navigate("pageVideoList")});break;case I.TYPE_FOLDER:n(e.$item.data.value);break;case D.TYPE_BACK:a();break;case D.TYPE_SEARCH:k.initSearch({url:e.$item.data.value.url},function(){m.navigate("pageSearch")})}}function n(e){P.push(e),I.getCursor({item:e},function(e,t){I.getNext(t,function(e,t){var i=[];0!==t.length&&(i.push(L.back),t.forEach(function(e){i.push({value:e})}),l.viewIndex=-1,l.init({data:i,size:i.length}),l.$body.children[1]?l.focusItem(l.$body.children[1]):l.focusItem(l.$body.children[0]))})})}function a(){1===P.length?window.parent.postMessage("hide","*"):2===P.length?h.initService(null,function(){l.focus()}):(P.pop(),I.getCursor({item:P[P.length-1]},function(e,t){var i=[];I.getNext(t,function(e,t){0!==P.length&&i.push(L.back),t.forEach(function(e){i.push({value:e})}),l.viewIndex=-1,l.init({data:i,size:i.length}),l.focusItem(l.$body.children[0])})}))}var o,r,l,c,u="pageService",d=document.getElementById(u),p=i(7),h=new p({$node:d}),m=i(4),g=i(1),w=(i(5),i(10)),f=i(16),v=i(9),y=i(8),b=i(3),T=i(6),E=i(13),k=i(12),S=new v({visible:!1,events:{show:function(){S.okBtn.focus()},hide:function(){c.focus()}}}),x=document.getElementById("pageServiceCatImg"),_=document.getElementById("pageServiceLogo"),I={},P=[],D={TYPE_BACK:20,TYPE_SEARCH_LIST:12,TYPE_SEARCH:13},L={back:{value:{title:"Back",specialClass:"backItem",type:D.TYPE_BACK}},searchArr:[]},B=[];h.addListener("load",function(){o=new w({focusable:!1,$node:document.getElementById("pageServiceWrapper")}),h.add(o),r=new w({$node:document.getElementById("pageServiceRightPanel")}),o.add(r),h.initService(null,function(){}),h.add(S),S.add(S.title=new w),S.title.$body.innerText="Are you sure you want to exit?",S.add(S.okBtn=new y({value:"Exit",events:{keydown:function(e){switch(y.prototype.defaultEvents.keydown.call(this,e),e.code){case g.right:S.cancelBtn.focus();break;case g.back:case g.exit:S.hide(),e.stop=!0}},click:function(){window.location.href=i(39)()||"file:///home/web/services.html"}}})),S.add(S.cancelBtn=new y({value:"Cancel",events:{keydown:function(e){switch(y.prototype.defaultEvents.keydown.call(this,e),e.code){case g.left:S.okBtn.focus();break;case g.back:case g.exit:S.hide(),e.stop=!0}},click:function(){S.hide()}}}))}),h.addListener("show",function(){try{l.focus(),l.focusItem(l.$focusItem)}catch(e){}window.breadcrumb=[]}),h.initService=function(e,t,i){var n=document.getElementById("pageServiceDescription");_.classList.add("logo"),B=[],n.innerText="TED is a platform for ideas worth spreading. Started in 1984 as a conference where technology, entertainment and design converged, TED today shares ideas from a broad spectrum — from science to business to global issues — in more than 100 languages. Meanwhile, independent TEDx events help share ideas in communities around the world.",T.loadPlugin(e,function(){I=T.current.plugin,I.info={serviceId:e},P=[I.root],window.breadcrumb=[],I.getCursor({item:I.root},function(e,n){e&&i(),I.getNext(n,function(e,i){i.forEach(function(e){var t={};t.value=e,B.push(t)}),I.root.searchable&&B.unshift({value:{title:"Search",type:D.TYPE_SEARCH,img:"1_Search.png"}}),l&&l.remove(),l=new f({data:B,size:B.length,render:function(e,t){var i=document.createElement("div"),s=document.createElement("div");e.innerHTML="",s.className="text",i.className="wrapper",s.innerText=t.value.title,t.value.specialClass?i.classList.add(t.value.specialClass):i.className="wrapper",t.value.searchType&&(e.data.value.searchType=t.value.searchType),i.appendChild(s),e.appendChild(i)}}),r.add(l),l.addListeners({"click:item":s,"focus:item":function(e){l.$node.style.top=h.$node.offsetHeight/2-l.$focusItem.index*l.$focusItem.offsetHeight-l.$focusItem.offsetHeight/2+"px",e.$curr.data.value.img&&(x.src="./img/icons/"+e.$curr.data.value.img)}}),l.$node.style.top=h.$node.offsetHeight/2-l.$node.firstChild.offsetHeight/2+"px",l.focus(),l.focusIndex(0),t()})})})},h.addListener("keydown",function(e){switch(e.code){case g.back:a();break;case g.exit:e.stop=!0,window.parent===window?P.length>1?h.initService(null,function(){l.focus()}):(c=m.current.activeComponent,S.show()):window.parent.postMessage("hide","*")}}),e.exports=h},function(e,t){"use strict";e.exports={main:[{title:"Themes",url:"themes",img:"2_Themes.png",type:3,system:{type:2}},{title:"Speakers",url:"http://www.ted.com/people/speakers?page=%n&per_page=30&sort=last",img:"3_Speakers.png",type:2,sortTypes:[{name:"last name",url:"http://www.ted.com/people/speakers?page=%n&per_page=30&sort=last"},{name:"first name",url:"http://www.ted.com/people/speakers?page=%n&per_page=30&sort=first"},{name:"Most recent",url:"http://www.ted.com/people/speakers?page=%n&per_page=30&sort=tals"}],system:{type:5}},{title:"Events",url:"http://www.ted.com/talks/events",img:"4_Evenrs.png",type:3,system:{type:8}},{title:"Languages",url:"lang",img:"5_Languages.png",type:3,system:{type:2}}],themes:[{title:"Technology",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=technology",img:"1Technology.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=technology"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=technology"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=technology"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=technology"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=technology"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=technology"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=technology"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=technology"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=technology"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=technology"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=technology"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=technology"}]},{title:"Entertainment",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=entertainment",img:"2Entertaiment.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=entertainment"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=entertainment"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=entertainment"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=entertainment"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=entertainment"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=entertainment"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=entertainment"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=entertainment"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=entertainment"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=entertainment"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=entertainment"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=entertainment"}]},{title:"Design",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=design",img:"3Design.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=design"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=design"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=design"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=design"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=design"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=design"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=design"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=design"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=design"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=design"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=design"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=design"}]},{title:"Business",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=business",img:"4Business.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=business"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=business"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=business"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=business"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=business"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=business"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=business"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=business"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=business"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=business"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=business"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=business"}]},{title:"Science",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=science",img:"5Science.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=science"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=science"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=science"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=science"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=science"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=science"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=science"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=science"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=science"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=science"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=science"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=science"}]},{title:"Global issues",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=global+issues",img:"6Globalissues.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&sort=newest&topics%5B%5D=global+issues"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&sort=oldest&topics%5B%5D=global+issues"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&sort=popular&topics%5B%5D=global+issues"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&sort=jaw-dropping&topics%5B%5D=global+issues"},{name:"funny",url:"http://www.ted.com/talks?page=%n&sort=funny&topics%5B%5D=global+issues"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&sort=persuasive&topics%5B%5D=global+issues"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&sort=courageous&topics%5B%5D=global+issues"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&sort=ingenious&topics%5B%5D=global+issues"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&sort=fascinating&topics%5B%5D=global+issues"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&sort=inspiring&topics%5B%5D=global+issues"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&sort=beautiful&topics%5B%5D=global+issues"},{name:"informative",url:"http://www.ted.com/talks?page=%n&sort=informative&topics%5B%5D=global+issues"}]},{title:"All themes",url:"allThemes",img:"2_Themes.png",type:3,system:{type:2}}],lang:[{title:"English",url:"http://www.ted.com/talks?page=%n&language=en&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=en&sort=newest"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=en&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=en&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=en&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=en&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=en&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=en&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=en&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=en&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=en&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=en&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=en&sort=informative"}]},{title:"EspaГ±ol",url:"http://www.ted.com/talks?page=%n&language=es&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=es&sort=newest"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=es&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=es&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=es&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=es&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=es&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=es&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=es&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=es&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=es&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=es&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=es&sort=informative"}]},{title:"German",url:"http://www.ted.com/talks?page=%n&language=de&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=de&sort=newest"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=de&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=de&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=de&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=de&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=de&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=de&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=de&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=de&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=de&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=de&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=de&sort=informative"}]},{title:"Russian",url:"http://www.ted.com/talks?page=%n&language=ru&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=ru&sort=newest"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=ru&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=ru&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=ru&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=ru&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=ru&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=ru&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=ru&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=ru&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=ru&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=ru&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=ru&sort=informative"}]},{title:"Turkish",url:"http://www.ted.com/talks?page=%n&language=tr&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=tr&sort=newest"
+},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=tr&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=tr&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=tr&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=tr&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=tr&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=tr&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=tr&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=tr&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=tr&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=tr&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=tr&sort=informative"}]},{title:"Ukrainian",url:"http://www.ted.com/talks?page=%n&language=uk&sort=newest",img:"5_Languages.png",type:2,system:{type:3},sortTypes:[{name:"newest",url:"http://www.ted.com/talks?page=%n&language=uk&sort=newest"},{name:"oldest",url:"http://www.ted.com/talks?page=%n&language=uk&sort=oldest"},{name:"most viewed",url:"http://www.ted.com/talks?page=%n&language=uk&sort=popular"},{name:"jaw-dropping",url:"http://www.ted.com/talks?page=%n&language=uk&sort=jaw-dropping"},{name:"funny",url:"http://www.ted.com/talks?page=%n&language=uk&sort=funny"},{name:"persuasive",url:"http://www.ted.com/talks?page=%n&language=uk&sort=persuasive"},{name:"courageous",url:"http://www.ted.com/talks?page=%n&language=uk&sort=courageous"},{name:"ingenious",url:"http://www.ted.com/talks?page=%n&language=uk&sort=ingenious"},{name:"fascinating",url:"http://www.ted.com/talks?page=%n&language=uk&sort=fascinating"},{name:"inspiring",url:"http://www.ted.com/talks?page=%n&language=uk&sort=inspiring"},{name:"beautiful",url:"http://www.ted.com/talks?page=%n&language=uk&sort=beautiful"},{name:"informative",url:"http://www.ted.com/talks?page=%n&language=uk&sort=informative"}]}],allThemes:[{title:"A-B",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["A","B"]}},{title:"C",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["C"]}},{title:"D-E",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["D","E"]}},{title:"F-H",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["F","G","H"]}},{title:"I-L",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["I","J","K","L"]}},{title:"M-N",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["M","N"]}},{title:"O-R",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["O","P","Q","R"]}},{title:"S",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["S"]}},{title:"T-Z",url:"http://www.ted.com/topics",img:"2_Themes.png",type:3,system:{type:4,letters:["T","U","V","W","X","Y","Z"]}}]}},function(e,t,i){"use strict";function s(e,t,i,s){var n=new XMLHttpRequest;return"callback"===s?(i(),!0):(n.onreadystatechange=function(){var e;4===n.readyState&&(e="xml"===s?n.responseXML:"json"===s?JSON.parse(n.responseText):n.responseText,i(e,n.status))},n.open(e,t,!0),"json"===s&&n.setRequestHeader("Accept","application/json"),n.send(),n)}var n={TYPE_ROOT:1,TYPE_CATEGORY:2,TYPE_FOLDER:3,TYPE_MOVIE:4,TYPE_FILE:5},a={TYPE_ROOT:1,TYPE_MENU_LIST:2,TYPE_THEME:3,TYPE_THEME_LIST:4,TYPE_SPEAKERS_LIST:5,TYPE_VIDEO:6,TYPE_SPEAKER:7,TYPE_EVENT_LIST:8,TYPE_EVENT_SUB_LIST:9,TYPE_SEARCH:10},o=i(29);n.root={title:"ted.com",url:"https://ted.com",img:"",type:n.TYPE_ROOT,system:{type:a.TYPE_ROOT,search:[]},searchable:!0},n.getNext=function(e,t){var i,r,l,c=this;switch(e.page++,e.system.type){case a.TYPE_ROOT:if(l="callback",e.page>0)return void t(!1,[]);r=function(){t(!1,o.main)};break;case a.TYPE_MENU_LIST:if(l="callback",e.page>0)return void t(!1,[]);r=function(){t(!1,o[e.url])};break;case a.TYPE_THEME_LIST:i=e.url,r=function(i){var s,n,o,r=!1,l=[];if(i=i.split("")[1],void 0===i&&e.page>0)return void t(r,[]);for(i=i.split("class='topics__list__topic'"),s=1;s")),-1!==e.system.letters.indexOf(n[0])&&l.push({title:n,url:o,system:{type:a.TYPE_THEME},type:2});t(r,l)};break;case a.TYPE_THEME:i=e.url.replace("%n",e.page+1),r=function(i){var s,o,r,l,c,u,d=!1,p=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(d,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"')).replace("&","&"),c=i[s].split("talk-link__speaker'>")[1],c=c.substring(0,c.indexOf("')[1],u=u.substring(0,u.indexOf("")),r=i[s].split("class='media__message'")[1].split("href=")[1],r="http://www.ted.com"+r.substring(1,r.indexOf("'>")),p.push({title:o,img:l,author:c,duration:u,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_SPEAKERS_LIST:i=e.url.replace("%n",e.page+1),r=function(i){var s,n,o,r,l,u=!1,d=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")),o=i[s].split("")[1].split("")[1],r=r.substring(0,r.indexOf("
"," ").replace("\n",""),l=i[s].split("")[1],l=l.substring(l.indexOf("")+8,l.indexOf("")),d.push({img:o,url:"http://www.ted.com"+n,author:r,profession:l,type:c.TYPE_FOLDER,system:{type:a.TYPE_SPEAKER}});t(u,d)};break;case a.TYPE_SPEAKER:i=e.url,r=function(i){var s,n,o,r,l,u,d=!1,p=[];if((u=i.split("
")[1])&&(u=u.substring(0,u.indexOf("’"))),i=i.split("")[1],void 0===i||e.page>0)return void t(d,[]);for(i=i.split(""),s=1;s')[1],l=l.substring(0,l.indexOf("")),n=i[s].split("href='")[1],n="http://www.ted.com"+n.substring(0,n.indexOf("'>")),r=i[s].split("")[1],r=r.substring(r.indexOf(">")+1,r.indexOf("")),p.push({img:o,url:n,duration:l,title:r,type:c.TYPE_MOVIE,author:u,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_EVENT_LIST:if(l="json",i=e.url,e.page>0)return void t(!1,[]);r=function(i){var s=[],o=[];i.forEach(function(t){-1===o.indexOf(t.year)&&(o.push(t.year),s.push({title:t.year,url:e.url+"/"+t.year,type:n.TYPE_FOLDER,system:{type:a.TYPE_EVENT_SUB_LIST}}))}),t(!1,s)};break;case a.TYPE_EVENT_SUB_LIST:if(l="json",i="http://www.ted.com/talks/events",e.page>0)return void t(!1,[]);r=function(i){var s=[],o=e.url.substring(e.url.lastIndexOf("/")+1);i.forEach(function(e){e.year===o&&s.push({title:e.label,url:"http://www.ted.com/talks?event="+e.value+"&page=%n&sort=newest",type:n.TYPE_CATEGORY,system:{type:a.TYPE_THEME}})}),t(!1,s)};break;case a.TYPE_VIDEO:if(i=e.url,e.page>0)return void t(!1,[]);r=function(e){var i;if(e=e.split('"talkPage.init",')[1],void 0===e)return void t(!0,[]);e=e.substring(0,e.indexOf(")"));try{i=JSON.parse(e)}catch(s){return void t(!0,[])}t(!1,[i.talks[0]])};break;case a.TYPE_SEARCH:i=e.url.replace("%n",e.page+1),r=function(i){var s,o,r,l,c,u=!1,d=[];if(i=i.split("")[1].split("")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),c=o.substr(0,o.indexOf(":")),o=o.substring(o.indexOf(":")+2),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"'))+"quality=89&w=320",r=i[s].split('')),d.push({title:o,img:l,author:c,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(u,d)}}r?s("GET",i,r,l):t(!1,{})},n.getPrev=function(e,t){var i,o,r,l=this;if(e.page<0)return void t(!1,[]);switch(e.system.type){case a.TYPE_ROOT:if(r="json",i="http://192.168.1.53:8033/main.json",e.page>0)return void t(!1,[]);o=function(e){e?t(!1,e):t(!0,[])};break;case a.TYPE_MENU_LIST:if(r="json",i=e.url,e.page>0)return void t(!1,[]);o=function(e){e?t(!1,e):t(!0,[])};break;case a.TYPE_THEME_LIST:i=e.url,o=function(i){var s,n,o,r=!1,l=[];if(i=i.split("")[1],void 0===i&&e.page>0)return void t(r,[]);for(i=i.split("class='topics__list__topic'"),s=1;s")),-1!==e.system.letters.indexOf(n[0])&&l.push({title:n,url:o,system:{type:a.TYPE_THEME},type:2});t(r,l)};break;case a.TYPE_THEME:i=e.url.replace("%n",e.page+1),o=function(i){var s,o,r,l,c,u,d=!1,p=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(d,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"')).replace("&","&"),c=i[s].split("talk-link__speaker'>")[1],c=c.substring(0,c.indexOf("')[1],u=u.substring(0,u.indexOf("")),r=i[s].split("class='media__message'")[1].split("href=")[1],r="http://www.ted.com"+r.substring(1,r.indexOf("'>")),p.push({title:o,img:l,author:c,duration:u,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_SPEAKERS_LIST:i=e.url.replace("%n",e.page+1),o=function(i){var s,n,o,r,c,u=!1,d=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")),o=i[s].split("")[1].split("")[1],r=r.substring(0,r.indexOf("
"," ").replace("\n",""),c=i[s].split("")[1],c=c.substring(c.indexOf("")+8,c.indexOf("")),d.push({img:o,url:"http://www.ted.com"+n,author:r,profession:c,type:l.TYPE_FOLDER,system:{type:a.TYPE_SPEAKER}});t(u,d)};break;case a.TYPE_SPEAKER:i=e.url,o=function(i){var s,n,o,r,c,u,d=!1,p=[];if((u=i.split("
")[1])&&(u=u.substring(0,u.indexOf("’"))),i=i.split("
")[1],r=r.substring(0,r.indexOf("
"," ").replace("\n",""),l=i[s].split("")[1],l=l.substring(l.indexOf("")+8,l.indexOf("")),d.push({img:o,url:"http://www.ted.com"+n,author:r,profession:l,type:c.TYPE_FOLDER,system:{type:a.TYPE_SPEAKER}});t(u,d)};break;case a.TYPE_SPEAKER:i=e.url,r=function(i){var s,n,o,r,l,u,d=!1,p=[];if((u=i.split("
")[1])&&(u=u.substring(0,u.indexOf("’"))),i=i.split("")[1],void 0===i||e.page>0)return void t(d,[]);for(i=i.split(""),s=1;s')[1],l=l.substring(0,l.indexOf("")),n=i[s].split("href='")[1],n="http://www.ted.com"+n.substring(0,n.indexOf("'>")),r=i[s].split("")[1],r=r.substring(r.indexOf(">")+1,r.indexOf("")),p.push({img:o,url:n,duration:l,title:r,type:c.TYPE_MOVIE,author:u,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_EVENT_LIST:if(l="json",i=e.url,e.page>0)return void t(!1,[]);r=function(i){var s=[],o=[];i.forEach(function(t){-1===o.indexOf(t.year)&&(o.push(t.year),s.push({title:t.year,url:e.url+"/"+t.year,type:n.TYPE_FOLDER,system:{type:a.TYPE_EVENT_SUB_LIST}}))}),t(!1,s)};break;case a.TYPE_EVENT_SUB_LIST:if(l="json",i="http://www.ted.com/talks/events",e.page>0)return void t(!1,[]);r=function(i){var s=[],o=e.url.substring(e.url.lastIndexOf("/")+1);i.forEach(function(e){e.year===o&&s.push({title:e.label,url:"http://www.ted.com/talks?event="+e.value+"&page=%n&sort=newest",type:n.TYPE_CATEGORY,system:{type:a.TYPE_THEME}})}),t(!1,s)};break;case a.TYPE_VIDEO:if(i=e.url,e.page>0)return void t(!1,[]);r=function(e){var i;if(e=e.split('"talkPage.init",')[1],void 0===e)return void t(!0,[]);e=e.substring(0,e.indexOf(")"));try{i=JSON.parse(e)}catch(s){return void t(!0,[])}t(!1,[i.talks[0]])};break;case a.TYPE_SEARCH:i=e.url.replace("%n",e.page+1),r=function(i){var s,o,r,l,c,u=!1,d=[];if(i=i.split("")[1].split("")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),c=o.substr(0,o.indexOf(":")),o=o.substring(o.indexOf(":")+2),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"'))+"quality=89&w=320",r=i[s].split('')),d.push({title:o,img:l,author:c,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(u,d)}}r?s("GET",i,r,l):t(!1,{})},n.getPrev=function(e,t){var i,o,r,l=this;if(e.page<0)return void t(!1,[]);switch(e.system.type){case a.TYPE_ROOT:if(r="json",i="http://192.168.1.53:8033/main.json",e.page>0)return void t(!1,[]);o=function(e){e?t(!1,e):t(!0,[])};break;case a.TYPE_MENU_LIST:if(r="json",i=e.url,e.page>0)return void t(!1,[]);o=function(e){e?t(!1,e):t(!0,[])};break;case a.TYPE_THEME_LIST:i=e.url,o=function(i){var s,n,o,r=!1,l=[];if(i=i.split("")[1],void 0===i&&e.page>0)return void t(r,[]);for(i=i.split("class='topics__list__topic'"),s=1;s")),-1!==e.system.letters.indexOf(n[0])&&l.push({title:n,url:o,system:{type:a.TYPE_THEME},type:2});t(r,l)};break;case a.TYPE_THEME:i=e.url.replace("%n",e.page+1),o=function(i){var s,o,r,l,c,u,d=!1,p=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(d,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"')).replace("&","&"),c=i[s].split("talk-link__speaker'>")[1],c=c.substring(0,c.indexOf("')[1],u=u.substring(0,u.indexOf("")),r=i[s].split("class='media__message'")[1].split("href=")[1],r="http://www.ted.com"+r.substring(1,r.indexOf("'>")),p.push({title:o,img:l,author:c,duration:u,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_SPEAKERS_LIST:i=e.url.replace("%n",e.page+1),o=function(i){var s,n,o,r,c,u=!1,d=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")),o=i[s].split("")[1].split("")[1],r=r.substring(0,r.indexOf("
"," ").replace("\n",""),c=i[s].split("")[1],c=c.substring(c.indexOf("")+8,c.indexOf("")),d.push({img:o,url:"http://www.ted.com"+n,author:r,profession:c,type:l.TYPE_FOLDER,system:{type:a.TYPE_SPEAKER}});t(u,d)};break;case a.TYPE_SPEAKER:i=e.url,o=function(i){var s,n,o,r,c,u,d=!1,p=[];if((u=i.split("
")[1])&&(u=u.substring(0,u.indexOf("’"))),i=i.split("
")[1],r=r.substring(r.indexOf(">")+1,r.indexOf("")),p.push({img:o,url:n,duration:l,title:r,type:c.TYPE_MOVIE,author:u,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_EVENT_LIST:if(l="json",i=e.url,e.page>0)return void t(!1,[]);r=function(i){var s=[],o=[];i.forEach(function(t){-1===o.indexOf(t.year)&&(o.push(t.year),s.push({title:t.year,url:e.url+"/"+t.year,type:n.TYPE_FOLDER,system:{type:a.TYPE_EVENT_SUB_LIST}}))}),t(!1,s)};break;case a.TYPE_EVENT_SUB_LIST:if(l="json",i="http://www.ted.com/talks/events",e.page>0)return void t(!1,[]);r=function(i){var s=[],o=e.url.substring(e.url.lastIndexOf("/")+1);i.forEach(function(e){e.year===o&&s.push({title:e.label,url:"http://www.ted.com/talks?event="+e.value+"&page=%n&sort=newest",type:n.TYPE_CATEGORY,system:{type:a.TYPE_THEME}})}),t(!1,s)};break;case a.TYPE_VIDEO:if(i=e.url,e.page>0)return void t(!1,[]);r=function(e){var i;if(e=e.split('"talkPage.init",')[1],void 0===e)return void t(!0,[]);e=e.substring(0,e.indexOf(")"));try{i=JSON.parse(e)}catch(s){return void t(!0,[])}t(!1,[i.talks[0]])};break;case a.TYPE_SEARCH:i=e.url.replace("%n",e.page+1),r=function(i){var s,o,r,l,c,u=!1,d=[];if(i=i.split("")[1].split("")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),c=o.substr(0,o.indexOf(":")),o=o.substring(o.indexOf(":")+2),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"'))+"quality=89&w=320",r=i[s].split('')),d.push({title:o,img:l,author:c,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(u,d)}}r?s("GET",i,r,l):t(!1,{})},n.getPrev=function(e,t){var i,o,r,l=this;if(e.page<0)return void t(!1,[]);switch(e.system.type){case a.TYPE_ROOT:if(r="json",i="http://192.168.1.53:8033/main.json",e.page>0)return void t(!1,[]);o=function(e){e?t(!1,e):t(!0,[])};break;case a.TYPE_MENU_LIST:if(r="json",i=e.url,e.page>0)return void t(!1,[]);o=function(e){e?t(!1,e):t(!0,[])};break;case a.TYPE_THEME_LIST:i=e.url,o=function(i){var s,n,o,r=!1,l=[];if(i=i.split("")[1],void 0===i&&e.page>0)return void t(r,[]);for(i=i.split("class='topics__list__topic'"),s=1;s")),-1!==e.system.letters.indexOf(n[0])&&l.push({title:n,url:o,system:{type:a.TYPE_THEME},type:2});t(r,l)};break;case a.TYPE_THEME:i=e.url.replace("%n",e.page+1),o=function(i){var s,o,r,l,c,u,d=!1,p=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(d,[]);for(i=i.split(""),s=1;s")+1,o.indexOf("")),l=i[s].split('class=" thumb__image"')[1].split('src="')[1],l=l.substring(0,l.indexOf('"')).replace("&","&"),c=i[s].split("talk-link__speaker'>")[1],c=c.substring(0,c.indexOf("')[1],u=u.substring(0,u.indexOf("")),r=i[s].split("class='media__message'")[1].split("href=")[1],r="http://www.ted.com"+r.substring(1,r.indexOf("'>")),p.push({title:o,img:l,author:c,duration:u,url:r,type:n.TYPE_MOVIE,system:{type:a.TYPE_VIDEO}});t(d,p)};break;case a.TYPE_SPEAKERS_LIST:i=e.url.replace("%n",e.page+1),o=function(i){var s,n,o,r,c,u=!1,d=[];if(i=i.split("id='browse-results'")[1],void 0===i&&e.page>0)return void t(u,[]);for(i=i.split(""),s=1;s")),o=i[s].split("")[1].split("")[1],r=r.substring(0,r.indexOf("
"," ").replace("\n",""),c=i[s].split("")[1],c=c.substring(c.indexOf("")+8,c.indexOf("")),d.push({img:o,url:"http://www.ted.com"+n,author:r,profession:c,type:l.TYPE_FOLDER,system:{type:a.TYPE_SPEAKER}});t(u,d)};break;case a.TYPE_SPEAKER:i=e.url,o=function(i){var s,n,o,r,c,u,d=!1,p=[];if((u=i.split("
")[1])&&(u=u.substring(0,u.indexOf("’"))),i=i.split("
")[1],r=r.substring(0,r.indexOf("
"," ").replace("\n",""),c=i[s].split("")[1],c=c.substring(c.indexOf("")+8,c.indexOf("")),d.push({img:o,url:"http://www.ted.com"+n,author:r,profession:c,type:l.TYPE_FOLDER,system:{type:a.TYPE_SPEAKER}});t(u,d)};break;case a.TYPE_SPEAKER:i=e.url,o=function(i){var s,n,o,r,c,u,d=!1,p=[];if((u=i.split("