exports.ids = [5];
exports.modules = {

/***/ 253:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
/* harmony import */ var _mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31);
/* harmony import */ var _mixins_registrable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39);
// Mixins



/* @vue/component */

/* harmony default export */ __webpack_exports__["a"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_mixins_binds_attrs__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], Object(_mixins_registrable__WEBPACK_IMPORTED_MODULE_2__[/* provide */ "b"])('form')
/* @vue/component */).extend({
  name: 'v-form',
  provide() {
    return {
      form: this
    };
  },
  inheritAttrs: false,
  props: {
    disabled: Boolean,
    lazyValidation: Boolean,
    readonly: Boolean,
    value: Boolean
  },
  data: () => ({
    inputs: [],
    watchers: [],
    errorBag: {}
  }),
  watch: {
    errorBag: {
      handler(val) {
        const errors = Object.values(val).includes(true);
        this.$emit('input', !errors);
      },
      deep: true,
      immediate: true
    }
  },
  methods: {
    watchInput(input) {
      const watcher = input => {
        return input.$watch('hasError', val => {
          this.$set(this.errorBag, input._uid, val);
        }, {
          immediate: true
        });
      };
      const watchers = {
        _uid: input._uid,
        valid: () => {},
        shouldValidate: () => {}
      };
      if (this.lazyValidation) {
        // Only start watching inputs if we need to
        watchers.shouldValidate = input.$watch('shouldValidate', val => {
          if (!val) return; // Only watch if we're not already doing it

          if (this.errorBag.hasOwnProperty(input._uid)) return;
          watchers.valid = watcher(input);
        });
      } else {
        watchers.valid = watcher(input);
      }
      return watchers;
    },
    /** @public */
    validate() {
      return this.inputs.filter(input => !input.validate(true)).length === 0;
    },
    /** @public */
    reset() {
      this.inputs.forEach(input => input.reset());
      this.resetErrorBag();
    },
    resetErrorBag() {
      if (this.lazyValidation) {
        // Account for timeout in validatable
        setTimeout(() => {
          this.errorBag = {};
        }, 0);
      }
    },
    /** @public */
    resetValidation() {
      this.inputs.forEach(input => input.resetValidation());
      this.resetErrorBag();
    },
    register(input) {
      this.inputs.push(input);
      this.watchers.push(this.watchInput(input));
    },
    unregister(input) {
      const found = this.inputs.find(i => i._uid === input._uid);
      if (!found) return;
      const unwatch = this.watchers.find(i => i._uid === found._uid);
      if (unwatch) {
        unwatch.valid();
        unwatch.shouldValidate();
      }
      this.watchers = this.watchers.filter(i => i._uid !== found._uid);
      this.inputs = this.inputs.filter(i => i._uid !== found._uid);
      this.$delete(this.errorBag, found._uid);
    }
  },
  render(h) {
    return h('form', {
      staticClass: 'v-form',
      attrs: {
        novalidate: true,
        ...this.attrs$
      },
      on: {
        submit: e => this.$emit('submit', e)
      }
    }, this.$slots.default);
  }
}));

/***/ }),

/***/ 273:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(URLSearchParams) {/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vuex__WEBPACK_IMPORTED_MODULE_0__);

/* harmony default export */ __webpack_exports__["a"] = ({
  name: 'Login',
  data() {
    return {
      password: '',
      email: '',
      loading: false,
      valid: false
    };
  },
  computed: Object(vuex__WEBPACK_IMPORTED_MODULE_0__["mapState"])(['settings']),
  methods: {
    async forgot() {
      if (!this.email) {
        this.$refs.email.focus();
        return;
      }
      this.loading = true;
      await this.$axios.$post('/user/recover', {
        email: this.email
      });
      this.loading = false;
      this.$root.$message('login.check_email', {
        color: 'success'
      });
    },
    async submit(e) {
      if (!this.$refs.form.validate()) return;
      try {
        this.loading = true;
        const data = new URLSearchParams();
        data.append('username', this.email);
        data.append('password', this.password);
        data.append('grant_type', 'password');
        data.append('client_id', 'self');
        await this.$auth.loginWith('local', {
          data
        });
        this.loading = false;
        this.$root.$message('login.ok', {
          color: 'success'
        });
      } catch (e) {
        this.$root.$message('login.error', {
          color: 'error'
        });
        this.loading = false;
        return;
      }
      this.email = this.password = '';
    }
  },
  head() {
    return {
      htmlAttrs: {
        lang: this.settings.instance_locale
      },
      title: this.settings.title + ' - ' + this.$t('common.login')
    };
  }
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(82)["URLSearchParams"]))

/***/ }),

/***/ 370:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VBtn/VBtn.js
var VBtn = __webpack_require__(87);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VCard/VCard.js
var VCard = __webpack_require__(88);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VCard/index.js
var components_VCard = __webpack_require__(14);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VCol.js
var VCol = __webpack_require__(226);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VContainer.js + 1 modules
var VContainer = __webpack_require__(230);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VForm/VForm.js
var VForm = __webpack_require__(253);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VRow.js
var VRow = __webpack_require__(225);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VSpacer.js
var VSpacer = __webpack_require__(223);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VTextField/VTextField.js + 3 modules
var VTextField = __webpack_require__(47);

// CONCATENATED MODULE: ./node_modules/vuetify-loader/lib/loader.js??ref--4!./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--7!./node_modules/pug-plain-loader??ref--1-oneOf-0-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/Login.vue?vue&type=template&id=f758720e&lang=pug













var Loginvue_type_template_id_f758720e_lang_pug_render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c(VContainer["a" /* default */], {
    staticClass: "pa-0 pa-md-3"
  }, [_c(VRow["a" /* default */], {
    staticClass: "mt-md-5 ma-0",
    attrs: {
      "align": "center",
      "justify": "center"
    }
  }, [_c(VCol["a" /* default */], {
    staticClass: "pa-0 pa-md-3",
    attrs: {
      "cols": "12",
      "md": "6",
      "lg": "5",
      "xl": "4"
    }
  }, [_c(VForm["a" /* default */], {
    ref: "form",
    attrs: {
      "lazy-validation": ""
    },
    on: {
      "submit": function ($event) {
        $event.preventDefault();
        return _vm.submit.apply(null, arguments);
      }
    },
    model: {
      value: _vm.valid,
      callback: function ($$v) {
        _vm.valid = $$v;
      },
      expression: "valid"
    }
  }, [_c(VCard["a" /* default */], [_c(components_VCard["d" /* VCardTitle */], [_vm._v(_vm._s(_vm.$t('common.login')))]), _c(components_VCard["b" /* VCardSubtitle */], {
    domProps: {
      "textContent": _vm._s(_vm.$t('login.description'))
    }
  }), _c(components_VCard["c" /* VCardText */], [_c(VTextField["a" /* default */], {
    ref: "email",
    attrs: {
      "type": "email",
      "validate-on-blur": "",
      "rules": _vm.$validators.email,
      "autofocus": "",
      "label": _vm.$t("common.email")
    },
    model: {
      value: _vm.email,
      callback: function ($$v) {
        _vm.email = $$v;
      },
      expression: "email"
    }
  }), _c(VTextField["a" /* default */], {
    attrs: {
      "rules": _vm.$validators.password,
      "type": "password",
      "label": _vm.$t("common.password")
    },
    model: {
      value: _vm.password,
      callback: function ($$v) {
        _vm.password = $$v;
      },
      expression: "password"
    }
  })], 1), _c(components_VCard["a" /* VCardActions */], [_c(VBtn["a" /* default */], {
    attrs: {
      "text": "",
      "tabindex": "1",
      "small": ""
    },
    on: {
      "click": _vm.forgot
    }
  }, [_vm._v(_vm._s(_vm.$t('login.forgot_password')))])], 1), _c(components_VCard["a" /* VCardActions */], [_c(VSpacer["a" /* default */]), _vm.settings.allow_registration ? _c(VBtn["a" /* default */], {
    attrs: {
      "to": "/register",
      "text": "",
      "color": "orange"
    }
  }, [_vm._v(_vm._s(_vm.$t('login.not_registered')))]) : _vm._e(), _c(VBtn["a" /* default */], {
    attrs: {
      "color": "success",
      "type": "submit",
      "outlined": "",
      "disabled": !_vm.valid || _vm.loading,
      "loading": _vm.loading
    }
  }, [_vm._v(_vm._s(_vm.$t('common.login')))])], 1)], 1)], 1)], 1)], 1)], 1);
};
var staticRenderFns = [];

// CONCATENATED MODULE: ./pages/Login.vue?vue&type=template&id=f758720e&lang=pug

// EXTERNAL MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--2-0!./node_modules/babel-loader/lib??ref--2-1!./node_modules/vue-loader/lib??vue-loader-options!./pages/Login.vue?vue&type=script&lang=js
var Loginvue_type_script_lang_js = __webpack_require__(273);

// CONCATENATED MODULE: ./pages/Login.vue?vue&type=script&lang=js
 /* harmony default export */ var pages_Loginvue_type_script_lang_js = (Loginvue_type_script_lang_js["a" /* default */]); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(7);

// CONCATENATED MODULE: ./pages/Login.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  pages_Loginvue_type_script_lang_js,
  Loginvue_type_template_id_f758720e_lang_pug_render,
  staticRenderFns,
  false,
  null,
  null,
  "1ab9f5d5"
  
)

/* harmony default export */ var Login = __webpack_exports__["default"] = (component.exports);

/***/ })

};;
//# sourceMappingURL=Login.js.map