(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[42],{

/***/ "./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/main/user/Signup.vue?vue&type=script&lang=js&":
/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/main/user/Signup.vue?vue&type=script&lang=js& ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/http */ \"./src/utils/http.js\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n  props: {\n    value: Boolean\n  },\n  components: {\n    BForm: () => Promise.all(/*! import() */[__webpack_require__.e(0), __webpack_require__.e(1), __webpack_require__.e(9)]).then(__webpack_require__.bind(null, /*! @/components/singles/BForm/component.vue */ \"./src/components/singles/BForm/component.vue\")),\n    Modal: () => __webpack_require__.e(/*! import() */ 2).then(__webpack_require__.bind(null, /*! @/components/main/Modal.vue */ \"./src/components/main/Modal.vue\"))\n  },\n  data() {\n    return {\n      isLoading: false,\n      form: {\n        valid: false,\n        inputs: [{\n          focus: true,\n          icon: \"mdi-card-account-details-outline\",\n          name: \"firstname\",\n          placeholder: \"First name\",\n          type: \"text\",\n          validation: \"min:1|max:30\",\n          value: \"\"\n        }, {\n          icon: \"mdi-card-account-details-outline\",\n          name: \"lastname\",\n          placeholder: \"Last name\",\n          type: \"text\",\n          validation: \"min:1|max:30\",\n          value: \"\"\n        }, {\n          icon: \"mdi-email\",\n          name: \"username\",\n          placeholder: \"Email\",\n          type: \"email\",\n          validation: \"email\",\n          value: \"\"\n        }, {\n          icon: \"mdi-lock\",\n          name: \"password\",\n          placeholder: \"Password\",\n          type: \"password\",\n          validation: \"min:8|confirmed:confirmation\",\n          value: \"\"\n        }]\n      }\n    };\n  },\n  created() {},\n  mounted() {},\n  methods: {\n    async save() {\n      if (this.form.valid && !this.isLoading) {\n        try {\n          this.isLoading = true;\n          if (this.$store.state.auth.success) {\n            await Object(_utils_http__WEBPACK_IMPORTED_MODULE_0__[\"postApi\"])(\"signup\", this.getForm(), {\n              fullDataObject: true\n            });\n          } else {\n            await Object(_utils_http__WEBPACK_IMPORTED_MODULE_0__[\"postApi\"])(\"signup\", this.getForm(), {\n              skipAuth: true,\n              fullDataObject: true\n            });\n          }\n          this.$helpers.notify(\"Success\", \"Sign up is complete.\", \"success\");\n          this.$emit(\"complete\", this.getForm());\n          this.isLoading = false;\n          this.hide();\n        } catch ({\n          response\n        }) {\n          if (response.status == 409) {\n            this.$helpers.notify(\"User\", \"The user already exists.\", \"info\");\n          } else if (response.status == 500) {\n            this.$helpers.notify(\"Error\", \"Internal server error, please try again later.\", \"danger\");\n          } else if (response.status == 400) {\n            console.log(response.data);\n            this.$helpers.notify(\"Error\", \"Missing parameter.\", \"danger\");\n          } else if (response.status == 401) {\n            console.log(response.data);\n            this.$helpers.notify(\"Error\", \"Permission denied.\", \"warning\");\n          }\n        }\n        this.isLoading = false;\n      }\n    },\n    getForm() {\n      return {\n        firstName: this.form.inputs[0].value,\n        lastName: this.form.inputs[1].value,\n        mail: this.form.inputs[2].value,\n        password: this.form.inputs[3].value\n      };\n    },\n    hide() {\n      if (!this.isLoading) this.$emit(\"hide\", false);\n    }\n  }\n});\n\n//# sourceURL=webpack:///./src/components/main/user/Signup.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options");

/***/ }),

/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"7d40fa80-vue-loader-template\"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/main/user/Signup.vue?vue&type=template&id=57d3a494&":
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7d40fa80-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/main/user/Signup.vue?vue&type=template&id=57d3a494& ***!
  \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! exports provided: render, staticRenderFns */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function() {\n  var _vm = this\n  var _h = _vm.$createElement\n  var _c = _vm._self._c || _h\n  return _c(\n    \"Modal\",\n    {\n      attrs: { value: _vm.value, title: \"Sign up\", skipCloseOnBgClick: true },\n      on: {\n        hide: function($event) {\n          return _vm.hide()\n        }\n      }\n    },\n    [\n      _c(\n        \"template\",\n        { staticClass: \"content\", slot: \"body\" },\n        [\n          _c(\"BForm\", {\n            attrs: { elements: _vm.form, mode: \"lazy\" },\n            on: {\n              valid: function($event) {\n                _vm.form.valid = $event\n              }\n            }\n          })\n        ],\n        1\n      ),\n      _c(\"template\", { staticClass: \"content\", slot: \"footer\" }, [\n        _c(\n          \"div\",\n          {\n            staticClass: \"button is-primary\",\n            class: { \"is-loading\": _vm.isLoading },\n            attrs: { disabled: !_vm.form.valid || _vm.isLoading },\n            on: {\n              click: function($event) {\n                return _vm.save()\n              }\n            }\n          },\n          [_vm._v(\" Sign up \")]\n        ),\n        _c(\n          \"div\",\n          {\n            staticClass: \"button\",\n            on: {\n              click: function($event) {\n                return _vm.hide()\n              }\n            }\n          },\n          [_vm._v(\"Cancel\")]\n        )\n      ])\n    ],\n    2\n  )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./src/components/main/user/Signup.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%227d40fa80-vue-loader-template%22%7D!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options");

/***/ }),

/***/ "./src/components/main/user/Signup.vue":
/*!*********************************************!*\
  !*** ./src/components/main/user/Signup.vue ***!
  \*********************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Signup_vue_vue_type_template_id_57d3a494___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Signup.vue?vue&type=template&id=57d3a494& */ \"./src/components/main/user/Signup.vue?vue&type=template&id=57d3a494&\");\n/* harmony import */ var _Signup_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Signup.vue?vue&type=script&lang=js& */ \"./src/components/main/user/Signup.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n  _Signup_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n  _Signup_vue_vue_type_template_id_57d3a494___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n  _Signup_vue_vue_type_template_id_57d3a494___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n  false,\n  null,\n  null,\n  null\n  \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"src/components/main/user/Signup.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);\n\n//# sourceURL=webpack:///./src/components/main/user/Signup.vue?");

/***/ }),

/***/ "./src/components/main/user/Signup.vue?vue&type=script&lang=js&":
/*!**********************************************************************!*\
  !*** ./src/components/main/user/Signup.vue?vue&type=script&lang=js& ***!
  \**********************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_12_0_node_modules_babel_loader_lib_index_js_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Signup_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/babel-loader/lib!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./Signup.vue?vue&type=script&lang=js& */ \"./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/main/user/Signup.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__[\"default\"] = (_node_modules_cache_loader_dist_cjs_js_ref_12_0_node_modules_babel_loader_lib_index_js_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Signup_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[\"default\"]); \n\n//# sourceURL=webpack:///./src/components/main/user/Signup.vue?");

/***/ }),

/***/ "./src/components/main/user/Signup.vue?vue&type=template&id=57d3a494&":
/*!****************************************************************************!*\
  !*** ./src/components/main/user/Signup.vue?vue&type=template&id=57d3a494& ***!
  \****************************************************************************/
/*! exports provided: render, staticRenderFns */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_cache_loader_dist_cjs_js_cacheDirectory_node_modules_cache_vue_loader_cacheIdentifier_7d40fa80_vue_loader_template_node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Signup_vue_vue_type_template_id_57d3a494___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"7d40fa80-vue-loader-template\"}!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./Signup.vue?vue&type=template&id=57d3a494& */ \"./node_modules/cache-loader/dist/cjs.js?{\\\"cacheDirectory\\\":\\\"node_modules/.cache/vue-loader\\\",\\\"cacheIdentifier\\\":\\\"7d40fa80-vue-loader-template\\\"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/main/user/Signup.vue?vue&type=template&id=57d3a494&\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return _node_modules_cache_loader_dist_cjs_js_cacheDirectory_node_modules_cache_vue_loader_cacheIdentifier_7d40fa80_vue_loader_template_node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Signup_vue_vue_type_template_id_57d3a494___WEBPACK_IMPORTED_MODULE_0__[\"render\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return _node_modules_cache_loader_dist_cjs_js_cacheDirectory_node_modules_cache_vue_loader_cacheIdentifier_7d40fa80_vue_loader_template_node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Signup_vue_vue_type_template_id_57d3a494___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"]; });\n\n\n\n//# sourceURL=webpack:///./src/components/main/user/Signup.vue?");

/***/ })

}]);