(window.webpackJsonpSettings=window.webpackJsonpSettings||[]).push([[6],{263:function(t,e){function s(t){return"function"==typeof t.value||(console.warn("[Vue-click-outside:] provided expression",t.expression,"is not a function."),!1)}function i(t){return void 0!==t.componentInstance&&t.componentInstance.$isServer}t.exports={bind:function(t,e,n){function a(e){if(n.context){var s=e.path||e.composedPath&&e.composedPath();s&&s.length>0&&s.unshift(e.target),t.contains(e.target)||function(t,e){if(!t||!e)return!1;for(var s=0,i=e.length;ss.parts.length&&(i.parts.length=s.parts.length)}else{var r=[];for(n=0;n',"\nscript:\n...\ninfiniteHandler($state) {\n ajax('https://www.example.com/api/news')\n .then((res) => {\n if (res.data.length) {\n $state.loaded();\n } else {\n $state.complete();\n }\n });\n}\n...","","more details: https://github.com/PeachScript/vue-infinite-loading/issues/57#issuecomment-324370549"].join("\n"),INFINITE_EVENT:"`:on-infinite` property will be deprecated soon, please use `@infinite` event instead.",IDENTIFIER:"the `reset` event will be deprecated soon, please reset this component by change the `identifier` property."},r={INFINITE_LOOP:["executed the callback function more than ".concat(i.loopCheckMaxCalls," times for a short time, it looks like searched a wrong scroll wrapper that doest not has fixed height or maximum height, please check it. If you want to force to set a element as scroll wrapper ranther than automatic searching, you can do this:"),'\n\x3c!-- add a special attribute for the real scroll wrapper --\x3e\n
\n ...\n \x3c!-- set force-use-infinite-wrapper --\x3e\n \n
\nor\n
\n ...\n \x3c!-- set force-use-infinite-wrapper as css selector of the real scroll wrapper --\x3e\n \n
\n ',"more details: https://github.com/PeachScript/vue-infinite-loading/issues/55#issuecomment-316934169"].join("\n")},o={READY:0,LOADING:1,COMPLETE:2,ERROR:3},l={color:"#666",fontSize:"14px",padding:"10px 0"},u={mode:"development",props:{spinner:"default",distance:100,forceUseInfiniteWrapper:!1},system:i,slots:{noResults:"No results :(",noMore:"No more data :)",error:"Opps, something went wrong :(",errorBtnText:"Retry",spinner:""},WARNINGS:a,ERRORS:r,STATUS:o},d=s(4),c=s.n(d),p={BUBBLES:{render:function(t){return t("span",{attrs:{class:"loading-bubbles"}},Array.apply(Array,Array(8)).map((function(){return t("span",{attrs:{class:"bubble-item"}})})))}},CIRCLES:{render:function(t){return t("span",{attrs:{class:"loading-circles"}},Array.apply(Array,Array(8)).map((function(){return t("span",{attrs:{class:"circle-item"}})})))}},DEFAULT:{render:function(t){return t("i",{attrs:{class:"loading-default"}})}},SPIRAL:{render:function(t){return t("i",{attrs:{class:"loading-spiral"}})}},WAVEDOTS:{render:function(t){return t("span",{attrs:{class:"loading-wave-dots"}},Array.apply(Array,Array(5)).map((function(){return t("span",{attrs:{class:"wave-item"}})})))}}};function g(t,e,s,i,n,a,r,o){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=s,u._compiled=!0),i&&(u.functional=!0),a&&(u._scopeId="data-v-"+a),r?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=l):n&&(l=o?function(){n.call(this,this.$root.$options.shadowRoot)}:n),l)if(u.functional){u._injectStyles=l;var d=u.render;u.render=function(t,e){return l.call(e),d(t,e)}}else{var c=u.beforeCreate;u.beforeCreate=c?[].concat(c,l):[l]}return{exports:t,options:u}}var h=g({name:"Spinner",computed:{spinnerView:function(){return p[(this.$attrs.spinner||"").toUpperCase()]||this.spinnerInConfig},spinnerInConfig:function(){return u.slots.spinner&&"string"==typeof u.slots.spinner?{render:function(){return this._v(u.slots.spinner)}}:"object"===c()(u.slots.spinner)?u.slots.spinner:p[u.props.spinner.toUpperCase()]||p.DEFAULT}}},(function(){var t=this.$createElement;return(this._self._c||t)(this.spinnerView,{tag:"component"})}),[],!1,(function(t){var e=s(5);e.__inject__&&e.__inject__(t)}),"46b20d22",null);h.options.__file="Spinner.vue";var f=h.exports;function m(t){"production"!==u.mode&&console.warn("[Vue-infinite-loading warn]: ".concat(t))}var v={timers:[],caches:[],throttle:function(t){var e=this;-1===this.caches.indexOf(t)&&(this.caches.push(t),this.timers.push(setTimeout((function(){t(),e.caches.splice(e.caches.indexOf(t),1),e.timers.shift()}),u.system.throttleLimit)))},reset:function(){this.timers.forEach((function(t){clearTimeout(t)})),this.timers.length=0,this.caches=[]}},b={isChecked:!1,timer:null,times:0,track:function(){var t=this;this.times+=1,clearTimeout(this.timer),this.timer=setTimeout((function(){t.isChecked=!0}),u.system.loopCheckTimeout),this.times>u.system.loopCheckMaxCalls&&(function(t){console.error("[Vue-infinite-loading error]: ".concat(t))}(r.INFINITE_LOOP),this.isChecked=!0)}},w={key:"_infiniteScrollHeight",getScrollElm:function(t){return t===window?document.documentElement:t},save:function(t){var e=this.getScrollElm(t);e[this.key]=e.scrollHeight},restore:function(t){var e=this.getScrollElm(t);"number"==typeof e[this.key]&&(e.scrollTop=e.scrollHeight-e[this.key]+e.scrollTop),this.remove(e)},remove:function(t){void 0!==t[this.key]&&delete t[this.key]}};function y(t){return t.offsetWidth+t.offsetHeight>0}var _=g({name:"InfiniteLoading",data:function(){return{scrollParent:null,scrollHandler:null,isFirstLoad:!0,status:o.READY,slots:u.slots}},components:{Spinner:f},computed:{isShowSpinner:function(){return this.status===o.LOADING},isShowError:function(){return this.status===o.ERROR},isShowNoResults:function(){return this.status===o.COMPLETE&&this.isFirstLoad},isShowNoMore:function(){return this.status===o.COMPLETE&&!this.isFirstLoad},slotStyles:function(){var t=this,e={};return Object.keys(u.slots).forEach((function(s){var i=function(t){return t.replace(/[A-Z]/g,(function(t){return"-".concat(t.toLowerCase())}))}(s);(!t.$slots[i]&&!u.slots[s].render||t.$slots[i]&&!t.$slots[i][0].tag)&&(e[s]=l)})),e}},props:{distance:{type:Number,default:u.props.distance},spinner:String,direction:{type:String,default:"bottom"},forceUseInfiniteWrapper:{type:[Boolean,String],default:u.props.forceUseInfiniteWrapper},identifier:{default:+new Date},onInfinite:Function},watch:{identifier:function(){this.stateChanger.reset()}},mounted:function(){var t=this;this.$watch("forceUseInfiniteWrapper",(function(){t.scrollParent=t.getScrollParent()}),{immediate:!0}),this.scrollHandler=function(e){t.status===o.READY&&(e&&e.constructor===Event&&y(t.$el)?v.throttle(t.attemptLoad):t.attemptLoad())},setTimeout((function(){t.scrollHandler(),t.scrollParent.addEventListener("scroll",t.scrollHandler,n)}),1),this.$on("$InfiniteLoading:loaded",(function(e){t.isFirstLoad=!1,"top"===t.direction&&t.$nextTick((function(){w.restore(t.scrollParent)})),t.status===o.LOADING&&t.$nextTick(t.attemptLoad.bind(null,!0)),e&&e.target===t||m(a.STATE_CHANGER)})),this.$on("$InfiniteLoading:complete",(function(e){t.status=o.COMPLETE,t.$nextTick((function(){t.$forceUpdate()})),t.scrollParent.removeEventListener("scroll",t.scrollHandler,n),e&&e.target===t||m(a.STATE_CHANGER)})),this.$on("$InfiniteLoading:reset",(function(e){t.status=o.READY,t.isFirstLoad=!0,w.remove(t.scrollParent),t.scrollParent.addEventListener("scroll",t.scrollHandler,n),setTimeout((function(){v.reset(),t.scrollHandler()}),1),e&&e.target===t||m(a.IDENTIFIER)})),this.stateChanger={loaded:function(){t.$emit("$InfiniteLoading:loaded",{target:t})},complete:function(){t.$emit("$InfiniteLoading:complete",{target:t})},reset:function(){t.$emit("$InfiniteLoading:reset",{target:t})},error:function(){t.status=o.ERROR,v.reset()}},this.onInfinite&&m(a.INFINITE_EVENT)},deactivated:function(){this.status===o.LOADING&&(this.status=o.READY),this.scrollParent.removeEventListener("scroll",this.scrollHandler,n)},activated:function(){this.scrollParent.addEventListener("scroll",this.scrollHandler,n)},methods:{attemptLoad:function(t){var e=this;this.status!==o.COMPLETE&&y(this.$el)&&this.getCurrentDistance()<=this.distance?(this.status=o.LOADING,"top"===this.direction&&this.$nextTick((function(){w.save(e.scrollParent)})),"function"==typeof this.onInfinite?this.onInfinite.call(null,this.stateChanger):this.$emit("infinite",this.stateChanger),!t||this.forceUseInfiniteWrapper||b.isChecked||b.track()):this.status===o.LOADING&&(this.status=o.READY)},getCurrentDistance:function(){return"top"===this.direction?"number"==typeof this.scrollParent.scrollTop?this.scrollParent.scrollTop:this.scrollParent.pageYOffset:this.$el.getBoundingClientRect().top-(this.scrollParent===window?window.innerHeight:this.scrollParent.getBoundingClientRect().bottom)},getScrollParent:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.$el;return"string"==typeof this.forceUseInfiniteWrapper&&(t=e.querySelector(this.forceUseInfiniteWrapper)),t||("BODY"===e.tagName?t=window:!this.forceUseInfiniteWrapper&&["scroll","auto"].indexOf(getComputedStyle(e).overflowY)>-1?t=e:(e.hasAttribute("infinite-wrapper")||e.hasAttribute("data-infinite-wrapper"))&&(t=e)),t||this.getScrollParent(e.parentNode)}},destroyed:function(){!this.status!==o.COMPLETE&&(v.reset(),w.remove(this.scrollParent),this.scrollParent.removeEventListener("scroll",this.scrollHandler,n))}},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"infinite-loading-container"},[s("div",{directives:[{name:"show",rawName:"v-show",value:t.isShowSpinner,expression:"isShowSpinner"}],staticClass:"infinite-status-prompt",style:t.slotStyles.spinner},[t._t("spinner",[s("spinner",{attrs:{spinner:t.spinner}})])],2),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:t.isShowNoResults,expression:"isShowNoResults"}],staticClass:"infinite-status-prompt",style:t.slotStyles.noResults},[t._t("no-results",[t.slots.noResults.render?s(t.slots.noResults,{tag:"component"}):[t._v(t._s(t.slots.noResults))]])],2),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:t.isShowNoMore,expression:"isShowNoMore"}],staticClass:"infinite-status-prompt",style:t.slotStyles.noMore},[t._t("no-more",[t.slots.noMore.render?s(t.slots.noMore,{tag:"component"}):[t._v(t._s(t.slots.noMore))]])],2),t._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:t.isShowError,expression:"isShowError"}],staticClass:"infinite-status-prompt",style:t.slotStyles.error},[t._t("error",[t.slots.error.render?s(t.slots.error,{tag:"component",attrs:{trigger:t.attemptLoad}}):[t._v("\n "+t._s(t.slots.error)+"\n "),s("br"),t._v(" "),s("button",{staticClass:"btn-try-infinite",domProps:{textContent:t._s(t.slots.errorBtnText)},on:{click:t.attemptLoad}})]],{trigger:t.attemptLoad})],2)])}),[],!1,(function(t){var e=s(7);e.__inject__&&e.__inject__(t)}),"46b21138",null);_.options.__file="InfiniteLoading.vue";var x=_.exports;function C(t){u.mode=t.config.productionTip?"development":"production"}Object.defineProperty(x,"install",{configurable:!1,enumerable:!1,value:function(t,e){Object.assign(u.props,e&&e.props),Object.assign(u.slots,e&&e.slots),Object.assign(u.system,e&&e.system),t.component("infinite-loading",x),C(t)}}),"undefined"!=typeof window&&window.Vue&&(window.Vue.component("infinite-loading",x),C(window.Vue)),e.default=x}])},272:function(e,s,i){"use strict";i.r(s);var n=i(4),a=i(262),r=i.n(a),o=i(109),l=i(263),u=i.n(l),d=i(236);function c(t,e,s,i,n,a,r){try{var o=t[a](r),l=o.value}catch(t){return void s(t)}o.done?e(l):Promise.resolve(l).then(i,n)}function p(t){return function(){var e=this,s=arguments;return new Promise((function(i,n){var a=t.apply(e,s);function r(t){c(a,i,n,r,o,"next",t)}function o(t){c(a,i,n,r,o,"throw",t)}r(void 0)}))}}function g(t){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.default.use(d.a);var h,f,m,v,b,w,y,_={name:"UserRow",components:{PopoverMenu:o.PopoverMenu,Multiselect:o.Multiselect},directives:{ClickOutside:u.a},props:{user:{type:Object,required:!0},settings:{type:Object,default:function(){return{}}},groups:{type:Array,default:function(){return[]}},subAdminsGroups:{type:Array,default:function(){return[]}},quotaOptions:{type:Array,default:function(){return[]}},showConfig:{type:Object,default:function(){return{}}},languages:{type:Array,required:!0},externalActions:{type:Array,default:function(){return[]}}},data:function(){return{rand:parseInt(1e3*Math.random()),openedMenu:!1,feedbackMessage:"",loading:{all:!1,displayName:!1,password:!1,mailAddress:!1,groups:!1,subadmins:!1,quota:!1,delete:!1,disable:!1,languages:!1,wipe:!1}}},computed:{userActions:function(){var e=[{icon:"icon-delete",text:t("settings","Delete user"),action:this.deleteUser},{icon:"icon-delete",text:t("settings","Wipe all devices"),action:this.wipeUserDevices},{icon:this.user.enabled?"icon-close":"icon-add",text:this.user.enabled?t("settings","Disable user"):t("settings","Enable user"),action:this.enableDisableUser}];return null!==this.user.email&&""!==this.user.email&&e.push({icon:"icon-mail",text:t("settings","Resend welcome email"),action:this.sendWelcomeMail}),e.concat(this.externalActions)},userGroups:function(){var t=this,e=this.groups.filter((function(e){return t.user.groups.includes(e.id)}));return e},userSubAdminsGroups:function(){var t=this,e=this.subAdminsGroups.filter((function(e){return t.user.subadmin.includes(e.id)}));return e},availableGroups:function(){var t=this;return this.groups.map((function(e){var s=Object.assign({},e);return s.$isDisabled=!1===e.canAdd&&!t.user.groups.includes(e.id)||!1===e.canRemove&&t.user.groups.includes(e.id),s}))},usedSpace:function(){return this.user.quota.used?t("settings","{size} used",{size:OC.Util.humanFileSize(this.user.quota.used)}):t("settings","{size} used",{size:OC.Util.humanFileSize(0)})},usedQuota:function(){var t=this.user.quota.quota;t>0?t=Math.min(100,Math.round(this.user.quota.used/t*100)):t=95*(1-1/(this.user.quota.used/(10*Math.pow(2,30))+1));return isNaN(t)?0:t},userQuota:function(){if(this.user.quota.quota>=0){var t=OC.Util.humanFileSize(this.user.quota.quota),e=this.quotaOptions.find((function(e){return e.id===t}));return e||{id:t,label:t}}return"default"===this.user.quota.quota?this.quotaOptions[0]:this.quotaOptions[1]},minPasswordLength:function(){return this.$store.getters.getPasswordPolicyMinLength},userLanguage:function(){var t=this,e=this.languages[0].languages.concat(this.languages[1].languages).find((function(e){return e.code===t.user.language}));return"object"!==g(e)&&""!==this.user.language?{code:this.user.language,name:this.user.language}:""!==this.user.language&&e}},mounted:function(){},methods:{toggleMenu:function(){this.openedMenu=!this.openedMenu},hideMenu:function(){this.openedMenu=!1},generateAvatar:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;return OC.generateUrl("/avatar/{user}/{size}?v={version}",{user:t,size:e,version:oc_userconfig.avatar.version})},formatGroupsTitle:function(t){return t.map((function(t){return t.name})).slice(2).join(", ")},wipeUserDevices:function(){var t=this;this.loading.wipe=!0,this.loading.all=!0;var e=this.user.id;return this.$store.dispatch("wipeUserDevices",e).then((function(){t.loading.wipe=!1,t.loading.all=!1}))},deleteUser:function(){var t=this;this.loading.delete=!0,this.loading.all=!0;var e=this.user.id;return this.$store.dispatch("deleteUser",e).then((function(){t.loading.delete=!1,t.loading.all=!1}))},enableDisableUser:function(){var t=this;this.loading.delete=!0,this.loading.all=!0;var e=this.user.id,s=!this.user.enabled;return this.$store.dispatch("enableDisableUser",{userid:e,enabled:s}).then((function(){t.loading.delete=!1,t.loading.all=!1}))},updateDisplayName:function(){var t=this,e=this.$refs.displayName.value;this.loading.displayName=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"displayname",value:e}).then((function(){t.loading.displayName=!1,t.$refs.displayName.value=e}))},updatePassword:function(){var t=this,e=this.$refs.password.value;this.loading.password=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"password",value:e}).then((function(){t.loading.password=!1,t.$refs.password.value=""}))},updateEmail:function(){var t=this,e=this.$refs.mailAddress.value;this.loading.mailAddress=!0,this.$store.dispatch("setUserData",{userid:this.user.id,key:"email",value:e}).then((function(){t.loading.mailAddress=!1,t.$refs.mailAddress.value=e}))},createGroup:(y=p(regeneratorRuntime.mark((function t(e){var s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading={groups:!0,subadmins:!0},t.prev=1,t.next=4,this.$store.dispatch("addGroup",e);case 4:return s=this.user.id,t.next=7,this.$store.dispatch("addUserGroup",{userid:s,gid:e});case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),console.error(t.t0);case 12:return t.prev=12,this.loading={groups:!1,subadmins:!1},t.finish(12);case 15:return t.abrupt("return",this.$store.getters.getGroups[this.groups.length]);case 16:case"end":return t.stop()}}),t,this,[[1,9,12,15]])}))),function(t){return y.apply(this,arguments)}),addUserGroup:(w=p(regeneratorRuntime.mark((function t(e){var s,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==e.canAdd){t.next=2;break}return t.abrupt("return",!1);case 2:return this.loading.groups=!0,s=this.user.id,i=e.id,t.prev=5,t.next=8,this.$store.dispatch("addUserGroup",{userid:s,gid:i});case 8:t.next=13;break;case 10:t.prev=10,t.t0=t.catch(5),console.error(t.t0);case 13:return t.prev=13,this.loading.groups=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,this,[[5,10,13,16]])}))),function(t){return w.apply(this,arguments)}),removeUserGroup:(b=p(regeneratorRuntime.mark((function t(e){var s,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==e.canRemove){t.next=2;break}return t.abrupt("return",!1);case 2:return this.loading.groups=!0,s=this.user.id,i=e.id,t.prev=5,t.next=8,this.$store.dispatch("removeUserGroup",{userid:s,gid:i});case 8:this.loading.groups=!1,this.$route.params.selectedGroup===i&&this.$store.commit("deleteUser",s),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(5),this.loading.groups=!1;case 15:case"end":return t.stop()}}),t,this,[[5,12]])}))),function(t){return b.apply(this,arguments)}),addUserSubAdmin:(v=p(regeneratorRuntime.mark((function t(e){var s,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading.subadmins=!0,s=this.user.id,i=e.id,t.prev=3,t.next=6,this.$store.dispatch("addUserSubAdmin",{userid:s,gid:i});case 6:this.loading.subadmins=!1,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),console.error(t.t0);case 12:case"end":return t.stop()}}),t,this,[[3,9]])}))),function(t){return v.apply(this,arguments)}),removeUserSubAdmin:(m=p(regeneratorRuntime.mark((function t(e){var s,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading.subadmins=!0,s=this.user.id,i=e.id,t.prev=3,t.next=6,this.$store.dispatch("removeUserSubAdmin",{userid:s,gid:i});case 6:t.next=11;break;case 8:t.prev=8,t.t0=t.catch(3),console.error(t.t0);case 11:return t.prev=11,this.loading.subadmins=!1,t.finish(11);case 14:case"end":return t.stop()}}),t,this,[[3,8,11,14]])}))),function(t){return m.apply(this,arguments)}),setUserQuota:(f=p(regeneratorRuntime.mark((function t(){var e,s=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=s.length>0&&void 0!==s[0]?s[0]:"none",this.loading.quota=!0,e=e.id?e.id:e,t.prev=3,t.next=6,this.$store.dispatch("setUserData",{userid:this.user.id,key:"quota",value:e});case 6:t.next=11;break;case 8:t.prev=8,t.t0=t.catch(3),console.error(t.t0);case 11:return t.prev=11,this.loading.quota=!1,t.finish(11);case 14:return t.abrupt("return",e);case 15:case"end":return t.stop()}}),t,this,[[3,8,11,14]])}))),function(){return f.apply(this,arguments)}),validateQuota:function(t){var e=OC.Util.computerFileSize(t);return null!==e&&e>=0&&this.setUserQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(t)))},setUserLanguage:(h=p(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading.languages=!0,t.prev=1,t.next=4,this.$store.dispatch("setUserData",{userid:this.user.id,key:"language",value:e.code});case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),console.error(t.t0);case 9:return t.prev=9,this.loading.languages=!1,t.finish(9);case 12:return t.abrupt("return",e);case 13:case"end":return t.stop()}}),t,this,[[1,6,9,12]])}))),function(t){return h.apply(this,arguments)}),sendWelcomeMail:function(){var e=this;this.loading.all=!0,this.$store.dispatch("sendWelcomeMail",this.user.id).then((function(s){s&&(e.feedbackMessage=t("setting","Welcome mail sent!"),setTimeout((function(){e.feedbackMessage=""}),2e3)),e.loading.all=!1}))}}},x=i(23),C=Object(x.a)(_,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return 1===Object.keys(t.user).length?s("div",{staticClass:"row",attrs:{"data-id":t.user.id}},[s("div",{staticClass:"avatar",class:{"icon-loading-small":t.loading.delete||t.loading.disable||t.loading.wipe}},[t.loading.delete||t.loading.disable||t.loading.wipe?t._e():s("img",{attrs:{alt:"",width:"32",height:"32",src:t.generateAvatar(t.user.id,32),srcset:t.generateAvatar(t.user.id,64)+" 2x, "+t.generateAvatar(t.user.id,128)+" 4x"}})]),t._v(" "),s("div",{staticClass:"name"},[t._v("\n\t\t"+t._s(t.user.id)+"\n\t")]),t._v(" "),s("div",{staticClass:"obfuscated"},[t._v("\n\t\t"+t._s(t.t("settings","You do not have permissions to see the details of this user"))+"\n\t")])]):s("div",{staticClass:"row",class:{disabled:t.loading.delete||t.loading.disable},attrs:{"data-id":t.user.id}},[s("div",{staticClass:"avatar",class:{"icon-loading-small":t.loading.delete||t.loading.disable||t.loading.wipe}},[t.loading.delete||t.loading.disable||t.loading.wipe?t._e():s("img",{attrs:{alt:"",width:"32",height:"32",src:t.generateAvatar(t.user.id,32),srcset:t.generateAvatar(t.user.id,64)+" 2x, "+t.generateAvatar(t.user.id,128)+" 4x"}})]),t._v(" "),s("div",{staticClass:"name"},[t._v("\n\t\t"+t._s(t.user.id)+"\n\t")]),t._v(" "),s("form",{staticClass:"displayName",class:{"icon-loading-small":t.loading.displayName},on:{submit:function(e){return e.preventDefault(),t.updateDisplayName(e)}}},[t.user.backendCapabilities.setDisplayName?[t.user.backendCapabilities.setDisplayName?s("input",{ref:"displayName",attrs:{id:"displayName"+t.user.id+t.rand,type:"text",disabled:t.loading.displayName||t.loading.all,autocomplete:"new-password",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},domProps:{value:t.user.displayname}}):t._e(),t._v(" "),t.user.backendCapabilities.setDisplayName?s("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}}):t._e()]:s("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.t("settings","The backend does not support changing the display name"),expression:"t('settings', 'The backend does not support changing the display name')",modifiers:{auto:!0}}],staticClass:"name"},[t._v("\n\t\t\t"+t._s(t.user.displayname)+"\n\t\t")])],2),t._v(" "),t.settings.canChangePassword&&t.user.backendCapabilities.setPassword?s("form",{staticClass:"password",class:{"icon-loading-small":t.loading.password},on:{submit:function(e){return e.preventDefault(),t.updatePassword(e)}}},[s("input",{ref:"password",attrs:{id:"password"+t.user.id+t.rand,type:"password",required:"",disabled:t.loading.password||t.loading.all,minlength:t.minPasswordLength,value:"",placeholder:t.t("settings","New password"),autocomplete:"new-password",autocorrect:"off",autocapitalize:"off",spellcheck:"false"}}),t._v(" "),s("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]):s("div"),t._v(" "),s("form",{staticClass:"mailAddress",class:{"icon-loading-small":t.loading.mailAddress},on:{submit:function(e){return e.preventDefault(),t.updateEmail(e)}}},[s("input",{ref:"mailAddress",attrs:{id:"mailAddress"+t.user.id+t.rand,type:"email",disabled:t.loading.mailAddress||t.loading.all,autocomplete:"new-password",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},domProps:{value:t.user.email}}),t._v(" "),s("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]),t._v(" "),s("div",{staticClass:"groups",class:{"icon-loading-small":t.loading.groups}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userGroups,options:t.availableGroups,disabled:t.loading.groups||t.loading.all,"tag-placeholder":"create",placeholder:t.t("settings","Add user in group"),label:"name","track-by":"id",limit:2,multiple:!0,taggable:t.settings.isAdmin,"close-on-select":!1,"tag-width":60},on:{tag:t.createGroup,select:t.addUserGroup,remove:t.removeUserGroup}},[s("span",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.formatGroupsTitle(t.userGroups),expression:"formatGroupsTitle(userGroups)",modifiers:{auto:!0}}],staticClass:"multiselect__limit",attrs:{slot:"limit"},slot:"limit"},[t._v("+"+t._s(t.userGroups.length-2))]),t._v(" "),s("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?s("div",{staticClass:"subadmins",class:{"icon-loading-small":t.loading.subadmins}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userSubAdminsGroups,options:t.subAdminsGroups,disabled:t.loading.subadmins||t.loading.all,placeholder:t.t("settings","Set user as admin for"),label:"name","track-by":"id",limit:2,multiple:!0,"close-on-select":!1,"tag-width":60},on:{select:t.addUserSubAdmin,remove:t.removeUserSubAdmin}},[s("span",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.formatGroupsTitle(t.userSubAdminsGroups),expression:"formatGroupsTitle(userSubAdminsGroups)",modifiers:{auto:!0}}],staticClass:"multiselect__limit",attrs:{slot:"limit"},slot:"limit"},[t._v("+"+t._s(t.userSubAdminsGroups.length-2))]),t._v(" "),s("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1):t._e(),t._v(" "),s("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.usedSpace,expression:"usedSpace",modifiers:{auto:!0}}],staticClass:"quota",class:{"icon-loading-small":t.loading.quota}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userQuota,options:t.quotaOptions,disabled:t.loading.quota||t.loading.all,"tag-placeholder":"create",placeholder:t.t("settings","Select user quota"),label:"label","track-by":"id","allow-empty":!1,taggable:!0},on:{tag:t.validateQuota,input:t.setUserQuota}}),t._v(" "),s("progress",{staticClass:"quota-user-progress",class:{warn:t.usedQuota>80},attrs:{max:"100"},domProps:{value:t.usedQuota}})],1),t._v(" "),t.showConfig.showLanguages?s("div",{staticClass:"languages",class:{"icon-loading-small":t.loading.languages}},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{value:t.userLanguage,options:t.languages,disabled:t.loading.languages||t.loading.all,placeholder:t.t("settings","No language set"),label:"name","track-by":"code","allow-empty":!1,"group-values":"languages","group-label":"label"},on:{input:t.setUserLanguage}})],1):t._e(),t._v(" "),t.showConfig.showStoragePath?s("div",{staticClass:"storageLocation"},[t._v("\n\t\t"+t._s(t.user.storageLocation)+"\n\t")]):t._e(),t._v(" "),t.showConfig.showUserBackend?s("div",{staticClass:"userBackend"},[t._v("\n\t\t"+t._s(t.user.backend)+"\n\t")]):t._e(),t._v(" "),t.showConfig.showLastLogin?s("div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:t.user.lastLogin>0?t.OC.Util.formatDate(t.user.lastLogin):"",expression:"user.lastLogin>0 ? OC.Util.formatDate(user.lastLogin) : ''",modifiers:{auto:!0}}],staticClass:"lastLogin"},[t._v("\n\t\t"+t._s(t.user.lastLogin>0?t.OC.Util.relativeModifiedDate(t.user.lastLogin):t.t("settings","Never"))+"\n\t")]):t._e(),t._v(" "),s("div",{staticClass:"userActions"},[t.OC.currentUser===t.user.id||"admin"===t.user.id||t.loading.all?t._e():s("div",{staticClass:"toggleUserActions"},[s("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:t.hideMenu,expression:"hideMenu"}],staticClass:"icon-more",on:{click:t.toggleMenu}}),t._v(" "),s("div",{staticClass:"popovermenu",class:{open:t.openedMenu}},[s("PopoverMenu",{attrs:{menu:t.userActions}})],1)]),t._v(" "),s("div",{staticClass:"feedback",style:{opacity:""!==t.feedbackMessage?1:0}},[s("div",{staticClass:"icon-checkmark"}),t._v("\n\t\t\t"+t._s(t.feedbackMessage)+"\n\t\t")])])])}),[],!1,null,null,null).exports,k=i(264),U=i.n(k),A={id:"none",label:t("settings","Unlimited")},S={id:"default",label:t("settings","Default quota")},L={id:"",displayName:"",password:"",mailAddress:"",groups:[],subAdminsGroups:[],quota:S,language:{code:"en",name:t("settings","Default language")}},N={name:"UserList",components:{userRow:C,Multiselect:o.Multiselect,InfiniteLoading:U.a},props:{users:{type:Array,default:function(){return[]}},showConfig:{type:Object,required:!0},selectedGroup:{type:String,default:null},externalActions:{type:Array,default:function(){return[]}}},data:function(){return{unlimitedQuota:A,defaultQuota:S,loading:{all:!1,groups:!1},scrolled:!1,searchQuery:"",newUser:Object.assign({},L)}},computed:{settings:function(){return this.$store.getters.getServerData},filteredUsers:function(){return"disabled"===this.selectedGroup?this.users.filter((function(t){return!1===t.enabled})):this.settings.isAdmin?this.users.filter((function(t){return!1!==t.enabled})):this.users.filter((function(t){return!1!==t.enabled&&t.id!==OC.getCurrentUser().uid}))},groups:function(){return this.$store.getters.getGroups.filter((function(t){return"disabled"!==t.id})).sort((function(t,e){return t.name.localeCompare(e.name)}))},canAddGroups:function(){return this.groups.map((function(t){return(t=Object.assign({},t)).$isDisabled=!1===t.canAdd,t}))},subAdminsGroups:function(){return this.$store.getters.getSubadminGroups},quotaOptions:function(){var t=this.settings.quotaPreset.reduce((function(t,e){return t.concat({id:e,label:e})}),[]);return t.unshift(this.unlimitedQuota),t.unshift(this.defaultQuota),t},minPasswordLength:function(){return this.$store.getters.getPasswordPolicyMinLength},usersOffset:function(){return this.$store.getters.getUsersOffset},usersLimit:function(){return this.$store.getters.getUsersLimit},usersCount:function(){return this.users.length},languages:function(){return[{label:t("settings","Common languages"),languages:this.settings.languages.commonlanguages},{label:t("settings","All languages"),languages:this.settings.languages.languages}]}},watch:{selectedGroup:function(t,e){this.redirectIfDisabled(),this.$store.commit("resetUsers"),this.$refs.infiniteLoading.stateChanger.reset(),this.setNewUserDefaultGroup(t)},usersCount:function(t,e){0===t&&1===e?this.$refs.infiniteLoading.stateChanger.reset():1===t&&0===e&&this.$refs.infiniteLoading.stateChanger.loaded()}},mounted:function(){this.settings.canChangePassword||OC.Notification.showTemporary(t("settings","Password change is disabled because the master key is disabled")),this.resetForm(),this.userSearch=new OCA.Search(this.search,this.resetSearch),this.redirectIfDisabled()},methods:{onScroll:function(t){this.scrolled=t.target.scrollTo>0},validateQuota:function(t){var e=OC.Util.computerFileSize(t);return null!==e&&e>=0?(t=OC.Util.humanFileSize(OC.Util.computerFileSize(t)),this.newUser.quota={id:t,label:t},this.newUser.quota):(this.newUser.quota=this.quotaOptions[0],this.quotaOptions[0])},infiniteHandler:function(t){this.$store.dispatch("getUsers",{offset:this.usersOffset,limit:this.usersLimit,group:"disabled"!==this.selectedGroup?this.selectedGroup:"",search:this.searchQuery}).then((function(e){e?t.loaded():t.complete()}))},search:function(t){this.searchQuery=t,this.$store.commit("resetUsers"),this.$refs.infiniteLoading.stateChanger.reset()},resetSearch:function(){this.search("")},resetForm:function(){this.newUser=Object.assign({},L),this.settings.defaultLanguage&&n.default.set(this.newUser.language,"code",this.settings.defaultLanguage),this.setNewUserDefaultGroup(this.selectedGroup),this.loading.all=!1},createUser:function(){var t=this;this.loading.all=!0,this.$store.dispatch("addUser",{userid:this.newUser.id,password:this.newUser.password,displayName:this.newUser.displayName,email:this.newUser.mailAddress,groups:this.newUser.groups.map((function(t){return t.id})),subadmin:this.newUser.subAdminsGroups.map((function(t){return t.id})),quota:this.newUser.quota.id,language:this.newUser.language.code}).then((function(){t.resetForm(),t.$refs.newusername.focus()})).catch((function(e){if(t.loading.all=!1,e.response&&e.response.data&&e.response.data.ocs&&e.response.data.ocs.meta){var s=e.response.data.ocs.meta.statuscode;102===s?t.$refs.newusername.focus():107===s&&t.$refs.newuserpassword.focus()}}))},setNewUserDefaultGroup:function(t){if(t&&t.length>0){var e=this.groups.find((function(e){return e.id===t}));if(e)return void(this.newUser.groups=[e])}this.newUser.groups=[]},createGroup:function(t){var e=this;return this.loading.groups=!0,this.$store.dispatch("addGroup",t).then((function(s){e.newUser.groups.push(e.groups.find((function(e){return e.id===t}))),e.loading.groups=!1})).catch((function(){e.loading.groups=!1})),this.$store.getters.getGroups[this.groups.length]},redirectIfDisabled:function(){var t=this.$store.getters.getGroups;"disabled"===this.selectedGroup&&t.findIndex((function(t){return"disabled"===t.id&&0===t.usercount}))>-1&&(this.$router.push({name:"users"}),this.$refs.infiniteLoading.stateChanger.reset())}}},$=Object(x.a)(N,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"user-list-grid",attrs:{id:"app-content"},on:{"&scroll":function(e){return t.onScroll(e)}}},[s("div",{staticClass:"row",class:{sticky:t.scrolled&&!t.showConfig.showNewUserForm},attrs:{id:"grid-header"}},[s("div",{staticClass:"avatar",attrs:{id:"headerAvatar"}}),t._v(" "),s("div",{staticClass:"name",attrs:{id:"headerName"}},[t._v("\n\t\t\t"+t._s(t.t("settings","Username"))+"\n\t\t")]),t._v(" "),s("div",{staticClass:"displayName",attrs:{id:"headerDisplayName"}},[t._v("\n\t\t\t"+t._s(t.t("settings","Display name"))+"\n\t\t")]),t._v(" "),s("div",{staticClass:"password",attrs:{id:"headerPassword"}},[t._v("\n\t\t\t"+t._s(t.t("settings","Password"))+"\n\t\t")]),t._v(" "),s("div",{staticClass:"mailAddress",attrs:{id:"headerAddress"}},[t._v("\n\t\t\t"+t._s(t.t("settings","Email"))+"\n\t\t")]),t._v(" "),s("div",{staticClass:"groups",attrs:{id:"headerGroups"}},[t._v("\n\t\t\t"+t._s(t.t("settings","Groups"))+"\n\t\t")]),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?s("div",{staticClass:"subadmins",attrs:{id:"headerSubAdmins"}},[t._v("\n\t\t\t"+t._s(t.t("settings","Group admin for"))+"\n\t\t")]):t._e(),t._v(" "),s("div",{staticClass:"quota",attrs:{id:"headerQuota"}},[t._v("\n\t\t\t"+t._s(t.t("settings","Quota"))+"\n\t\t")]),t._v(" "),t.showConfig.showLanguages?s("div",{staticClass:"languages",attrs:{id:"headerLanguages"}},[t._v("\n\t\t\t"+t._s(t.t("settings","Language"))+"\n\t\t")]):t._e(),t._v(" "),t.showConfig.showStoragePath?s("div",{staticClass:"headerStorageLocation storageLocation"},[t._v("\n\t\t\t"+t._s(t.t("settings","Storage location"))+"\n\t\t")]):t._e(),t._v(" "),t.showConfig.showUserBackend?s("div",{staticClass:"headerUserBackend userBackend"},[t._v("\n\t\t\t"+t._s(t.t("settings","User backend"))+"\n\t\t")]):t._e(),t._v(" "),t.showConfig.showLastLogin?s("div",{staticClass:"headerLastLogin lastLogin"},[t._v("\n\t\t\t"+t._s(t.t("settings","Last login"))+"\n\t\t")]):t._e(),t._v(" "),s("div",{staticClass:"userActions"})]),t._v(" "),s("form",{directives:[{name:"show",rawName:"v-show",value:t.showConfig.showNewUserForm,expression:"showConfig.showNewUserForm"}],staticClass:"row",class:{sticky:t.scrolled&&t.showConfig.showNewUserForm},attrs:{id:"new-user",disabled:t.loading.all},on:{submit:function(e){return e.preventDefault(),t.createUser(e)}}},[s("div",{class:t.loading.all?"icon-loading-small":"icon-add"}),t._v(" "),s("div",{staticClass:"name"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.id,expression:"newUser.id"}],ref:"newusername",attrs:{id:"newusername",type:"text",required:"",placeholder:t.settings.newUserGenerateUserID?t.t("settings","Will be autogenerated"):t.t("settings","Username"),name:"username",autocomplete:"off",autocapitalize:"none",autocorrect:"off",pattern:"[a-zA-Z0-9 _\\.@\\-']+",disabled:t.settings.newUserGenerateUserID},domProps:{value:t.newUser.id},on:{input:function(e){e.target.composing||t.$set(t.newUser,"id",e.target.value)}}})]),t._v(" "),s("div",{staticClass:"displayName"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.displayName,expression:"newUser.displayName"}],attrs:{id:"newdisplayname",type:"text",placeholder:t.t("settings","Display name"),name:"displayname",autocomplete:"off",autocapitalize:"none",autocorrect:"off"},domProps:{value:t.newUser.displayName},on:{input:function(e){e.target.composing||t.$set(t.newUser,"displayName",e.target.value)}}})]),t._v(" "),s("div",{staticClass:"password"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.password,expression:"newUser.password"}],ref:"newuserpassword",attrs:{id:"newuserpassword",type:"password",required:""===t.newUser.mailAddress,placeholder:t.t("settings","Password"),name:"password",autocomplete:"new-password",autocapitalize:"none",autocorrect:"off",minlength:t.minPasswordLength},domProps:{value:t.newUser.password},on:{input:function(e){e.target.composing||t.$set(t.newUser,"password",e.target.value)}}})]),t._v(" "),s("div",{staticClass:"mailAddress"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.newUser.mailAddress,expression:"newUser.mailAddress"}],attrs:{id:"newemail",type:"email",required:""===t.newUser.password||t.settings.newUserRequireEmail,placeholder:t.t("settings","Email"),name:"email",autocomplete:"off",autocapitalize:"none",autocorrect:"off"},domProps:{value:t.newUser.mailAddress},on:{input:function(e){e.target.composing||t.$set(t.newUser,"mailAddress",e.target.value)}}})]),t._v(" "),s("div",{staticClass:"groups"},[t.settings.isAdmin?t._e():s("input",{class:{"icon-loading-small":t.loading.groups},attrs:{id:"newgroups",type:"text",tabindex:"-1",required:!t.settings.isAdmin},domProps:{value:t.newUser.groups}}),t._v(" "),s("Multiselect",{staticClass:"multiselect-vue",attrs:{options:t.canAddGroups,disabled:t.loading.groups||t.loading.all,"tag-placeholder":"create",placeholder:t.t("settings","Add user in group"),label:"name","track-by":"id",multiple:!0,taggable:!0,"close-on-select":!1,"tag-width":60},on:{tag:t.createGroup},model:{value:t.newUser.groups,callback:function(e){t.$set(t.newUser,"groups",e)},expression:"newUser.groups"}},[s("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1),t._v(" "),t.subAdminsGroups.length>0&&t.settings.isAdmin?s("div",{staticClass:"subadmins"},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{options:t.subAdminsGroups,placeholder:t.t("settings","Set user as admin for"),label:"name","track-by":"id",multiple:!0,"close-on-select":!1,"tag-width":60},model:{value:t.newUser.subAdminsGroups,callback:function(e){t.$set(t.newUser,"subAdminsGroups",e)},expression:"newUser.subAdminsGroups"}},[s("span",{attrs:{slot:"noResult"},slot:"noResult"},[t._v(t._s(t.t("settings","No results")))])])],1):t._e(),t._v(" "),s("div",{staticClass:"quota"},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{options:t.quotaOptions,placeholder:t.t("settings","Select user quota"),label:"label","track-by":"id","allow-empty":!1,taggable:!0},on:{tag:t.validateQuota},model:{value:t.newUser.quota,callback:function(e){t.$set(t.newUser,"quota",e)},expression:"newUser.quota"}})],1),t._v(" "),t.showConfig.showLanguages?s("div",{staticClass:"languages"},[s("Multiselect",{staticClass:"multiselect-vue",attrs:{options:t.languages,placeholder:t.t("settings","Default language"),label:"name","track-by":"code","allow-empty":!1,"group-values":"languages","group-label":"label"},model:{value:t.newUser.language,callback:function(e){t.$set(t.newUser,"language",e)},expression:"newUser.language"}})],1):t._e(),t._v(" "),t.showConfig.showStoragePath?s("div",{staticClass:"storageLocation"}):t._e(),t._v(" "),t.showConfig.showUserBackend?s("div",{staticClass:"userBackend"}):t._e(),t._v(" "),t.showConfig.showLastLogin?s("div",{staticClass:"lastLogin"}):t._e(),t._v(" "),s("div",{staticClass:"userActions"},[s("input",{staticClass:"button primary icon-checkmark-white has-tooltip",attrs:{id:"newsubmit",type:"submit",value:"",title:t.t("settings","Add a new user")}})])]),t._v(" "),t._l(t.filteredUsers,(function(e,i){return s("user-row",{key:i,attrs:{user:e,settings:t.settings,"show-config":t.showConfig,groups:t.groups,"sub-admins-groups":t.subAdminsGroups,"quota-options":t.quotaOptions,languages:t.languages,"external-actions":t.externalActions}})})),t._v(" "),s("InfiniteLoading",{ref:"infiniteLoading",on:{infinite:t.infiniteHandler}},[s("div",{attrs:{slot:"spinner"},slot:"spinner"},[s("div",{staticClass:"users-icon-loading icon-loading"})]),t._v(" "),s("div",{attrs:{slot:"no-more"},slot:"no-more"},[s("div",{staticClass:"users-list-end"})]),t._v(" "),s("div",{attrs:{slot:"no-results"},slot:"no-results"},[s("div",{attrs:{id:"emptycontent"}},[s("div",{staticClass:"icon-contacts-dark"}),t._v(" "),s("h2",[t._v(t._s(t.t("settings","No users in here")))])])])])],2)}),[],!1,null,null,null).exports;function O(t){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}n.default.use(r.a);var G={name:"Users",components:{AppContent:o.AppContent,AppNavigation:o.AppNavigation,AppNavigationItem:o.AppNavigationItem,AppNavigationNew:o.AppNavigationNew,AppNavigationSettings:o.AppNavigationSettings,Content:o.Content,UserList:$,Multiselect:o.Multiselect},props:{selectedGroup:{type:String,default:null}},data:function(){return{unlimitedQuota:{id:"none",label:t("settings","Unlimited")},selectedQuota:!1,externalActions:[],showAddGroupEntry:!1,loadingAddGroup:!1,showConfig:{showStoragePath:!1,showUserBackend:!1,showLastLogin:!1,showNewUserForm:!1,showLanguages:!1}}},computed:{users:function(){return this.$store.getters.getUsers},usersOffset:function(){return this.$store.getters.getUsersOffset},usersLimit:function(){return this.$store.getters.getUsersLimit},showLanguages:{get:function(){return this.getLocalstorage("showLanguages")},set:function(t){this.setLocalStorage("showLanguages",t)}},showLastLogin:{get:function(){return this.getLocalstorage("showLastLogin")},set:function(t){this.setLocalStorage("showLastLogin",t)}},showUserBackend:{get:function(){return this.getLocalstorage("showUserBackend")},set:function(t){this.setLocalStorage("showUserBackend",t)}},showStoragePath:{get:function(){return this.getLocalstorage("showStoragePath")},set:function(t){this.setLocalStorage("showStoragePath",t)}},userCount:function(){return this.$store.getters.getUserCount},settings:function(){return this.$store.getters.getServerData},quotaOptions:function(){var t=this.settings.quotaPreset.reduce((function(t,e){return t.concat({id:e,label:e})}),[]);return t.unshift(this.unlimitedQuota),t},defaultQuota:{get:function(){return!1!==this.selectedQuota?this.selectedQuota:this.settings.defaultQuota!==this.unlimitedQuota.id&&OC.Util.computerFileSize(this.settings.defaultQuota)>=0?{id:this.settings.defaultQuota,label:this.settings.defaultQuota}:this.unlimitedQuota},set:function(t){this.selectedQuota=t}},menu:function(){var e=this,s=this,i=this.$store.getters.getGroups,a=(i=(i=Array.isArray(i)?i:[]).map((function(i){var n={};return n.id=i.id.replace(" ","_"),n.key=n.id,n.utils={},n.router={name:"group",params:{selectedGroup:i.id}},n.text=i.name,n.title=i.name,(i.usercount-i.disabled>0||-1===i.usercount)&&(n.utils.counter=i.usercount-i.disabled),"admin"!==n.id&&"disabled"!==n.id&&e.settings.isAdmin&&(n.utils.actions=[{icon:"icon-delete",text:t("settings","Remove group"),action:function(){s.removeGroup(i.id)}}]),n}))).find((function(t){return"disabled"!==t.id&&"admin"!==t.id}));if(a=void 0===a?[]:a,(a=Array.isArray(a)?a:[a]).length>0){var r={caption:!0,text:t("settings","Groups")};i.unshift(r)}var o=i.find((function(t){return"admin"===t.id})),l=i.find((function(t){return"disabled"===t.id}));i=i.filter((function(t){return-1===["admin","disabled"].indexOf(t.id)})),o&&o.text&&(o.text=t("settings","Admins"),o.icon="icon-user-admin",i.unshift(o)),l&&l.text&&(l.text=t("settings","Disabled users"),l.icon="icon-disabled-users",l.utils&&(l.utils.counter>0||-1===l.utils.counter)&&i.unshift(l));var u={id:"everyone",key:"everyone",icon:"icon-contacts-dark",router:{name:"users"},text:t("settings","Everyone")};this.userCount>0&&n.default.set(u,"utils",{counter:this.userCount}),i.unshift(u);var d={id:"addgroup",key:"addgroup",icon:"icon-add",text:t("settings","Add group"),classes:this.loadingAddGroup?"icon-loading-small":""};return this.showAddGroupEntry?(n.default.set(d,"edit",{text:t("settings","Add group"),action:this.createGroup,reset:function(){s.showAddGroupEntry=!1}}),d.classes="editing"):n.default.set(d,"action",(function(){s.showAddGroupEntry=!0,n.default.nextTick((function(){window.addgroup.querySelector('form > input[type="text"]').focus()}))})),i.unshift(d),i}},beforeMount:function(){this.$store.commit("initGroups",{groups:this.$store.getters.getServerData.groups,orderBy:this.$store.getters.getServerData.sortGroups,userCount:this.$store.getters.getServerData.userCount}),this.$store.dispatch("getPasswordPolicyMinLength")},created:function(){Object.assign(OCA,{Settings:{UserList:{registerAction:this.registerAction}}})},methods:{toggleNewUserMenu:function(){this.showConfig.showNewUserForm=!this.showConfig.showNewUserForm,this.showConfig.showNewUserForm&&n.default.nextTick((function(){window.newusername.focus()}))},getLocalstorage:function(t){var e=this.$localStorage.get(t);return this.showConfig[t]=null!==e?"true"===e:this.showConfig[t],this.showConfig[t]},setLocalStorage:function(t,e){return this.showConfig[t]=e,this.$localStorage.set(t,e),e},removeGroup:function(e){var s=this;OC.dialogs.confirm(t("settings","You are about to remove the group {group}. The users will NOT be deleted.",{group:e}),t("settings","Please confirm the group removal "),(function(t){t&&s.$store.dispatch("removeGroup",e)}))},setDefaultQuota:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";this.$store.dispatch("setAppConfig",{app:"files",key:"default_quota",value:e.id?e.id:e}).then((function(){"object"!==O(e)&&(e={id:e,label:e}),t.defaultQuota=e}))},validateQuota:function(t){return null===OC.Util.computerFileSize(t)?this.setDefaultQuota("none"):this.setDefaultQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(t)))},registerAction:function(t,e,s){return this.externalActions.push({icon:t,text:e,action:s}),this.externalActions},createGroup:function(t){var e=this,s=t.target[0].value;this.loadingAddGroup=!0,this.$store.dispatch("addGroup",s).then((function(){e.showAddGroupEntry=!1,e.loadingAddGroup=!1,e.$router.push({name:"group",params:{selectedGroup:s}})})).catch((function(){e.loadingAddGroup=!1}))}}},P=Object(x.a)(G,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("Content",{attrs:{"app-name":"settings","navigation-class":{"icon-loading":t.loadingAddGroup}}},[s("AppNavigation",[s("AppNavigationNew",{attrs:{"button-id":"new-user-button",text:t.t("settings","New user"),"button-class":"icon-add"},on:{click:t.toggleNewUserMenu}}),t._v(" "),s("ul",{attrs:{id:"usergrouplist"}},t._l(t.menu,(function(t){return s("AppNavigationItem",{key:t.key,attrs:{item:t}})})),1),t._v(" "),s("AppNavigationSettings",[s("div",[s("p",[t._v(t._s(t.t("settings","Default quota:")))]),t._v(" "),s("Multiselect",{attrs:{value:t.defaultQuota,options:t.quotaOptions,"tag-placeholder":"create",placeholder:t.t("settings","Select default quota"),label:"label","track-by":"id","allow-empty":!1,taggable:!0},on:{tag:t.validateQuota,input:t.setDefaultQuota}})],1),t._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.showLanguages,expression:"showLanguages"}],staticClass:"checkbox",attrs:{id:"showLanguages",type:"checkbox"},domProps:{checked:Array.isArray(t.showLanguages)?t._i(t.showLanguages,null)>-1:t.showLanguages},on:{change:function(e){var s=t.showLanguages,i=e.target,n=!!i.checked;if(Array.isArray(s)){var a=t._i(s,null);i.checked?a<0&&(t.showLanguages=s.concat([null])):a>-1&&(t.showLanguages=s.slice(0,a).concat(s.slice(a+1)))}else t.showLanguages=n}}}),t._v(" "),s("label",{attrs:{for:"showLanguages"}},[t._v(t._s(t.t("settings","Show Languages")))])]),t._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.showLastLogin,expression:"showLastLogin"}],staticClass:"checkbox",attrs:{id:"showLastLogin",type:"checkbox"},domProps:{checked:Array.isArray(t.showLastLogin)?t._i(t.showLastLogin,null)>-1:t.showLastLogin},on:{change:function(e){var s=t.showLastLogin,i=e.target,n=!!i.checked;if(Array.isArray(s)){var a=t._i(s,null);i.checked?a<0&&(t.showLastLogin=s.concat([null])):a>-1&&(t.showLastLogin=s.slice(0,a).concat(s.slice(a+1)))}else t.showLastLogin=n}}}),t._v(" "),s("label",{attrs:{for:"showLastLogin"}},[t._v(t._s(t.t("settings","Show last login")))])]),t._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.showUserBackend,expression:"showUserBackend"}],staticClass:"checkbox",attrs:{id:"showUserBackend",type:"checkbox"},domProps:{checked:Array.isArray(t.showUserBackend)?t._i(t.showUserBackend,null)>-1:t.showUserBackend},on:{change:function(e){var s=t.showUserBackend,i=e.target,n=!!i.checked;if(Array.isArray(s)){var a=t._i(s,null);i.checked?a<0&&(t.showUserBackend=s.concat([null])):a>-1&&(t.showUserBackend=s.slice(0,a).concat(s.slice(a+1)))}else t.showUserBackend=n}}}),t._v(" "),s("label",{attrs:{for:"showUserBackend"}},[t._v(t._s(t.t("settings","Show user backend")))])]),t._v(" "),s("div",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.showStoragePath,expression:"showStoragePath"}],staticClass:"checkbox",attrs:{id:"showStoragePath",type:"checkbox"},domProps:{checked:Array.isArray(t.showStoragePath)?t._i(t.showStoragePath,null)>-1:t.showStoragePath},on:{change:function(e){var s=t.showStoragePath,i=e.target,n=!!i.checked;if(Array.isArray(s)){var a=t._i(s,null);i.checked?a<0&&(t.showStoragePath=s.concat([null])):a>-1&&(t.showStoragePath=s.slice(0,a).concat(s.slice(a+1)))}else t.showStoragePath=n}}}),t._v(" "),s("label",{attrs:{for:"showStoragePath"}},[t._v(t._s(t.t("settings","Show storage path")))])])])],1),t._v(" "),s("AppContent",[s("UserList",{attrs:{users:t.users,"show-config":t.showConfig,"selected-group":t.selectedGroup,"external-actions":t.externalActions},scopedSlots:t._u([{key:"content",fn:function(){},proxy:!0}])})],1)],1)}),[],!1,null,null,null);s.default=P.exports}}]); //# sourceMappingURL=vue-6.js.map?v=68fb1718121aa66ad907