(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{178:function(t,s,e){var r=e(238);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);(0,e(5).default)("6223f415",r,!1,{})},237:function(t,s,e){"use strict";var r=e(178);e.n(r).a},238:function(t,s,e){(s=e(4)(!1)).push([t.i,".status-text{text-align:center}.status-text--error{color:var(--color-button-cancel)}\n",""]),t.exports=s},297:function(t,s,e){"use strict";e.r(s);var r=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)])])])])};r._withStripped=!0;var a=e(3),i=e(13);function n(t,s){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);s&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),e.push.apply(e,r)}return e}function o(t,s,e){return s in t?Object.defineProperty(t,s,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[s]=e,t}var c={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]:{};s%2?n(Object(e),!0).forEach((function(s){o(t,s,e[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):n(Object(e)).forEach((function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(e,s))}))}return t}({},Object(a.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"})}}},u=(e(237),e(1)),p=Object(u.a)(c,r,[],!1,null,null,null);p.options.__file="src/views/Setup.vue";s.default=p.exports}}]);