File: /volume1/@appstore/CodecPack/ui/CodecPackVueBundle.js
/*! For license information please see synoame.bundle.js.LICENSE.txt */
!function(){"use strict";var t={n:function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,{a:r}),r},d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e=Vue,r=t.n(e),n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("v-app-instance",{attrs:{"class-name":t.APP_INSTANCE_NAME}},[r("v-app-window",{ref:"appWindow",attrs:{width:"680",height:"500",resizable:!1,"syno-id":"SYNO.AME.Window"},on:{close:t.resetAppState}},[r("v-panel",{attrs:{"syno-id":"src-app-panel-0","layout-type":"content",fbar:!1},scopedSlots:t._u([{key:"body",fn:function(){return[r("v-spin",{attrs:{mask:t.showMask,spinning:t.isLoading,tip:t.maskText}},[r("MainContainer")],1)]},proxy:!0}])})],1)],1)};n._withStripped=!0;var o=Vuex,i=t.n(o),a="SYNO.AME.Instance",c="unknown",u="lost",s="need_download",l="downloading_installing",f="up_to_date",p="download_install_failed",h=401,d=402,v=601,y=651,m={H264:"AVC",VC1:"VC1"},g="",_="pre_install",w="install",b="post_install",S="pre_uninstall",E="uninstall",x="post_uninstall",O=function(t,e){var r=_TT(a,t,e);return(r=r||_T(t,e))||String.format("{0}:{1}",t,e)},P=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"main-container"},[t.hasCodec?r("div",[r(t.description,{tag:"component"}),t._v(" "),r(t.content,{tag:"component"})],1):r("div",{staticClass:"empty-codec",domProps:{innerHTML:t._s(t.emptyCodecMsg)}})])};P._withStripped=!0;var k=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("v-fieldset",{attrs:{title:t.titleCodecPack,collapsible:!1}},[r("CodecStatusContent")],1)],1)};k._withStripped=!0;var L=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"codec-status-content"},[r("v-form",{attrs:{"syno-id":"codec-status-content-form"}},[r("CodecStatusItem",{attrs:{title:t.titleSupportCodec}},[r("SupportedCodecContainer")],1),t._v(" "),r("CodecStatusItem",{attrs:{title:t.titleCurrentVersion,textonly:""}},[t._v("\n "+t._s(t.currentVersion)+"\n ")]),t._v(" "),r("CodecStatusItem",{attrs:{title:t.titleLastUpdateTime,textonly:""}},[t._v("\n "+t._s(t.lastUpdateTime)+"\n ")]),t._v(" "),r("CodecStatusItem",{attrs:{title:t.titleStatus,textonly:""}},[r("span",{class:t.statusClass},[t._v(t._s(t.statusText))])]),t._v(" "),t.actionButton?r("CodecStatusItem",[r(t.actionButton,{tag:"component"})],1):t._e()],1)],1)};L._withStripped=!0;var I=function(){var t=this,e=t.$createElement;return(t._self._c||e)("BaseButton",{attrs:{id:"download-button",text:"Download","click-handler":t.download}})};I._withStripped=!0;var T=function(){var t=this,e=t.$createElement;return(t._self._c||e)("v-button",{attrs:{"syno-id":t.id,suffix:t.suffix,disabled:t.disabled},on:{click:t.clickHandler}},[t._v("\n "+t._s(t.text)+"\n")])};function A(t,e,r,n,o,i,a,c){var u,s="function"==typeof t?t.options:t;if(e&&(s.render=e,s.staticRenderFns=r,s._compiled=!0),n&&(s.functional=!0),i&&(s._scopeId="data-v-"+i),a?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},s._ssrRegister=u):o&&(u=c?function(){o.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:o),u)if(s.functional){s._injectStyles=u;var l=s.render;s.render=function(t,e){return u.call(e),l(t,e)}}else{var f=s.beforeCreate;s.beforeCreate=f?[].concat(f,u):[u]}return{exports:t,options:s}}T._withStripped=!0;var j=A({props:{disabled:{type:Boolean,default:!1},id:{type:String,required:!0},suffix:{type:String,default:"blue"},text:{type:String,default:""},clickHandler:{type:Function,required:!0}}},T,[],!1,null,null,null);j.options.__file="src/buttons/BaseButton.vue";var C=j.exports,N=function(t){var e=t.type;return function(){return synowebapi.promises.request({api:"SYNO.AME.Pack",method:"manual_update",version:1,params:{type:e}})}},D=N({type:"download"}),G=N({type:"install"}),$=N({type:"download_install"});function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function U(){U=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new T(n||[]);return o(a,"_invoke",{value:P(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};s(w,a,(function(){return this}));var b=Object.getPrototypeOf,S=b&&b(b(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var E=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==M(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?v:h,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=v,n.method="throw",n.arg=s.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(M(e)+" is not iterable")}return g.prototype=_,o(E,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=s(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,s(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},x(O.prototype),s(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(E),s(E,u,"Generator"),s(E,a,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function B(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var F={components:{BaseButton:C},methods:{download:function(){var t,e=this;return(t=U().mark((function t(){return U().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.$store.commit("SET_IS_LOADING",!0),console.log("download"),t.prev=2,t.next=5,D();case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(2),console.error("Failed to download: [code]: ",t.t0.code);case 10:e.$store.commit("SET_IS_LOADING",!1);case 11:case"end":return t.stop()}}),t,null,[[2,7]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){B(i,n,o,a,c,"next",t)}function c(t){B(i,n,o,a,c,"throw",t)}a(void 0)}))})()}}},V=A(F,I,[],!1,null,null,null);V.options.__file="src/buttons/DownloadButton.vue";V.exports;var R=function(){var t=this,e=t.$createElement;return(t._self._c||e)("BaseButton",{attrs:{id:"download-and-install-button",text:t.text,"click-handler":t.openUpdateConfirmDialog}})};function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function z(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function K(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Y(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Y(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}R._withStripped=!0;var H={components:{BaseButton:C},data:function(){return{text:O("action","update")}},methods:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?z(Object(r),!0).forEach((function(e){K(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},(0,o.mapActions)(["openUpdateConfirmDialog"]))},W=A(H,R,[],!1,null,null,null);W.options.__file="src/buttons/DownloadAndInstallButton.vue";var q=W.exports,X=function(){var t=this,e=t.$createElement;return(t._self._c||e)("BaseButton",{attrs:{id:"install-button",text:"Install","click-handler":t.install}})};function J(t){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(t)}function Q(){Q=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new T(n||[]);return o(a,"_invoke",{value:P(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};s(w,a,(function(){return this}));var b=Object.getPrototypeOf,S=b&&b(b(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var E=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==J(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?v:h,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=v,n.method="throw",n.arg=s.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(J(e)+" is not iterable")}return g.prototype=_,o(E,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=s(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,s(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},x(O.prototype),s(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(E),s(E,u,"Generator"),s(E,a,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function Z(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}X._withStripped=!0;var tt={components:{BaseButton:C},methods:{install:function(){var t,e=this;return(t=Q().mark((function t(){return Q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.$store.commit("SET_IS_LOADING",!0),console.log("install"),t.prev=2,t.next=5,G();case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(2),console.error("Failed to install: [code]: ",t.t0.code);case 10:e.$store.commit("SET_IS_LOADING",!1);case 11:case"end":return t.stop()}}),t,null,[[2,7]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Z(i,n,o,a,c,"next",t)}function c(t){Z(i,n,o,a,c,"throw",t)}a(void 0)}))})()}}},et=A(tt,X,[],!1,null,null,null);et.options.__file="src/buttons/InstallButton.vue";et.exports;var rt=function(){var t=this,e=t.$createElement;return(t._self._c||e)("BaseButton",{attrs:{id:"retry-button",suffix:"grey",text:t.text,"click-handler":t.downloadAndInstall}})};function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function ot(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function it(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==nt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===nt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}rt._withStripped=!0;var at={components:{BaseButton:C},data:function(){return{text:O("action","retry_btn")}},methods:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(r),!0).forEach((function(e){it(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},(0,o.mapActions)(["downloadAndInstall"]))},ct=A(at,rt,[],!1,null,null,null);ct.options.__file="src/buttons/RetryButton.vue";var ut=ct.exports,st=function(){var t=this,e=t.$createElement;return(t._self._c||e)("BaseButton",{attrs:{id:"setting-button",text:"Setting","click-handler":t.openSettingDialog}})};st._withStripped=!0;var lt=A({components:{BaseButton:C},methods:{openSettingDialog:function(){console.log("open setting dialog")}}},st,[],!1,null,null,null);lt.options.__file="src/buttons/SettingButton.vue";lt.exports;var ft=function(){var t=this,e=t.$createElement;return(t._self._c||e)("v-form-item",{attrs:{label:t.title,textonly:t.textonly}},[t._t("default")],2)};ft._withStripped=!0;var pt=A({props:{title:{type:String,default:""},textonly:{type:Boolean,default:!1}}},ft,[],!1,null,null,null);pt.options.__file="src/components/CodecStatusItem.vue";var ht=pt.exports,dt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"supported-codec-container"},t._l(t.codecInfo,(function(t){var e=t[0],n=t[1];return r("Codec",{key:e,attrs:{codec:e.toUpperCase(),"is-installed":n.isPackInstalled}})})),1)};dt._withStripped=!0;var vt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.tooltipProps,expression:"tooltipProps"}],staticClass:"codec"},[r("div",{staticClass:"codec__icon",class:{"codec__icon--installed":t.isInstalled}}),t._v(" "),r("div",[t._v(t._s(t.displayCodecName))])])};vt._withStripped=!0;var yt=A({props:{codec:{type:String,required:!0,validator:function(t){return Object.keys(m).includes(t)}},isInstalled:{type:Boolean,required:!0}},computed:{displayCodecName:function(){return m[this.codec]},tooltipProps:function(){var t=this.isInstalled?"has":"require";return{content:O("common","".concat(t,"_").concat(this.codec.toLowerCase(),"_tooltip")),isHtml:!0}}}},vt,[],!1,null,"a879fdd4",null);yt.options.__file="src/components/Codec.vue";var mt=A({components:{Codec:yt.exports},computed:{codecInfo:function(){return Object.entries(this.$store.state.codecInfo)}}},dt,[],!1,null,"2d56fad9",null);function gt(t){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(t)}function _t(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==gt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==gt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===gt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}mt.options.__file="src/components/SupportedCodecContainer.vue";var wt=A({components:{CodecStatusItem:ht,SupportedCodecContainer:mt.exports},data:function(){return{titleCurrentVersion:O("common","current_version")+":",titleLastUpdateTime:O("common","last_update_time")+":",titleStatus:O("common","status")+":",titleSupportCodec:O("common","support_codec")+":"}},computed:{statusClass:function(){var t;return this.$store.state.isPackageOutOfDate?"error":(_t(t={},p,"error"),_t(t,l,"processing"),_t(t,f,"up-to-date"),_t(t,s,"need-update"),t)[this.$store.state.packInfo.binaryStatus]},currentVersion:function(){return this.$store.state.packInfo.currentVersion||"-"},lastUpdateTime:function(){var t=this.$store.state.packInfo.lastUpdateTimestampInSec;if(0==t)return"-";var e=new Date(1e3*t);return SYNO.SDS.DateTimeFormatter(e,{type:"datetimesec"})},hasCodec:function(){return Object.entries(this.$store.state.codecInfo).length>0},statusText:function(){var t;if(this.$store.state.isPackageOutOfDate)return O("common","install_binary_need_update");var e=this.$store.state.packInfo.updateProgress,r=(_t(t={},p,O("error","update_failed")),_t(t,s,O("status","need_update")),_t(t,l,String.format(O("status","download_installing"),"(".concat(e,"%)"))),_t(t,f,O("status","up_to_date")),t),n=this.$store.state.packInfo.binaryStatus;return(n!==f||this.hasCodec)&&r[n]||"-"},actionButton:function(){var t;if(this.$store.state.isPackageOutOfDate)return null;var e=(_t(t={},u,q),_t(t,p,ut),_t(t,s,q),t)[this.$store.state.packInfo.binaryStatus];return e}}},L,[],!1,null,"21e0853e",null);wt.options.__file="src/components/CodecStatusContent.vue";var bt=A({components:{CodecStatusContent:wt.exports},data:function(){return{titleCodecPack:O("common","codec_pack")}}},k,[],!1,null,null,null);bt.options.__file="src/components/CodecStatusContainer.vue";var St=bt.exports,Et=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"description"},[t._v(t._s(t.desc))])};Et._withStripped=!0;var xt=A({computed:{desc:function(){return O("common","description")}}},Et,[],!1,null,"0426a595",null);xt.options.__file="src/components/DescriptionContainer.vue";var Ot=xt.exports,Pt=A({components:{CodecStatusContainer:St,DescriptionContainer:Ot},data:function(){return{isStateInitialized:!1}},computed:{codecInfo:function(){return this.isStateInitialized?Object.entries(this.$store.state.codecInfo):[]},hasCodec:function(){return this.codecInfo.length>0},content:function(){return this.isStateInitialized?St:null},description:function(){return this.isStateInitialized?Ot:null},emptyCodecMsg:function(){if(!this.isStateInitialized)return null;var t=O("common","empty_codec_msg_embedded_url");return String.format(t,'<a href="'.concat("https://sy.to/amenaco",'" target="blank" text-decoration: underline;">'),"</a>")}},created:function(){var t=this;this.$store.dispatch("initState",(function(){t.isStateInitialized=!0}))}},P,[],!1,null,"03ebb270",null);function kt(t){return kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(t)}function Lt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function It(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==kt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==kt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===kt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Pt.options.__file="src/components/MainContainer.vue";var Tt={components:{MainContainer:Pt.exports},data:function(){return{APP_INSTANCE_NAME:a,maskText:O("common","loading")}},computed:{isLoading:function(){return this.$store.state.loadingState.isLoading},showMask:function(){return this.$store.state.loadingState.showMask}},methods:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Lt(Object(r),!0).forEach((function(e){It(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},(0,o.mapMutations)({resetAppState:"RESET_APP_STATE"}))},At=A(Tt,n,[],!1,null,"7ba5bd90",null);At.options.__file="src/App.vue";var jt=At.exports,Ct=function(){var t=this.$createElement;return(this._self._c||t)("v-modal-window",{attrs:{"syno-id":"dialogs-modal-window-modal-window-0",width:"700",height:"300",title:"Hello Window","show-close":""}})};Ct._withStripped=!0;var Nt=A({components:{},data:function(){return{message:"Vue say hello"}}},Ct,[],!1,null,null,null);Nt.options.__file="src/dialogs/ModalWindow.vue";var Dt=Nt.exports,Gt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("v-message-box-window",{attrs:{"syno-id":"update-confirm-dialog","do-confirm":t.doConfirm,"do-cancel":t.doCancel},scopedSlots:t._u([{key:"content",fn:function(){return[r("div",{staticClass:"message"},[r("span",[t._v(t._s(t.message))])]),t._v(" "),r("ul",{staticClass:"plugin-list"},t._l(t.pluginAppIds,(function(e){return r("li",{key:e,staticClass:"plugin-item"},[t._v(t._s(e))])})),0)]},proxy:!0}])})};function $t(t){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(t)}function Mt(){Mt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new T(n||[]);return o(a,"_invoke",{value:P(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};s(w,a,(function(){return this}));var b=Object.getPrototypeOf,S=b&&b(b(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var E=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==$t(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?v:h,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=v,n.method="throw",n.arg=s.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError($t(e)+" is not iterable")}return g.prototype=_,o(E,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=s(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,s(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},x(O.prototype),s(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(E),s(E,u,"Generator"),s(E,a,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function Ut(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}Gt._withStripped=!0;var Bt={props:{doConfirm:{type:Function,required:!0},doCancel:{type:Function,required:!0}},data:function(){return{message:O("common","update_confirm_msg"),pluginAppIds:[]}},created:function(){var t,e=this;return(t=Mt().mark((function t(){var r,n;return Mt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,synowebapi.promises.request({api:"SYNO.AME.Pack",method:"get_plugin_app_id",version:1});case 3:r=t.sent,n=r.app_id,e.pluginAppIds=n.map((function(t){return SYNO.SDS.Utils.GetAppTitle(t)})),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),console.error(t.t0);case 11:case"end":return t.stop()}}),t,null,[[0,8]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ut(i,n,o,a,c,"next",t)}function c(t){Ut(i,n,o,a,c,"throw",t)}a(void 0)}))})()}},Ft=A(Bt,Gt,[],!1,null,"3d1f0712",null);Ft.options.__file="src/dialogs/UpdateConfirmDialog.vue";var Vt=Ft.exports,Rt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("v-message-box-window",{attrs:{"syno-id":"error-dialog"},scopedSlots:t._u([{key:"content",fn:function(){return[r("div",[r("v-rich-text",{attrs:{text:t.message,"allow-attrs":["href","target"]}})],1)]},proxy:!0}])})};Rt._withStripped=!0;var Yt=A({props:{message:{type:String,required:!0}}},Rt,[],!1,null,null,null);Yt.options.__file="src/dialogs/ErrorDialog.vue";var zt=Yt.exports,Kt=function(t){var e=t.currentDownloadSize,r=t.totalDownloadSize,n=t.installStep;if(e>r)throw new Error("currentDownloadSize is greater than totalDownloadSize");if(n!==g){if(e<r)throw new Error("Start to install before download is done");switch(n){case S:return 57;case E:return 64;case x:return 71;case _:return 78;case w:return 85;case b:return 92;default:throw new Error("Invalid install step")}}return 0===r?0:Math.floor(e/r*50)},Ht=function(t){return new Promise((function(e){setTimeout(e,t)}))};function Wt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return qt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Xt(t){return Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xt(t)}function Jt(){Jt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new T(n||[]);return o(a,"_invoke",{value:P(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function _(){}var w={};s(w,a,(function(){return this}));var b=Object.getPrototypeOf,S=b&&b(b(A([])));S&&S!==r&&n.call(S,a)&&(w=S);var E=_.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==Xt(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=p;return function(i,a){if(o===d)throw new Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?v:h,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=v,n.method="throw",n.arg=s.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Xt(e)+" is not iterable")}return g.prototype=_,o(E,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:g,configurable:!0}),g.displayName=s(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,s(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},x(O.prototype),s(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(E),s(E,u,"Generator"),s(E,a,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function Qt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Zt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Qt(i,n,o,a,c,"next",t)}function c(t){Qt(i,n,o,a,c,"throw",t)}a(void 0)}))}}var te=[l],ee=2e3,re=function(){return SYNO.SDS.AppMgr.getByAppName(a)[0].$parent.$refs.appWindow},ne=function(){var t=Zt(Jt().mark((function t(){var e,r,n;return Jt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Vue.extend(Vt),r={doConfirm:function(){return Promise.resolve({type:"confirm"})},doCancel:function(){return Promise.resolve({type:"cancel"})}},n=re().getMsgBox(e,r),t.prev=3,t.next=6,n.confirm();case 6:return t.abrupt("return",t.sent);case 9:t.prev=9,t.t0=t.catch(3),console.error("Failed to confirm");case 12:return t.prev=12,n.onClose(),t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[3,9,12,15]])})));return function(){return t.apply(this,arguments)}}(),oe=function(){var t=Zt(Jt().mark((function t(e){var r,n,o;return Jt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.message,n=Vue.extend(zt),o=re().getMsgBox(n,{message:r}),t.next=5,o.alert();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ie=function(){var t=Zt(Jt().mark((function t(){return Jt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,oe({message:O("error","internal_error")});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ae=function(t,e){return t!=c&&(t!=e&&!te.includes(e))},ce=function(){var t=Zt(Jt().mark((function t(e){var r,n;return Jt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.commit,n={currentVersion:"",newVersion:"",lastUpdateTime:0,packStatus:"",isPackageOutOfDate:!1,hasH264:!1,hasVc1:!1,needH264:!1,needVc1:!1},t.prev=2,t.next=5,synowebapi.promises.request({api:"SYNO.AME.Pack",method:"get_info",version:1}).then((function(t){var e=t.current_version,r=t.new_version,n=t.last_update_time,o=t.has_h264,i=t.has_vc1,a=t.need_h264,c=t.need_vc1,u=t.package_out_of_date;return{currentVersion:e,newVersion:r,lastUpdateTime:n,packStatus:t.status,isPackageOutOfDate:u,hasH264:o,hasVc1:i,needH264:a,needVc1:c}}));case 5:n=t.sent,t.next=12;break;case 8:return t.prev=8,t.t0=t.catch(2),console.error(t.t0),t.abrupt("return",{packStatus:c});case 12:return r("SET_PACK_BINARY_STATUS",n.packStatus),r("SET_IS_PACKAGE_OUT_OF_DATE",n.isPackageOutOfDate),r("SET_PACK_CURRENT_VERSION",n.currentVersion),r("SET_PACK_NEW_VERSION",n.newVersion),r("SET_PACK_LAST_UPDATE_TIMESTAMP",n.lastUpdateTime),n.hasH264?r("SET_CODEC_INFO",{codec:"h264",isPackInstalled:!0}):n.needH264&&r("SET_CODEC_INFO",{codec:"h264",isPackInstalled:!1}),n.hasVc1?r("SET_CODEC_INFO",{codec:"vc1",isPackInstalled:!0}):n.needVc1&&r("SET_CODEC_INFO",{codec:"vc1",isPackInstalled:!1}),t.abrupt("return",{packStatus:n.packStatus});case 20:case"end":return t.stop()}}),t,null,[[2,8]])})));return function(e){return t.apply(this,arguments)}}(),ue=function(){return{isAppOpen:!1,loadingState:{isLoading:!0,showMask:!0},isPackageOutOfDate:!1,codecInfo:{},packInfo:{updateProgress:0,lastUpdateTimestampInSec:0,currentVersion:null,newVersion:null,binaryStatus:c}}},se=function t(e,r,n){Vue.set(e,r,n),"object"!==Xt(n)||Array.isArray(n)||null===n||Object.entries(n).forEach((function(r){var n=Wt(r,2),o=n[0],i=n[1];return t(e,o,i)}))},le=new(i().Store)({state:ue(),mutations:{RESET_APP_STATE:function(t){var e=ue();Object.entries(e).forEach((function(e){var r=Wt(e,2),n=r[0],o=r[1];return se(t,n,o)}))},SET_IS_APP_OPEN:function(t,e){t.isAppOpen=e},SET_IS_LOADING:function(t,e){t.loadingState.isLoading=e,t.loadingState.showMask=!0},SET_IS_LOADING_WITHOUT_MASK:function(t,e){t.loadingState.isLoading=e,t.loadingState.showMask=!1},SET_IS_PACKAGE_OUT_OF_DATE:function(t,e){t.isPackageOutOfDate=e},SET_CODEC_INFO:function(t,e){var r=e.codec,n=e.isPackInstalled;Vue.set(t.codecInfo,r,{isPackInstalled:n})},SET_PACK_UPDATE_PROGRESS:function(t,e){e<0?e=0:e>100&&(e=100),t.packInfo.updateProgress=e},SET_PACK_CURRENT_VERSION:function(t,e){t.packInfo.currentVersion=e},SET_PACK_NEW_VERSION:function(t,e){t.packInfo.newVersion=e},SET_PACK_LAST_UPDATE_TIMESTAMP:function(t,e){t.packInfo.lastUpdateTimestampInSec=e},SET_PACK_BINARY_STATUS:function(t,e){t.packInfo.binaryStatus=e}},actions:{closePaymentIframe:function(t){(0,t.commit)("SET_IS_LOADING",!1)},initState:function(t){var e=arguments;return Zt(Jt().mark((function r(){var n,o,i,a,c;return Jt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=t.commit,o=t.dispatch,i=e.length>1&&void 0!==e[1]?e[1]:function(){},n("SET_IS_APP_OPEN",!0),n("SET_IS_LOADING_WITHOUT_MASK",!0),r.next=6,ce({commit:n});case 6:a=r.sent,c=a.packStatus,te.includes(c)&&o("trackUpdateProgress",{prevPackStatus:c}),i(),n("SET_IS_LOADING_WITHOUT_MASK",!1);case 11:case"end":return r.stop()}}),r)})))()},trackUpdateProgress:function(t){var e=arguments;return Zt(Jt().mark((function r(){var n,o,i,a,c,u,s,l,f,p,h;return Jt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=t.commit,o=t.dispatch,i=t.state,a=(e.length>1&&void 0!==e[1]?e[1]:{}).prevPackStatus,c=void 0===a?"":a,i.isAppOpen){r.next=4;break}return r.abrupt("return");case 4:return r.prev=4,r.next=7,synowebapi.promises.request({api:"SYNO.AME.Pack",method:"get_info",version:1}).then((function(t){var e=t.download_progress,r=t.install_progress;return{packStatus:t.status,currentDownloadSize:e.download_size_now,totalDownloadSize:e.download_size_total,installStep:r.install_step}}));case 7:p=r.sent,u=p.packStatus,s=p.currentDownloadSize,l=p.totalDownloadSize,f=p.installStep,r.next=21;break;case 14:return r.prev=14,r.t0=r.catch(4),console.error("Failed to get info, error:",r.t0),r.next=19,Ht(ee);case 19:return o("trackUpdateProgress",{prevPackStatus:c}),r.abrupt("return");case 21:if(!ae(c,u)){r.next=24;break}return ce({commit:n}),r.abrupt("return");case 24:return n("SET_PACK_BINARY_STATUS",u),h=Kt({currentDownloadSize:s,totalDownloadSize:l,installStep:f}),n("SET_PACK_UPDATE_PROGRESS",h),r.next=29,Ht(ee);case 29:o("trackUpdateProgress",{prevPackStatus:u});case 30:case"end":return r.stop()}}),r,null,[[4,14]])})))()},downloadAndInstall:function(t){return Zt(Jt().mark((function e(){var r,n,o,i,a,c;return Jt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.dispatch,n=t.commit,o=t.state,n("SET_IS_LOADING",!0),i=o.packInfo.binaryStatus,n("SET_PACK_BINARY_STATUS",l),e.prev=4,e.next=7,$();case 7:return e.next=9,Ht(ee);case 9:r("trackUpdateProgress",{prevPackStatus:i}),e.next=27;break;case 12:e.prev=12,e.t0=e.catch(4),e.t1=e.t0.code,e.next=e.t1===y?17:e.t1===v?19:25;break;case 17:return n("SET_IS_PACKAGE_OUT_OF_DATE",!0),e.abrupt("break",27);case 19:return e.next=21,ce({commit:n});case 21:return a=e.sent,c=a.packStatus,te.includes(c)&&r("trackUpdateProgress",{prevPackStatus:c}),e.abrupt("break",27);case 25:console.error("Manual update failed:",e.t0),n("SET_PACK_BINARY_STATUS",p);case 27:n("SET_IS_LOADING",!1);case 28:case"end":return e.stop()}}),e,null,[[4,12]])})))()},getLicense:function(t){return Zt(Jt().mark((function e(){var r,n;return Jt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.commit,n=t.dispatch,r("SET_IS_LOADING",!0),e.prev=2,e.next=5,ce({commit:r});case 5:n("downloadAndInstall"),e.next=17;break;case 8:e.prev=8,e.t0=e.catch(2),e.t1=e.t0.code,e.next=e.t1===h||e.t1===d?13:16;break;case 13:return e.next=15,ie();case 15:return e.abrupt("break",17);case 16:console.error("Failed to activate free license:",e.t0);case 17:r("SET_IS_LOADING",!1);case 18:case"end":return e.stop()}}),e,null,[[2,8]])})))()},openUpdateConfirmDialog:function(t){return Zt(Jt().mark((function e(){var r,n,o;return Jt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.dispatch,e.next=3,ne();case 3:if(n=e.sent,"cancel"!==(o=n.type)){e.next=7;break}return e.abrupt("return");case 7:if("confirm"===o){e.next=10;break}return console.error("Invalid action type: ",o),e.abrupt("return");case 10:r("downloadAndInstall");case 11:case"end":return e.stop()}}),e)})))()}}});Ext.namespace("SYNO.AME"),
// @require SYNO.AME.ModalWindow
SYNO.AME.Instance=r().extend({components:{App:jt},template:"<App/>",store:le}),SYNO.AME.ModalWindow=r().extend({components:{ModalWindow:Dt},template:"<ModalWindow/>"})}();