magcore-app-update-manager
Version:
Update manager application.
1 lines • 69.6 kB
JavaScript
!function(e){var t={};function i(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(s,n,function(t){return e[t]}.bind(null,n));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=21)}([function(e,t,i){"use strict";var s=i(17);s.back=s.backspace,s.channelNext=s.tab,s.channelPrev=s.tab+"s",s.ok=s.enter,s.exit=s.escape,s.volumeUp=107,s.volumeDown=109,s.f1="112c",s.f2="113c",s.f3="114c",s.f4="115c",s.refresh="116c",s.frame="117c",s.phone="119c",s.set="120c",s.tv="121c",s.menu="122c",s.app="123c",s.rewind="66a",s.forward="70a",s.audio="71a",s.standby="74a",s.keyboard="76a",s.usbMounted="80a",s.usbUnmounted="81a",s.playPause="82a",s.play=-1,s.pause=-1,s.stop="83a",s.power="85a",s.record="87a",s.info="89a",s.mute="192a",s.digit0=48,s.digit1=49,s.digit2=50,s.digit3=51,s.digit4=52,s.digit5=53,s.digit6=54,s.digit7=55,s.digit8=56,s.digit9=57,e.exports=s},function(e,t,i){"use strict";var s=i(4),n=i(13),a=0;function o(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),this.$node=e.$node||document.createElement("div"),this.$body=e.$body||this.$node,this.$node.className=this.name+" "+(e.className||""),this.id=e.id||this.$node.id||"cid"+a++,e.parent&&e.parent.add(this),!1===e.visible&&this.hide(),!1===e.focusable&&(this.focusable=!1),this.defaultEvents)for(t in e.events=e.events||{},this.defaultEvents)e.events[t]=e.events[t]||this.defaultEvents[t];e.events&&Object.keys(e.events).forEach(function(t){i.addListener(t,e.events[t])}),e.children&&this.add.apply(this,e.children),this.$node.addEventListener("click",function(e){i.focus(),i.events["click"]&&i.emit("click",e),e.stopPropagation()}),this.name,this.id,this.name,this.id}o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.prototype.defaultEvents=null,o.prototype.add=function(e){var t;for(t=0;t<arguments.length;t++)e=arguments[t],this.children.push(e),e.parent=this,e.$node&&null===e.$node.parentNode&&this.$body.appendChild(e.$node),e.name,e.id,this.name,this.id,this.name,this.id,e.name,e.id,this.events["add"]&&this.emit("add",{item:e})},o.prototype.remove=function(){this.parent&&(s.activePage.activeComponent===this&&(this.blur(),this.parent.focus()),this.parent.children.splice(this.parent.children.indexOf(this),1)),this.children.forEach(function(e){e.remove()}),this.$node.parentNode.removeChild(this.$node),this.events["remove"]&&this.emit("remove"),this.events={},this.name,this.id,this.name,this.id},o.prototype.focus=function(e){var t=s.activePage,i=t.activeComponent;return!(!this.focusable||this===i)&&(i&&i.blur(),t.activeComponent=i=this,i.$node.classList.add("focus"),this.name,this.id,this.name,this.id,i.events["focus"]&&i.emit("focus",e),!0)},o.prototype.blur=function(){var e=s.activePage,t=e.activeComponent;return this.$node.classList.remove("focus"),this===t?(e.activeComponent=null,this.name,this.id,this.name,this.id,this.events["blur"]&&this.emit("blur"),!0):(this.name,this.id,this.name,this.id,!1)},o.prototype.show=function(e,t){return!this.visible&&(this.$node.classList.remove("hidden"),this.visible=!0,this.name,this.id,this.name,this.id,this.events["show"]&&this.emit("show",e),"function"==typeof t&&setTimeout(t),!0)},o.prototype.hide=function(e){return!!this.visible&&(this.$node.classList.add("hidden"),this.visible=!1,this.name,this.id,this.name,this.id,this.events["hide"]&&this.emit("hide"),"function"==typeof e&&setTimeout(e),!0)},e.exports=o},function(e,t,i){"use strict";e.exports=i(1)},function(e,t,i){"use strict";var s=i(22);e.exports=s},function(e,t,i){"use strict";var s=i(13),n=i(23).parse,a=new s;a.query=n(document.location.search.substring(1)),a.config=i(24),a.activePage=null,a.route=function(e,t){var i,s=a.activePage;return!(!e||e.active)&&(e.name,e.id,e.name,e.id,(i=a.activePage)&&i.active&&(i.$node.classList.remove("active"),i.active=!1,a.activePage=null,i.name,i.id,i.name,i.id,i.events["hide"]&&i.emit("hide")),function(e,t){!e||e.active||(e.$node.classList.add("active"),e.active=!0,a.activePage=e,e.name,e.id,e.name,e.id,e.events["show"]&&e.emit("show",{data:t}))}(e,t),this.events["route"]&&this.emit("route",{from:s,to:e}),!0)},e.exports=a},function(e,t,i){"use strict";e.exports=i(33),e.exports.prototype.name="stb-component-page"},function(e,t,i){"use strict";var s=i(18),n=i(19);function a(e){var t=this;e=e||{},this.handlers={},this.$noData=null,e.propagate=void 0===e.propagate||e.propagate,this.fixedData=e.fixedData||!1,e.$body=document.createElement("div"),e.$body.className="body",this.$noData=document.createElement("div"),this.$noData.className="noData hidden",s.call(this,e),this.$node.appendChild(this.$body),this.$node.appendChild(this.$noData),this.addListener("click:item",function(e){e.$item.layout.children.length&&!e.inner&&e.$item.layout.children[e.$item.layout.focusIndex].focus(),e.inner&&(t.focus(),t.focusItem(e.$item)),t.handlers[e.$item.index]&&t.handlers[e.$item.index](e.$item)})}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,a.prototype.name="mag-component-layout-list",a.prototype.renderItemDefault=function(e,t){var i,s,a,o,l;if(e.ready&&this.fixedData)for(l=0;l<t.items.length;l++)"string"!=typeof(o=t.items[l]).value&&void 0!==o.value||((a=e.layout.$node.childNodes[l]).innerText=o.value||"",a.className=o.className||"");else{for(;e.firstChild;)e.removeChild(e.firstChild);s={focusable:!1,data:t.items},t.className&&(s.className=t.className),i=new n(s),e.appendChild(i.$node),e.layout=i,i.parent=this,i.$parentItem=e,i.addListener("click",function(){i.parent.emit("click:item",{$item:e,inner:!0})}),t.click&&(this.handlers[e.index]=t.click),e.ready=!0}e.value=t.value||{}},a.prototype.setData=function(e){s.prototype.setData.call(this,e),e.data&&e.data.length?this.$noData.classList.add("hidden"):this.$noData.classList.remove("hidden")},a.prototype.init=function(e){var t;s.prototype.init.call(this,e),e.noData&&(this.$noData.innerHTML="",e.noData instanceof Element?this.$noData.appendChild(e.noData):"string"==typeof e.noData&&((t=document.createElement("div")).innerText=e.noData,this.$noData.appendChild(t))),e.data&&e.data.length?this.$noData.classList.add("hidden"):this.$noData.classList.remove("hidden")},a.prototype.renderItem=a.prototype.renderItemDefault,e.exports=a},function(e,t,i){"use strict";var s={tag:function(e,t,i){var s,n,a=null;if(e){if(a=document.createElement(e),t&&"object"==typeof t)for(n in t)a[n]=t[n];for(s=2;s<arguments.length;s++)arguments[s]&&a.appendChild("object"==typeof arguments[s]?arguments[s]:document.createTextNode(arguments[s]))}return a},fragment:function(e){var t,i=document.createDocumentFragment();for(t=0;t<arguments.length;t++)(e=arguments[t])&&i.appendChild("object"==typeof e?e:document.createTextNode(e));return i},add:function(e,t){var i;if(e instanceof Node){for(i=1;i<arguments.length;i++)arguments[i]&&e.appendChild("object"==typeof arguments[i]?arguments[i]:document.createTextNode(arguments[i]));return e}return null},remove:function(e){var t,i=0;for(t=0;t<arguments.length;t++)arguments[t]&&arguments[t].parentNode&&arguments[t].parentNode.removeChild(arguments[t])===arguments[t]&&i++;return arguments.length>0&&i===arguments.length},clear:function(e){for(;e.lastChild;)e.removeChild(e.lastChild)}};e.exports=s},function(e,t,i){"use strict";var s=i(2);function n(e){var t;e=e||{},this.timerId=0,e.render&&(this.render=e.render),e.focusable=!1,e.visible=e.visible||!0,this.value=e.value,this.active=!1,Object.defineProperty(this,"interval",{set:function(e){t=e},get:function(){return t}}),this.interval=e.interval||1e3,s.call(this,e)}n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.name="spa-component-flicker",n.prototype.start=function(){var e=this;this.active||(this.active=!0,function t(){e.render(e.$node,e.value),e.timerId=setTimeout(t,e.interval)}())},n.prototype.stop=function(){this.active&&(this.active=!1,clearTimeout(this.timerId))},n.prototype.defaultRender=function(e,t){e.innerText=t},n.prototype.render=n.prototype.defaultRender,e.exports=n},function(e,t,i){"use strict";var s=i(2),n=i(0);function a(e){var t,i=this;function a(e){switch(e.code){case n.left:i.focusIndex>0&&i.panels[i.focusIndex-1].focus();break;case n.right:i.focusIndex<i.panels.length-1&&i.panels[i.focusIndex+1].focus()}}for((e=e||{}).focusable=e.focusable||!1,s.call(this,e),this.panels=e.panels,this.focusIndex=0,e.panels&&!e.panels[0].main&&(e.panels[0].$node.classList.add("left"),e.panels[0].$node.classList.add("expand")),e.panels&&e.panels[1]&&e.panels[1].main&&e.panels[1].$node.classList.add("position-right"),e.panels&&e.panels[2]&&e.panels[1].main&&e.panels[2].$node.classList.add("right"),e.panels&&this.add.apply(this,e.panels),t=0;t<this.panels.length;t++)this.panels[t].addListeners({keydown:a}),this.panels[t].index=t}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,a.prototype.name="mag-component-panel-set",a.prototype.focus=function(){s.prototype.focus.call(this),this.panels[this.focusIndex].focus()},a.prototype.blur=function(){this.panels[this.focusIndex].blur()},e.exports=a},function(e,t,i){"use strict";var s=i(2),n=i(19);function a(e){var t;e=e||{},this.size=1,this.main=!1,this.index=0,e.$body=document.createElement("div"),e.$body.className="body",s.call(this,e),e.size&&(this.size=e.size,this.$node.classList.add("size"+e.size)),e.main&&(this.main=!0,this.$node.classList.add("main")),this.$shadow={left:document.createElement("div"),right:document.createElement("div")},this.$shadow.left.className="shadow left",this.$node.appendChild(this.$shadow.left),this.$shadow.right.className="shadow right",this.$node.appendChild(this.$shadow.right),e.title&&(Array.isArray(e.title)||(e.title=[e.title]),this.$title=new n({className:"title",data:e.title,focusable:!1}),this.$node.appendChild(this.$title.$node)),this.$node.appendChild(this.$body),(t=document.createElement("div")).className="overlay",this.$node.appendChild(t)}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,a.prototype.name="mag-component-panel",a.prototype.defaultEvents={focus:function(){this.children.length&&this.children[0].focus()}},a.prototype.focus=function(){this.focusable&&(this.parent.panels[this.parent.focusIndex].$node.classList.remove("active"),this.parent.panels[this.parent.focusIndex].$node.classList.remove("top"),s.prototype.focus.call(this),this.parent.focusIndex=this.index,this.$node.classList.add("active"),this.$node.classList.add("top"),0===this.index&&this.parent.panels[1]&&this.parent.panels[1].main?(this.parent.panels[1].$node.classList.remove("position-left"),this.parent.panels[1].$node.classList.add("position-right"),this.parent.panels[2]&&this.parent.panels[2].$node.classList.remove("expand"),this.$node.classList.add("expand")):2===this.index&&this.parent.panels[1].main&&(this.parent.panels[1].$node.classList.remove("position-right"),this.parent.panels[1].$node.classList.add("position-left"),this.parent.panels[0].$node.classList.remove("expand"),this.$node.classList.add("expand")))},a.prototype.blur=function(){this.parent.panels[this.parent.focusIndex].$node.classList.remove("active"),s.prototype.blur.call(this)},e.exports=a},function(e,t,i){"use strict";var s=i(34),n=i(2),a=i(0);function o(e){var t,i,n,o=this;(e=e||{}).events=e.events||{},e.focusable=e.focusable||!1,e.visible=e.visible||!1,e.events.click=e.events.click||function(){o.hide()},n=e.events.keydown,e.events.keydown=function(e){n&&n.call(this,e),e.code!==a.back&&e.code!==a.menu||(e.stop=!0,o.hide())},s.call(this,e),this.$node.appendChild(document.createElement("div")),this.$node.firstChild.classList.add("alignBox"),this.$node.firstChild.appendChild(document.createElement("div")),this.$header=document.createElement("div"),this.$header.className="header",this.$text=this.$header.appendChild(document.createElement("div")),this.$text.classList.add("text"),this.$text.innerText=e.title||"",e.icon&&(this.$icon=this.$header.appendChild(document.createElement("div")),this.$icon.className="icon "+e.icon),(t=document.createElement("div")).className="overlay",i=this.$body.parentNode.removeChild(this.$body),this.$node.firstChild.firstChild.appendChild(this.$header),this.$node.firstChild.firstChild.appendChild(i),this.$node.firstChild.firstChild.appendChild(t)}o.prototype=Object.create(s.prototype),o.prototype.constructor=o,o.prototype.name="mag-component-modal",o.prototype.focus=function(){this.$node.classList.add("active"),s.prototype.focus.call(this),this.children[0]&&this.children[0]instanceof n&&this.children[0].focus()},o.prototype.blur=function(){this.$node.classList.remove("active"),s.prototype.blur.call(this)},e.exports=o},function(e,t,i){"use strict";e.exports=i(36),e.exports.prototype.name="stb-component-scrollbar"},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(){i.removeListener(e,s),t.apply(i,arguments)})},addListeners:function(e){var t;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))},emit:function(e){var t,i=this.events[e];if(i)for(t=0;t<i.length;t++)i[t].apply(this,Array.prototype.slice.call(arguments,1))}},s.prototype.constructor=s,e.exports=s},function(e,t,i){"use strict";var s=i(18),n="theme-icon theme-icon-radio",a="theme-icon theme-icon-radio-active";function o(e){var t=this;e.classIcon&&(n=e.classIcon),e.classIconActive&&(a=e.classIconActive),e.classChecked&&(n=e.classChecked),this.checkedData=null,this.checkedIndex=null,s.call(this,e),this.addListener("click:item",function(e){var i=e.$item,s=t.checkedData;t.checkIndex(i.index),s!==i.data&&t.emit("select",i)})}o.prototype=Object.create(s.prototype),o.prototype.constructor=o,o.prototype.name="mag-component-radio-list",o.prototype.init=function(e){e=e||{},s.prototype.init.call(this,e)},o.prototype.setData=function(e){s.prototype.setData.call(this,e),this.defaultCheckedIndex=this.checkedIndex,this.$focusItem?this.defaultFocusIndex=this.$focusItem.index:this.defaultFocusIndex=0},o.prototype.resetData=function(){this.checkIndex(this.defaultCheckedIndex),this.focusIndex(this.defaultFocusIndex)},o.prototype.clearChecked=function(e){for(var t=0;t<this.data.length;t++)this.data[t].state=!1;e||0===e||(e=this.$focusItem?this.$focusItem.index:0),this.setData({data:this.data,focusIndex:e})},o.prototype.renderItemDefault=function(e,t){var i,s,o,l;e.ready?(e.$title.innerText=t.title||"",t.state?(e.classList.add("checked"),e.checkBox.className=a):(e.classList.remove("checked"),e.checkBox.className=n),e.state=t.state,e.value=t.value):(e.innerHTML="",i=document.createElement("table"),s=document.createElement("tr"),o=document.createElement("td"),l=document.createElement("div"),t.state?(e.classList.add("checked"),l.className=a):(e.classList.remove("checked"),l.className=n),i.appendChild(s),o.appendChild(l),o.className="checkBoxWrapper",s.appendChild(o),(o=document.createElement("td")).className="title",o.innerText=t.title||"",s.appendChild(o),e.checkBox=l,e.state=t.state,e.value=t.value,e.$title=o,e.appendChild(i),t.state&&(this.checkedData=t,this.checkedIndex=e.index),e.ready=!0)},o.prototype.checkIndex=function(e){var t;e!==this.checkedIndex&&(null!==this.checkedIndex&&this.$node.children.length&&(this.data[this.checkedIndex].state=!1,(t=this.getItemNodeByIndex(this.checkedIndex))&&(t.checkBox.className=n,t.classList.remove("checked"))),(t=this.getItemNodeByIndex(e))&&(t.checkBox.className=a,t.classList.add("checked"),t.state=!0),this.data[e].state=!0,this.checkedData=this.data[e],this.checkedIndex=e)},o.prototype.getItemNodeByIndex=function(e){var t=this.$node.children;return(e-=this.viewIndex)<this.size&&e>=0?t[e]:null},o.prototype.renderItem=o.prototype.renderItemDefault,e.exports=o},function(e,t,i){"use strict";e.exports=i(38),e.exports.prototype.name="stb-component-button"},function(e,t,i){"use strict";var s=i(4);e.exports=function(e){var t=document.createElement("link");t.rel="stylesheet",t.href="css/"+e+"."+s.metrics.height+".css",document.head.appendChild(t)}},function(e,t,i){"use strict";e.exports={backspace:8,tab:9,enter:13,escape:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,del:46}},function(e,t,i){"use strict";var s=i(2),n=i(0);function a(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),this.provider=null,this.type===this.TYPE_HORIZONTAL&&(e.className+=" horizontal"),s.call(this,e),this.init(e)}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,a.prototype.name="mag-component-list",a.prototype.TYPE_VERTICAL=1,a.prototype.TYPE_HORIZONTAL=2,a.prototype.renderItemDefault=function(e,t){e.innerText=t.value},a.prototype.renderItem=a.prototype.renderItemDefault,a.prototype.defaultEvents={mousewheel:function(e){this.type===this.TYPE_VERTICAL&&e.wheelDeltaY&&this.move(e.wheelDeltaY>0?n.up:n.down),this.type===this.TYPE_HORIZONTAL&&e.wheelDeltaX&&this.move(e.wheelDeltaX>0?n.left:n.right)},keydown:function(e){switch(e.code){case n.up:case n.down:case n.right:case n.left:case n.pageUp:case n.pageDown:case n.home:case n.end:this.move(e.code);break;case n.enter:this.events["click:item"]&&this.$focusItem&&this.emit("click:item",{$item:this.$focusItem,event:e})}}},a.prototype.init=function(e){var t,i,s=this,n=this.$body.children.length,a=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.provider&&(this.provider=e.provider),e.render&&(this.renderItem=e.render),e.size&&(this.size=e.size),e.events&&Object.keys(e.events).forEach(function(t){s.events[t]=null,s.addListener(t,e.events[t])}),this.size!==n)for(n>0&&(this.$body.innerText=null),i=0;i<this.size;i++)(t=document.createElement("div")).index=i,t.className="item",t.addEventListener("click",a),this.$body.appendChild(t);if(this.provider){if(this.provider.blocked)return;this.provider.get(null,function(t,i){t?s.events["data:error"]&&s.emit("data:error",t):(i&&(e.data=i,s.setData(e),s.scroll&&s.scroll.init({realSize:s.provider.maxCount,viewSize:s.provider.size,value:s.provider.head+s.provider.pos})),s.events["data:get"]&&s.emit("data:get"))})}else e.data&&this.setData(e)},a.prototype.setData=function(e){e.data&&(this.data=function(e){var t;for(t=0;t<e.length;t++)"object"!=typeof e[t]&&(e[t]={value:e[t]});return e}(e.data)),this.viewIndex=null,this.$focusItem&&this.blurItem(this.$focusItem),this.scroll&&(this.provider?this.scroll.realSize!==this.provider.maxCount&&this.scroll.init({realSize:this.provider.maxCount,viewSize:this.provider.size,value:this.provider.head+this.provider.pos}):this.scroll.init({realSize:this.data.length,viewSize:this.size,value:e.viewIndex||0})),void 0!==e.focusIndex&&this.data.length?this.focusIndex(e.focusIndex):this.renderView(e.viewIndex||0)},a.prototype.renderView=function(e){var t,i,s,n,a;if(this.viewIndex!==e){for(n=this.viewIndex,this.viewIndex=a=e,i=0;i<this.size;i++)t=this.$body.children[i],(s=this.data[e])?(t.data=s,t.index=e,this.renderItem(t,s),s.mark?t.classList.add("mark"):t.classList.remove("mark")):(t.data=t.index=void 0,t.innerHTML=" ",t.ready=!1),e++;return this.events["move:view"]&&this.emit("move:view",{prevIndex:n,currIndex:a}),this.events["select:item"]&&this.emit("select:item",{$item:t}),this.scroll&&this.scroll.scrollTo(this.provider?this.provider.head+this.provider.pos:this.viewIndex),!0}return!1},a.prototype.move=function(e){var t=this,i=!1;if(this.data.length)switch(e){case n.left:if(this.type!==this.TYPE_HORIZONTAL)break;i=!0;case n.up:if(i||this.type===this.TYPE_VERTICAL)if(this.$focusItem&&this.$focusItem.index>0)this.$focusItem===this.$body.firstChild?this.renderView(this.viewIndex-1):this.focusItem(this.$focusItem.previousSibling);else if(this.provider){if(this.provider.blocked)return;this.provider.get(e,function(e,i,s){e?t.events["data:error"]&&t.emit("data:error",e):i&&t.setData({data:i,focusIndex:s||0===s?s:t.$focusItem.index})})}else this.cycle&&this.move(n.end),this.events["overflow"]&&this.emit("overflow",{direction:e,cycle:this.cycle});break;case n.right:if(this.type!==this.TYPE_HORIZONTAL)break;i=!0;case n.down:if(i||this.type===this.TYPE_VERTICAL)if(this.$focusItem&&this.$focusItem.index<this.data.length-1)this.$focusItem===this.$body.lastChild?this.renderView(this.viewIndex+1):this.focusItem(this.$focusItem.nextSibling);else if(this.provider){if(this.provider.blocked)return;this.provider.get(e,function(e,i,s){e?t.events["data:error"]&&t.emit("data:error",e):i&&t.setData({data:i,focusIndex:s||0===s?s:t.$focusItem.index})})}else this.cycle&&this.move(n.home),this.events["overflow"]&&this.emit("overflow",{direction:e,cycle:this.cycle});break;case n.pageUp:if(this.provider){if(this.provider.blocked)return;return void this.provider.get(e,function(e,i,s){e?t.events["data:error"]&&t.emit("data:error",e):i&&t.setData({data:i,focusIndex:s||0})})}this.viewIndex<this.size?this.renderView(0):this.renderView(this.viewIndex-this.size+1),this.focusItem(this.$body.firstChild);break;case n.pageDown:if(this.provider){if(this.provider.blocked)return;this.provider.get(e,function(e,i,s){var n;e?t.events["data:error"]&&t.emit("data:error",e):i&&(n=s||0===s?s:i.length<t.size?i.length-1:t.size-1,t.setData({data:i,focusIndex:n}))});break}this.data.length>this.size?(this.viewIndex>this.data.length-2*this.size?this.renderView(this.data.length-this.size):this.renderView(this.viewIndex+this.size-1),this.focusItem(this.$body.lastChild)):this.focusItem(this.$body.children[this.data.length-1]);break;case n.home:if(this.provider){if(this.provider.blocked)return;this.provider.get(e,function(e,i,s){e?t.events["data:error"]&&t.emit("data:error",e):i&&t.setData({data:i,focusIndex:s||0})});break}this.renderView(0),this.focusItem(this.$body.firstChild);break;case n.end:if(this.provider){if(this.provider.blocked)return;this.provider.get(e,function(e,i,s){var n;e?t.events["data:error"]&&t.emit("data:error",e):i&&(n=s||0===s?s:i.length<t.size?i.length-1:t.size-1,t.setData({data:i,focusIndex:n}))});break}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])}},a.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)},a.prototype.blurItem=function(e){return!!e&&(e===this.$focusItem&&(this.$focusItem=null),e.classList.remove("focus"),this.events["blur:item"]&&this.emit("blur:item",{$item:e}),!0)},a.prototype.focusIndex=function(e){var t=this.viewIndex||0;e>=t+this.size?(e=e<this.data.length-1?e:this.data.length-1,this.renderView(e-this.size+1),this.focusItem(this.$body.lastChild)):e<t?(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]))},a.prototype.markItem=function(e,t){t?e.classList.add("mark"):e.classList.remove("mark"),e.data.mark=t},e.exports=a},function(e,t,i){"use strict";var s=i(2),n=i(0);function a(e){var t=this;e=e||{},this.focusIndex=0,this.data=[],s.call(this,e),this.init(e),this.addListener("keydown",function(e){switch(e.code){case n.right:t.children.length&&t.focusIndex<t.children.length-1&&t.children[++t.focusIndex].focus();break;case n.left:t.children.length&&t.focusIndex>0&&t.children[--t.focusIndex].focus();break;case n.back:t.parent&&(t.parent.focus(),t.$parentItem&&t.parent.focusItem(t.$parentItem))}})}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,a.prototype.name="mag-component-layout",a.prototype.init=function(e){for(var t,i,n,a=this,o=function(e){var t,i;for(t=0;t<e.length;t++)"object"==typeof(i=e[t])?i instanceof s||i instanceof HTMLElement?e[t]={value:i,wrap:!1}:e[t].wrap=!0:e[t]={value:e[t],wrap:!0};return e}(e.data);this.$node.firstChild;)this.$node.removeChild(this.$node.firstChild);function l(){a.focusIndex=this.index}for(this.data=o,n=0;n<o.length;n++)"string"==typeof(t=o[n]).value?((i=document.createElement("div")).textContent=t.value,t.className&&(i.className=t.className),this.$node.appendChild(i)):t.value instanceof HTMLElement?t.wrap?(i=document.createElement("div"),t.className&&(i.className=t.className),i.appendChild(t.value),this.$node.appendChild(i)):this.$node.appendChild(t.value):t.value instanceof s?(t.value.propagate=!0,t.value.index=this.children.length,t.value.addListener("click",l),t.wrap?(i=document.createElement("div"),t.className&&(i.className=t.className),i.appendChild(t.value.$node),this.$node.appendChild(i),this.children.push(t.value),t.value.parent=this):this.add(t.value)):(i=document.createElement("div"),t.className&&(i.className=t.className),this.$node.appendChild(i))},e.exports=a},function(e,t,i){"use strict";var s=i(1),n=i(0);function a(e){(e=e||{}).$body=document.createElement("div"),e.$body.className="body",this.step=5,this.realHeight=0,this.viewHeight=0,this.topPosition=0,this.scroll=null,s.call(this,e),this.$node.appendChild(this.$body),this.init(e)}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,a.prototype.name="mag-component-scroll-area",a.prototype.defaultEvents={keydown:function(e){switch(e.code){case n.up:case n.down:this.move(e.code)}},mousewheel:function(e){this.move(e.wheelDeltaY>0?n.up:n.down)}},a.prototype.move=function(e){var t=screen.height,i=this.viewHeight-this.realHeight;if(i<0)switch(e){case n.down:if(this.topPosition-this.step*t/100<i)return this.scroll.scrollTo(-i),this.$body.style.top=i+"px",void this.emit("overflow",{direction:e});this.topPosition-=Math.ceil(this.step*t/100),this.scroll&&this.scroll.scrollTo(-this.topPosition),this.$body.style.top=this.topPosition+"px";break;case n.up:if(this.topPosition+this.step*t/100>0)return this.scroll.scrollTo(0),this.$body.style.top="0px",void this.emit("overflow",{direction:e});this.topPosition+=Math.ceil(this.step*t/100),this.scroll&&this.scroll.scrollTo(-this.topPosition),this.$body.style.top=this.topPosition+"px"}else this.emit("overflow",{direction:e})},a.prototype.init=function(e){e=e||{},this.realHeight=this.$body.offsetHeight,this.viewHeight=this.$node.offsetHeight,this.topPosition=0,this.$body.style.top=this.topPosition+"px",e.scroll&&(this.scroll=e.scroll),e.step&&(this.step=e.step),this.scroll&&this.scroll.init({realSize:this.realHeight,viewSize:this.viewHeight,value:this.topPosition})},e.exports=a},function(e,t,i){"use strict";var s=i(3);s.gettext=i(30),s.once("load",function(){s.gettext.load({name:window.core.environment.language},function(e){s.pages={main:i(32),info:i(37),logs:i(39),usb:i(44),url:i(45)},s.ready()})})},function(e,t,i){"use strict";var s=i(4),n=i(25);window.core=window.parent.getCoreInstance(window,s),i(26),i(27),i(16)("sdk"),i(29),i(16)("app"),s.platform="mag",s.ready=function(){window.core.call("app:ready")},s.exit=function(){s.events["exit"]&&s.emit("exit"),core.call("exit")},n.load=function(e){document.body.setAttribute("platform",s.platform),core.ready?s.events["load"]&&s.emit("load",{}):core.once("load",function(){s.events[e.type]&&s.emit(e.type,e)})},n.contextmenu=function(e){e.preventDefault()},Object.keys(n).forEach(function(e){window.addEventListener(e,n[e])}),e.exports=s},function(e,t,i){"use strict";e.exports={parse:function(e){var t={};return e.split("&").forEach(function(e){2===(e=e.split("=")).length&&(t[e[0]]=decodeURIComponent(e[1]))}),t},stringify:function(e){var t=[];return Object.keys(e).forEach(function(i){t.push(i+"="+encodeURIComponent(e[i]))}),t.join("&")}}},function(e,t,i){"use strict";e.exports={pathToImageAtUsb:"",selectedImage:0}},function(e,t,i){"use strict";var s=i(4);e.exports={DOMContentLoaded:function(e){s.events["dom"]&&s.emit("dom",e)},load:function(e){s.events[e.type]&&s.emit(e.type,e)},unload:function(e){s.events[e.type]&&s.emit(e.type,e)},error:function(e){},keydown:function(e){var t,i=s.activePage,n={code:e.keyCode,stop:!1};e.ctrlKey&&(n.code+="c"),e.altKey&&(n.code+="a"),e.shiftKey&&(n.code+="s"),(t=i.activeComponent)&&t!==i&&(t.events[e.type]&&t.emit(e.type,n,e),!n.stop&&t.propagate&&t.parent&&t.parent.events[e.type]&&t.parent.emit(e.type,n,e)),n.stop||(i.events[e.type]&&i.emit(e.type,n,e),e.stop||s.events[e.type]&&s.emit(e.type,n,e))},keypress:function(e){var t=s.activePage;t.activeComponent&&t.activeComponent!==t&&t.activeComponent.events[e.type]&&t.activeComponent.emit(e.type,e)},mousewheel:function(e){var t=s.activePage;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)}}},function(e,t,i){"use strict";if(!document.documentElement.classList){var s=Array.prototype,n=s.indexOf,a=s.slice,o=s.push,l=s.splice,d=s.join;window.DOMTokenList=function(e){if(this._element=e,e.className!==this._classCache){if(this._classCache=e.className,!this._classCache)return;var t,i=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/);for(t=0;t<i.length;t++)o.call(this,i[t])}},window.DOMTokenList.prototype={add:function(e){this.contains(e)||(o.call(this,e),this._element.className=a.call(this,0).join(" "))},contains:function(e){return-1!==n.call(this,e)},item:function(e){return this[e]||null},remove:function(e){var t=n.call(this,e);-1!==t&&(l.call(this,t,1),this._element.className=a.call(this,0).join(" "))},toString:function(){return d.call(this," ")},toggle:function(e){return this.contains(e)?this.remove(e):this.add(e),this.contains(e)}},Object.defineProperty(Element.prototype,"classList",{get:function(){return new window.DOMTokenList(this)}})}},function(e,t,i){"use strict";var s=i(4),n=i(28);s.metrics=n[s.query.screenHeight]||n[screen.height]||n[720],s.metrics.availHeight=s.metrics.height-(s.metrics.availTop+s.metrics.availBottom),s.metrics.availWidth=s.metrics.width-(s.metrics.availLeft+s.metrics.availRight)},function(e,t,i){"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:26,availLeft:54},720:{height:720,width:1280,availTop:30,availBottom:30,availRight:40,availLeft:40},1080:{height:1080,width:1920,availTop:45,availBottom:45,availRight:60,availLeft:60}}},function(e,t,i){"use strict";var s,n=i(4);(s=document.createElement("link")).rel="stylesheet",s.href=window.core.theme.path+n.metrics.height+".css",document.head.appendChild(s),e.exports=s},function(e,t,i){"use strict";var s=i(13),n=i(31),a=new s;function o(e){var t=new n(e);return window.gettext=window._=t.gettext,window.pgettext=t.pgettext,window.ngettext=t.ngettext,t}a.defaultLanguage="en",a.load=function(e,t){var i;return e.ext=e.ext||"json",e.path=e.path||"lang",e.name===a.defaultLanguage?(o(),t(null),!1):((i=new XMLHttpRequest).onload=function(){try{o(JSON.parse(i.responseText)),t(null),a.events["load"]&&a.emit("load")}catch(e){i.onerror(e)}},i.ontimeout=i.onerror=function(e){o(),t(e),a.events["error"]&&a.emit("error",e)},i.open("GET",e.path+"/"+e.name+"."+e.ext,!0),i.send(null),!0)},e.exports=a},function(module,exports,__webpack_require__){"use strict";function Gettext(config){var data,meta;config=config||{},data=config.data||{},data[""]=data[""]||{},meta=config.meta,this.gettext=function(e){return data[""][e]||e},this.pgettext=function(e,t){return data[e]&&data[e][t]||t},this.ngettext=function(msgId,plural,value){var n,evalResult;return data&&meta&&data[""][msgId]?(evalResult=eval("n = "+value+"; "+meta.plural),"boolean"==typeof evalResult&&(evalResult=+evalResult),data[""][msgId][evalResult]):1===value?msgId:plural}}Gettext.prototype.constructor=Gettext,module.exports=Gettext},function(e,t,i){"use strict";var s,n=i(5),a=i(3),o=new n({$node:document.getElementById("pageMain")}),l=i(9),d=i(14),c=i(10),r=i(6),h=i(11),u=i(7),m=i(0),p=window.core.plugins.fs,f=i(12),v=i(8),y=i(20);s=u.tag("div",{className:"amountContainer"},u.tag("div",{className:"amount"},"4")),a.updater=window.core.plugins.updater,a.storages=p.getMountPoints().concat(p.getHDDInfo()),p.onMount=function(e){a.storages=p.getMountPoints().concat(p.getHDDInfo()),a.pages.usb.active&&(a.pages.usb.modalUsbSelect.visible&&a.pages.usb.modalUsbSelect.hide(),a.pages.usb.middlePanel.reset(),a.pages.usb.panelSet.focus())},o.clock=new v({className:"clock",interval:1e3,render:function(e){var t=new Date,i=t.getHours(),s=t.getMinutes();e.innerText=(i>9?i:"0"+i)+":"+(s>9?s:"0"+s)}}),o.add(o.clock),o.clock.start(),o.modalExit=new h({title:_("Exit"),className:"modalExit",events:{show:function(){this.children[0].focus()},hide:function(){o.panelSet.focus()}},children:[new r({size:2,focusIndex:0,data:[{items:[{value:_("Yes")}],click:function(){o.modalExit.hide(),a.intent&&a.intent.data&&a.intent.data.closeCallback?(window.core.taskManager.hideAll(),a.intent.data.closeCallback(),a.intent=null):window.core.call("hide")}},{items:[{value:_("No")}],click:function(){o.modalExit.hide()}}],propagate:!0})]}),o.add(o.modalExit),o.leftPanel=new c({title:_("Menu"),children:[],className:"leftPanel"}),o.leftPanel.add(o.leftPanel.list=new r({cycle:!0,focusIndex:0,data:[{items:[{className:"theme-icon theme-icon-exit",value:""},{value:_("Exit")}],click:function(){o.panelSet.blur(),o.modalExit.show()}}]})),o.rightPanel=new c({title:_("Details"),className:"rightPanel"}),o.rightPanel.scroll=new f({}),o.rightPanel.textArea=new y({propagate:!0,step:5,scroll:o.rightPanel.scroll}),o.rightPanel.add(o.rightPanel.textArea,o.rightPanel.scroll),o.rightPanel.reset=function(){var e,t,i,s,n=o.rightPanel.textArea;n.$body.innerHTML="";try{e=o.middlePanel.list.$focusItem.data.items[1].data}catch(t){e=null}if(e&&e.length){for(t=u.fragment(),i=0;i<e.length;i++)"title"===e[i].type?t.appendChild(u.tag("div",{className:"title theme-subhead-color"},(e[i].data||"")+("function"==typeof e[i].calc?" "+e[i].calc():""))):"text"===e[i].type?t.appendChild(u.tag("div",{},(e[i].data||"")+("function"==typeof e[i].calc?" "+e[i].calc():""))):"html"===e[i].type&&((s=document.createElement("div")).innerHTML=e[i].data,t.appendChild(s));n.$body.appendChild(t),o.rightPanel.textArea.show(),o.rightPanel.textArea.init()}else o.rightPanel.textArea.hide()},o.modalFriquency=new h({visible:!1,title:_("Auto update condition"),events:{show:function(){this.focus()},hide:function(){o.panelSet.focus()}},children:[new d({cycle:!0,focusIndex:0,size:3,data:[{state:a.updater.frequency===a.updater.constants.NEVER,title:_("Never"),value:a.updater.constants.NEVER},{state:a.updater.frequency===a.updater.constants.WEEKLY,title:_("Weekly"),value:a.updater.constants.WEEKLY},{state:a.updater.frequency===a.updater.constants.MONTHLY,title:_("Monthly"),value:a.updater.constants.MONTHLY}],propagate:!0,events:{"click:item":function(e){a.updater.frequency=e.$item.data.value,o.rightPanel.reset(),o.modalFriquency.hide()}}})]}),o.add(o.modalFriquency),o.modalAllowBeta=new h({visible:!1,title:_("Update to beta"),events:{show:function(){this.focus()},hide:function(){o.panelSet.focus()}},children:[new d({cycle:!0,focusIndex:0,size:2,data:[{state:!a.updater.betaUpdate,title:_("OFF"),value:!1},{state:a.updater.betaUpdate,title:_("ON"),value:!0}],propagate:!0,events:{"click:item":function(e){a.updater.betaUpdate=e.$item.data.value,o.rightPanel.reset(),o.modalAllowBeta.hide()}}})]}),o.add(o.modalAllowBeta),o.middlePanel=new c({title:[{value:_("updates"),className:"name"},s],main:!0,children:[],className:"middlePanel"}),o.middlePanel.sets={main:{title:_("updates"),index:0,data:[{items:[{className:"theme-icon theme-icon-internet"},{value:_("List of releases"),data:[{type:"title",data:_("Update via server")},{type:"html",data:"</br>"},{type:"text",data:_("Update to image from server.")}]}],click:function(){o.middlePanel.reset(o.middlePanel.sets.releases)}},{items:[{className:"theme-icon theme-icon-update"},{value:_("Update by URL"),data:[{type:"title",data:_("Update via URL")},{type:"html",data:"</br>"},{type:"text",data:_("Update to image from URL.")}]}],click:function(){o.panelSet.blur(),a.route(a.pages.url)}},{items:[{className:"theme-icon theme-icon-usb"},{value:_("USB"),data:[{type:"title",data:_("Update via storage")},{type:"html",data:"</br>"},{type:"text",data:_("Update to image from storage device.")}]}],click:function(){o.panelSet.blur(),a.route(a.pages.usb)}}]},options:{title:_("Auto update"),index:0,data:[{items:[{className:"theme-icon theme-icon-back"},{value:".."}],click:function(){o.middlePanel.reset(o.middlePanel.sets.main)}},{items:[{className:"theme-icon theme-icon-beta"},{value:_("Update to beta versions"),data:[{type:"title",data:_("Update to beta versions:")},{type:"text",calc:function(){return a.updater.betaUpdate?_("ON"):_("OFF")}},{type:"html",data:"</br>"},{type:"text",data:_("Update to beta versions.")}]}],click:function(){o.panelSet.blur(),o.modalAllowBeta.show()}},{items:[{className:"theme-icon theme-icon-update"},{value:_("Update frequency"),data:[{type:"title",data:_("Update frequency:")},{type:"text",calc:function(){var e={};return e[a.updater.constants.NEVER]=_("Never"),e[a.updater.constants.WEEKLY]=_("Weekly"),e[a.updater.constants.MONTHLY]=_("Monthly"),e[a.updater.frequency]}},{type:"html",data:"</br>"},{type:"text",data:_("Choose frequency of new versions check.")}]}],click:function(){o.panelSet.blur(),o.modalFriquency.show()}}]},releases:{title:_("List of releases"),index:0,data:[{items:[{className:"theme-icon theme-icon-back"},{value:".."}],click:function(){o.middlePanel.reset(o.middlePanel.sets.main)}}]}},a.updater.autoUpdateEnabled&&o.middlePanel.sets.main.data.push({items:[{className:"theme-icon theme-icon-folder"},{value:_("Auto update"),data:[{type:"title",data:_("Auto update")},{type:"html",data:"</br>"},{type:"text",data:_("Choose auto update conditions.")}]}],click:function(){o.middlePanel.reset(o.middlePanel.sets.options)}}),o.middlePanel.releaseListUpdate=function(){var e=a.updater.list;o.middlePanel.sets.releases.data=[{items:[{className:"theme-icon theme-icon-back"},{value:".."}],click:function(){o.middlePanel.reset(o.middlePanel.sets.main)}}],e.forEach(function(e,t,i){o.middlePanel.sets.releases.data.push({items:[{className:"theme-icon theme-icon-file"},{value:e.name,data:[{type:"title",data:_("New version")},{type:"html",data:"</br>"},{type:"text",data:_("Name:")+" "+e.name},{type:"text",data:_("Description:")+" "+e.descr},{type:"text",data:_("Type:")+" "+e.type},{type:"text",data:_("Date:")+" "+new Date(e.date).toString()},{type:"html",data:"</br>"},{type:"title",data:_("Current version")},{type:"html",data:"</br>"},{type:"text",data:_("Name:")+" "+a.updater.current.version},{type:"text",data:_("Description:")+" "+a.updater.current.description},{type:"text",data:_("Date:")+" "+a.updater.current.date.toString()}]}],click:function(){var s=i.slice();o.panelSet.blur(),s.splice(t,1),a.route(a.pages.info,[e].concat(s))}})})},o.middlePanel.resetTimeOut=null,o.middlePanel.reset=function(e){clearTimeout(o.middlePanel.resetTimeOut),o.middlePanel.resetTimeOut=setTimeout(function(){var t,i=o.middlePanel.list;o.middlePanel.currentSet&&(o.middlePanel.currentSet.index=i.$focusItem.index),o.middlePanel.currentSet=e,t={data:e.data},s.firstChild.innerText=e.data.length,t.focusIndex=e.index<e.data.length?e.index:0,o.middlePanel.scroll.init({realSize:e.data.length,viewSize:7}),o.middlePanel.scroll.show(),i.init(t),o.middlePanel.$title.init({data:[e.title]})},300)},o.middlePanel.scroll=new f({}),o.middlePanel.add(o.middlePanel.list=new r({cycle:!0,scroll:o.middlePanel.scroll,focusIndex:0,size:7,data:o.middlePanel.sets.main.data,events:{"focus:item":function(){setTimeout(function(){o.rightPanel.reset()},50)}}})),o.panelSet=new l({visible:!0,$node:document.getElementById("panelSetMain"),focusIndex:1,panels:[o.leftPanel,o.middlePanel,o.rightPanel]}),o.add(o.panelSet),o.addListener("keydown",function(e){switch(e.code){case m.back:o.activeComponent===o.middlePanel.list&&o.middlePanel.currentSet!==o.middlePanel.sets.main?o.middlePanel.reset(o.middlePanel.sets.main):window.core.call("hide")}}),a.updater.addListeners({listChange:function(){o.middlePanel.releaseListUpdate(),a.pages.main.active&&o.middlePanel.currentSet===o.middlePanel.sets.options&&o.middlePanel.reset(o.middlePanel.sets.options)},hardUpdate:function(e){e&&(a.intent={action:"update",data:e},a.route(a.pages.logs,[e]))}}),window.core.addListener("intent",function(e,t){"update"===e.action&&setTimeout(function(){window.core.call("show"),window.core.call("focus"),a.intent=e,e.data&&!e.data.closeCallback&&(a.updater.frequency!==a.updater.constants.NEVER||a.updater.standAloneMode)&&a.route(a.pages.logs,e.data),t(!1,{})},100)}),o.addListener("show",function(){o.panelSet.show(),o.panelSet.focus(),o.middlePanel.currentSet||o.middlePanel.reset(o.middlePanel.sets.main),o.middlePanel.focus(),o.rightPanel.reset()}),window.core.addListeners({show:function(){o.clock.start()},hide:function(){o.clock.stop()}}),o.middlePanel.releaseListUpdate(),a.route(o),o.show(),a.updater.standAloneMode&&window.core.emit("app:ready"),e.exports=o},function(e,t,i){"use strict";var s=i(1);function n(e){e=e||{},this.active=!1,this.activeComponent=null,s.call(this,e),this.active=this.$node.classList.contains("active"),null===this.$node.parentNode&&document.body.appendChild(this.$node),this.page=this}n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.name="spa-component-page",e.exports=n},function(e,t,i){"use strict";e.exports=i(35),e.exports.prototype.name="stb-component-modal"},function(e,t,i){"use strict";var s=i(1);function n(e){(e=e||{}).$body=document.createElement("div"),e.$body.className="body",s.call(this,e),this.$node.appendChild(document.createElement("div").appendChild(this.$body).parentNode)}n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.name="spa-component-modal",e.exports=n},function(e,t,i){"use strict";var s=i(1);function n(e){e=e||{},this.viewSize=10,this.realSize=100,this.value=0,this.type=this.TYPE_VERTICAL,this.thumbRect=null,this.trackRect=null,e.focusable=e.focusable||!1,e.type&&(this.type=e.type),this.type===this.TYPE_HORIZONTAL&&(e.className+=" horizontal"),s.call(this,e),this.$thumb=this.$body.appendChild(document.createElement("div")),this.$thumb.className="thumb",this.init(e)}n.prototype=Object.create(s.prototype),n.prototype.constructor=n,n.prototype.name="spa-component-scrollbar",n.prototype.TYPE_VERTICAL=1,n.prototype.TYPE_HORIZONTAL=2,n.prototype.init=function(e){void 0!==(e=e||{}).realSize&&(this.realSize=e.realSize),void 0!==e.viewSize&&(this.viewSize=e.viewSize),this.viewSize>=this.realSize?this.$thumb.classList.add("hidden"):this.$thumb.classList.remove("hidden"),void 0!==e.value&&this.scrollTo(e.value),this.type===this.TYPE_VERTICAL?this.$thumb.style.height=this.viewSize/this.realSize*100+"%":this.$thumb.style.width=this.viewSize/this.realSize*100+"%",this.thumbRect=this.$thumb.getBoundingClientRect(),this.trackRect=this.$node.getBoundingClientRect()},n.prototype.scrollTo=function(e){return this.value!==e&&(0!==this.thumbRect.height&&0!==this.thumbRect.width||(this.trackRect=this.$node.getBoundingClientRect(),this.thumbRect=this.$thumb.getBoundingClientRect()),this.type===this.TYPE_VERTICAL?this.$thumb.style.marginTop=(this.trackRect.height-this.thumbRect.height)*e/(this.realSize-this.viewSize)+"px":this.$thumb.style.marginLeft=(this.trackRect.width-this.thumbRect.width)*e/(this.realSize-this.viewSize)+"px",this.events["change"]&&this.emit("change",{curr:e,prev:this.value}),e>=this.realSize&&(e=this.realSize,this.events["done"]&&this.emit("done")),this.value=e,!0)},e.exports=n},function(e,t,i){"use strict";var s,n,a=i(5),o=i(3),l=new a({$node:document.getElementById("pageInfo")}),d=i(9),c=i(10),r=i(6),h=i(11),u=i(14),m=i(7),p=i(0),f=i(12),v=i(8),y=i(15);s=m.tag("div",{className:"amountContainer"},n=m.tag("div",{className:"amount"},"0")),l.clock=new v({className:"clock",interval:1e3,render:function(e){var t=new Date,i=t.getHours(),s=t.getMinutes();e.innerText=(i>9?i:"0"+i)+":"+(s>9?s:"0"+s)}}),l.add(l.clock),l.clock.start(),l.modalImageSelect=new h({visible:!1,title:gettext("images"),events:{show:function(){var e,t=0,i=[];for(e=0;e<l.list.length;e++)i.push({state:!1,title:l.list[e].name,value:l.list[e]}),l.currImg===l.list[e]&&(i[e].state=!0,t=e);this.children[0].init({data:i,size:i.length,focusIndex:t}),this.focus()},hide:function(){l.panelSet.focus()}},children:[new u({cycle:!0,focusIndex:0,size:3,data:[],propagate:!0,events:{"click:item":function(e){l.currImg=e.$item.data.value,l.modalImageSelect.hide(),l.middlePanel.reset()}}})]}),l.add(l.modalImageSelect),l.modalMore=new h({visible:!1,focusable:!0,title:gettext("information"),events:{show:function(){l.middlePanel.list.$focusItem&&(l.modalMore.$text.innerText=l.middlePanel.list.$focusItem.children[0].children[0].innerText,l.modalMore.$body.innerHTML="</br>",l.modalMore.$body.innerHTML+=l.middlePanel.list.$focusItem.children[0].children[1].innerText,l.modalMore.$body.innerHTML+="</br></br>"),this.focus()},hide:function(){l.panelSet.focus()}}}),l.add(l.modalMore),l.middlePanel=new c({title:[{value:gettext("software update"),className:"name"},s],main:!0,children:[],className:"middlePanel"}),l.middlePanel.scroll=new f({}),l.middlePanel.add(l.middlePanel.list=new r({cycle:!0,focusIndex:0,size:6,className:"padded",scroll:l.middlePanel.scroll,events:{overflow:function(){l.middlePanel.list.$focusItem.classList.remove("focus"),l.middlePanel.scroll.hide(),l.middlePanel.button.focus()},keydown:function(e){r.prototype.defaultEvents.keydown.call(this,e)}},data:[],noData:m.tag("div",{className:"panelHint"},m.tag("div",{className:"hint"},m.tag("div",{className:"hint",innerHTML:gettext("No data")})))}),l.middlePanel.scroll),l.middlePanel.reset=function(){var e=[{items:[{className:"item name theme-subhead-color",value:gettext("Current version:")},{className:"item text",value:o.updater.current.version}]},{items:[{className:"item name theme-subhead-color",value:gettext("Description:")},{className:"item text",value:o.updater.current.description}],className:"theme-item-more",click:function(){l.panelSet.blur(),l.modalMore.show()}},{items:[{className:"item name theme-subhead-color",value:gettext("Date:")},{className:"item text",value:o.updater.current.date.toString()}],className:"theme-item-more",click:function(){l.panelSet.blur(),l.modalMore.show()}}],t=l.middlePanel.list;l.currImg&&(e=e.concat([{items:[{className:"item name theme-subhead-color",value:gettext("New version:")},{className:"item text",value:l.currImg.name}],className:(l.list.length>1?"theme-item-more":"")+" theme-separator-top",click:function(){l.list.length>1&&(l.panelSet.blur(),l.modalImageSelect.show())}},{items:[{className:"item name theme-subhead-color",value:gettext("Description:")},{className:"item text",value:l.currImg.descr}],className:"theme-item-more",click:function(){l.panelSet.blur(),l.modalMore.show()}},{items:[{className:"item name theme-subhead-color",value:gettext("Date:")},{className:"item text",value:l.currImg.date.toString()}],className:"theme-item-more",click:function(){l.panelSet.blur(),l.modalMore.show()}}])),n.innerText=e.length,t.init({data:e,focusIndex:t.$focusItem&&t.$focusItem.index?t.$focusItem.index:0})},l.middlePanel.add(l.middlePanel.button=new y({value:gettext("UPDATE"),className:"bottom theme-footer",$node:l.middlePanel.$node.appendChild(document.createElement("div")),events:{click:function(){l.currImg?o.route(o.pages.logs,l.currImg):o.route(o.pages.main)},keydown:function(e){e.code===p.up?(l.middlePanel.list.focus(),l.middlePanel.scroll.show(),l.middlePanel.list.$focusItem.classList.add("focus"),l.middlePanel.list.focusIndex(l.middlePanel.list.data.length-1)):e.code===p.down?(l.middlePanel.list.focus(),l.middlePanel.scroll.show(),l.middlePanel.list.$focusItem.classList.add("focus"),l.middlePanel.list.focusIndex(0)):e.code===p.ok&&l.middlePanel.button.events["click"]&&l.middlePanel.button.emit("click",{event:e})}}})),l.panelSet=new d({visible:!0,$node:document.getElementById("panelSetInfo"),focusIndex:0,panels:[l.middlePanel]}),l.add(l.panelSet),l.addListener("keydown",function(e){switch(e.code){case p.back:o.route(o.pages.main)}}),l.addListener("show",function(e){l.list=o.updater.list,e&&e.data&&Array.isArray(e.data)&&(l.list=e.data),l.currImg=l.list[0],l.currImg?l.middlePanel.button.$text.innerText=gettext("UPDATE"):(window.core.notify({title:gettext("Software up to date, no need for update."),icon:"info"}),l.middlePanel.button.$text.innerText=gettext("CLOSE")),l.panelSet.show(),l.panelSet.focus(),l.middlePanel.reset(),l.middlePanel.list.$focusItem.classList.remove("focus"),l.middlePanel.scroll.hide(),l.middlePanel.button.focus()}),e.exports=l},function(e,t,i){"use strict";var s=i(1),