nextcloud/apps/settings/js/vue-settings-apps-users-man...

227 lines
281 KiB
JavaScript
Raw Normal View History

!function(t){function e(e){for(var n,o,i=e[0],a=e[1],s=0,u=[];s<i.length;s++)o=i[s],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&u.push(r[o][0]),r[o]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n]);for(c&&c(e);u.length;)u.shift()()}var n={},r={3:0};function o(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(t){var e=[],n=r[t];if(0!==n)if(n)e.push(n[2]);else{var i=new Promise((function(e,o){n=r[t]=[e,o]}));e.push(n[2]=i);var a,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(t){return o.p+"vue-"+({0:"vendors-settings-apps-settings-users",2:"settings-apps",7:"settings-users",8:"vendors-settings-apps",9:"vendors-settings-users"}[t]||t)+"-"+{0:"2c6e2ec8740f347384ba",2:"d2e0f1043bb072b36afa",7:"ea065c5499fe6978d296",8:"046aaa34ead5fcde92b4",9:"d6d65ae7744221a9a6d3"}[t]+".js?v="+{0:"820511c34ed0e9cddc34",2:"cd875c614ef847bc0d51",7:"5139d04ca268f25987e2",8:"0f709af59a94d04ec082",9:"269139092a6f0b7ba4a8"}[t]}(t);var c=new Error;a=function(e){s.onerror=s.onload=null,clearTimeout(u);var n=r[t];if(0!==n){if(n){var o=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;c.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",c.name="ChunkLoadError",c.type=o,c.request=i,n[1](c)}r[t]=void 0}};var u=setTimeout((function(){a({type:"timeout",target:s})}),12e4);s.onerror=s.onload=a,document.head.appendChild(s)}return Promise.all(e)},o.m=t,o.c=n,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/js/",o.oe=function(t){throw console.error(t),t};var i=window.webpackJsonpSettings=window.webpackJsonpSettings||[],a=i.push.bind(i);i.push=e,i=i.slice();for(var s=0;s<i.length;s++)e(i[s]);var c=a;o(o.s=580)}([function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n(9))},function(t,e,n){var r=n(0),o=n(25).f,i=n(15),a=n(16),s=n(54),c=n(113),u=n(82);t.exports=function(t,e){var n,f,l,p,d,h=t.target,v=t.global,m=t.stat;if(n=v?r:m?r[h]||s(h,{}):(r[h]||{}).prototype)for(f in e){if(p=e[f],l=t.noTargetGet?(d=o(n,f))&&d.value:n[f],!u(v?f:h+(m?".":"#")+f,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;c(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),a(n,f,p,t)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(0),o=n(43),i=n(5),a=n(64),s=n(65),c=n(116),u=o("wks"),f=r.Symbol,l=c?f:f&&f.withoutSetter||a;t.exports=function(t){return i(u,t)&&(s||"string"==typeof u[t])||(s&&i(f,t)?u[t]=f[t]:u[t]=l("Symbol."+t)),u[t]}},function(t,e,n){var r=n(7);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){var r=n(14),o={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return o.call(r(t),e)}},function(t,e,n){var r=n(2);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";var r=n(138),o=Object.prototype.toString;function i(t){return"[object Array]"===o.call(t)}function a(t){return void 0===t}function s(t){return null!==t&&"
/*!
* Vue.js v2.6.12
* (c) 2014-2020 Evan You
* Released under the MIT License.
*/
var r=Object.freeze({});function o(t){return null==t}function i(t){return null!=t}function a(t){return!0===t}function s(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function c(t){return null!==t&&"object"==typeof t}var u=Object.prototype.toString;function f(t){return"[object Object]"===u.call(t)}function l(t){return"[object RegExp]"===u.call(t)}function p(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return i(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function h(t){return null==t?"":Array.isArray(t)||f(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function v(t){var e=parseFloat(t);return isNaN(e)?t:e}function m(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o<r.length;o++)n[r[o]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}m("slot,component",!0);var g=m("key,ref,slot,slot-scope,is");function y(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function _(t,e){return b.call(t,e)}function w(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var O=/-(\w)/g,E=w((function(t){return t.replace(O,(function(t,e){return e?e.toUpperCase():""}))})),x=w((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),A=/\B([A-Z])/g,C=w((function(t){return t.replace(A,"-$1").toLowerCase()}));var S=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function I(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function T(t,e){for(var n in e)t[n]=e[n];return t}function j(t){for(var e={},n=0;n<t.length;n++)t[n]&&T(e,t[n]);return e}function k(t,e,n){}var R=function(t,e,n){return!1},L=function(t){return t};function P(t,e){if(t===e)return!0;var n=c(t),r=c(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var o=Array.isArray(t),i=Array.isArray(e);if(o&&i)return t.length===e.length&&t.every((function(t,n){return P(t,e[n])}));if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(o||i)return!1;var a=Object.keys(t),s=Object.keys(e);return a.length===s.length&&a.every((function(n){return P(t[n],e[n])}))}catch(t){return!1}}function $(t,e){for(var n=0;n<t.length;n++)if(P(t[n],e))return n;return-1}function N(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}var U=["component","directive","filter"],D=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],M={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:R,isReservedAttr:R,isUnknownElement:R,getTagNamespace:k,parsePlatformTagName:L,mustUseProp:R,async:!0,_lifecycleHooks:D},F=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function B(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var z=new RegExp("[^"+F.source+".$_\\d]");var H,q="__proto__"in{},G="undefined"!=typeof window,V="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,X=V&&WXEnvironment.platform.toLowerCase(),W=G&&window.navigator.userAgent.toLowerCase(),Y=W&&/msie|trident/.test(W),K=W&&W.indexOf("msie 9.0")>0,J=W&&W.indexOf("edge/")>0,Q=(W&&W.indexOf("android"),W&&/iphone|ipad|ipod|ios/.test(W)||"ios"===X),Z=(W&&/chrome\/\d+/.test(W),W&&/phantomjs/.test(W),W&&W.match(/firefox\/(\d+)/)),tt={}.watch,et=!1;if(G)try{var nt={};Object.defineProperty(nt,"passive",{get:function(){et=!0}}),window.addEventListener("test-passive",null,nt)}catch(t){}var rt=function(){return void 0===H&&(H=!G&&!V&&void 0!==t&&(t.process&&"server"===t.process.env.VUE_ENV)),H},ot=G&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function it(t){return"function"==t
/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.16.1
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
var n="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,r=function(){for(var t=["Edge","Trident","Firefox"],e=0;e<t.length;e+=1)if(n&&navigator.userAgent.indexOf(t[e])>=0)return 1;return 0}();var o=n&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then((function(){e=!1,t()})))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout((function(){e=!1,t()}),r))}};function i(t){return t&&"[object Function]"==={}.toString.call(t)}function a(t,e){if(1!==t.nodeType)return[];var n=t.ownerDocument.defaultView.getComputedStyle(t,null);return e?n[e]:n}function s(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function c(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=a(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?t:c(s(t))}function u(t){return t&&t.referenceNode?t.referenceNode:t}var f=n&&!(!window.MSInputMethodContext||!document.documentMode),l=n&&/MSIE 10/.test(navigator.userAgent);function p(t){return 11===t?f:10===t?l:f||l}function d(t){if(!t)return document.documentElement;for(var e=p(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?d(n):n:t?t.ownerDocument.documentElement:document.documentElement}function h(t){return null!==t.parentNode?h(t.parentNode):t}function v(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,o=n?e:t,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);var a,s,c=i.commonAncestorContainer;if(t!==c&&e!==c||r.contains(o))return"BODY"===(s=(a=c).nodeName)||"HTML"!==s&&d(a.firstElementChild)!==a?d(c):c;var u=h(t);return u.host?v(u.host,e):v(t,h(e).host)}function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===e?"scrollTop":"scrollLeft",r=t.nodeName;if("BODY"===r||"HTML"===r){var o=t.ownerDocument.documentElement,i=t.ownerDocument.scrollingElement||o;return i[n]}return t[n]}function g(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=m(e,"top"),o=m(e,"left"),i=n?-1:1;return t.top+=r*i,t.bottom+=r*i,t.left+=o*i,t.right+=o*i,t}function y(t,e){var n="x"===e?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+r+"Width"])}function b(t,e,n,r){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],p(10)?parseInt(n["offset"+t])+parseInt(r["margin"+("Height"===t?"Top":"Left")])+parseInt(r["margin"+("Height"===t?"Bottom":"Right")]):0)}function _(t){var e=t.body,n=t.documentElement,r=p(10)&&getComputedStyle(n);return{height:b("Height",e,n,r),width:b("Width",e,n,r)}}var w=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},O=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),E=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},x=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};function A(t){return x({},t,{right:t.left+t.width,bottom:t.top+t.height})}function C(t){var e={};try{if(p(10)){e=t.getBoundingClientRect();var n=m(t,"top"),r=m(t,"left");e.top+=n,e.left+=r,e.bottom+=n,e.right+=r}else e=t.getBoundingClientRect()}catch(t){}var o={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},i="HTML"===t.nodeName?_(t.ownerDocument):{},s=i.width||t.clientWidth||o.width,c=i.height||t.clientHeight||o.height,u=t.offsetWidth-s,f=t.offsetHeight-c;if(u||f){var l=a(t);u-=y(l,"x"),f-
/*!
* vuex v3.6.2
* (c) 2021 Evan You
* @license MIT
*/
function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,e.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}(u=t)}l.state.get=function(){return this._vm._data.$$state},l.state.set=function(t){0},f.prototype.commit=function(t,e,n){var r=this,o=g(t,e,n),i=o.type,a=o.payload,s=(o.options,{type:i,payload:a}),c=this._mutations[i];c&&(this._withCommit((function(){c.forEach((function(t){t(a)}))})),this._subscribers.slice().forEach((function(t){return t(s,r.state)})))},f.prototype.dispatch=function(t,e){var n=this,r=g(t,e),o=r.type,i=r.payload,a={type:o,payload:i},s=this._actions[o];if(s){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(a,n.state)}))}catch(t){0}var c=s.length>1?Promise.all(s.map((function(t){return t(i)}))):s[0](i);return new Promise((function(t,e){c.then((function(e){try{n._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(a,n.state)}))}catch(t){0}t(e)}),(function(t){try{n._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(a,n.state,t)}))}catch(t){0}e(t)}))}))}},f.prototype.subscribe=function(t,e){return p(t,this._subscribers,e)},f.prototype.subscribeAction=function(t,e){return p("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},f.prototype.watch=function(t,e,n){var r=this;return this._watcherVM.$watch((function(){return t(r.state,r.getters)}),e,n)},f.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._vm._data.$$state=t}))},f.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),v(this,this.state,t,this._modules.get(t),n.preserveState),h(this,this.state)},f.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){var n=m(e.state,t.slice(0,-1));u.delete(n,t[t.length-1])})),d(this)},f.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},f.prototype.hotUpdate=function(t){this._modules.update(t),d(this,!0)},f.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(f.prototype,l);var b=x((function(t,e){var n={};return E(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var r=A(this.$store,"mapState",t);if(!r)return;e=r.context.state,n=r.context.getters}return"function"==typeof o?o.call(this,e,n):e[o]},n[r].vuex=!0})),n})),_=x((function(t,e){var n={};return E(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.commit;if(t){var i=A(this.$store,"mapMutations",t);if(!i)return;r=i.context.commit}return"function"==typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}})),n})),w=x((function(t,e){var n={};return E(e).forEach((function(e){var r=e.key,o=e.val;o=t+o,n[r]=function(){if(!t||A(this.$store,"mapGetters",t))return this.$store.getters[o]},n[r].vuex=!0})),n})),O=x((function(t,e){var n={};return E(e).forEach((function(e){var r=e.key,o=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.dispatch;if(t){var i=A(this.$store,"mapActions",t);if(!i)return;r=i.context.dispatch}return"function"==typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}})),n}));function E(t){return function(t){return Array.isArray(t)||i(t)}(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function x(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function A(t,e,n){return t._modulesNamespaceMap[n]}function C(t,e,n){var r=n?
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Julius Härtl <jus@bitgrid.net>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
const ne=()=>Promise.all([o.e(0),o.e(9),o.e(7)]).then(o.bind(null,610)),re=()=>Promise.all([o.e(0),o.e(8),o.e(2)]).then(o.bind(null,609));i.default.use(te);var oe=new te({mode:"history",base:Object(ee.generateUrl)(""),linkActiveClass:"active",routes:[{path:"/:index(index.php/)?settings/users",component:ne,props:!0,name:"users",children:[{path:":selectedGroup",name:"group",component:ne}]},{path:"/:index(index.php/)?settings/apps",component:re,props:!0,name:"apps",children:[{path:":category",name:"apps-category",component:re,children:[{path:":id",name:"apps-details",component:re}]}]}]}),ie=o(303),ae=o(30),se=o.n(ae),ce=o(111),ue=o.n(ce);
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Julius Härtl <jus@bitgrid.net>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Sujith Haridasan <sujith.h@gmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
const fe=function(t){return t.replace(/\/$/,"")};var le={requireAdmin:()=>ue()(),get:(t,e)=>se.a.get(fe(t),e),post:(t,e)=>se.a.post(fe(t),e),patch:(t,e)=>se.a.patch(fe(t),e),put:(t,e)=>se.a.put(fe(t),e),delete:(t,e)=>se.a.delete(fe(t),{params:e})};
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Daniel Calviño Sánchez <danxuliu@gmail.com>
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Julius Härtl <jus@bitgrid.net>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Vincent Petry <vincent@nextcloud.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/const pe=function(t,e){return 1===e?t.sort((t,e)=>t.usercount-t.disabled<e.usercount-e.disabled):t.sort((t,e)=>t.name.localeCompare(e.name))},de={id:"",name:"",usercount:0,disabled:0,canAdd:!0,canRemove:!0},he={appendUsers(t,e){const n=t.users.concat(Object.keys(e).map(t=>e[t]));t.usersOffset+=t.usersLimit,t.users=n},setPasswordPolicyMinLength(t,e){t.minPasswordLength=""!==e?e:0},initGroups(t,{groups:e,orderBy:n,userCount:r}){t.groups=e.map(t=>Object.assign({},de,t)),t.orderBy=n,t.userCount=r,t.groups=pe(t.groups,t.orderBy)},addGroup(t,{gid:e,displayName:n}){try{if(void 0!==t.groups.find(t=>t.id===e))return;const r=Object.assign({},de,{id:e,name:n});t.groups.push(r),t.groups=pe(t.groups,t.orderBy)}catch(t){console.error("Can't create group",t)}},removeGroup(t,e){const n=t.groups.findIndex(t=>t.id===e);n>=0&&t.groups.splice(n,1)},addUserGroup(t,{userid:e,gid:n}){const r=t.groups.find(t=>t.id===n),o=t.users.find(t=>t.id===e);r&&o.enabled&&t.userCount>0&&r.usercount++;o.groups.push(n),t.groups=pe(t.groups,t.orderBy)},removeUserGroup(t,{userid:e,gid:n}){const r=t.groups.find(t=>t.id===n),o=t.users.find(t=>t.id===e);r&&o.enabled&&t.userCount>0&&r.usercount--;const i=o.groups;i.splice(i.indexOf(n),1),t.groups=pe(t.groups,t.orderBy)},addUserSubAdmin(t,{userid:e,gid:n}){t.users.find(t=>t.id===e).subadmin.push(n)},removeUserSubAdmin(t,{userid:e,gid:n}){const r=t.users.find(t=>t.id===e).subadmin;r.splice(r.indexOf(n),1)},deleteUser(t,e){const n=t.users.findIndex(t=>t.id===e);t.users.splice(n,1)},addUserData(t,e){t.users.push(e.data.ocs.data)},enableDisableUser(t,{userid:e,enabled:n}){const r=t.users.find(t=>t.id===e);r.enabled=n,t.userCount>0&&(t.groups.find(t=>"disabled"===t.id).usercount+=n?-1:1,t.userCount+=n?1:-1,r.groups.forEach(e=>{t.groups.find(t=>t.id===e).disabled+=n?-1:1}))},setUserData(t,{userid:e,key:n,value:r}){if("quota"===n){const o=OC.Util.computerFileSize(r);t.users.find(t=>t.id===e)[n][n]=null!==o?o:r}else t.users.find(t=>t.id===e)[n]=r},resetUsers(t){t.users=[],t.usersOffset=0}},ve={getUsers:t=>t.users,getGroups:t=>t.groups,getSubadminGroups:t=>t.groups.filter(t=>"admin"!==t.id&&"disabled"!==t.id),getPasswordPolicyMinLength:t=>t.minPasswordLength,getUsersOffset:t=>t.usersOffset,getUsersLimit:t=>t.usersLimit,getUserCount:t=>t.userCount},me=se.a.CancelToken;let ge=null;var ye={state:{users:[],groups:[],orderBy:1,minPasswordLength:0,usersOffset:0,usersLimit:25,userCount:0},mutations:he,getters:ve,actions:{getUsers:(t,{offset:e,limit:n,search:r,group:o})=>(ge&&ge.cancel("Operation canceled by another search request."),ge=me.source(),r="string"==typeof r?r:"",""!==(o="string"==typeof o?o:"")?le.get(Object(ee.generateOcsUrl)("cloud/groups/".concat(encodeURIComponent(encodeURIComponent(o)),"/users/details?offset=").concat(e,"&limit=").concat(n,"&search=").concat(r),2),{cancelToken:ge.token}).then(e=>Object.keys(e.data.ocs.data.users).length>0&&(t.commit("appendUsers",e.data.ocs.data.users),Object.keys(e.data.ocs.data.users).length>=n)).catch(e=>{se.a.isCancel(e)||t.commit("API_FAILURE",e)}):le.get(Object(ee.generateOcsUrl)("cloud/users/details?offset=".concat(e,"&limit=").concat(n,"&search=").concat(r),2),{cancelToken:ge.token}).then(e=>Object.keys(e.data.ocs.data.users).length>0&&(t.commit("appendUsers",e.data.ocs.data.users),Object.keys(e.data.ocs.data.users).length>=n)).catch(e=>{se.a.isCancel(e)||t.commit("API_FAILURE",e)})),getGroups(t,{offset:e,limit:n,search:r}){r="string"==typeof r?r:"";const o=-1===n?"":"&limit=".concat(n);return le.get(Object(ee.generateOcsUrl)("cloud/groups?offset=".concat(e,"&search=").concat(r).concat(o),2)).then(e=>Object.keys(e.data.ocs.data.groups).length>0&&(e.data.ocs.data.groups.forEach((function(e){t.commit("addGroup",{gid:e,displayName:e})})),!0)).catch(e=>t.commit("API_FAILURE",e))},getUsersFromList:(t,{offset:e,limit:n,search:r})=>(r="string"==typeof r?r:"",le.get(Object(ee.generateOcsUrl)("cloud/users/details?offset=".concat(e,"&limit=").concat(n,"&search=").concat(r),2)).then(e=>Object.keys(e.data.ocs.data.users).length>0&&(t.commit("appendUsers",e.data.ocs.data.users),!0))
/**
* @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Julius Härtl <jus@bitgrid.net>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/var be={state:{apps:[],categories:[],updateCount:0,loading:{},loadingList:!1},mutations:{APPS_API_FAILURE(e,n){OC.Notification.showHtml(t("settings","An error occured during the request. Unable to proceed.")+"<br>"+n.error.response.data.data.message,{timeout:7}),console.error(e,n)},initCategories(t,{categories:e,updateCount:n}){t.categories=e,t.updateCount=n},setUpdateCount(t,e){t.updateCount=e},addCategory(t,e){t.categories.push(e)},appendCategories(t,e){t.categories=e},setAllApps(t,e){t.apps=e},setError(t,{appId:e,error:n}){Array.isArray(e)||(e=[e]),e.forEach(e=>{t.apps.find(t=>t.id===e).error=n})},clearError(t,{appId:e,error:n}){t.apps.find(t=>t.id===e).error=null},enableApp(t,{appId:e,groups:n}){const r=t.apps.find(t=>t.id===e);r.active=!0,r.groups=n},disableApp(t,e){const n=t.apps.find(t=>t.id===e);n.active=!1,n.groups=[],n.removable&&(n.canUnInstall=!0)},uninstallApp(t,e){t.apps.find(t=>t.id===e).active=!1,t.apps.find(t=>t.id===e).groups=[],t.apps.find(t=>t.id===e).needsDownload=!0,t.apps.find(t=>t.id===e).installed=!1,t.apps.find(t=>t.id===e).canUnInstall=!1,t.apps.find(t=>t.id===e).canInstall=!0},updateApp(t,e){const n=t.apps.find(t=>t.id===e),r=n.update;n.update=null,n.version=r,t.updateCount--},resetApps(t){t.apps=[]},reset(t){t.apps=[],t.categories=[],t.updateCount=0},startLoading(t,e){Array.isArray(e)?e.forEach(e=>{i.default.set(t.loading,e,!0)}):i.default.set(t.loading,e,!0)},stopLoading(t,e){Array.isArray(e)?e.forEach(e=>{i.default.set(t.loading,e,!1)}):i.default.set(t.loading,e,!1)}},getters:{loading:t=>function(e){return t.loading[e]},getCategories:t=>t.categories,getAllApps:t=>t.apps,getUpdateCount:t=>t.updateCount},actions:{enableApp(e,{appId:n,groups:r}){let o;return o=Array.isArray(n)?n:[n],le.requireAdmin().then(i=>(e.commit("startLoading",o),e.commit("startLoading","install"),le.post(Object(ee.generateUrl)("settings/apps/enable"),{appIds:o,groups:r}).then(i=>(e.commit("stopLoading",o),e.commit("stopLoading","install"),o.forEach(t=>{e.commit("enableApp",{appId:t,groups:r})}),le.get(Object(ee.generateUrl)("apps/files")).then(()=>{i.data.update_required&&(OC.dialogs.info(t("settings","The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds."),t("settings","App update"),(function(){window.location.reload()}),!0),setTimeout((function(){location.reload()}),5e3))}).catch(()=>{Array.isArray(n)||e.commit("setError",{appId:o,error:t("settings","Error: This app cannot be enabled because it makes the server unstable")})}))).catch(t=>{e.commit("stopLoading",o),e.commit("stopLoading","install"),e.commit("setError",{appId:o,error:t.response.data.data.message}),e.commit("APPS_API_FAILURE",{appId:n,error:t})}))).catch(t=>e.commit("API_FAILURE",{appId:n,error:t}))},forceEnableApp(t,{appId:e,groups:n}){let r;return r=Array.isArray(e)?e:[e],le.requireAdmin().then(()=>(t.commit("startLoading",r),t.commit("startLoading","install"),le.post(Object(ee.generateUrl)("settings/apps/force"),{appId:e}).then(t=>{location.reload()}).catch(n=>{t.commit("stopLoading",r),t.commit("stopLoading","install"),t.commit("setError",{appId:r,error:n.response.data.data.message}),t.commit("APPS_API_FAILURE",{appId:e,error:n})}))).catch(n=>t.commit("API_FAILURE",{appId:e,error:n}))},disableApp(t,{appId:e}){let n;return n=Array.isArray(e)?e:[e],le.requireAdmin().then(r=>(t.commit("startLoading",n),le.post(Object(ee.generateUrl)("settings/apps/disable"),{appIds:n}).then(e=>(t.commit("stopLoading",n),n.forEach(e=>{t.commit("disableApp",e)}),!0)).catch(r=>{t.commit("stopLoading",n),t.commit("APPS_API_FAILURE",{appId:e,error:r})}))).catch(n=>t.commit("API_FAILURE",{appId:e,error:n}))},uninstallApp:(t,{appId:e})=>le.requireAdmin().then(n=>(t.commit("startLoading",e),le.get(Object(ee.generateUrl)("settings/apps/uninstall/".concat(e))).then(n=>(t.commit("stopLoading",e),t.commit("uninstallApp",e),!0)).catch(n=>{t.commit("stopLoading",e),t.commit("APPS_API_FAILURE",{appId:e,error:n})}))).catch(n=>t.commit("API_FAILURE",{appId:e,error:n})),updateApp:(t,{appId:e})=>le.requireAdmin().then(n=>(t.commit("st
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/var _e={state:{serverData:{}},mutations:{setServerData(t,e){t.serverData=e}},getters:{getServerData:t=>t.serverData},actions:{}};
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/var we={state:{},mutations:{},getters:{},actions:{setAppConfig:(t,{app:e,key:n,value:r})=>le.requireAdmin().then(t=>le.post(Object(ee.generateOcsUrl)("apps/provisioning_api/api/v1/config/apps/".concat(e,"/").concat(n),2),{value:r}).catch(t=>{throw t})).catch(o=>t.commit("API_FAILURE",{app:e,key:n,value:r,error:o}))}};
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Julius Härtl <jus@bitgrid.net>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/i.default.use(ie.a);const Oe={API_FAILURE(e,n){try{const e=n.error.response.data.ocs.meta.message;OC.Notification.showHtml(t("settings","An error occured during the request. Unable to proceed.")+"<br>"+e,{timeout:7})}catch(e){OC.Notification.showTemporary(t("settings","An error occured during the request. Unable to proceed."))}console.error(e,n)}};var Ee=new ie.a.Store({modules:{users:ye,apps:be,settings:_e,oc:we},strict:!1,mutations:Oe});
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author rakekniven <mark.ziegler@rakekniven.de>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/i.default.use(a.default,{defaultHtml:!1}),Object(s.sync)(Ee,oe),o.nc=btoa(OC.requestToken),o.p=OC.linkTo("settings","js/"),i.default.prototype.t=t,i.default.prototype.n=n,i.default.prototype.OC=OC,i.default.prototype.OCA=OCA,i.default.prototype.oc_userconfig=oc_userconfig;const xe=new i.default({router:oe,store:Ee,render:t=>t(f)}).$mount("#content")}]);
//# sourceMappingURL=vue-settings-apps-users-management.js.map?v=92e03ea2e073b12c2d2f