(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{190:function(t,s,e){var a=e(256);"string"==typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);(0,e(5).default)("280936a2",a,!1,{})},255:function(t,s,e){"use strict";var a=e(190);e.n(a).a},256:function(t,s,e){(t.exports=e(4)(!1)).push([t.i,".status-text {\n  text-align: center;\n}\n.status-text--error {\n  color: var(--color-button-cancel);\n}\n",""])},342:function(t,s,e){"use strict";e.r(s);var a=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("main",{staticClass:"main-container main-container--center"},[e("div",{staticClass:"container container--small"},[e("h2",{staticClass:"title"},[t._v(t._s(t.$t("setup")))]),t._v(" "),"NOT_CONNECTED"===t.status?e("p",{staticClass:"status-text status-text--error"},[t._v(t._s(t.$t("setup-not-connected")))]):t._e(),t._v(" "),"RATE_LIMITED"===t.status?e("p",{staticClass:"status-text status-text--error"},[t._v(t._s(t.$t("setup-rate-limited")))]):t._e(),t._v(" "),"AUTHENTICATED"===t.status?e("p",{staticClass:"status-text"},[t._v(t._s(t.$t("setup-authenticated")))]):t._e(),t._v(" "),"UNAUTHORIZED"===t.status?e("p",{staticClass:"status-text"},[t._v(t._s(t.$t("setup-description")))]):t._e(),t._v(" "),"UNAUTHORIZED"===t.status?e("div",{staticClass:"form-item"},[e("label",{staticClass:"form-item__label",attrs:{for:"password"}},[t._v(t._s(t.$t("password")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.password,expression:"password"}],staticClass:"form-item__input",attrs:{id:"password",type:"password"},domProps:{value:t.password},on:{keydown:function(s){return!s.type.indexOf("key")&&t._k(s.keyCode,"enter",13,s.key,"Enter")?null:t.updatePassword(s)},input:function(s){s.target.composing||(t.password=s.target.value)}}})]):t._e(),t._v(" "),e("div",{staticClass:"form-item"},[e("div",{staticClass:"form-item__buttons form-item__buttons--center"},[e("button",{staticClass:"button button--confirm",on:{click:t.onButtonClick}},[t.processing?e("font-awesome-icon",{attrs:{icon:"spinner",spin:""}}):e("span",[t._v(t._s(t.buttonText))])],1)])])])])};a._withStripped=!0;var r=e(3),i=e(13);function n(t,s,e){return s in t?Object.defineProperty(t,s,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[s]=e,t}var o={name:"setup",metaInfo(){return{title:this.$t("setup")}},data(){return{password:this.$store.getters["auth/password"],processing:!1}},computed:function(t){for(var s=1;s<arguments.length;s++){var e=null!=arguments[s]?arguments[s]:{},a=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.forEach(function(s){n(t,s,e[s])})}return t}({},Object(r.c)({status:"auth/status"}),{buttonText(){switch(this.status){case i.a.UNAUTHORIZED:case i.a.AUTHENTICATED:return this.$t("continue");default:return this.$t("refresh")}}}),methods:{async onButtonClick(){if(!this.processing)switch(this.status){case i.a.UNAUTHORIZED:this.updatePassword();break;case i.a.AUTHENTICATED:this.redirect();break;default:this.refreshStatus()}},async updatePassword(){this.processing=!0;try{await this.$store.dispatch("auth/setPassword",this.password),await this.$store.dispatch("auth/validate")?this.$router.replace({name:"home"}):this.$error(this.$t("password-invalid"))}catch(t){this.$error(t.message)}finally{this.processing=!1}},async refreshStatus(){this.processing=!0;try{await this.$store.dispatch("auth/updateStatus")}catch(t){this.$error(t.message)}finally{this.processing=!1}},redirect(){this.$router.replace({name:"home"})}}},c=(e(255),e(1)),u=Object(c.a)(o,a,[],!1,null,null,null);u.options.__file="src/views/Setup.vue";s.default=u.exports}}]);