(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{850:function(e,t,r){"use strict";r.r(t);var o=r(193),n=r(194),l=r(27),c=r(493),d=r(497),m=r(540),f=r(190),v=r(492),$=r(490),O=r(102),h=r(489),w=(r(210),r(5)),y=r(2),j=(r(18),r(29),r(16)),_=r(506),P=r.n(_),k=r(11);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}var C={name:"Register",data:()=>({mdiChevronRight:k.v,loading:!1,user:{},valid:!0}),validate(e){var{store:t}=e;return t.state.settings.allow_registration},computed:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){Object(y.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},Object(j.d)(["settings"])),mounted(){this.$refs.email.focus()},methods:{register(){var e=this;return Object(w.a)((function*(){if(e.$refs.form.validate()){try{e.loading=!0;var t=yield e.$axios.$post("/user/register",e.user),r=t&&t.is_admin&&t.is_active;e.$root.$message(r?"register.first_user":"register.complete",{color:"success"}),e.$router.replace("/")}catch(t){var o=P()(t,"response.data.errors[0].message",String(t));e.$root.$message(o,{color:"error"})}e.loading=!1}}))()}},head(){return{htmlAttrs:{lang:this.settings.instance_locale},title:this.settings.title+" - "+this.$t("common.register")}}},D=C,R=r(13),component=Object(R.a)(D,(function(){var e=this,t=e._self._c;return t(d.a,{staticClass:"pa-0 pa-md-3"},[t(v.a,{staticClass:"mt-md-5 ma-0",attrs:{align:"center",justify:"center"}},[t(c.a,{staticClass:"pa-0 pa-md-3",attrs:{cols:"12",md:"6",lg:"5",xl:"4"}},[t(n.a,[t(l.d,[e._v(e._s(e.$t("common.register")))]),t(l.c,[t("p",{domProps:{innerHTML:e._s(e.$t("register.description"))}}),t(m.a,{ref:"form",model:{value:e.valid,callback:function(t){e.valid=t},expression:"valid"}},[t(O.a,{ref:"email",attrs:{type:"email",rules:e.$validators.email,label:e.$t("common.email"),autocomplete:"email"},model:{value:e.user.email,callback:function(t){e.$set(e.user,"email",t)},expression:"user.email"}}),t(O.a,{attrs:{type:"password",rules:e.$validators.password,label:e.$t("common.password")},model:{value:e.user.password,callback:function(t){e.$set(e.user,"password",t)},expression:"user.password"}}),t(h.a,{attrs:{rules:[e.$validators.required(e.$t("common.description"))],label:e.$t("common.description")},model:{value:e.user.description,callback:function(t){e.$set(e.user,"description",t)},expression:"user.description"}})],1)],1),t(l.a,[t($.a),t(o.a,{attrs:{outlined:"",disabled:!e.valid||e.loading,loading:e.loading,color:"primary"},on:{click:e.register}},[e._v(e._s(e.$t("common.send"))),t(f.a,{domProps:{textContent:e._s(e.mdiChevronRight)}})],1)],1)],1)],1)],1)],1)}),[],!1,null,null,null);t.default=component.exports}}]);