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

/***/ "./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/views/DomainShares.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/views/DomainShares.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/* harmony import */ var _utils_permission_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/utils/permission.js */ \"./src/utils/permission.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//\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//\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//\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//\n//\n//\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n  components: {\n    Title: () => __webpack_require__.e(/*! import() */ 4).then(__webpack_require__.bind(null, /*! @/components/singles/Title.vue */ \"./src/components/singles/Title.vue\")),\n    Plus: () => __webpack_require__.e(/*! import() */ 14).then(__webpack_require__.bind(null, /*! @/components/main/Plus.vue */ \"./src/components/main/Plus.vue\")),\n    Share: () => __webpack_require__.e(/*! import() */ 85).then(__webpack_require__.bind(null, /*! @/components/main/domain/Share.vue */ \"./src/components/main/domain/Share.vue\")),\n    Confirm: () => __webpack_require__.e(/*! import() */ 10).then(__webpack_require__.bind(null, /*! @/components/main/Confirm.vue */ \"./src/components/main/Confirm.vue\"))\n  },\n  data() {\n    return {\n      items: [],\n      domain: null,\n      firstLoadDone: false,\n      showDelete: false,\n      selected: null,\n      showAdd: false\n    };\n  },\n  async created() {\n    await this.getDomain();\n    await this.getUsers();\n    await this.getSources();\n    this.firstLoadDone = true;\n  },\n  computed: {\n    domainPermission() {\n      return domain => {\n        if (domain.permission) return _utils_permission_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].domain[domain.permission];else return \"Owner\";\n      };\n    },\n    sourcePermission() {\n      return source => {\n        if (source.permission) return _utils_permission_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].source[source.permission];\n      };\n    }\n  },\n  methods: {\n    toggle(item) {\n      const index = this.items.findIndex(x => x.user.uid === item.user.uid);\n      this.$set(this.items, index, {\n        ...item,\n        visible: !item.visible\n      });\n    },\n    async removeShare(item) {\n      const index = this.items.findIndex(x => x.user.uid === item.user.uid);\n      this.$set(this.items, index, {\n        ...item,\n        isLoading: true\n      });\n      const res = await Object(_utils_http__WEBPACK_IMPORTED_MODULE_0__[\"postApi\"])(\"delete/domainShare\", {\n        domainUID: this.domain.uid,\n        userUID2: item.user.uid\n      });\n      this.$delete(this.items, index);\n      this.showDelete = false;\n      this.selected = null;\n    },\n    async getSources() {\n      await this.$store.dispatch(\"source/fetch\", {\n        domainUID: this.$route.params.domainUID\n      });\n    },\n    async getDomain() {\n      await this.$store.dispatch(\"domain/fetch\");\n      this.domain = this.$store.getters[\"domain/single\"](this.$route.params.domainUID);\n    },\n    async getUsers() {\n      const res = await Object(_utils_http__WEBPACK_IMPORTED_MODULE_0__[\"postApi\"])(\"get/sharedDomainsAndUsers\", {\n        domainUID: this.$route.params.domainUID\n      });\n      this.items = res;\n    }\n  }\n});\n\n//# sourceURL=webpack:///./src/views/DomainShares.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/views/DomainShares.vue?vue&type=template&id=d11660dc&":
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** ./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/views/DomainShares.vue?vue&type=template&id=d11660dc& ***!
  \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! 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    \"section\",\n    { staticClass: \"section\" },\n    [\n      _c(\n        \"div\",\n        { staticClass: \"container\" },\n        [\n          _c(\n            \"Title\",\n            [\n              _vm._v(\"Users \"),\n              _c(\"Plus\", {\n                on: {\n                  click: function($event) {\n                    _vm.showAdd = true\n                  }\n                }\n              })\n            ],\n            1\n          ),\n          _c(\"div\", {\n            staticClass: \"loading\",\n            attrs: { \"ng-show\": \"!firstLoadDone\" }\n          }),\n          _vm.firstLoadDone && _vm.items.length === 0\n            ? _c(\"p\", { staticClass: \"is-italic\" }, [\n                _c(\"i\", [_vm._v(\"No users.\")])\n              ])\n            : _vm._e(),\n          _c(\n            \"div\",\n            {\n              directives: [\n                {\n                  name: \"show\",\n                  rawName: \"v-show\",\n                  value: _vm.firstLoadDone && _vm.items.length != 0,\n                  expression: \"firstLoadDone && items.length != 0\"\n                }\n              ],\n              staticClass: \"columns is-multiline\"\n            },\n            _vm._l(_vm.items, function(item) {\n              return _c(\n                \"div\",\n                {\n                  key: item.user.uid,\n                  staticClass: \"column is-one-third-widescreen is-unselectable\"\n                },\n                [\n                  _c(\"div\", { staticClass: \"card\" }, [\n                    _c(\n                      \"header\",\n                      {\n                        staticClass: \"card-header\",\n                        on: {\n                          click: function($event) {\n                            return _vm.toggle(item)\n                          }\n                        }\n                      },\n                      [\n                        _c(\"div\", { staticClass: \"card-header-title\" }, [\n                          _vm._m(0, true),\n                          _vm._v(_vm._s(item.user.mail) + \" \")\n                        ]),\n                        _c(\n                          \"a\",\n                          {\n                            staticClass: \"card-header-icon\",\n                            attrs: { \"aria-label\": \"show more\" }\n                          },\n                          [\n                            _c(\"span\", { staticClass: \"icon\" }, [\n                              _c(\"i\", {\n                                staticClass: \"mdi\",\n                                class: {\n                                  \"mdi-chevron-down\": !item.visible,\n                                  \"mdi-chevron-up\": item.visible\n                                },\n                                attrs: { \"aria-hidden\": \"true\" }\n                              })\n                            ])\n                          ]\n                        )\n                      ]\n                    ),\n                    _c(\n                      \"div\",\n                      {\n                        directives: [\n                          {\n                            name: \"show\",\n                            rawName: \"v-show\",\n                            value: item.visible,\n                            expression: \"item.visible\"\n                          }\n                        ],\n                        staticClass: \"card-content\"\n                      },\n                      [\n                        _c(\n                          \"table\",\n                          { staticClass: \"table is-narrow is-fullwidth\" },\n                          [\n                            _vm._m(1, true),\n                            _c(\n                              \"tbody\",\n                              [\n                                _c(\"tr\", [\n                                  _c(\"td\", [_vm._v(\"Domain\")]),\n                                  _c(\"td\", [\n                                    _vm._v(_vm._s(_vm.domain.friendlyName))\n                                  ]),\n                                  _c(\"td\", [\n                                    _vm._v(\n                                      \" \" +\n                                        _vm._s(\n                                          _vm.domainPermission(item.domain)\n                                        ) +\n                                        \" \"\n                                    )\n                                  ])\n                                ]),\n                                _vm._l(item.sources, function(source) {\n                                  return _c(\"tr\", { key: source.uid }, [\n                                    _c(\"td\", [_vm._v(\"Repository\")]),\n                                    _c(\"td\", [_vm._v(_vm._s(source.name))]),\n                                    _c(\"td\", [\n                                      _vm._v(\n                                        \" \" +\n                                          _vm._s(_vm.sourcePermission(source)) +\n                                          \" \"\n                                      )\n                                    ])\n                                  ])\n                                })\n                              ],\n                              2\n                            )\n                          ]\n                        )\n                      ]\n                    ),\n                    _c(\n                      \"footer\",\n                      {\n                        directives: [\n                          {\n                            name: \"show\",\n                            rawName: \"v-show\",\n                            value: item.visible,\n                            expression: \"item.visible\"\n                          }\n                        ],\n                        staticClass: \"card-footer\"\n                      },\n                      [\n                        !item.isLoading\n                          ? _c(\n                              \"a\",\n                              {\n                                staticClass: \"card-footer-item\",\n                                attrs: {\n                                  disabled:\n                                    _vm.domain.permission &&\n                                    _vm.domain.permission < 256\n                                },\n                                on: {\n                                  click: function($event) {\n                                    _vm.selected = item\n                                    _vm.showDelete = true\n                                  }\n                                }\n                              },\n                              [_vm._v(\"Stop share\")]\n                            )\n                          : _vm._e(),\n                        item.isLoading\n                          ? _c(\n                              \"a\",\n                              {\n                                staticClass:\n                                  \"card-footer-item spinner-wrapper center\"\n                              },\n                              [\n                                _c(\"span\", {\n                                  staticClass: \"spinner is-centered\"\n                                })\n                              ]\n                            )\n                          : _vm._e()\n                      ]\n                    )\n                  ])\n                ]\n              )\n            }),\n            0\n          )\n        ],\n        1\n      ),\n      _vm.domain && _vm.showAdd\n        ? _c(\"Share\", {\n            attrs: {\n              domain: _vm.domain,\n              sources: _vm.$store.state.source.sources\n            },\n            on: {\n              hide: function($event) {\n                _vm.selected = null\n              },\n              change: function($event) {\n                return _vm.getUsers()\n              }\n            },\n            model: {\n              value: _vm.showAdd,\n              callback: function($$v) {\n                _vm.showAdd = $$v\n              },\n              expression: \"showAdd\"\n            }\n          })\n        : _vm._e(),\n      _vm.selected && _vm.showDelete\n        ? _c(\n            \"Confirm\",\n            {\n              on: {\n                hide: function($event) {\n                  _vm.selected = null\n                },\n                confirmed: function($event) {\n                  return _vm.removeShare(_vm.selected)\n                }\n              },\n              model: {\n                value: _vm.showDelete,\n                callback: function($$v) {\n                  _vm.showDelete = $$v\n                },\n                expression: \"showDelete\"\n              }\n            },\n            [\n              _vm._v(\" You are about to stop sharing the domain \"),\n              _c(\"i\", [_vm._v(_vm._s(_vm.domain.friendlyName))]),\n              _vm._v(\" with \" + _vm._s(_vm.selected.user.mail) + \". \")\n            ]\n          )\n        : _vm._e()\n    ],\n    1\n  )\n}\nvar staticRenderFns = [\n  function() {\n    var _vm = this\n    var _h = _vm.$createElement\n    var _c = _vm._self._c || _h\n    return _c(\"span\", { staticClass: \"icon\" }, [\n      _c(\"i\", { staticClass: \"mdi mdi-account\" })\n    ])\n  },\n  function() {\n    var _vm = this\n    var _h = _vm.$createElement\n    var _c = _vm._self._c || _h\n    return _c(\"thead\", [\n      _c(\"tr\", [\n        _c(\"th\", [_vm._v(\"Type\")]),\n        _c(\"th\", [_vm._v(\"Name\")]),\n        _c(\"th\", [_vm._v(\"Permission\")])\n      ])\n    ])\n  }\n]\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack:///./src/views/DomainShares.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/utils/permission.js":
/*!*********************************!*\
  !*** ./src/utils/permission.js ***!
  \*********************************/
/*! exports provided: domain, source, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"domain\", function() { return domain; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"source\", function() { return source; });\nconst domain = {\n  4: \"Read\",\n  8: \"Execute\",\n  16: \"Change\",\n  32: \"Add\",\n  64: \"Remove\",\n  128: \"Remove domain\",\n  256: \"Edit shares\"\n};\nconst source = {\n  1: \"Read\",\n  2: \"Download\",\n  4: \"Update\",\n  8: \"Create\",\n  16: \"Delete\",\n  32: \"Owner\"\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n  domain,\n  source\n});\n\n//# sourceURL=webpack:///./src/utils/permission.js?");

/***/ }),

/***/ "./src/views/DomainShares.vue":
/*!************************************!*\
  !*** ./src/views/DomainShares.vue ***!
  \************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _DomainShares_vue_vue_type_template_id_d11660dc___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DomainShares.vue?vue&type=template&id=d11660dc& */ \"./src/views/DomainShares.vue?vue&type=template&id=d11660dc&\");\n/* harmony import */ var _DomainShares_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DomainShares.vue?vue&type=script&lang=js& */ \"./src/views/DomainShares.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  _DomainShares_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n  _DomainShares_vue_vue_type_template_id_d11660dc___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n  _DomainShares_vue_vue_type_template_id_d11660dc___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/views/DomainShares.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);\n\n//# sourceURL=webpack:///./src/views/DomainShares.vue?");

/***/ }),

/***/ "./src/views/DomainShares.vue?vue&type=script&lang=js&":
/*!*************************************************************!*\
  !*** ./src/views/DomainShares.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_DomainShares_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!./DomainShares.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/views/DomainShares.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_DomainShares_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[\"default\"]); \n\n//# sourceURL=webpack:///./src/views/DomainShares.vue?");

/***/ }),

/***/ "./src/views/DomainShares.vue?vue&type=template&id=d11660dc&":
/*!*******************************************************************!*\
  !*** ./src/views/DomainShares.vue?vue&type=template&id=d11660dc& ***!
  \*******************************************************************/
/*! 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_DomainShares_vue_vue_type_template_id_d11660dc___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!./DomainShares.vue?vue&type=template&id=d11660dc& */ \"./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/views/DomainShares.vue?vue&type=template&id=d11660dc&\");\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_DomainShares_vue_vue_type_template_id_d11660dc___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_DomainShares_vue_vue_type_template_id_d11660dc___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"]; });\n\n\n\n//# sourceURL=webpack:///./src/views/DomainShares.vue?");

/***/ })

}]);