text: (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{1548:function(e,t,n){"use strict";n.d(t,"a",function(){return f});n(88),n(43);var a=n(30),r=n.n(a),i=n(7),o=n.n(i),s=n(56);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function u(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,m(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(t,o.a.PureComponent),n=t,(a=[{key:"render",value:function(){var e="fa fa-1x fa-angle-right"+(this.props.additionalClassName?" "+this.props.additionalClassName:"");return o.a.createElement(s.c,{id:"generic_icons.next",defaultMessage:"Next Icon"},function(t){return o.a.createElement("i",{className:e,title:t})})}}])&&c(n.prototype,a),r&&c(n,r),t}();p(f,"propTypes",{additionalClassName:r.a.string}),p(f,"defaultProps",{additionalClassName:null})},1584:function(e,t,n){"use strict";n.d(t,"a",function(){return f});n(88),n(43);var a=n(7),r=n.n(a),i=n(56),o=n(30),s=n.n(o);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function u(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,m(t).apply(this,arguments))}var n,a,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(t,r.a.PureComponent),n=t,(a=[{key:"render",value:function(){var e="fa fa-1x fa-angle-left"+(this.props.additionalClassName?" "+this.props.additionalClassName:"");return r.a.createElement(i.c,{id:"generic_icons.previous",defaultMessage:"Previous Icon"},function(t){return r.a.createElement("i",{className:e,title:t})})}}])&&c(n.prototype,a),o&&c(n,o),t}();p(f,"propTypes",{additionalClassName:s.a.string}),p(f,"defaultProps",{additionalClassName:null})},1736:function(e,t,n){"use strict";var a=n(418),r=n(20),i=n(40),o=n(12),s=n(16),l=(n(88),n(43),n(211),n(120),n(30)),c=n.n(l),u=n(7),m=n.n(u),d=n(56),p=n(23),f=n(57);function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function g(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var _,E,S,O=Object(d.g)({sessionRevoked:{id:Object(f.b)("audit_table.sessionRevoked"),defaultMessage:"The session with id {sessionId} was revoked"},channelCreated:{id:Object(f.b)("audit_table.channelCreated"),defaultMessage:"Created the {channelName} channel"},establishedDM:{id:Object(f.b)("audit_table.establishedDM"),defaultMessage:"Established a direct message channel with {username}"},nameUpdated:{id:Object(f.b)("audit_table.nameUpdated"),defaultMessage:"Updated the {channelName} channel name"},headerUpdated:{id:Object(f.b)("audit_table.headerUpdated"),defaultMessage:"Updated the {channelName} channel header"},channelDeleted:{id:Object(f.b)("audit_table.channelDeleted"),defaultMessage:"Archived the channel with the URL {url}"},userAdded:{id:Object(f.b)("audit_table.userAdded"),defaultMessage:"Added {username} to the {channelName} channel"},userRemoved:{id:Object(f.b)("audit_table.userRemoved"),defaultMessage:"Removed {username} to the {channelName} channel"},attemptedRegisterApp:{id:Object(f.b)("audit_table.attemptedRegisterApp"),defaultMessage:"Attempted to register a new OAuth Application with ID {id}"},attemptedAllowOAuthAccess:{id:Object(f.b)("audit_table.attemptedAllowOAuthAccess"),defaultMessage:"Attempted to allow a new OAuth service access"},successfullOAuthAccess:{id:Object(f.b)("audit_table.successfullOAuthAccess"),defaultMessage:"Successfully gave a new OAuth service access"},failedOAuthAccess:{id:Object(f.b)("audit_table.failedOAuthAccess"),defaultMessage:"Failed to allow a new OAuth service access - the redirect URI did not match the previously registered callback"},attemptedOAuthToken:{id:Object(f.b)("audit_table.attemptedOAuthToken"),defaultMessage:"Attempted to get an OAuth access token"},successfullOAuthToken:{id:Object(f.b)("audit_table.successfullOAuthToken"),defaultMessage:"Successfully added a new OAuth service"},oauthTokenFailed:{id:Object(f.b)("audit_table.oauthTokenFailed"),defaultMessage:"Failed to get an OAuth access token - {token}"},attemptedLogin:{id:Object(f.b)("audit_table.attemptedLogin"),defaultMessage:"Attempted to login"},authenticated:{id:Object(f.b)("audit_table.authenticated"),defauleMessage:"Successfully authenticated"},successfullLogin:{id:Object(f.b)("audit_table.successfullLogin"),defaultMessage:"Successfully logged in"},failedLogin:{id:Object(f.b)("audit_table.failedLogin"),defaultMessage:"FAILED login attempt"},updatePicture:{id:Object(f.b)("audit_table.updatePicture"),defaultMessage:"Updated your profile picture"},updateGeneral:{id:Object(f.b)("audit_table.updateGeneral"),defaultMessage:"Updated the general settings of your account"},attemptedPassword:{id:Object(f.b)("audit_table.attemptedPassword"),defaultMessage:"Attempted to change password"},successfullPassword:{id:Object(f.b)("audit_table.successfullPassword"),defaultMessage:"Successfully changed password"},failedPassword:{id:Object(f.b)("audit_table.failedPassword"),defaultMessage:"Failed to change password - tried to update user password who was logged in through OAuth"},updatedRol:{id:Object(f.b)("audit_table.updatedRol"),defaultMessage:"Updated user role(s) to "},member:{id:Object(f.b)("audit_table.member"),defaultMessage:"member"},accountActive:{id:Object(f.b)("audit_table.accountActive"),defaultMessage:"Account activated"},accountInactive:{id:Object(f.b)("audit_table.accountInactive"),defaultMessage:"Account deactivated"},by:{id:Object(f.b)("audit_table.by"),defaultMessage:" by {username}"},byAdmin:{id:Object(f.b)("audit_table.byAdmin"),defaultMessage:" by an admin"},sentEmail:{id:Object(f.b)("audit_table.sentEmail"),defaultMessage:"Sent an email to {email} to reset your password"},attemptedReset:{id:Object(f.b)("audit_table.attemptedReset"),defaultMessage:"Attempted to reset password"},successfullReset:{id:Object(f.b)("audit_table.successfullReset"),defaultMessage:"Successfully reset password"},updateGlobalNotifications:{id:Object(f.b)("audit_table.updateGlobalNotifications"),defaultMessage:"Updated your global notification settings"},attemptedWebhookCreate:{id:Object(f.b)("audit_table.attemptedWebhookCreate"),defaultMessage:"Attempted to create a webhook"},succcessfullWebhookCreate:{id:Object(f.b)("audit_table.successfullWebhookCreate"),defaultMessage:"Successfully created a webhook"},failedWebhookCreate:{id:Object(f.b)("audit_table.failedWebhookCreate"),defaultMessage:"Failed to create a webhook - bad channel permissions"},attemptedWebhookDelete:{id:Object(f.b)("audit_table.attemptedWebhookDelete"),defaultMessage:"Attempted to delete a webhook"},successfullWebhookDelete:{id:Object(f.b)("audit_table.successfullWebhookDelete"),defaultMessage:"Successfully deleted a webhook"},failedWebhookDelete:{id:Object(f.b)("audit_table.failedWebhookDelete"),defaultMessage:"Failed to delete a webhook - inappropriate conditions"},logout:{id:Object(f.b)("audit_table.logout"),defaultMessage:"Logged out of your account"},verified:{id:Object(f.b)("audit_table.verified"),defaultMessage:"Successfully verified your email address"},revokedAll:{id:Object(f.b)("audit_table.revokedAll"),defaultMessage:"Revoked all current sessions for the team"},loginAttempt:{id:Object(f.b)("audit_table.loginAttempt"),defaultMessage:" (Login attempt)"},loginFailure:{id:Object(f.b)("audit_table.loginFailure"),defaultMessage:" (Login failure)"},attemptedLicenseAdd:{id:Object(f.b)("audit_table.attemptedLicenseAdd"),defaultMessage:"Attempted to add new license"},successfullLicenseAdd:{id:Object(f.b)("audit_table.successfullLicenseAdd"),defaultMessage:"Successfully added new license"},failedExpiredLicenseAdd:{id:Object(f.b)("audit_table.failedExpiredLicenseAdd"),defaultMessage:"Failed to add a new license as it has either expired or not yet been started"},failedInvalidLicenseAdd:{id:Object(f.b)("audit_table.failedInvalidLicenseAdd"),defaultMessage:"Failed to add an invalid license"},licenseRemoved:{id:Object(f.b)("audit_table.licenseRemoved"),defaultMessage:"Successfully removed a license"}}),T=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),g(this,y(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(t,m.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){var e=this.props.audits.map(function(e){return e.user_id});this.props.actions.getMissingProfilesByIds(e)}},{key:"render",value:function(){for(var e,t,n,a=this.props.audits,r=this.props.showUserId,i=this.props.showIp,o=this.props.showSession,s=[],l=0;l<a.length;l++){var c=a[l],u=this.formatAuditInfo(c),p=void 0;r&&(p=m.a.createElement("td",{className:"word-break--all"},u.userId));var f=void 0;i&&(f=m.a.createElement("td",{className:"whitespace--nowrap word-break--all"},u.ip));var b=void 0;o&&(b=m.a.createElement("td",{className:"whitespace--nowrap word-break--all"},u.sessionId));var h="";-1!==u.desc.toLowerCase().indexOf("fail")&&(h=" color--error"),s[l]=m.a.createElement("tr",{key:c.id},m.a.createElement("td",{className:"whitespace--nowrap word-break--all"},u.timestamp),p,m.a.createElement("td",{className:"word-break--all"+h},u.desc),f,b)}return r&&(e=m.a.createElement("th",null,m.a.createElement(d.c,{id:"audit_table.userId",defaultMessage:"User ID"}))),i&&(t=m.a.createElement("th",null,m.a.createElement(d.c,{id:"audit_table.ip",defaultMessage:"IP Address"}))),o&&(n=m.a.createElement("th",null,m.a.createElement(d.c,{id:"audit_table.session",defaultMessage:"Session ID"}))),m.a.createElement("table",{className:"table"},m.a.createElement("thead",null,m.a.createElement("tr",null,m.a.createElement("th",null,m.a.createElement(d.c,{id:"audit_table.timestamp",defaultMessage:"Timestamp"})),e,m.a.createElement("th",null,m.a.createElement(d.c,{id:"audit_table.action",defaultMessage:"Action"})),t,n)),m.a.createElement("tbody",null,s))}},{key:"formatAuditInfo",value:function(e){var t=this.props.intl.formatMessage,n=e.action.replace(/\/api\/v[1-9]/,""),a="";if(0===n.indexOf("/channels")){var r,i=e.extra_info.split(" "),o=i[0].split("="),s="",l="";switch(o.indexOf("name")>=0&&(s=o[o.indexOf("name")+1],l=(r=this.props.getByName(s))?r.display_name:s),n){case"/channels/create":a=t(O.channelCreated,{channelName:l});break;case"/channels/create_direct":a=t(O.establishedDM,{username:Object(p.u)(r.id).username});break;case"/channels/update":a=t(O.nameUpdated,{channelName:l});break;case"/channels/update_desc":case"/channels/update_header":a=t(O.headerUpdated,{channelName:l});break;default:var c=[],u="",f="";if(i[1]&&(c=i[1].split("=")).indexOf("user_id")>=0){u=c[c.indexOf("user_id")+1];var b=this.props.getUser(u);b&&(f=b.username)}/\/channels\/[A-Za-z0-9]+\/delete/.test(n)?a=t(O.channelDeleted,{url:s}):/\/channels\/[A-Za-z0-9]+\/add/.test(n)?a=t(O.userAdded,{username:f,channelName:l}):/\/channels\/[A-Za-z0-9]+\/remove/.test(n)&&(a=t(O.userRemoved,{username:f,channelName:l}))}}else if(0===n.indexOf("/oauth")){var h=e.extra_info.split(" ");switch(n){case"/oauth/register":var g=h[0].split("=");"client_id"===g[0]&&(a=t(O.attemptedRegisterApp,{id:g[1]}));break;case"/oauth/allow":"attempt"===h[0]?a=t(O.attemptedAllowOAuthAccess):"success"===h[0]?a=t(O.successfullOAuthAccess):"fail - redirect_uri did not match registered callback"===h[0]&&(a=t(O.failedOAuthAccess));break;case"/oauth/access_token":if("attempt"===h[0])a=t(O.attemptedOAuthToken);else if("success"===h[0])a=t(O.successfullOAuthToken);else{var y=h[0].split("-");"fail"===y[0].trim()&&y[1]&&(a=t(y,{token:y[1].trim()}))}}}else if(0===n.indexOf("/users")){var v=e.extra_info.split(" ");switch(n){case"/users/login":"attempt"===v[0]?a=t(O.attemptedLogin):"success"===v[0]?a=t(O.successfullLogin):"authenticated"===v[0]?a=t(O.authenticated):v[0]&&(a=t(O.failedLogin));break;case"/users/revoke_session":a=t(O.sessionRevoked,{sessionId:v[0].split("=")[1]});break;case"/users/newimage":a=t(O.updatePicture);break;case"/users/update":a=t(O.updateGeneral);break;case"/users/newpassword":"attempted"===v[0]?a=t(O.attemptedPassword):"completed"===v[0]?a=t(O.successfullPassword):"failed - tried to update user password who was logged in through oauth"===v[0]&&(a=t(O.failedPassword));break;case"/users/update_roles":var _=v[0].split("=")[1];a=t(O.updatedRol),_.trim()?a+=_:a+=t(O.member);break;case"/users/update_active":var E=v[0].split("=")[0],S=v[0].split("=")[1];if("active"===E){"true"===S?a=t(O.accountActive):"false"===S&&(a=t(O.accountInactive));var T=v[1].split("=");if("session_user"===T[0]){var w=this.props.getUser(T[1]),j=this.props.currentUser;j&&w&&Object(p.W)(j.roles)?a+=t(O.by,{username:w.username}):j&&w&&(a+=t(O.byAdmin))}}else"session_id"===E&&(a=t(O.sessionRevoked,{sessionId:S}));break;case"/users/send_password_reset":a=t(O.sentEmail,{email:v[0].split("=")[1]});break;case"/users/reset_password":"attempt"===v[0]?a=t(O.attemptedReset):"success"===v[0]&&(a=t(O.successfullReset));break;case"/users/update_notify":a=t(O.updateGlobalNotifications)}}else if(0===n.indexOf("/hooks")){var x=e.extra_info;switch(n){case"/hooks/incoming/create":"attempt"===x?a=t(O.attemptedWebhookCreate):"success"===x?a=t(O.succcessfullWebhookCreate):"fail - bad channel permissions"===x&&(a=t(O.failedWebhookCreate));break;case"/hooks/incoming/delete":"attempt"===x?a=t(O.attemptedWebhookDelete):"success"===x?a=t(O.successfullWebhookDelete):"fail - inappropriate conditions"===x&&(a=t(O.failedWebhookDelete))}}else if(0===n.indexOf("/license")){var P=e.extra_info;switch(n){case"/license/add":"attempt"===P?a=t(O.attemptedLicenseAdd):"success"===P?a=t(O.successfullLicenseAdd):"failed - expired or non-started license"===P?a=t(O.failedExpiredLicenseAdd):"failed - invalid license"===P&&(a=t(O.failedInvalidLicenseAdd));break;case"/license/remove":a=t(O.licenseRemoved)}}else if(0===n.indexOf("/admin/download_compliance_report"))a=Object(p.kb)(e.extra_info);else switch(n){case"/logout":a=t(O.logout);break;case"/verify_email":a=t(O.verified)}if(!a)if(e.extra_info.indexOf("revoked_all=")>=0)a=t(O.revokedAll);else{var k="";n&&-1!==n.lastIndexOf("/")&&(k=n.substring(n.lastIndexOf("/")+1).replace("_"," "),k=Object(p.kb)(k));var C="";e.extra_info&&-1!==(C=e.extra_info).indexOf("=")&&(C=C.substring(C.indexOf("=")+1)),a=k+" "+C}var M=new Date(e.create_at),R={};R.timestamp=m.a.createElement("div",null,m.a.createElement("div",null,m.a.createElement(d.a,{value:M,day:"2-digit",month:"short",year:"numeric"})),m.a.createElement("div",null,m.a.createElement(d.d,{value:M,hour:"2-digit",minute:"2-digit"})));var N=this.props.getUser(e.user_id);return R.userId=N?N.email:e.user_id,R.desc=a,R.ip=e.ip_address,R.sessionId=e.session_id,R}}])&&h(n.prototype,a),r&&h(n,r),t}();_=T,E="propTypes",S={intl:d.i.isRequired,audits:c.a.array.isRequired,showUserId:c.a.bool,showIp:c.a.bool,showSession:c.a.bool,currentUser:c.a.object.isRequired,getUser:c.a.func.isRequired,getByName:c.a.func.isRequired,actions:c.a.shape({getMissingProfilesByIds:c.a.func.isRequired}).isRequired},E in _?Object.defineProperty(_,E,{value:S,enumerable:!0,configurable:!0,writable:!0}):_[E]=S;var w=Object(d.h)(T);t.a=Object(a.connect)(function(e){return{currentUser:Object(o.getCurrentUser)(e),getUser:function(t){return Object(o.getUser)(e,t)},getByName:function(t){return Object(s.getChannelByName)(e,t)}}},function(e){return{actions:Object(r.bindActionCreators)({getMissingProfilesByIds:i.getMissingProfilesByIds},e)}})(w)},1849:function(e,t){},1852:function(e,t){},2341:function(e,t,n){},2342:function(e,t,n){},2343:function(e,t,n){},2346:function(e,t,n){e.exports=n.p+"files/59f2c2a0e27998aa41f428e4d8500721.png"},2347:function(e,t,n){e.exports=n.p+"files/8b4e209ef4a947aa0ac0ccd7ebea918a.png"},2354:function(e,t,n){"use strict";n.r(t);var a=n(418),r=n(20),i=n(1528),o=n(248),s=n(1570),l=n(435),c=n(24),u=n(96),m=n(12),d=n(1496),p=n(1588),f=(n(88),n(43),n(44),n(245),n(247),n(33),n(34),n(25),n(945),n(1795),n(30)),b=n.n(f),h=n(7),g=n.n(h),y=n(1558),v=n(1733),_=n(1869),E=(n(120),n(211),n(74),n(116),n(118),n(156),n(117),n(56)),S=n(1685),O=n(1766),T=n(319),w=n(0),j=(n(210),n(305),n(306),n(313),n(1729),n(14)),x=regeneratorRuntime.mark(R);function P(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var C={enableTeamCreation:{true:[{roleName:"system_user",permission:j.Permissions.CREATE_TEAM,shouldHave:!0}],false:[{roleName:"system_user",permission:j.Permissions.CREATE_TEAM,shouldHave:!1}]},editOthersPosts:{true:[{roleName:"system_admin",permission:j.Permissions.EDIT_OTHERS_POSTS,shouldHave:!0},{roleName:"team_admin",permission:j.Permissions.EDIT_OTHERS_POSTS,shouldHave:!0}],false:[{roleName:"team_admin",permission:j.Permissions.EDIT_OTHERS_POSTS,shouldHave:!1},{roleName:"system_admin",permission:j.Permissions.EDIT_OTHERS_POSTS,shouldHave:!0}]},enableOnlyAdminIntegrations:{true:[{roleName:"team_user",permission:j.Permissions.MANAGE_INCOMING_WEBHOOKS,shouldHave:!1},{roleName:"team_user",permission:j.Permissions.MANAGE_OUTGOING_WEBHOOKS,shouldHave:!1},{roleName:"team_user",permission:j.Permissions.MANAGE_SLASH_COMMANDS,shouldHave:!1},{roleName:"system_user",permission:j.Permissions.MANAGE_OAUTH,shouldHave:!1}],false:[{roleName:"team_user",permission:j.Permissions.MANAGE_INCOMING_WEBHOOKS,shouldHave:!0},{roleName:"team_user",permission:j.Permissions.MANAGE_OUTGOING_WEBHOOKS,shouldHave:!0},{roleName:"team_user",permission:j.Permissions.MANAGE_SLASH_COMMANDS,shouldHave:!0},{roleName:"system_user",permission:j.Permissions.MANAGE_OAUTH,shouldHave:!0}]}};function M(e,t){var n=JSON.parse(JSON.stringify(t));return function(e){var t=(n=[],Object.values(C).forEach(function(e){Object.values(e).forEach(function(e){var t=e.map(function(e){return e.roleName});n=n.concat(t)})}),P(new Set(n.map(function(e){return e}))));var n;Object.keys(e).forEach(function(n){t.includes(n)||delete e[n]})}(n),Object.keys(C).forEach(function(t){var a=e[t];a&&function(e,t,n){var a=C[e][t];if(void 0===a)throw new Error("Value '".concat(t,"' not present in MAPPING for key '").concat(e,"'."));a.forEach(function(e){var t=n[e.roleName];e.shouldHave?function(e,t){t.permissions.includes(e)||t.permissions.push(e)}(e.permission,t):function(e,t){var n=t.permissions.indexOf(e);-1!==n&&t.permissions.splice(n,1)}(e.permission,t)})}(t,a,n)}),Object.entries(n).forEach(function(e){var a=k(e,2),r=a[0],i=a[1],o=new Set(t[r].permissions),s=new Set(i.permissions),l=P(s).filter(function(e){return!o.has(e)});o.size===s.size&&0===l.length&&delete n[r]}),n}function R(e,t){var n,a,r;return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:i.t0=regeneratorRuntime.keys(e);case 1:if((i.t1=i.t0()).done){i.next=10;break}if(n=i.t1.value,!e.hasOwnProperty(n)){i.next=8;break}return a=e[n],r=a.some(function(e){var n=t[e.roleName];return e.shouldHave&&!n.permissions.includes(e.permission)||!e.shouldHave&&n.permissions.includes(e.permission)}),i.next=8,{value:n,allConditionsAreMet:!r};case 8:i.next=1;break;case 10:case"end":return i.stop()}},x)}var N=n(23),A=n(57),D=n(1526),L=n(1579),I=n(1542);function U(e){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function q(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function F(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(e,t){return(G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Y=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=B(t).call(this,e))||"object"!==U(r)&&"function"!=typeof r?F(a):r).handleRequest=n.handleRequest.bind(F(n)),n.state={busy:!1,fail:null,success:!1},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&G(e,t)}(t,g.a.Component),n=t,(a=[{key:"handleRequest",value:function(e){var t=this;e.preventDefault(),this.setState({busy:!0,fail:null,success:!1});var n=function(){t.props.requestAction(function(){t.setState({busy:!1,success:!0})},function(e){var n=e.message;t.props.includeDetailedError&&(n+=" - "+e.detailed_error),t.setState({busy:!1,fail:n})})};this.props.saveNeeded?this.props.saveConfigAction(n):n()}},{key:"render",value:function(){var e=null;this.state.fail?e=g.a.createElement("div",null,g.a.createElement("div",{className:"alert alert-warning"},g.a.createElement(I.a,null),g.a.createElement(E.c,{id:this.props.errorMessage.id,defaultMessage:this.props.errorMessage.defaultMessage,values:{error:this.state.fail}}))):this.state.success&&this.props.showSuccessMessage&&(e=g.a.createElement("div",null,g.a.createElement("div",{className:"alert alert-success"},g.a.createElement(L.a,null),g.a.createElement(E.c,{id:this.props.successMessage.id,defaultMessage:this.props.successMessage.defaultMessage}))));var t="col-sm-8",n=null;return this.props.label?n=g.a.createElement("label",{className:"control-label col-sm-4"},this.props.label):t="col-sm-offset-4 "+t,g.a.createElement("div",{className:"form-group"},n,g.a.createElement("div",{className:t},g.a.createElement("div",null,g.a.createElement("button",{className:"btn btn-default",onClick:this.handleRequest,disabled:this.props.disabled},g.a.createElement(D.a,{loading:this.state.busy,text:this.props.loadingText||N.ab("admin.requestButton.loading"," Loading...")},this.props.buttonText)),this.props.alternativeActionElement,e),g.a.createElement("div",{className:"help-text"},this.props.helpText)))}}])&&q(n.prototype,a),r&&q(n,r),t}();H(Y,"propTypes",{requestAction:b.a.func.isRequired,helpText:b.a.element,loadingText:b.a.string,buttonText:b.a.element.isRequired,label:b.a.element,disabled:b.a.bool,saveNeeded:b.a.bool,saveConfigAction:b.a.func,showSuccessMessage:b.a.bool,successMessage:b.a.shape({id:b.a.string.isRequired,defaultMessage:b.a.string.isRequired}),errorMessage:b.a.shape({id:b.a.string.isRequired,defaultMessage:b.a.string.isRequired}),includeDetailedError:b.a.bool,alternativeActionElement:b.a.element}),H(Y,"defaultProps",{disabled:!1,saveNeeded:!1,showSuccessMessage:!0,includeDetailedError:!1,successMessage:{id:Object(A.b)("admin.requestButton.requestSuccess"),defaultMessage:"Test Successful"},errorMessage:{id:Object(A.b)("admin.requestButton.requestFailure"),defaultMessage:"Test Failure: {error}"}});var W=n(1494),z=function(){return g.a.createElement("div",{className:"alert alert-warning"},g.a.createElement(E.c,{id:"admin.set_by_env",defaultMessage:"This setting has been set through an environment variable. It cannot be changed through the System Console."}))};function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function J(e,t){return!t||"object"!==V(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Q(e,t){return(Q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Z,$,ee,te=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),J(this,K(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Q(e,t)}(t,h["PureComponent"]),n=t,(a=[{key:"render",value:function(){var e=this.props,t=e.children,n=e.setByEnv,a=e.helpText,r=e.inputId,i=e.label;return g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label col-sm-4",htmlFor:r},i),g.a.createElement("div",{className:"col-sm-8"},t,g.a.createElement("div",{className:"help-text"},a),n?g.a.createElement(z,null):null))}}])&&X(n.prototype,a),r&&X(n,r),t}();function ne(e){return(ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ae(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function re(e){return(re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ie(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Z=te,$="propTypes",ee={inputId:b.a.string,label:b.a.node.isRequired,children:b.a.node.isRequired,helpText:b.a.node,setByEnv:b.a.bool},$ in Z?Object.defineProperty(Z,$,{value:ee,enumerable:!0,configurable:!0,writable:!0}):Z[$]=ee;var le=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=re(t).call(this,e))||"object"!==ne(r)&&"function"!=typeof r?ie(a):r).handleChange=n.handleChange.bind(ie(n)),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oe(e,t)}(t,g.a.Component),n=t,(a=[{key:"handleChange",value:function(e){this.props.onChange(this.props.id,"true"===e.target.value)}},{key:"render",value:function(){var e;return e=this.props.disabled&&this.props.disabledText?g.a.createElement("div",null,g.a.createElement("span",{className:"admin-console__disabled-text"},this.props.disabledText),this.props.helpText):this.props.helpText,g.a.createElement(te,{label:this.props.label,helpText:e,setByEnv:this.props.setByEnv},g.a.createElement("a",{name:this.props.id}),g.a.createElement("label",{className:"radio-inline"},g.a.createElement("input",{type:"radio",value:"true",id:N.h(this.props.id)+"true",name:this.props.id,checked:this.props.value,onChange:this.handleChange,disabled:this.props.disabled||this.props.setByEnv}),this.props.trueText),g.a.createElement("label",{className:"radio-inline"},g.a.createElement("input",{type:"radio",value:"false",id:N.h(this.props.id)+"false",name:this.props.id,checked:!this.props.value,onChange:this.handleChange,disabled:this.props.disabled||this.props.setByEnv}),this.props.falseText))}}])&&ae(n.prototype,a),r&&ae(n,r),t}();se(le,"propTypes",{id:b.a.string.isRequired,label:b.a.node.isRequired,value:b.a.bool.isRequired,onChange:b.a.func.isRequired,trueText:b.a.node,falseText:b.a.node,disabled:b.a.bool.isRequired,setByEnv:b.a.bool.isRequired,disabledText:b.a.node,helpText:b.a.node.isRequired}),se(le,"defaultProps",{trueText:g.a.createElement(E.c,{id:"admin.true",defaultMessage:"true"}),falseText:g.a.createElement(E.c,{id:"admin.false",defaultMessage:"false"}),disabled:!1});var ce=n(1870);function ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function me(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var de=function(e){var t=e.setByEnv,n=e.disabled,a=me(e,["setByEnv","disabled"]);return g.a.createElement(ce.a,Object.assign({},a,{labelClassName:"col-sm-4",inputClassName:"col-sm-8",disabled:n||t,footer:t?g.a.createElement(z,null):null}))};de.propTypes=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){ue(e,t,n[t])})}return e}({},ce.a.propTypes,{setByEnv:b.a.bool.isRequired});var pe=de;function fe(e){return(fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function be(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ge(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ye(e,t){return(ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _e=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=he(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==fe(r)&&"function"!=typeof r?ge(a):r,ve(ge(n),"handleChange",function(e){n.props.onChange(n.props.id,e.target.value)}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ye(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){var e=[],t=!0,n=!1,a=void 0;try{for(var r,i=this.props.values[Symbol.iterator]();!(t=(r=i.next()).done);t=!0){var o=r.value,s=o.value,l=o.text;e.push(g.a.createElement("option",{value:s,key:s},l))}}catch(e){n=!0,a=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw a}}return g.a.createElement(te,{label:this.props.label,inputId:this.props.id,helpText:this.props.helpText,setByEnv:this.props.setByEnv},g.a.createElement("select",{className:"form-control",id:this.props.id,value:this.props.value,onChange:this.handleChange,disabled:this.props.disabled||this.props.setByEnv},e))}}])&&be(n.prototype,a),r&&be(n,r),t}();ve(_e,"propTypes",{id:b.a.string.isRequired,values:b.a.array.isRequired,label:b.a.node.isRequired,value:b.a.string.isRequired,onChange:b.a.func.isRequired,disabled:b.a.bool,setByEnv:b.a.bool.isRequired,helpText:b.a.node}),ve(_e,"defaultProps",{isDisabled:!1});n(422);var Ee=n(1735),Se=n(1501);function Oe(e){return(Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Te(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function we(e){return(we=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function je(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xe(e,t){return(xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ke=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=we(t).call(this,e),n=!r||"object"!==Oe(r)&&"function"!=typeof r?je(a):r,Pe(je(n),"calculateValue",function(){return n.props.selected.reduce(function(e,t){var a=n.props.values.find(function(e){return e.value===t});return null!==a&&e.push(a),e},[])}),Pe(je(n),"getOptionLabel",function(e){return e.text}),n.handleChange=n.handleChange.bind(je(n)),n.state={error:!1},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xe(e,t)}(t,g.a.Component),n=t,(a=[{key:"handleChange",value:function(e){var t=e.map(function(e){return e.value});this.props.selected.length>0&&this.props.mustBePresent&&-1===t.join(",").indexOf(this.props.mustBePresent)?this.setState({error:this.props.notPresent}):(this.props.onChange(this.props.id,t),this.setState({error:!1}))}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.selected.length>0&&e.mustBePresent&&-1===e.selected.join(",").indexOf(e.mustBePresent)?this.setState({error:this.props.notPresent}):this.setState({error:!1})}},{key:"render",value:function(){return g.a.createElement(te,{label:this.props.label,inputId:this.props.id,helpText:this.props.helpText,setByEnv:this.props.setByEnv},g.a.createElement(Ee.a,{id:this.props.id,isMulti:!0,getOptionLabel:this.getOptionLabel,options:this.props.values,delimiter:",",clearable:!1,disabled:this.props.disabled||this.props.setByEnv,noResultsText:this.props.noResultText,onChange:this.handleChange,value:this.calculateValue()}),g.a.createElement(Se.a,{error:this.state.error}))}}])&&Te(n.prototype,a),r&&Te(n,r),t}();function Ce(e){return(Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Me(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ae(e,t){return(Ae=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function De(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Pe(ke,"propTypes",{id:b.a.string.isRequired,values:b.a.array.isRequired,label:b.a.node.isRequired,selected:b.a.array.isRequired,mustBePresent:b.a.string,onChange:b.a.func.isRequired,disabled:b.a.bool,setByEnv:b.a.bool.isRequired,helpText:b.a.node,noResultText:b.a.node,errorText:b.a.node,notPresent:b.a.node}),Pe(ke,"defaultProps",{disabled:!1});var Le=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=Re(t).call(this,e))||"object"!==Ce(r)&&"function"!=typeof r?Ne(a):r).handleChange=n.handleChange.bind(Ne(n)),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ae(e,t)}(t,g.a.Component),n=t,(a=[{key:"handleChange",value:function(e){this.props.onChange(this.props.id,e.target.value)}},{key:"render",value:function(){var e=[],t=!0,n=!1,a=void 0;try{for(var r,i=this.props.values[Symbol.iterator]();!(t=(r=i.next()).done);t=!0){var o=r.value,s=o.value,l=o.text;e.push(g.a.createElement("div",{className:"radio",key:s},g.a.createElement("label",null,g.a.createElement("input",{type:"radio",value:s,name:this.props.id,checked:s===this.props.value,onChange:this.handleChange,disabled:this.props.disabled||this.props.setByEnv}),l)))}}catch(e){n=!0,a=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw a}}return g.a.createElement(te,{label:this.props.label,inputId:this.props.id,helpText:this.props.helpText,setByEnv:this.props.setByEnv},e)}}])&&Me(n.prototype,a),r&&Me(n,r),t}();De(Le,"propTypes",{id:b.a.string.isRequired,values:b.a.array.isRequired,label:b.a.node.isRequired,value:b.a.string.isRequired,onChange:b.a.func.isRequired,disabled:b.a.bool,setByEnv:b.a.bool.isRequired,helpText:b.a.node}),De(Le,"defaultProps",{disabled:!1});var Ie=n(1798);function Ue(e){return(Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qe(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Be(e){return(Be=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ge(e,t){return(Ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ye=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Be(t).call(this,e),n=!r||"object"!==Ue(r)&&"function"!=typeof r?Fe(a):r,He(Fe(n),"handleChange",function(e){n.props.onChange(n.props.id,e.hex)}),He(Fe(n),"togglePicker",function(){n.props.disabled?n.setState({showPicker:!1}):n.setState({showPicker:!n.state.showPicker})}),He(Fe(n),"closePicker",function(e){e.target.closest("."+n.getPickerClass())||n.setState({showPicker:!1})}),He(Fe(n),"onTextInput",function(e){n.props.onChange(n.props.id,e.target.value)}),He(Fe(n),"getPickerClass",function(){return n.props.id?"picker-"+n.props.id.replace(".","-"):""}),n.state={showPicker:!1},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ge(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){document.addEventListener("click",this.closePicker)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.closePicker)}},{key:"render",value:function(){var e;return this.state.showPicker&&(e=g.a.createElement("div",{className:"color-picker__popover "+this.getPickerClass()},g.a.createElement(Ie.ChromePicker,{color:this.props.value,onChange:this.handleChange}))),g.a.createElement(te,{label:this.props.label,helpText:this.props.helpText,inputId:this.props.id},g.a.createElement("div",{className:"input-group color-picker colorpicker-element"},g.a.createElement("input",{type:"text",className:"form-control",value:this.props.value,onChange:this.onTextInput,disabled:this.props.disabled}),g.a.createElement("span",{className:"input-group-addon "+this.getPickerClass(),onClick:this.togglePicker},g.a.createElement("i",{style:{backgroundColor:this.props.value}})),e))}}])&&qe(n.prototype,a),r&&qe(n,r),t}();He(Ye,"propTypes",{id:b.a.string.isRequired,label:b.a.node.isRequired,helpText:b.a.node,value:b.a.string.isRequired,onChange:b.a.func,disabled:b.a.bool});var We=n(1832),ze=n.n(We);function Ve(e){return(Ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xe(e){return(Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Je(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ke(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Qe(e,t,n){return t&&Ke(e.prototype,t),n&&Ke(e,n),e}function Ze(e,t){return(Ze=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $e=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=Xe(t).call(this,e))||"object"!==Ve(r)&&"function"!=typeof r?Je(a):r).regenerate=n.regenerate.bind(Je(n)),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ze(e,t)}(t,g.a.Component),Qe(t,null,[{key:"propTypes",get:function(){return{id:b.a.string.isRequired,label:b.a.node.isRequired,placeholder:b.a.string,value:b.a.string.isRequired,onChange:b.a.func.isRequired,disabled:b.a.bool.isRequired,setByEnv:b.a.bool.isRequired,disabledText:b.a.node,helpText:b.a.node.isRequired,regenerateText:b.a.node,regenerateHelpText:b.a.node}}},{key:"defaultProps",get:function(){return{disabled:!1,regenerateText:g.a.createElement(E.c,{id:"admin.regenerate",defaultMessage:"Regenerate"})}}}]),Qe(t,[{key:"regenerate",value:function(e){e.preventDefault(),this.props.onChange(this.props.id,ze.a.randomBytes(256).toString("base64").substring(0,32))}},{key:"render",value:function(){var e=null;this.props.disabled&&this.props.disabledText&&(e=g.a.createElement("div",{className:"admin-console__disabled-text"},this.props.disabledText));var t=null;this.props.regenerateHelpText&&(t=g.a.createElement("div",{className:"help-text"},this.props.regenerateHelpText));var n=this.props.value;return n||(n=g.a.createElement("span",{className:"placeholder-text"},this.props.placeholder)),g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label col-sm-4",htmlFor:this.props.id},this.props.label),g.a.createElement("div",{className:"col-sm-8"},g.a.createElement("div",{className:"form-control disabled",id:this.props.id},n),e,g.a.createElement("div",{className:"help-text"},this.props.helpText),g.a.createElement("div",{className:"help-text"},g.a.createElement("button",{className:"btn btn-default",onClick:this.regenerate,disabled:this.props.disabled||this.props.setByEnv},this.props.regenerateText)),t,this.props.setByEnv?g.a.createElement(z,null):null))}}]),t}(),et=n(1676),tt=n(1561),nt=n(1562);function at(e){return(at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rt(e){return(rt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function it(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ot(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function st(e,t,n){return t&&ot(e.prototype,t),n&&ot(e,n),e}function lt(e,t){return(lt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ct(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ut=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=rt(t).call(this,e),n=!r||"object"!==at(r)&&"function"!=typeof r?it(a):r,ct(it(n),"handleChange",function(e){n.props.onChange(n.props.id,e.target.value)}),ct(it(n),"handleUserSelected",function(e){n.props.onChange(n.props.id,e.username)}),n.userSuggestionProviders=[new et.a],n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&lt(e,t)}(t,g.a.Component),st(t,null,[{key:"propTypes",get:function(){return{id:b.a.string.isRequired,label:b.a.node.isRequired,placeholder:b.a.string,helpText:b.a.node,value:b.a.string,onChange:b.a.func,disabled:b.a.bool}}}]),st(t,[{key:"render",value:function(){return g.a.createElement(te,{label:this.props.label,helpText:this.props.helpText,inputId:this.props.id},g.a.createElement("div",{className:"admin-setting-user__dropdown"},g.a.createElement(tt.a,{id:"admin_user_setting_"+this.props.id,className:"form-control",placeholder:this.props.placeholder,value:this.props.value,onChange:this.handleChange,onItemSelected:this.handleUserSelected,listComponent:nt.a,listStyle:"bottom",providers:this.userSuggestionProviders,disabled:this.props.disabled,requiredCharacters:0,openOnFocus:!0})))}}]),t}();function mt(e){return(mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dt(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function pt(e,t){return!t||"object"!==mt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ft(e){return(ft=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function bt(e,t){return(bt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ht=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),pt(this,ft(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bt(e,t)}(t,g.a.Component),n=t,r=[{key:"propTypes",get:function(){return{show:b.a.bool.isRequired,header:b.a.node,children:b.a.node,container:b.a.bool}}},{key:"defaultProps",get:function(){return{show:!0,container:!0}}}],(a=[{key:"render",value:function(){var e="",t="";if(!this.props.show)return null;this.props.container&&(e="admin-console__wrapper",t="admin-console__content");var n=null;return this.props.header&&(n=g.a.createElement("h4",null,this.props.header)),g.a.createElement("div",{className:e},g.a.createElement("div",{className:t},n,this.props.children))}}])&&dt(n.prototype,a),r&&dt(n,r),t}(),gt=n(2337),yt=n(2338);function vt(e){return(vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _t(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Et(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){_t(i,a,r,o,s,"next",e)}function s(e){_t(i,a,r,o,s,"throw",e)}o(void 0)})}}function St(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ot(e){return(Ot=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Tt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wt(e,t){return(wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xt=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Ot(t).call(this,e),n=!r||"object"!==vt(r)&&"function"!=typeof r?Tt(a):r,jt(Tt(n),"getStatus",function(e){var t=n.props.intl.formatMessage;return e.status===w.o.PENDING?g.a.createElement("span",{className:"status-icon-warning",title:t({id:"admin.jobTable.jobId",defaultMessage:"Job ID: "})+e.id},g.a.createElement(E.c,{id:"admin.jobTable.statusPending",defaultMessage:"Pending"})):e.status===w.o.IN_PROGRESS?g.a.createElement("span",{className:"status-icon-warning",title:t({id:"admin.jobTable.jobId",defaultMessage:"Job ID: "})+e.id},g.a.createElement(E.c,{id:"admin.jobTable.statusInProgress",defaultMessage:"In Progress"})):e.status===w.o.SUCCESS?g.a.createElement("span",{className:"status-icon-success",title:t({id:"admin.jobTable.jobId",defaultMessage:"Job ID: "})+e.id},g.a.createElement(E.c,{id:"admin.jobTable.statusSuccess",defaultMessage:"Success"})):e.status===w.o.ERROR?g.a.createElement("span",{className:"status-icon-error",title:t({id:"admin.jobTable.jobId",defaultMessage:"Job ID: "})+e.id},g.a.createElement(E.c,{id:"admin.jobTable.statusError",defaultMessage:"Error"})):e.status===w.o.CANCEL_REQUESTED?g.a.createElement("span",{className:"status-icon-warning",title:t({id:"admin.jobTable.jobId",defaultMessage:"Job ID: "})+e.id},g.a.createElement(E.c,{id:"admin.jobTable.statusCanceling",defaultMessage:"Canceling..."})):e.status===w.o.CANCELED?g.a.createElement("span",{className:"status-icon-error",title:t({id:"admin.jobTable.jobId",defaultMessage:"Job ID: "})+e.id},g.a.createElement(E.c,{id:"admin.jobTable.statusCanceled",defaultMessage:"Canceled"})):g.a.createElement("span",{title:t({id:"admin.jobTable.jobId",defaultMessage:"Job ID: "})+e.id},e.status)}),jt(Tt(n),"getExtraInfoText",function(e){return e.data&&e.data.error&&e.data.error.length>0?g.a.createElement("span",{title:e.data.error},e.data.error):n.props.getExtraInfoText?n.props.getExtraInfoText(e):g.a.createElement("span",null)}),jt(Tt(n),"getRunLength",function(e){var t=e.last_activity_at-e.start_at;if(e.status===w.o.IN_PROGRESS){var a=Date.now()-e.start_at;a>t&&(t=a)}var r=N.ab("admin.jobTable.lastActivityAt","Last Activity: ")+"--";e.last_activity_at>0&&(r=N.ab("admin.jobTable.lastActivityAt","Last Activity: ")+n.props.intl.formatDate(new Date(e.last_activity_at),{year:"numeric",month:"short",day:"2-digit"})+" - "+n.props.intl.formatTime(new Date(e.last_activity_at),{hour:"2-digit",minute:"2-digit",second:"2-digit"}));var i=Math.round(t/1e3),o=Math.round(t/6e4);return t<=0||e.status===w.o.CANCELED?g.a.createElement("span",{className:"whitespace--nowrap"},"--"):i<=120?g.a.createElement("span",{className:"whitespace--nowrap",title:r},i+N.ab("admin.jobTable.runLengthSeconds"," seconds")):g.a.createElement("span",{className:"whitespace--nowrap",title:r},o+N.ab("admin.jobTable.runLengthMinutes"," minutes"))}),jt(Tt(n),"getFinishAt",function(e,t){if(0===t||e===w.o.PENDING||e===w.o.IN_PROGRESS||e===w.o.CANCEL_REQUESTED)return g.a.createElement("span",{className:"whitespace--nowrap"},"--");var n=new Date(t);return g.a.createElement("span",{className:"whitespace--nowrap"},g.a.createElement(E.a,{value:n,day:"2-digit",month:"short",year:"numeric"})," - ",g.a.createElement(E.d,{value:n,hour:"2-digit",minute:"2-digit"}))}),jt(Tt(n),"reload",function(){n.setState({loading:!0}),n.props.actions.getJobsByType(n.props.jobType).then(function(){n.setState({loading:!1})})}),jt(Tt(n),"handleCancelJob",function(){var e=Et(regeneratorRuntime.mark(function e(t){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),a=t.currentTarget.getAttribute("data-job-id"),e.next=4,n.props.actions.cancelJob(a);case 4:n.reload();case 5:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),jt(Tt(n),"handleCreateJob",function(){var e=Et(regeneratorRuntime.mark(function e(t){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),a={type:n.props.jobType},e.next=4,n.props.actions.createJob(a);case 4:n.reload();case 5:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),jt(Tt(n),"getCancelButton",function(e){var t=n.props.intl.formatMessage,a=null;return n.props.disabled||e.status!==w.o.PENDING&&e.status!==w.o.IN_PROGRESS||(a=g.a.createElement("span",{"data-job-id":e.id,onClick:n.handleCancelJob,className:"job-table__cancel-button",title:t({id:"admin.jobTable.cancelButton",defaultMessage:"Cancel"})},"×")),a}),n.interval=null,n.state={loading:!0},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wt(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"UNSAFE_componentWillMount",value:function(){this.interval=setInterval(this.reload,15e3)}},{key:"componentDidMount",value:function(){var e=this;this.props.actions.getJobsByType(this.props.jobType).then(function(){return e.setState({loading:!1})})}},{key:"componentWillUnmount",value:function(){this.interval&&clearInterval(this.interval)}},{key:"render",value:function(){var e=this,t=this.props.jobs.map(function(t){return g.a.createElement("tr",{key:t.id},g.a.createElement("td",{width:"30px",className:"whitespace--nowrap text-center"},e.getCancelButton(t)),g.a.createElement("td",{className:"whitespace--nowrap"},e.getStatus(t)),g.a.createElement("td",{className:"whitespace--nowrap"},e.getFinishAt(t.status,t.last_activity_at)),g.a.createElement("td",{className:"whitespace--nowrap"},e.getRunLength(t)),g.a.createElement("td",null,e.getExtraInfoText(t)))});return g.a.createElement("div",{className:"job-table__panel"},g.a.createElement("div",{className:"job-table__create-button"},g.a.createElement("div",null,g.a.createElement("button",{className:"btn btn-default",onClick:this.handleCreateJob,disabled:this.props.disabled},this.props.createJobButtonText)),g.a.createElement("div",{className:"help-text"},this.props.createJobHelpText)),g.a.createElement("div",{className:"job-table__table"},g.a.createElement("table",{className:"table"},g.a.createElement("thead",null,g.a.createElement("tr",null,g.a.createElement("th",{width:"30px"}),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.jobTable.headerStatus",defaultMessage:"Status"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.jobTable.headerFinishAt",defaultMessage:"Finish Time"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.jobTable.headerRunTime",defaultMessage:"Run Time"})),g.a.createElement("th",{colSpan:"3"},g.a.createElement(E.c,{id:"admin.jobTable.headerExtraInfo",defaultMessage:"Details"})))),g.a.createElement("tbody",null,t))))}}])&&St(n.prototype,a),r&&St(n,r),t}();jt(xt,"propTypes",{intl:E.i.isRequired,jobs:b.a.arrayOf(b.a.object).isRequired,getExtraInfoText:b.a.func,disabled:b.a.bool,createJobHelpText:b.a.element.isRequired,createJobButtonText:b.a.element.isRequired,jobType:b.a.string.isRequired,actions:b.a.shape({getJobsByType:b.a.func.isRequired,cancelJob:b.a.func.isRequired,createJob:b.a.func.isRequired}).isRequired});var Pt=Object(E.h)(xt);var kt=Object(a.connect)(function(e,t){return{jobs:yt.makeGetJobsByType(t.jobType)(e)}},function(e){return{actions:Object(r.bindActionCreators)({getJobsByType:gt.getJobsByType,createJob:gt.createJob,cancelJob:gt.cancelJob},e)}})(Pt),Ct=n(183),Mt=n.n(Ct);function Rt(e){return(Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nt(e){return(Nt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function At(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dt(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Lt(e,t,n){return t&&Dt(e.prototype,t),n&&Dt(e,n),e}function It(e,t){return(It=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qt=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Nt(t).call(this,e),n=!r||"object"!==Rt(r)&&"function"!=typeof r?At(a):r,Ut(At(n),"handleChange",function(){var e=n.refs.fileInput.files;e&&e.length>0&&n.setState({fileSelected:!0,fileName:e[0].name})}),Ut(At(n),"handleSubmit",function(e){e.preventDefault(),Mt()(n.refs.upload_button).button("loading"),n.props.onSubmit(n.props.id,n.refs.fileInput.files[0],function(e){Mt()(n.refs.upload_button).button("reset"),e&&N.d(n.refs.fileInput)})}),n.state={fileName:null,serverError:e.error},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&It(e,t)}(t,te),Lt(t,null,[{key:"propTypes",get:function(){return{id:b.a.string.isRequired,label:b.a.node.isRequired,helpText:b.a.node,uploadingText:b.a.node,onSubmit:b.a.func.isRequired,disabled:b.a.bool,fileType:b.a.string.isRequired,error:b.a.string}}}]),Lt(t,[{key:"render",value:function(){var e;this.state.serverError&&(e=g.a.createElement("div",{className:"form-group has-error"},g.a.createElement("label",{className:"control-label"},this.state.serverError)));var t,n="btn";return this.state.fileSelected&&(n="btn btn-primary"),t=this.state.fileName?this.state.fileName:g.a.createElement(E.c,{id:"admin.file_upload.noFile",defaultMessage:"No file uploaded"}),g.a.createElement(te,{label:this.props.label,helpText:this.props.helpText,inputId:this.props.id},g.a.createElement("div",null,g.a.createElement("div",{className:"file__upload"},g.a.createElement("button",{className:"btn btn-default",disabled:this.props.disabled},g.a.createElement(E.c,{id:"admin.file_upload.chooseFile",defaultMessage:"Choose File"})),g.a.createElement("input",{ref:"fileInput",type:"file",disabled:this.props.disabled,accept:this.props.fileType,onChange:this.handleChange})),g.a.createElement("button",{className:n,disabled:!this.state.fileSelected,onClick:this.handleSubmit,ref:"upload_button","data-loading-text":"<span class='glyphicon glyphicon-refresh glyphicon-refresh-animate'></span> ".concat(this.props.uploadingText)},g.a.createElement(E.c,{id:"admin.file_upload.uploadFile",defaultMessage:"Upload"})),g.a.createElement("div",{className:"help-text no-margin"},t),e))}}]),t}();function Bt(e){return(Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ft(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Gt(e){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ht(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yt(e,t){return(Yt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Wt=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=Gt(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Bt(r)&&"function"!=typeof r?Ht(a):r,function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Ht(n),"handleRemove",function(e){e.preventDefault(),Mt()(n.refs.remove_button).button("loading"),n.props.onSubmit(n.props.id,function(){Mt()(n.refs.remove_button).button("reset")})}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Yt(e,t)}(t,te),n=t,r=[{key:"propTypes",get:function(){return{id:b.a.string.isRequired,label:b.a.node.isRequired,helpText:b.a.node,removeButtonText:b.a.node.isRequired,removingText:b.a.node,fileName:b.a.string.isRequired,onSubmit:b.a.func.isRequired,disabled:b.a.bool}}}],(a=[{key:"render",value:function(){return g.a.createElement(te,{label:this.props.label,helpText:this.props.helpText,inputId:this.props.id},g.a.createElement("div",null,g.a.createElement("div",{className:"help-text remove-filename"},this.props.fileName),g.a.createElement("button",{className:"btn btn-danger",onClick:this.handleRemove,ref:"remove_button",disabled:this.props.disabled,"data-loading-text":"<span class='glyphicon glyphicon-refresh glyphicon-refresh-animate'></span> ".concat(this.props.removingText)},this.props.removeButtonText)))}}])&&Ft(n.prototype,a),r&&Ft(n,r),t}(),zt=n(131),Vt=n.n(zt),Xt=n(1491);function Jt(e){return(Jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kt(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Qt(e){return(Qt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Zt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $t(e,t){return($t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function en(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tn=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=Qt(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Jt(r)&&"function"!=typeof r?Zt(a):r,en(Zt(n),"renderTranslated",function(){var e=n.props,t=e.isMarkdown,a=e.text,r=e.textDefault,i=e.textValues;return"object"===Jt(a)?a:t?g.a.createElement(Xt.b,{id:a,defaultMessage:r,values:i}):g.a.createElement(E.c,{id:a,values:i,defaultMessage:r})}),en(Zt(n),"renderUntranslated",function(){if(n.props.isMarkdown){var e=Vt()(n.props.text,{breaks:!0,sanitize:!0,renderer:new Xt.a});return g.a.createElement("span",{dangerouslySetInnerHTML:{__html:e}})}return g.a.createElement("span",null,n.props.text)}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$t(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){return this.props.isTranslated?this.renderTranslated():this.renderUntranslated()}}])&&Kt(n.prototype,a),r&&Kt(n,r),t}();en(tn,"propTypes",{isMarkdown:b.a.bool,isTranslated:b.a.bool,text:b.a.oneOfType([b.a.string,b.a.object]).isRequired,textDefault:b.a.string,textValues:b.a.object}),en(tn,"defaultProps",{isTranslated:!0});var nn=n(1521);function an(e){return(an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rn(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function on(e,t){return!t||"object"!==an(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function sn(e){return(sn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ln(e,t){return(ln=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var cn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),on(this,sn(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ln(e,t)}(t,g.a.Component),n=t,r=[{key:"propTypes",get:function(){return{children:b.a.node.isRequired}}}],(a=[{key:"render",value:function(){return g.a.createElement("div",{className:"admin-console__header"},this.props.children)}}])&&rn(n.prototype,a),r&&rn(n,r),t}(),un=function(e){return g.a.createElement(cn,null,g.a.createElement(Xt.b,{id:e.id,defaultMessage:e.defaultMessage,values:e.values}))};un.propTypes={id:b.a.string.isRequired,defaultMessage:b.a.string.isRequired,values:b.a.object},un.defaultProps={values:{}};var mn=un;function dn(e){return(dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){_n(e,t,n[t])})}return e}function fn(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function bn(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){fn(i,a,r,o,s,"next",e)}function s(e){fn(i,a,r,o,s,"throw",e)}o(void 0)})}}function hn(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function gn(e){return(gn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vn(e,t){return(vn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var En=function(e){function t(e){var n,a,r,i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,i=gn(t).call(this,e),a=!i||"object"!==dn(i)&&"function"!=typeof i?yn(r):i,_n(yn(a),"handleSubmit",function(){var e=bn(regeneratorRuntime.mark(function e(n){var r,i,o,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n.preventDefault(),a.setState({saving:!0,serverError:null}),"both"!==a.state.saveNeeded&&"permissions"!==a.state.saveNeeded){e.next=11;break}return r=a.props.schema&&a.props.schema.settings||[],i=r.reduce(function(e,t){return t.type===w.Q.SettingsTypes.TYPE_PERMISSION&&(e[t.permissions_mapping_name]=a.state[t.key].toString()),e},{}),o=M(i,a.props.roles),s=!0,e.next=9,Promise.all(Object.values(o).map(function(){var e=bn(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a.props.editRole(t);case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),s=!1,a.setState({saving:!1,serverError:e.t0.message});case 9:case"end":return e.stop()}},e,null,[[0,5]])}));return function(t){return e.apply(this,arguments)}}()));case 9:if(s){e.next=11;break}return e.abrupt("return");case 11:"both"===a.state.saveNeeded||"config"===a.state.saveNeeded?a.doSubmit(null,t.getStateFromConfig):(a.setState({saving:!1,saveNeeded:!1,serverError:null}),a.props.setNavigationBlocked(!1));case 12:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),_n(yn(a),"renderTitle",function(){return a.props.schema?!1===a.props.schema.translate?g.a.createElement(cn,null,a.props.schema.name||a.props.schema.id):g.a.createElement(mn,{id:a.props.schema.name||a.props.schema.id,defaultMessage:a.props.schema.name_default||a.props.schema.id}):""}),_n(yn(a),"renderBanner",function(e){return a.props.schema?!1===a.props.schema.translate?g.a.createElement("span",null,e.label):"string"==typeof e.label?e.label_markdown?g.a.createElement(Xt.b,{id:e.label,values:e.label_values,defaultMessage:e.label_default}):g.a.createElement(E.c,{id:e.label,defaultMessage:e.label_default,values:e.label_values}):e.label:g.a.createElement("span",null,"")}),_n(yn(a),"renderHelpText",function(e){return a.props.schema?e.help_text?(e.disabled_help_text&&a.isDisabled(e)?(t=e.disabled_help_text,n=e.disabled_help_text_markdown,r=e.disabled_help_text_values,i=e.disabled_help_text_default):(t=e.help_text,n=e.help_text_markdown,r=e.help_text_values,i=e.help_text_default),g.a.createElement(tn,{isMarkdown:n,isTranslated:a.props.schema.translate,text:t,textDefault:i,textValues:r})):null:g.a.createElement("span",null,"");var t,n,r,i}),_n(yn(a),"renderLabel",function(e){return a.props.schema?!1===a.props.schema.translate?e.label:N.ab(e.label,e.label_default):""}),_n(yn(a),"isDisabled",function(e){return"function"==typeof e.isDisabled?e.isDisabled(a.props.config,a.state,a.props.license):Boolean(e.isDisabled)}),_n(yn(a),"isHidden",function(e){return"function"==typeof e.isHidden?e.isHidden(a.props.config,a.state,a.props.license):Boolean(e.isHidden)}),_n(yn(a),"buildButtonSetting",function(e){return g.a.createElement(Y,{key:a.props.schema.id+"_text_"+e.key,requestAction:e.action,helpText:a.renderHelpText(e),loadingText:N.ab(e.loading,e.loading_default),buttonText:g.a.createElement("span",null,a.renderLabel(e)),showSuccessMessage:Boolean(e.success_message),includeDetailedError:!0,errorMessage:{id:e.error_message,defaultMessage:e.error_message_default},successMessage:e.success_message&&{id:e.success_message,defaultMessage:e.success_message_default}})}),_n(yn(a),"buildTextSetting",function(e){var t="input";e.type===w.Q.SettingsTypes.TYPE_NUMBER?t="number":e.type===w.Q.SettingsTypes.TYPE_LONG_TEXT&&(t="textarea");var n=a.state[e.key]||"";return e.dynamic_value&&(n=e.dynamic_value(n,a.props.config,a.state,a.props.license)),g.a.createElement(pe,{key:a.props.schema.id+"_text_"+e.key,id:e.key,type:t,label:a.renderLabel(e),helpText:a.renderHelpText(e),placeholder:N.ab(e.placeholder,e.placeholder_default),value:n,disabled:a.isDisabled(e),setByEnv:a.isSetByEnv(e.key),onChange:a.handleChange,maxLength:e.max_length})}),_n(yn(a),"buildColorSetting",function(e){return g.a.createElement(Ye,{key:a.props.schema.id+"_text_"+e.key,id:e.key,label:a.renderLabel(e),helpText:a.renderHelpText(e),placeholder:N.ab(e.placeholder,e.placeholder_default),value:a.state[e.key]||"",disabled:a.isDisabled(e),onChange:a.handleChange})}),_n(yn(a),"buildBoolSetting",function(e){return g.a.createElement(le,{key:a.props.schema.id+"_bool_"+e.key,id:e.key,label:a.renderLabel(e),helpText:a.renderHelpText(e),value:!a.isDisabled(e)&&a.state[e.key]||!1,disabled:a.isDisabled(e),setByEnv:a.isSetByEnv(e.key),onChange:a.handleChange})}),_n(yn(a),"buildPermissionSetting",function(e){return g.a.createElement(le,{key:a.props.schema.id+"_bool_"+e.key,id:e.key,label:a.renderLabel(e),helpText:a.renderHelpText(e),value:!a.isDisabled(e)&&a.state[e.key]||!1,disabled:a.isDisabled(e),setByEnv:a.isSetByEnv(e.key),onChange:a.handlePermissionChange})}),_n(yn(a),"buildDropdownSetting",function(e){var t="true"===a.props.config.BuildEnterpriseReady,n=[];e.options.forEach(function(e){e.isHidden&&e.isHidden(a.props.config,a.state,a.props.license,t)||n.push(e)});for(var r=n.map(function(e){return{value:e.value,text:N.ab(e.display_name)}}),i=a.state[e.key]||r[0].value,o=null,s=0,l=n;s<l.length;s++){var c=l[s];if(c.help_text&&c.value===i){o=c;break}}return g.a.createElement(_e,{key:a.props.schema.id+"_dropdown_"+e.key,id:e.key,values:r,label:a.renderLabel(e),helpText:a.renderHelpText(o||e),value:i,disabled:a.isDisabled(e),setByEnv:a.isSetByEnv(e.key),onChange:a.handleChange})}),_n(yn(a),"buildLanguageSetting",function(e){var t=T.b(),n=Object.keys(t).map(function(e){return{value:t[e].value,text:t[e].name,order:t[e].order}}).sort(function(e,t){return e.order-t.order});if(e.multiple){var r=g.a.createElement(E.c,{id:e.no_result,defaultMessage:e.no_result_default}),i=g.a.createElement(E.c,{id:e.not_present,defaultMessage:e.not_present_default});return g.a.createElement(ke,{key:a.props.schema.id+"_language_"+e.key,id:e.key,label:a.renderLabel(e),values:n,helpText:a.renderHelpText(e),selected:a.state[e.key]&&a.state[e.key].split(",")||[],disabled:a.isDisabled(e),setByEnv:a.isSetByEnv(e.key),onChange:function(e,t){return a.handleChange(e,t.join(","))},noResultText:r,notPresent:i})}return g.a.createElement(_e,{key:a.props.schema.id+"_language_"+e.key,id:e.key,label:a.renderLabel(e),values:n,helpText:a.renderHelpText(e),value:a.state[e.key]||n[0].value,disabled:a.isDisabled(e),setByEnv:a.isSetByEnv(e.key),onChange:a.handleChange})}),_n(yn(a),"buildRadioSetting",function(e){var t=(e.options||[]).map(function(e){return{value:e.value,text:e.display_name}});return g.a.createElement(Le,{key:a.props.schema.id+"_radio_"+e.key,id:e.key,values:t,label:a.renderLabel(e),helpText:a.renderHelpText(e),value:a.state[e.key]||t[0],disabled:a.isDisabled(e),setByEnv:a.isSetByEnv(e.key),onChange:a.handleChange})}),_n(yn(a),"buildBannerSetting",function(e){return a.isDisabled(e)?null:g.a.createElement("div",{className:"banner "+e.banner_type,key:a.props.schema.id+"_bool_"+e.key},g.a.createElement("div",{className:"banner__content"},g.a.createElement("span",null,a.renderBanner(e))))}),_n(yn(a),"buildGeneratedSetting",function(e){return g.a.createElement($e,{key:a.props.schema.id+"_generated_"+e.key,id:e.key,label:a.renderLabel(e),helpText:a.renderHelpText(e),regenerateHelpText:e.regenerate_help_text,placeholder:N.ab(e.placeholder,e.placeholder_default),value:a.state[e.key]||"",disabled:a.isDisabled(e),setByEnv:a.isSetByEnv(e.key),onChange:a.handleGeneratedChange})}),_n(yn(a),"handleGeneratedChange",function(e,t){a.handleChange(e,t.replace("+","-").replace("/","_"))}),_n(yn(a),"handleChange",function(e,t){var n="config";"permissions"===a.state.saveNeeded&&(n="both"),a.setState(_n({saveNeeded:n},e,t)),a.props.setNavigationBlocked(!0)}),_n(yn(a),"handlePermissionChange",function(e,t){var n="permissions";"config"===a.state.saveNeeded&&(n="both"),a.setState(_n({saveNeeded:n},e,t)),a.props.setNavigationBlocked(!0)}),_n(yn(a),"buildUsernameSetting",function(e){return g.a.createElement(ut,{key:a.props.schema.id+"_userautocomplete_"+e.key,id:e.key,label:a.renderLabel(e),helpText:a.renderHelpText(e),placeholder:N.ab(e.placeholder,e.placeholder_default)||N.ab("search_bar.search","Search"),value:a.state[e.key]||"",disabled:a.isDisabled(e),onChange:a.handleChange})}),_n(yn(a),"buildJobsTableSetting",function(e){return g.a.createElement(kt,{key:a.props.schema.id+"_userautocomplete_"+e.key,jobType:e.job_type,getExtraInfoText:e.render_job,disabled:a.isDisabled(e),createJobButtonText:g.a.createElement(E.c,{id:e.label,defaultMessage:e.label_default}),createJobHelpText:g.a.createElement(Xt.b,{id:e.help_text,defaultMessage:e.help_text_default})})}),_n(yn(a),"buildFileUploadSetting",function(e){if(a.state[e.key]){return g.a.createElement(Wt,{id:a.props.schema.id,key:a.props.schema.id+"_fileupload_"+e.key,label:a.renderLabel(e),helpText:g.a.createElement(E.c,{id:e.remove_help_text,defaultMessage:e.remove_help_text_default}),removeButtonText:N.ab(e.remove_button_text,e.remove_button_text_default),removingText:N.ab(e.removing_text,e.removing_text_default),fileName:a.state[e.key],onSubmit:function(t,n){e.remove_action(function(){var t;a.handleChange(e.key,""),a.setState((_n(t={},e.key,null),_n(t,"".concat(e.key,"Error"),null),t))},function(t){var r;n(),a.setState((_n(r={},e.key,null),_n(r,"".concat(e.key,"Error"),t.message),r))})},disabled:a.isDisabled(e),setByEnv:a.isSetByEnv(e.key)})}return g.a.createElement(qt,{id:e.key,key:a.props.schema.id+"_fileupload_"+e.key,label:a.renderLabel(e),helpText:a.renderHelpText(e),uploadingText:N.ab(e.uploading_text,e.uploading_text_default),disabled:a.isDisabled(e),fileType:e.fileType,onSubmit:function(t,n,r){e.upload_action(n,function(n){var i;a.handleChange(t,n),a.setState((_n(i={},e.key,n),_n(i,"".concat(e.key,"Error"),null),i)),r&&"function"==typeof r&&r()},function(e){r&&"function"==typeof r&&r(e.message)})},error:a.state.idpCertificateFileError,setByEnv:a.isSetByEnv(e.key)})}),_n(yn(a),"buildCustomSetting",function(e){var t=e.component;return g.a.createElement(t,{key:a.props.schema.id+"_userautocomplete_"+e.key,id:e.key,value:a.state[e.key]||"",disabled:a.isDisabled(e),setByEnv:a.isSetByEnv(e.key),onChange:a.handleChange})}),_n(yn(a),"renderSettings",function(){var e=a.props.schema;if(!e)return g.a.createElement(W.a,null);var t,n,r=[];return e.settings&&e.settings.forEach(function(e){if(a.buildSettingFunctions[e.type]&&!a.isHidden(e)){var t=e;a.isPlugin&&(t=pn({},e,{key:e.key.toLowerCase()})),r.push(a.buildSettingFunctions[e.type](t))}}),e.header&&(t=g.a.createElement("div",{className:"banner"},g.a.createElement(tn,{text:e.header,isMarkdown:!0}))),e.footer&&(n=g.a.createElement("div",{className:"banner"},g.a.createElement(tn,{text:e.footer,isMarkdown:!0}))),g.a.createElement(ht,{container:!1},t,r,n)}),_n(yn(a),"closeTooltip",function(){a.setState({errorTooltip:!1})}),_n(yn(a),"openTooltip",function(e){var t=e.currentTarget.querySelector(".control-label"),n=t.offsetWidth<t.scrollWidth;a.setState({errorTooltip:n})}),_n(yn(a),"doSubmit",function(e,t){a.setState({saving:!0,serverError:null});var n=JSON.parse(JSON.stringify(a.props.config));n=a.getConfigFromState(n),Object(d.B)(n,function(r){a.setState(t(r)),a.setState({saveNeeded:!1,saving:!1}),a.props.setNavigationBlocked(!1),e&&e(),a.handleSaved&&a.handleSaved(n)},function(t){a.setState({saving:!1,serverError:t.message,serverErrorId:t.id}),e&&e(),a.handleSaved&&a.handleSaved(n)})}),_n(yn(a),"isSetByEnv",function(e){return Boolean(t.getConfigValue(a.props.environmentConfig,e))}),_n(yn(a),"hybridSchemaAndComponent",function(){var e=a.props.schema;if(e&&e.component&&e.settings){var t=e.component;return g.a.createElement(t,a.props)}return null}),_n(yn(a),"render",function(){var e=a.props.schema;if(e&&e.component&&!e.settings){var t=e.component;return g.a.createElement(t,a.props)}return g.a.createElement("div",{className:"wrapper--fixed "+a.state.customComponentWrapperClass},a.renderTitle(),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement("form",{className:"form-horizontal",role:"form",onSubmit:a.handleSubmit},a.renderSettings()),a.hybridSchemaAndComponent())),g.a.createElement("div",{className:"admin-console-save"},g.a.createElement(nn.a,{saving:a.state.saving,disabled:!a.state.saveNeeded||a.canSave&&!a.canSave(),onClick:a.handleSubmit,savingMessage:N.ab("admin.saving","Saving Config...")}),g.a.createElement("div",{className:"error-message",ref:"errorMessage",onMouseOver:a.openTooltip,onMouseOut:a.closeTooltip},g.a.createElement(Se.a,{error:a.state.serverError})),g.a.createElement(S.a,{show:a.state.errorTooltip,delayShow:w.Q.OVERLAY_TIME_DELAY,placement:"top",target:a.refs.errorMessage},g.a.createElement(O.a,{id:"error-tooltip"},a.state.serverError))))}),a.isPlugin=!1,a.buildSettingFunctions=(_n(n={},w.Q.SettingsTypes.TYPE_TEXT,a.buildTextSetting),_n(n,w.Q.SettingsTypes.TYPE_LONG_TEXT,a.buildTextSetting),_n(n,w.Q.SettingsTypes.TYPE_NUMBER,a.buildTextSetting),_n(n,w.Q.SettingsTypes.TYPE_COLOR,a.buildColorSetting),_n(n,w.Q.SettingsTypes.TYPE_BOOL,a.buildBoolSetting),_n(n,w.Q.SettingsTypes.TYPE_PERMISSION,a.buildPermissionSetting),_n(n,w.Q.SettingsTypes.TYPE_DROPDOWN,a.buildDropdownSetting),_n(n,w.Q.SettingsTypes.TYPE_RADIO,a.buildRadioSetting),_n(n,w.Q.SettingsTypes.TYPE_BANNER,a.buildBannerSetting),_n(n,w.Q.SettingsTypes.TYPE_GENERATED,a.buildGeneratedSetting),_n(n,w.Q.SettingsTypes.TYPE_USERNAME,a.buildUsernameSetting),_n(n,w.Q.SettingsTypes.TYPE_BUTTON,a.buildButtonSetting),_n(n,w.Q.SettingsTypes.TYPE_LANGUAGE,a.buildLanguageSetting),_n(n,w.Q.SettingsTypes.TYPE_JOBSTABLE,a.buildJobsTableSetting),_n(n,w.Q.SettingsTypes.TYPE_FILE_UPLOAD,a.buildFileUploadSetting),_n(n,w.Q.SettingsTypes.TYPE_CUSTOM,a.buildCustomSetting),n),a.state={saveNeeded:!1,saving:!1,serverError:null,errorTooltip:!1,customComponentWrapperClass:""},a}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vn(e,t)}(t,g.a.Component),n=t,r=[{key:"getDerivedStateFromProps",value:function(e,n){return e.schema&&e.schema.id!==n.prevSchemaId?pn({prevSchemaId:e.schema.id,saveNeeded:!1,saving:!1,serverError:null,errorTooltip:!1},t.getStateFromConfig(e.config,e.schema,e.roles)):null}},{key:"getStateFromConfig",value:function(e,n,a){var r={};n&&((n.settings||[]).forEach(function(n){if(n.key)if(n.type!==w.Q.SettingsTypes.TYPE_PERMISSION){var i=t.getConfigValue(e,n.key);n.onConfigLoad&&(i=n.onConfigLoad(i,e)),r[n.key]=null==i?n.default:i}else try{r[n.key]="true"===function(e,t){var n=!0,a=!1,r=void 0;try{for(var i,o=R(C[e],t)[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){var s=i.value;if(s.allConditionsAreMet)return s.value}}catch(e){a=!0,r=e}finally{try{n||null==o.return||o.return()}finally{if(a)throw r}}throw new Error("No matching mapping value found for key '".concat(e,"' with the given roles."))}(n.permissions_mapping_name,a)}catch(e){r[n.key]=!1}}),n.onConfigLoad&&(r=pn({},r,n.onConfigLoad(e))));return r}},{key:"getConfigValue",value:function(e,t){return t.split(".").reduce(function(e,t){return e?e[t]:null},e)}}],(a=[{key:"getConfigFromState",value:function(e){var n=this,a=this.props.schema;if(a&&((a.settings||[]).forEach(function(a){if(a.key)if(a.type!==w.Q.SettingsTypes.TYPE_PERMISSION){var r=n.getSettingValue(a),i=t.getConfigValue(e,a.key);a.onConfigSave&&(r=a.onConfigSave(r,i)),n.setConfigValue(e,a.key,r)}else n.setConfigValue(e,a.key,null)}),a.onConfigSave))return a.onConfigSave(e,this.props.config);return e}},{key:"getSetting",value:function(e){var t=!0,n=!1,a=void 0;try{for(var r,i=this.props.schema.settings[Symbol.iterator]();!(t=(r=i.next()).done);t=!0){var o=r.value;if(o.key===e)return o}}catch(e){n=!0,a=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw a}}return null}},{key:"getSettingValue",value:function(e){return(e.type!==w.Q.SettingsTypes.TYPE_BOOL||!this.isDisabled(e))&&(e.type===w.Q.SettingsTypes.TYPE_TEXT&&e.dynamic_value?e.dynamic_value(this.state[e.key],this.props.config,this.state,this.props.license):this.state[e.key])}},{key:"setConfigValue",value:function(e,t,n){!function e(t,a){var r=a[0];1===a.length?t[r]=n:(null==t[r]&&(t[r]={}),e(t[r],a.slice(1)))}(e,t.split("."))}}])&&hn(n.prototype,a),r&&hn(n,r),t}();_n(En,"propTypes",{config:b.a.object,environmentConfig:b.a.object,setNavigationBlocked:b.a.func,schema:b.a.object,roles:b.a.object,license:b.a.object,editRole:b.a.func});var Sn=n(1498);function On(e){return(On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tn(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function wn(e,t){return!t||"object"!==On(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function jn(e){return(jn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function xn(e,t){return(xn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Pn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),wn(this,jn(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xn(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){var e=g.a.createElement(E.c,{id:"discard_changes_modal.title",defaultMessage:"Discard Changes?"}),t=g.a.createElement(E.c,{id:"discard_changes_modal.message",defaultMessage:"You have unsaved changes, are you sure you want to discard them?"}),n=g.a.createElement(E.c,{id:"discard_changes_modal.leave",defaultMessage:"Yes, Discard"}),a=this.props,r=a.show,i=a.onConfirm,o=a.onCancel;return g.a.createElement(Sn.a,{show:r,title:e,message:t,modalClass:"discard-changes-modal",confirmButtonClass:"btn btn-primary",confirmButtonText:n,onConfirm:i,onCancel:o})}}])&&Tn(n.prototype,a),r&&Tn(n,r),t}();!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Pn,"propTypes",{show:b.a.bool.isRequired,onConfirm:b.a.func.isRequired,onCancel:b.a.func.isRequired});n(304);var kn=n(1763),Cn=n(2339),Mn=n.n(Cn),Rn=n(307),Nn=n(419),An=n.n(Nn),Dn=n(1865),Ln=n.n(Dn);function In(e){return(In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Un(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function qn(e){return(qn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Bn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fn(e,t){return(Fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hn=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=qn(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==In(r)&&"function"!=typeof r?Bn(a):r,Gn(Bn(n),"chart",null),Gn(Bn(n),"initChart",function(e){if(n.refs.canvas){var t=An.a.findDOMNode(n.refs.canvas).getContext("2d"),a=JSON.parse(JSON.stringify(n.props.data));n.chart=new Ln.a(t,{type:"doughnut",data:a,options:{}}),e&&n.chart.update()}}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fn(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){this.initChart()}},{key:"componentDidUpdate",value:function(e){N.c(e.data,this.props.data)||this.initChart(!0)}},{key:"componentWillUnmount",value:function(){this.chart&&this.refs.canvas&&this.chart.destroy()}},{key:"render",value:function(){var e;return e=null==this.props.data?g.a.createElement(E.c,{id:"analytics.chart.loading",defaultMessage:"Loading..."}):g.a.createElement("canvas",{ref:"canvas",width:this.props.width,height:this.props.height}),g.a.createElement("div",{className:"col-sm-6"},g.a.createElement("div",{className:"total-count"},g.a.createElement("div",{className:"title"},this.props.title),g.a.createElement("div",{className:"content"},e)))}}])&&Un(n.prototype,a),r&&Un(n,r),t}();function Yn(e){return(Yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wn(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function zn(e){return(zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xn(e,t){return(Xn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Gn(Hn,"propTypes",{title:b.a.node,width:b.a.number,height:b.a.number,data:b.a.object});var Kn=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=zn(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Yn(r)&&"function"!=typeof r?Vn(a):r,Jn(Vn(n),"chart",null),Jn(Vn(n),"chartOptions",{legend:{display:!1}}),Jn(Vn(n),"initChart",function(e){if(n.refs.canvas){var t=An.a.findDOMNode(n.refs.canvas).getContext("2d"),a=JSON.parse(JSON.stringify(n.props.data));n.chart=new Ln.a(t,{type:"line",data:a,options:n.chartOptions||{}}),e&&n.chart.update()}}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xn(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){this.initChart()}},{key:"UNSAFE_componentWillUpdate",value:function(e){var t=e.data&&e.data.labels.length>0,n=Boolean(this.chart);!t&&n&&(this.chart.destroy(),this.chart=null)}},{key:"componentDidUpdate",value:function(e){if(!N.c(e.data,this.props.data)){var t=this.props.data&&this.props.data.labels.length>0,n=Boolean(this.chart);t&&this.initChart(n)}}},{key:"componentWillUnmount",value:function(){this.chart&&this.chart.destroy()}},{key:"render",value:function(){var e;return e=null==this.props.data?g.a.createElement(E.c,{id:"analytics.chart.loading",defaultMessage:"Loading..."}):0===this.props.data.labels.length?g.a.createElement("h5",null,g.a.createElement(E.c,{id:"analytics.chart.meaningful",defaultMessage:"Not enough data for a meaningful representation."})):g.a.createElement("canvas",{ref:"canvas",width:this.props.width,height:this.props.height}),g.a.createElement("div",{className:"col-sm-12"},g.a.createElement("div",{className:"total-count by-day"},g.a.createElement("div",{className:"title"},this.props.title),g.a.createElement("div",{className:"content"},e)))}}])&&Wn(n.prototype,a),r&&Wn(n,r),t}();function Qn(e){return(Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zn(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function $n(e,t){return!t||"object"!==Qn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ea(e){return(ea=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ta(e,t){return(ta=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Jn(Kn,"propTypes",{title:b.a.node.isRequired,width:b.a.number.isRequired,height:b.a.number.isRequired,data:b.a.object});var na=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$n(this,ea(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ta(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){var e=g.a.createElement(E.c,{id:"analytics.chart.loading",defaultMessage:"Loading..."});return g.a.createElement("div",{className:"col-lg-3 col-md-4 col-sm-6"},g.a.createElement("div",{className:"total-count"},g.a.createElement("div",{className:"title"},this.props.title,g.a.createElement("i",{className:"fa "+this.props.icon})),g.a.createElement("div",{className:"content"},isNaN(this.props.count)?e:this.props.count)))}}])&&Zn(n.prototype,a),r&&Zn(n,r),t}();function aa(e){var t={labels:[],datasets:[{fillColor:"rgba(151,187,205,0.2)",borderColor:"rgba(151,187,205,1)",pointBackgroundColor:"rgba(151,187,205,1)",pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:"rgba(151,187,205,1)",data:[]}]};for(var n in e)if(e[n]){var a=e[n];t.labels.push(a.name),t.datasets[0].data.push(a.value)}return t}function ra(e){var t={labels:[],datasets:[{label:"",fillColor:"rgba(151,187,205,0.2)",borderColor:"rgba(151,187,205,1)",pointBackgroundColor:"rgba(151,187,205,1)",pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:"rgba(151,187,205,1)",data:[]}]};for(var n in e)if(e[n]){var a=e[n];t.labels.push(a.name),t.datasets[0].data.push(a.value)}return t}function ia(e){return(ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oa(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function sa(e,t){return!t||"object"!==ia(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function la(e){return(la=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ca(e,t){return(ca=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(na,"propTypes",{title:b.a.node.isRequired,icon:b.a.string.isRequired,count:b.a.number});var ua=w.Q.StatTypes,ma=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),sa(this,la(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ca(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){d.q(),d.p(),d.m(),d.r(),this.props.isLicensed&&d.l()}},{key:"render",value:function(){var e,t,n,a,r,i,o,s,l,c,u,m,d,p,f,b,h=this.props.stats,y=this.props.isLicensed,v=-1===h[ua.TOTAL_POSTS],_=aa(h[ua.POST_PER_DAY]),S=aa(h[ua.BOT_POST_PER_DAY]),O=ra(h[ua.USERS_WITH_POSTS_PER_DAY]);if(v?e=g.a.createElement("div",{className:"banner"},g.a.createElement("div",{className:"banner__content"},g.a.createElement(Xt.b,{id:"analytics.system.skippedIntensiveQueries",defaultMessage:"To maximize performance, some statistics are disabled. You can [re-enable them in config.json](!https://docs.mattermost.com/administration/statistics.html)."}))):(t=g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.totalPosts",defaultMessage:"Total Posts"}),icon:"fa-comment",count:h[ua.TOTAL_POSTS]}),a=g.a.createElement("div",{className:"row"},g.a.createElement(Kn,{title:g.a.createElement(E.c,{id:"analytics.system.totalBotPosts",defaultMessage:"Total Posts from Bots"}),data:S,width:740,height:225})),n=g.a.createElement("div",{className:"row"},g.a.createElement(Kn,{title:g.a.createElement(E.c,{id:"analytics.system.totalPosts",defaultMessage:"Total Posts"}),data:_,width:740,height:225})),r=g.a.createElement("div",{className:"row"},g.a.createElement(Kn,{title:g.a.createElement(E.c,{id:"analytics.system.activeUsers",defaultMessage:"Active Users With Posts"}),data:O,width:740,height:225}))),this.props.isLicensed){s=g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.totalSessions",defaultMessage:"Total Sessions"}),icon:"fa-signal",count:h[ua.TOTAL_SESSIONS]}),l=g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.totalCommands",defaultMessage:"Total Commands"}),icon:"fa-terminal",count:h[ua.TOTAL_COMMANDS]}),c=g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.totalIncomingWebhooks",defaultMessage:"Incoming Webhooks"}),icon:"fa-arrow-down",count:h[ua.TOTAL_IHOOKS]}),u=g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.totalOutgoingWebhooks",defaultMessage:"Outgoing Webhooks"}),icon:"fa-arrow-up",count:h[ua.TOTAL_OHOOKS]}),i=g.a.createElement("div",null,g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.totalWebsockets",defaultMessage:"WebSocket Conns"}),icon:"fa-user",count:h[ua.TOTAL_WEBSOCKET_CONNECTIONS]}),g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.totalMasterDbConnections",defaultMessage:"Master DB Conns"}),icon:"fa-terminal",count:h[ua.TOTAL_MASTER_DB_CONNECTIONS]}),g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.totalReadDbConnections",defaultMessage:"Replica DB Conns"}),icon:"fa-terminal",count:h[ua.TOTAL_READ_DB_CONNECTIONS]}));var T,w=(f=h[ua.TOTAL_PUBLIC_CHANNELS],b=h[ua.TOTAL_PRIVATE_GROUPS],{labels:[N.ab("analytics.system.publicChannels","Public Channels"),N.ab("analytics.system.privateGroups","Private Channels")],datasets:[{data:[f,b],backgroundColor:["#46BFBD","#FDB45C"],hoverBackgroundColor:["#5AD3D1","#FFC870"]}]}),j=(m=h[ua.TOTAL_FILE_POSTS],d=h[ua.TOTAL_HASHTAG_POSTS],p=h[ua.TOTAL_POSTS],{labels:[N.ab("analytics.system.totalFilePosts","Posts with Files"),N.ab("analytics.system.totalHashtagPosts","Posts with Hashtags"),N.ab("analytics.system.textPosts","Posts with Text-only")],datasets:[{data:[m,d,p-m-d],backgroundColor:["#46BFBD","#F7464A","#FDB45C"],hoverBackgroundColor:["#5AD3D1","#FF5A5E","#FFC870"]}]});-1!==h[ua.TOTAL_POSTS]&&(T=g.a.createElement(Hn,{title:g.a.createElement(E.c,{id:"analytics.system.postTypes",defaultMessage:"Posts, Files and Hashtags"}),data:j,width:300,height:225})),o=g.a.createElement("div",{className:"row"},g.a.createElement(Hn,{title:g.a.createElement(E.c,{id:"analytics.system.channelTypes",defaultMessage:"Channel Types"}),data:w,width:300,height:225}),T)}var x,P,k=g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.totalUsers",defaultMessage:"Total Active Users"}),icon:"fa-user",count:h[ua.TOTAL_USERS]}),C=g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.totalTeams",defaultMessage:"Total Teams"}),icon:"fa-users",count:h[ua.TOTAL_TEAMS]}),M=g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.totalChannels",defaultMessage:"Total Channels"}),icon:"fa-globe",count:h[ua.TOTAL_PUBLIC_CHANNELS]+h[ua.TOTAL_PRIVATE_GROUPS]}),R=g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.dailyActiveUsers",defaultMessage:"Daily Active Users"}),icon:"fa-users",count:h[ua.DAILY_ACTIVE_USERS]}),A=g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.system.monthlyActiveUsers",defaultMessage:"Monthly Active Users"}),icon:"fa-users",count:h[ua.MONTHLY_ACTIVE_USERS]});y&&v?(x=g.a.createElement("div",null,k,C,M,s),P=g.a.createElement("div",null,l,c,u)):y&&!v?(x=g.a.createElement("div",null,k,C,M,t),P=g.a.createElement("div",null,s,l,c,u)):y||(x=g.a.createElement("div",null,k,C,M,t));var D=g.a.createElement("div",null,R,A);return g.a.createElement("div",{className:"wrapper--fixed team_statistics"},g.a.createElement(mn,{id:"analytics.system.title",defaultMessage:"System Statistics"}),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},e,g.a.createElement("div",{className:"row"},x,P,D,i),o,n,a,r)))}}])&&oa(n.prototype,a),r&&oa(n,r),t}();!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(ma,"propTypes",{isLicensed:b.a.bool.isRequired,stats:b.a.object});var da=Object(a.connect)(function(e){return{isLicensed:"true"===Object(c.getLicense)(e).IsLicensed,stats:e.entities.admin.analytics}})(ma),pa=n(308),fa=n(40),ba=n(31),ha=n(1622),ga=n(310);function ya(e){var t=g.a.createElement(E.c,{id:"admin.banner.heading",defaultMessage:"Note:"});return e.title&&(t=e.title),g.a.createElement("div",{className:"banner"},g.a.createElement("div",{className:"banner__content"},g.a.createElement("h4",{className:"banner__heading"},t),g.a.createElement("p",null,e.description)))}function va(e){return(va="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _a(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ea(e,t){return!t||"object"!==va(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Sa(e){return(Sa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Oa(e,t){return(Oa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}ya.defaultProps={},ya.propTypes={title:b.a.node,description:b.a.node.isRequired};var Ta=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ea(this,Sa(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Oa(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){return g.a.createElement("div",{className:"col-sm-6"},g.a.createElement("div",{className:"total-count recent-active-users"},g.a.createElement("div",{className:"title"},this.props.title),g.a.createElement("div",{className:"content"},g.a.createElement("table",null,g.a.createElement("tbody",null,this.props.data.map(function(e){var t=g.a.createElement(O.a,{id:"tip-table-entry-"+e.name},e.tip);return g.a.createElement("tr",{key:"table-entry-"+e.name},g.a.createElement("td",null,g.a.createElement(kn.a,{delayShow:w.Q.OVERLAY_TIME_DELAY,placement:"top",overlay:t},g.a.createElement("time",null,e.name))),g.a.createElement("td",null,e.value))}))))))}}])&&_a(n.prototype,a),r&&_a(n,r),t}();function wa(e){return(wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ja(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function xa(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Pa(e){return(Pa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ka(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ca(e,t){return(Ca=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ma(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Ta,"propTypes",{title:b.a.node.isRequired,data:b.a.arrayOf(b.a.shape({name:b.a.string.isRequired,tip:b.a.string.isRequired,value:b.a.node.isRequired})).isRequired});var Ra="last_analytics_team",Na=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Pa(t).call(this,e),n=!r||"object"!==wa(r)&&"function"!=typeof r?ka(a):r,Ma(ka(n),"getData",function(){var e,t=(e=regeneratorRuntime.mark(function e(t){var a,r,i,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return d.q(t),d.p(t),d.m(t),d.r(t),e.next=6,n.props.actions.getProfilesInTeam(t,0,j.General.PROFILE_CHUNK_SIZE,"last_activity_at");case 6:return a=e.sent,r=a.data,e.next=10,n.props.actions.getProfilesInTeam(t,0,j.General.PROFILE_CHUNK_SIZE,"create_at");case 10:i=e.sent,o=i.data,n.setState({recentlyActiveUsers:r,newUsers:o});case 13:case"end":return e.stop()}},e)}),function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){ja(i,a,r,o,s,"next",e)}function s(e){ja(i,a,r,o,s,"throw",e)}o(void 0)})});return function(e){return t.apply(this,arguments)}}()),Ma(ka(n),"handleTeamChange",function(e){var t,a=e.target.value;n.props.teams.forEach(function(e){e.id===a&&(t=e)}),n.setState({team:t}),ha.a.setGlobalItem(Ra,a)}),n.state={team:e.initialTeam,recentlyActiveUsers:[],newUsers:[]},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ca(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidMount",value:function(){this.state.team&&this.getData(this.state.team.id),this.props.actions.getTeams(0,1e3)}},{key:"UNSAFE_componentWillUpdate",value:function(e,t){t.team&&t.team!==this.state.team&&this.getData(t.team.id)}},{key:"render",value:function(){if(0===this.props.teams.length||!this.state.team||!this.props.stats[this.state.team.id])return g.a.createElement(W.a,null);if(null==this.state.team)return g.a.createElement(ya,{description:g.a.createElement(E.c,{id:"analytics.team.noTeams",defaultMessage:"There are no teams on this server for which to view statistics."})});var e,t,n,a=this.props.stats[this.state.team.id],r=aa(a[w.F.POST_PER_DAY]),i=ra(a[w.F.USERS_WITH_POSTS_PER_DAY]),o=g.a.createElement("div",{className:"banner"},g.a.createElement("div",{className:"banner__content"},g.a.createElement(E.c,{id:"analytics.system.info",defaultMessage:"Only data for the chosen team is calculated. Excludes posts made in direct message channels, which are not tied to a team."})));-1===a[w.F.TOTAL_POSTS]?o=g.a.createElement("div",{className:"banner"},g.a.createElement("div",{className:"banner__content"},g.a.createElement(Xt.b,{id:"analytics.system.infoAndSkippedIntensiveQueries",defaultMessage:"Only data for the chosen team is calculated. Excludes posts made in direct message channels, which are not tied to a team. \\n \\n Some statistics have been omitted because they put too much load on the system to calculate. See [https://docs.mattermost.com/administration/statistics.html](!https://docs.mattermost.com/administration/statistics.html) for more details."}))):(e=g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.team.totalPosts",defaultMessage:"Total Posts"}),icon:"fa-comment",count:a[w.F.TOTAL_POSTS]}),t=g.a.createElement("div",{className:"row"},g.a.createElement(Kn,{key:this.state.team.id,title:g.a.createElement(E.c,{id:"analytics.team.totalPosts",defaultMessage:"Total Posts"}),data:r,width:740,height:225})),n=g.a.createElement("div",{className:"row"},g.a.createElement(Kn,{key:this.state.team.id,title:g.a.createElement(E.c,{id:"analytics.team.activeUsers",defaultMessage:"Active Users With Posts"}),data:i,width:740,height:225})));var s=function(e,t){if(null==e)return[];return e.map(function(e){var n={};return n.name=e.username,n.value=g.a.createElement(E.a,{value:e.last_activity_at,day:"numeric",month:Object(A.a)(t),year:"numeric",hour12:!0,hour:"2-digit",minute:"2-digit"}),n.tip=e.email,n})}(this.state.recentlyActiveUsers,this.props.locale),l=function(e,t){if(null==e)return[];return e.map(function(e){var n={};return n.name=e.username,n.value=g.a.createElement(E.a,{value:e.create_at,day:"numeric",month:Object(A.a)(t),year:"numeric",hour12:!0,hour:"2-digit",minute:"2-digit"}),n.tip=e.email,n})}(this.state.newUsers,this.props.locale),c=this.props.teams.sort(function(e,t){var n=e.display_name.toUpperCase(),a=t.display_name.toUpperCase();return n===a?0:n>a?1:-1}).map(function(e){return g.a.createElement("option",{key:e.id,value:e.id},e.display_name)});return g.a.createElement("div",{className:"wrapper--fixed team_statistics"},g.a.createElement("div",{className:"admin-console__header team-statistics__header-row"},g.a.createElement("div",{className:"team-statistics__header"},g.a.createElement(Xt.b,{id:"analytics.team.title",defaultMessage:"Team Statistics for {team}",values:{team:this.state.team.display_name}})),g.a.createElement("div",{className:"team-statistics__team-filter"},g.a.createElement("select",{className:"form-control team-statistics__team-filter__dropdown",onChange:this.handleTeamChange,value:this.state.team.id},c))),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},o,g.a.createElement("div",{className:"row"},g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.team.totalUsers",defaultMessage:"Total Active Users"}),icon:"fa-users",count:a[w.F.TOTAL_USERS]}),g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.team.publicChannels",defaultMessage:"Public Channels"}),icon:"fa-globe",count:a[w.F.TOTAL_PUBLIC_CHANNELS]}),g.a.createElement(na,{title:g.a.createElement(E.c,{id:"analytics.team.privateGroups",defaultMessage:"Private Channels"}),icon:"fa-lock",count:a[w.F.TOTAL_PRIVATE_GROUPS]}),e),t,n,g.a.createElement("div",{className:"row"},g.a.createElement(Ta,{title:g.a.createElement(E.c,{id:"analytics.team.recentUsers",defaultMessage:"Recent Active Users"}),data:s}),g.a.createElement(Ta,{title:g.a.createElement(E.c,{id:"analytics.team.newlyCreated",defaultMessage:"Newly Created Users"}),data:l})))))}}])&&xa(n.prototype,a),r&&xa(n,r),t}();Ma(Na,"propTypes",{teams:b.a.arrayOf(b.a.object).isRequired,initialTeam:b.a.object,locale:b.a.string.isRequired,stats:b.a.object.isRequired,actions:b.a.shape({getTeams:b.a.func.isRequired,getProfilesInTeam:b.a.func.isRequired}).isRequired});var Aa="last_analytics_team";var Da=Object(a.connect)(function(e){var t=Object(ba.getTeamsList)(e),n=ha.a.getGlobalItem(Aa,null);return{initialTeam:e.entities.teams.teams[n]||(t.length>0?t[0]:null),locale:Object(ga.a)(e),teams:t,stats:e.entities.admin.teamAnalytics}},function(e){return{actions:Object(r.bindActionCreators)({getTeams:pa.getTeams,getProfilesInTeam:fa.getProfilesInTeam},e)}})(Na),La=n(1482),Ia=n(436),Ua=n.n(Ia);function qa(e){return(qa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ba(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Fa(e){return(Fa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ga(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ha(e,t){return(Ha=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ya(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wa=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Fa(t).call(this,e),n=!r||"object"!==qa(r)&&"function"!=typeof r?Ga(a):r,Ya(Ga(n),"closeTooltip",function(){n.setState({errorTooltip:!1})}),Ya(Ga(n),"openTooltip",function(e){var t=e.currentTarget.querySelector(".control-label"),a=t.offsetWidth<t.scrollWidth;n.setState({errorTooltip:a})}),Ya(Ga(n),"handleChange",function(e,t){n.setState(Ya({saveNeeded:!0},e,t)),n.props.setNavigationBlocked(!0)}),Ya(Ga(n),"handleSubmit",function(e){e.preventDefault(),n.doSubmit()}),Ya(Ga(n),"doSubmit",function(e){n.setState({saving:!0,serverError:null});var t=JSON.parse(JSON.stringify(n.props.config));t=n.getConfigFromState(t),Object(d.B)(t,function(a){n.setState(n.getStateFromConfig(a)),n.setState({saveNeeded:!1,saving:!1}),n.props.setNavigationBlocked(!1),e&&e(),n.handleSaved&&n.handleSaved(t)},function(a){n.setState({saving:!1,serverError:a.message,serverErrorId:a.id}),e&&e(),n.handleSaved&&n.handleSaved(t)})}),Ya(Ga(n),"parseInt",function(e,t){var n=parseInt(e,10);return isNaN(n)?t||0:n}),Ya(Ga(n),"parseIntNonNegative",function(e,t){var n=parseInt(e,10);return isNaN(n)||n<0?t||0:n}),Ya(Ga(n),"parseIntNonZero",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=parseInt(e,10);return isNaN(a)||a<n?t||1:a}),Ya(Ga(n),"isSetByEnv",function(e){return Boolean(n.getConfigValue(n.props.environmentConfig,e))}),n.state=Object.assign(n.getStateFromConfig(e.config),{saveNeeded:!1,saving:!1,serverError:null,errorTooltip:!1}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ha(e,t)}(t,g.a.Component),n=t,(a=[{key:"getConfigValue",value:function(e,t){return t.split(".").reduce(function(e,t){return e?e[t]:null},e)}},{key:"setConfigValue",value:function(e,t,n){!function e(t,a){var r=a[0];1===a.length?t[r]=n:(null==t[r]&&(t[r]={}),e(t[r],a.slice(1)))}(e,t.split("."))}},{key:"render",value:function(){return g.a.createElement("form",{className:"form-horizontal",role:"form",onSubmit:this.handleSubmit},g.a.createElement("div",{className:"wrapper--fixed"},g.a.createElement(cn,null,this.renderTitle()),this.renderSettings(),g.a.createElement("div",{className:"admin-console-save"},g.a.createElement(nn.a,{saving:this.state.saving,disabled:!this.state.saveNeeded||this.canSave&&!this.canSave(),onClick:this.handleSubmit,savingMessage:Object(N.ab)("admin.saving","Saving Config...")}),g.a.createElement("div",{className:"error-message",ref:"errorMessage",onMouseOver:this.openTooltip,onMouseOut:this.closeTooltip},g.a.createElement(Se.a,{error:this.state.serverError})),g.a.createElement(S.a,{show:this.state.errorTooltip,delayShow:w.Q.OVERLAY_TIME_DELAY,placement:"top",target:this.refs.errorMessage},g.a.createElement(O.a,{id:"error-tooltip"},this.state.serverError)))))}}])&&Ba(n.prototype,a),r&&Ba(n,r),t}();function za(e){return(za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Va(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Xa(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){Va(i,a,r,o,s,"next",e)}function s(e){Va(i,a,r,o,s,"throw",e)}o(void 0)})}}function Ja(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ka(e){return(Ka=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Qa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Za(e,t){return(Za=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Ya(Wa,"propTypes",{config:b.a.object,environmentConfig:b.a.object,setNavigationBlocked:b.a.func});var er=function(e){switch(e.state){case Ua.a.PLUGIN_STATE_NOT_RUNNING:return g.a.createElement(E.c,{id:"admin.plugin.state.not_running",defaultMessage:"Not running"});case Ua.a.PLUGIN_STATE_STARTING:return g.a.createElement(E.c,{id:"admin.plugin.state.starting",defaultMessage:"Starting"});case Ua.a.PLUGIN_STATE_RUNNING:return g.a.createElement(E.c,{id:"admin.plugin.state.running",defaultMessage:"Running"});case Ua.a.PLUGIN_STATE_FAILED_TO_START:return g.a.createElement(E.c,{id:"admin.plugin.state.failed_to_start",defaultMessage:"Failed to start"});case Ua.a.PLUGIN_STATE_FAILED_TO_STAY_RUNNING:return g.a.createElement(E.c,{id:"admin.plugin.state.failed_to_stay_running",defaultMessage:"Crashing"});case Ua.a.PLUGIN_STATE_STOPPING:return g.a.createElement(E.c,{id:"admin.plugin.state.stopping",defaultMessage:"Stopping"});default:return g.a.createElement(E.c,{id:"admin.plugin.state.unknown",defaultMessage:"Unknown"})}};er.propTypes={state:b.a.number.isRequired};var tr=function(e){switch(e.state){case Ua.a.PLUGIN_STATE_NOT_RUNNING:return g.a.createElement("div",{className:"alert alert-info"},g.a.createElement("i",{className:"fa fa-ban"}),g.a.createElement(E.c,{id:"admin.plugin.state.not_running.description",defaultMessage:"This plugin is not enabled."}));case Ua.a.PLUGIN_STATE_STARTING:return g.a.createElement("div",{className:"alert alert-success"},g.a.createElement("i",{className:"fa fa-info"}),g.a.createElement(E.c,{id:"admin.plugin.state.starting.description",defaultMessage:"This plugin is starting."}));case Ua.a.PLUGIN_STATE_RUNNING:return g.a.createElement("div",{className:"alert alert-success"},g.a.createElement("i",{className:"fa fa-check"}),g.a.createElement(E.c,{id:"admin.plugin.state.running.description",defaultMessage:"This plugin is running."}));case Ua.a.PLUGIN_STATE_FAILED_TO_START:return g.a.createElement("div",{className:"alert alert-warning"},g.a.createElement("i",{className:"fa fa-warning"}),g.a.createElement(E.c,{id:"admin.plugin.state.failed_to_start.description",defaultMessage:"This plugin failed to start. Check your system logs for errors."}));case Ua.a.PLUGIN_STATE_FAILED_TO_STAY_RUNNING:return g.a.createElement("div",{className:"alert alert-warning"},g.a.createElement("i",{className:"fa fa-warning"}),g.a.createElement(E.c,{id:"admin.plugin.state.failed_to_stay_running.description",defaultMessage:"This plugin crashed multiple times and is no longer running. Check your system logs for errors."}));case Ua.a.PLUGIN_STATE_STOPPING:return g.a.createElement("div",{className:"alert alert-info"},g.a.createElement("i",{className:"fa fa-info"}),g.a.createElement(E.c,{id:"admin.plugin.state.stopping.description",defaultMessage:"This plugin is stopping."}));default:return null}};tr.propTypes={state:b.a.number.isRequired};var nr=function(e){var t,n=e.pluginStatus,a=e.removing,r=e.handleEnable,i=e.handleDisable,o=e.handleRemove,s=e.showInstances,l=e.hasSettings,c=n.state===Ua.a.PLUGIN_STATE_STARTING,u=n.state===Ua.a.PLUGIN_STATE_STOPPING;t=n.active?g.a.createElement("a",{"data-plugin-id":n.id,disabled:u,onClick:i},u?g.a.createElement(E.c,{id:"admin.plugin.disabling",defaultMessage:"Disabling..."}):g.a.createElement(E.c,{id:"admin.plugin.disable",defaultMessage:"Disable"})):g.a.createElement("a",{"data-plugin-id":n.id,disabled:c,onClick:r},c?g.a.createElement(E.c,{id:"admin.plugin.enabling",defaultMessage:"Enabling..."}):g.a.createElement(E.c,{id:"admin.plugin.enable",defaultMessage:"Enable"}));var m,d,p,f,b=null;(l&&(b=g.a.createElement("span",null," - ",g.a.createElement(La.a,{to:"/admin_console/plugins/plugin_"+n.id},g.a.createElement(E.c,{id:"admin.plugin.settingsButton",defaultMessage:"Settings"})))),n.is_prepackaged)||(d=a?g.a.createElement(E.c,{id:"admin.plugin.removing",defaultMessage:"Removing..."}):g.a.createElement(E.c,{id:"admin.plugin.remove",defaultMessage:"Remove"}),m=g.a.createElement("span",null," - ",g.a.createElement("a",{"data-plugin-id":n.id,disabled:a,onClick:o},d)));n.description&&(p=g.a.createElement("div",{className:"padding-top"},n.description)),n.is_prepackaged&&(f=g.a.createElement("span",null,", ",g.a.createElement(E.c,{id:"admin.plugin.prepackaged",defaultMessage:"pre-packaged"})));var h=[];n.instances.some(function(e){return e.version!==n.version})&&h.push(g.a.createElement("div",{key:"multiple-versions",className:"alert alert-warning"},g.a.createElement("i",{className:"fa fa-warning"}),g.a.createElement(E.c,{id:"admin.plugin.multiple_versions_warning",defaultMessage:"There are multiple versions of this plugin installed across your cluster. Re-install this plugin to ensure it works consistently."}))),h.push(g.a.createElement(tr,{key:"state-description",state:n.state}));var y,v=n.instances.slice();return v.sort(function(e,t){return e.cluster_id<t.cluster_id?-1:e.cluster_id>t.cluster_id?1:0}),s&&(y=g.a.createElement("div",{className:"padding-top x2 padding-bottom"},g.a.createElement("div",{className:"row"},g.a.createElement("div",{className:"col-md-6"},g.a.createElement("strong",null,g.a.createElement(E.c,{id:"admin.plugin.cluster_instance",defaultMessage:"Cluster Instance"}))),g.a.createElement("div",{className:"col-md-3"},g.a.createElement("strong",null,g.a.createElement(E.c,{id:"admin.plugin.version_title",defaultMessage:"Version"}))),g.a.createElement("div",{className:"col-md-3"},g.a.createElement("strong",null,g.a.createElement(E.c,{id:"admin.plugin.state",defaultMessage:"State"})))),v.map(function(e){return g.a.createElement("div",{key:e.cluster_id,className:"row"},g.a.createElement("div",{className:"col-md-6"},e.cluster_id),g.a.createElement("div",{className:"col-md-3"},e.version),g.a.createElement("div",{className:"col-md-3"},g.a.createElement(er,{state:e.state})))}))),g.a.createElement("div",null,g.a.createElement("div",null,g.a.createElement("strong",null,n.name)," (",n.id," - ",n.version,f,")"),p,g.a.createElement("div",{className:"padding-top"},t,m,b),g.a.createElement("div",null,h),g.a.createElement("div",null,y),g.a.createElement("hr",null))};nr.propTypes={pluginStatus:b.a.object.isRequired,removing:b.a.bool.isRequired,handleEnable:b.a.func.isRequired,handleDisable:b.a.func.isRequired,handleRemove:b.a.func.isRequired,showInstances:b.a.bool.isRequired,hasSettings:b.a.bool.isRequired};var ar=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Ka(t).call(this,e),n=!r||"object"!==za(r)&&"function"!=typeof r?Qa(a):r,$a(Qa(n),"handleUpload",function(){n.setState({lastMessage:null,serverError:null});var e=n.refs.fileInput;e.files.length>0&&n.setState({fileSelected:!0,file:e.files[0]})}),$a(Qa(n),"helpSubmitUpload",function(){var e=Xa(regeneratorRuntime.mark(function e(t,a){var r,i,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n.setState({uploading:!0}),e.next=3,n.props.actions.uploadPlugin(t,a);case 3:if(r=e.sent,!(i=r.error)){e.next=13;break}if("app.plugin.install_id.app_error"!==i.server_error_id||a){e.next=9;break}return n.setState({confirmOverwriteUploadModal:!0,overwritingUpload:!0}),e.abrupt("return");case 9:return n.setState({file:null,fileSelected:!1,uploading:!1}),"app.plugin.activate.app_error"===i.server_error_id?n.setState({serverError:N.ab("admin.plugin.error.activate","Unable to upload the plugin. It may conflict with another plugin on your server.")}):"app.plugin.extract.app_error"===i.server_error_id?n.setState({serverError:N.ab("admin.plugin.error.extract","Encountered an error when extracting the plugin. Review your plugin file content and try again.")}):n.setState({serverError:i.message}),n.setState({file:null,fileSelected:!1}),e.abrupt("return");case 13:return n.setState({loading:!0}),e.next=16,n.props.actions.getPlugins();case 16:o="Successfully uploaded plugin from ".concat(t.name),n.state.overwritingUpload&&(o="Successfully updated plugin from ".concat(t.name)),n.setState({file:null,fileSelected:!1,serverError:null,lastMessage:o,overwritingUpload:!1,uploading:!1,loading:!1});case 19:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()),$a(Qa(n),"handleSubmitUpload",function(e){e.preventDefault();var t=n.refs.fileInput;if(0!==t.files.length){var a=t.files[0];n.helpSubmitUpload(a,!1),N.d(t)}}),$a(Qa(n),"handleOverwriteUploadPluginCancel",function(){n.setState({file:null,fileSelected:!1,serverError:null,confirmOverwriteUploadModal:!1,lastMessage:null,uploading:!1})}),$a(Qa(n),"handleOverwriteUploadPlugin",function(){n.setState({confirmOverwriteUploadModal:!1}),n.helpSubmitUpload(n.state.file,!0)}),$a(Qa(n),"onPluginDownloadUrlChange",function(e){n.setState({pluginDownloadUrl:e.target.value})}),$a(Qa(n),"installFromUrl",function(){var e=Xa(regeneratorRuntime.mark(function e(t){var a,r,i,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.state.pluginDownloadUrl,n.setState({installing:!0,serverError:null,lastMessage:null}),e.next=4,n.props.actions.installPluginFromUrl(a,t);case 4:if(r=e.sent,!(i=r.error)){e.next=13;break}if("app.plugin.install_id.app_error"!==i.server_error_id||t){e.next=10;break}return n.setState({confirmOverwriteInstallModal:!0,overwritingInstall:!0}),e.abrupt("return");case 10:return n.setState({installing:!1}),"app.plugin.extract.app_error"===i.server_error_id?n.setState({serverError:N.ab("admin.plugin.error.extract","Encountered an error when extracting the plugin. Review your plugin file content and try again.")}):n.setState({serverError:i.message}),e.abrupt("return");case 13:return n.setState({loading:!0}),e.next=16,n.props.actions.getPlugins();case 16:o="Successfully installed plugin from ".concat(a),n.state.overwritingInstall&&(o="Successfully updated plugin from ".concat(a)),n.setState({serverError:null,lastMessage:o,overwritingInstall:!1,installing:!1,loading:!1});case 19:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),$a(Qa(n),"handleSubmitInstall",function(e){return e.preventDefault(),n.installFromUrl(!1)}),$a(Qa(n),"handleOverwriteInstallPluginCancel",function(){n.setState({confirmOverwriteInstallModal:!1,installing:!1,serverError:null,lastMessage:null})}),$a(Qa(n),"handleOverwriteInstallPlugin",function(){return n.setState({confirmOverwriteInstallModal:!1}),n.installFromUrl(!0)}),$a(Qa(n),"handleRemove",function(){var e=Xa(regeneratorRuntime.mark(function e(t){var a,r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n.setState({lastMessage:null,serverError:null}),t.preventDefault(),a=t.currentTarget.getAttribute("data-plugin-id"),n.setState({removing:a}),e.next=6,n.props.actions.removePlugin(a);case 6:r=e.sent,i=r.error,n.setState({removing:null}),i&&n.setState({serverError:i.message});case 10:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),$a(Qa(n),"handleEnable",function(){var e=Xa(regeneratorRuntime.mark(function e(t){var a,r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),n.setState({lastMessage:null,serverError:null}),a=t.currentTarget.getAttribute("data-plugin-id"),e.next=5,n.props.actions.enablePlugin(a);case 5:r=e.sent,(i=r.error)&&n.setState({serverError:i.message});case 8:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),$a(Qa(n),"handleDisable",function(){var e=Xa(regeneratorRuntime.mark(function e(t){var a,r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n.setState({lastMessage:null,serverError:null}),t.preventDefault(),a=t.currentTarget.getAttribute("data-plugin-id"),e.next=5,n.props.actions.disablePlugin(a);case 5:r=e.sent,(i=r.error)&&n.setState({serverError:i.message});case 8:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),$a(Qa(n),"renderOverwritePluginModal",function(e){var t=e.show,n=e.onConfirm,a=e.onCancel,r=g.a.createElement(E.c,{id:"admin.plugin.upload.overwrite_modal.title",defaultMessage:"Overwrite existing plugin?"}),i=g.a.createElement(E.c,{id:"admin.plugin.upload.overwrite_modal.desc",defaultMessage:"A plugin with this ID already exists. Would you like to overwrite it?"}),o=g.a.createElement(E.c,{id:"admin.plugin.upload.overwrite_modal.overwrite",defaultMessage:"Overwrite"});return g.a.createElement(Sn.a,{show:t,title:r,message:i,confirmButtonClass:"btn btn-danger",confirmButtonText:o,onConfirm:n,onCancel:a})}),$a(Qa(n),"renderEnablePluginsSetting",function(){return n.props.config.ExperimentalSettings.RestrictSystemAdmin?null:g.a.createElement(le,{id:"enable",label:g.a.createElement(E.c,{id:"admin.plugins.settings.enable",defaultMessage:"Enable Plugins: "}),helpText:g.a.createElement(Xt.b,{id:"admin.plugins.settings.enableDesc",defaultMessage:"When true, enables plugins on your Mattermost server. Use plugins to integrate with third-party systems, extend functionality, or customize the user interface of your Mattermost server. See [documentation](https://about.mattermost.com/default-plugin-uploads) to learn more."}),value:n.state.enable,onChange:n.handleChange,setByEnv:n.isSetByEnv("PluginSettings.Enable")})}),n.getConfigFromState=n.getConfigFromState.bind(Qa(n)),n.renderSettings=n.renderSettings.bind(Qa(n)),n.state=Object.assign(n.state,{loading:!0,fileSelected:!1,file:null,pluginDownloadUrl:"",serverError:null,lastMessage:null,uploading:!1,installing:!1,overwritingUpload:!1,confirmOverwriteUploadModal:!1,overwritingInstall:!1,confirmOverwriteInstallModal:!1}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Za(e,t)}(t,Wa),n=t,(a=[{key:"getConfigFromState",value:function(e){return e.PluginSettings.Enable=this.state.enable,e.PluginSettings.EnableUploads=this.state.enableUploads,e.PluginSettings.AllowInsecureDownloadUrl=this.state.allowInsecureDownloadUrl,e}},{key:"getStateFromConfig",value:function(e){return{enable:e.PluginSettings.Enable,enableUploads:e.PluginSettings.EnableUploads,allowInsecureDownloadUrl:e.PluginSettings.AllowInsecureDownloadUrl}}},{key:"componentDidMount",value:function(){var e=this;this.state.enable&&this.props.actions.getPluginStatuses().then(function(){return e.setState({loading:!1})})}},{key:"renderTitle",value:function(){return g.a.createElement(E.c,{id:"admin.plugin.management.title",defaultMessage:"Management"})}},{key:"renderSettings",value:function(){var e=this,t=this.state.enableUploads,n=this.props.config.PluginSettings.Enable,a="",r="";this.state.serverError&&(a=g.a.createElement("div",{className:"col-sm-12"},g.a.createElement("div",{className:"form-group has-error half"},g.a.createElement("label",{className:"control-label"},this.state.serverError)))),this.state.lastMessage&&(r=g.a.createElement("div",{className:"col-sm-12"},g.a.createElement("div",{className:"form-group half"},this.state.lastMessage)));var i,o,s,l,c,u="btn";this.state.fileSelected&&(u="btn btn-primary"),this.state.file&&(i=this.state.file.name),o=this.state.uploading?g.a.createElement(E.c,{id:"admin.plugin.uploading",defaultMessage:"Uploading..."}):g.a.createElement(E.c,{id:"admin.plugin.upload",defaultMessage:"Upload"});var m,d=Object.values(this.props.pluginStatuses);if(this.state.loading)s=g.a.createElement(W.a,null);else if(0===d.length)c=g.a.createElement(E.c,{id:"admin.plugin.no_plugins",defaultMessage:"No installed plugins."});else{var p=d.some(function(e){return e.instances.length>1});d.sort(function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}),s=d.map(function(t){var n=e.props.plugins[t.id],a=Boolean(n&&n.settings_schema&&(n.settings_schema.header||n.settings_schema.footer||n.settings_schema.settings&&n.settings_schema.settings.length>0));return g.a.createElement(nr,{key:t.id,pluginStatus:t,removing:e.state.removing===t.id,handleEnable:e.handleEnable,handleDisable:e.handleDisable,handleRemove:e.handleRemove,showInstances:p,hasSettings:a})}),c=g.a.createElement("div",{className:"alert alert-transparent"},s)}n&&(l=g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label col-sm-4"},g.a.createElement(E.c,{id:"admin.plugin.installedTitle",defaultMessage:"Installed Plugins: "})),g.a.createElement("div",{className:"col-sm-8"},g.a.createElement("p",{className:"help-text"},g.a.createElement(E.b,{id:"admin.plugin.installedDesc",defaultMessage:"Installed plugins on your Mattermost server. Pre-packaged plugins are installed by default, and can be disabled but not removed."})),g.a.createElement("br",null),c))),m=t&&n?g.a.createElement(Xt.b,{id:"admin.plugin.uploadDesc",defaultMessage:"Upload a plugin for your Mattermost server. See [documentation](!https://about.mattermost.com/default-plugin-uploads) to learn more."}):!0===n&&!1===t?g.a.createElement(Xt.b,{id:"admin.plugin.uploadDisabledDesc",defaultMessage:"Enable plugin uploads in config.json. See [documentation](!https://about.mattermost.com/default-plugin-uploads) to learn more."}):g.a.createElement(Xt.b,{id:"admin.plugin.uploadAndPluginDisabledDesc",defaultMessage:"To enable plugins, set **Enable Plugins** to true. See [documentation](!https://about.mattermost.com/default-plugin-uploads) to learn more."});var f=t?"btn btn-primary":"btn",b=this.state.confirmOverwriteUploadModal&&this.renderOverwritePluginModal({show:this.state.confirmOverwriteUploadModal,onConfirm:this.handleOverwriteUploadPlugin,onCancel:this.handleOverwriteUploadPluginCancel});return g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement(ht,{id:"PluginSettings",container:!1},this.renderEnablePluginsSetting(),g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label col-sm-4"},g.a.createElement(E.c,{id:"admin.plugin.uploadTitle",defaultMessage:"Upload Plugin: "})),g.a.createElement("div",{className:"col-sm-8"},g.a.createElement("div",{className:"file__upload"},g.a.createElement("button",{className:f,disabled:!t||!n},g.a.createElement(E.c,{id:"admin.plugin.choose",defaultMessage:"Choose File"})),g.a.createElement("input",{ref:"fileInput",type:"file",accept:".gz",onChange:this.handleUpload,disabled:!t||!n})),g.a.createElement("button",{className:u,disabled:!this.state.fileSelected,onClick:this.handleSubmitUpload},o),g.a.createElement("div",{className:"help-text no-margin"},i),a,r,g.a.createElement("p",{className:"help-text"},m))),l),b))}}])&&Ja(n.prototype,a),r&&Ja(n,r),t}();$a(ar,"propTypes",{config:b.a.object.isRequired,pluginStatuses:b.a.object.isRequired,plugins:b.a.object.isRequired,actions:b.a.shape({uploadPlugin:b.a.func.isRequired,removePlugin:b.a.func.isRequired,getPlugins:b.a.func.isRequired,getPluginStatuses:b.a.func.isRequired,enablePlugin:b.a.func.isRequired,disablePlugin:b.a.func.isRequired,installPluginFromUrl:b.a.func.isRequired}).isRequired});var rr=Object(a.connect)(function(e){return{plugins:e.entities.admin.plugins,pluginStatuses:e.entities.admin.pluginStatuses}},function(e){return{actions:Object(r.bindActionCreators)({uploadPlugin:i.uploadPlugin,installPluginFromUrl:i.installPluginFromUrl,removePlugin:i.removePlugin,getPlugins:i.getPlugins,getPluginStatuses:i.getPluginStatuses,enablePlugin:i.enablePlugin,disablePlugin:i.disablePlugin},e)}})(ar),ir=n(121);n(425);function or(e){return(or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lr(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function cr(e,t){return!t||"object"!==or(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ur(e){return(ur=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mr(e,t){return(mr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var dr=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=cr(this,ur(t).call(this,e))).isPlugin=!0,n.getStateFromConfig=t.getStateFromConfig,n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mr(e,t)}(t,En),n=t,r=[{key:"getDerivedStateFromProps",value:function(e,n){return e.schema&&e.schema.id!==n.prevSchemaId?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){sr(e,t,n[t])})}return e}({prevSchemaId:e.schema.id,saveNeeded:!1,saving:!1,serverError:null,errorTooltip:!1},t.getStateFromConfig(e.config,e.schema,e.roles)):null}},{key:"getStateFromConfig",value:function(e,t){var n={};if(t){var a=e.PluginSettings.Plugins[t.id]||{};(t.settings||[]).forEach(function(e){var t=e.key.toLowerCase();n[t]=null==a[t]?e.default:a[t]})}return n}}],(a=[{key:"getConfigFromState",value:function(e){var t=this,n=this.props.schema;if(n){e.PluginSettings.Plugins[n.id]||(e.PluginSettings.Plugins[n.id]={});var a=e.PluginSettings.Plugins[n.id];(n.settings||[]).forEach(function(e){var n=e.key.toLowerCase(),r=t.state[n];null==r&&null==e.default?Reflect.deleteProperty(a,n):a[n]=null==r?e.default:r})}return e}}])&&lr(n.prototype,a),r&&lr(n,r),t}();function pr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){fr(e,t,n[t])})}return e}function fr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var br=Object(a.connect)(function(){var e=Object(ir.a)(function(e,t){return e.entities.admin.plugins[t]},function(e){return e?(e.settings_schema&&e.settings_schema.settings&&(t=e.settings_schema.settings.map(function(e){return pr({},e,{help_text_markdown:!0,label:e.display_name})})),pr({},e.settings_schema,{id:e.id,name:e.name,settings:t,translate:Boolean(e.translate)})):null;var t});return function(t,n){var a=n.match.params.plugin_id;return{schema:e(t,a),roles:Object(u.getRoles)(t)}}})(dr),hr=n(420),gr=n(36);function yr(e){return(yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vr(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function _r(e,t){return!t||"object"!==yr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Er(e){return(Er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Sr(e,t){return(Sr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Or=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),_r(this,Er(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sr(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){return g.a.createElement(E.c,{id:"generic_icons.reload",defaultMessage:"Reload Icon"},function(e){return g.a.createElement("i",{className:"fa fa-refresh",title:e})})}}])&&vr(n.prototype,a),r&&vr(n,r),t}(),Tr=n(1499);function wr(e){return(wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jr(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function xr(e){return(xr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kr(e,t){return(kr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Mr=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=xr(t).call(this,e),n=!r||"object"!==wr(r)&&"function"!=typeof r?Pr(a):r,Cr(Pr(n),"reload",function(){n.setState({loadingReports:!0}),n.props.actions.getComplianceReports().then(function(){return n.setState({loadingReports:!1})})}),Cr(Pr(n),"runReport",function(e){e.preventDefault(),n.setState({runningReport:!0});var t={};t.desc=n.refs.desc.value,t.emails=n.refs.emails.value,t.keywords=n.refs.keywords.value,t.start_at=Date.parse(n.refs.from.value),t.end_at=Date.parse(n.refs.to.value),n.props.actions.createComplianceReport(t).then(function(e){e.data&&(n.refs.emails.value="",n.refs.keywords.value="",n.refs.desc.value="",n.refs.from.value="",n.refs.to.value=""),n.setState({runningReport:!1})})}),n.state={loadingReports:!0},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kr(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){var e=this;this.props.isLicensed&&this.props.enabled&&this.props.actions.getComplianceReports().then(function(){return e.setState({loadingReports:!1})})}},{key:"getDateTime",value:function(e){var t=new Date(e);return g.a.createElement("span",{style:Rr.date},g.a.createElement(E.a,{value:t,day:"2-digit",month:"short",year:"numeric"})," - ",g.a.createElement(E.d,{value:t,hour:"2-digit",minute:"2-digit"}))}},{key:"render",value:function(){if(!this.props.isLicensed||!this.props.enabled)return g.a.createElement("div",null);var e=null;if(this.state.loadingReports)e=g.a.createElement(W.a,null);else{for(var t=[],n=0;n<this.props.reports.length;n++){var a=this.props.reports[n],r="";"adhoc"===a.type&&(r=g.a.createElement("span",null,g.a.createElement(E.c,{id:"admin.compliance_reports.from",defaultMessage:"From:"})," ",this.getDateTime(a.start_at),g.a.createElement("br",null),g.a.createElement(E.c,{id:"admin.compliance_reports.to",defaultMessage:"To:"})," ",this.getDateTime(a.end_at),g.a.createElement("br",null),g.a.createElement(E.c,{id:"admin.compliance_reports.emails",defaultMessage:"Emails:"})," ",a.emails,g.a.createElement("br",null),g.a.createElement(E.c,{id:"admin.compliance_reports.keywords",defaultMessage:"Keywords:"})," ",a.keywords));var i="",o="";"finished"===a.status?(i=g.a.createElement("a",{href:"".concat(gr.Client4.getBaseRoute(),"/compliance/reports/").concat(a.id,"/download")},g.a.createElement(E.c,{id:"admin.compliance_table.download",defaultMessage:"Download"})),o=g.a.createElement("span",{style:Rr.greenStatus},a.status)):"failed"===a.status&&(o=g.a.createElement("span",{style:Rr.redStatus},a.status));var s=a.user_id,l=this.props.users[a.user_id];l&&(s=l.email),t[n]=g.a.createElement("tr",{key:a.id},g.a.createElement("td",{style:Rr.dataCell},i),g.a.createElement("td",null,this.getDateTime(a.create_at)),g.a.createElement("td",null,o),g.a.createElement("td",null,a.count),g.a.createElement("td",null,a.type),g.a.createElement("td",{style:Rr.dataCell},a.desc),g.a.createElement("td",null,s),g.a.createElement("td",{style:Rr.dataCell},r))}e=g.a.createElement("div",{style:Rr.content},g.a.createElement("table",{className:"table"},g.a.createElement("thead",null,g.a.createElement("tr",null,g.a.createElement("th",null),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.compliance_table.timestamp",defaultMessage:"Timestamp"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.compliance_table.status",defaultMessage:"Status"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.compliance_table.records",defaultMessage:"Records"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.compliance_table.type",defaultMessage:"Type"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.compliance_table.desc",defaultMessage:"Description"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.compliance_table.userId",defaultMessage:"Requested By"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.compliance_table.params",defaultMessage:"Params"})))),g.a.createElement("tbody",null,t)))}var c="";return this.props.serverError&&(c=g.a.createElement("div",{className:"form-group has-error",style:Rr.serverError},g.a.createElement("label",{className:"control-label"},this.props.serverError))),g.a.createElement("div",{className:"panel compliance-panel"},g.a.createElement("h4",null,g.a.createElement(E.c,{id:"admin.compliance_reports.title",defaultMessage:"Compliance Reports"})),g.a.createElement("div",{className:"row"},g.a.createElement("div",{className:"col-sm-6 col-md-4 form-group"},g.a.createElement("label",null,g.a.createElement(E.c,{id:"admin.compliance_reports.desc",defaultMessage:"Job Name:"})),g.a.createElement(Tr.a,{type:"text",className:"form-control",id:"desc",ref:"desc",placeholder:{id:Object(A.b)("admin.compliance_reports.desc_placeholder"),defaultMessage:'E.g. "Audit 445 for HR"'}})),g.a.createElement("div",{className:"col-sm-3 col-md-2 form-group"},g.a.createElement("label",null,g.a.createElement(E.c,{id:"admin.compliance_reports.from",defaultMessage:"From:"})),g.a.createElement(Tr.a,{type:"text",className:"form-control",id:"from",ref:"from",placeholder:{id:Object(A.b)("admin.compliance_reports.from_placeholder"),defaultMessage:'E.g. "2016-03-11"'}})),g.a.createElement("div",{className:"col-sm-3 col-md-2 form-group"},g.a.createElement("label",null,g.a.createElement(E.c,{id:"admin.compliance_reports.to",defaultMessage:"To:"})),g.a.createElement(Tr.a,{type:"text",className:"form-control",id:"to",ref:"to",placeholder:{id:Object(A.b)("admin.compliance_reports.to_placeholder"),defaultMessage:'E.g. "2016-03-15"'}}))),g.a.createElement("div",{className:"row"},g.a.createElement("div",{className:"col-sm-6 col-md-4 form-group"},g.a.createElement("label",null,g.a.createElement(E.c,{id:"admin.compliance_reports.emails",defaultMessage:"Emails:"})),g.a.createElement(Tr.a,{type:"text",className:"form-control",id:"emails",ref:"emails",placeholder:{id:Object(A.b)("admin.compliance_reports.emails_placeholder"),defaultMessage:'E.g. "bill@example.com, bob@example.com"'}})),g.a.createElement("div",{className:"col-sm-6 col-md-4 form-group"},g.a.createElement("label",null,g.a.createElement(E.c,{id:"admin.compliance_reports.keywords",defaultMessage:"Keywords:"})),g.a.createElement(Tr.a,{type:"text",className:"form-control",id:"keywords",ref:"keywords",placeholder:{id:Object(A.b)("admin.compliance_reports.keywords_placeholder"),defaultMessage:'E.g. "shorting stock"'}}))),g.a.createElement("div",{className:"clearfix"},g.a.createElement("button",{id:"run-button",type:"submit",className:"btn btn-primary",onClick:this.runReport},g.a.createElement(E.c,{id:"admin.compliance_reports.run",defaultMessage:"Run Compliance Report"}))),c,g.a.createElement("div",{className:"text-right"},g.a.createElement("button",{type:"submit",className:"btn btn-link",disabled:this.state.runningReport,onClick:this.reload},g.a.createElement(Or,null),g.a.createElement(E.c,{id:"admin.compliance_reports.reload",defaultMessage:"Reload Completed Compliance Reports"}))),g.a.createElement("div",{className:"compliance-panel__table"},e))}}])&&jr(n.prototype,a),r&&jr(n,r),t}();Cr(Mr,"propTypes",{isLicensed:b.a.bool.isRequired,enabled:b.a.bool.isRequired,reports:b.a.arrayOf(b.a.object).isRequired,users:b.a.object.isRequired,serverError:b.a.string,actions:b.a.shape({getComplianceReports:b.a.func.isRequired,createComplianceReport:b.a.func.isRequired}).isRequired});var Rr={content:{margin:10},greenStatus:{color:"green"},redStatus:{color:"red"},dataCell:{whiteSpace:"nowrap"},date:{whiteSpace:"nowrap"},serverError:{marginTop:"10px"}},Nr=Object(ir.a)(function(e){return e.entities.users.profiles},function(e){return e.entities.admin.complianceReports},function(e,t){var n={};return Object.values(t).forEach(function(t){var a=e[t.user_id];a&&(n[a.id]=a)}),n});var Ar=Object(a.connect)(function(e){var t,n="true"===Object(c.getLicense)(e).IsLicensed,a=!1,r=Object(s.getConfig)(e);r&&r.ComplianceSettings&&(a=r.ComplianceSettings.Enable);var i=e.requests.admin.createCompliance.error;return i&&(t=i.message),{isLicensed:n,enabled:a,reports:Object.values(Object(s.getComplianceReports)(e)).sort(function(e,t){return t.create_at-e.create_at}),serverError:t,users:Nr(e)}},function(e){return{actions:Object(r.bindActionCreators)({getComplianceReports:i.getComplianceReports,createComplianceReport:i.createComplianceReport},e)}})(Mr),Dr=n(1736);function Lr(e){return(Lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ir(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ur(e){return(Ur=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Br(e,t){return(Br=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Gr=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Ur(t).call(this,e),n=!r||"object"!==Lr(r)&&"function"!=typeof r?qr(a):r,Fr(qr(n),"reload",function(){n.setState({loadingAudits:!0}),n.props.actions.getAudits().then(function(){return n.setState({loadingAudits:!1})})}),Fr(qr(n),"activityLogHeader",function(){return g.a.createElement("div",{style:{clear:"both"}},g.a.createElement("h4",{style:{display:"inline-block",marginBottom:"6px"}},g.a.createElement(E.c,{id:"admin.complianceMonitoring.userActivityLogsTitle",defaultMessage:"User Activity Logs"})),g.a.createElement("button",{type:"submit",className:"btn btn-link pull-right",onClick:n.reload},g.a.createElement(Or,null),g.a.createElement(E.c,{id:"admin.audits.reload",defaultMessage:"Reload User Activity Logs"})))}),Fr(qr(n),"renderComplianceReports",function(){return n.props.isLicensed?g.a.createElement(Ar,null):g.a.createElement("div",null)}),n.state={loadingAudits:!0},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Br(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){var e=this;this.props.actions.getAudits().then(function(){return e.setState({loadingAudits:!1})})}},{key:"render",value:function(){var e=null;return e=this.state.loadingAudits?g.a.createElement(W.a,null):g.a.createElement("div",null,g.a.createElement(Dr.a,{audits:this.props.audits,showUserId:!0,showIp:!0,showSession:!0})),g.a.createElement("div",null,this.renderComplianceReports(),g.a.createElement("div",{className:"panel compliance-panel"},this.activityLogHeader(),g.a.createElement("div",{className:"compliance-panel__table"},e)))}}])&&Ir(n.prototype,a),r&&Ir(n,r),t}();Fr(Gr,"propTypes",{isLicensed:b.a.bool.isRequired,audits:b.a.arrayOf(b.a.object).isRequired,actions:b.a.shape({getAudits:b.a.func.isRequired}).isRequired});var Hr=Object(a.connect)(function(e){return{isLicensed:"true"===Object(c.getLicense)(e).Compliance,audits:Object.values(s.getAudits(e))}},function(e){return{actions:Object(r.bindActionCreators)({getAudits:i.getAudits},e)}})(Gr);function Yr(e){return(Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wr(e){return(Wr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vr(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Xr(e,t,n){return t&&Vr(e.prototype,t),n&&Vr(e,n),e}function Jr(e,t){return(Jr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qr=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Wr(t).call(this,e),n=!r||"object"!==Yr(r)&&"function"!=typeof r?zr(a):r,Kr(zr(n),"stringToArray",function(e){return e.split(",").map(function(e){return e.trim()}).filter(Boolean)}),Kr(zr(n),"arrayToString",function(e){return e.join(",")}),Kr(zr(n),"handleChange",function(e){var t=n.stringToArray(e.target.value);n.props.onChange(n.props.id,t),n.setState({value:e.target.value})}),n.state={value:n.arrayToString(e.value)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Jr(e,t)}(t,g.a.Component),Xr(t,null,[{key:"propTypes",get:function(){return{id:b.a.string.isRequired,value:b.a.array.isRequired,onChange:b.a.func.isRequired,disabled:b.a.bool,setByEnv:b.a.bool.isRequired}}}]),Xr(t,[{key:"render",value:function(){var e=N.ab("admin.customization.customUrlSchemes","Custom URL Schemes:"),t=N.ab("admin.customization.customUrlSchemesDesc",'Allows message text to link if it begins with any of the comma-separated URL schemes listed. By default, the following schemes will create links: "http", "https", "ftp", "tel", and "mailto".');return g.a.createElement(te,{label:e,helpText:t,inputId:this.props.id,setByEnv:this.props.setByEnv},g.a.createElement(Tr.a,{id:this.props.id,className:"form-control",type:"text",placeholder:{id:Object(A.b)("admin.customization.customUrlSchemesPlaceholder"),defaultMessage:'E.g.: "git,smtp"'},value:this.state.value,onChange:this.handleChange,disabled:this.props.disabled||this.props.setByEnv}))}}]),t}(),Zr=n(946);function $r(e){return($r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ei(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function ti(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){ei(i,a,r,o,s,"next",e)}function s(e){ei(i,a,r,o,s,"throw",e)}o(void 0)})}}function ni(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ai(e){return(ai=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ri(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ii(e,t){return(ii=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var si=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=ai(t).call(this,e),n=!r||"object"!==$r(r)&&"function"!=typeof r?ri(a):r,oi(ri(n),"handleChange",function(){var e=n.refs.fileInput;e&&e.files.length>0&&n.setState({fileSelected:!0,fileName:e.files[0].name})}),oi(ri(n),"handleSubmit",function(){var e=ti(regeneratorRuntime.mark(function e(t){var a,r,i,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),(a=n.refs.fileInput)&&0!==a.files.length){e.next=4;break}return e.abrupt("return");case 4:return r=a.files[0],n.setState({uploading:!0}),e.next=8,n.props.actions.uploadLicense(r);case 8:if(i=e.sent,!(o=i.error)){e.next=14;break}return N.d(a[0]),n.setState({fileSelected:!1,fileName:null,serverError:o.message,uploading:!1}),e.abrupt("return");case 14:return e.next=16,n.props.actions.getLicenseConfig();case 16:n.setState({fileSelected:!1,fileName:null,serverError:null,uploading:!1});case 17:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),oi(ri(n),"handleRemove",function(){var e=ti(regeneratorRuntime.mark(function e(t){var a,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),n.setState({removing:!0}),e.next=4,n.props.actions.removeLicense();case 4:if(a=e.sent,!(r=a.error)){e.next=9;break}return n.setState({fileSelected:!1,fileName:null,serverError:r.message,removing:!1}),e.abrupt("return");case 9:return e.next=11,n.props.actions.getLicenseConfig();case 11:n.setState({fileSelected:!1,fileName:null,serverError:null,removing:!1});case 12:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),n.state={fileSelected:!1,fileName:null,serverError:null,removing:!1,uploading:!1},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ii(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidMount",value:function(){this.props.actions.getLicenseConfig()}},{key:"render",value:function(){var e="";this.state.serverError&&(e=g.a.createElement("div",{className:"col-sm-12"},g.a.createElement("div",{className:"form-group has-error"},g.a.createElement("label",{className:"control-label"},this.state.serverError))));var t="btn";this.state.fileSelected&&(t="btn btn-primary");var n,a,r,i=this.props.license,o=this.state.uploading,s=N.l(parseInt(i.IssuedAt,10))+" "+N.n(parseInt(i.IssuedAt,10),!0),l=N.l(parseInt(i.StartsAt,10)),c=N.l(parseInt(i.ExpiresAt,10));if("true"!==i.IsLicensed||o){var u;n=g.a.createElement("p",null,"Mattermost Enterprise Edition. Unlock enterprise features in this software through the purchase of a subscription from ",g.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://mattermost.com/"},"https://mattermost.com/")),a="This software is offered under a commercial license.\n\nSee ENTERPRISE-EDITION-LICENSE.txt in your root install directory for details. See NOTICE.txt for information about open source software used in this system.",u=this.state.fileName?this.state.fileName:g.a.createElement(E.c,{id:"admin.license.noFile",defaultMessage:"No file uploaded"});var m=g.a.createElement(E.c,{id:"admin.license.upload",defaultMessage:"Upload"});o&&(m=g.a.createElement(E.c,{id:"admin.license.uploading",defaultMessage:"Uploading License..."})),r=g.a.createElement("div",{className:"col-sm-8"},g.a.createElement("div",{className:"file__upload"},g.a.createElement("button",{className:"btn btn-primary"},g.a.createElement(E.c,{id:"admin.license.choose",defaultMessage:"Choose File"})),g.a.createElement("input",{ref:"fileInput",type:"file",accept:".mattermost-license",onChange:this.handleChange})),g.a.createElement("button",{className:t,disabled:!this.state.fileSelected,onClick:this.handleSubmit,id:"upload-button"},m),g.a.createElement("div",{className:"help-text no-margin"},u),g.a.createElement("br",null),e,g.a.createElement("p",{className:"help-text no-margin"},g.a.createElement(Xt.b,{id:"admin.license.uploadDesc",defaultMessage:"Upload a license key for Mattermost Enterprise Edition to upgrade this server. [Visit us online](!http://mattermost.com) to learn more about the benefits of Enterprise Edition or to purchase a key."})))}else{var d=i.SkuShortName?g.a.createElement(g.a.Fragment,null,"Edition: Mattermost Enterprise Edition ".concat(i.SkuShortName),g.a.createElement("br",null)):null;n="Mattermost Enterprise Edition. Enterprise features on this server have been unlocked with a license key and a valid subscription.",a=g.a.createElement("div",null,g.a.createElement("p",null,"This software is offered under a commercial license.\n\nSee ENTERPRISE-EDITION-LICENSE.txt in your root install directory for details. See NOTICE.txt for information about open source software used in this system.\n\nYour subscription details are as follows:"),"Name: ".concat(i.Name),g.a.createElement("br",null),"Company or organization name: ".concat(i.Company),g.a.createElement("br",null),d,"Number of users: ".concat(i.Users),g.a.createElement("br",null),"License issued: ".concat(s),g.a.createElement("br",null),"Start date of license: ".concat(l),g.a.createElement("br",null),"Expiry date of license: ".concat(c),g.a.createElement("br",null),g.a.createElement("br",null),"See also ",g.a.createElement("a",{rel:"noopener noreferrer",target:"_blank",href:"https://about.mattermost.com/enterprise-edition-terms/"},"Enterprise Edition Terms of Service")," and ",g.a.createElement("a",{rel:"noopener noreferrer",target:"_blank",href:"https://about.mattermost.com/privacy/"},"Privacy Policy."));var p=g.a.createElement(E.c,{id:"admin.license.keyRemove",defaultMessage:"Remove Enterprise License and Downgrade Server"});this.state.removing&&(p=g.a.createElement(E.c,{id:"admin.license.removing",defaultMessage:"Removing License..."})),r=g.a.createElement("div",{className:"col-sm-8"},g.a.createElement("button",{className:"btn btn-danger",onClick:this.handleRemove,id:"remove-button"},p),g.a.createElement("br",null),g.a.createElement("br",null),g.a.createElement("p",{className:"help-text"},"If you migrate servers you may need to remove your license key to install it elsewhere. You can remove the key here, which will revert functionality to that of Team Edition."))}return g.a.createElement("div",{className:"wrapper--fixed"},g.a.createElement(mn,{id:"admin.license.title",defaultMessage:"Edition and License"}),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement("form",{className:"form-horizontal",role:"form"},g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label col-sm-4"},g.a.createElement(E.c,{id:"admin.license.edition",defaultMessage:"Edition: "})),g.a.createElement("div",{className:"col-sm-8"},n)),g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label col-sm-4"},g.a.createElement(E.c,{id:"admin.license.type",defaultMessage:"License: "})),g.a.createElement("div",{className:"col-sm-8"},a)),g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label col-sm-4"},g.a.createElement(E.c,{id:"admin.license.key",defaultMessage:"License Key: "})),r)))))}}])&&ni(n.prototype,a),r&&ni(n,r),t}();oi(si,"propTypes",{license:b.a.object.isRequired,config:b.a.object,actions:b.a.shape({getLicenseConfig:b.a.func.isRequired,uploadLicense:b.a.func.isRequired,removeLicense:b.a.func.isRequired}).isRequired});var li=Object(a.connect)(null,function(e){return{actions:Object(r.bindActionCreators)({getLicenseConfig:Zr.getLicenseConfig,uploadLicense:i.uploadLicense,removeLicense:i.removeLicense},e)}})(si),ci=n(1730),ui=n(1731),mi=function(e){return g.a.createElement("div",{className:"AdminPanel "+e.className,id:e.id},g.a.createElement("div",{className:"header",onClick:e.onHeaderClick},g.a.createElement("div",null,g.a.createElement("h3",null,g.a.createElement(E.c,{id:e.titleId,defaultMessage:e.titleDefault})),g.a.createElement("span",null,g.a.createElement(Xt.b,{id:e.subtitleId,defaultMessage:e.subtitleDefault,values:e.subtitleValues}))),e.button&&g.a.createElement("div",{className:"button"},e.button)),e.children)};mi.propTypes={children:b.a.node,className:b.a.string.isRequired,id:b.a.string,titleId:b.a.string.isRequired,titleDefault:b.a.string.isRequired,subtitleId:b.a.string.isRequired,subtitleDefault:b.a.string.isRequired,subtitleValues:b.a.object,onHeaderClick:b.a.func,button:b.a.node},mi.defaultProps={className:""};var di=mi,pi=function(e){var t=g.a.createElement(La.a,{className:"btn btn-primary",to:e.url,disabled:e.disabled},g.a.createElement(E.c,{id:e.linkTextId,defaultMessage:e.linkTextDefault}));return g.a.createElement(di,{className:"AdminPanelWithLink "+e.className,id:e.id,titleId:e.titleId,titleDefault:e.titleDefault,subtitleId:e.subtitleId,subtitleDefault:e.subtitleDefault,button:t},e.children)};pi.propTypes={children:b.a.node,className:b.a.string.isRequired,id:b.a.string,titleId:b.a.string.isRequired,titleDefault:b.a.string.isRequired,subtitleId:b.a.string.isRequired,subtitleDefault:b.a.string.isRequired,url:b.a.string.isRequired,disabled:b.a.bool,linkTextId:b.a.string.isRequired,linkTextDefault:b.a.string.isRequired},pi.defaultProps={className:""};var fi=pi;function bi(e){return(bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hi(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function gi(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){hi(i,a,r,o,s,"next",e)}function s(e){hi(i,a,r,o,s,"throw",e)}o(void 0)})}}function yi(e){return(yi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _i(e,t){return(_i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ei(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Si=8,Oi=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=yi(t).call(this,e),n=!r||"object"!==bi(r)&&"function"!=typeof r?vi(a):r,Ei(vi(n),"renderConfirmModal",function(){var e=g.a.createElement(E.c,{id:"admin.permissions.permissionsSchemeSummary.deleteSchemeTitle",defaultMessage:"Delete {scheme} scheme?",values:{scheme:n.props.scheme.display_name}}),t=null;n.state.serverError&&(t=g.a.createElement("div",{className:"permission-scheme-summary-error-message"},g.a.createElement("i",{className:"fa fa-exclamation-circle"})," ",n.state.serverError));var a=g.a.createElement("div",null,g.a.createElement("p",null,g.a.createElement(E.c,{id:"admin.permissions.permissionsSchemeSummary.deleteConfirmQuestion",defaultMessage:"The permissions in the teams using this scheme will reset to the defaults in the System Scheme. Are you sure you want to delete the {schemeName} scheme?",values:{schemeName:n.props.scheme.display_name}})),t),r=g.a.createElement(D.a,{loading:n.state.deleting,text:N.ab("admin.permissions.permissionsSchemeSummary.deleting","Deleting...")},g.a.createElement(E.c,{id:"admin.permissions.permissionsSchemeSummary.deleteConfirmButton",defaultMessage:"Yes, Delete"}));return g.a.createElement(Sn.a,{show:n.state.showConfirmModal,title:e,message:a,confirmButtonText:r,onConfirm:n.handleDeleteConfirmed,onCancel:n.handleDeleteCanceled})}),Ei(vi(n),"stopPropagation",function(e){e.stopPropagation()}),Ei(vi(n),"handleDeleteCanceled",function(){n.setState({showConfirmModal:!1})}),Ei(vi(n),"handleDeleteConfirmed",gi(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n.setState({deleting:!0,serverError:null}),e.next=3,n.props.actions.deleteScheme(n.props.scheme.id);case 3:(t=e.sent).error?n.setState({deleting:!1,serverError:t.error.message}):n.setState({deleting:!1,showConfirmModal:!1});case 5:case"end":return e.stop()}},e)}))),Ei(vi(n),"delete",function(e){e.stopPropagation(),n.setState({showConfirmModal:!0,serverError:null})}),Ei(vi(n),"goToEdit",function(){n.props.history.push("/admin_console/user_management/permissions/team_override_scheme/"+n.props.scheme.id)}),Ei(vi(n),"render",function(){var e=n.props.scheme,t=n.props.teams?n.props.teams.map(function(e){return g.a.createElement("span",{className:"team",key:e.id},e.display_name)}):[],a=null;t.length>Si&&(a=g.a.createElement(kn.a,{delayShow:w.Q.OVERLAY_TIME_DELAY,placement:"bottom",overlay:g.a.createElement(O.a,{className:"team-scheme-extra-teams-overlay",id:e.id+"-extra-teams-overlay"},t.slice(Si))},g.a.createElement("span",{className:"team",key:"extra-teams"},g.a.createElement(E.c,{id:"admin.permissions.permissionsSchemeSummary.moreTeams",defaultMessage:"+{number} more",values:{number:t.length-Si}}))),t=t.slice(0,Si));var r=n.renderConfirmModal();return g.a.createElement("div",{className:"permissions-scheme-summary",onClick:n.goToEdit},g.a.createElement("div",{onClick:n.stopPropagation},r),g.a.createElement("div",{className:"permissions-scheme-summary--header"},g.a.createElement("div",{className:"title"},e.display_name),g.a.createElement("div",{className:"actions"},g.a.createElement(La.a,{className:"edit-button",to:"/admin_console/user_management/permissions/team_override_scheme/"+e.id},g.a.createElement(E.c,{id:"admin.permissions.permissionsSchemeSummary.edit",defaultMessage:"Edit"})),"-",g.a.createElement("a",{className:"delete-button",onClick:n.delete},g.a.createElement(E.c,{id:"admin.permissions.permissionsSchemeSummary.delete",defaultMessage:"Delete"})))),g.a.createElement("div",{className:"permissions-scheme-summary--description"},e.description),g.a.createElement("div",{className:"permissions-scheme-summary--teams"},t,a))}),n.state={showConfirmModal:!1,deleting:!1,serverError:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_i(e,t)}(t,g.a.Component),t}();Ei(Oi,"propTypes",{scheme:b.a.object.isRequired,teams:b.a.array,actions:b.a.shape({deleteScheme:b.a.func.isRequired}).isRequired});var Ti=Object(a.connect)(function(){var e=Object(ui.makeGetSchemeTeams)();return function(t,n){return{teams:e(t,{schemeId:n.scheme.id})}}},function(e){return{actions:Object(r.bindActionCreators)({deleteScheme:ci.deleteScheme},e)}})(Oi);function wi(e){return(wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ji(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function xi(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Pi(e){return(Pi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ki(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ci(e,t){return(Ci=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ri=30,Ni=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Pi(t).call(this,e),n=!r||"object"!==wi(r)&&"function"!=typeof r?ki(a):r,Mi(ki(n),"loadMoreSchemes",function(){n.setState({loadingMore:!0}),n.props.actions.loadSchemes("team",n.state.page+1,Ri).then(function(e){var t=[],a=!0,r=!1,i=void 0;try{for(var o,s=e.data[Symbol.iterator]();!(a=(o=s.next()).done);a=!0){var l=o.value;t.push(n.props.actions.loadSchemeTeams(l.id))}}catch(e){r=!0,i=e}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}Promise.all(t).then(function(){return n.setState({loadingMore:!1,page:n.state.page+1})})})}),Mi(ki(n),"teamOverrideSchemesMigrationView",function(){if(n.state.phase2MigrationIsComplete)return null;var e=g.a.createElement("a",{href:"https://docs.mattermost.com/administration/config-settings.html#jobs",rel:"noopener noreferrer",target:"_blank"},g.a.createElement(E.c,{id:"admin.permissions.documentationLinkText",defaultMessage:"documentation"}));return n.props.jobsAreEnabled&&!n.props.clusterIsEnabled?n.teamOverrideUnavalableView(Object(A.b)("admin.permissions.teamOverrideSchemesInProgress"),"Migration job in progress: Team Override Schemes are not available until the job server completes the permissions migration. Learn more in the {documentationLink}.",e):n.teamOverrideUnavalableView(Object(A.b)("admin.permissions.teamOverrideSchemesNoJobsEnabled"),"Migration job on hold: Team Override Schemes are not available until the job server can execute the permissions migration. The job will be automatically started when the job server is enabled. Learn more in the {documentationLink}.",e)}),Mi(ki(n),"teamOverrideUnavalableView",function(e,t,n){return g.a.createElement("div",{className:"team-override-unavailable"},g.a.createElement("div",{className:"team-override-unavailable__inner"},g.a.createElement(E.c,{id:e,defaultMessage:t,values:{documentationLink:n}})))}),Mi(ki(n),"renderTeamOverrideSchemes",function(){var e=Object.values(n.props.schemes).map(function(e){return g.a.createElement(Ti,{scheme:e,history:n.props.history,key:e.id})}),t="true"===n.props.license.CustomPermissionsSchemes,a=n.teamOverrideSchemesMigrationView();return!!t&&g.a.createElement(fi,{className:"permissions-block",titleId:Object(A.b)("admin.permissions.teamOverrideSchemesTitle"),titleDefault:"Team Override Schemes",subtitleId:Object(A.b)("admin.permissions.teamOverrideSchemesBannerText"),subtitleDefault:"Use when specific teams need permission exceptions to the [System Scheme](!https://about.mattermost.com/default-system-scheme).",url:"/admin_console/user_management/permissions/team_override_scheme",disabled:null!==a,linkTextId:Object(A.b)("admin.permissions.teamOverrideSchemesNewButton"),linkTextDefault:"New Team Override Scheme"},0===e.length&&null===a&&g.a.createElement("div",{className:"no-team-schemes"},g.a.createElement(E.c,{id:"admin.permissions.teamOverrideSchemesNoSchemes",defaultMessage:"No team override schemes created."})),a,e.length>0&&e,e.length===Ri*(n.state.page+1)&&g.a.createElement("button",{className:"more-schemes theme style--none color--link",onClick:n.loadMoreSchemes,disabled:n.state.loadingMore},g.a.createElement(D.a,{loading:n.state.loadingMore,text:N.ab("admin.permissions.loadingMoreSchemes","Loading...")},g.a.createElement(E.c,{id:"admin.permissions.loadMoreSchemes",defaultMessage:"Load more schemes"}))))}),Mi(ki(n),"render",function(){if(n.state.loading)return g.a.createElement(W.a,null);var e=n.teamOverrideSchemesMigrationView();return g.a.createElement("div",{className:"wrapper--fixed"},g.a.createElement(mn,{id:"admin.permissions.permissionSchemes",defaultMessage:"Permission Schemes"}),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement("div",{className:"banner info"},g.a.createElement("div",{className:"banner__content"},g.a.createElement("span",null,g.a.createElement(Xt.b,{id:"admin.permissions.introBanner",defaultMessage:"Permission Schemes set the default permissions for Team Admins, Channel Admins and everyone else. Learn more about permission schemes in our [documentation](!https://about.mattermost.com/default-advanced-permissions)."})))),g.a.createElement(fi,{titleId:Object(A.b)("admin.permissions.systemSchemeBannerTitle"),titleDefault:"System Scheme",subtitleId:Object(A.b)("admin.permissions.systemSchemeBannerText"),subtitleDefault:"Set the default permissions inherited by all teams unless a [Team Override Scheme](!https://about.mattermost.com/default-team-override-scheme) is applied.",url:"/admin_console/user_management/permissions/system_scheme",disabled:null!==e,linkTextId:Object(A.b)("admin.permissions.systemSchemeBannerButton"),linkTextDefault:"Edit Scheme"}),n.renderTeamOverrideSchemes())))}),n.state={loading:!0,loadingMore:!1,page:0,phase2MigrationIsComplete:!1},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ci(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"UNSAFE_componentWillMount",value:function(){var e,t=(e=regeneratorRuntime.mark(function e(){var t,n,a,r,i,o,s,l,c,u=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=!0,e.prev=1,e.next=4,this.props.actions.loadSchemes("team",0,Ri);case 4:for(501===(t=e.sent).error.status_code&&(n=!1),a=[],r=!0,i=!1,o=void 0,e.prev=10,s=t.data[Symbol.iterator]();!(r=(l=s.next()).done);r=!0)c=l.value,a.push(this.props.actions.loadSchemeTeams(c.id));e.next=18;break;case 14:e.prev=14,e.t0=e.catch(10),i=!0,o=e.t0;case 18:e.prev=18,e.prev=19,r||null==s.return||s.return();case 21:if(e.prev=21,!i){e.next=24;break}throw o;case 24:return e.finish(21);case 25:return e.finish(18);case 26:Promise.all(a).then(function(){return u.setState({loading:!1,phase2MigrationIsComplete:n})}),e.next=32;break;case 29:e.prev=29,e.t1=e.catch(1),this.setState({loading:!1,phase2MigrationIsComplete:n});case 32:case"end":return e.stop()}},e,this,[[1,29],[10,14,18,26],[19,,21,25]])}),function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){ji(i,a,r,o,s,"next",e)}function s(e){ji(i,a,r,o,s,"throw",e)}o(void 0)})});return function(){return t.apply(this,arguments)}}()}])&&xi(n.prototype,a),r&&xi(n,r),t}();Mi(Ni,"propTypes",{schemes:b.a.object.isRequired,jobsAreEnabled:b.a.bool,clusterIsEnabled:b.a.bool,license:b.a.shape({CustomPermissionsSchemes:b.a.string}),actions:b.a.shape({loadSchemes:b.a.func.isRequired,loadSchemeTeams:b.a.func.isRequired})}),Mi(Ni,"defaultProps",{schemes:{}}),Object(A.b)("admin.permissions.group.delete_posts.description"),Object(A.b)("admin.permissions.group.delete_posts.name"),Object(A.b)("admin.permissions.group.integrations.description"),Object(A.b)("admin.permissions.group.integrations.name"),Object(A.b)("admin.permissions.group.posts.description"),Object(A.b)("admin.permissions.group.posts.name"),Object(A.b)("admin.permissions.group.private_channel.description"),Object(A.b)("admin.permissions.group.private_channel.name"),Object(A.b)("admin.permissions.group.public_channel.description"),Object(A.b)("admin.permissions.group.public_channel.name"),Object(A.b)("admin.permissions.group.reactions.description"),Object(A.b)("admin.permissions.group.reactions.name"),Object(A.b)("admin.permissions.group.send_invites.description"),Object(A.b)("admin.permissions.group.send_invites.name"),Object(A.b)("admin.permissions.group.teams.description"),Object(A.b)("admin.permissions.group.teams.name"),Object(A.b)("admin.permissions.group.edit_posts.description"),Object(A.b)("admin.permissions.group.edit_posts.name"),Object(A.b)("admin.permissions.group.teams_team_scope.description"),Object(A.b)("admin.permissions.group.teams_team_scope.name"),Object(A.b)("admin.permissions.permission.assign_system_admin_role.description"),Object(A.b)("admin.permissions.permission.assign_system_admin_role.name"),Object(A.b)("admin.permissions.permission.create_direct_channel.description"),Object(A.b)("admin.permissions.permission.create_direct_channel.name"),Object(A.b)("admin.permissions.permission.create_group_channel.description"),Object(A.b)("admin.permissions.permission.create_group_channel.name"),Object(A.b)("admin.permissions.permission.create_private_channel.description"),Object(A.b)("admin.permissions.permission.create_private_channel.name"),Object(A.b)("admin.permissions.permission.create_public_channel.description"),Object(A.b)("admin.permissions.permission.create_public_channel.name"),Object(A.b)("admin.permissions.permission.create_team.description"),Object(A.b)("admin.permissions.permission.create_team.name"),Object(A.b)("admin.permissions.permission.create_user_access_token.description"),Object(A.b)("admin.permissions.permission.create_user_access_token.name"),Object(A.b)("admin.permissions.permission.delete_others_posts.description"),Object(A.b)("admin.permissions.permission.delete_others_posts.name"),Object(A.b)("admin.permissions.permission.delete_post.description"),Object(A.b)("admin.permissions.permission.delete_post.name"),Object(A.b)("admin.permissions.permission.delete_private_channel.description"),Object(A.b)("admin.permissions.permission.delete_private_channel.name"),Object(A.b)("admin.permissions.permission.delete_public_channel.description"),Object(A.b)("admin.permissions.permission.delete_public_channel.name"),Object(A.b)("admin.permissions.permission.edit_other_users.description"),Object(A.b)("admin.permissions.permission.edit_other_users.name"),Object(A.b)("admin.permissions.permission.edit_post.description"),Object(A.b)("admin.permissions.permission.edit_post.name"),Object(A.b)("admin.permissions.permission.import_team.description"),Object(A.b)("admin.permissions.permission.import_team.name"),Object(A.b)("admin.permissions.permission.list_team_channels.description"),Object(A.b)("admin.permissions.permission.list_team_channels.name"),Object(A.b)("admin.permissions.permission.list_users_without_team.description"),Object(A.b)("admin.permissions.permission.list_users_without_team.name"),Object(A.b)("admin.permissions.permission.manage_channel_roles.description"),Object(A.b)("admin.permissions.permission.manage_channel_roles.name"),Object(A.b)("admin.permissions.permission.create_emojis.description"),Object(A.b)("admin.permissions.permission.create_emojis.name"),Object(A.b)("admin.permissions.permission.delete_emojis.description"),Object(A.b)("admin.permissions.permission.delete_emojis.name"),Object(A.b)("admin.permissions.permission.delete_others_emojis.description"),Object(A.b)("admin.permissions.permission.delete_others_emojis.name"),Object(A.b)("admin.permissions.permission.manage_jobs.description"),Object(A.b)("admin.permissions.permission.manage_jobs.name"),Object(A.b)("admin.permissions.permission.manage_oauth.description"),Object(A.b)("admin.permissions.permission.manage_oauth.name"),Object(A.b)("admin.permissions.permission.manage_private_channel_members.description"),Object(A.b)("admin.permissions.permission.manage_private_channel_members.name"),Object(A.b)("admin.permissions.permission.manage_private_channel_properties.description"),Object(A.b)("admin.permissions.permission.manage_private_channel_properties.name"),Object(A.b)("admin.permissions.permission.manage_public_channel_members.description"),Object(A.b)("admin.permissions.permission.manage_public_channel_members.name"),Object(A.b)("admin.permissions.permission.manage_public_channel_properties.description"),Object(A.b)("admin.permissions.permission.manage_public_channel_properties.name"),Object(A.b)("admin.permissions.permission.manage_roles.description"),Object(A.b)("admin.permissions.permission.manage_roles.name"),Object(A.b)("admin.permissions.permission.manage_slash_commands.description"),Object(A.b)("admin.permissions.permission.manage_slash_commands.name"),Object(A.b)("admin.permissions.permission.manage_system.description"),Object(A.b)("admin.permissions.permission.manage_system.name"),Object(A.b)("admin.permissions.permission.manage_team.description"),Object(A.b)("admin.permissions.permission.manage_team.name"),Object(A.b)("admin.permissions.permission.manage_team_roles.description"),Object(A.b)("admin.permissions.permission.manage_team_roles.name"),Object(A.b)("admin.permissions.permission.manage_incoming_webhooks.description"),Object(A.b)("admin.permissions.permission.manage_incoming_webhooks.name"),Object(A.b)("admin.permissions.permission.manage_outgoing_webhooks.description"),Object(A.b)("admin.permissions.permission.manage_outgoing_webhooks.name"),Object(A.b)("admin.permissions.permission.permanent_delete_user.description"),Object(A.b)("admin.permissions.permission.permanent_delete_user.name"),Object(A.b)("admin.permissions.permission.read_channel.description"),Object(A.b)("admin.permissions.permission.read_channel.name"),Object(A.b)("admin.permissions.permission.read_user_access_token.description"),Object(A.b)("admin.permissions.permission.read_user_access_token.name"),Object(A.b)("admin.permissions.permission.remove_user_from_team.description"),Object(A.b)("admin.permissions.permission.remove_user_from_team.name"),Object(A.b)("admin.permissions.permission.revoke_user_access_token.description"),Object(A.b)("admin.permissions.permission.revoke_user_access_token.name"),Object(A.b)("admin.permissions.permission.upload_file.description"),Object(A.b)("admin.permissions.permission.upload_file.name"),Object(A.b)("admin.permissions.permission.view_team.description"),Object(A.b)("admin.permissions.permission.view_team.name"),Object(A.b)("admin.permissions.permission.edit_others_posts.description"),Object(A.b)("admin.permissions.permission.edit_others_posts.name"),Object(A.b)("admin.permissions.roles.all_users.name"),Object(A.b)("admin.permissions.roles.channel_admin.name"),Object(A.b)("admin.permissions.roles.channel_user.name"),Object(A.b)("admin.permissions.roles.system_admin.name"),Object(A.b)("admin.permissions.roles.system_user.name"),Object(A.b)("admin.permissions.roles.team_admin.name"),Object(A.b)("admin.permissions.roles.team_user.name");var Ai=Object(a.connect)(function(e){var t=Object(ui.getSchemes)(e),n=Object(c.getConfig)(e);return{schemes:t,jobsAreEnabled:"true"===n.RunJobs,clusterIsEnabled:"true"===n.EnableCluster}},function(e){return{actions:Object(r.bindActionCreators)({loadSchemes:ci.getSchemes,loadSchemeTeams:ci.getSchemeTeams},e)}})(Ni),Di=n(4),Li=n.n(Di),Ii=n(119);function Ui(e){return(Ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qi(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Bi(e){return(Bi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gi(e,t){return(Gi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yi=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=Bi(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Ui(r)&&"function"!=typeof r?Fi(a):r,Hi(Fi(n),"handleClick",function(e){n.props.blocked&&(e.preventDefault(),n.props.actions.deferNavigation(function(){Ii.a.push(n.props.to)}))}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gi(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){Hi(e,t,n[t])})}return e}({},this.props);return Reflect.deleteProperty(e,"blocked"),Reflect.deleteProperty(e,"actions"),g.a.createElement(La.b,Object.assign({},e,{onClick:this.handleClick}))}}])&&qi(n.prototype,a),r&&qi(n,r),t}();Hi(Yi,"propTypes",{blocked:b.a.bool.isRequired,to:b.a.string.isRequired,actions:b.a.shape({deferNavigation:b.a.func.isRequired}).isRequired});var Wi=Object(a.connect)(function(e){return{blocked:Object(p.a)(e)}},function(e){return{actions:Object(r.bindActionCreators)({deferNavigation:d.g},e)}})(Yi);function zi(e){return(zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vi(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Xi(e,t){return!t||"object"!==zi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ji(e){return(Ji=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ki(e,t){return(Ki=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Xi(this,Ji(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ki(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){return g.a.createElement("span",this.props,g.a.createElement("svg",{width:"30px",height:"30px",viewBox:"0 0 30 30"},g.a.createElement("g",{id:"Developer-Export",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},g.a.createElement("g",{transform:"translate(-995.000000, -1372.000000)",id:"All-Team-Members"},g.a.createElement("g",{transform:"translate(245.000000, 698.000000)"},g.a.createElement("g",{id:"Team-Administrators",transform:"translate(0.000000, 651.000000)"},g.a.createElement("g",{id:"accordion-header"},g.a.createElement("g",{id:"accordion---expanded",transform:"translate(750.000000, 23.000000)"},g.a.createElement("path",{d:"M23.1484532,13.3124932 C23.3437659,13.1171805 23.3437659,12.7968676 23.1484532,12.6015549 L21.8515766,11.3124908 C21.6562639,11.1171781 21.3437635,11.1171781 21.1484508,11.3124908 L15.0000083,17.4609333 L8.8515659,11.3124908 C8.65625317,11.1171781 8.34375279,11.1171781 8.14844006,11.3124908 L6.85156352,12.6015549 C6.65625078,12.7968676 6.65625078,13.1171805 6.85156352,13.3124932 L14.6484454,21.1015626 C14.8437582,21.2968754 15.1562585,21.2968754 15.3515713,21.1015626 L23.1484532,13.3124932 Z",id:"",fill:"#979797"}),g.a.createElement("circle",{id:"Oval-2",stroke:"#989898",strokeWidth:"2",cx:"15",cy:"15",r:"14"})))))))))}}])&&Vi(n.prototype,a),r&&Vi(n,r),t}(),Zi=function(e){return g.a.createElement(di,{className:"AdminPanelTogglable "+e.className+(e.open?"":" closed"),id:e.id,titleId:e.titleId,titleDefault:e.titleDefault,subtitleId:e.subtitleId,subtitleDefault:e.subtitleDefault,onHeaderClick:e.onToggle,button:g.a.createElement(Qi,null)},e.children)};Zi.propTypes={children:b.a.node,className:b.a.string.isRequired,id:b.a.string,open:b.a.bool.isRequired,titleId:b.a.string.isRequired,titleDefault:b.a.string.isRequired,subtitleId:b.a.string.isRequired,subtitleDefault:b.a.string.isRequired,onToggle:b.a.func.isRequired},Zi.defaultProps={className:"",open:!0};var $i=Zi;function eo(e){return(eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function to(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function no(e,t){return!t||"object"!==eo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ao(e){return(ao=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ro(e,t){return(ro=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var io=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),no(this,ao(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ro(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){return g.a.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18"},g.a.createElement("g",{id:"Developer-Export",stroke:"none",strokeWidth:"1",fillRule:"evenodd"},g.a.createElement("g",{transform:"translate(-285.000000, -933.000000)",id:"All-Team-Members"},g.a.createElement("g",{transform:"translate(245.000000, 698.000000)"},g.a.createElement("g",{id:"Channel-Administrators",transform:"translate(0.000000, 106.000000)"},g.a.createElement("g",{id:"data-table/column-1",transform:"translate(11.000000, 86.000000)"},g.a.createElement("g",{id:"row-checkbox---Public-Channels",transform:"translate(12.000000, 35.000000)"},g.a.createElement("g",{id:"Stacked-Group",transform:"translate(0.000000, 5.000000)"},g.a.createElement("g",{id:"data-table/1st/row-checkbox-label-base"},g.a.createElement("g",{id:"check-on-copy-11",transform:"translate(14.000000, 0.000000)"},g.a.createElement("path",{d:"M19,3 L5,3 C3.9,3 3,3.9 3,5 L3,19 C3,20.1 3.9,21 5,21 L19,21 C20.1,21 21,20.1 21,19 L21,5 C21,3.9 20.1,3 19,3 L19,3 Z M10,17 L5,12.1923077 L6.4,10.8461538 L10,14.3076923 L17.6,7 L19,8.34615385 L10,17 L10,17 Z",id:"checkbox---checked"})))))))))))}}])&&to(n.prototype,a),r&&to(n,r),t}();function oo(e){return(oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function so(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function lo(e,t){return!t||"object"!==oo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function co(e){return(co=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function uo(e,t){return(uo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var mo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),lo(this,co(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&uo(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){return g.a.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18"},g.a.createElement("g",{id:"Developer-Export",stroke:"none",strokeWidth:"1",fillRule:"evenodd"},g.a.createElement("g",{transform:"translate(-298.000000, -1273.000000)",id:"All-Team-Members"},g.a.createElement("g",{transform:"translate(245.000000, 698.000000)"},g.a.createElement("g",{id:"Channel-Administrators",transform:"translate(0.000000, 106.000000)"},g.a.createElement("g",{id:"data-table/column-1",transform:"translate(11.000000, 86.000000)"},g.a.createElement("g",{id:"row-checkbox---@all-@channel-Mentions",transform:"translate(0.000000, 375.000000)"},g.a.createElement("g",{id:"Stacked-Group"},g.a.createElement("g",{id:"data-table/1st/row-checkbox-label-base",transform:"translate(25.000000, 5.000000)"},g.a.createElement("g",{id:"check-on-copy-11",transform:"translate(14.000000, 0.000000)"},g.a.createElement("path",{d:"M19,3 C20.1,3 21,3.9 21,5 L21,19 C21,20.1 20.1,21 19,21 L5,21 C3.9,21 3,20.1 3,19 L3,5 C3,3.9 3.9,3 5,3 L19,3 Z M7,11 L7,13 L17,13 L17,11 L7,11 Z",id:"checkbox---partial"})))))))))))}}])&&so(n.prototype,a),r&&so(n,r),t}();function po(e){return(po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fo(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function bo(e,t){return!t||"object"!==po(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ho(e){return(ho=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function go(e,t){return(go=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),bo(this,ho(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&go(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){var e=this.props.value,t=null,n="";return"checked"===e?(t=g.a.createElement(io,null),n="checked"):"intermediate"===e&&(t=g.a.createElement(mo,null),n="intermediate"),g.a.createElement("div",{className:"permission-check "+n},t)}}])&&fo(n.prototype,a),r&&fo(n,r),t}();function _o(e){return(_o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Eo(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function So(e){return(So=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Oo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function To(e,t){return(To=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}yo(vo,"propTypes",{value:b.a.string.isRequired}),yo(vo,"defaultProps",{value:""});var jo=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=So(t).call(this,e),n=!r||"object"!==_o(r)&&"function"!=typeof r?Oo(a):r,wo(Oo(n),"closeTooltip",function(){n.setState({open:!1})}),wo(Oo(n),"openTooltip",function(e){var t=e.currentTarget.querySelector("span"),a=t.offsetWidth<t.scrollWidth;n.setState({open:a})}),wo(Oo(n),"parentPermissionClicked",function(e){var t="inherit-link-wrapper"===e.target.parentElement.parentElement.className;"permission-description"===e.target.parentElement.className||t?t&&(n.props.selectRow(n.props.id),e.stopPropagation()):e.stopPropagation()}),n.id=Object(N.r)(),n.state={open:!1},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&To(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){var e=this.props,t=e.inherited,n=e.id,a=e.rowType,r="";r=t?g.a.createElement("span",{className:"inherit-link-wrapper"},g.a.createElement(E.b,{id:"admin.permissions.inherited_from",values:{name:this.props.intl.formatMessage({id:"admin.permissions.roles."+t.name+".name",defaultMessage:t.display_name})}})):g.a.createElement(E.c,{id:"admin.permissions."+a+"."+n+".description",values:this.props.additionalValues});var i=g.a.createElement(S.a,{show:this.state.open,delayShow:w.Q.OVERLAY_TIME_DELAY,placement:"top",target:this.refs.content},g.a.createElement(O.a,{id:this.id},r));return r.props.values&&Object.keys(r.props.values).length>0&&(i=null),r=g.a.createElement("span",{className:"permission-description",onClick:this.parentPermissionClicked,ref:"content",onMouseOver:this.openTooltip,onMouseOut:this.closeTooltip},r,i)}}])&&Eo(n.prototype,a),r&&Eo(n,r),t}();wo(jo,"propTypes",{intl:E.i.isRequired,id:b.a.string.isRequired,rowType:b.a.string.isRequired,inherited:b.a.object,selectRow:b.a.func.isRequired,additionalValues:b.a.object});var xo=Object(E.h)(jo);function Po(e){return(Po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ko(e){return(ko=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Co(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mo(e,t){return(Mo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ro(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var No=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=ko(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Po(r)&&"function"!=typeof r?Co(a):r,Ro(Co(n),"toggleSelect",function(){n.props.readOnly||n.props.onChange(n.props.id)}),Ro(Co(n),"render",function(){var e=n.props,t=e.id,a=e.uniqId,r=e.inherited,i=e.value,o=e.readOnly,s=e.selected,l=e.additionalValues,c="permission-row";return o&&(c+=" read-only"),s===t&&(c+=" selected"),g.a.createElement("div",{className:c,onClick:n.toggleSelect,id:a},g.a.createElement(vo,{value:i}),g.a.createElement("span",{className:"permission-name"},g.a.createElement(E.c,{id:"admin.permissions.permission."+t+".name"})),g.a.createElement(xo,{inherited:r,id:t,selectRow:n.props.selectRow,rowType:"permission",additionalValues:l}))}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Mo(e,t)}(t,g.a.Component),t}();function Ao(e){return(Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Do(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Lo(e){return(Lo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Io(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uo(e,t){return(Uo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Ro(No,"propTypes",{id:b.a.string.isRequired,uniqId:b.a.string.isRequired,inherited:b.a.object,readOnly:b.a.bool,selected:b.a.string,selectRow:b.a.func.isRequired,value:b.a.string.isRequired,onChange:b.a.func.isRequired,additionalValues:b.a.object});var Bo=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Lo(t).call(this,e),n=!r||"object"!==Ao(r)&&"function"!=typeof r?Io(a):r,qo(Io(n),"toggleExpanded",function(e){e.stopPropagation(),n.setState({expanded:!n.state.expanded})}),qo(Io(n),"toggleSelectRow",function(e){n.props.readOnly||n.props.onChange([e])}),qo(Io(n),"getRecursivePermissions",function(e){var t=[],a=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done);a=!0){var l=o.value;"string"==typeof l?t.push(l):t=t.concat(n.getRecursivePermissions(l.permissions))}}catch(e){r=!0,i=e}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}return t}),qo(Io(n),"toggleSelectSubGroup",function(e){n.props.readOnly||n.props.onChange(e)}),qo(Io(n),"toggleSelectGroup",function(){var e=n.props,t=e.readOnly,a=e.permissions,r=e.role,i=e.onChange;if(!t)if("checked"===n.getStatus(a)){var o=[],s=!0,l=!1,c=void 0;try{for(var u,m=n.getRecursivePermissions(a)[Symbol.iterator]();!(s=(u=m.next()).done);s=!0){var d=u.value;n.fromParent(d)||o.push(d)}}catch(e){l=!0,c=e}finally{try{s||null==m.return||m.return()}finally{if(l)throw c}}n.setState({expanded:!0}),i(o)}else if(""===n.getStatus(a)){var p=[],f=!0;if(0===n.state.prevPermissions.length){var b=!0,h=!1,g=void 0;try{for(var y,v=n.getRecursivePermissions(a)[Symbol.iterator]();!(b=(y=v.next()).done);b=!0){var _=y.value;n.fromParent(_)||(p.push(_),f=!1)}}catch(e){h=!0,g=e}finally{try{b||null==v.return||v.return()}finally{if(h)throw g}}}else{var E=!0,S=!1,O=void 0;try{for(var T,w=n.getRecursivePermissions(a)[Symbol.iterator]();!(E=(T=w.next()).done);E=!0){var j=T.value;-1===n.state.prevPermissions.indexOf(j)||n.fromParent(j)||p.push(j)}}catch(e){S=!0,O=e}finally{try{E||null==w.return||w.return()}finally{if(S)throw O}}}i(p),n.setState({prevPermissions:[],expanded:f})}else{var x=[],P=!0,k=!1,C=void 0;try{for(var M,R=n.getRecursivePermissions(a)[Symbol.iterator]();!(P=(M=R.next()).done);P=!0){var N=M.value;-1!==r.permissions.indexOf(N)||n.fromParent(N)||x.push(N)}}catch(e){k=!0,C=e}finally{try{P||null==R.return||R.return()}finally{if(k)throw C}}n.setState({prevPermissions:r.permissions,expanded:!1}),i(x)}}),qo(Io(n),"isInScope",function(e){return("channel_scope"!==n.props.scope||"channel_scope"===w.v[e])&&("team_scope"!==n.props.scope||"system_scope"!==w.v[e])}),qo(Io(n),"renderPermission",function(e,t){if(!n.isInScope(e))return null;var a=n.fromParent(e),r=a||-1!==n.props.role.permissions.indexOf(e);return g.a.createElement(No,{key:e,id:e,uniqId:n.props.uniqId+"-"+e,selected:n.props.selected,selectRow:n.props.selectRow,readOnly:n.props.readOnly||a,inherited:a?n.props.parentRole:null,value:r?"checked":"",onChange:n.toggleSelectRow,additionalValues:t})}),qo(Io(n),"renderGroup",function(e){return g.a.createElement(t,{key:e.id,id:e.id,uniqId:n.props.uniqId+"-"+e.id,selected:n.props.selected,selectRow:n.props.selectRow,readOnly:n.props.readOnly,permissions:e.permissions,additionalValues:n.props.additionalValues,role:n.props.role,parentRole:n.props.parentRole,scope:n.props.scope,onChange:n.toggleSelectSubGroup,combined:e.combined,root:!1})}),qo(Io(n),"fromParent",function(e){return n.props.parentRole&&-1!==n.props.parentRole.permissions.indexOf(e)}),qo(Io(n),"getStatus",function(e){var t=!1,a=!1,r=!0,i=!1,o=void 0;try{for(var s,l=e[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var c=s.value;if("string"==typeof c){if(!n.isInScope(c))continue;t=t||n.fromParent(c)||-1!==n.props.role.permissions.indexOf(c),a=a||!n.fromParent(c)&&-1===n.props.role.permissions.indexOf(c)}else{var u=n.getStatus(c.permissions);if("intermediate"===u)return"intermediate";"checked"===u&&(t=!0),""===u&&(a=!0)}}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return t&&a?"intermediate":t&&!a?"checked":""}),qo(Io(n),"hasPermissionsOnScope",function(){return n.getRecursivePermissions(n.props.permissions).some(function(e){return n.isInScope(e)})}),qo(Io(n),"allPermissionsFromParent",function(e){var t=!0,a=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value;if("string"==typeof s){if(n.isInScope(s)&&!n.fromParent(s))return!1}else if(!n.allPermissionsFromParent(s.permissions))return!1}}catch(e){a=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(a)throw r}}return!0}),qo(Io(n),"render",function(){var e=n.props,t=e.id,a=e.uniqId,r=e.permissions,i=e.readOnly,o=e.combined,s=e.root,l=e.selected,c=e.additionalValues;if(!n.hasPermissionsOnScope())return null;var u=r.map(function(e){if("string"==typeof e){var t=c&&c[e]?c[e]:{};return n.renderPermission(e,t)}return n.renderGroup(e)});if(s)return g.a.createElement("div",{className:"permission-group-permissions "+(n.state.expanded?"open":"")},u);var m=null;n.allPermissionsFromParent(n.props.permissions)&&n.props.combined&&(m=n.props.parentRole);var d="";return l===t&&(d+=" selected"),(i||n.allPermissionsFromParent(n.props.permissions))&&(d+=" read-only"),o&&(d+=" combined"),g.a.createElement("div",{className:"permission-group"},!s&&g.a.createElement("div",{className:"permission-group-row "+d,onClick:n.toggleSelectGroup,id:a},!o&&g.a.createElement("div",{className:"fa fa-caret-right permission-arrow "+(n.state.expanded?"open":""),onClick:n.toggleExpanded}),g.a.createElement(vo,{value:n.getStatus(n.props.permissions)}),g.a.createElement("span",{className:"permission-name"},g.a.createElement(E.c,{id:"admin.permissions.group."+t+".name"})),g.a.createElement(xo,{inherited:m,id:t,selectRow:n.props.selectRow,rowType:"group"})),!o&&g.a.createElement("div",{className:"permission-group-permissions "+(n.state.expanded?"open":"")},u))}),n.state={expanded:!0,prevPermissions:[]},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Uo(e,t)}(t,g.a.Component),n=t,(a=[{key:"UNSAFE_componentWillUpdate",value:function(e){this.props.selected!==e.selected&&-1!==this.getRecursivePermissions(this.props.permissions).indexOf(e.selected)&&this.setState({expanded:!0})}}])&&Do(n.prototype,a),r&&Do(n,r),t}();function Fo(e){return(Fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Go(e){return(Go=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ho(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yo(e,t){return(Yo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Wo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}qo(Bo,"propTypes",{id:b.a.string.isRequired,uniqId:b.a.string.isRequired,permissions:b.a.array.isRequired,readOnly:b.a.bool,role:b.a.object,parentRole:b.a.object,scope:b.a.string.isRequired,combined:b.a.bool,selected:b.a.string,selectRow:b.a.func.isRequired,root:b.a.bool,onChange:b.a.func.isRequired,additionalValues:b.a.object});var zo=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=Go(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Fo(r)&&"function"!=typeof r?Ho(a):r,Wo(Ho(n),"render",function(){var e;return e=n.props.timeLimit===w.i.UNSET_POST_EDIT_TIME_LIMIT?Object(A.b)("edit_post.time_limit_button.no_limit"):Object(A.b)("edit_post.time_limit_button.for_n_seconds"),g.a.createElement("button",{className:"edit-post-time-limit-button",onClick:n.props.onClick},g.a.createElement("i",{className:"fa fa-gear"}),g.a.createElement(E.c,{id:e,values:{n:n.props.timeLimit}}))}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Yo(e,t)}(t,g.a.Component),t}();Wo(zo,"propTypes",{timeLimit:b.a.number.isRequired,onClick:b.a.func});var Vo=Object(a.connect)(function(e){var t=Object(c.getConfig)(e).PostEditTimeLimit;return{timeLimit:parseInt(t,10)}})(zo),Xo=n(1739);function Jo(e){return(Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ko(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Qo(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){Ko(i,a,r,o,s,"next",e)}function s(e){Ko(i,a,r,o,s,"throw",e)}o(void 0)})}}function Zo(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function $o(e){return($o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function es(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ts(e,t){return(ts=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ns(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var as=2147483647,rs=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=$o(t).call(this,e),n=!r||"object"!==Jo(r)&&"function"!=typeof r?es(a):r,ns(es(n),"save",Qo(regeneratorRuntime.mark(function e(){var t,a,r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n.setState({saving:!0,errorMessage:""}),(t=parseInt(n.state.postEditTimeLimit,10))===w.i.UNSET_POST_EDIT_TIME_LIMIT){e.next=6;break}if(!("NaN"===t.toString()||t<=0||t>as)){e.next=6;break}return n.setState({errorMessage:Object(N.ab)("edit_post.time_limit_modal.invalid_time_limit","Invalid time limit"),saving:!1}),e.abrupt("return",!1);case 6:return(a=JSON.parse(JSON.stringify(n.props.config))).ServiceSettings.PostEditTimeLimit=t,e.next=10,n.props.actions.updateConfig(a);case 10:return r=e.sent,(i=r.error)?n.setState({errorMessage:i,saving:!1}):(n.setState({saving:!1}),n.props.onClose()),e.abrupt("return",!0);case 14:case"end":return e.stop()}},e)}))),ns(es(n),"handleOptionChange",function(e){e.target.value===w.i.ALLOW_EDIT_POST_ALWAYS?n.setState({postEditTimeLimit:w.i.UNSET_POST_EDIT_TIME_LIMIT}):n.setState({postEditTimeLimit:""})}),ns(es(n),"handleSecondsChange",function(e){var t=e.target.value;n.setState({postEditTimeLimit:t})}),ns(es(n),"render",function(){return g.a.createElement(Xo.a,{dialogClassName:"a11y__modal admin-modal edit-post-time-limit-modal",show:n.props.show,role:"dialog","aria-labelledby":"editPostTimeModalLabel"},g.a.createElement(Xo.a.Header,{closeButton:!0},g.a.createElement(Xo.a.Title,{componentClass:"h1",id:"editPostTimeModalLabel"},g.a.createElement(E.c,{id:"edit_post.time_limit_modal.title",defaultMessage:"Configure Global Edit Post Time Limit"}))),g.a.createElement(Xo.a.Body,null,g.a.createElement(E.b,{id:"edit_post.time_limit_modal.description",defaultMessage:'Setting a time limit <strong>applies to all users</strong> who have the "Edit Post" permissions in any permission scheme.'}),g.a.createElement("div",{className:"padding-left x2 padding-top padding-bottom"},g.a.createElement("div",{className:"padding-top x2"},g.a.createElement("input",{id:"anytime",type:"radio",name:"limit",value:w.i.ALLOW_EDIT_POST_ALWAYS,checked:n.state.postEditTimeLimit===w.i.UNSET_POST_EDIT_TIME_LIMIT,onChange:n.handleOptionChange}),g.a.createElement("label",{htmlFor:"anytime"},g.a.createElement(E.c,{id:"edit_post.time_limit_modal.option_label_anytime",defaultMessage:"Anytime"}))),g.a.createElement("div",{className:"padding-top"},g.a.createElement("input",{id:"timelimit",type:"radio",name:"limit",value:w.i.ALLOW_EDIT_POST_TIME_LIMIT,checked:n.state.postEditTimeLimit!==w.i.UNSET_POST_EDIT_TIME_LIMIT,onChange:n.handleOptionChange}),g.a.createElement("label",{htmlFor:"timelimit"},g.a.createElement(E.c,{id:"edit_post.time_limit_modal.option_label_time_limit.preinput",defaultMessage:"Can edit for"})),g.a.createElement("input",{type:"number",className:"form-control inline",min:"0",step:"1",max:as,id:"editPostTimeLimit",readOnly:n.state.postEditTimeLimit===w.i.UNSET_POST_EDIT_TIME_LIMIT,onChange:n.handleSecondsChange,value:n.state.postEditTimeLimit===w.i.UNSET_POST_EDIT_TIME_LIMIT?"":n.state.postEditTimeLimit}),g.a.createElement("label",{htmlFor:"timelimit"},g.a.createElement(E.c,{id:"edit_post.time_limit_modal.option_label_time_limit.postinput",defaultMessage:"seconds after posting"}))),g.a.createElement("div",{className:"padding-top x2 light"},g.a.createElement(E.c,{id:"edit_post.time_limit_modal.subscript",defaultMessage:"Set the length of time users have to edit their messages after posting."})))),g.a.createElement(Xo.a.Footer,null,g.a.createElement("div",{className:"edit-post-time-limit-modal__error"},n.state.errorMessage),g.a.createElement("button",{type:"button",className:"btn btn-cancel",onClick:n.props.onClose},g.a.createElement(E.c,{id:"confirm_modal.cancel",defaultMessage:"Cancel"})),g.a.createElement("button",{id:"linkModalCloseButton",type:"button",className:"btn btn-default",onClick:n.save,disabled:n.state.saving},g.a.createElement(E.c,{id:n.state.saving?Object(A.b)("save_button.saving"):Object(A.b)("edit_post.time_limit_modal.save_button"),defaultMessage:"Save Edit Time"}))))}),n.state={postEditTimeLimit:parseInt(e.config.ServiceSettings.PostEditTimeLimit,10),saving:!1,errorMessage:""},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ts(e,t)}(t,g.a.Component),n=t,(a=[{key:"UNSAFE_componentWillMount",value:function(){this.props.actions.getConfig()}}])&&Zo(n.prototype,a),r&&Zo(n,r),t}();ns(rs,"propTypes",{config:b.a.object.isRequired,show:b.a.bool,onClose:b.a.func.isRequired,actions:b.a.shape({updateConfig:b.a.func.isRequired,getConfig:b.a.func.isRequired}).isRequired});var is=Object(a.connect)(function(e){return{config:s.getConfig(e)}},function(e){return{actions:Object(r.bindActionCreators)({updateConfig:i.updateConfig,getConfig:i.getConfig},e)}})(rs);function os(e){return(os="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ss(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ls(e){return(ls=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function cs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function us(e,t){return(us=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ms(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ds=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=ls(t).call(this,e),n=!r||"object"!==os(r)&&"function"!=typeof r?cs(a):r,ms(cs(n),"updateGroups",function(){var e=n.props,t=e.config,a=e.scope,r=n.groups[n.groups.length-1];"true"===t.EnableIncomingWebhooks&&-1===r.permissions.indexOf("manage_incoming_webhooks")&&r.permissions.push("manage_incoming_webhooks"),"true"===t.EnableOutgoingWebhooks&&-1===r.permissions.indexOf("manage_outgoing_webhooks")&&r.permissions.push("manage_outgoing_webhooks"),"true"===t.EnableOAuthServiceProvider&&-1===r.permissions.indexOf("manage_oauth")&&r.permissions.push("manage_oauth"),"true"===t.EnableCommands&&-1===r.permissions.indexOf("manage_slash_commands")&&r.permissions.push("manage_slash_commands"),"true"===t.EnableCustomEmoji&&-1===r.permissions.indexOf("create_emojis")&&r.permissions.push("create_emojis"),"true"===t.EnableCustomEmoji&&-1===r.permissions.indexOf("delete_emojis")&&r.permissions.push("delete_emojis"),"true"===t.EnableCustomEmoji&&-1===r.permissions.indexOf("delete_others_emojis")&&r.permissions.push("delete_others_emojis"),"team_scope"===a&&"teams_team_scope"!==n.groups[0].id&&(n.groups[0].id="teams_team_scope")}),ms(cs(n),"openPostTimeLimitModal",function(){n.setState({editTimeLimitModalIsVisible:!0})}),ms(cs(n),"closePostTimeLimitModal",function(){n.setState({editTimeLimitModalIsVisible:!1})}),ms(cs(n),"toggleGroup",function(e){n.props.readOnly||n.props.onToggle(n.props.role.name,e)}),ms(cs(n),"render",function(){return g.a.createElement("div",{className:"permissions-tree"},g.a.createElement("div",{className:"permissions-tree--header"},g.a.createElement("div",{className:"permission-name"},g.a.createElement(E.c,{id:"admin.permissions.permissionsTree.permission",defaultMessage:"Permission"})),g.a.createElement("div",{className:"permission-description"},g.a.createElement(E.c,{id:"admin.permissions.permissionsTree.description",defaultMessage:"Description"}))),g.a.createElement("div",{className:"permissions-tree--body"},g.a.createElement(Bo,{key:"all",id:"all",uniqId:n.props.role.name,selected:n.props.selected,selectRow:n.props.selectRow,readOnly:n.props.readOnly,permissions:n.groups,additionalValues:n.ADDITIONAL_VALUES,role:n.props.role,parentRole:n.props.parentRole,scope:n.props.scope,combined:!1,onChange:n.toggleGroup,root:!0})),g.a.createElement(is,{onClose:n.closePostTimeLimitModal,show:n.state.editTimeLimitModalIsVisible}))}),n.state={editTimeLimitModalIsVisible:!1},n.ADDITIONAL_VALUES={edit_post:{editTimeLimitButton:g.a.createElement(Vo,{onClick:n.openPostTimeLimitModal})}},n.groups=[{id:"teams",permissions:[{id:"send_invites",combined:!0,permissions:["invite_user","get_public_link","add_user_to_team"]},"create_team"]},{id:"public_channel",permissions:["create_public_channel","manage_public_channel_properties","manage_public_channel_members","delete_public_channel"]},{id:"private_channel",permissions:["create_private_channel","manage_private_channel_properties","manage_private_channel_members","delete_private_channel"]},{id:"posts",permissions:[{id:"edit_posts",permissions:["edit_post","edit_others_posts"]},{id:"delete_posts",permissions:["delete_post","delete_others_posts"]},{id:"reactions",combined:!0,permissions:["add_reaction","remove_reaction"]}]},{id:"integrations",permissions:[]}],n.updateGroups(),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&us(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidUpdate",value:function(e){this.props.config!==e.config&&this.updateGroups()}}])&&ss(n.prototype,a),r&&ss(n,r),t}();ms(ds,"propTypes",{scope:b.a.string.isRequired,config:b.a.object.isRequired,role:b.a.object.isRequired,onToggle:b.a.func.isRequired,parentRole:b.a.object,selected:b.a.string,selectRow:b.a.func.isRequired,readOnly:b.a.bool}),ms(ds,"defaultProps",{role:{permissions:[]}});var ps=Object(a.connect)(function(e){return{config:Object(c.getConfig)(e)}})(ds);function fs(e){return(fs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function hs(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function gs(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function ys(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){gs(i,a,r,o,s,"next",e)}function s(e){gs(i,a,r,o,s,"throw",e)}o(void 0)})}}function vs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){Ts(e,t,n[t])})}return e}function _s(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Es(e){return(Es=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ss(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Os(e,t){return(Os=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ts(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ws=[Li.a.VIEW_MEMBERS,Li.a.JOIN_PUBLIC_TEAMS,Li.a.LIST_PUBLIC_TEAMS,Li.a.JOIN_PRIVATE_TEAMS,Li.a.LIST_PRIVATE_TEAMS],js=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Es(t).call(this,e),n=!r||"object"!==fs(r)&&"function"!=typeof r?Ss(a):r,Ts(Ss(n),"goToSelectedRow",function(){var e=document.querySelector(".permission-row.selected,.permission-group-row.selected");return!!e&&(n.state.openRoles.all_users?e.scrollIntoView({behavior:"smooth",block:"center"}):(n.toggleRole("all_users"),setTimeout(function(){e.scrollIntoView({behavior:"smooth",block:"center"})},300)),!0)}),Ts(Ss(n),"selectRow",function(e){n.setState({selectedPermission:e}),setTimeout(n.goToSelectedRow),setTimeout(function(){n.setState({selectedPermission:null})},3e3)}),Ts(Ss(n),"deriveRolesFromAllUsers",function(e){return{system_user:vs({},n.props.roles.system_user,{permissions:e.permissions.filter(function(e){return"system_scope"===w.v[e]})}),team_user:vs({},n.props.roles.team_user,{permissions:e.permissions.filter(function(e){return"team_scope"===w.v[e]})}),channel_user:vs({},n.props.roles.channel_user,{permissions:e.permissions.filter(function(e){return"channel_scope"===w.v[e]})})}}),Ts(Ss(n),"restoreExcludedPermissions",function(e){var t=!0,a=!1,r=void 0;try{for(var i,o=n.props.roles.system_user.permissions[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value;ws.includes(s)&&e.system_user.permissions.push(s)}}catch(e){a=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(a)throw r}}var l=!0,c=!1,u=void 0;try{for(var m,d=n.props.roles.team_user.permissions[Symbol.iterator]();!(l=(m=d.next()).done);l=!0){var p=m.value;ws.includes(p)&&e.team_user.permissions.push(p)}}catch(e){c=!0,u=e}finally{try{l||null==d.return||d.return()}finally{if(c)throw u}}var f=!0,b=!1,h=void 0;try{for(var g,y=n.props.roles.channel_user.permissions[Symbol.iterator]();!(f=(g=y.next()).done);f=!0){var v=g.value;ws.includes(v)&&e.channel_user.permissions.push(v)}}catch(e){b=!0,h=e}finally{try{f||null==y.return||y.return()}finally{if(b)throw h}}return e}),Ts(Ss(n),"handleSubmit",ys(regeneratorRuntime.mark(function e(){var t,a,r,i,o,s,l,c,u,m,d,p,f,b,h;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.props.actions.editRole(n.state.roles.team_admin),a=n.props.actions.editRole(n.state.roles.channel_admin),r=n.restoreExcludedPermissions(n.deriveRolesFromAllUsers(n.state.roles.all_users)),i=n.props.actions.editRole(r.system_user),o=n.props.actions.editRole(r.team_user),s=n.props.actions.editRole(r.channel_user),n.setState({saving:!0}),e.next=9,Promise.all([t,a,i,o,s]);case 9:l=e.sent,c=null,u=!1,m=!0,d=!1,p=void 0,e.prev=15,f=l[Symbol.iterator]();case 17:if(m=(b=f.next()).done){e.next=26;break}if(!(h=b.value).error){e.next=23;break}return c=h.error.message,u=!0,e.abrupt("break",26);case 23:m=!0,e.next=17;break;case 26:e.next=32;break;case 28:e.prev=28,e.t0=e.catch(15),d=!0,p=e.t0;case 32:e.prev=32,e.prev=33,m||null==f.return||f.return();case 35:if(e.prev=35,!d){e.next=38;break}throw p;case 38:return e.finish(35);case 39:return e.finish(32);case 40:n.setState({serverError:c,saving:!1,saveNeeded:u}),n.props.actions.setNavigationBlocked(u);case 42:case"end":return e.stop()}},e,null,[[15,28,32,40],[33,,35,39]])}))),Ts(Ss(n),"toggleRole",function(e){var t=vs({},n.state.openRoles);t[e]=!t[e],n.setState({openRoles:t})}),Ts(Ss(n),"togglePermission",function(e,t){var a=vs({},n.state.roles),r=vs({},a[e]),i=hs(r.permissions),o=!0,s=!1,l=void 0;try{for(var c,u=t[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var m=c.value;-1===i.indexOf(m)?i.push(m):i.splice(i.indexOf(m),1)}}catch(e){s=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(s)throw l}}r.permissions=i,a[e]=r,n.setState({roles:a,saveNeeded:!0}),n.props.actions.setNavigationBlocked(!0)}),Ts(Ss(n),"resetDefaults",function(){var e=JSON.parse(JSON.stringify(vs({},n.state.roles)));Object.entries(w.j).forEach(function(t){var n=bs(t,2),a=n[0],r=n[1];e[a].permissions=r}),n.setState({roles:e,saveNeeded:!0}),n.props.actions.setNavigationBlocked(!0)}),Ts(Ss(n),"render",function(){return n.state.loaded?g.a.createElement("div",{className:"wrapper--fixed"},g.a.createElement("div",{className:"admin-console__header with-back"},g.a.createElement("div",null,g.a.createElement(Wi,{to:"/admin_console/user_management/permissions",className:"fa fa-angle-left back"}),g.a.createElement(E.c,{id:"admin.permissions.systemScheme",defaultMessage:"System Scheme"}))),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement("div",{className:"banner info"},g.a.createElement("div",{className:"banner__content"},g.a.createElement("span",null,g.a.createElement(Xt.b,{id:"admin.permissions.systemScheme.introBanner",defaultMessage:"Configure the default permissions for Team Admins, Channel Admins and other members. This scheme is inherited by all teams unless a [Team Override Scheme](!https://about.mattermost.com/default-team-override-scheme) is applied in specific teams."})))),g.a.createElement($i,{className:"permissions-block",open:n.state.openRoles.all_users,id:"all_users",onToggle:function(){return n.toggleRole("all_users")},titleId:Object(A.b)("admin.permissions.systemScheme.allMembersTitle"),titleDefault:"All Members",subtitleId:Object(A.b)("admin.permissions.systemScheme.allMembersDescription"),subtitleDefault:"Permissions granted to all members, including administrators and newly created users."},g.a.createElement(ps,{selected:n.state.selectedPermission,role:n.state.roles.all_users,scope:"system_scope",onToggle:n.togglePermission,selectRow:n.selectRow})),g.a.createElement($i,{className:"permissions-block",open:n.state.openRoles.channel_admin,onToggle:function(){return n.toggleRole("channel_admin")},titleId:Object(A.b)("admin.permissions.systemScheme.channelAdminsTitle"),titleDefault:"Channel Administrators",subtitleId:Object(A.b)("admin.permissions.systemScheme.channelAdminsDescription"),subtitleDefault:"Permissions granted to channel creators and any users promoted to Channel Administrator."},g.a.createElement(ps,{parentRole:n.state.roles.all_users,role:n.state.roles.channel_admin,scope:"channel_scope",onToggle:n.togglePermission,selectRow:n.selectRow})),g.a.createElement($i,{className:"permissions-block",open:n.state.openRoles.team_admin,onToggle:function(){return n.toggleRole("team_admin")},titleId:Object(A.b)("admin.permissions.systemScheme.teamAdminsTitle"),titleDefault:"Team Administrators",subtitleId:Object(A.b)("admin.permissions.systemScheme.teamAdminsDescription"),subtitleDefault:"Permissions granted to team creators and any users promoted to Team Administrator."},g.a.createElement(ps,{parentRole:n.state.roles.all_users,role:n.state.roles.team_admin,scope:"team_scope",onToggle:n.togglePermission,selectRow:n.selectRow})),g.a.createElement($i,{className:"permissions-block",open:n.state.openRoles.system_admin,onToggle:function(){return n.toggleRole("system_admin")},titleId:Object(A.b)("admin.permissions.systemScheme.systemAdminsTitle"),titleDefault:"System Administrators",subtitleId:Object(A.b)("admin.permissions.systemScheme.systemAdminsDescription"),subtitleDefault:"Full permissions granted to System Administrators."},g.a.createElement(ps,{readOnly:!0,role:n.state.roles.system_admin,scope:"system_scope",onToggle:n.togglePermission,selectRow:n.selectRow})))),g.a.createElement("div",{className:"admin-console-save"},g.a.createElement(nn.a,{saving:n.state.saving,disabled:!n.state.saveNeeded||n.canSave&&!n.canSave(),onClick:n.handleSubmit,savingMessage:Object(N.ab)("admin.saving","Saving Config...")}),g.a.createElement(Wi,{className:"cancel-button",to:"/admin_console/user_management/permissions"},g.a.createElement(E.c,{id:"admin.permissions.permissionSchemes.cancel",defaultMessage:"Cancel"})),g.a.createElement("a",{onClick:function(){return n.setState({showResetDefaultModal:!0})},className:"cancel-button reset-defaults-btn"},g.a.createElement(E.c,{id:"admin.permissions.systemScheme.resetDefaultsButton",defaultMessage:"Reset to Defaults"})),g.a.createElement("div",{className:"error-message"},g.a.createElement(Se.a,{error:n.state.serverError}))),g.a.createElement(Sn.a,{show:n.state.showResetDefaultModal,title:g.a.createElement(E.c,{id:"admin.permissions.systemScheme.resetDefaultsButtonModalTitle",defaultMessage:"Reset to Default?"}),message:g.a.createElement(E.c,{id:"admin.permissions.systemScheme.resetDefaultsButtonModalBody",defaultMessage:"This will reset all selections on this page to their default settings. Are you sure you want to reset?"}),confirmButtonText:g.a.createElement(E.c,{id:"admin.permissions.systemScheme.resetDefaultsConfirmationButton",defaultMessage:"Yes, Reset"}),onConfirm:function(){n.resetDefaults(),n.setState({showResetDefaultModal:!1})},onCancel:function(){return n.setState({showResetDefaultModal:!1})}})):g.a.createElement(W.a,null)}),n.state={showResetDefaultModal:!1,loaded:!1,saving:!1,saveNeeded:!1,serverError:null,roles:{},openRoles:{all_users:!0,system_admin:!0,team_admin:!0,channel_admin:!0}},n.rolesNeeded=["system_admin","system_user","team_admin","team_user","channel_admin","channel_user"],n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Os(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidMount",value:function(){var e=this;this.props.actions.loadRolesIfNeeded(this.rolesNeeded),this.rolesNeeded.every(function(t){return e.props.roles[t]})&&this.loadRolesIntoState(this.props)}},{key:"componentWillReceiveProps",value:function(e){!this.state.loaded&&this.rolesNeeded.every(function(t){return e.roles[t]})&&this.loadRolesIntoState(e)}},{key:"loadRolesIntoState",value:function(e){var t=e.roles,n=t.system_admin,a=t.team_admin,r=t.channel_admin,i=t.system_user,o=t.team_user,s=t.channel_user;this.setState({selectedPermission:null,loaded:!0,roles:{system_admin:n,team_admin:a,channel_admin:r,all_users:{name:"all_users",displayName:"All members",permissions:i.permissions.concat(o.permissions).concat(s.permissions)}}})}}])&&_s(n.prototype,a),r&&_s(n,r),t}();Ts(js,"propTypes",{roles:b.a.object.isRequired,license:b.a.object.isRequired,actions:b.a.shape({loadRolesIfNeeded:b.a.func.isRequired,editRole:b.a.func.isRequired,setNavigationBlocked:b.a.func.isRequired}).isRequired});var xs=Object(a.connect)(function(e){return{roles:Object(u.getRoles)(e),rolesRequest:e.requests.roles.getRolesByNames}},function(e){return{actions:Object(r.bindActionCreators)({loadRolesIfNeeded:o.loadRolesIfNeeded,editRole:o.editRole,setNavigationBlocked:d.C},e)}})(js),Ps=(n(185),n(1547)),ks=n(1572);function Cs(e){return(Cs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ms(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Rs(e,t){return!t||"object"!==Cs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ns(e){return(Ns=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function As(e,t){return(As=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ds=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Rs(this,Ns(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&As(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){var e=this.props.team,t=Object(N.I)(e),n=null;return n=t?g.a.createElement("div",{className:"team-btn__image",style:{backgroundImage:"url('".concat(t,"')")}}):g.a.createElement("div",{className:"team-btn__initials"},e.display_name?e.display_name.replace(/\s/g,"").substring(0,2):"??"),g.a.createElement("div",{className:"team-info-block"},g.a.createElement("span",{className:"icon"},n),g.a.createElement("div",{className:"team-data"},g.a.createElement("div",{className:"title"},e.display_name)))}}])&&Ms(n.prototype,a),r&&Ms(n,r),t}();function Ls(e){return(Ls="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Is(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Us(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){Is(i,a,r,o,s,"next",e)}function s(e){Is(i,a,r,o,s,"throw",e)}o(void 0)})}}function qs(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Bs(e){return(Bs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gs(e,t){return(Gs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Ds,"propTypes",{team:b.a.object.isRequired});var Ys=50,Ws=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Bs(t).call(this,e),n=!r||"object"!==Ls(r)&&"function"!=typeof r?Fs(a):r,Hs(Fs(n),"handleHide",function(){n.props.actions.setModalSearchTerm(""),n.setState({show:!1})}),Hs(Fs(n),"handleExit",function(){n.props.onModalDismissed&&n.props.onModalDismissed()}),Hs(Fs(n),"handleSubmit",function(e){e&&e.preventDefault(),0!==n.state.values.length&&(n.props.onTeamsSelected(n.state.values),n.handleHide())}),Hs(Fs(n),"addValue",function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n.props.modalID!==w.r.ADD_TEAMS_TO_SCHEME||null===e.scheme_id||""===e.scheme_id||t){var a=Object.assign([],n.state.values),r=a.map(function(e){return e.id});e&&e.id&&-1===r.indexOf(e.id)&&a.push(e),n.setState({values:a,confirmAddModal:!1,confirmAddTeam:null})}else n.setState({confirmAddModal:!0,confirmAddTeam:e})}),Hs(Fs(n),"setTeamsLoadingState",function(e){n.setState({loadingTeams:e})}),Hs(Fs(n),"handlePageChange",function(e,t){e>t&&(n.setTeamsLoadingState(!0),n.props.actions.loadTeams(e,Ys+1).then(function(){n.setTeamsLoadingState(!1)}))}),Hs(Fs(n),"handleDelete",function(e){n.setState({values:e})}),Hs(Fs(n),"search",function(e,t){0!==t.state.page&&t.setState({page:0}),n.props.actions.setModalSearchTerm(e)}),n.searchTimeoutId=0,n.state={values:[],show:!0,search:!1,loadingTeams:!0,confirmAddModal:!1,confirmAddTeam:null},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gs(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidMount",value:function(){var e=this;this.props.actions.loadTeams(0,Ys+1).then(function(){e.setTeamsLoadingState(!1)})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this;if(this.props.searchTerm!==e.searchTerm){clearTimeout(this.searchTimeoutId);var n=e.searchTerm;if(""===n)return;this.searchTimeoutId=setTimeout(Us(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.setTeamsLoadingState(!0),e.next=3,t.props.actions.searchTeams(n);case 3:t.setTeamsLoadingState(!1);case 4:case"end":return e.stop()}},e)})),w.Q.SEARCH_TIMEOUT_MILLISECONDS)}}},{key:"renderOption",value:function(e,t,n){var a="";return t&&(a="more-modal__row--selected"),g.a.createElement("div",{key:e.id,ref:t?"selected":e.id,className:"more-modal__row clickable "+a,onClick:function(){return n(e)}},g.a.createElement("div",{className:"more-modal__details"},g.a.createElement(Ds,{team:e})),g.a.createElement("div",{className:"more-modal__actions"},g.a.createElement("div",{className:"more-modal__actions--round"},g.a.createElement("i",{className:"fa fa-plus"}))))}},{key:"renderValue",value:function(e){return e.data.display_name}},{key:"renderConfirmModal",value:function(e,t){var n=this,a=g.a.createElement(E.c,{id:"add_teams_to_scheme.confirmation.title",defaultMessage:"Team Override Scheme Change?"}),r=g.a.createElement(E.c,{id:"add_teams_to_scheme.confirmation.message",defaultMessage:"This team is already selected in another team scheme, are you sure you want to move it to this team scheme?"}),i=g.a.createElement(E.c,{id:"add_teams_to_scheme.confirmation.accept",defaultMessage:"Yes, Move Team"});return g.a.createElement(Sn.a,{show:e,title:a,message:r,confirmButtonText:i,onCancel:function(){return n.setState({confirmAddModal:!1,confirmAddTeam:null})},onConfirm:function(){return n.addValue(t,!0)}})}},{key:"render",value:function(){var e=this,t=this.renderConfirmModal(this.state.confirmAddModal,this.state.confirmAddTeam),n=g.a.createElement(E.c,{id:"multiselect.selectTeams",defaultMessage:"Use ↑↓ to browse, ↵ to select."}),a=Object(N.ab)("multiselect.add","Add"),r=[];return this.props.teams&&(r=(r=(r=this.props.teams.filter(function(e){return 0===e.delete_at})).filter(function(t){return t.scheme_id!==e.currentSchemeId})).filter(function(t){return-1===e.props.alreadySelected.indexOf(t.id)})).sort(function(e,t){var n=e.display_name.toUpperCase(),a=t.display_name.toUpperCase();return n===a?0:n>a?1:-1}),g.a.createElement(Xo.a,{dialogClassName:"a11y__modal more-modal more-direct-channels team-selector-modal",show:this.state.show,onHide:this.handleHide,onExited:this.handleExit,role:"dialog","aria-labelledby":"teamSelectorModalLabel"},g.a.createElement(Xo.a.Header,{closeButton:!0},g.a.createElement(Xo.a.Title,{componentClass:"h1",id:"teamSelectorModalLabel"},g.a.createElement(Xt.b,{id:"add_teams_to_scheme.title",defaultMessage:"Add Teams To **Team Selection** List"}))),g.a.createElement(Xo.a.Body,null,t,g.a.createElement(ks.a,{key:"addTeamsToSchemeKey",options:r,optionRenderer:this.renderOption,values:this.state.values,valueRenderer:this.renderValue,perPage:Ys,handlePageChange:this.handlePageChange,handleInput:this.search,handleDelete:this.handleDelete,handleAdd:this.addValue,handleSubmit:this.handleSubmit,numRemainingText:n,buttonSubmitText:a,saving:!1,loading:this.state.loadingTeams,placeholderText:Object(N.ab)("multiselect.addTeamsPlaceholder","Search and add teams")})))}}])&&qs(n.prototype,a),r&&qs(n,r),t}();Hs(Ws,"propTypes",{currentSchemeId:b.a.string,alreadySelected:b.a.array,searchTerm:b.a.string.isRequired,teams:b.a.array.isRequired,onModalDismissed:b.a.func,onTeamsSelected:b.a.func,modalID:b.a.string,actions:b.a.shape({loadTeams:b.a.func.isRequired,setModalSearchTerm:b.a.func.isRequired,searchTeams:b.a.func.isRequired}).isRequired});var zs=Object(a.connect)(function(e){var t=e.views.search.modalSearch,n=Object.values(Object(ba.getTeams)(e)||{}).filter(function(e){return e.display_name.toLowerCase().startsWith(t.toLowerCase())||e.description.toLowerCase().startsWith(t.toLowerCase())});return{searchTerm:t,teams:n}},function(e){return{actions:Object(r.bindActionCreators)({loadTeams:pa.getTeams,setModalSearchTerm:Ps.a,searchTeams:pa.searchTeams},e)}})(Ws),Vs=function(e){var t=g.a.createElement("a",{className:"btn btn-primary",onClick:e.onButtonClick,disabled:e.disabled},g.a.createElement(E.c,{id:e.buttonTextId,defaultMessage:e.buttonTextDefault}));return g.a.createElement(di,{className:"AdminPanelWithButton "+e.className,id:e.id,titleId:e.titleId,titleDefault:e.titleDefault,subtitleId:e.subtitleId,subtitleDefault:e.subtitleDefault,button:t},e.children)};Vs.propTypes={children:b.a.node,className:b.a.string.isRequired,id:b.a.string,titleId:b.a.string.isRequired,titleDefault:b.a.string.isRequired,subtitleId:b.a.string.isRequired,subtitleDefault:b.a.string.isRequired,onButtonClick:b.a.func,disabled:b.a.bool,buttonTextId:b.a.string,buttonTextDefault:b.a.string},Vs.defaultProps={className:""};var Xs=Vs;function Js(e){return(Js="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ks(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Qs(e,t){return!t||"object"!==Js(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Zs(e){return(Zs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $s(e,t){return($s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var el=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Qs(this,Zs(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$s(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){var e=this,t=this.props.team;return g.a.createElement("div",{className:"team",key:t.id},g.a.createElement(Ds,{team:t}),g.a.createElement("a",{className:"remove",onClick:function(){return e.props.onRemoveTeam(t.id)}},g.a.createElement(E.c,{id:"admin.permissions.teamScheme.removeTeam",defaultMessage:"Remove"})))}}])&&Ks(n.prototype,a),r&&Ks(n,r),t}();!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(el,"propTypes",{team:b.a.object.isRequired,onRemoveTeam:b.a.func});var tl=Object(a.connect)(function(e){return{stats:Object(ba.getTeamStats)(e)}},function(e){return{actions:Object(r.bindActionCreators)({loadTeamStats:pa.getTeamStats},e)}})(el);function nl(e){return(nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function al(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function rl(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function il(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){rl(i,a,r,o,s,"next",e)}function s(e){rl(i,a,r,o,s,"throw",e)}o(void 0)})}}function ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){ml(e,t,n[t])})}return e}function sl(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ll(e){return(ll=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function cl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ul(e,t){return(ul=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ml(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dl=[Li.a.VIEW_MEMBERS,Li.a.JOIN_PUBLIC_TEAMS,Li.a.LIST_PUBLIC_TEAMS,Li.a.JOIN_PRIVATE_TEAMS,Li.a.LIST_PRIVATE_TEAMS],pl=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=ll(t).call(this,e),n=!r||"object"!==nl(r)&&"function"!=typeof r?cl(a):r,ml(cl(n),"isLoaded",function(e){return e.schemeId?!!(null!==e.scheme&&null!==e.teams&&e.roles[e.scheme.default_team_user_role]&&e.roles[e.scheme.default_team_admin_role]&&e.roles[e.scheme.default_channel_user_role]&&e.roles[e.scheme.default_channel_admin_role]):!!(e.roles.team_user&&e.roles.team_admin&&e.roles.channel_user&&e.roles.channel_admin)}),ml(cl(n),"goToSelectedRow",function(){var e=document.querySelector(".permission-row.selected,.permission-group-row.selected");return!!e&&(n.state.openRoles.all_users?e.scrollIntoView({behavior:"smooth",block:"center"}):(n.toggleRole("all_users"),setTimeout(function(){e.scrollIntoView({behavior:"smooth",block:"center"})},300)),!0)}),ml(cl(n),"selectRow",function(e){n.setState({selectedPermission:e}),setTimeout(n.goToSelectedRow),setTimeout(function(){n.setState({selectedPermission:null})},3e3)}),ml(cl(n),"getStateRoles",function(){if(null!==n.state.roles)return n.state.roles;var e=null,t=null,a=null,r=null;if(n.props.schemeId)n.isLoaded(n.props)&&(e=n.props.roles[n.props.scheme.default_team_user_role],t=n.props.roles[n.props.scheme.default_team_admin_role],a=n.props.roles[n.props.scheme.default_channel_user_role],r=n.props.roles[n.props.scheme.default_channel_admin_role]);else{if(!n.isLoaded(n.props))return null;e=n.props.roles.team_user,t=n.props.roles.team_admin,a=n.props.roles.channel_user,r=n.props.roles.channel_admin}return{team_admin:t,channel_admin:r,all_users:{name:"all_users",displayName:"All members",permissions:e.permissions.concat(a.permissions)}}}),ml(cl(n),"deriveRolesFromAllUsers",function(e,t,n){return{team_user:ol({},e,{permissions:n.permissions.filter(function(e){return"team_scope"===w.v[e]})}),channel_user:ol({},t,{permissions:n.permissions.filter(function(e){return"channel_scope"===w.v[e]})})}}),ml(cl(n),"restoreExcludedPermissions",function(e,t,n){var a=!0,r=!1,i=void 0;try{for(var o,s=e.permissions[Symbol.iterator]();!(a=(o=s.next()).done);a=!0){var l=o.value;dl.includes(l)&&n.team_user.permissions.push(l)}}catch(e){r=!0,i=e}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}var c=!0,u=!1,m=void 0;try{for(var d,p=t.permissions[Symbol.iterator]();!(c=(d=p.next()).done);c=!0){var f=d.value;dl.includes(f)&&n.channel_user.permissions.push(f)}}catch(e){u=!0,m=e}finally{try{c||null==p.return||p.return()}finally{if(u)throw m}}return n}),ml(cl(n),"handleNameChange",function(e){n.setState({schemeName:e.target.value,saveNeeded:!0}),n.props.actions.setNavigationBlocked(!0)}),ml(cl(n),"handleDescriptionChange",function(e){n.setState({schemeDescription:e.target.value,saveNeeded:!0}),n.props.actions.setNavigationBlocked(!0)}),ml(cl(n),"handleSubmit",il(regeneratorRuntime.mark(function e(){var t,a,r,i,o,s,l,c,u,m,d,p,f,b,h,g,y,v,_,E,S,O,T,w,j,x,P,k,C,M,R,N,A,D,L,I,U,q,B,F,G,H,Y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.getStateRoles(),a=t.team_admin,r=t.channel_admin,i=t.all_users,o=n.state.schemeName||n.props.scheme&&n.props.scheme.display_name||"",s=n.state.schemeDescription||n.props.scheme&&n.props.scheme.description||"",l=null,c=null,u=null,n.setState({saving:!0}),!n.props.schemeId){e.next=20;break}return m=n.deriveRolesFromAllUsers(n.props.roles[n.props.scheme.default_team_user_role],n.props.roles[n.props.scheme.default_channel_user_role],i),m=n.restoreExcludedPermissions(n.props.roles[n.props.scheme.default_team_user_role],n.props.roles[n.props.scheme.default_channel_user_role],m),l=m.team_user,c=m.channel_user,e.next=17,n.props.actions.patchScheme(n.props.schemeId,{display_name:o,description:s});case 17:u=n.props.schemeId,e.next=39;break;case 20:return d=n.deriveRolesFromAllUsers(n.props.roles.team_user,n.props.roles.channel_user,i),d=n.restoreExcludedPermissions(n.props.roles.team_user,n.props.roles.channel_user,d),l=d.team_user,c=d.channel_user,e.next=26,n.props.actions.createScheme({display_name:o,description:s,scope:"team"});case 26:if(!(p=e.sent).error){e.next=31;break}return n.setState({serverError:p.error.message,saving:!1,saveNeeded:!0}),n.props.actions.setNavigationBlocked(!0),e.abrupt("return");case 31:return f=p.data,u=f.id,e.next=35,n.props.actions.loadRolesIfNeeded([f.default_team_user_role,f.default_team_admin_role,f.default_channel_user_role,f.default_channel_admin_role]);case 35:l=ol({},l,{id:n.props.roles[f.default_team_user_role].id}),a=ol({},a,{id:n.props.roles[f.default_team_admin_role].id}),c=ol({},c,{id:n.props.roles[f.default_channel_user_role].id}),r=ol({},r,{id:n.props.roles[f.default_channel_admin_role].id});case 39:for(b=n.props.actions.editRole(a),h=n.props.actions.editRole(r),g=n.props.actions.editRole(l),y=n.props.actions.editRole(c),v=[],_=new Set((n.state.teams||n.props.teams||[]).map(function(e){return e.id})),E=new Set((n.props.teams||[]).map(function(e){return e.id})),S=new Set(al(_).filter(function(e){return!E.has(e)})),O=new Set(al(E).filter(function(e){return!_.has(e)})),T=!0,w=!1,j=void 0,e.prev=51,x=S[Symbol.iterator]();!(T=(P=x.next()).done);T=!0)k=P.value,v.push(n.props.actions.updateTeamScheme(k,u));e.next=59;break;case 55:e.prev=55,e.t0=e.catch(51),w=!0,j=e.t0;case 59:e.prev=59,e.prev=60,T||null==x.return||x.return();case 62:if(e.prev=62,!w){e.next=65;break}throw j;case 65:return e.finish(62);case 66:return e.finish(59);case 67:for(C=!0,M=!1,R=void 0,e.prev=70,N=O[Symbol.iterator]();!(C=(A=N.next()).done);C=!0)D=A.value,v.push(n.props.actions.updateTeamScheme(D,""));e.next=78;break;case 74:e.prev=74,e.t1=e.catch(70),M=!0,R=e.t1;case 78:e.prev=78,e.prev=79,C||null==N.return||N.return();case 81:if(e.prev=81,!M){e.next=84;break}throw R;case 84:return e.finish(81);case 85:return e.finish(78);case 86:return e.next=88,Promise.all([b,h,g,y].concat(v));case 88:L=e.sent,I=null,U=!1,q=!0,B=!1,F=void 0,e.prev=94,G=L[Symbol.iterator]();case 96:if(q=(H=G.next()).done){e.next=105;break}if(!(Y=H.value).error){e.next=102;break}return I=Y.error.message,U=!0,e.abrupt("break",105);case 102:q=!0,e.next=96;break;case 105:e.next=111;break;case 107:e.prev=107,e.t2=e.catch(94),B=!0,F=e.t2;case 111:e.prev=111,e.prev=112,q||null==G.return||G.return();case 114:if(e.prev=114,!B){e.next=117;break}throw F;case 117:return e.finish(114);case 118:return e.finish(111);case 119:n.setState({serverError:I,saving:!1,saveNeeded:U}),n.props.actions.setNavigationBlocked(U),n.props.history.push("/admin_console/user_management/permissions");case 122:case"end":return e.stop()}},e,null,[[51,55,59,67],[60,,62,66],[70,74,78,86],[79,,81,85],[94,107,111,119],[112,,114,118]])}))),ml(cl(n),"toggleRole",function(e){var t=ol({},n.state.openRoles);t[e]=!t[e],n.setState({openRoles:t})}),ml(cl(n),"togglePermission",function(e,t){var a=ol({},n.getStateRoles()),r=null;a.team_admin.name===e?r=ol({},a.team_admin):a.channel_admin.name===e?r=ol({},a.channel_admin):a.all_users.name===e&&(r=ol({},a.all_users));var i=al(r.permissions),o=!0,s=!1,l=void 0;try{for(var c,u=t[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var m=c.value;-1===i.indexOf(m)?i.push(m):i.splice(i.indexOf(m),1)}}catch(e){s=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(s)throw l}}r.permissions=i,a.team_admin.name===e?a.team_admin=r:a.channel_admin.name===e?a.channel_admin=r:a.all_users.name===e&&(a.all_users=r),n.setState({roles:a,saveNeeded:!0}),n.props.actions.setNavigationBlocked(!0)}),ml(cl(n),"openAddTeam",function(){n.setState({addTeamOpen:!0})}),ml(cl(n),"removeTeam",function(e){var t=(n.state.teams||n.props.teams).filter(function(t){return t.id!==e});n.setState({teams:t,saveNeeded:!0}),n.props.actions.setNavigationBlocked(!0)}),ml(cl(n),"addTeams",function(e){var t=n.state.teams||n.props.teams||[];n.setState({teams:[].concat(al(t),al(e)),saveNeeded:!0}),n.props.actions.setNavigationBlocked(!0)}),ml(cl(n),"closeAddTeam",function(){n.setState({addTeamOpen:!1})}),ml(cl(n),"render",function(){if(!n.isLoaded(n.props))return g.a.createElement(W.a,null);var e=n.getStateRoles(),t=n.state.teams||n.props.teams||[],a=n.state.schemeName||n.props.scheme&&n.props.scheme.display_name||"",r=n.state.schemeDescription||n.props.scheme&&n.props.scheme.description||"";return g.a.createElement("div",{className:"wrapper--fixed"},n.state.addTeamOpen&&g.a.createElement(zs,{modalID:w.r.ADD_TEAMS_TO_SCHEME,onModalDismissed:n.closeAddTeam,onTeamsSelected:n.addTeams,currentSchemeId:n.props.schemeId,alreadySelected:t.map(function(e){return e.id})}),g.a.createElement("div",{className:"admin-console__header with-back"},g.a.createElement("div",null,g.a.createElement(Wi,{to:"/admin_console/user_management/permissions",className:"fa fa-angle-left back"}),g.a.createElement(E.c,{id:"admin.permissions.teamScheme",defaultMessage:"Team Scheme"}))),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement("div",{className:"banner info"},g.a.createElement("div",{className:"banner__content"},g.a.createElement("span",null,g.a.createElement(Xt.b,{id:"admin.permissions.teamScheme.introBanner",defaultMessage:"[Team Override Schemes](!https://about.mattermost.com/default-team-override-scheme) set the permissions for Team Admins, Channel Admins and other members in specific teams. Use a Team Override Scheme when specific teams need permission exceptions to the [System Scheme](!https://about.mattermost.com/default-system-scheme)."})))),g.a.createElement(di,{titleId:Object(A.b)("admin.permissions.teamScheme.schemeDetailsTitle"),titleDefault:"Scheme Details",subtitleId:Object(A.b)("admin.permissions.teamScheme.schemeDetailsDescription"),subtitleDefault:"Set the name and description for this scheme."},g.a.createElement("div",{className:"team-scheme-details"},g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label",htmlFor:"scheme-name"},g.a.createElement(E.c,{id:"admin.permissions.teamScheme.schemeNameLabel",defaultMessage:"Scheme Name:"})),g.a.createElement(Tr.a,{id:"scheme-name",className:"form-control",type:"text",value:a,placeholder:{id:Object(A.b)("admin.permissions.teamScheme.schemeNamePlaceholder"),defaultMessage:"Scheme Name"},onChange:n.handleNameChange})),g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label",htmlFor:"scheme-description"},g.a.createElement(E.c,{id:"admin.permissions.teamScheme.schemeDescriptionLabel",defaultMessage:"Scheme Description:"})),g.a.createElement("textarea",{id:"scheme-description",className:"form-control",rows:"5",value:r,placeholder:Object(N.ab)("admin.permissions.teamScheme.schemeDescriptionPlaceholder","Scheme Description"),onChange:n.handleDescriptionChange})))),g.a.createElement(Xs,{className:"permissions-block",titleId:Object(A.b)("admin.permissions.teamScheme.selectTeamsTitle"),titleDefault:"Select teams to override permissions",subtitleId:Object(A.b)("admin.permissions.teamScheme.selectTeamsDescription"),subtitleDefault:"Select teams where permission exceptions are required.",onButtonClick:n.openAddTeam,buttonTextId:Object(A.b)("admin.permissions.teamScheme.addTeams"),buttonTextDefault:"Add Teams"},g.a.createElement("div",{className:"teams-list"},0===t.length&&g.a.createElement("div",{className:"no-team-schemes"},g.a.createElement(E.c,{id:"admin.permissions.teamScheme.noTeams",defaultMessage:"No team selected. Please add teams to this list."})),t.map(function(e){return g.a.createElement(tl,{key:e.id,team:e,onRemoveTeam:n.removeTeam})}))),g.a.createElement($i,{className:"permissions-block all_users",open:n.state.openRoles.all_users,id:"all_users",onToggle:function(){return n.toggleRole("all_users")},titleId:Object(A.b)("admin.permissions.systemScheme.allMembersTitle"),titleDefault:"All Members",subtitleId:Object(A.b)("admin.permissions.systemScheme.allMembersDescription"),subtitleDefault:"Permissions granted to all members, including administrators and newly created users."},g.a.createElement(ps,{selected:n.state.selectedPermission,role:e.all_users,scope:"team_scope",onToggle:n.togglePermission,selectRow:n.selectRow})),g.a.createElement($i,{className:"permissions-block channel_admin",open:n.state.openRoles.channel_admin,onToggle:function(){return n.toggleRole("channel_admin")},titleId:Object(A.b)("admin.permissions.systemScheme.channelAdminsTitle"),titleDefault:"Channel Administrators",subtitleId:Object(A.b)("admin.permissions.systemScheme.channelAdminsDescription"),subtitleDefault:"Permissions granted to channel creators and any users promoted to Channel Administrator."},g.a.createElement(ps,{parentRole:e.all_users,role:e.channel_admin,scope:"channel_scope",onToggle:n.togglePermission,selectRow:n.selectRow})),g.a.createElement($i,{className:"permissions-block team_admin",open:n.state.openRoles.team_admin,onToggle:function(){return n.toggleRole("team_admin")},titleId:Object(A.b)("admin.permissions.systemScheme.teamAdminsTitle"),titleDefault:"Team Administrators",subtitleId:Object(A.b)("admin.permissions.systemScheme.teamAdminsDescription"),subtitleDefault:"Permissions granted to team creators and any users promoted to Team Administrator."},g.a.createElement(ps,{parentRole:e.all_users,role:e.team_admin,scope:"team_scope",onToggle:n.togglePermission,selectRow:n.selectRow})))),g.a.createElement("div",{className:"admin-console-save"},g.a.createElement(nn.a,{saving:n.state.saving,disabled:!n.state.saveNeeded||n.canSave&&!n.canSave(),onClick:n.handleSubmit,savingMessage:Object(N.ab)("admin.saving","Saving Config...")}),g.a.createElement(Wi,{className:"cancel-button",to:"/admin_console/user_management/permissions"},g.a.createElement(E.c,{id:"admin.permissions.permissionSchemes.cancel",defaultMessage:"Cancel"})),g.a.createElement("div",{className:"error-message"},g.a.createElement(Se.a,{error:n.state.serverError}))))}),n.state={saving:!1,saveNeeded:!1,serverError:null,roles:null,teams:null,addTeamOpen:!1,selectedPermission:null,openRoles:{all_users:!0,team_admin:!0,channel_admin:!0}},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ul(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidMount",value:function(){var e=this;this.props.actions.loadRolesIfNeeded(["team_admin","team_user","channel_admin","channel_user"]),this.props.schemeId&&(this.props.actions.loadScheme(this.props.schemeId).then(function(t){e.props.actions.loadRolesIfNeeded([t.data.default_team_user_role,t.data.default_team_admin_role,t.data.default_channel_user_role,t.data.default_channel_admin_role])}),this.props.actions.loadSchemeTeams(this.props.schemeId))}}])&&sl(n.prototype,a),r&&sl(n,r),t}();ml(pl,"propTypes",{schemeId:b.a.string,scheme:b.a.object,roles:b.a.object,teams:b.a.array,actions:b.a.shape({loadRolesIfNeeded:b.a.func.isRequired,loadScheme:b.a.func.isRequired,loadSchemeTeams:b.a.func.isRequired,editRole:b.a.func.isRequired,patchScheme:b.a.func.isRequired,createScheme:b.a.func.isRequired,updateTeamScheme:b.a.func.isRequired,setNavigationBlocked:b.a.func.isRequired}).isRequired}),ml(pl,"defaultProps",{scheme:null});var fl=Object(a.connect)(function(){var e=Object(ui.makeGetSchemeTeams)();return function(t,n){var a=n.match.params.scheme_id;return{schemeId:a,scheme:a?Object(ui.getScheme)(t,a):null,teams:a?e(t,{schemeId:a}):null,roles:Object(u.getRoles)(t),rolesRequest:t.requests.roles.getRolesByNames}}},function(e){return{actions:Object(r.bindActionCreators)({loadRolesIfNeeded:o.loadRolesIfNeeded,loadScheme:ci.getScheme,loadSchemeTeams:ci.getSchemeTeams,editRole:o.editRole,patchScheme:ci.patchScheme,updateTeamScheme:pa.updateTeamScheme,createScheme:ci.createScheme,setNavigationBlocked:d.C},e)}})(pl),bl=n(311),hl=n(122);function gl(e){var t={};return e===w.L.SYSTEM_ADMIN?t[w.M.ROLE]=w.L.SYSTEM_ADMIN:e===w.L.INACTIVE&&(t[w.M.INACTIVE]=!0),t}function yl(e){var t={};return e===w.L.SYSTEM_ADMIN?t[w.N.ROLE]=w.L.SYSTEM_ADMIN:e===w.L.INACTIVE&&(t[w.N.ALLOW_INACTIVE]=!0),t}var vl=n(107),_l=n(1506);function El(e){return(El="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sl(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Ol(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){Sl(i,a,r,o,s,"next",e)}function s(e){Sl(i,a,r,o,s,"throw",e)}o(void 0)})}}function Tl(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function wl(e){return(wl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function jl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xl(e,t){return(xl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kl(e){var t=e.user&&e.user.roles?e.user.roles:"";return{error:null,hasPostAllRole:vl.hasPostAllRole(t),hasPostAllPublicRole:vl.hasPostAllPublicRole(t),hasUserAccessTokenRole:vl.hasUserAccessTokenRole(t),isSystemAdmin:vl.isSystemAdmin(t)}}var Cl=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=wl(t).call(this,e),n=!r||"object"!==El(r)&&"function"!=typeof r?jl(a):r,Pl(jl(n),"handleError",function(e){n.setState({error:e})}),Pl(jl(n),"handleSystemAdminChange",function(e){"systemadmin"===e.target.name?n.setState({isSystemAdmin:!0}):"systemmember"===e.target.name&&n.setState({isSystemAdmin:!1})}),Pl(jl(n),"handleUserAccessTokenChange",function(e){n.setState({hasUserAccessTokenRole:e.target.checked})}),Pl(jl(n),"handlePostAllChange",function(e){n.setState({hasPostAllRole:e.target.checked})}),Pl(jl(n),"handlePostAllPublicChange",function(e){n.setState({hasPostAllPublicRole:e.target.checked})}),Pl(jl(n),"trackRoleChanges",function(e,t){vl.hasUserAccessTokenRole(e)&&!vl.hasUserAccessTokenRole(t)?Object(hr.d)("actions","add_roles",{role:j.General.SYSTEM_USER_ACCESS_TOKEN_ROLE}):!vl.hasUserAccessTokenRole(e)&&vl.hasUserAccessTokenRole(t)&&Object(hr.d)("actions","remove_roles",{role:j.General.SYSTEM_USER_ACCESS_TOKEN_ROLE}),vl.hasPostAllRole(e)&&!vl.hasPostAllRole(t)?Object(hr.d)("actions","add_roles",{role:j.General.SYSTEM_POST_ALL_ROLE}):!vl.hasPostAllRole(e)&&vl.hasPostAllRole(t)&&Object(hr.d)("actions","remove_roles",{role:j.General.SYSTEM_POST_ALL_ROLE}),vl.hasPostAllPublicRole(e)&&!vl.hasPostAllPublicRole(t)?Object(hr.d)("actions","add_roles",{role:j.General.SYSTEM_POST_ALL_PUBLIC_ROLE}):!vl.hasPostAllPublicRole(e)&&vl.hasPostAllPublicRole(t)&&Object(hr.d)("actions","remove_roles",{role:j.General.SYSTEM_POST_ALL_PUBLIC_ROLE})}),Pl(jl(n),"handleSave",Ol(regeneratorRuntime.mark(function e(){var t,a,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n.setState({error:null}),t=j.General.SYSTEM_USER_ROLE,n.state.isSystemAdmin?t+=" "+j.General.SYSTEM_ADMIN_ROLE:n.state.hasUserAccessTokenRole&&(t+=" "+j.General.SYSTEM_USER_ACCESS_TOKEN_ROLE,n.state.hasPostAllRole?t+=" "+j.General.SYSTEM_POST_ALL_ROLE:n.state.hasPostAllPublicRole&&(t+=" "+j.General.SYSTEM_POST_ALL_PUBLIC_ROLE)),e.next=5,n.props.actions.updateUserRoles(n.props.user.id,t);case 5:a=e.sent,r=a.data,n.trackRoleChanges(t,n.props.user.roles),r?n.props.onModalDismissed():n.handleError(g.a.createElement(E.c,{id:"admin.manage_roles.saveError",defaultMessage:"Unable to save roles."}));case 9:case"end":return e.stop()}},e)}))),Pl(jl(n),"renderContents",function(){var e=n.props.user;if(null==e)return g.a.createElement("div",null);var t,a,r=vl.getFullName(e);r?r+=" (@".concat(e.username,")"):r="@".concat(e.username),(n.state.hasUserAccessTokenRole||n.state.isSystemAdmin||e.is_bot)&&(t=g.a.createElement("div",null,g.a.createElement("p",null,g.a.createElement(Xt.b,{id:"admin.manage_roles.additionalRoles",defaultMessage:"Select additional permissions for the account. [Read more about roles and permissions](!https://about.mattermost.com/default-permissions)."})),g.a.createElement("div",{className:"checkbox"},g.a.createElement("label",null,g.a.createElement("input",{type:"checkbox",ref:"postall",checked:n.state.hasPostAllRole||n.state.isSystemAdmin,disabled:n.state.isSystemAdmin,onChange:n.handlePostAllChange}),g.a.createElement("strong",null,g.a.createElement(E.c,{id:"admin.manage_roles.postAllRoleTitle",defaultMessage:"post:all"})),g.a.createElement(E.c,{id:"admin.manage_roles.postAllRole",defaultMessage:"Access to post to all Mattermost channels including direct messages."}))),g.a.createElement("div",{className:"checkbox"},g.a.createElement("label",null,g.a.createElement("input",{type:"checkbox",ref:"postallpublic",checked:n.state.hasPostAllPublicRole||n.state.hasPostAllRole||n.state.isSystemAdmin,disabled:n.state.hasPostAllRole||n.state.isSystemAdmin,onChange:n.handlePostAllPublicChange}),g.a.createElement("strong",null,g.a.createElement(E.c,{id:"admin.manage_roles.postAllPublicRoleTitle",defaultMessage:"post:channels"})),g.a.createElement(E.c,{id:"admin.manage_roles.postAllPublicRole",defaultMessage:"Access to post to all Mattermost public channels."}))))),n.props.userAccessTokensEnabled&&(a=e.is_bot?g.a.createElement("div",null,g.a.createElement("div",{className:"member-row--padded member-row-lone-padding"},t)):g.a.createElement("div",null,g.a.createElement("div",{className:"checkbox"},g.a.createElement("label",null,g.a.createElement("input",{type:"checkbox",ref:"postall",checked:n.state.hasUserAccessTokenRole||n.state.isSystemAdmin,disabled:n.state.isSystemAdmin,onChange:n.handleUserAccessTokenChange}),g.a.createElement(Xt.b,{id:"admin.manage_roles.allowUserAccessTokens",defaultMessage:"Allow this account to generate [personal access tokens](!https://about.mattermost.com/default-user-access-tokens)."}),g.a.createElement("span",{className:"d-block padding-top padding-bottom light"},g.a.createElement(E.b,{id:"admin.manage_roles.allowUserAccessTokensDesc",defaultMessage:"Removing this permission doesn't delete existing tokens. To delete them, go to the user's Manage Tokens menu."})))),g.a.createElement("div",{className:"member-row--padded"},t)));var i=e.email;return e.is_bot&&(i=""),g.a.createElement("div",null,g.a.createElement("div",{className:"manage-teams__user"},g.a.createElement("img",{alt:"",className:"manage-teams__profile-picture",src:gr.Client4.getProfilePictureUrl(e.id,e.last_picture_update)}),g.a.createElement("div",{className:"manage-teams__info"},g.a.createElement("div",{className:"manage-teams__name"},r,g.a.createElement(_l.a,{show:Boolean(e.is_bot),className:"badge-admin"})),g.a.createElement("div",{className:"manage-teams__email"},i))),g.a.createElement("div",null,g.a.createElement("div",{className:"manage-row--inner"},g.a.createElement("div",{className:"radio-inline"},g.a.createElement("label",null,g.a.createElement("input",{name:"systemadmin",type:"radio",checked:n.state.isSystemAdmin,onChange:n.handleSystemAdminChange}),g.a.createElement(E.c,{id:"admin.manage_roles.systemAdmin",defaultMessage:"System Admin"}))),g.a.createElement("div",{className:"radio-inline"},g.a.createElement("label",null,g.a.createElement("input",{name:"systemmember",type:"radio",checked:!n.state.isSystemAdmin,onChange:n.handleSystemAdminChange}),g.a.createElement(E.c,{id:"admin.manage_roles.systemMember",defaultMessage:"Member"})))),a))}),n.state=kl(e),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xl(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this.props.user||{},n=e.user||{};t.id!==n.id&&this.setState(kl(e))}},{key:"render",value:function(){return g.a.createElement(Xo.a,{show:this.props.show,onHide:this.props.onModalDismissed,dialogClassName:"a11y__modal manage-teams",role:"dialog","aria-labelledby":"manageRolesModalLabel"},g.a.createElement(Xo.a.Header,{closeButton:!0},g.a.createElement(Xo.a.Title,{componentClass:"h1",id:"manageRolesModalLabel"},g.a.createElement(E.c,{id:"admin.manage_roles.manageRolesTitle",defaultMessage:"Manage Roles"}))),g.a.createElement(Xo.a.Body,null,this.renderContents(),this.state.error),g.a.createElement(Xo.a.Footer,null,g.a.createElement("button",{type:"button",className:"btn btn-link",onClick:this.props.onModalDismissed},g.a.createElement(E.c,{id:"admin.manage_roles.cancel",defaultMessage:"Cancel"})),g.a.createElement("button",{type:"button",className:"btn btn-primary",onClick:this.handleSave},g.a.createElement(E.c,{id:"admin.manage_roles.save",defaultMessage:"Save"}))))}}])&&Tl(n.prototype,a),r&&Tl(n,r),t}();Pl(Cl,"propTypes",{show:b.a.bool.isRequired,user:b.a.object,userAccessTokensEnabled:b.a.bool.isRequired,onModalDismissed:b.a.func.isRequired,actions:b.a.shape({updateUserRoles:b.a.func.isRequired}).isRequired});var Ml=Object(a.connect)(function(e){return{userAccessTokensEnabled:e.entities.admin.config.ServiceSettings.EnableUserAccessTokens}},function(e){return{actions:Object(r.bindActionCreators)({updateUserRoles:fa.updateUserRoles},e)}})(Cl),Rl=n(1623),Nl=n(1533),Al=n(1530),Dl=n(1517);function Ll(e){return(Ll="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Il(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Ul(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){Il(i,a,r,o,s,"next",e)}function s(e){Il(i,a,r,o,s,"throw",e)}o(void 0)})}}function ql(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Bl(e){return(Bl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gl(e,t){return(Gl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Yl=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=Bl(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Ll(r)&&"function"!=typeof r?Fl(a):r,Hl(Fl(n),"makeTeamAdmin",Ul(regeneratorRuntime.mark(function e(){var t,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.props.updateTeamMemberSchemeRoles(n.props.teamMember.team_id,n.props.user.id,!0,!0);case 2:t=e.sent,(a=t.error)?n.props.onError(a.message):n.props.onMemberChange(n.props.teamMember.team_id);case 5:case"end":return e.stop()}},e)}))),Hl(Fl(n),"makeMember",Ul(regeneratorRuntime.mark(function e(){var t,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.props.updateTeamMemberSchemeRoles(n.props.teamMember.team_id,n.props.user.id,!0,!1);case 2:t=e.sent,(a=t.error)?n.props.onError(a.message):n.props.onMemberChange(n.props.teamMember.team_id);case 5:case"end":return e.stop()}},e)}))),Hl(Fl(n),"removeFromTeam",function(){n.props.handleRemoveUserFromTeam(n.props.teamMember.team_id)}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gl(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){var e,t=N.L(this.props.teamMember.roles)||this.props.teamMember.scheme_admin,n=this.props.team;return e=t?N.ab("admin.user_item.teamAdmin","Team Admin"):N.ab("admin.user_item.teamMember","Team Member"),g.a.createElement(Nl.a,null,g.a.createElement("a",null,g.a.createElement("span",null,e," "),g.a.createElement("span",{className:"caret"})),g.a.createElement(Al.a,{openLeft:!0,ariaLabel:N.ab("team_members_dropdown.menuAriaLabel","Team member role change")},g.a.createElement(Dl.a,{show:!t,onClick:this.makeTeamAdmin,text:N.ab("admin.user_item.makeTeamAdmin","Make Team Admin")}),g.a.createElement(Dl.a,{show:t,onClick:this.makeMember,text:N.ab("admin.user_item.makeMember","Make Member")}),g.a.createElement(Dl.a,{show:!n.group_constrained,onClick:this.removeFromTeam,text:N.ab("team_members_dropdown.leave_team","Remove from Team")})))}}])&&ql(n.prototype,a),r&&ql(n,r),t}();function Wl(e){return(Wl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zl(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Vl(e){return(Vl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Xl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jl(e,t){return(Jl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Kl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Hl(Yl,"propTypes",{team:b.a.object.isRequired,user:b.a.object.isRequired,teamMember:b.a.object.isRequired,onError:b.a.func.isRequired,onMemberChange:b.a.func.isRequired,updateTeamMemberSchemeRoles:b.a.func.isRequired,handleRemoveUserFromTeam:b.a.func.isRequired});var Ql=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=Vl(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Wl(r)&&"function"!=typeof r?Xl(a):r,Kl(Xl(n),"handleClick",function(e){e.preventDefault(),n.props.handleRemoveUserFromTeam(n.props.teamId)}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Jl(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){return g.a.createElement("button",{className:"btn btn-danger",onClick:this.handleClick},g.a.createElement(E.c,{id:"team_members_dropdown.leave_team",defaultMessage:"Remove from Team"}))}}])&&zl(n.prototype,a),r&&zl(n,r),t}();function Zl(e){return(Zl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $l(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function ec(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){$l(i,a,r,o,s,"next",e)}function s(e){$l(i,a,r,o,s,"throw",e)}o(void 0)})}}function tc(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function nc(e){return(nc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ac(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rc(e,t){return(rc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ic(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Kl(Ql,"propTypes",{teamId:b.a.string.isRequired,handleRemoveUserFromTeam:b.a.func.isRequired});var oc=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=nc(t).call(this,e),n=!r||"object"!==Zl(r)&&"function"!=typeof r?ac(a):r,ic(ac(n),"loadTeamsAndTeamMembers",ec(regeneratorRuntime.mark(function e(){var t,a,r,i=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:n.props.user,n.getTeamMembers(t.id),e.next=4,n.props.actions.getTeamsForUser(t.id);case 4:a=e.sent,r=a.data,n.setState({teams:Object(Rl.a)(r,n.props.locale)});case 7:case"end":return e.stop()}},e)}))),ic(ac(n),"handleError",function(e){n.setState({error:e})}),ic(ac(n),"getTeamMembers",ec(regeneratorRuntime.mark(function e(){var t,a,r,i=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:n.props.user.id,e.next=3,n.props.actions.getTeamMembersForUser(t);case 3:a=e.sent,(r=a.data)&&n.setState({teamMembers:r});case 6:case"end":return e.stop()}},e)}))),ic(ac(n),"handleMemberRemove",function(e){n.setState({teams:n.state.teams.filter(function(t){return t.id!==e}),teamMembers:n.state.teamMembers.filter(function(t){return t.team_id!==e})})}),ic(ac(n),"handleRemoveUserFromTeam",function(){var e=ec(regeneratorRuntime.mark(function e(t){var a,r,i,o,s,l;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.props,r=a.actions,i=a.user,e.next=3,r.removeUserFromTeam(t,i.id);case 3:o=e.sent,s=o.data,l=o.error,s?n.handleMemberRemove(t):l&&n.handleError(l.message);case 7:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),ic(ac(n),"handleMemberChange",function(){n.getTeamMembers(n.props.user.id)}),ic(ac(n),"renderContents",function(){var e=n.props.user,t=n.state,a=t.teams,r=t.teamMembers;if(!e)return g.a.createElement(W.a,null);var i,o=N.L(e.roles),s=N.z(e);s?s+=" (@".concat(e.username,")"):s="@".concat(e.username),i=a&&r?a.map(function(t){var a,i=r.find(function(e){return e.team_id===t.id});return i?(a=o?g.a.createElement(Ql,{teamId:t.id,handleRemoveUserFromTeam:n.handleRemoveUserFromTeam}):g.a.createElement(Yl,{user:e,team:t,teamMember:i,onError:n.handleError,onMemberChange:n.handleMemberChange,updateTeamMemberSchemeRoles:n.props.actions.updateTeamMemberSchemeRoles,handleRemoveUserFromTeam:n.handleRemoveUserFromTeam}),g.a.createElement("div",{key:t.id,className:"manage-teams__team"},g.a.createElement("div",{className:"manage-teams__team-name"},t.display_name),g.a.createElement("div",{className:"manage-teams__team-actions"},a))):null}):g.a.createElement(W.a,null);var l=null;return o&&(l=g.a.createElement("div",{className:"manage-teams__system-admin"},g.a.createElement(E.c,{id:"admin.user_item.sysAdmin",defaultMessage:"System Admin"}))),g.a.createElement("div",null,g.a.createElement("div",{className:"manage-teams__user"},g.a.createElement("img",{alt:"",className:"manage-teams__profile-picture",src:gr.Client4.getProfilePictureUrl(e.id,e.last_picture_update)}),g.a.createElement("div",{className:"manage-teams__info"},g.a.createElement("div",{className:"manage-teams__name"},s),g.a.createElement("div",{className:"manage-teams__email"},e.email)),l),g.a.createElement("div",{className:"manage-teams__teams"},i))}),n.state={error:null,teams:null,teamMembers:null},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rc(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidMount",value:function(){this.props.user&&this.loadTeamsAndTeamMembers()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){(this.props.user?this.props.user.id:"")!==(e.user?e.user.id:"")&&(this.setState({teams:null,teamMembers:null}),e.user&&this.loadTeamsAndTeamMembers(e.user))}},{key:"render",value:function(){return g.a.createElement(Xo.a,{show:this.props.show,onHide:this.props.onModalDismissed,dialogClassName:"a11y__modal manage-teams modal--overflow-visible",role:"dialog","aria-labelledby":"manageTeamsModalLabel"},g.a.createElement(Xo.a.Header,{closeButton:!0},g.a.createElement(Xo.a.Title,{componentClass:"h1",id:"manageTeamsModalLabel"},g.a.createElement(E.c,{id:"admin.user_item.manageTeams",defaultMessage:"Manage Teams"}))),g.a.createElement(Xo.a.Body,null,this.renderContents()))}}])&&tc(n.prototype,a),r&&tc(n,r),t}();ic(oc,"propTypes",{locale:b.a.string.isRequired,onModalDismissed:b.a.func.isRequired,show:b.a.bool.isRequired,user:b.a.object,actions:b.a.shape({getTeamMembersForUser:b.a.func.isRequired,getTeamsForUser:b.a.func.isRequired,updateTeamMemberSchemeRoles:b.a.func.isRequired,removeUserFromTeam:b.a.func.isRequired}).isRequired});var sc=Object(a.connect)(function(e){return{locale:Object(ga.a)(e)}},function(e){return{actions:Object(r.bindActionCreators)({getTeamMembersForUser:pa.getTeamMembersForUser,getTeamsForUser:pa.getTeamsForUser,updateTeamMemberSchemeRoles:pa.updateTeamMemberSchemeRoles,removeUserFromTeam:pa.removeUserFromTeam},e)}})(oc);function lc(e){return(lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cc(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function uc(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function mc(e){return(mc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function dc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pc(e,t){return(pc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function fc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bc=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=mc(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==lc(r)&&"function"!=typeof r?dc(a):r,fc(dc(n),"handleClick",function(){var e,t=(e=regeneratorRuntime.mark(function e(t){var a,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,n.props.actions.revokeUserAccessToken(n.props.tokenId);case 3:a=e.sent,r=a.error,Object(hr.d)("system_console","revoke_user_access_token"),r&&n.props.onError(r.message);case 7:case"end":return e.stop()}},e)}),function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){cc(i,a,r,o,s,"next",e)}function s(e){cc(i,a,r,o,s,"throw",e)}o(void 0)})});return function(e){return t.apply(this,arguments)}}()),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pc(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){return g.a.createElement("button",{className:"btn btn-danger",onClick:this.handleClick},g.a.createElement(E.c,{id:"admin.revoke_token_button.delete",defaultMessage:"Delete"}))}}])&&uc(n.prototype,a),r&&uc(n,r),t}();fc(bc,"propTypes",{tokenId:b.a.string.isRequired,onError:b.a.func.isRequired,actions:b.a.shape({revokeUserAccessToken:b.a.func.isRequired}).isRequired});var hc=Object(a.connect)(null,function(e){return{actions:Object(r.bindActionCreators)({revokeUserAccessToken:fa.revokeUserAccessToken},e)}})(bc);function gc(e){return(gc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yc(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function vc(e){return(vc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ec(e,t){return(Ec=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Oc=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=vc(t).call(this,e),n=!r||"object"!==gc(r)&&"function"!=typeof r?_c(a):r,Sc(_c(n),"handleError",function(e){n.setState({error:e})}),Sc(_c(n),"renderContents",function(){var e=n.props,t=e.user,a=e.userAccessTokens;if(!t)return g.a.createElement(W.a,null);var r,i=vl.getFullName(t);if(i?i+=" (@".concat(t.username,")"):i="@".concat(t.username),a){var o=Object.values(a);r=0===o.length?g.a.createElement("div",{className:"manage-row__empty"},g.a.createElement(E.c,{id:"admin.manage_tokens.userAccessTokensNone",defaultMessage:"No personal access tokens."})):o.map(function(e){return g.a.createElement("div",{key:e.id,className:"manage-teams__team"},g.a.createElement("div",{className:"manage-teams__team-name"},g.a.createElement("div",{className:"whitespace--nowrap overflow--ellipsis"},g.a.createElement(E.c,{id:"admin.manage_tokens.userAccessTokensNameLabel",defaultMessage:"Token Description: "}),e.description),g.a.createElement("div",{className:"whitespace--nowrap overflow--ellipsis"},g.a.createElement(E.c,{id:"admin.manage_tokens.userAccessTokensIdLabel",defaultMessage:"Token ID: "}),e.id)),g.a.createElement("div",{className:"manage-teams__team-actions"},g.a.createElement(hc,{tokenId:e.id,onError:n.handleError})))})}else r=g.a.createElement(W.a,null);return g.a.createElement("div",null,g.a.createElement("div",{className:"manage-teams__user"},g.a.createElement("img",{alt:"",className:"manage-teams__profile-picture",src:gr.Client4.getProfilePictureUrl(t.id,t.last_picture_update)}),g.a.createElement("div",{className:"manage-teams__info"},g.a.createElement("div",{className:"manage-teams__name"},i),g.a.createElement("div",{className:"manage-teams__email"},t.email))),g.a.createElement("div",{className:"padding-top x2"},g.a.createElement(Xt.b,{id:"admin.manage_tokens.userAccessTokensDescription",defaultMessage:"Personal access tokens function similarly to session tokens and can be used by integrations to [interact with this Mattermost server](!https://about.mattermost.com/default-api-authentication). Tokens are disabled if the user is deactivated. Learn more about [personal access tokens](!https://about.mattermost.com/default-user-access-tokens)."})),g.a.createElement("div",{className:"manage-teams__teams"},r))}),n.state={error:null},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ec(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){var t=this.props.user?this.props.user.id:null,n=e.user?e.user.id:null;n&&n!==t&&this.props.actions.getUserAccessTokensForUser(n,0,200)}},{key:"render",value:function(){return g.a.createElement(Xo.a,{show:this.props.show,onHide:this.props.onModalDismissed,dialogClassName:"a11y__modal manage-teams",role:"dialog","aria-labelledby":"manageTokensModalLabel"},g.a.createElement(Xo.a.Header,{closeButton:!0},g.a.createElement(Xo.a.Title,{componentClass:"h1",id:"manageTokensModalLabel"},g.a.createElement(E.c,{id:"admin.manage_tokens.manageTokensTitle",defaultMessage:"Manage Personal Access Tokens"}))),g.a.createElement(Xo.a.Body,null,this.renderContents(),this.state.error))}}])&&yc(n.prototype,a),r&&yc(n,r),t}();Sc(Oc,"propTypes",{show:b.a.bool.isRequired,user:b.a.object,userAccessTokens:b.a.object,onModalDismissed:b.a.func.isRequired,actions:b.a.shape({getUserAccessTokensForUser:b.a.func.isRequired}).isRequired});var Tc=Object(a.connect)(function(e,t){var n=t.user?t.user.id:"";return{userAccessTokens:e.entities.admin.userAccessTokensByUser[n]}},function(e){return{actions:Object(r.bindActionCreators)({getUserAccessTokensForUser:fa.getUserAccessTokensForUser},e)}})(Oc);function wc(e){return(wc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jc(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function xc(e){return(xc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kc(e,t){return(kc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Cc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Mc=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=xc(t).call(this,e))||"object"!==wc(r)&&"function"!=typeof r?Pc(a):r).doSubmit=n.doSubmit.bind(Pc(n)),n.doCancel=n.doCancel.bind(Pc(n)),n.state={serverErrorNewPass:null,serverErrorCurrentPass:null},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kc(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentWillUnmount",value:function(){this.setState({serverErrorNewPass:null,serverErrorCurrentPass:null})}},{key:"doSubmit",value:function(e){var t=this;e.preventDefault();var n="";if(this.refs.currentPassword&&""===(n=this.refs.currentPassword.value)){var a;return a=g.a.createElement(E.c,{id:"admin.reset_password.missing_current",defaultMessage:"Please enter your current password."}),void this.setState({serverErrorCurrentPass:a})}var r=this.refs.password.value,i=N.X(r,this.props.passwordConfig),o=i.valid,s=i.error;o||!s?(this.setState({serverErrorNewPass:null}),Object(d.c)(this.props.user.id,n,r,function(){t.props.onModalSubmit(t.props.user)},function(e){t.setState({serverErrorCurrentPass:e.message})})):this.setState({serverErrorNewPass:s})}},{key:"doCancel",value:function(){this.setState({serverErrorNewPass:null,serverErrorCurrentPass:null}),this.props.onModalDismissed()}},{key:"render",value:function(){var e=this.props.user;if(null==e)return g.a.createElement("div",null);var t,n="input-group input-group--limit",a=null;this.state.serverErrorNewPass&&(n+=" has-error",a=g.a.createElement("div",{className:"has-error"},g.a.createElement("p",{className:"input__help error"},this.state.serverErrorNewPass))),t=e.auth_service?g.a.createElement(E.c,{id:"admin.reset_password.titleSwitch",defaultMessage:"Switch Account to Email/Password"}):g.a.createElement(E.c,{id:"admin.reset_password.titleReset",defaultMessage:"Reset Password"});var r=null,i=null,o=!0;if(this.props.currentUserId===e.id){o=!1;var s="input-group input-group--limit";this.state.serverErrorCurrentPass&&(s+=" has-error",i=g.a.createElement("div",{className:"has-error"},g.a.createElement("p",{className:"input__help error"},this.state.serverErrorCurrentPass))),r=g.a.createElement("div",{className:"col-sm-10 password__group-addon-space"},g.a.createElement("div",{className:s},g.a.createElement("span",{"data-toggle":"tooltip",title:"Current Password",className:"input-group-addon password__group-addon"},g.a.createElement(E.c,{id:"admin.reset_password.curentPassword",defaultMessage:"Current Password"})),g.a.createElement("input",{type:"password",ref:"currentPassword",className:"form-control",autoFocus:!0,tabIndex:"1"})))}return g.a.createElement(Xo.a,{dialogClassName:"a11y__modal",show:this.props.show,onHide:this.doCancel,role:"dialog","aria-labelledby":"resetPasswordModalLabel"},g.a.createElement(Xo.a.Header,{closeButton:!0},g.a.createElement(Xo.a.Title,{componentClass:"h1",id:"resetPasswordModalLabel"},t)),g.a.createElement("form",{role:"form",className:"form-horizontal"},g.a.createElement(Xo.a.Body,null,g.a.createElement("div",{className:"form-group"},r,g.a.createElement("div",{className:"col-sm-10"},g.a.createElement("div",{className:n},g.a.createElement("span",{"data-toggle":"tooltip",title:"New Password",className:"input-group-addon password__group-addon"},g.a.createElement(E.c,{id:"admin.reset_password.newPassword",defaultMessage:"New Password"})),g.a.createElement("input",{type:"password",ref:"password",className:"form-control",autoFocus:o,tabIndex:"1"})),a,i))),g.a.createElement(Xo.a.Footer,null,g.a.createElement("button",{type:"button",className:"btn btn-link",onClick:this.doCancel},g.a.createElement(E.c,{id:"admin.reset_password.cancel",defaultMessage:"Cancel"})),g.a.createElement("button",{onClick:this.doSubmit,type:"submit",className:"btn btn-primary",tabIndex:"2"},g.a.createElement(E.c,{id:"admin.reset_password.reset",defaultMessage:"Reset"})))))}}])&&jc(n.prototype,a),r&&jc(n,r),t}();Cc(Mc,"propTypes",{user:b.a.object,currentUserId:b.a.string.isRequired,show:b.a.bool.isRequired,onModalSubmit:b.a.func,onModalDismissed:b.a.func,passwordConfig:b.a.object}),Cc(Mc,"defaultProps",{show:!1});var Rc=Object(a.connect)(function(e){var t=Object(c.getConfig)(e);return{currentUserId:Object(m.getCurrentUserId)(e),passwordConfig:Object(N.B)(t)}})(Mc),Nc=n(76);function Ac(e){return(Ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Dc(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Lc(e){return(Lc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ic(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uc(e,t){return(Uc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Bc=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Lc(t).call(this,e),n=!r||"object"!==Ac(r)&&"function"!=typeof r?Ic(a):r,qc(Ic(n),"doSubmit",function(e){if(e.preventDefault(),n.refs.email){var t=n.refs.email.value;if(!Object(Nc.isEmail)(t)){var a=g.a.createElement(E.c,{id:"user.settings.general.validEmail",defaultMessage:"Please enter a valid email address."});return void n.setState({error:a})}}var r=Object.assign({},n.props.user),i=n.refs.email.value.trim().toLowerCase();r.email=i,n.setState({error:null}),Object(d.a)(r,function(){n.props.onModalSubmit(n.props.user)},function(e){var t=e.message?e.message:e;n.setState({error:t})})}),qc(Ic(n),"doCancel",function(){n.setState({error:null}),n.props.onModalDismissed()}),n.state={error:null},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Uc(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){if(!this.props.user)return g.a.createElement("div",null);var e="input-group input-group--limit",t=null;this.state.error&&(e+=" has-error",t=g.a.createElement("div",{className:"has-error"},g.a.createElement("p",{className:"input__help error"},this.state.error)));var n=g.a.createElement(E.c,{id:"admin.reset_email.titleReset",defaultMessage:"Update Email"});return g.a.createElement(Xo.a,{dialogClassName:"a11y__modal",show:this.props.show,onHide:this.doCancel,role:"dialog","aria-labelledby":"resetEmailModalLabel"},g.a.createElement(Xo.a.Header,{closeButton:!0},g.a.createElement(Xo.a.Title,{componentClass:"h1",id:"resetEmailModalLabel"},n)),g.a.createElement("form",{role:"form",className:"form-horizontal"},g.a.createElement(Xo.a.Body,null,g.a.createElement("div",{className:"form-group"},g.a.createElement("div",{className:"col-sm-10"},g.a.createElement("div",{className:e},g.a.createElement("span",{"data-toggle":"tooltip",title:"New Email",className:"input-group-addon email__group-addon"},g.a.createElement(E.c,{id:"admin.reset_email.newEmail",defaultMessage:"New Email"})),g.a.createElement("input",{type:"email",ref:"email",className:"form-control",maxLength:"128",autoFocus:!0,tabIndex:"1"})),t))),g.a.createElement(Xo.a.Footer,null,g.a.createElement("button",{type:"button",className:"btn btn-link",onClick:this.doCancel},g.a.createElement(E.c,{id:"admin.reset_email.cancel",defaultMessage:"Cancel"})),g.a.createElement("button",{onClick:this.doSubmit,type:"submit",className:"btn btn-primary",tabIndex:"2"},g.a.createElement(E.c,{id:"admin.reset_email.reset",defaultMessage:"Reset"})))))}}])&&Dc(n.prototype,a),r&&Dc(n,r),t}();qc(Bc,"propTypes",{user:b.a.object,show:b.a.bool.isRequired,onModalSubmit:b.a.func,onModalDismissed:b.a.func,passwordConfig:b.a.object}),qc(Bc,"defaultProps",{show:!1});var Fc=n(1866),Gc=n(1546);function Hc(e){return(Hc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yc(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Wc(e){return(Wc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vc(e,t){return(Vc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Jc=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=Wc(t).call(this,e))||"object"!==Hc(r)&&"function"!=typeof r?zc(a):r).state={},n.onError=n.onError.bind(zc(n)),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Vc(e,t)}(t,g.a.Component),n=t,(a=[{key:"onError",value:function(e){this.setState({error:e})}},{key:"render",value:function(){var e=this,t=null;this.props.actions&&(t=this.props.actions.map(function(t,n){return g.a.createElement(t,Object.assign({key:n.toString(),user:e.props.user,index:e.props.index,totalUsers:e.props.totalUsers},e.props.actionProps,e.props.actionUserProps,{onError:e.onError}))}));var n,a=this.props.user.email,r="more-modal__description";this.props.user.is_bot?a=null:this.props.extraInfo&&this.props.extraInfo.length>0?(a=g.a.createElement(Xt.b,{id:"admin.user_item.emailTitle",defaultMessage:"**Email:** {email}",values:{email:this.props.user.email}}),r=""):n=this.props.user.status?this.props.user.status:this.props.status,this.props.user.is_bot&&(n=null);var i=null,o=null;this.props.userCount>=0&&(i=N.h("userListRowName"+this.props.userCount),o=N.h("userListRowEmail"+this.props.userCount));var s=null;return this.state.error&&(s=g.a.createElement("div",{className:"has-error"},g.a.createElement("label",{className:"has-error control-label"},this.state.error.message))),g.a.createElement("div",{key:this.props.user.id,className:"more-modal__row"},g.a.createElement(Gc.a,{src:gr.Client4.getProfilePictureUrl(this.props.user.id,this.props.user.last_picture_update),status:n,width:"32",height:"32"}),g.a.createElement("div",{className:"more-modal__right"},g.a.createElement("div",{className:"more-modal__top"},g.a.createElement("div",{className:"more-modal__details"},g.a.createElement("div",{id:i,className:"more-modal__name"},g.a.createElement(La.a,{to:"/admin_console/user_management/user/"+this.props.user.id},N.m(this.props.user)),g.a.createElement(_l.a,{className:"badge-admin",show:Boolean(this.props.user.is_bot)})),g.a.createElement("div",{id:o,className:r},a),this.props.extraInfo),g.a.createElement("div",{className:"more-modal__actions"},t)),g.a.createElement("div",{className:"more-modal__bottom"},s)))}}])&&Yc(n.prototype,a),r&&Yc(n,r),t}();Xc(Jc,"propTypes",{user:b.a.object.isRequired,status:b.a.string,extraInfo:b.a.arrayOf(b.a.object),actions:b.a.arrayOf(b.a.func),actionProps:b.a.object,actionUserProps:b.a.object,index:b.a.number,totalUsers:b.a.number,userCount:b.a.number}),Xc(Jc,"defaultProps",{extraInfo:[],actions:[],actionProps:{},actionUserProps:{}});var Kc=Object(a.connect)(function(e,t){var n=t.user||{};return{status:Object(m.getStatusForUserId)(e,n.id)}})(Jc),Qc=n(1606),Zc=n(1650),$c=n(1493),eu=n(1571);function tu(e){return(tu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nu(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function au(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){nu(i,a,r,o,s,"next",e)}function s(e){nu(i,a,r,o,s,"throw",e)}o(void 0)})}}function ru(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function iu(e){return(iu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ou(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function su(e,t){return(su=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cu=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=iu(t).call(this,e),n=!r||"object"!==tu(r)&&"function"!=typeof r?ou(a):r,lu(ou(n),"handleMakeActive",function(e){e.preventDefault(),n.props.actions.updateUserActive(n.props.user.id,!0).then(n.onUpdateActiveResult)}),lu(ou(n),"handleManageTeams",function(e){e.preventDefault(),n.props.doManageTeams(n.props.user)}),lu(ou(n),"handleManageRoles",function(e){e.preventDefault(),n.props.doManageRoles(n.props.user)}),lu(ou(n),"handleManageTokens",function(e){e.preventDefault(),n.props.doManageTokens(n.props.user)}),lu(ou(n),"handleResetPassword",function(e){e.preventDefault(),n.props.doPasswordReset(n.props.user)}),lu(ou(n),"handleResetEmail",function(e){e.preventDefault(),n.props.doEmailReset(n.props.user)}),lu(ou(n),"handleResetMfa",function(e){e.preventDefault(),Object(d.b)(n.props.user.id,null,n.props.onError)}),lu(ou(n),"handleShowDeactivateMemberModal",function(){var e=au(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),!n.shouldDisableBotsWhenOwnerIsDeactivated()){e.next=4;break}return e.next=4,n.props.actions.loadBots(w.i.Integrations.START_PAGE_NUM,w.i.Integrations.PAGE_SIZE);case 4:n.setState({showDeactivateMemberModal:!0});case 5:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),lu(ou(n),"handleDeactivateMember",function(){n.props.actions.updateUserActive(n.props.user.id,!1).then(n.onUpdateActiveResult),n.setState({showDeactivateMemberModal:!1})}),lu(ou(n),"onUpdateActiveResult",function(e){var t=e.error;t&&n.props.onError(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){lu(e,t,n[t])})}return e}({id:t.server_error_id},t))}),lu(ou(n),"handleDeactivateCancel",function(){n.setState({showDeactivateMemberModal:!1})}),lu(ou(n),"renderDeactivateMemberModal",function(){var e,t=n.props.user,a=g.a.createElement(E.c,{id:"deactivate_member_modal.title",defaultMessage:"Deactivate {username}",values:{username:n.props.user.username}}),r=g.a.createElement(Xt.b,{id:"deactivate_member_modal.desc",defaultMessage:"This action deactivates {username}. They will be logged out and not have access to any teams or channels on this system.\\n",values:{username:t.username}});""!==t.auth_service&&t.auth_service!==w.i.EMAIL_SERVICE&&(e=g.a.createElement("strong",null,g.a.createElement("br",null),g.a.createElement("br",null),g.a.createElement(E.c,{id:"deactivate_member_modal.sso_warning",defaultMessage:"You must also deactivate this user in the SSO provider or they will be reactivated on next login or sync."})));var i,o=g.a.createElement(Xt.b,{id:"deactivate_member_modal.desc.confirm",defaultMessage:"Are you sure you want to deactivate {username}?",values:{username:t.username}});if(n.shouldDisableBotsWhenOwnerIsDeactivated())for(var s=0,l=Object.values(n.props.bots);s<l.length;s++){var c=l[s];if(c.owner_id===t.id&&n.state.showDeactivateMemberModal&&0===c.delete_at){i=g.a.createElement(Xt.b,{id:"deactivate_member_modal.desc.for_users_with_bot_accounts",defaultMessage:"This action deactivates {username}.\\n \\n * They will be logged out and not have access to any teams or channels on this system.\\n * Bot accounts they manage will be disabled along with their integrations. To enable them again, go to Integrations > Bot Accounts. [Learn more about bot accounts](!https://mattermost.com/pl/default-bot-accounts).\\n \\n \\n",values:{username:t.username}});break}}var u=g.a.createElement("div",null,i||r,o,e),m=g.a.createElement(E.c,{id:"deactivate_member_modal.deactivate",defaultMessage:"Deactivate"});return g.a.createElement(Sn.a,{show:n.state.showDeactivateMemberModal,title:a,message:u,confirmButtonClass:"btn btn-danger",confirmButtonText:m,onConfirm:n.handleDeactivateMember,onCancel:n.handleDeactivateCancel})}),lu(ou(n),"handleShowRevokeSessionsModal",function(e){e.preventDefault(),n.setState({showRevokeSessionsModal:!0})}),lu(ou(n),"handleRevokeSessions",au(regeneratorRuntime.mark(function e(){var t,a,r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.props.currentUser,e.next=3,n.props.actions.revokeAllSessionsForUser(n.props.user.id);case 3:a=e.sent,r=a.data,i=a.error,r&&n.props.user.id===t.id?Object($c.e)():i&&n.props.onError(i),n.setState({showRevokeSessionsModal:!1});case 8:case"end":return e.stop()}},e)}))),lu(ou(n),"handleRevokeSessionsCancel",function(){n.setState({showRevokeSessionsModal:!1})}),lu(ou(n),"renderRevokeSessionsModal",function(){var e=g.a.createElement(E.c,{id:"revoke_user_sessions_modal.title",defaultMessage:"Revoke Sessions for {username}",values:{username:n.props.user.username}}),t=g.a.createElement(E.c,{id:"revoke_user_sessions_modal.desc",defaultMessage:"This action revokes all sessions for {username}. They will be logged out from all devices. Are you sure you want to revoke all sessions for {username}?",values:{username:n.props.user.username}}),a=g.a.createElement(E.c,{id:"revoke_user_sessions_modal.revoke",defaultMessage:"Revoke"});return g.a.createElement(Sn.a,{show:n.state.showRevokeSessionsModal,title:e,message:t,confirmButtonClass:"btn btn-danger",confirmButtonText:a,onConfirm:n.handleRevokeSessions,onCancel:n.handleRevokeSessionsCancel})}),lu(ou(n),"renderAccessToken",function(){if(!n.props.enableUserAccessTokens)return null;var e=n.props.user,t=vl.hasPostAllRole(e.roles),a=vl.hasPostAllPublicRole(e.roles),r=vl.hasUserAccessTokenRole(e.roles),i=vl.isSystemAdmin(e.roles),o="";return(r||i)&&(o=t?Object(A.b)("admin.user_item.userAccessTokenPostAll"):a?Object(A.b)("admin.user_item.userAccessTokenPostAllPublic"):Object(A.b)("admin.user_item.userAccessTokenYes")),o?g.a.createElement("div",{className:"light margin-top half"},g.a.createElement(E.c,{key:"admin.user_item.userAccessToken",id:o})):null}),n.state={showDeactivateMemberModal:!1,showRevokeSessionsModal:!1,user:null,role:null},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&su(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"shouldDisableBotsWhenOwnerIsDeactivated",value:function(){return this.props.config&&this.props.config.ServiceSettings&&this.props.config.ServiceSettings.DisableBotsWhenOwnerIsDeactivated}},{key:"render",value:function(){var e=this.props.user;if(!e)return g.a.createElement("div",null);var t=g.a.createElement(E.c,{id:"admin.user_item.member",defaultMessage:"Member"});e.roles.length>0&&N.W(e.roles)&&(t=g.a.createElement(E.c,{id:"team_members_dropdown.systemAdmin",defaultMessage:"System Admin"}));var n=!1,a=!N.W(e.roles),r=!0,i=!0,o=this.props.mfaEnabled&&Boolean(e.mfa_active);e.delete_at>0&&(t=g.a.createElement(E.c,{id:"admin.user_item.inactive",defaultMessage:"Inactive"}),n=!0,a=!1,r=!1,i=!1);var s=!1;e.auth_service===w.i.LDAP_SERVICE&&(s=!0);var l=this.renderDeactivateMemberModal(),c=this.renderRevokeSessionsModal(),u=this.props,m=u.index,d=u.totalUsers,p=!1;return d>5&&d-m<=5&&(p=!0),g.a.createElement(g.a.Fragment,null,l,c,g.a.createElement(Nl.a,null,g.a.createElement("div",{className:"text-right"},g.a.createElement("a",null,g.a.createElement("span",null,t," "),g.a.createElement("span",{className:"caret"})),this.renderAccessToken()),g.a.createElement(Al.a,{openLeft:!0,openUp:p,ariaLabel:N.ab("admin.user_item.menuAriaLabel","User Actions Menu")},g.a.createElement(Dl.a,{show:n,onClick:this.handleMakeActive,text:N.ab("admin.user_item.makeActive","Activate"),disabled:s}),g.a.createElement(Dl.a,{show:a,onClick:this.handleShowDeactivateMemberModal,text:N.ab("admin.user_item.makeInactive","Deactivate"),disabled:s}),g.a.createElement(Dl.a,{onClick:this.handleManageRoles,text:N.ab("admin.user_item.manageRoles","Manage Roles")}),g.a.createElement(Dl.a,{show:r,onClick:this.handleManageTeams,text:N.ab("admin.user_item.manageTeams","Manage Teams")}),g.a.createElement(Dl.a,{show:this.props.enableUserAccessTokens,onClick:this.handleManageTokens,text:N.ab("admin.user_item.manageTokens","Manage Tokens")}),g.a.createElement(Dl.a,{show:o,onClick:this.handleResetMfa,text:N.ab("admin.user_item.resetMfa","Remove MFA")}),g.a.createElement(Dl.a,{show:Boolean(e.auth_service)&&this.props.experimentalEnableAuthenticationTransfer,onClick:this.handleResetPassword,text:N.ab("admin.user_item.switchToEmail","Switch to Email/Password")}),g.a.createElement(Dl.a,{show:!e.auth_service,onClick:this.handleResetPassword,text:N.ab("admin.user_item.resetPwd","Reset Password")}),g.a.createElement(Dl.a,{show:!e.auth_service&&e.id!==this.props.currentUser.id,onClick:this.handleResetEmail,text:N.ab("admin.user_item.resetEmail","Update Email")}),g.a.createElement(eu.a,{permissions:[j.Permissions.REVOKE_USER_ACCESS_TOKEN]},g.a.createElement(Dl.a,{show:i,onClick:this.handleShowRevokeSessionsModal,text:N.ab("admin.user_item.revokeSessions","Revoke Sessions")})))))}}])&&ru(n.prototype,a),r&&ru(n,r),t}();lu(cu,"propTypes",{user:b.a.object.isRequired,mfaEnabled:b.a.bool.isRequired,enableUserAccessTokens:b.a.bool.isRequired,experimentalEnableAuthenticationTransfer:b.a.bool.isRequired,doPasswordReset:b.a.func.isRequired,doEmailReset:b.a.func.isRequired,doManageTeams:b.a.func.isRequired,doManageRoles:b.a.func.isRequired,doManageTokens:b.a.func.isRequired,onError:b.a.func.isRequired,currentUser:b.a.object.isRequired,index:b.a.number.isRequired,totalUsers:b.a.number.isRequired,actions:b.a.shape({updateUserActive:b.a.func.isRequired,revokeAllSessionsForUser:b.a.func.isRequired,loadBots:b.a.func.isRequired}).isRequired,config:b.a.object.isRequired,bots:b.a.object.isRequired});var uu=Object(a.connect)(function(e){var t=Object(Qc.getBotAccounts)(e);return{config:s.getConfig(e),currentUser:Object(m.getCurrentUser)(e),bots:t}},function(e){return{actions:Object(r.bindActionCreators)({updateUserActive:fa.updateUserActive,revokeAllSessionsForUser:fa.revokeAllSessionsForUser,loadBots:Zc.loadBots},e)}})(cu);function mu(e){return(mu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function du(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function pu(e){return(pu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function fu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bu(e,t){return(bu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gu=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=pu(t).call(this,e),n=!r||"object"!==mu(r)&&"function"!=typeof r?fu(a):r,hu(fu(n),"nextPage",function(){n.setState({page:n.state.page+1}),n.props.nextPage(n.state.page+1)}),hu(fu(n),"previousPage",function(){n.setState({page:n.state.page-1})}),hu(fu(n),"search",function(e){n.props.search(e),""!==e&&n.setState({page:0})}),hu(fu(n),"doManageTeams",function(e){n.setState({showManageTeamsModal:!0,user:e})}),hu(fu(n),"doManageRoles",function(e){n.setState({showManageRolesModal:!0,user:e})}),hu(fu(n),"doManageTokens",function(e){n.setState({showManageTokensModal:!0,user:e})}),hu(fu(n),"doManageTeamsDismiss",function(){n.setState({showManageTeamsModal:!1,user:null})}),hu(fu(n),"doManageRolesDismiss",function(){n.setState({showManageRolesModal:!1,user:null})}),hu(fu(n),"doManageTokensDismiss",function(){n.setState({showManageTokensModal:!1,user:null})}),hu(fu(n),"doPasswordReset",function(e){n.setState({showPasswordModal:!0,user:e})}),hu(fu(n),"doPasswordResetDismiss",function(){n.setState({showPasswordModal:!1,user:null})}),hu(fu(n),"doPasswordResetSubmit",function(e){n.props.actions.getUser(e.id),n.setState({showPasswordModal:!1,user:null})}),hu(fu(n),"doEmailReset",function(e){n.setState({showEmailModal:!0,user:e})}),hu(fu(n),"doEmailResetDismiss",function(){n.setState({showEmailModal:!1,user:null})}),hu(fu(n),"doEmailResetSubmit",function(e){n.props.actions.getUser(e.id),n.setState({showEmailModal:!1,user:null})}),n.state={page:0,showManageTeamsModal:!1,showManageRolesModal:!1,showManageTokensModal:!1,showPasswordModal:!1,showEmailModal:!1,user:null},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bu(e,t)}(t,g.a.Component),n=t,(a=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.teamId!==this.props.teamId&&this.setState({page:0})}},{key:"getInfoForUser",value:function(e){var t,n=[];e.auth_service?(t=e.auth_service===w.i.LDAP_SERVICE||e.auth_service===w.i.SAML_SERVICE?e.auth_service.toUpperCase():N.kb(e.auth_service),n.push(g.a.createElement(Xt.b,{key:"admin.user_item.authServiceNotEmail",id:"admin.user_item.authServiceNotEmail",defaultMessage:"**Sign-in Method:** {service}",values:{service:t}}))):n.push(g.a.createElement(Xt.b,{key:"admin.user_item.authServiceEmail",id:"admin.user_item.authServiceEmail",defaultMessage:"**Sign-in Method:** Email"}));return this.props.mfaEnabled&&(n.push(", "),e.mfa_active?n.push(g.a.createElement(Xt.b,{key:"admin.user_item.mfaYes",id:"admin.user_item.mfaYes",defaultMessage:"**MFA**: Yes"})):n.push(g.a.createElement(Xt.b,{key:"admin.user_item.mfaNo",id:"admin.user_item.mfaNo",defaultMessage:"**MFA**: No"}))),n}},{key:"renderCount",value:function(e,t,n,a,r){return t?r?g.a.createElement(E.c,{id:"system_users_list.countSearch",defaultMessage:"{count, number} {count, plural, one {user} other {users}} of {total, number} total",values:{count:e,total:t}}):0!==n||a!==t?g.a.createElement(E.c,{id:"system_users_list.countPage",defaultMessage:"{startCount, number} - {endCount, number} {count, plural, one {user} other {users}} of {total, number} total",values:{count:e,startCount:n+1,endCount:a,total:t}}):g.a.createElement(E.c,{id:"system_users_list.count",defaultMessage:"{count, number} {count, plural, one {user} other {users}}",values:{count:e}}):null}},{key:"render",value:function(){var e={};if(this.props.users){var t=!0,n=!1,a=void 0;try{for(var r,i=this.props.users[Symbol.iterator]();!(t=(r=i.next()).done);t=!0){var o=r.value;e[o.id]=this.getInfoForUser(o)}}catch(e){n=!0,a=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw a}}}return g.a.createElement("div",null,g.a.createElement(Fc.a,Object.assign({},this.props,{renderCount:this.renderCount,extraInfo:e,actions:[uu],actionProps:{mfaEnabled:this.props.mfaEnabled,enableUserAccessTokens:this.props.enableUserAccessTokens,experimentalEnableAuthenticationTransfer:this.props.experimentalEnableAuthenticationTransfer,doPasswordReset:this.doPasswordReset,doEmailReset:this.doEmailReset,doManageTeams:this.doManageTeams,doManageRoles:this.doManageRoles,doManageTokens:this.doManageTokens},nextPage:this.nextPage,previousPage:this.previousPage,search:this.search,page:this.state.page,term:this.props.term,onTermChange:this.props.onTermChange,rowComponentType:Kc})),g.a.createElement(sc,{user:this.state.user,show:this.state.showManageTeamsModal,onModalDismissed:this.doManageTeamsDismiss}),g.a.createElement(Ml,{user:this.state.user,show:this.state.showManageRolesModal,onModalDismissed:this.doManageRolesDismiss}),g.a.createElement(Tc,{user:this.state.user,show:this.state.showManageTokensModal,onModalDismissed:this.doManageTokensDismiss}),g.a.createElement(Rc,{user:this.state.user,show:this.state.showPasswordModal,onModalSubmit:this.doPasswordResetSubmit,onModalDismissed:this.doPasswordResetDismiss}),g.a.createElement(Bc,{user:this.state.user,show:this.state.showEmailModal,onModalSubmit:this.doEmailResetSubmit,onModalDismissed:this.doEmailResetDismiss}))}}])&&du(n.prototype,a),r&&du(n,r),t}();hu(gu,"propTypes",{users:b.a.arrayOf(b.a.object),usersPerPage:b.a.number,total:b.a.number,nextPage:b.a.func,search:b.a.func.isRequired,focusOnMount:b.a.bool,renderFilterRow:b.a.func,teamId:b.a.string.isRequired,filter:b.a.string.isRequired,term:b.a.string.isRequired,onTermChange:b.a.func.isRequired,mfaEnabled:b.a.bool.isRequired,enableUserAccessTokens:b.a.bool.isRequired,experimentalEnableAuthenticationTransfer:b.a.bool.isRequired,actions:b.a.shape({getUser:b.a.func.isRequired}).isRequired});var yu="",vu="no_team",_u=26;function Eu(e,t,n,a,r){if(t)return[];var i=function(e){return gl(e)}(r);if(a){var o=[];if(0===(o=n?Object(m.searchProfilesInTeam)(e,n,a,!1,i):Object(m.searchProfiles)(e,a,!1,i)).length&&a.length===_u){var s=Object(m.getUser)(e,a);s&&(o=[s])}return o}return n===yu?Object(m.getProfiles)(e,i):n===vu?Object(m.getProfilesWithoutTeam)(e,i):Object(m.getProfilesInTeam)(e,n,i)}var Su=Object(a.connect)(function(e,t){return{users:function(e,t,n,a,r){return Eu(e,t,n,a,r).filter(function(e){return!e.is_bot})}(e,t.loading,t.teamId,t.term,t.filter)}},function(e){return{actions:Object(r.bindActionCreators)({getUser:fa.getUser},e)}})(gu);function Ou(e){return(Ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){Mu(e,t,n[t])})}return e}function wu(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function ju(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){wu(i,a,r,o,s,"next",e)}function s(e){wu(i,a,r,o,s,"throw",e)}o(void 0)})}}function xu(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Pu(e){return(Pu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ku(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cu(e,t){return(Cu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ru=26,Nu=50,Au=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Pu(t).call(this,e),n=!r||"object"!==Ou(r)&&"function"!=typeof r?ku(a):r,Mu(ku(n),"loadDataForTeam",function(){var e=ju(regeneratorRuntime.mark(function e(t,a){var r,i,o,s,l,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.props.actions,i=r.getProfiles,o=r.loadProfilesWithoutTeam,s=r.loadProfilesAndTeamMembers,l=r.getTeamStats,!n.props.searchTerm){e.next=4;break}return n.doSearch(n.props.searchTerm,t,a),e.abrupt("return");case 4:if(c=gl(a),t!==w.C.ALL_USERS){e.next=10;break}return e.next=8,Promise.all([i(0,w.i.PROFILE_CHUNK_SIZE,c),Object(d.q)()]);case 8:e.next=17;break;case 10:if(t!==w.C.NO_TEAM){e.next=15;break}return e.next=13,o(0,w.i.PROFILE_CHUNK_SIZE);case 13:e.next=17;break;case 15:return e.next=17,Promise.all([s(0,w.i.PROFILE_CHUNK_SIZE,t),l(t)]);case 17:n.setState({loading:!1});case 18:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()),Mu(ku(n),"handleTeamChange",function(e){var t=e.target.value;n.loadDataForTeam(t,n.props.filter),n.props.actions.setSystemUsersSearch(n.props.searchTerm,t,n.props.filter)}),Mu(ku(n),"handleFilterChange",function(e){var t=e.target.value;n.loadDataForTeam(n.props.teamId,t),n.props.actions.setSystemUsersSearch(n.props.searchTerm,n.props.teamId,t)}),Mu(ku(n),"handleTermChange",function(e){n.props.actions.setSystemUsersSearch(e,n.props.teamId,n.props.filter)}),Mu(ku(n),"nextPage",function(){var e=ju(regeneratorRuntime.mark(function e(t){var a,r,i,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.props.actions,r=a.getProfiles,i=a.loadProfilesWithoutTeam,o=a.loadProfilesAndTeamMembers,n.props.teamId!==w.C.ALL_USERS){e.next=6;break}return e.next=4,r(t+1,Nu,{});case 4:e.next=13;break;case 6:if(n.props.teamId!==w.C.NO_TEAM){e.next=11;break}return e.next=9,i(t+1,Nu);case 9:e.next=13;break;case 11:return e.next=13,o(t+1,Nu,n.props.teamId);case 13:n.setState({loading:!1});case 14:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),Mu(ku(n),"doSearch",Object(hl.debounce)(function(){var e=ju(regeneratorRuntime.mark(function e(t,a){var r,i,o,s=arguments;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=s.length>2&&void 0!==s[2]?s[2]:n.props.filter,t){e.next=3;break}return e.abrupt("return");case 3:return n.setState({loading:!0}),i=Tu({},yl(r),a&&{team_id:a},a===w.C.NO_TEAM&&Mu({},w.N.WITHOUT_TEAM,!0),{allow_inactive:!0}),e.next=7,n.props.actions.searchProfiles(t,i);case 7:if(o=e.sent,0!==o.data.length||t.length!==Ru){e.next=12;break}return e.next=12,n.getUserByTokenOrId(t);case 12:n.setState({loading:!1});case 13:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),w.i.SEARCH_TIMEOUT_MILLISECONDS,!0)),Mu(ku(n),"getUserById",function(){var e=ju(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.props.users[t]){e.next=3;break}return n.setState({loading:!1}),e.abrupt("return");case 3:return e.next=5,n.props.actions.getUser(t);case 5:n.setState({loading:!1});case 6:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),Mu(ku(n),"getUserByTokenOrId",function(){var e=ju(regeneratorRuntime.mark(function e(t){var a,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.props.enableUserAccessTokens){e.next=9;break}return e.next=3,n.props.actions.getUserAccessToken(t);case 3:if(a=e.sent,!(r=a.data)){e.next=9;break}return n.setState({term:r.user_id}),n.getUserById(r.user_id),e.abrupt("return");case 9:n.getUserById(t);case 10:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),Mu(ku(n),"renderFilterRow",function(e){var t=n.props.teams.map(function(e){return g.a.createElement("option",{key:e.id,value:e.id},e.display_name)});return g.a.createElement("div",{className:"system-users__filter-row"},g.a.createElement("div",{className:"system-users__filter"},g.a.createElement(Tr.a,{id:"searchUsers",ref:"filter",className:"form-control filter-textbox",placeholder:{id:Object(A.b)("filtered_user_list.search"),defaultMessage:"Search users"},onInput:e})),g.a.createElement("label",null,g.a.createElement("span",{className:"system-users__team-filter-label"},g.a.createElement(E.c,{id:"filtered_user_list.team",defaultMessage:"Team:"})),g.a.createElement("select",{className:"form-control system-users__team-filter",onChange:n.handleTeamChange,value:n.props.teamId},g.a.createElement("option",{value:w.C.ALL_USERS},N.ab("admin.system_users.allUsers","All Users")),g.a.createElement("option",{value:w.C.NO_TEAM},N.ab("admin.system_users.noTeams","No Teams")),t)),g.a.createElement("label",null,g.a.createElement("span",{className:"system-users__filter-label"},g.a.createElement(E.c,{id:"filtered_user_list.userStatus",defaultMessage:"User Status:"})),g.a.createElement("select",{className:"form-control system-users__filter",value:n.props.filter,onChange:n.handleFilterChange},g.a.createElement("option",{value:""},N.ab("admin.system_users.allUsers","All Users")),g.a.createElement("option",{value:w.L.SYSTEM_ADMIN},N.ab("admin.system_users.system_admin","System Admin")),g.a.createElement("option",{value:w.L.INACTIVE},N.ab("admin.system_users.inactive","Inactive")))))}),n.state={loading:!0,searching:!1},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cu(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidMount",value:function(){this.loadDataForTeam(this.props.teamId,this.props.filter),this.props.actions.getTeams(0,1e3)}},{key:"componentWillUnmount",value:function(){this.props.actions.setSystemUsersSearch("","","")}},{key:"render",value:function(){return g.a.createElement("div",{className:"wrapper--fixed"},g.a.createElement(mn,{id:"admin.system_users.title",defaultMessage:"{siteName} Users",values:{siteName:this.props.siteName}}),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement("div",{className:"more-modal__list member-list-holder"},g.a.createElement(Su,{loading:this.state.loading,renderFilterRow:this.renderFilterRow,search:this.doSearch,nextPage:this.nextPage,usersPerPage:Nu,total:this.props.totalUsers,teams:this.props.teams,teamId:this.props.teamId,filter:this.props.filter,term:this.props.searchTerm,onTermChange:this.handleTermChange,mfaEnabled:this.props.mfaEnabled,enableUserAccessTokens:this.props.enableUserAccessTokens,experimentalEnableAuthenticationTransfer:this.props.experimentalEnableAuthenticationTransfer})))))}}])&&xu(n.prototype,a),r&&xu(n,r),t}();function Du(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Mu(Au,"propTypes",{teams:b.a.arrayOf(b.a.object).isRequired,siteName:b.a.string,mfaEnabled:b.a.bool.isRequired,enableUserAccessTokens:b.a.bool.isRequired,experimentalEnableAuthenticationTransfer:b.a.bool.isRequired,totalUsers:b.a.number.isRequired,searchTerm:b.a.string.isRequired,teamId:b.a.string.isRequired,filter:b.a.string.isRequired,users:b.a.object.isRequired,actions:b.a.shape({getTeams:b.a.func.isRequired,getTeamStats:b.a.func.isRequired,getUser:b.a.func.isRequired,getUserAccessToken:b.a.func.isRequired,loadProfilesAndTeamMembers:b.a.func.isRequired,loadProfilesWithoutTeam:b.a.func.isRequired,getProfiles:b.a.func.isRequired,setSystemUsersSearch:b.a.func.isRequired,searchProfiles:b.a.func.isRequired}).isRequired});var Lu=Object(a.connect)(function(e){var t=Object(c.getConfig)(e),n=t.SiteName,a="true"===t.EnableMultifactorAuthentication,r="true"===t.EnableUserAccessTokens,i="true"===t.ExperimentalEnableAuthenticationTransfer,o=e.views.search.systemUsersSearch,s=0,l="",u="",d="";if(o)if(l=o.term||"",u=o.team||"",d=o.filter||"",u&&u!==w.C.ALL_USERS)s=u===w.C.NO_TEAM?0:(e.entities.teams.stats[u]||{total_member_count:0}).total_member_count;else{var p,f=e.entities.admin.analytics||(Du(p={},j.Stats.TOTAL_USERS,0),Du(p,j.Stats.TOTAL_INACTIVE_USERS,0),p);s=f[j.Stats.TOTAL_USERS]+f[j.Stats.TOTAL_INACTIVE_USERS]}return{teams:Object(ba.getTeamsList)(e),siteName:n,mfaEnabled:a,totalUsers:s,searchTerm:l,teamId:u,filter:d,enableUserAccessTokens:r,users:Object(m.getUsers)(e),experimentalEnableAuthenticationTransfer:i}},function(e){return{actions:Object(r.bindActionCreators)({getTeams:pa.getTeams,getTeamStats:pa.getTeamStats,getUser:fa.getUser,getUserAccessToken:fa.getUserAccessToken,loadProfilesAndTeamMembers:bl.g,setSystemUsersSearch:Ps.b,loadProfilesWithoutTeam:bl.k,getProfiles:fa.getProfiles,searchProfiles:fa.searchProfiles},e)}})(Au);n(2341);function Iu(e){return(Iu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Uu(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function qu(e,t){return!t||"object"!==Iu(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Bu(e){return(Bu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fu(e,t){return(Fu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Gu=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qu(this,Bu(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fu(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){return g.a.createElement("button",{onClick:this.props.onClick,className:"AdminButtonOutline btn btn-primary"},this.props.children)}}])&&Uu(n.prototype,a),r&&Uu(n,r),t}();!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Gu,"propTypes",{onClick:b.a.func.isRequired,children:b.a.string.isRequired});n(2342);var Hu=function(e){return(e.user.first_name||e.user.last_name)&&e.user.nickname?g.a.createElement("span",null," • "):null},Yu=function(e){return g.a.createElement("div",{className:"AdminUserCard"},g.a.createElement("div",{className:"AdminUserCard__header"},g.a.createElement(Gc.a,{src:gr.Client4.getProfilePictureUrl(e.user.id,e.user.last_picture_update),width:"134",height:"134",wrapperClass:"admin-user-card",userId:e.user.id}),g.a.createElement("div",{className:"AdminUserCard__user-info"},g.a.createElement("span",null,e.user.first_name," ",e.user.last_name),g.a.createElement(Hu,{user:e.user}),g.a.createElement("span",{className:"AdminUserCard__user-nickname"},e.user.nickname))),g.a.createElement("div",{className:"AdminUserCard__body"},e.body),g.a.createElement("div",{className:"AdminUserCard__footer"},e.footer))};Hu.propTypes={user:b.a.shape({first_name:b.a.string,last_name:b.a.string,nickname:b.a.string,last_picture_update:b.a.number})},Yu.propTypes={user:b.a.shape({first_name:b.a.string,last_name:b.a.string,nickname:b.a.string,last_picture_update:b.a.number,id:b.a.string}),body:b.a.element,footer:b.a.element};var Wu=Yu;n(2343);function zu(e){return(zu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vu(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Xu(e){return(Xu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ju(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ku(e,t){return(Ku=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Zu=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Xu(t).call(this,e),n=!r||"object"!==zu(r)&&"function"!=typeof r?Ju(a):r,Qu(Ju(n),"doPasswordReset",function(e){n.setState({showPasswordModal:!0,user:e})}),Qu(Ju(n),"doPasswordResetDismiss",function(){n.setState({showPasswordModal:!1})}),Qu(Ju(n),"doPasswordResetSubmit",function(){n.setState({showPasswordModal:!1})}),Qu(Ju(n),"handleMakeActive",function(e){e.preventDefault(),n.props.actions.updateUserActive(n.props.user.id,!0).then(n.onUpdateActiveResult)}),Qu(Ju(n),"handleShowDeactivateMemberModal",function(e){e.preventDefault(),n.setState({showDeactivateMemberModal:!0})}),Qu(Ju(n),"handleDeactivateMember",function(){n.props.actions.updateUserActive(n.props.user.id,!1).then(n.onUpdateActiveResult),n.setState({showDeactivateMemberModal:!1})}),Qu(Ju(n),"onUpdateActiveResult",function(e){var t=e.error;t&&n.setState({error:t})}),Qu(Ju(n),"handleDeactivateCancel",function(){n.setState({showDeactivateMemberModal:!1})}),Qu(Ju(n),"handleResetMfa",function(e){e.preventDefault(),Object(d.b)(n.props.user.id,null,null)}),Qu(Ju(n),"handleEmailChange",function(e){var t=e.target.value!==n.props.user.email;n.setState({user:{email:e.target.value},saveNeeded:t}),n.props.actions.setNavigationBlocked(t)}),Qu(Ju(n),"handleSubmit",function(e){if(e.preventDefault(),n.state.user.email!==n.props.user.email){if(!Object(Nc.isEmail)(n.state.user.email))return void n.setState({serverError:"Invalid Email address"});var t=Object.assign({},n.props.user),a=n.state.user.email.trim().toLowerCase();t.email=a,n.setState({serverError:null}),Object(d.a)(t,function(){n.props.history.push("/admin_console/user_management/users")},function(e){var t=e.message?e.message:e;n.setState({serverError:t})}),n.setState({saving:!1,saveNeeded:!1,serverError:null}),n.props.actions.setNavigationBlocked(!1)}}),Qu(Ju(n),"renderDeactivateMemberModal",function(e){var t,a=g.a.createElement(E.c,{id:"deactivate_member_modal.title",defaultMessage:"Deactivate {username}",values:{username:e.username}});""!==e.auth_service&&e.auth_service!==w.i.EMAIL_SERVICE&&(t=g.a.createElement("strong",null,g.a.createElement("br",null),g.a.createElement("br",null),g.a.createElement(E.c,{id:"deactivate_member_modal.sso_warning",defaultMessage:"You must also deactivate this user in the SSO provider or they will be reactivated on next login or sync."})));var r=g.a.createElement("div",null,g.a.createElement(E.c,{id:"deactivate_member_modal.desc",defaultMessage:"This action deactivates {username}. They will be logged out and not have access to any teams or channels on this system. Are you sure you want to deactivate {username}?",values:{username:e.username}}),t),i=g.a.createElement(E.c,{id:"deactivate_member_modal.deactivate",defaultMessage:"Deactivate"});return g.a.createElement(Sn.a,{show:n.state.showDeactivateMemberModal,title:a,message:r,confirmButtonClass:"btn btn-danger",confirmButtonText:i,onConfirm:n.handleDeactivateMember,onCancel:n.handleDeactivateCancel})}),Qu(Ju(n),"renderActivateDeactivate",function(){return n.props.user.delete_at>0?g.a.createElement(Gu,{onClick:n.handleMakeActive,className:"admin-btn-default"},N.ab("admin.user_item.makeActive","Activate")):g.a.createElement(Gu,{onClick:n.handleShowDeactivateMemberModal,className:"admin-btn-default"},N.ab("admin.user_item.makeInactive","Deactivate"))}),Qu(Ju(n),"renderRemoveMFA",function(){return n.props.user.mfa_active?g.a.createElement(Gu,{onClick:n.handleResetMfa,className:"admin-btn-default"},"Remove MFA"):null}),n.state={loading:!1,searching:!1,showPasswordModal:!1,showDeactivateMemberModal:!1,saveNeeded:!1,saving:!1,serverError:null,errorTooltip:!1,customComponentWrapperClass:"",user:{email:n.props.user.email}},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ku(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){var e,t=this.props.user,n=g.a.createElement(E.c,{id:"admin.user_item.member",defaultMessage:"Member"});return t.id?(t.id&&(e=this.renderDeactivateMemberModal(t),t.delete_at>0&&(n=g.a.createElement(E.c,{id:"admin.user_item.inactive",defaultMessage:"Inactive"})),t.roles.length>0&&N.W(t.roles)&&(n=g.a.createElement(E.c,{id:"team_members_dropdown.systemAdmin",defaultMessage:"System Admin"}))),g.a.createElement("div",{className:"SystemUserDetail wrapper--fixed"},g.a.createElement("div",{className:"admin-console__header with-back"},g.a.createElement("div",null,g.a.createElement(Wi,{to:"/admin_console/user_management/users",className:"fa fa-angle-left back"}),g.a.createElement(E.c,{id:"admin.systemUserDetail.title",defaultMessage:"User Configuration"}))),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement(Wu,{user:t,body:g.a.createElement(g.a.Fragment,null,g.a.createElement("span",{className:"SystemUserDetail__field-label"},t.position),g.a.createElement("span",{className:"SystemUserDetail__field-label"},N.ab("admin.userManagement.userDetail.email","Email")),g.a.createElement("input",{className:"SystemUserDetail__input form-control",type:"text",value:this.state.user.email,onChange:this.handleEmailChange}),g.a.createElement("span",{className:"SystemUserDetail__field-label"},N.ab("admin.userManagement.userDetail.username","Username")),g.a.createElement("p",null,t.username),g.a.createElement("span",{className:"SystemUserDetail__field-label"},N.ab("admin.userManagement.userDetail.authenticationMethod","Authentication Method")),g.a.createElement("p",null,t.mfa_active?"MFA":"Email"),g.a.createElement("span",{className:"SystemUserDetail__field-label"},N.ab("admin.userManagement.userDetail.role","Role")),g.a.createElement("p",null,n)),footer:g.a.createElement(g.a.Fragment,null,g.a.createElement(Gu,{onClick:this.doPasswordReset,className:"admin-btn-default"},"Reset Password"),this.renderActivateDeactivate(),this.renderRemoveMFA())}))),g.a.createElement("div",{className:"admin-console-save"},g.a.createElement(nn.a,{saving:this.state.saving,disabled:!this.state.saveNeeded||this.canSave&&!this.canSave(),onClick:this.handleSubmit,savingMessage:N.ab("admin.saving","Saving Config...")}),g.a.createElement("div",{className:"error-message",ref:"errorMessage",onMouseOver:this.openTooltip,onMouseOut:this.closeTooltip},g.a.createElement(Se.a,{error:this.state.serverError})),g.a.createElement(S.a,{show:this.state.errorTooltip,delayShow:w.i.OVERLAY_TIME_DELAY,placement:"top",target:this.refs.errorMessage},g.a.createElement(O.a,{id:"error-tooltip"},this.state.serverError))),g.a.createElement(Rc,{user:t,show:this.state.showPasswordModal,onModalSubmit:this.doPasswordResetSubmit,onModalDismissed:this.doPasswordResetDismiss}),e)):g.a.createElement(l.a,{to:{pathname:"/admin_console/user_management/users"}})}}])&&Vu(n.prototype,a),r&&Vu(n,r),t}();Qu(Zu,"propTypes",{user:b.a.object.isRequired,actions:b.a.shape({updateUserActive:b.a.func.isRequired,setNavigationBlocked:b.a.func.isRequired}).isRequired}),Qu(Zu,"defaultProps",{user:{email:null}});var $u=Object(a.connect)(function(e,t){var n=t.match.params.user_id;return{userId:n,user:Object(m.getUser)(e,n),navigationBlocked:Object(p.a)(e),showNavigationPrompt:Object(p.c)(e)}},function(e){return{actions:Object(r.bindActionCreators)({getUser:m.getUser,getProfiles:m.getProfiles,updateUserActive:fa.updateUserActive,setNavigationBlocked:d.C,deferNavigation:d.g,cancelNavigation:d.e,confirmNavigation:d.f},e)}})(Zu),em=n(1548);function tm(e){return(tm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nm(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function am(e){return(am=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function im(e,t){return(im=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function om(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sm=500,lm=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=am(t).call(this,e),n=!r||"object"!==tm(r)&&"function"!=typeof r?rm(a):r,om(rm(n),"nextPage",function(e){e.preventDefault(),n.setState({nextDisabled:!0}),n.nextTimeoutId=setTimeout(function(){return n.setState({nextDisabled:!1})},sm),n.props.nextPage()}),om(rm(n),"previousPage",function(e){e.preventDefault(),n.props.previousPage()}),n.logPanel=g.a.createRef(),n.state={nextDisabled:!1},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&im(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){var e=this.logPanel.current;e.scrollTop=e.scrollHeight,e.focus()}},{key:"componentDidUpdate",value:function(){var e=this.logPanel.current;e.scrollTop=e.scrollHeight}},{key:"render",value:function(){var e,t,n=null;this.props.logs.length>=this.props.perPage&&(e=g.a.createElement("button",{className:"btn btn-default filter-control filter-control__next pull-right",onClick:this.nextPage,disabled:this.state.nextDisabled},g.a.createElement(E.c,{id:"admin.logs.next",defaultMessage:"Next"}),g.a.createElement(em.a,{additionalClassName:"margin-left"}))),this.props.page>0&&(t=g.a.createElement("button",{className:"btn btn-default filter-control filter-control__prev",onClick:this.previousPage},g.a.createElement(E.c,{id:"generic_icons.previous",defaultMessage:"Previous Icon"},function(e){return g.a.createElement("i",{className:"fa fa-angle-left",title:e})}),g.a.createElement(E.c,{id:"admin.logs.prev",defaultMessage:"Previous"}))),n=[];for(var a=0;a<this.props.logs.length;a++){var r={whiteSpace:"nowrap",fontFamily:"monospace"};this.props.logs[a].indexOf("[EROR]")>0&&(r.color="red"),n.push(g.a.createElement("br",{key:"br_"+a})),n.push(g.a.createElement("span",{key:"log_"+a,style:r},this.props.logs[a]))}return g.a.createElement("div",null,g.a.createElement("div",{tabIndex:"-1",ref:this.logPanel,className:"log__panel"},n),g.a.createElement("div",{className:"padding-top padding-bottom x2 filter-controls"},t,e))}}])&&nm(n.prototype,a),r&&nm(n,r),t}();function cm(e){return(cm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function um(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function mm(e){return(mm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function dm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pm(e,t){return(pm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function fm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}om(lm,"propTypes",{logs:b.a.arrayOf(b.a.string).isRequired,page:b.a.number.isRequired,perPage:b.a.number.isRequired,nextPage:b.a.func.isRequired,previousPage:b.a.func.isRequired});var bm=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=mm(t).call(this,e),n=!r||"object"!==cm(r)&&"function"!=typeof r?dm(a):r,fm(dm(n),"nextPage",function(){n.setState({page:n.state.page+1})}),fm(dm(n),"previousPage",function(){n.setState({page:n.state.page-1})}),fm(dm(n),"reload",function(){n.setState({loadingLogs:!0}),n.props.actions.getLogs(n.state.page,n.state.perPage).then(function(){return n.setState({loadingLogs:!1})})}),n.state={loadingLogs:!0,page:0,perPage:1e3},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pm(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidMount",value:function(){var e=this;this.props.actions.getLogs(this.state.page,this.state.perPage).then(function(){return e.setState({loadingLogs:!1})})}},{key:"UNSAFE_componentWillUpdate",value:function(e,t){var n=this;this.state.page!==t.page&&this.props.actions.getLogs(t.page,t.perPage).then(function(){return n.setState({loadingLogs:!1})})}},{key:"render",value:function(){var e=null;return e=this.state.loadingLogs?g.a.createElement(W.a,null):g.a.createElement(lm,Object.assign({},this.props,{nextPage:this.nextPage,previousPage:this.previousPage,page:this.state.page,perPage:this.state.perPage})),g.a.createElement("div",{className:"wrapper--admin"},g.a.createElement(mn,{id:"admin.logs.title",defaultMessage:"Server Logs"}),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement("div",{className:"banner"},g.a.createElement("div",{className:"banner__content"},g.a.createElement(E.c,{id:"admin.logs.bannerDesc",defaultMessage:"To look up users by User ID or Token ID, go to Reporting > Users and paste the ID into the search filter."}))),g.a.createElement("button",{type:"submit",className:"btn btn-primary",onClick:this.reload},g.a.createElement(E.c,{id:"admin.logs.reload",defaultMessage:"Reload"})),e)))}}])&&um(n.prototype,a),r&&um(n,r),t}();fm(bm,"propTypes",{logs:b.a.arrayOf(b.a.string).isRequired,nextPage:b.a.func,actions:b.a.shape({getLogs:b.a.func.isRequired}).isRequired});var hm=Object(a.connect)(function(e){return{logs:s.getLogs(e)}},function(e){return{actions:Object(r.bindActionCreators)({getLogs:i.getLogs},e)}})(bm);function gm(e){return(gm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ym(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function vm(e,t){return!t||"object"!==gm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _m(e){return(_m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Em(e,t){return(Em=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Sm=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),vm(this,_m(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Em(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){var e,t=this.props,n=t.status,a=t.primaryClass,r=t.disabled,i=t.onClick;return e=n===w.K.COMPLETE?[g.a.createElement(L.a,{key:"icon"})," ",N.ab("admin.team.uploaded","Uploaded!")]:N.ab("admin.team.upload","Upload"),g.a.createElement("button",{className:a,disabled:r,onClick:i,id:"upload-button"},g.a.createElement(D.a,{loading:n===w.K.LOADING,text:N.ab("admin.team.uploading","Uploading...")},e))}}])&&ym(n.prototype,a),r&&ym(n,r),t}();function Om(e){return(Om="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tm(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function wm(e){return(wm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function jm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xm(e,t){return(xm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Sm,"propTypes",{status:b.a.string,primaryClass:b.a.string,disabled:b.a.bool,onClick:b.a.func});var Pm=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=wm(t).call(this,e))||"object"!==Om(r)&&"function"!=typeof r?jm(a):r).handleImageChange=n.handleImageChange.bind(jm(n)),n.handleImageSubmit=n.handleImageSubmit.bind(jm(n)),n.state={brandImage:null,brandImageExists:!1,brandImageTimestamp:Date.now(),error:"",status:w.K.DEFAULT},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xm(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"UNSAFE_componentWillMount",value:function(){var e=this;fetch(gr.Client4.getBrandImageUrl(this.state.brandImageTimestamp)).then(function(t){200===t.status?e.setState({brandImageExists:!0}):e.setState({brandImageExists:!1})})}},{key:"componentDidUpdate",value:function(){if(this.refs.image){var e=new FileReader,t=this.refs.image;e.onload=function(e){Mt()(t).attr("src",e.target.result)},e.readAsDataURL(this.state.brandImage)}}},{key:"handleImageChange",value:function(){var e=Mt()(this.refs.fileInput);e.prop("files").length>0&&this.setState({brandImage:e.prop("files")[0],status:w.K.DEFAULT})}},{key:"handleImageSubmit",value:function(e){var t=this;e.preventDefault(),this.state.brandImage&&this.state.status!==w.K.LOADING&&(this.setState({error:"",status:w.K.LOADING}),Object(d.F)(this.state.brandImage,function(){t.setState({brandImageExists:!0,brandImage:null,brandImageTimestamp:Date.now(),status:w.K.COMPLETE})},function(e){t.setState({error:e.message,status:w.K.DEFAULT})}))}},{key:"render",value:function(){var e="btn";this.state.brandImage&&(e+=" btn-primary");var t="btn";this.props.disabled||(t+=" btn-default");var n=null;return n=this.state.brandImage?g.a.createElement("img",{ref:"image",className:"brand-img",alt:"brand image",src:""}):this.state.brandImageExists?g.a.createElement("img",{className:"brand-img",alt:"brand image",src:gr.Client4.getBrandImageUrl(this.state.brandImageTimestamp)}):g.a.createElement("p",null,g.a.createElement(E.c,{id:"admin.team.noBrandImage",defaultMessage:"No brand image uploaded"})),g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label col-sm-4"},g.a.createElement(E.c,{id:"admin.team.brandImageTitle",defaultMessage:"Custom Brand Image:"})),g.a.createElement("div",{className:"col-sm-8"},n),g.a.createElement("div",{className:"col-sm-4"}),g.a.createElement("div",{className:"col-sm-8"},g.a.createElement("div",{className:"file__upload"},g.a.createElement("button",{className:t,disabled:this.props.disabled},g.a.createElement(E.c,{id:"admin.team.chooseImage",defaultMessage:"Choose New Image"})),g.a.createElement("input",{ref:"fileInput",type:"file",accept:".jpg,.png,.bmp",disabled:this.props.disabled,onChange:this.handleImageChange})),g.a.createElement(Sm,{primaryClass:e,status:this.state.status,disabled:this.props.disabled||!this.state.brandImage,onClick:this.handleImageSubmit}),g.a.createElement("br",null),g.a.createElement(Se.a,{error:this.state.error}),g.a.createElement("p",{className:"help-text no-margin"},g.a.createElement(E.b,{id:"admin.team.uploadDesc",defaultMessage:'Customize your user experience by adding a custom image to your login screen. See examples at <a href="http://docs.mattermost.com/administration/config-settings.html#custom-branding" target="_blank">docs.mattermost.com/administration/config-settings.html#custom-branding</a>.'}))))}}])&&Tm(n.prototype,a),r&&Tm(n,r),t}();!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Pm,"propTypes",{disabled:b.a.bool.isRequired});n(317),n(1507);var km=n(1538);function Cm(e){return(Cm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Mm(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Rm(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){Mm(i,a,r,o,s,"next",e)}function s(e){Mm(i,a,r,o,s,"throw",e)}o(void 0)})}}function Nm(e){return(Nm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Am(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dm(e,t){return(Dm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Im=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Nm(t).call(this,e),n=!r||"object"!==Cm(r)&&"function"!=typeof r?Am(a):r,Lm(Am(n),"onRowClick",function(){n.props.onCheckToggle(n.props.primary_key)}),Lm(Am(n),"linkHandler",function(){var e=Rm(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.stopPropagation(),t.preventDefault(),n.setState({loading:!0}),e.next=5,n.props.actions.link(n.props.primary_key);case 5:n.setState({loading:!1});case 6:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),Lm(Am(n),"unlinkHandler",function(){var e=Rm(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.stopPropagation(),t.preventDefault(),n.setState({loading:!0}),e.next=5,n.props.actions.unlink(n.props.primary_key);case 5:n.setState({loading:!1});case 6:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),Lm(Am(n),"renderActions",function(){return n.props.mattermost_group_id?n.props.has_syncables?g.a.createElement(La.a,{to:"/admin_console/user_management/groups/"+n.props.mattermost_group_id},g.a.createElement(E.c,{id:"admin.group_settings.group_row.edit",defaultMessage:"Edit"})):g.a.createElement(La.a,{to:"/admin_console/user_management/groups/"+n.props.mattermost_group_id},g.a.createElement(E.c,{id:"admin.group_settings.group_row.configure",defaultMessage:"Configure"})):null}),Lm(Am(n),"renderLinked",function(){return n.state.loading?g.a.createElement("a",{href:"#"},n.props.mattermost_group_id&&g.a.createElement(km.a,{text:Object(N.ab)("admin.group_settings.group_row.unlinking","Unlinking")}),!n.props.mattermost_group_id&&g.a.createElement(km.a,{text:Object(N.ab)("admin.group_settings.group_row.linking","Linking")})):n.props.mattermost_group_id?n.props.failed?g.a.createElement("a",{href:"#",onClick:n.unlinkHandler,className:"warning"},g.a.createElement("i",{className:"icon fa fa-exclamation-triangle"}),g.a.createElement(E.c,{id:"admin.group_settings.group_row.unlink_failed",defaultMessage:"Unlink failed"})):g.a.createElement("a",{href:"#",onClick:n.unlinkHandler},g.a.createElement("i",{className:"icon fa fa-link"}),g.a.createElement(E.c,{id:"admin.group_settings.group_row.linked",defaultMessage:"Linked"})):n.props.failed?g.a.createElement("a",{href:"#",onClick:n.linkHandler,className:"warning"},g.a.createElement("i",{className:"icon fa fa-exclamation-triangle"}),g.a.createElement(E.c,{id:"admin.group_settings.group_row.link_failed",defaultMessage:"Link failed"})):g.a.createElement("a",{href:"#",onClick:n.linkHandler},g.a.createElement("i",{className:"icon fa fa-unlink"}),g.a.createElement(E.c,{id:"admin.group_settings.group_row.not_linked",defaultMessage:"Not Linked"}))}),Lm(Am(n),"render",function(){return g.a.createElement("div",{className:"group "+(n.props.checked?"checked":""),onClick:n.onRowClick},g.a.createElement("div",{className:"group-row"},g.a.createElement("div",{className:"group-check "+(n.props.checked?"checked":"")},n.props.checked&&g.a.createElement(io,null)),g.a.createElement("span",{className:"group-name"},n.props.name),g.a.createElement("span",{className:"group-description"},n.renderLinked()),g.a.createElement("span",{className:"group-actions"},n.renderActions())))}),n.state={loading:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Dm(e,t)}(t,g.a.Component),t}();Lm(Im,"propTypes",{primary_key:b.a.string.isRequired,name:b.a.string.isRequired,mattermost_group_id:b.a.string,has_syncables:b.a.bool,checked:b.a.bool,failed:b.a.bool,onCheckToggle:b.a.func,actions:b.a.shape({link:b.a.func.isRequired,unlink:b.a.func.isRequired}).isRequired});var Um=n(1584),qm=n(1599);function Bm(e){return(Bm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Gm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){Jm(e,t,n[t])})}return e}function Hm(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Ym(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){Hm(i,a,r,o,s,"next",e)}function s(e){Hm(i,a,r,o,s,"throw",e)}o(void 0)})}}function Wm(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function zm(e){return(zm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xm(e,t){return(Xm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Km=200,Qm={filterIsConfigured:{filter:"is:configured",option:{is_configured:!0}},filterIsUnconfigured:{filter:"is:notconfigured",option:{is_configured:!1}},filterIsLinked:{filter:"is:linked",option:{is_linked:!0}},filterIsUnlinked:{filter:"is:notlinked",option:{is_linked:!1}}},Zm=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=zm(t).call(this,e),n=!r||"object"!==Bm(r)&&"function"!=typeof r?Vm(a):r,Jm(Vm(n),"closeFilters",function(){n.setState({showFilters:!1})}),Jm(Vm(n),"previousPage",function(){var e=Ym(regeneratorRuntime.mark(function e(t){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t.preventDefault(),a=n.state.page<1?0:n.state.page-1,n.setState({checked:{},page:a,loading:!0}),n.searchGroups(a);case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),Jm(Vm(n),"nextPage",function(){var e=Ym(regeneratorRuntime.mark(function e(t){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t.preventDefault(),a=n.state.page+1,n.setState({checked:{},page:a,loading:!0}),n.searchGroups(a);case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),Jm(Vm(n),"onCheckToggle",function(e){var t=Gm({},n.state.checked);t[e]=!t[e],n.setState({checked:t})}),Jm(Vm(n),"linkSelectedGroups",function(){var e=!0,t=!1,a=void 0;try{for(var r,i=n.props.groups[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;n.state.checked[o.primary_key]&&!o.mattermost_group_id&&n.props.actions.link(o.primary_key)}}catch(e){t=!0,a=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw a}}}),Jm(Vm(n),"unlinkSelectedGroups",function(){var e=!0,t=!1,a=void 0;try{for(var r,i=n.props.groups[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=r.value;n.state.checked[o.primary_key]&&o.mattermost_group_id&&n.props.actions.unlink(o.primary_key)}}catch(e){t=!0,a=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw a}}}),Jm(Vm(n),"selectionActionButtonType",function(){var e=!1,t=!0,a=!1,r=void 0;try{for(var i,o=n.props.groups[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var s=i.value;if(n.state.checked[s.primary_key]){if(!s.mattermost_group_id)return"link";e=!0}}}catch(e){a=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(a)throw r}}return e?"unlink":"disabled"}),Jm(Vm(n),"renderSelectionActionButton",function(){switch(n.selectionActionButtonType()){case"link":return g.a.createElement("button",{className:"btn btn-primary",onClick:n.linkSelectedGroups},g.a.createElement("i",{className:"icon fa fa-link"}),g.a.createElement(E.c,{id:"admin.group_settings.groups_list.link_selected",defaultMessage:"Link Selected Groups"}));case"unlink":return g.a.createElement("button",{className:"btn btn-primary",onClick:n.unlinkSelectedGroups},g.a.createElement("i",{className:"icon fa fa-unlink"}),g.a.createElement(E.c,{id:"admin.group_settings.groups_list.unlink_selected",defaultMessage:"Unlink Selected Groups"}));default:return g.a.createElement("button",{className:"btn btn-inactive disabled"},g.a.createElement("i",{className:"icon fa fa-link"}),g.a.createElement(E.c,{id:"admin.group_settings.groups_list.link_selected",defaultMessage:"Link Selected Groups"}))}}),Jm(Vm(n),"renderRows",function(){return n.state.loading?g.a.createElement("div",{className:"groups-list-loading"},g.a.createElement("i",{className:"fa fa-spinner fa-pulse fa-2x"})):0===n.props.groups.length?g.a.createElement("div",{className:"groups-list-empty"},g.a.createElement(E.c,{id:"admin.group_settings.groups_list.no_groups_found",defaultMessage:"No groups found"})):n.props.groups.map(function(e){return g.a.createElement(Im,{key:e.primary_key,primary_key:e.primary_key,name:e.name,mattermost_group_id:e.mattermost_group_id,has_syncables:e.has_syncables,failed:e.failed,checked:Boolean(n.state.checked[e.primary_key]),onCheckToggle:n.onCheckToggle,actions:{link:n.props.actions.link,unlink:n.props.actions.unlink}})})}),Jm(Vm(n),"regex",function(e){return new RegExp("(".concat(e,")"),"i")}),Jm(Vm(n),"searchGroups",function(e){var t=n.state.searchString,a=Gm({},n.state);delete a.page,delete a.checked;var r=t,i={q:""};Object.entries(Qm).forEach(function(e){var o=Fm(e,2),s=o[0],l=o[1],c=n.regex(l.filter);c.test(t)?(a[s]=!0,r=r.replace(c,""),i=Object.assign(i,l.option)):n.state[s]&&(t+=" "+l.filter)}),i.q=r.trim(),a.searchString=t,a.showFilters=!1,a.loading=!0,a.showFilters=!1,n.setState(a),n.props.actions.getLdapGroups(e,Km,i).then(function(){n.setState({loading:!1})})}),Jm(Vm(n),"handleGroupSearchKeyUp",function(e){var t=e.key,a=n.state.searchString;t===w.i.KeyCodes.ENTER[0]&&(n.setState({page:0}),n.searchGroups());var r={};Object.entries(Qm).forEach(function(e){var t=Fm(e,2),i=t[0],o=t[1];n.regex(o.filter).test(a)||(r[i]=!1)}),n.setState(r)}),Jm(Vm(n),"newSearchString",function(e,t,a){var r=e,i=Qm[t].filter,o=n.regex(i),s=o.test(e);return s&&!a&&(r=e.replace(o,"").trim()),!s&&a&&(r+=" "+i),r.replace(/\s{2,}/g," ")}),Jm(Vm(n),"handleFilterCheck",function(e){var t=n.state.searchString;e.forEach(function(e){t=n.newSearchString(t,e[0],e[1]),n.setState(Jm({},e[0],e[1]))}),n.setState({searchString:t})}),Jm(Vm(n),"renderSearchFilters",function(){return g.a.createElement("div",{id:"group-filters",className:"group-search-filters",onClick:function(e){e.nativeEvent.stopImmediatePropagation()}},g.a.createElement("div",{className:"filter-row"},g.a.createElement("span",{className:"filter-check "+(n.state.filterIsLinked?"checked":""),onClick:function(){return n.handleFilterCheck([["filterIsLinked",!n.state.filterIsLinked],["filterIsUnlinked",!1]])}},n.state.filterIsLinked&&g.a.createElement(io,null)),g.a.createElement("span",null,g.a.createElement(E.c,{id:"admin.group_settings.filters.isLinked",defaultMessage:"Is Linked"}))),g.a.createElement("div",{className:"filter-row"},g.a.createElement("span",{className:"filter-check "+(n.state.filterIsUnlinked?"checked":""),onClick:function(){return n.handleFilterCheck([["filterIsUnlinked",!n.state.filterIsUnlinked],["filterIsLinked",!1]])}},n.state.filterIsUnlinked&&g.a.createElement(io,null)),g.a.createElement("span",null,g.a.createElement(E.c,{id:"admin.group_settings.filters.isUnlinked",defaultMessage:"Is Not Linked"}))),g.a.createElement("div",{className:"filter-row"},g.a.createElement("span",{className:"filter-check "+(n.state.filterIsConfigured?"checked":""),onClick:function(){return n.handleFilterCheck([["filterIsConfigured",!n.state.filterIsConfigured],["filterIsUnconfigured",!1]])}},n.state.filterIsConfigured&&g.a.createElement(io,null)),g.a.createElement("span",null,g.a.createElement(E.c,{id:"admin.group_settings.filters.isConfigured",defaultMessage:"Is Configured"}))),g.a.createElement("div",{className:"filter-row"},g.a.createElement("span",{className:"filter-check "+(n.state.filterIsUnconfigured?"checked":""),onClick:function(){return n.handleFilterCheck([["filterIsUnconfigured",!n.state.filterIsUnconfigured],["filterIsConfigured",!1]])}},n.state.filterIsUnconfigured&&g.a.createElement(io,null)),g.a.createElement("span",null,g.a.createElement(E.c,{id:"admin.group_settings.filters.isUnconfigured",defaultMessage:"Is Not Configured"}))),g.a.createElement("a",{onClick:function(){n.setState({page:0}),n.searchGroups(0)},className:"btn btn-primary search-groups-btn"},g.a.createElement(E.c,{id:"search_bar.search",defaultMessage:"Search"})))}),Jm(Vm(n),"resetFiltersAndSearch",function(){var e={showFilters:!1,searchString:"",loading:!0,page:0};Object.entries(Qm).forEach(function(t){var n=Fm(t,1)[0];e[n]=!1}),n.setState(e),n.props.actions.getLdapGroups(n.state.page,Km,{q:""}).then(function(){n.setState({loading:!1})})}),Jm(Vm(n),"render",function(){var e=n.state.page*Km+1,t=n.state.page*Km+Km,a=n.props.total;t>a&&(t=a);var r=t===a,i=0===n.state.page;return g.a.createElement("div",{className:"groups-list"},g.a.createElement("div",{className:"groups-list--global-actions"},g.a.createElement("div",{className:"group-list-search"},g.a.createElement("input",{type:"text",placeholder:N.ab("search_bar.search","Search"),onKeyUp:n.handleGroupSearchKeyUp,onChange:function(e){return n.setState({searchString:e.target.value})},value:n.state.searchString}),g.a.createElement(qm.a,{id:"searchIcon",className:"search__icon","aria-hidden":"true"}),g.a.createElement("i",{className:"fa fa-times-circle group-filter-action "+(n.state.searchString.length?"":"hidden"),onClick:n.resetFiltersAndSearch}),g.a.createElement("i",{className:"fa fa-caret-down group-filter-action "+(n.state.showFilters?"hidden":""),onClick:function(){document.addEventListener("click",n.closeFilters,{once:!0}),n.setState({showFilters:!0})}})),n.state.showFilters&&n.renderSearchFilters(),g.a.createElement("div",{className:"group-list-link-unlink"},n.renderSelectionActionButton())),g.a.createElement("div",{className:"groups-list--header"},g.a.createElement("div",{className:"group-name"},g.a.createElement(E.c,{id:"admin.group_settings.groups_list.nameHeader",defaultMessage:"Name"})),g.a.createElement("div",{className:"group-description"},g.a.createElement(E.c,{id:"admin.group_settings.groups_list.mappingHeader",defaultMessage:"Mattermost Linking"})),g.a.createElement("div",{className:"group-actions"})),g.a.createElement("div",{className:"groups-list--body"},n.renderRows()),g.a.createElement("div",{className:"groups-list--footer"},g.a.createElement("div",{className:"counter"},g.a.createElement(E.c,{id:"admin.group_settings.groups_list.paginatorCount",defaultMessage:"{startCount, number} - {endCount, number} of {total, number}",values:{startCount:e,endCount:t,total:a}})),g.a.createElement("button",{className:"btn btn-link prev "+(i?"disabled":""),onClick:i?null:n.previousPage,disabled:i},g.a.createElement(Um.a,null)),g.a.createElement("button",{className:"btn btn-link next "+(r?"disabled":""),onClick:r?null:n.nextPage,disabled:r},g.a.createElement(em.a,null))))}),n.state={checked:{},loading:!0,page:0,showFilters:!1,searchString:""},Object.entries(Qm).forEach(function(e){var t=Fm(e,1)[0];n.state[t]=!1}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xm(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){var e=this;this.props.actions.getLdapGroups(this.state.page,Km).then(function(){e.setState({loading:!1})})}}])&&Wm(n.prototype,a),r&&Wm(n,r),t}();Jm(Zm,"propTypes",{groups:b.a.arrayOf(b.a.object),total:b.a.number,actions:b.a.shape({getLdapGroups:b.a.func.isRequired,link:b.a.func.isRequired,unlink:b.a.func.isRequired}).isRequired}),Jm(Zm,"defaultProps",{groups:[]});var $m=Object(ir.a)(s.getLdapGroups,function(e){var t=Object.values(e);return t.sort(function(e,t){return e.name.localeCompare(t.name)}),t});var ed=Object(a.connect)(function(e){return{groups:$m(e),total:Object(s.getLdapGroupsCount)(e)}},function(e){return{actions:Object(r.bindActionCreators)({getLdapGroups:i.getLdapGroups,link:i.linkLdapGroup,unlink:i.unlinkLdapGroup},e)}})(Zm);function td(e){return(td="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nd(e){return(nd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ad(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rd(e,t){return(rd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var id=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,n=!(r=(e=nd(t)).call.apply(e,[this].concat(o)))||"object"!==td(r)&&"function"!=typeof r?ad(a):r,function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(ad(n),"render",function(){var e=Object(Rn.e)();return g.a.createElement("div",{className:"wrapper--fixed"},g.a.createElement("div",{className:"admin-console__header"},g.a.createElement(E.c,{id:"admin.group_settings.groupsPageTitle",defaultMessage:"Groups"})),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement("div",{className:"banner info"},g.a.createElement("div",{className:"banner__content"},g.a.createElement(Xt.b,{id:"admin.group_settings.introBanner",defaultMessage:"Groups are a way to organize users and apply actions to all users within that group.\nFor more information on Groups, please see [documentation](!https://www.mattermost.com/default-ad-ldap-groups)."}))),g.a.createElement(di,{id:"ldap_groups",titleId:Object(A.b)("admin.group_settings.ldapGroupsTitle"),titleDefault:"AD/LDAP Groups",subtitleId:Object(A.b)("admin.group_settings.ldapGroupsDescription"),subtitleDefault:"Link and configure groups from your AD/LDAP to Mattermost. Please ensure you have configured a [group filter](".concat(e,"/admin_console/authentication/ldap)."),subtitleValues:{siteURL:e}},g.a.createElement(ed,null)))))}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rd(e,t)}(t,g.a.PureComponent),t}(),od=n(1567),sd=n(1601);n(2344);function ld(e){return(ld="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cd(e){return(cd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ud(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function md(e,t){return(md=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pd=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=cd(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==ld(r)&&"function"!=typeof r?ud(a):r,dd(ud(n),"render",function(){var e=n.props.name;return g.a.createElement("div",{className:"group-profile"},g.a.createElement("div",{className:"group-profile-field"},g.a.createElement("label",null,g.a.createElement(E.c,{id:"admin.group_settings.group_details.group_profile.name",defaultMessage:"Name:"})),g.a.createElement("input",{type:"text",className:"form-control",value:e,disabled:!0})))}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&md(e,t)}(t,g.a.PureComponent),t}();dd(pd,"propTypes",{name:b.a.string.isRequired});var fd=n(1553),bd=n(1554);function hd(e){return(hd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gd(e){return(gd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vd(e,t){return(vd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ed=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=gd(t).call(this,e),n=!r||"object"!==hd(r)&&"function"!=typeof r?yd(a):r,_d(yd(n),"removeItem",function(){n.props.onRemoveItem(n.props.id,n.props.type),n.setState({showConfirmationModal:!1})}),_d(yd(n),"toggleCollapse",function(){n.props.onToggleCollapse(n.props.id)}),_d(yd(n),"render",function(){var e="",t=null;n.props.hasChildren&&(t=g.a.createElement("i",{className:"fa fa-caret-right"+(n.props.collapsed?"":" open"),onClick:n.toggleCollapse}),e+=" has-clidren"),n.props.collapsed&&(e+=" collapsed");var a=null,r=null;switch(n.props.type){case"public-team":a=g.a.createElement("div",{className:"team-icon team-icon-public"},g.a.createElement("i",{className:"fa fa-circle-o-notch"}));break;case"private-team":a=g.a.createElement("div",{className:"team-icon team-icon-private"},g.a.createElement("span",{className:"fa-stack fa-2x"},g.a.createElement("i",{className:"fa fa-circle-thin fa-stack-2x"}),g.a.createElement("i",{className:"fa fa-lock fa-stack-1x"})));break;default:a=g.a.createElement("div",{className:"team-icon"})}switch(n.props.type){case"public-channel":r=g.a.createElement("div",{className:"channel-icon"},g.a.createElement(fd.a,{className:"icon icon__globe"}));break;case"private-channel":r=g.a.createElement("div",{className:"channel-icon"},g.a.createElement(bd.a,{className:"icon icon__lock"}))}var i=n.props.type.split("-")[1];return g.a.createElement("div",{className:"group-teams-and-channels-row"+e},g.a.createElement(Sn.a,{show:n.state.showConfirmationModal,title:g.a.createElement(E.c,{id:"admin.group_settings.group_details.group_teams_and_channels_row.remove.confirm_header",defaultMessage:"Remove Membership from the '".concat(n.props.name,"' ").concat(i,"?"),values:{name:n.props.name,displayType:i}}),message:g.a.createElement(E.c,{id:"admin.group_settings.group_details.group_teams_and_channels_row.remove.confirm_body",defaultMessage:"Removing this membership will prevent future users in this group from being added to the '".concat(n.props.name,"' ").concat(i,"."),values:{name:n.props.name,displayType:i}}),confirmButtonText:g.a.createElement(E.c,{id:"admin.group_settings.group_details.group_teams_and_channels_row.remove.confirm_button",defaultMessage:"Yes, Remove"}),onConfirm:n.removeItem,onCancel:function(){return n.setState({showConfirmationModal:!1})}}),g.a.createElement("div",{className:"arrow-icon"},t),a,r,g.a.createElement("div",{className:"name"},n.props.name),g.a.createElement("div",{className:"remove"},!n.props.implicit&&g.a.createElement("button",{className:"btn btn-link",onClick:function(){return n.setState({showConfirmationModal:!0})}},g.a.createElement(E.c,{id:"admin.group_settings.group_details.group_teams_and_channels_row.remove",defaultMessage:"Remove"}))))}),n.state={showConfirmationModal:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vd(e,t)}(t,g.a.PureComponent),t}();function Sd(e){return(Sd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Od(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Td(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function wd(e){return(wd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function jd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xd(e,t){return(xd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}_d(Ed,"propTypes",{id:b.a.string.isRequired,type:b.a.string.isRequired,name:b.a.string.isRequired,implicit:b.a.bool,hasChildren:b.a.bool,collapsed:b.a.bool,onRemoveItem:b.a.func.isRequired,onToggleCollapse:b.a.func.isRequired});var kd=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=wd(t).call(this,e),n=!r||"object"!==Sd(r)&&"function"!=typeof r?jd(a):r,Pd(jd(n),"onToggleCollapse",function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){Pd(e,t,n[t])})}return e}({},n.state.collapsed);t[e]=!t[e],n.setState({collapsed:t})}),Pd(jd(n),"onRemoveItem",function(){var e,t=(e=regeneratorRuntime.mark(function e(t,a){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("public-team"!==a&&"private-team"!==a){e.next=7;break}return e.next=3,n.props.unlink(n.props.id,t,j.Groups.SYNCABLE_TYPE_TEAM);case 3:return e.next=5,n.props.getGroupSyncables(n.props.id,j.Groups.SYNCABLE_TYPE_TEAM);case 5:e.next=11;break;case 7:return e.next=9,n.props.unlink(n.props.id,t,j.Groups.SYNCABLE_TYPE_CHANNEL);case 9:return e.next=11,n.props.getGroupSyncables(n.props.id,j.Groups.SYNCABLE_TYPE_CHANNEL);case 11:case"end":return e.stop()}},e)}),function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){Td(i,a,r,o,s,"next",e)}function s(e){Td(i,a,r,o,s,"throw",e)}o(void 0)})});return function(e,n){return t.apply(this,arguments)}}()),Pd(jd(n),"teamsAndChannelsToEntries",function(e,t){var a=[],r=new Set,i=[];e.forEach(function(e){r.add(e.team_id),i.push({type:"O"===e.team_type?"public-team":"private-team",hasChildren:t.some(function(t){return t.team_id===e.team_id}),name:e.team_display_name,collapsed:n.state.collapsed[e.team_id],id:e.team_id,implicit:!1})});var o={};return t.forEach(function(e){o[e.team_id]=o[e.team_id]||[],o[e.team_id].push({type:"O"===e.channel_type?"public-channel":"private-channel",name:e.channel_display_name,id:e.channel_id}),r.has(e.team_id)||(r.add(e.team_id),i.push({type:"O"===e.team_type?"public-team":"private-team",hasChildren:!0,name:e.team_display_name,collapsed:n.state.collapsed[e.team_id],id:e.team_id,implicit:!0}))}),i.sort(function(e,t){return e.name.localeCompare(t.name)}),i.forEach(function(e){if(a.push(e),e.hasChildren&&!e.collapsed){var t=o[e.id];t.sort(function(e,t){return e.name.localeCompare(t.name)}),a.push.apply(a,Od(t))}}),a}),Pd(jd(n),"render",function(){var e=n.teamsAndChannelsToEntries(n.props.teams,n.props.channels);return n.props.loading?g.a.createElement("div",{className:"group-teams-and-channels"},g.a.createElement("div",{className:"group-teams-and-channels-loading"},g.a.createElement("i",{className:"fa fa-spinner fa-pulse fa-2x"}))):0===e.length?g.a.createElement("div",{className:"group-teams-and-channels"},g.a.createElement("div",{className:"group-teams-and-channels-empty"},g.a.createElement(E.c,{id:"admin.group_settings.group_details.group_teams_and_channels.no-teams-or-channels-speicified",defaultMessage:"No teams or channels specified yet"}))):g.a.createElement("div",{className:"group-teams-and-channels"},g.a.createElement("div",{className:"group-teams-and-channels--header"},g.a.createElement(E.c,{id:"admin.group_settings.group_profile.group_teams_and_channels.name",defaultMessage:"Name"})),g.a.createElement("div",{className:"group-teams-and-channels--body"},e.map(function(e){return g.a.createElement(Ed,Object.assign({key:e.id,onRemoveItem:n.onRemoveItem,onToggleCollapse:n.onToggleCollapse},e))})))}),n.state={collapsed:{}},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xd(e,t)}(t,g.a.PureComponent),t}();function Cd(e){return(Cd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Md(e){return(Md=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Rd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nd(e,t){return(Nd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ad(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Pd(kd,"propTypes",{id:b.a.string.isRequired,teams:b.a.arrayOf(b.a.object),channels:b.a.arrayOf(b.a.object),loading:b.a.bool.isRequired,getGroupSyncables:b.a.func.isRequired,unlink:b.a.func.isRequired});var Dd=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=Md(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Cd(r)&&"function"!=typeof r?Rd(a):r,Ad(Rd(n),"render",function(){return g.a.createElement("div",{className:"group-users-row"},g.a.createElement("img",{className:"profile-picture",alt:"",src:gr.Client4.getProfilePictureUrl(n.props.userId,n.props.lastPictureUpdate)}),g.a.createElement("div",{className:"user-data"},g.a.createElement("div",{className:"name-row"},g.a.createElement("span",{className:"username"},"@"+n.props.username),"-",g.a.createElement("span",{className:"display-name"},n.props.displayName)),g.a.createElement("div",null,g.a.createElement("span",{className:"email-label"},g.a.createElement(E.c,{id:"admin.group_settings.group_details.group_users.email",defaultMessage:"Email:"})),g.a.createElement("span",{className:"email"},n.props.email))))}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Nd(e,t)}(t,g.a.PureComponent),t}();function Ld(e){return(Ld="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Id(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Ud(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){Id(i,a,r,o,s,"next",e)}function s(e){Id(i,a,r,o,s,"throw",e)}o(void 0)})}}function qd(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Bd(e){return(Bd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gd(e,t){return(Gd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Ad(Dd,"propTypes",{username:b.a.string.isRequired,displayName:b.a.string.isRequired,email:b.a.string.isRequired,userId:b.a.string.isRequired,lastPictureUpdate:b.a.number.isRequired});var Yd=20,Wd=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Bd(t).call(this,e),n=!r||"object"!==Ld(r)&&"function"!=typeof r?Fd(a):r,Hd(Fd(n),"previousPage",Ud(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.state.page<1?0:n.state.page-1,n.setState({page:t,loading:!0}),e.next=4,n.props.getMembers(n.props.groupID,t,Yd);case 4:n.setState({loading:!1});case 5:case"end":return e.stop()}},e)}))),Hd(Fd(n),"nextPage",Ud(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(n.state.page+1)*Yd>=n.props.total?n.state.page:n.state.page+1,n.setState({page:t,loading:!0}),e.next=4,n.props.getMembers(n.props.groupID,t,Yd);case 4:n.setState({loading:!1});case 5:case"end":return e.stop()}},e)}))),Hd(Fd(n),"renderRows",function(){return 0===n.props.members.length?g.a.createElement("div",{className:"group-users-empty"},g.a.createElement(E.c,{id:"admin.group_settings.group_details.group_users.no-users-found",defaultMessage:"No users found"})):n.props.members.map(function(e){return g.a.createElement(Dd,{key:e.id,username:e.username,displayName:e.first_name+" "+e.last_name,email:e.email,userId:e.id,lastPictureUpdate:e.last_picture_update})})}),Hd(Fd(n),"renderPagination",function(){if(0===n.props.members.length)return g.a.createElement("div",{className:"group-users--footer empty"});var e=n.state.page*Yd+1,t=n.state.page*Yd+Yd,a=n.props.total;t>a&&(t=a);var r=t===a,i=0===n.state.page;return g.a.createElement("div",{className:"group-users--footer"},g.a.createElement("div",{className:"counter"},g.a.createElement(E.c,{id:"admin.group_settings.groups_list.paginatorCount",defaultMessage:"{startCount, number} - {endCount, number} of {total, number}",values:{startCount:e,endCount:t,total:a}})),g.a.createElement("button",{className:"btn btn-link prev "+(i?"disabled":""),onClick:n.previousPage,disabled:i},g.a.createElement(Um.a,null)),g.a.createElement("button",{className:"btn btn-link next "+(r?"disabled":""),onClick:n.nextPage,disabled:r},g.a.createElement(em.a,null)))}),Hd(Fd(n),"render",function(){return g.a.createElement("div",{className:"group-users"},g.a.createElement("div",{className:"group-users--header"},g.a.createElement(Xt.b,{id:"admin.group_settings.group_profile.group_users.ldapConnector",defaultMessage:"AD/LDAP Connector is configured to sync and manage this group and its users. [Click here to view](/admin_console/authentication/ldap)"})),g.a.createElement("div",{className:"group-users--body"},g.a.createElement("div",{className:"group-users-loading "+(n.state.loading?"active":"")},g.a.createElement("i",{className:"fa fa-spinner fa-pulse fa-2x"})),n.renderRows()),n.renderPagination())}),n.state={loading:!0,page:0},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gd(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){var e=this;this.props.getMembers(this.props.groupID,0,Yd).then(function(){e.setState({loading:!1})})}}])&&qd(n.prototype,a),r&&qd(n,r),t}();Hd(Wd,"propTypes",{groupID:b.a.string.isRequired,members:b.a.arrayOf(b.a.object),total:b.a.number.isRequired,getMembers:b.a.func.isRequired});var zd=n(75);n(947);function Vd(e){return(Vd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xd(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Jd(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){Xd(i,a,r,o,s,"next",e)}function s(e){Xd(i,a,r,o,s,"throw",e)}o(void 0)})}}function Kd(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Qd(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Zd(e){return(Zd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ep(e,t){return(ep=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var np=50,ap=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Zd(t).call(this,e),n=!r||"object"!==Vd(r)&&"function"!=typeof r?$d(a):r,tp($d(n),"handleHide",function(){n.props.actions.setModalSearchTerm(""),n.setState({show:!1})}),tp($d(n),"handleExit",function(){n.props.onModalDismissed&&n.props.onModalDismissed()}),tp($d(n),"handleSubmit",function(e){e&&e.preventDefault(),0!==n.state.values.length&&(n.props.onChannelsSelected(n.state.values),n.handleHide())}),tp($d(n),"addValue",function(e){var t=Object.assign([],n.state.values);e&&e.id&&-1===t.findIndex(function(t){return t.id===e.id})&&t.push(e),n.setState({values:t})}),tp($d(n),"setChannelsLoadingState",function(e){n.setState({loadingChannels:e})}),tp($d(n),"handlePageChange",function(e,t){e>t&&(n.setChannelsLoadingState(!0),n.props.actions.loadChannels(e,np+1,n.props.groupID,!0).then(function(e){var t=Kd(n.state.channels),a=n.state.channels.map(function(e){return e.id});e.data.forEach(function(e){a.includes(e.id)||t.push(e)}),n.setState({channels:t.sort(N.f)}),n.setChannelsLoadingState(!1)}))}),tp($d(n),"handleDelete",function(e){n.setState({values:e})}),tp($d(n),"search",function(e,t){0!==t.state.page&&t.setState({page:0}),n.props.actions.setModalSearchTerm(e)}),n.searchTimeoutId=0,n.state={values:[],show:!0,search:!1,loadingChannels:!0,channels:[]},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ep(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidMount",value:function(){var e=this;this.props.actions.loadChannels(0,np+1,this.props.groupID,!0).then(function(t){e.setState({channels:t.data.sort(N.f)}),e.setChannelsLoadingState(!1)})}},{key:"componentDidUpdate",value:function(e){var t=this;if(e.searchTerm!==this.props.searchTerm){clearTimeout(this.searchTimeoutId);var n=this.props.searchTerm;""===n?this.props.actions.loadChannels(0,np+1,this.props.groupID,!0).then(function(e){t.setState({channels:e.data.sort(N.f)}),t.setChannelsLoadingState(!1)}):this.searchTimeoutId=setTimeout(Jd(regeneratorRuntime.mark(function e(){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.setChannelsLoadingState(!0),e.next=3,t.props.actions.searchChannels(n,t.props.groupID,!0);case 3:a=e.sent,t.setState({channels:a.data}),t.setChannelsLoadingState(!1);case 6:case"end":return e.stop()}},e)})),w.Q.SEARCH_TIMEOUT_MILLISECONDS)}}},{key:"renderOption",value:function(e,t,n){var a="";return t&&(a="more-modal__row--selected"),g.a.createElement("div",{key:e.id,ref:t?"selected":e.id,className:"more-modal__row clickable "+a,onClick:function(){return n(e)}},g.a.createElement("div",{className:"more-modal__details"},"P"===e.type&&g.a.createElement(bd.a,{className:"icon icon__lock"}),"O"===e.type&&g.a.createElement(fd.a,{className:"icon icon__globe"}),g.a.createElement("span",{className:"channel-name"},e.display_name),g.a.createElement("span",{className:"team-name"},"("+e.team_display_name+")")),g.a.createElement("div",{className:"more-modal__actions"},g.a.createElement("div",{className:"more-modal__actions--round"},g.a.createElement("i",{className:"fa fa-plus"}))))}},{key:"renderValue",value:function(e){return e.data.display_name+" ("+e.data.team_display_name+")"}},{key:"render",value:function(){var e=g.a.createElement(E.c,{id:"multiselect.selectChannels",defaultMessage:"Use ↑↓ to browse, ↵ to select."}),t=Object(N.ab)("multiselect.add","Add");return g.a.createElement(Xo.a,{dialogClassName:"a11y__modal more-modal more-direct-channels channel-selector-modal",show:this.state.show,onHide:this.handleHide,onExited:this.handleExit,role:"dialog","aria-labelledby":"channelSelectorModalLabel"},g.a.createElement(Xo.a.Header,{closeButton:!0},g.a.createElement(Xo.a.Title,{componentClass:"h1",id:"channelSelectorModalLabel"},g.a.createElement(Xt.b,{id:"add_channels_to_scheme.title",defaultMessage:"Add Channels To **Channel Selection** List"}))),g.a.createElement(Xo.a.Body,null,g.a.createElement(ks.a,{key:"addChannelsToSchemeKey",options:this.state.channels,optionRenderer:this.renderOption,values:this.state.values,valueRenderer:this.renderValue,perPage:np,handlePageChange:this.handlePageChange,handleInput:this.search,handleDelete:this.handleDelete,handleAdd:this.addValue,handleSubmit:this.handleSubmit,numRemainingText:e,buttonSubmitText:t,saving:!1,loading:this.state.loadingChannels,placeholderText:Object(N.ab)("multiselect.addChannelsPlaceholder","Search and add channels")})))}}])&&Qd(n.prototype,a),r&&Qd(n,r),t}();tp(ap,"propTypes",{searchTerm:b.a.string.isRequired,onModalDismissed:b.a.func,onChannelsSelected:b.a.func,groupID:b.a.string.isRequired,actions:b.a.shape({loadChannels:b.a.func.isRequired,setModalSearchTerm:b.a.func.isRequired,searchChannels:b.a.func.isRequired}).isRequired});var rp=Object(a.connect)(function(e){return{searchTerm:e.views.search.modalSearch}},function(e){return{actions:Object(r.bindActionCreators)({loadChannels:zd.getAllChannels,setModalSearchTerm:Ps.a,searchChannels:zd.searchAllChannels},e)}})(ap);function ip(e){return(ip="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function op(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function sp(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function lp(e){return(lp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function cp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function up(e,t){return(up=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dp=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=lp(t).call(this,e),n=!r||"object"!==ip(r)&&"function"!=typeof r?cp(a):r,mp(cp(n),"openAddChannel",function(){n.setState({addChannelOpen:!0})}),mp(cp(n),"closeAddChannel",function(){n.setState({addChannelOpen:!1})}),mp(cp(n),"openAddTeam",function(){n.setState({addTeamOpen:!0})}),mp(cp(n),"closeAddTeam",function(){n.setState({addTeamOpen:!1})}),mp(cp(n),"addTeams",function(e){var t=[],a=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done);a=!0){var l=o.value;t.push(n.props.actions.link(n.props.groupID,l.id,j.Groups.SYNCABLE_TYPE_TEAM,{auto_add:!0}))}}catch(e){r=!0,i=e}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}return Promise.all(t).finally(function(){return n.props.actions.getGroupSyncables(n.props.groupID,j.Groups.SYNCABLE_TYPE_TEAM)})}),mp(cp(n),"addChannels",function(){var e,t=(e=regeneratorRuntime.mark(function e(t){var a,r,i,o,s,l,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(a=[],r=!0,i=!1,o=void 0,e.prev=4,s=t[Symbol.iterator]();!(r=(l=s.next()).done);r=!0)c=l.value,a.push(n.props.actions.link(n.props.groupID,c.id,j.Groups.SYNCABLE_TYPE_CHANNEL,{auto_add:!0}));e.next=12;break;case 8:e.prev=8,e.t0=e.catch(4),i=!0,o=e.t0;case 12:e.prev=12,e.prev=13,r||null==s.return||s.return();case 15:if(e.prev=15,!i){e.next=18;break}throw o;case 18:return e.finish(15);case 19:return e.finish(12);case 20:return e.abrupt("return",Promise.all(a).finally(function(){return n.props.actions.getGroupSyncables(n.props.groupID,j.Groups.SYNCABLE_TYPE_CHANNEL)}));case 21:case"end":return e.stop()}},e,null,[[4,8,12,20],[13,,15,19]])}),function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){op(i,a,r,o,s,"next",e)}function s(e){op(i,a,r,o,s,"throw",e)}o(void 0)})});return function(e){return t.apply(this,arguments)}}()),mp(cp(n),"render",function(){var e=n.props,t=e.group,a=e.members,r=e.groupTeams,i=e.groupChannels,o=e.memberCount;return g.a.createElement("div",{className:"wrapper--fixed"},g.a.createElement("div",{className:"admin-console__header with-back"},g.a.createElement("div",null,g.a.createElement(Wi,{to:"/admin_console/user_management/groups",className:"fa fa-angle-left back"}),g.a.createElement(E.c,{id:"admin.group_settings.group_detail.group_configuration",defaultMessage:"Group Configuration"}))),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement("div",{className:"banner info"},g.a.createElement("div",{className:"banner__content"},g.a.createElement(E.c,{id:"admin.group_settings.group_detail.introBanner",defaultMessage:"Configure default teams and channels and view users belonging to this group."}))),g.a.createElement(di,{id:"group_profile",titleId:Object(A.b)("admin.group_settings.group_detail.groupProfileTitle"),titleDefault:"Group Profile",subtitleId:Object(A.b)("admin.group_settings.group_detail.groupProfileDescription"),subtitleDefault:"The name for this group."},g.a.createElement(pd,{name:t.display_name})),g.a.createElement(di,{id:"group_teams_and_channels",titleId:Object(A.b)("admin.group_settings.group_detail.groupTeamsAndChannelsTitle"),titleDefault:"Team and Channel Membership",subtitleId:Object(A.b)("admin.group_settings.group_detail.groupTeamsAndChannelsDescription"),subtitleDefault:"Set default teams and channels for group members. Teams added will include default channels, town-square, and off-topic. Adding a channel without setting the team will add the implied team to the listing below.",button:g.a.createElement("div",{className:"group-profile-add-menu"},g.a.createElement(Nl.a,null,g.a.createElement("button",{className:"btn btn-primary"},g.a.createElement(E.c,{id:"admin.group_settings.group_details.add_team_or_channel",defaultMessage:"Add Team or Channel"}),g.a.createElement("i",{className:"fa fa-caret-down"})),g.a.createElement(Al.a,{ariaLabel:Object(N.ab)("admin.group_settings.group_details.menuAriaLabel","Add Team or Channel Menu")},g.a.createElement(Dl.a,{onClick:n.openAddTeam,text:Object(N.ab)("admin.group_settings.group_details.add_team","Add Team")}),g.a.createElement(Dl.a,{onClick:n.openAddChannel,text:Object(N.ab)("admin.group_settings.group_details.add_channel","Add Channel")}))))},g.a.createElement(kd,{id:n.props.groupID,teams:r,channels:i,loading:n.state.loadingTeamsAndChannels,getGroupSyncables:n.props.actions.getGroupSyncables,unlink:n.props.actions.unlink})),n.state.addTeamOpen&&g.a.createElement(zs,{onModalDismissed:n.closeAddTeam,onTeamsSelected:n.addTeams,alreadySelected:n.props.groupTeams.map(function(e){return e.team_id})}),n.state.addChannelOpen&&g.a.createElement(rp,{onModalDismissed:n.closeAddChannel,onChannelsSelected:n.addChannels,alreadySelected:n.props.groupChannels.map(function(e){return e.channel_id}),groupID:n.props.groupID}),g.a.createElement(di,{id:"group_users",titleId:Object(A.b)("admin.group_settings.group_detail.groupUsersTitle"),titleDefault:"Users",subtitleId:Object(A.b)("admin.group_settings.group_detail.groupUsersDescription"),subtitleDefault:"Listing of users in Mattermost associated with this group."},g.a.createElement(Wd,{members:a,total:o,groupID:n.props.groupID,getMembers:n.props.actions.getMembers})))))}),n.state={loadingTeamsAndChannels:!0,addTeamOpen:!1,addChannelOpen:!1},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&up(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.groupID,a=t.actions;a.getGroup(n),Promise.all([a.getGroupSyncables(n,j.Groups.SYNCABLE_TYPE_TEAM),a.getGroupSyncables(n,j.Groups.SYNCABLE_TYPE_CHANNEL)]).then(function(){e.setState({loadingTeamsAndChannels:!1})})}}])&&sp(n.prototype,a),r&&sp(n,r),t}();mp(dp,"propTypes",{groupID:b.a.string.isRequired,group:b.a.object,groupTeams:b.a.arrayOf(b.a.object),groupChannels:b.a.arrayOf(b.a.object),members:b.a.arrayOf(b.a.object),memberCount:b.a.number.isRequired,actions:b.a.shape({getGroup:b.a.func.isRequired,getMembers:b.a.func.isRequired,getGroupSyncables:b.a.func.isRequired,link:b.a.func.isRequired,unlink:b.a.func.isRequired}).isRequired}),mp(dp,"defaultProps",{members:[],groupTeams:[],groupChannels:[],group:{display_name:""},memberCount:0});var pp=Object(a.connect)(function(e,t){var n=t.match.params.group_id;return{groupID:n,group:Object(sd.getGroup)(e,n),groupTeams:Object(sd.getGroupTeams)(e,n),groupChannels:Object(sd.getGroupChannels)(e,n),members:Object(sd.getGroupMembers)(e,n),memberCount:Object(sd.getGroupMemberCount)(e,n)}},function(e){return{actions:Object(r.bindActionCreators)({getGroup:od.getGroup,getMembers:od.getGroupMembers,getGroupSyncables:od.getGroupSyncables,link:od.linkGroupSyncable,unlink:od.unlinkGroupSyncable},e)}})(dp);n(2345);function fp(e){return(fp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bp(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function hp(e,t){return!t||"object"!==fp(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function gp(e){return(gp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yp(e,t){return(yp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var vp=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hp(this,gp(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yp(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){var e,t=this.props,n=t.small,a=t.teamIconUrl,r=n?"small":"large";if(a)e=g.a.createElement("div",{className:"team-btn__content no-hover"},g.a.createElement("div",{className:"team-btn__image team-btn-".concat(r,"__image"),style:{backgroundImage:"url('".concat(a,"')")}}));else{var i=this.props.displayName;i=i?i.replace(/\s/g,"").substring(0,2):"??",e=g.a.createElement("div",{className:"team-btn__content no-hover"},g.a.createElement("div",{className:"team-btn__initials team-btn-".concat(r,"__initials")},i))}return g.a.createElement("div",{className:"team-container"},g.a.createElement("div",{className:"team-btn team-btn-".concat(r)},e))}}])&&bp(n.prototype,a),r&&bp(n,r),t}();function _p(e){return(_p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ep(e){return(Ep=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Sp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Op(e,t){return(Op=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}vp.propTypes={small:b.a.bool,teamIconUrl:b.a.string,displayName:b.a.string};var wp=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=Ep(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==_p(r)&&"function"!=typeof r?Sp(a):r,Tp(Sp(n),"handleRowClick",function(){var e=n.props,t=e.team;(0,e.onRowClick)(t.id)}),Tp(Sp(n),"render",function(){var e=n.props.team,t=N.I(e);return g.a.createElement("div",{className:"group ",onClick:n.handleRowClick},g.a.createElement("div",{className:"group-row group-row-large"},g.a.createElement("div",{className:"group-name adjusted center-row row-content"},g.a.createElement("div",null,g.a.createElement(vp,{small:!0,teamIconUrl:t,displayName:e.display_name})),g.a.createElement("div",null,g.a.createElement("b",null,e.display_name),e.description&&g.a.createElement("div",{className:"overflow--ellipsis text-nowrap team-descr-list-column"},e.description))),g.a.createElement("span",{className:"group-description adjusted row-content"},g.a.createElement(E.c,{id:"admin.team_settings.team_row.managementMethod.".concat(e.group_constrained?"group":"manual"),defaultMessage:e.group_constrained?"Group Sync":"Manual Invites"})),g.a.createElement("span",{className:"group-actions"},g.a.createElement(La.a,{to:"/admin_console/user_management/teams/".concat(e.id)},g.a.createElement(E.c,{id:"admin.team_settings.team_row.configure",defaultMessage:"Edit"})))))}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Op(e,t)}(t,g.a.Component),t}();function jp(e){return(jp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xp(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Pp(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){xp(i,a,r,o,s,"next",e)}function s(e){xp(i,a,r,o,s,"throw",e)}o(void 0)})}}function kp(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Cp(e){return(Cp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Mp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rp(e,t){return(Rp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Np(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Tp(wp,"propTypes",{team:b.a.object.isRequired,onRowClick:b.a.func.isRequired});var Ap=10,Dp=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Cp(t).call(this,e),n=!r||"object"!==jp(r)&&"function"!=typeof r?Mp(a):r,Np(Mp(n),"previousPage",function(){var e=Pp(regeneratorRuntime.mark(function e(t){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t.preventDefault(),a=n.state.page<1?0:n.state.page-1,n.setState({page:a,loading:!0}),n.performSearch(a);case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),Np(Mp(n),"nextPage",function(){var e=Pp(regeneratorRuntime.mark(function e(t){var a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t.preventDefault(),a=n.state.page+1,n.setState({page:a,loading:!0}),n.performSearch(a);case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),Np(Mp(n),"renderRows",function(){if(n.state.loading)return g.a.createElement("div",{className:"groups-list-loading"},g.a.createElement("i",{className:"fa fa-spinner fa-pulse fa-2x"}));if(0===n.props.data.length)return g.a.createElement("div",{className:"groups-list-empty"},g.a.createElement(E.c,{id:n.props.emptyListTextId,defaultMessage:n.props.emptyListTextDefaultMessage}));var e=n.state.page*Ap;return n.props.data.slice(e,e+Ap).map(n.props.renderRow)}),Np(Mp(n),"performSearch",function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){Np(e,t,n[t])})}return e}({},n.state);delete t.page,t.loading=!0,n.setState(t),n.props.actions.getData(e,Ap).then(function(){n.props.onPageChangedCallback&&n.props.onPageChangedCallback(n.getPaging()),n.setState({loading:!1})})}),Np(Mp(n),"render",function(){var e=n.getPaging(),t=e.startCount,a=e.endCount,r=e.total,i=a===r,o=0===n.state.page;return g.a.createElement("div",{className:"groups-list groups-list-no-padding"},r>0&&n.props.header,g.a.createElement("div",{className:"groups-list--body"},n.renderRows()),r>0&&g.a.createElement("div",{className:"groups-list--footer"},g.a.createElement("div",{className:"counter"},g.a.createElement(E.c,{id:"admin.team_channel_settings.list.paginatorCount",defaultMessage:"{startCount, number} - {endCount, number} of {total, number}",values:{startCount:t,endCount:a,total:r}})),g.a.createElement("button",{className:"btn btn-link prev "+(o?"disabled":""),onClick:o?null:n.previousPage,disabled:o},g.a.createElement(Um.a,null)),g.a.createElement("button",{className:"btn btn-link next "+(i?"disabled":""),onClick:i?null:n.nextPage,disabled:i},g.a.createElement(em.a,null))))}),n.state={loading:!0,page:0},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rp(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"componentDidMount",value:function(){this.performSearch(this.state.page)}},{key:"getPaging",value:function(){var e=this.state.page*Ap+1,t=this.state.page*Ap+Ap,n=this.props.total;return t>n&&(t=n),{startCount:e,endCount:t,total:n}}}])&&kp(n.prototype,a),r&&kp(n,r),t}();function Lp(e){return(Lp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ip(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Up(e){return(Up=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bp(e,t){return(Bp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Np(Dp,"propTypes",{data:b.a.arrayOf(b.a.object),onPageChangedCallback:b.a.func,total:b.a.number.isRequired,header:b.a.node.isRequired,renderRow:b.a.func.isRequired,emptyListTextId:b.a.string.isRequired,emptyListTextDefaultMessage:b.a.string.isRequired,actions:b.a.shape({getData:b.a.func.isRequired,removeGroup:b.a.func}).isRequired}),Np(Dp,"defaultProps",{data:[]});var Gp=function(){return g.a.createElement("div",{className:"groups-list--header"},g.a.createElement("div",{className:"group-name adjusted"},g.a.createElement(E.c,{id:"admin.team_settings.team_list.nameHeader",defaultMessage:"Name"})),g.a.createElement("div",{className:"group-description adjusted"},g.a.createElement(E.c,{id:"admin.team_settings.team_list.mappingHeader",defaultMessage:"Management"})),g.a.createElement("div",{className:"group-actions"}))},Hp=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=Up(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Lp(r)&&"function"!=typeof r?qp(a):r,Fp(qp(n),"renderRow",function(e){return g.a.createElement(wp,{key:e.id,team:e,onRowClick:n.onTeamClick})}),Fp(qp(n),"onTeamClick",function(e){Ii.a.push("/admin_console/user_management/teams/".concat(e))}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bp(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){return g.a.createElement(Dp,Object.assign({header:g.a.createElement(Gp,null),renderRow:this.renderRow},this.props))}}])&&Ip(n.prototype,a),r&&Ip(n,r),t}(),Yp=Object(ir.a)(ba.getTeams,function(e){return Object.values(e).sort(function(e,t){return e.display_name.localeCompare(t.display_name)})});var Wp=Object(a.connect)(function(e){return{data:Yp(e),total:e.entities.teams.totalCount||0,emptyListTextId:Object(A.b)("admin.team_settings.team_list.no_teams_found"),emptyListTextDefaultMessage:"No teams found"}},function(e){return{actions:Object(r.bindActionCreators)({getData:function(e,t){return Object(pa.getTeams)(e,t,!0)}},e)}})(Hp);function zp(e){return(zp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){Qp(e,t,n[t])})}return e}function Xp(e){return(Xp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kp(e,t){return(Kp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Zp=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Xp(t).call(this,e),n=!r||"object"!==zp(r)&&"function"!=typeof r?Jp(a):r,Qp(Jp(n),"onPageChangedCallback",function(e){var t=e.startCount,a=e.endCount,r=e.total;n.setState({startCount:t,endCount:a,total:r})}),Qp(Jp(n),"render",function(){return g.a.createElement("div",{className:"wrapper--fixed"},g.a.createElement("div",{className:"admin-console__header"},g.a.createElement(E.c,{id:"admin.team_settings.groupsPageTitle",defaultMessage:"{siteName} Teams",values:{siteName:n.props.siteName}})),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement(di,{id:"teams",titleId:Object(A.b)("admin.team_settings.title"),titleDefault:"Teams",subtitleId:Object(A.b)("admin.team_settings.description"),subtitleDefault:"Showing {startCount, number} - {endCount, number} of {total, number} teams. Manage team settings.",subtitleValues:Vp({},n.state)},g.a.createElement(Wp,{onPageChangedCallback:n.onPageChangedCallback})))))}),n.state={startCount:0,endCount:1,total:0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kp(e,t)}(t,g.a.Component),t}();Qp(Zp,"propTypes",{siteName:b.a.string.isRequired});var $p=Object(a.connect)(function(e){return{siteName:Object(c.getConfig)(e).SiteName}})(Zp);function ef(e){return(ef="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tf(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function nf(e,t){return!t||"object"!==ef(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function af(e){return(af=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rf(e,t){return(rf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var of=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),nf(this,af(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&rf(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){var e=this.props,t=e.amount,n=e.inChannel,a=g.a.createElement(E.c,{id:"admin.team_channel_settings.removeConfirmModal.title",defaultMessage:"Save and remove {amount, number} {amount, plural, one {user} other {users}}?",values:{amount:t}}),r=g.a.createElement(E.c,{id:"admin.team_channel_settings.removeConfirmModal.message",defaultMessage:"{amount, number} {amount, plural, one {user} other {users}} will be removed on the next AD/LDAP synchronization. They are not in groups linked to this {type}. Are you sure you wish to remove these users?",values:{amount:t,type:n?"channel":"group"}}),i=g.a.createElement(E.c,{id:"admin.team_channel_settings.removeConfirmModal.remove",defaultMessage:"Save and Remove Users"}),o=this.props,s=o.show,l=o.onConfirm,c=o.onCancel;return g.a.createElement(Sn.a,{show:s,title:a,message:r,modalClass:"discard-changes-modal",confirmButtonClass:"btn btn-primary",confirmButtonText:i,onConfirm:l,onCancel:c})}}])&&tf(n.prototype,a),r&&tf(n,r),t}();!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(of,"propTypes",{show:b.a.bool.isRequired,onConfirm:b.a.func.isRequired,onCancel:b.a.func.isRequired,inChannel:b.a.bool.isRequired,amount:b.a.number.isRequired});var sf=n(1602);function lf(e){return(lf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cf(e){return(cf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function uf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mf(e,t){return(mf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function df(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pf=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=cf(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==lf(r)&&"function"!=typeof r?uf(a):r,df(uf(n),"renderRolesColumn",function(e){return e.roles.split(" ").map(function(e){return N.ab("admin.permissions.roles."+e+".name",e)}).join(", ")}),df(uf(n),"renderGroupsColumn",function(e){return 1===e.groups.length?e.groups[0].display_name:g.a.createElement(kn.a,{placement:"top",overlay:g.a.createElement(O.a,{id:"groupsTooltip"},e.groups.map(function(e){return e.display_name}).join(", "))},g.a.createElement("a",{href:"#"},g.a.createElement(E.c,{id:Object(A.b)("team_channel_settings.group.group_user_row.numberOfGroups"),defaultMessage:"{amount, number} {amount, plural, one {Group} other {Groups}}",values:{amount:e.groups.length}})))}),df(uf(n),"render",function(){var e=n.props,t=e.user,a=e.lastPictureUpdate,r=e.displayName;return g.a.createElement("div",{className:"group "},g.a.createElement("div",{className:"group-row",style:{padding:"30px 0px"}},g.a.createElement("div",{className:"group-name"},g.a.createElement("div",{className:"row"},g.a.createElement("div",{className:"col-sm-2"},g.a.createElement("img",{className:"group-user-profile-picture",alt:"",src:gr.Client4.getProfilePictureUrl(t.id,a)})),g.a.createElement("div",{className:"col-sm-10"},g.a.createElement("div",{className:"row"},g.a.createElement("b",null,"@"+t.username," "),"-"," ",r),g.a.createElement("div",{className:"row"},t.email)))),g.a.createElement("span",{className:"group-user-removal-column group-description"},n.renderRolesColumn(t)),g.a.createElement("span",{className:"group-user-removal-column group-description group-description-link"},n.renderGroupsColumn(t))))}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mf(e,t)}(t,g.a.PureComponent),t}();function ff(e){return(ff="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bf(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function hf(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){bf(i,a,r,o,s,"next",e)}function s(e){bf(i,a,r,o,s,"throw",e)}o(void 0)})}}function gf(e){return(gf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vf(e,t){return(vf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}df(pf,"propTypes",{displayName:b.a.string.isRequired,user:b.a.object.isRequired,lastPictureUpdate:b.a.number.isRequired});var Ef=10,Sf=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=gf(t).call(this,e),n=!r||"object"!==ff(r)&&"function"!=typeof r?yf(a):r,_f(yf(n),"previousPage",hf(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=n.state.page<1?0:n.state.page-1,n.setState({page:t});case 2:case"end":return e.stop()}},e)}))),_f(yf(n),"nextPage",hf(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=(n.state.page+1)*Ef>=n.props.total?n.state.page:n.state.page+1,n.setState({page:t});case 2:case"end":return e.stop()}},e)}))),_f(yf(n),"renderRow",function(e){return g.a.createElement(pf,{key:e.id,user:e,displayName:e.first_name+" "+e.last_name,lastPictureUpdate:e.last_picture_update||0})}),_f(yf(n),"renderRows",function(){var e=n.state.page*Ef;return n.props.members.slice(e,e+Ef).map(n.renderRow)}),_f(yf(n),"renderPagination",function(){var e=n.state.page,t=e*Ef+1,a=e*Ef+Ef,r=n.props.total;a>r&&(a=r);var i=a===r,o=0===e;return g.a.createElement("div",{className:"groups-list--footer"},g.a.createElement("div",{className:"counter"},g.a.createElement(E.c,{id:"admin.team_channel_settings.list.paginatorCount",defaultMessage:"{startCount, number} - {endCount, number} of {total, number}",values:{startCount:t,endCount:a,total:r}})),g.a.createElement("button",{className:"btn btn-link prev "+(o?"disabled":""),onClick:n.previousPage,disabled:o},g.a.createElement(Um.a,null)),g.a.createElement("button",{className:"btn btn-link next "+(i?"disabled":""),onClick:n.nextPage,disabled:i},g.a.createElement(em.a,null)))}),_f(yf(n),"render",function(){return g.a.createElement("div",{className:"groups-list groups-list-less-padding"},g.a.createElement("div",{className:"groups-list--header"},g.a.createElement("div",{className:"group-name"},g.a.createElement(E.c,{id:"admin.team_channel_settings.user_list.nameHeader",defaultMessage:"Name"})),g.a.createElement("div",{className:"group-description"},g.a.createElement(E.c,{id:"admin.team_channel_settings.user_list.roleHeader",defaultMessage:"Role"})),g.a.createElement("div",{className:"group-description"},g.a.createElement(E.c,{id:"admin.team_channel_settings.user_list.groupsHeader",defaultMessage:"Groups"}))),g.a.createElement("div",{className:"groups-list--body"},n.renderRows()),n.renderPagination())}),n.state={page:0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vf(e,t)}(t,g.a.PureComponent),t}();function Of(e){return(Of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tf(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function wf(e){return(wf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function jf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xf(e,t){return(xf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}_f(Sf,"propTypes",{members:b.a.arrayOf(b.a.object),total:b.a.number.isRequired});var kf=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=wf(t).call(this,e),n=!r||"object"!==Of(r)&&"function"!=typeof r?jf(a):r,Pf(jf(n),"handleHide",function(){n.setState({show:!1})}),Pf(jf(n),"handleExit",function(){n.props.onHide&&n.props.onHide()}),n.state={values:[],show:!0},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xf(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){var e=this.props,t=e.users,n=e.total,a=g.a.createElement(Xt.b,{id:"admin.team_channel_settings.usersToBeRemovedModal.title",defaultMessage:"**{total, number} {total, plural, one {User} other {Users}}** To Be Removed",values:{total:n}}),r=g.a.createElement(E.c,{id:"admin.team_channel_settings.usersToBeRemovedModal.message",defaultMessage:"The members listed below are not in any of the groups currently linked to this team. Because this team is set to be managed by group sync they will all be removed once saved."}),i=g.a.createElement(E.c,{id:"admin.team_channel_settings.usersToBeRemovedModal.close",defaultMessage:"Close"});return g.a.createElement(Xo.a,{dialogClassName:"a11y__modal settings-modal",show:this.state.show,onHide:this.handleHide,onExited:this.handleExit,id:"confirmModal",role:"dialog","aria-labelledby":"confirmModalLabel"},g.a.createElement(Xo.a.Header,{closeButton:!0},g.a.createElement(Xo.a.Title,{componentClass:"h1",id:"confirmModalLabel"},a)),g.a.createElement(Xo.a.Body,null,g.a.createElement("div",{className:"group-users-to-remove-modal-description"},r),g.a.createElement(Sf,{members:t,total:n})),g.a.createElement(Xo.a.Footer,null,g.a.createElement("button",{autoFocus:!0,type:"button",className:"btn btn-primary",onClick:this.handleHide,id:"closeModalButton"},i)))}}])&&Tf(n.prototype,a),r&&Tf(n,r),t}();function Cf(e){return(Cf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Mf(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Rf(e,t){return!t||"object"!==Cf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Nf(e){return(Nf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Af(e,t){return(Af=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Pf(kf,"propTypes",{total:b.a.number.isRequired,users:b.a.arrayOf(b.a.object).isRequired,onHide:b.a.func});var Df=function(e){var t=e.warning;return g.a.createElement(Se.a,{iconClassName:"fa-exclamation-".concat(t?"circle":"triangle"),textClassName:"has-".concat(t?"warning":"error"),error:g.a.createElement(E.c,{id:"admin.team_channel_settings.need_groups",defaultMessage:"You must add at least one group to manage this team by sync group members."})})},Lf=function(){return g.a.createElement(Se.a,{error:g.a.createElement(E.c,{id:"admin.team_channel_settings.need_domains",defaultMessage:"Please specify emails domains."})})};Df.propTypes={warning:f.bool};var If=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Rf(this,Nf(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Af(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){var e=this.props,t=e.total,n=e.users;return g.a.createElement(Se.a,{iconClassName:"fa-exclamation-triangle",textClassName:"has-warning",error:g.a.createElement("span",null,g.a.createElement(E.c,{id:"admin.team_channel_settings.users_will_be_removed",defaultMessage:"{amount, number} {amount, plural, one {User} other {Users}} will be removed from this team. They are not in groups linked to this team.",values:{amount:t}}),g.a.createElement(sf.a,{className:"btn btn-link",dialogType:kf,dialogProps:{total:t,users:n}},g.a.createElement(E.c,{id:"admin.team_channel_settings.view_removed_users",defaultMessage:"View These Users"})))})}}])&&Mf(n.prototype,a),r&&Mf(n,r),t}();function Uf(e){var t=e.saveNeeded,n=e.onClick,a=e.saving,r=e.serverError,i=e.cancelLink;return g.a.createElement("div",{className:"admin-console-save"},g.a.createElement(nn.a,{saving:a,disabled:!t,onClick:n,savingMessage:Object(N.ab)("admin.team_channel_settings.saving","Saving Config...")}),g.a.createElement(Wi,{className:"cancel-button",to:i},g.a.createElement(E.c,{id:"admin.team_channel_settings.cancel",defaultMessage:"Cancel"})),g.a.createElement("div",{className:"error-message"},r))}function qf(e){var t=e.team,n=N.I(t);return g.a.createElement(di,{id:"team_profile",titleId:Object(A.b)("admin.team_settings.team_detail.profileTitle"),titleDefault:"Team Profile",subtitleId:Object(A.b)("admin.team_settings.team_detail.profileDescription"),subtitleDefault:"Summary of the team, including team name and description."},g.a.createElement("div",{className:"group-teams-and-channels"},g.a.createElement("div",{className:"group-teams-and-channels--body"},g.a.createElement("div",{className:"row"},g.a.createElement("div",{className:"col-sm-2 large-team-image-col"},g.a.createElement(vp,{displayName:t.display_name,teamIconUrl:n})),g.a.createElement("div",{className:"col-sm-10"},g.a.createElement("div",{className:"row row-bottom-padding"},g.a.createElement(Xt.b,{id:"admin.team_settings.team_detail.teamName",defaultMessage:"**Team Name**:"}),g.a.createElement("br",null),t.display_name),g.a.createElement("div",{className:"row"},g.a.createElement(Xt.b,{id:"admin.team_settings.team_detail.teamDescription",defaultMessage:"**Team Description**:"}),g.a.createElement("br",null),t.description||g.a.createElement("span",{className:"greyed-out"},N.ab("admin.team_settings.team_detail.profileNoDescription","No team description added."))))))))}function Bf(e){var t=e.onToggle,n=e.toggled,a=e.onText,r=e.offText;return g.a.createElement("button",{type:"button",onClick:t,className:"btn btn-lg btn-toggle ".concat(n&&"active"),"aria-pressed":n?"true":"false",autoComplete:"off"},g.a.createElement("div",{className:"handle"}),function(e,t,n){if(e&&!t||!e&&!n)return null;return g.a.createElement("div",{className:"bg-text ".concat(e?"on":"off")},e?t:n)}(n,a,r))}function Ff(e){return(Ff="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gf(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Hf(e,t){return!t||"object"!==Ff(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Yf(e){return(Yf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Wf(e,t){return(Wf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(If,"propTypes",{users:f.arrayOf(f.object).isRequired,total:f.number.isRequired}),Uf.propTypes={saving:b.a.bool.isRequired,saveNeeded:b.a.bool.isRequired,onClick:b.a.func.isRequired,cancelLink:b.a.string.isRequired,serverError:b.a.node},qf.propTypes={team:b.a.object.isRequired},Bf.propTypes={onToggle:b.a.func.isRequired,toggled:b.a.bool,onText:b.a.node,offText:b.a.node};var zf=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Hf(this,Yf(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wf(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){var e=this.props,t=e.title,n=e.subTitle,a=e.singleLine,r=e.toggled,i=e.onToggle,o=e.children,s=e.offText,l=e.onText,c=e.last;return g.a.createElement("div",null,g.a.createElement("div",{className:"row align-items-start"},g.a.createElement("div",{className:"col-sm-10"},g.a.createElement("label",{className:"control-label"},t)),g.a.createElement("div",{className:"col-sm-2"},g.a.createElement(Bf,{onToggle:i,toggled:r,onText:l,offText:s}))),g.a.createElement("div",{className:"row"},g.a.createElement("div",{className:"col-sm-10"},g.a.createElement("div",{className:"help-text-small help-text-no-padding ".concat(a?"help-text-single-line":"")},n))),o,!c&&g.a.createElement("div",{className:"section-separator"},g.a.createElement("hr",{className:"separator__hr"})))}}])&&Gf(n.prototype,a),r&&Gf(n,r),t}();!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(zf,"propTypes",{title:b.a.node.isRequired,last:b.a.bool,toggled:b.a.bool.isRequired,singleLine:b.a.bool,subTitle:b.a.node.isRequired,onToggle:b.a.func.isRequired,children:b.a.node,offText:b.a.node,onText:b.a.node});var Vf=function(e){var t=e.syncChecked,n=e.allAllowedChecked,a=e.allowedDomainsChecked,r=e.allowedDomains,i=e.onToggle;return g.a.createElement(zf,{toggled:t,last:t,onToggle:function(){return i(!t,n,a,r)},title:g.a.createElement(E.c,{id:"admin.team_settings.team_details.syncGroupMembers",defaultMessage:"Sync Group Members"}),subTitle:g.a.createElement(Xt.b,{id:"admin.team_settings.team_details.syncGroupMembersDescr",defaultMessage:"When enabled, adding and removing users from groups will add or remove them from this team. The only way of inviting members to this team is by adding the groups they belong to. [Learn More](!https://www.mattermost.com/pl/default-ldap-group-constrained-team-channel.html)"})})};Vf.propTypes={syncChecked:b.a.bool.isRequired,allAllowedChecked:b.a.bool.isRequired,allowedDomainsChecked:b.a.bool.isRequired,allowedDomains:b.a.string.isRequired,onToggle:b.a.func.isRequired};var Xf=function(e){var t=e.syncChecked,n=e.allAllowedChecked,a=e.allowedDomainsChecked,r=e.allowedDomains,i=e.onToggle;return!t&&g.a.createElement(zf,{toggled:n,singleLine:!0,onToggle:function(){return i(t,!n,a,r)},title:g.a.createElement(E.c,{id:"admin.team_settings.team_details.anyoneCanJoin",defaultMessage:"Anyone can join this team"}),subTitle:g.a.createElement(E.c,{id:"admin.team_settings.team_details.anyoneCanJoinDescr",defaultMessage:"This team can be discovered allowing anyone with an account to join this team."})})};Xf.propTypes={syncChecked:b.a.bool.isRequired,allAllowedChecked:b.a.bool.isRequired,allowedDomainsChecked:b.a.bool.isRequired,allowedDomains:b.a.string.isRequired,onToggle:b.a.func.isRequired};var Jf=function(e){var t=e.syncChecked,n=e.allAllowedChecked,a=e.allowedDomainsChecked,r=e.allowedDomains,i=e.onToggle;return!t&&g.a.createElement(zf,{toggled:a,last:!0,onToggle:function(){return i(t,n,!a,r)},singleLine:!0,title:g.a.createElement(E.c,{id:"admin.team_settings.team_details.specificDomains",defaultMessage:"Only specific email domains can join this team"}),subTitle:g.a.createElement(E.c,{id:"admin.team_settings.team_details.specificDomainsDescr",defaultMessage:"Users can only join the team if their email matches one of the specified domains"})},g.a.createElement("div",{className:"help-text csvDomains"},g.a.createElement(E.c,{id:"admin.team_settings.team_details.csvDomains",defaultMessage:"Comma Separated Email Domain List"})),g.a.createElement("input",{type:"text",value:r,placeholder:"mattermost.org",className:"form-control",onChange:function(e){return i(t,n,a,e.currentTarget.value)}}))};Jf.propTypes={syncChecked:b.a.bool.isRequired,allAllowedChecked:b.a.bool.isRequired,allowedDomainsChecked:b.a.bool.isRequired,allowedDomains:b.a.string.isRequired,onToggle:b.a.func.isRequired};var Kf=function(e){var t=e.allAllowedChecked,n=e.syncChecked,a=e.allowedDomains,r=e.allowedDomainsChecked,i=e.onToggle;return g.a.createElement(di,{id:"team_manage",titleId:Object(A.b)("admin.team_settings.team_detail.manageTitle"),titleDefault:"Team Management",subtitleId:Object(A.b)("admin.team_settings.team_detail.manageDescription"),subtitleDefault:"Choose between inviting members manually or syncing members automatically from groups."},g.a.createElement("div",{className:"group-teams-and-channels"},g.a.createElement("div",{className:"group-teams-and-channels--body"},g.a.createElement(Vf,{allAllowedChecked:t,allowedDomainsChecked:r,allowedDomains:a,syncChecked:n,onToggle:i}),g.a.createElement(Xf,{allAllowedChecked:t,allowedDomainsChecked:r,allowedDomains:a,syncChecked:n,onToggle:i}),g.a.createElement(Jf,{allAllowedChecked:t,allowedDomainsChecked:r,allowedDomains:a,syncChecked:n,onToggle:i}))))};Kf.propTypes={syncChecked:b.a.bool.isRequired,allAllowedChecked:b.a.bool.isRequired,allowedDomainsChecked:b.a.bool.isRequired,onToggle:b.a.func.isRequired,allowedDomains:b.a.string.isRequired};var Qf=n(1658);function Zf(e){return(Zf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $f(e){return($f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tb(e,t){return(tb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ab=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=$f(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Zf(r)&&"function"!=typeof r?eb(a):r,nb(eb(n),"removeGroup",function(){n.props.removeGroup(n.props.group.id)}),nb(eb(n),"render",function(){var e=n.props.group;return g.a.createElement("div",{className:"group"},g.a.createElement("div",{className:"group-row"},g.a.createElement("span",{className:"group-name row-content"},e.display_name||e.name),g.a.createElement("span",{className:"group-description row-content"},g.a.createElement(E.c,{id:"admin.team_channel_settings.group_row.members",defaultMessage:"{memberCount, number} {memberCount, plural, one {member} other {members}}",values:{memberCount:e.member_count}})),g.a.createElement("span",{className:"group-actions"},g.a.createElement("a",{href:"#",onClick:n.removeGroup},g.a.createElement(E.c,{id:"admin.team_channel_settings.group_row.remove",defaultMessage:"Remove"})))))}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tb(e,t)}(t,g.a.Component),t}();function rb(e){return(rb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ib(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ob(e){return(ob=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function sb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lb(e,t){return(lb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}nb(ab,"propTypes",{group:b.a.object.isRequired,removeGroup:b.a.func.isRequired});var ub=function(){return g.a.createElement("div",{className:"groups-list--header"},g.a.createElement("div",{className:"group-name group-name-adjusted"},g.a.createElement(E.c,{id:"admin.team_channel_settings.group_list.nameHeader",defaultMessage:"Name"})),g.a.createElement("div",{className:"group-description group-description-adjusted"},g.a.createElement(E.c,{id:"admin.team_channel_settings.group_list.membersHeader",defaultMessage:"Member Count"})),g.a.createElement("div",{className:"group-actions"}))},mb=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=ob(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==rb(r)&&"function"!=typeof r?sb(a):r,cb(sb(n),"renderRow",function(e){return g.a.createElement(ab,{key:e.id,group:e,removeGroup:n.props.removeGroup})}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&lb(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){return g.a.createElement(Dp,Object.assign({header:g.a.createElement(ub,null),renderRow:this.renderRow},this.props))}}])&&ib(n.prototype,a),r&&ib(n,r),t}();cb(mb,"propTypes",{removeGroup:b.a.func});var db=Object(a.connect)(function(e,t){var n=t.groups,a=t.totalGroups,r=t.isModeSync;return{data:n,removeGroup:t.onGroupRemoved,emptyListTextId:r?Object(A.b)("admin.team_channel_settings.group_list.no-synced-groups"):Object(A.b)("admin.team_channel_settings.group_list.no-groups"),emptyListTextDefaultMessage:r?"At least one group must be specified":"No groups specified yet",total:a}},function(){return{actions:{getData:function(){return Promise.resolve()}}}})(mb),pb=function(e){var t=e.onGroupRemoved,n=e.syncChecked,a=e.team,r=e.onAddCallback,i=e.totalGroups,o=e.groups,s=e.removedGroups;return g.a.createElement(di,{id:"team_groups",titleId:n?Object(A.b)("admin.team_settings.team_detail.syncedGroupsTitle"):Object(A.b)("admin.team_settings.team_detail.groupsTitle"),titleDefault:n?"Synced Groups":"Groups",subtitleId:n?Object(A.b)("admin.team_settings.team_detail.syncedGroupsDescription"):Object(A.b)("admin.team_settings.team_detail.groupsDescription"),subtitleDefault:n?"Add and remove team members based on their group membership.":"Group members will be added to the team.",button:g.a.createElement(sf.a,{className:"btn btn-primary",dialogType:Qf.a,dialogProps:{team:a,onAddCallback:r,skipCommit:!0,excludeGroups:o,includeGroups:s}},g.a.createElement(E.c,{id:"admin.team_settings.team_details.add_group",defaultMessage:"Add Group"}))},g.a.createElement(db,{team:a,isModeSync:n,groups:o,totalGroups:i,onGroupRemoved:t}))};function fb(e){return(fb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bb(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function hb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){Ob(e,t,n[t])})}return e}function gb(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function yb(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){gb(i,a,r,o,s,"next",e)}function s(e){gb(i,a,r,o,s,"throw",e)}o(void 0)})}}function vb(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function _b(e){return(_b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Eb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sb(e,t){return(Sb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ob(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}pb.propTypes={syncChecked:b.a.bool.isRequired,team:b.a.object.isRequired,totalGroups:b.a.number.isRequired,groups:b.a.arrayOf(b.a.object).isRequired,removedGroups:b.a.arrayOf(b.a.object).isRequired,onAddCallback:b.a.func.isRequired,onGroupRemoved:b.a.func.isRequired};var Tb=function(e){function t(e){var n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=_b(t).call(this,e),n=!r||"object"!==fb(r)&&"function"!=typeof r?Eb(a):r,Ob(Eb(n),"handleSubmit",yb(regeneratorRuntime.mark(function e(){var t,a,r,i,o,s,l,c,u,m,d,p,f,b,h,y,v,_;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n.setState({showRemoveConfirmation:!1,saving:!0}),t=n.state,a=t.groups,r=t.allAllowedChecked,i=t.allowedDomainsChecked,o=t.allowedDomains,s=t.syncChecked,l=null,c=!1,u=n.props,m=u.team,d=u.groups,p=u.teamID,f=u.actions,!i||0!==o.trim().length){e.next=10;break}c=!0,l=g.a.createElement(Lf,null),e.next=28;break;case 10:if(0!==n.state.groups.length||!s){e.next=15;break}l=g.a.createElement(Df,null),c=!0,e.next=28;break;case 15:return b=f.patchTeam(hb({},m,{group_constrained:s,allowed_domains:i?o:"",allow_open_invite:r})),h=d.filter(function(e){return!a.includes(e)}).map(function(e){return f.unlinkGroupSyncable(e.id,p,j.Groups.SYNCABLE_TYPE_TEAM)}),y=a.filter(function(e){return!d.includes(e)}).map(function(e){return f.linkGroupSyncable(e.id,p,j.Groups.SYNCABLE_TYPE_TEAM,{auto_add:!0})}),e.next=20,Promise.all([b].concat(bb(h),bb(y)));case 20:if(v=e.sent,!(_=v.find(function(e){return e.error}))){e.next=26;break}l=g.a.createElement(Se.a,{error:_.error.message}),e.next=28;break;case 26:return e.next=28,f.getGroups(p);case 28:n.setState({serverError:l,saving:!1,saveNeeded:c}),f.setNavigationBlocked(c);case 30:case"end":return e.stop()}},e)}))),Ob(Eb(n),"setToggles",function(e,t,a,r){n.setState({saveNeeded:!0,syncChecked:e,allAllowedChecked:!e&&t,allowedDomainsChecked:!e&&a,allowedDomains:r},function(){return n.processGroupsChange(n.state.groups)}),n.props.actions.setNavigationBlocked(!0)}),Ob(Eb(n),"handleGroupRemoved",function(e){var t=n.state.groups.filter(function(t){return t.id!==e});n.setState({totalGroups:n.state.totalGroups-1}),n.processGroupsChange(t)}),Ob(Eb(n),"handleGroupChange",function(e){var t=[].concat(bb(n.state.groups),bb(e.map(function(e){return n.props.allGroups[e]})));n.setState({totalGroups:n.state.totalGroups+e.length}),n.processGroupsChange(t)}),Ob(Eb(n),"hideRemoveUsersModal",function(){n.setState({showRemoveConfirmation:!1})}),Ob(Eb(n),"showRemoveUsersModal",function(){n.state.usersToRemove>0?n.setState({showRemoveConfirmation:!0}):n.handleSubmit()}),Ob(Eb(n),"render",function(){var e=n.props.team,t=n.state,a=t.totalGroups,r=t.saving,i=t.saveNeeded,o=t.serverError,s=t.groups,l=t.allAllowedChecked,c=t.allowedDomainsChecked,u=t.allowedDomains,m=t.syncChecked,d=t.showRemoveConfirmation,p=t.usersToRemove,f=n.props.groups.filter(function(e){return!s.find(function(t){return t.id===e.id})});return g.a.createElement("div",{className:"wrapper--fixed"},g.a.createElement("div",{className:"admin-console__header with-back"},g.a.createElement("div",null,g.a.createElement(Wi,{to:"/admin_console/user_management/teams",className:"fa fa-angle-left back"}),g.a.createElement(E.c,{id:"admin.team_settings.team_detail.group_configuration",defaultMessage:"Team Configuration"}))),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement(of,{amount:p,inChannel:!1,show:d,onCancel:n.hideRemoveUsersModal,onConfirm:n.handleSubmit}),g.a.createElement(qf,{team:e}),g.a.createElement(Kf,{allAllowedChecked:l,allowedDomainsChecked:c,allowedDomains:u,syncChecked:m,onToggle:n.setToggles}),g.a.createElement(pb,{syncChecked:m,team:e,groups:s,removedGroups:f,totalGroups:a,onAddCallback:n.handleGroupChange,onGroupRemoved:n.handleGroupRemoved}))),g.a.createElement(Uf,{saving:r,cancelLink:"/admin_console/user_management/teams",saveNeeded:i,onClick:n.showRemoveUsersModal,serverError:o}))});var i=e.team;return n.state={groups:e.groups,syncChecked:Boolean(i.group_constrained),allAllowedChecked:i.allow_open_invite,allowedDomainsChecked:Boolean(i.allowed_domains&&""!==i.allowed_domains),allowedDomains:i.allowed_domains||"",saving:!1,showRemoveConfirmation:!1,usersToRemove:0,totalGroups:e.totalGroups,saveNeeded:!1,serverError:null},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sb(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.totalGroups,a=t.team;e.team.id!==a.id&&this.setState({totalGroups:n,syncChecked:Boolean(a.group_constrained),allAllowedChecked:a.allow_open_invite,allowedDomainsChecked:Boolean(a.allowed_domains&&""!==a.allowed_domains),allowedDomains:a.allowed_domains||""})}},{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.teamID,a=t.actions;a.getTeam(n).then(function(){return a.getGroups(n)}).then(function(){return e.setState({groups:e.props.groups})})}},{key:"processGroupsChange",value:function(){var e=yb(regeneratorRuntime.mark(function e(t){var n,a,r,i,o,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.props,a=n.teamID,(r=n.actions).setNavigationBlocked(!0),i=null,o=0,!this.state.syncChecked){e.next=20;break}if(e.prev=5,0!==t.length){e.next=10;break}i=g.a.createElement(Df,{warning:!0}),e.next=15;break;case 10:return e.next=12,r.membersMinusGroupMembers(a,t.map(function(e){return e.id}));case 12:s=e.sent,(o=s.data.total_count)>0&&(i=g.a.createElement(If,{total:o,users:s.data.users}));case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(5),i=e.t0;case 20:this.setState({groups:t,usersToRemove:o,saveNeeded:!0,serverError:i});case 21:case"end":return e.stop()}},e,this,[[5,17]])}));return function(t){return e.apply(this,arguments)}}()}])&&vb(n.prototype,a),r&&vb(n,r),t}();Ob(Tb,"propTypes",{teamID:b.a.string.isRequired,team:b.a.object.isRequired,totalGroups:b.a.number.isRequired,groups:b.a.arrayOf(b.a.object),allGroups:b.a.object.isRequired,actions:b.a.shape({setNavigationBlocked:b.a.func.isRequired,getTeam:b.a.func.isRequired,linkGroupSyncable:b.a.func.isRequired,unlinkGroupSyncable:b.a.func.isRequired,membersMinusGroupMembers:b.a.func.isRequired,getGroups:b.a.func.isRequired,patchTeam:b.a.func.isRequired}).isRequired}),Ob(Tb,"defaultProps",{team:{display_name:"",id:""}});var wb=Object(a.connect)(function(e,t){var n=t.match.params.team_id,a=Object(ba.getTeam)(e,n),r=Object(sd.getGroupsAssociatedToTeam)(e,n),i=e.entities.teams.groupsAssociatedToTeam,o=Object(sd.getAllGroups)(e,n);return{team:a,groups:r,totalGroups:i&&i[n]&&i[n].totalCount?i[n].totalCount:0,allGroups:o,teamID:n}},function(e){return{actions:Object(r.bindActionCreators)({getTeam:pa.getTeam,getGroups:od.getGroupsAssociatedToTeam,patchTeam:pa.patchTeam,linkGroupSyncable:od.linkGroupSyncable,unlinkGroupSyncable:od.unlinkGroupSyncable,membersMinusGroupMembers:pa.membersMinusGroupMembers,setNavigationBlocked:d.C},e)}})(Tb),jb=n(16);function xb(e){return(xb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pb(e){return(Pb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cb(e,t){return(Cb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rb=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=Pb(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==xb(r)&&"function"!=typeof r?kb(a):r,Mb(kb(n),"handleRowClick",function(){var e=n.props,t=e.channel;(0,e.onRowClick)(t.id)}),Mb(kb(n),"render",function(){var e=n.props.channel;return g.a.createElement("div",{className:"group ",onClick:n.handleRowClick},g.a.createElement("div",{className:"group-row"},g.a.createElement("span",{className:"group-name overflow--ellipsis row-content"},e.type===w.i.PRIVATE_CHANNEL?g.a.createElement(bd.a,{className:"channel-icon channel-icon__lock"}):g.a.createElement(fd.a,{className:"channel-icon channel-icon__globe"}),e.display_name),g.a.createElement("span",{className:"group-description row-content"},e.team_name),g.a.createElement("span",{className:"group-description adjusted row-content"},g.a.createElement(E.c,{id:"admin.channel_settings.channel_row.managementMethod.".concat(e.group_constrained?"group":"manual"),defaultMessage:e.group_constrained?"Group Sync":"Manual Invites"})),g.a.createElement("span",{className:"group-actions"},g.a.createElement(La.a,{to:"/admin_console/user_management/channels/".concat(e.id)},g.a.createElement(E.c,{id:"admin.channel_settings.channel_row.configure",defaultMessage:"Edit"})))))}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cb(e,t)}(t,g.a.Component),t}();function Nb(e){return(Nb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ab(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Db(e){return(Db=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Lb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ib(e,t){return(Ib=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ub(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Mb(Rb,"propTypes",{channel:b.a.object.isRequired,onRowClick:b.a.func.isRequired});var qb=function(){return g.a.createElement("div",{className:"groups-list--header"},g.a.createElement("div",{className:"group-name adjusted"},g.a.createElement(E.c,{id:"admin.channel_settings.channel_list.nameHeader",defaultMessage:"Name"})),g.a.createElement("div",{className:"group-description"},g.a.createElement(E.c,{id:"admin.channel_settings.channel_list.teamHeader",defaultMessage:"Team"})),g.a.createElement("div",{className:"group-description adjusted"},g.a.createElement(E.c,{id:"admin.channel_settings.channel_list.managementHeader",defaultMessage:"Management"})),g.a.createElement("div",{className:"group-actions"}))},Bb=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=Db(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==Nb(r)&&"function"!=typeof r?Lb(a):r,Ub(Lb(n),"renderRow",function(e){return g.a.createElement(Rb,{key:e.id,channel:e,onRowClick:n.onChannelClick})}),Ub(Lb(n),"onChannelClick",function(e){Ii.a.push("/admin_console/user_management/channels/".concat(e))}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ib(e,t)}(t,g.a.PureComponent),n=t,(a=[{key:"render",value:function(){return g.a.createElement(Dp,Object.assign({header:g.a.createElement(qb,null),renderRow:this.renderRow},this.props))}}])&&Ab(n.prototype,a),r&&Ab(n,r),t}(),Fb=function(e,t){return e.display_name.localeCompare(t.display_name)},Gb=Object(ir.a)(jb.getAllChannels,function(e){return Object.values(e).filter(function(e){return e.type===w.i.OPEN_CHANNEL||e.type===w.i.PRIVATE_CHANNEL}).sort(Fb)});var Hb=Object(a.connect)(function(e){return{data:Gb(e),total:e.entities.channels.totalCount,emptyListTextId:Object(A.b)("admin.channel_settings.channel_list.no_channels_found"),emptyListTextDefaultMessage:"No channels found"}},function(e){return{actions:Object(r.bindActionCreators)({getData:zd.getAllChannelsWithCount},e)}})(Bb);function Yb(e){return(Yb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){Jb(e,t,n[t])})}return e}function zb(e){return(zb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xb(e,t){return(Xb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Kb=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=zb(t).call(this,e),n=!r||"object"!==Yb(r)&&"function"!=typeof r?Vb(a):r,Jb(Vb(n),"onPageChangedCallback",function(e){var t=e.startCount,a=e.endCount,r=e.total;n.setState({startCount:t,endCount:a,total:r})}),Jb(Vb(n),"render",function(){return g.a.createElement("div",{className:"wrapper--fixed"},g.a.createElement("div",{className:"admin-console__header"},g.a.createElement(E.c,{id:"admin.channel_settings.groupsPageTitle",defaultMessage:"{siteName} Channels",values:{siteName:n.props.siteName}})),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement(di,{id:"channels",titleId:Object(A.b)("admin.channel_settings.title"),titleDefault:"Channels",subtitleId:Object(A.b)("admin.channel_settings.description"),subtitleDefault:"Showing {startCount, number} - {endCount, number} of {total, number} channels. Manage channel settings.",subtitleValues:Wb({},n.state)},g.a.createElement(Hb,{onPageChangedCallback:n.onPageChangedCallback})))))}),n.state={startCount:0,endCount:1,total:0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xb(e,t)}(t,g.a.Component),t}();Jb(Kb,"propTypes",{siteName:b.a.string.isRequired});var Qb=Object(a.connect)(function(e){return{siteName:Object(c.getConfig)(e).SiteName}})(Kb),Zb=function(e){var t=e.isSynced,n=e.isPublic,a=e.onToggle;return g.a.createElement(zf,{toggled:t,last:t,onToggle:function(){return a(!t,n)},title:g.a.createElement(E.c,{id:"admin.channel_settings.channel_details.syncGroupMembers",defaultMessage:"Sync Group Members"}),subTitle:g.a.createElement(Xt.b,{id:"admin.channel_settings.channel_details.syncGroupMembersDescr",defaultMessage:"When enabled, adding and removing users from groups will add or remove them from this channel. The only way of inviting members to this channel is by adding the groups they belong to. [Learn More](!https://www.mattermost.com/pl/default-ldap-group-constrained-team-channel.html)"})})};Zb.propTypes={isPublic:b.a.bool.isRequired,isSynced:b.a.bool.isRequired,onToggle:b.a.func.isRequired};var $b=function(e){var t=e.isSynced,n=e.isOriginallyPrivate,a=e.isPublic,r=e.onToggle;return!t&&g.a.createElement(zf,{toggled:a,last:!0,singleLine:!0,onToggle:function(){n||r(t,!a)},title:g.a.createElement(E.c,{id:"admin.channel_settings.channel_details.isPublic",defaultMessage:"Public channel or private channel"}),subTitle:g.a.createElement(E.c,{id:"admin.channel_settings.channel_details.isPublicDescr",defaultMessage:"If `public` the channel is discoverable and any user can join, or if `private` invitations are required."}),onText:g.a.createElement(E.c,{id:"channel_toggle_button.public",defaultMessage:"Public"}),offText:g.a.createElement(E.c,{id:"channel_toggle_button.private",defaultMessage:"Private"})})};$b.propTypes={isOriginallyPrivate:b.a.bool.isRequired,isPublic:b.a.bool.isRequired,isSynced:b.a.bool.isRequired,onToggle:b.a.func.isRequired};var eh=function(e){var t=e.isOriginallyPrivate,n=e.isPublic,a=e.isSynced,r=e.onToggle;return g.a.createElement(di,{id:"channel_manage",titleId:Object(A.b)("admin.channel_settings.channel_detail.manageTitle"),titleDefault:"Channel Management",subtitleId:Object(A.b)("admin.channel_settings.channel_detail.manageDescription"),subtitleDefault:"Choose between inviting members manually or syncing members automatically from groups."},g.a.createElement("div",{className:"group-teams-and-channels"},g.a.createElement("div",{className:"group-teams-and-channels--body"},g.a.createElement(Zb,{isPublic:n,isSynced:a,onToggle:r}),g.a.createElement($b,{isOriginallyPrivate:t,isPublic:n,isSynced:a,onToggle:r}))))};eh.propTypes={isOriginallyPrivate:b.a.bool.isRequired,isPublic:b.a.bool.isRequired,isSynced:b.a.bool.isRequired,onToggle:b.a.func.isRequired};var th=n(1659),nh=function(e){var t=e.onGroupRemoved,n=e.onAddCallback,a=e.totalGroups,r=e.groups,i=e.removedGroups,o=e.channel,s=e.synced;return g.a.createElement(di,{id:"channel_groups",titleId:s?Object(A.b)("admin.channel_settings.channel_detail.syncedGroupsTitle"):Object(A.b)("admin.channel_settings.channel_detail.groupsTitle"),titleDefault:s?"Synced Groups":"Groups",subtitleId:s?Object(A.b)("admin.channel_settings.channel_detail.syncedGroupsDescription"):Object(A.b)("admin.channel_settings.channel_detail.groupsDescription"),subtitleDefault:s?"Add and remove team members based on their group membership on the next scheduled sync.":"Group members will be added to the channel based on your sync schedule.",button:g.a.createElement(sf.a,{className:"btn btn-primary",dialogType:th.a,dialogProps:{channel:o,onAddCallback:n,skipCommit:!0,includeGroups:i,excludeGroups:r}},g.a.createElement(E.c,{id:"admin.channel_settings.channel_details.add_group",defaultMessage:"Add Group"}))},o.id&&g.a.createElement(db,{channel:o,groups:r,totalGroups:a,onGroupRemoved:t,isModeSync:s}))};nh.propTypes={synced:b.a.bool.isRequired,channel:b.a.object.isRequired,onAddCallback:b.a.func.isRequired,totalGroups:b.a.number.isRequired,groups:b.a.arrayOf(b.a.object).isRequired,removedGroups:b.a.arrayOf(b.a.object).isRequired,onGroupRemoved:b.a.func.isRequired};var ah=function(e){var t=e.team,n=e.channel;return g.a.createElement(di,{id:"channel_profile",titleId:Object(A.b)("admin.channel_settings.channel_detail.profileTitle"),titleDefault:"Channel Profile",subtitleId:Object(A.b)("admin.channel_settings.channel_detail.profileDescription"),subtitleDefault:"Summary of the channel, including the channel name."},g.a.createElement("div",{className:"group-teams-and-channels"},g.a.createElement("div",{className:"group-teams-and-channels--body"},g.a.createElement(Xt.b,{id:"admin.channel_settings.channel_detail.channelName",defaultMessage:"**Name**"}),g.a.createElement("br",null),n.name,g.a.createElement("br",null),g.a.createElement(Xt.b,{id:"admin.channel_settings.channel_detail.channelTeam",defaultMessage:"**Team**"}),g.a.createElement("br",null),t.display_name)))};function rh(e){return(rh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ih(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){ph(e,t,n[t])})}return e}function oh(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function sh(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){oh(i,a,r,o,s,"next",e)}function s(e){oh(i,a,r,o,s,"throw",e)}o(void 0)})}}function lh(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function ch(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function uh(e){return(uh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dh(e,t){return(dh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ph(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}ah.propTypes={channel:b.a.object.isRequired,team:b.a.object.isRequired};var fh=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=uh(t).call(this,e),n=!r||"object"!==rh(r)&&"function"!=typeof r?mh(a):r,ph(mh(n),"setToggles",function(e,t){n.setState({saveNeeded:!0,isSynced:e,isPublic:!e&&t},function(){return n.processGroupsChange(n.state.groups)}),n.props.actions.setNavigationBlocked(!0)}),ph(mh(n),"handleGroupRemoved",function(e){var t=n.state.groups.filter(function(t){return t.id!==e});n.setState({totalGroups:n.state.totalGroups-1}),n.processGroupsChange(t)}),ph(mh(n),"handleGroupChange",function(e){var t=[].concat(lh(n.state.groups),lh(e.map(function(e){return n.props.allGroups[e]})));n.setState({totalGroups:n.state.totalGroups+e.length}),n.processGroupsChange(t)}),ph(mh(n),"hideRemoveUsersModal",function(){n.setState({showRemoveConfirmation:!1})}),ph(mh(n),"showRemoveUsersModal",function(){n.state.usersToRemove>0?n.setState({showRemoveConfirmation:!0}):n.handleSubmit()}),ph(mh(n),"handleSubmit",sh(regeneratorRuntime.mark(function e(){var t,a,r,i,o,s,l,c,u,m,d,p,f,b,h,y;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n.setState({showRemoveConfirmation:!1,saving:!0}),t=n.state,a=t.groups,r=t.isSynced,i=t.isPublic,o=null,s=!1,l=n.props,c=l.groups,u=l.channelID,m=l.actions,d=l.channel,0!==n.state.groups.length||!r){e.next=10;break}o=g.a.createElement(Df,null),s=!0,e.next=25;break;case 10:return p=[],i||d.type!==w.Q.OPEN_CHANNEL||p.push(m.convertChannelToPrivate(d.id)),p.push(m.patchChannel(d.id,ih({},d,{group_constrained:r,type:i?w.Q.OPEN_CHANNEL:w.Q.PRIVATE_CHANNEL}))),f=c.filter(function(e){return!a.includes(e)}).map(function(e){return m.unlinkGroupSyncable(e.id,u,j.Groups.SYNCABLE_TYPE_CHANNEL)}),b=a.filter(function(e){return!c.includes(e)}).map(function(e){return m.linkGroupSyncable(e.id,u,j.Groups.SYNCABLE_TYPE_CHANNEL,{auto_add:!0})}),e.next=17,Promise.all([].concat(p,lh(f),lh(b)));case 17:if(h=e.sent,!(y=h.find(function(e){return e.error}))){e.next=23;break}o=g.a.createElement(Se.a,{error:y.error.message}),e.next=25;break;case 23:return e.next=25,m.getGroups(u);case 25:n.setState({serverError:o,saving:!1,saveNeeded:s}),m.setNavigationBlocked(s);case 27:case"end":return e.stop()}},e)}))),ph(mh(n),"render",function(){var e=n.state,t=e.totalGroups,a=e.saving,r=e.saveNeeded,i=e.serverError,o=e.isSynced,s=e.isPublic,l=e.groups,c=e.showRemoveConfirmation,u=e.usersToRemove,m=n.props,d=m.channel,p=m.team,f=n.props.groups.filter(function(e){return!l.find(function(t){return t.id===e.id})});return g.a.createElement("div",{className:"wrapper--fixed"},g.a.createElement("div",{className:"admin-console__header with-back"},g.a.createElement("div",null,g.a.createElement(Wi,{to:"/admin_console/user_management/channels",className:"fa fa-angle-left back"}),g.a.createElement(E.c,{id:"admin.channel_settings.channel_detail.channel_configuration",defaultMessage:"Channel Configuration"}))),g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement("div",{className:"admin-console__content"},g.a.createElement(of,{amount:u,inChannel:!1,show:c,onCancel:n.hideRemoveUsersModal,onConfirm:n.handleSubmit}),g.a.createElement(ah,{channel:d,team:p}),g.a.createElement(eh,{isPublic:s,isSynced:o,isOriginallyPrivate:d.type===w.Q.PRIVATE_CHANNEL,onToggle:n.setToggles}),g.a.createElement(nh,{synced:o,channel:d,totalGroups:t,groups:l,removedGroups:f,onAddCallback:n.handleGroupChange,onGroupRemoved:n.handleGroupRemoved}))),g.a.createElement(Uf,{saving:a,saveNeeded:r,onClick:n.showRemoveUsersModal,serverError:i,cancelLink:"/admin_console/user_management/channels"}))}),n.state={isSynced:Boolean(e.channel.group_constrained),isPublic:e.channel.type===w.Q.OPEN_CHANNEL,saving:!1,totalGroups:e.totalGroups,showRemoveConfirmation:!1,usersToRemove:0,groups:e.groups,saveNeeded:!1,serverError:null},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&dh(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.channel,a=t.totalGroups;n.id!==e.channel.id&&this.setState({totalGroups:a,isSynced:Boolean(n.group_constrained),isPublic:n.type===w.Q.OPEN_CHANNEL}),e.team.id||e.channel.team_id||!n.team_id||this.props.actions.getTeam(n.team_id)}},{key:"componentDidMount",value:function(){var e=sh(regeneratorRuntime.mark(function e(){var t,n,a,r,i,o=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=this.props,n=t.channelID,a=t.channel,r=t.team,(i=t.actions).getGroups(n).then(function(){return i.getChannel(n)}).then(function(){return o.setState({groups:o.props.groups})}),!r.id&&a.team_id&&i.getTeam(a.team_id);case 3:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"processGroupsChange",value:function(){var e=sh(regeneratorRuntime.mark(function e(t){var n,a,r,i,o,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.props,a=n.actions,r=n.channelID,a.setNavigationBlocked(!0),i=null,o=0,!this.state.isSynced){e.next=20;break}if(e.prev=5,0!==t.length){e.next=10;break}i=g.a.createElement(Df,null),e.next=15;break;case 10:return e.next=12,a.membersMinusGroupMembers(r,t.map(function(e){return e.id}));case 12:s=e.sent,(o=s.data.total_count)>0&&(i=g.a.createElement(If,{total:o,users:s.data.users}));case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(5),i=e.t0;case 20:this.setState({groups:t,usersToRemove:o,saveNeeded:!0,serverError:i});case 21:case"end":return e.stop()}},e,this,[[5,17]])}));return function(t){return e.apply(this,arguments)}}()}])&&ch(n.prototype,a),r&&ch(n,r),t}();ph(fh,"propTypes",{channelID:b.a.string.isRequired,channel:b.a.object.isRequired,team:b.a.object.isRequired,groups:b.a.arrayOf(b.a.object).isRequired,totalGroups:b.a.number.isRequired,allGroups:b.a.object.isRequired,actions:b.a.shape({getGroups:b.a.func.isRequired,linkGroupSyncable:b.a.func.isRequired,convertChannelToPrivate:b.a.func.isRequired,unlinkGroupSyncable:b.a.func.isRequired,membersMinusGroupMembers:b.a.func.isRequired,setNavigationBlocked:b.a.func.isRequired,getChannel:b.a.func.isRequired,getTeam:b.a.func.isRequired,patchChannel:b.a.func.isRequired}).isRequired}),ph(fh,"defaultProps",{channel:{display_name:"",id:""}});var bh=Object(a.connect)(function(e,t){var n=t.match.params.channel_id,a=Object(jb.getChannel)(e,n)||{},r=Object(ba.getTeam)(e,a.team_id)||{},i=Object(sd.getGroupsAssociatedToChannel)(e,n),o=e.entities.channels.groupsAssociatedToChannel;return{channel:a,team:r,allGroups:Object(sd.getAllGroups)(e,a.team_id),totalGroups:o&&o[n]&&o[n].totalCount?o[n].totalCount:0,groups:i,channelID:n}},function(e){return{actions:Object(r.bindActionCreators)({getChannel:zd.getChannel,getTeam:pa.getTeam,getGroups:od.getGroupsAssociatedToChannel,convertChannelToPrivate:zd.convertChannelToPrivate,linkGroupSyncable:od.linkGroupSyncable,unlinkGroupSyncable:od.unlinkGroupSyncable,membersMinusGroupMembers:zd.membersMinusGroupMembers,patchChannel:zd.patchChannel,setNavigationBlocked:d.C},e)}})(fh);function hh(e){return(hh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gh(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function yh(e){return(yh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _h(e,t){return(_h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Eh=function(e){function t(e){var n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=yh(t).call(this,e))||"object"!==hh(r)&&"function"!=typeof r?vh(a):r).getConfigFromState=n.getConfigFromState.bind(vh(n)),n.renderSettings=n.renderSettings.bind(vh(n)),n.getSampleErrorMsg=n.getSampleErrorMsg.bind(vh(n)),n.handlePasswordLengthChange=n.handlePasswordLengthChange.bind(vh(n)),n.handleCheckboxChange=n.handleCheckboxChange.bind(vh(n)),n.state=Object.assign(n.state,{passwordMinimumLength:e.config.PasswordSettings.MinimumLength,passwordLowercase:e.config.PasswordSettings.Lowercase,passwordNumber:e.config.PasswordSettings.Number,passwordUppercase:e.config.PasswordSettings.Uppercase,passwordSymbol:e.config.PasswordSettings.Symbol,maximumLoginAttempts:e.config.ServiceSettings.MaximumLoginAttempts}),Object(A.b)("user.settings.security.passwordErrorLowercase"),Object(A.b)("user.settings.security.passwordErrorLowercaseUppercase"),Object(A.b)("user.settings.security.passwordErrorLowercaseUppercaseNumber"),Object(A.b)("user.settings.security.passwordErrorLowercaseUppercaseNumberSymbol"),Object(A.b)("user.settings.security.passwordErrorLowercaseUppercaseSymbol"),Object(A.b)("user.settings.security.passwordErrorLowercaseNumber"),Object(A.b)("user.settings.security.passwordErrorLowercaseNumberSymbol"),Object(A.b)("user.settings.security.passwordErrorLowercaseSymbol"),Object(A.b)("user.settings.security.passwordErrorUppercase"),Object(A.b)("user.settings.security.passwordErrorUppercaseNumber"),Object(A.b)("user.settings.security.passwordErrorUppercaseNumberSymbol"),Object(A.b)("user.settings.security.passwordErrorUppercaseSymbol"),Object(A.b)("user.settings.security.passwordErrorNumber"),Object(A.b)("user.settings.security.passwordErrorNumberSymbol"),Object(A.b)("user.settings.security.passwordErrorSymbol");var i="user.settings.security.passwordError";return e.config.PasswordSettings.Lowercase&&(i+="Lowercase"),e.config.PasswordSettings.Uppercase&&(i+="Uppercase"),e.config.PasswordSettings.Number&&(i+="Number"),e.config.PasswordSettings.Symbol&&(i+="Symbol"),n.sampleErrorMsg=g.a.createElement(E.c,{id:i,default:"Your password must contain between {min} and {max} characters.",values:{min:n.state.passwordMinimumLength||w.Q.MIN_PASSWORD_LENGTH,max:w.Q.MAX_PASSWORD_LENGTH}}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_h(e,t)}(t,Wa),n=t,(a=[{key:"getConfigFromState",value:function(e){return e.PasswordSettings.MinimumLength=this.parseIntNonZero(this.state.passwordMinimumLength,w.Q.MIN_PASSWORD_LENGTH),e.PasswordSettings.Lowercase=this.refs.lowercase.checked,e.PasswordSettings.Uppercase=this.refs.uppercase.checked,e.PasswordSettings.Number=this.refs.number.checked,e.PasswordSettings.Symbol=this.refs.symbol.checked,e.ServiceSettings.MaximumLoginAttempts=this.parseIntNonZero(this.state.maximumLoginAttempts),e}},{key:"getStateFromConfig",value:function(e){return{passwordMinimumLength:e.PasswordSettings.MinimumLength,passwordLowercase:e.PasswordSettings.Lowercase,passwordNumber:e.PasswordSettings.Number,passwordUppercase:e.PasswordSettings.Uppercase,passwordSymbol:e.PasswordSettings.Symbol,maximumLoginAttempts:e.ServiceSettings.MaximumLoginAttempts}}},{key:"getSampleErrorMsg",value:function(e){if(this.props.config.PasswordSettings.MinimumLength>w.Q.MAX_PASSWORD_LENGTH||this.props.config.PasswordSettings.MinimumLength<w.Q.MIN_PASSWORD_LENGTH)return g.a.createElement(E.c,{id:"user.settings.security.passwordMinLength",default:"Invalid minimum length, cannot show preview."});var t="user.settings.security.passwordError";return this.refs.lowercase.checked&&(t+="Lowercase"),this.refs.uppercase.checked&&(t+="Uppercase"),this.refs.number.checked&&(t+="Number"),this.refs.symbol.checked&&(t+="Symbol"),g.a.createElement(E.c,{id:t,default:"Your password must contain between {min} and {max} characters.",values:{min:e||w.Q.MIN_PASSWORD_LENGTH,max:w.Q.MAX_PASSWORD_LENGTH}})}},{key:"handlePasswordLengthChange",value:function(e,t){this.sampleErrorMsg=this.getSampleErrorMsg(t),this.handleChange(e,t)}},{key:"handleCheckboxChange",value:function(e,t){this.sampleErrorMsg=this.getSampleErrorMsg(this.state.passwordMinimumLength),this.handleChange(e,t)}},{key:"renderTitle",value:function(){return g.a.createElement(E.c,{id:"admin.security.password",defaultMessage:"Password"})}},{key:"renderSettings",value:function(){return g.a.createElement(ht,null,g.a.createElement("div",null,g.a.createElement(pe,{id:"passwordMinimumLength",label:g.a.createElement(E.c,{id:"admin.password.minimumLength",defaultMessage:"Minimum Password Length:"}),placeholder:N.ab("admin.password.minimumLengthExample",'E.g.: "5"'),helpText:g.a.createElement(E.c,{id:"admin.password.minimumLengthDescription",defaultMessage:"Minimum number of characters required for a valid password. Must be a whole number greater than or equal to {min} and less than or equal to {max}.",values:{min:w.Q.MIN_PASSWORD_LENGTH,max:w.Q.MAX_PASSWORD_LENGTH}}),value:this.state.passwordMinimumLength,onChange:this.handlePasswordLengthChange,setByEnv:this.isSetByEnv("PasswordSettings.MinimumLength")}),g.a.createElement(te,{label:g.a.createElement(E.c,{id:"passwordRequirements",defaultMessage:"Password Requirements:"})},g.a.createElement("div",null,g.a.createElement("label",{className:"checkbox-inline"},g.a.createElement("input",{type:"checkbox",ref:"lowercase",defaultChecked:this.state.passwordLowercase,name:"admin.password.lowercase",onChange:this.handleCheckboxChange}),g.a.createElement(E.c,{id:"admin.password.lowercase",defaultMessage:"At least one lowercase letter"}))),g.a.createElement("div",null,g.a.createElement("label",{className:"checkbox-inline"},g.a.createElement("input",{type:"checkbox",ref:"uppercase",defaultChecked:this.state.passwordUppercase,name:"admin.password.uppercase",onChange:this.handleCheckboxChange}),g.a.createElement(E.c,{id:"admin.password.uppercase",defaultMessage:"At least one uppercase letter"}))),g.a.createElement("div",null,g.a.createElement("label",{className:"checkbox-inline"},g.a.createElement("input",{type:"checkbox",ref:"number",defaultChecked:this.state.passwordNumber,name:"admin.password.number",onChange:this.handleCheckboxChange}),g.a.createElement(E.c,{id:"admin.password.number",defaultMessage:"At least one number"}))),g.a.createElement("div",null,g.a.createElement("label",{className:"checkbox-inline"},g.a.createElement("input",{type:"checkbox",ref:"symbol",defaultChecked:this.state.passwordSymbol,name:"admin.password.symbol",onChange:this.handleCheckboxChange}),g.a.createElement(E.c,{id:"admin.password.symbol",defaultMessage:'At least one symbol (e.g. "~!@#$%^&*()")'}))),g.a.createElement("div",null,g.a.createElement("br",null),g.a.createElement("label",null,g.a.createElement(E.c,{id:"admin.password.preview",defaultMessage:"Error message preview:"})),g.a.createElement("br",null),this.sampleErrorMsg))),g.a.createElement(pe,{id:"maximumLoginAttempts",label:g.a.createElement(E.c,{id:"admin.service.attemptTitle",defaultMessage:"Maximum Login Attempts:"}),placeholder:N.ab("admin.service.attemptExample",'E.g.: "10"'),helpText:g.a.createElement(E.c,{id:"admin.service.attemptDescription",defaultMessage:"Login attempts allowed before user is locked out and required to reset password via email."}),value:this.state.maximumLoginAttempts,onChange:this.handleChange,setByEnv:this.isSetByEnv("ServiceSettings.MaximumLoginAttempts")}))}}])&&gh(n.prototype,a),r&&gh(n,r),t}();function Sh(e){return(Sh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oh(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Th(e){return(Th=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jh(e,t){return(jh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var xh=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Th(t).call(this,e),n=!r||"object"!==Sh(r)&&"function"!=typeof r?wh(a):r,function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(wh(n),"isPushNotificationServerSetByEnv",function(){return n.isSetByEnv("EmailSettings.SendPushNotifications")||n.isSetByEnv("EmailSettings.PushNotificationServer")}),n.canSave=n.canSave.bind(wh(n)),n.handleAgreeChange=n.handleAgreeChange.bind(wh(n)),n.getConfigFromState=n.getConfigFromState.bind(wh(n)),n.renderSettings=n.renderSettings.bind(wh(n)),n.handleDropdownChange=n.handleDropdownChange.bind(wh(n)),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jh(e,t)}(t,Wa),n=t,(a=[{key:"canSave",value:function(){return"mhpns"!==this.state.pushNotificationServerType||this.state.agree}},{key:"handleAgreeChange",value:function(e){this.setState({agree:e.target.checked})}},{key:"handleDropdownChange",value:function(e,t){"pushNotificationServerType"===e&&(this.setState({agree:!1}),"mhpns"===t?this.setState({pushNotificationServer:w.Q.MHPNS}):"mtpns"===t?this.setState({pushNotificationServer:w.Q.MTPNS}):"custom"!==t||"mtpns"!==this.state.pushNotificationServerType&&"mhpns"!==this.state.pushNotificationServerType||this.setState({pushNotificationServer:""})),this.handleChange(e,t)}},{key:"getConfigFromState",value:function(e){return e.EmailSettings.SendPushNotifications="off"!==this.state.pushNotificationServerType,e.EmailSettings.PushNotificationServer=this.state.pushNotificationServer.trim(),e.TeamSettings.MaxNotificationsPerChannel=this.state.maxNotificationsPerChannel,e}},{key:"getStateFromConfig",value:function(e){var t="custom",n=!1;e.EmailSettings.SendPushNotifications?e.EmailSettings.PushNotificationServer===w.Q.MHPNS&&"true"===this.props.license.IsLicensed&&"true"===this.props.license.MHPNS?(t="mhpns",n=!0):e.EmailSettings.PushNotificationServer===w.Q.MTPNS&&(t="mtpns"):t="off";var a=e.EmailSettings.PushNotificationServer;return"mtpns"===t?a=w.Q.MTPNS:"mhpns"===t&&(a=w.Q.MHPNS),{pushNotificationServerType:t,pushNotificationServer:a,maxNotificationsPerChannel:e.TeamSettings.MaxNotificationsPerChannel,agree:n}}},{key:"renderTitle",value:function(){return g.a.createElement(E.c,{id:"admin.environment.pushNotificationServer",defaultMessage:"Push Notification Server"})}},{key:"renderSettings",value:function(){var e=[];e.push({value:"off",text:N.ab("admin.email.pushOff","Do not send push notifications")}),"true"===this.props.license.IsLicensed&&"true"===this.props.license.MHPNS&&e.push({value:"mhpns",text:N.ab("admin.email.mhpns","Use HPNS connection with uptime SLA to send notifications to iOS and Android apps")}),e.push({value:"mtpns",text:N.ab("admin.email.mtpns","Use TPNS connection to send notifications to iOS and Android apps")}),e.push({value:"custom",text:N.ab("admin.email.selfPush","Manually enter Push Notification Service location")});var t,n=null,a=null;return"off"===this.state.pushNotificationServerType?n=g.a.createElement(Xt.b,{id:"admin.email.pushOffHelp",defaultMessage:"Please see [documentation on push notifications](!https://about.mattermost.com/default-mobile-push-notifications/) to learn more about setup options."}):a="mhpns"===this.state.pushNotificationServerType?g.a.createElement(Xt.b,{id:"admin.email.mhpnsHelp",defaultMessage:"Download [Mattermost iOS app](!https://about.mattermost.com/mattermost-ios-app/) from iTunes. Download [Mattermost Android app](!https://about.mattermost.com/mattermost-android-app/) from Google Play. Learn more about the [Mattermost Hosted Push Notification Service](!https://about.mattermost.com/default-hpns/)."}):"mtpns"===this.state.pushNotificationServerType?g.a.createElement(Xt.b,{id:"admin.email.mtpnsHelp",defaultMessage:"Download [Mattermost iOS app](!https://about.mattermost.com/mattermost-ios-app/) from iTunes. Download [Mattermost Android app](!https://about.mattermost.com/mattermost-android-app/) from Google Play. Learn more about the [Mattermost Test Push Notification Service](!https://about.mattermost.com/default-tpns/)."}):g.a.createElement(Xt.b,{id:"admin.email.easHelp",defaultMessage:"Learn more about compiling and deploying your own mobile apps from an [Enterprise App Store](!https://about.mattermost.com/default-enterprise-app-store)."}),"mhpns"===this.state.pushNotificationServerType&&(t=g.a.createElement("div",{className:"form-group"},g.a.createElement("div",{className:"col-sm-4"}),g.a.createElement("div",{className:"col-sm-8"},g.a.createElement("input",{type:"checkbox",ref:"agree",checked:this.state.agree,onChange:this.handleAgreeChange}),g.a.createElement(Xt.b,{id:"admin.email.agreeHPNS",defaultMessage:" I understand and accept the Mattermost Hosted Push Notification Service [Terms of Service](!https://about.mattermost.com/hpns-terms/) and [Privacy Policy](!https://about.mattermost.com/hpns-privacy/)."})))),g.a.createElement(ht,null,g.a.createElement(_e,{id:"pushNotificationServerType",values:e,label:g.a.createElement(E.c,{id:"admin.email.pushTitle",defaultMessage:"Enable Push Notifications: "}),value:this.state.pushNotificationServerType,onChange:this.handleDropdownChange,helpText:n,setByEnv:this.isPushNotificationServerSetByEnv()}),t,g.a.createElement(pe,{id:"pushNotificationServer",label:g.a.createElement(E.c,{id:"admin.email.pushServerTitle",defaultMessage:"Push Notification Server:"}),placeholder:N.ab("admin.email.pushServerEx",'E.g.: "https://push-test.mattermost.com"'),helpText:a,value:this.state.pushNotificationServer,onChange:this.handleChange,disabled:"custom"!==this.state.pushNotificationServerType,setByEnv:this.isSetByEnv("EmailSettings.PushNotificationServer")}),g.a.createElement(pe,{id:"maxNotificationsPerChannel",type:"number",label:g.a.createElement(E.c,{id:"admin.team.maxNotificationsPerChannelTitle",defaultMessage:"Max Notifications Per Channel:"}),placeholder:N.ab("admin.team.maxNotificationsPerChannelExample",'E.g.: "1000"'),helpText:g.a.createElement(Xt.b,{id:"admin.team.maxNotificationsPerChannelDescription",defaultMessage:"Maximum total number of users in a channel before users typing messages, @all, @here, and @channel no longer send notifications because of performance."}),value:this.state.maxNotificationsPerChannel,onChange:this.handleChange,setByEnv:this.isSetByEnv("TeamSettings.MaxNotificationsPerChannel")}))}}])&&Oh(n.prototype,a),r&&Oh(n,r),t}();function Ph(e){return(Ph="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kh(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ch(e){return(Ch=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Mh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rh(e,t){return(Rh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Nh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ah=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Ch(t).call(this,e),n=!r||"object"!==Ph(r)&&"function"!=typeof r?Mh(a):r,Nh(Mh(n),"handleSubmit",function(e){e.preventDefault(),n.setState({showConfirmModal:!0})}),Nh(Mh(n),"handleSaveConfirmed",function(){n.setState({showConfirmModal:!1}),n.doSubmit()}),Nh(Mh(n),"handleSaveCanceled",function(){n.setState({showConfirmModal:!1})}),n.getConfigFromState=n.getConfigFromState.bind(Mh(n)),n.renderSettings=n.renderSettings.bind(Mh(n)),n.renderConfirmModal=n.renderConfirmModal.bind(Mh(n)),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rh(e,t)}(t,Wa),n=t,(a=[{key:"getConfigFromState",value:function(e){return e.DataRetentionSettings.EnableMessageDeletion="true"===this.state.enableMessageDeletion,e.DataRetentionSettings.EnableFileDeletion="true"===this.state.enableFileDeletion,e.DataRetentionSettings.MessageRetentionDays=parseInt(this.state.messageRetentionDays,10),e.DataRetentionSettings.FileRetentionDays=parseInt(this.state.fileRetentionDays,10),e.DataRetentionSettings.DeletionJobStartTime=this.state.deletionJobStartTime,e}},{key:"getStateFromConfig",value:function(e){return{enableMessageDeletion:String(e.DataRetentionSettings.EnableMessageDeletion),enableFileDeletion:String(e.DataRetentionSettings.EnableFileDeletion),messageRetentionDays:e.DataRetentionSettings.MessageRetentionDays,fileRetentionDays:e.DataRetentionSettings.FileRetentionDays,deletionJobStartTime:e.DataRetentionSettings.DeletionJobStartTime,showConfirmModal:!1}}},{key:"renderConfirmModal",value:function(){var e=g.a.createElement(E.c,{id:"admin.data_retention.confirmChangesModal.title",defaultMessage:"Confirm data retention policy"}),t=[];"true"===this.state.enableMessageDeletion?t.push(g.a.createElement(E.c,{id:"admin.data_retention.confirmChangesModal.description.itemMessageDeletion",defaultMessage:"All messages will be permanently deleted after {days} days.",values:{days:g.a.createElement("strong",null,this.state.messageRetentionDays)}})):t.push(g.a.createElement(E.c,{id:"admin.data_retention.confirmChangesModal.description.itemMessageIndefinite",defaultMessage:"All messages will be retained indefinitely."})),"true"===this.state.enableFileDeletion?t.push(g.a.createElement(E.c,{id:"admin.data_retention.confirmChangesModal.description.itemFileDeletion",defaultMessage:"All files will be permanently deleted after {days} days.",values:{days:g.a.createElement("strong",null,this.state.fileRetentionDays)}})):t.push(g.a.createElement(E.c,{id:"admin.data_retention.confirmChangesModal.description.itemFileIndefinite",defaultMessage:"All files will be retained indefinitely."}));var n=g.a.createElement("div",null,g.a.createElement("p",null,g.a.createElement(E.c,{id:"admin.data_retention.confirmChangesModal.description",defaultMessage:"Are you sure you want to apply the following data retention policy:"})),g.a.createElement("ul",null,t.map(function(e,t){return g.a.createElement("li",{key:t},e)})),g.a.createElement("p",null,g.a.createElement(E.c,{id:"admin.data_retention.confirmChangesModal.clarification",defaultMessage:"Once deleted, messages and files cannot be retrieved."}))),a=g.a.createElement(E.c,{id:"admin.data_retention.confirmChangesModal.confirm",defaultMessage:"Confirm Settings"});return g.a.createElement(Sn.a,{show:this.state.showConfirmModal,title:e,message:n,confirmButtonText:a,onConfirm:this.handleSaveConfirmed,onCancel:this.handleSaveCanceled})}},{key:"renderTitle",value:function(){return g.a.createElement(E.c,{id:"admin.data_retention.title",defaultMessage:"Data Retention Policy"})}},{key:"renderSettings",value:function(){var e=[{value:"false",text:N.ab("admin.data_retention.keepMessagesIndefinitely","Keep all messages indefinitely")},{value:"true",text:N.ab("admin.data_retention.keepMessageForTime","Keep messages for a set amount of time")}],t=[{value:"false",text:N.ab("admin.data_retention.keepFilesIndefinitely","Keep all files indefinitely")},{value:"true",text:N.ab("admin.data_retention.keepFilesForTime","Keep files for a set amount of time")}],n="";"true"===this.state.enableMessageDeletion&&(n=g.a.createElement(pe,{id:"messageRetentionDays",label:g.a.createElement("span",null),placeholder:N.ab("admin.data_retention.messageRetentionDays.example",'E.g.: "60"'),helpText:g.a.createElement(E.c,{id:"admin.data_retention.messageRetentionDays.description",defaultMessage:"Set how many days messages are kept in Mattermost. Messages, including file attachments older than the duration you set will be deleted nightly. The minimum time is one day."}),value:this.state.messageRetentionDays,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.MessageRetentionDays")}));var a="";"true"===this.state.enableFileDeletion&&(a=g.a.createElement(pe,{id:"fileRetentionDays",label:g.a.createElement("span",null),placeholder:N.ab("admin.data_retention.fileRetentionDays.example",'E.g.: "60"'),helpText:g.a.createElement(E.c,{id:"admin.data_retention.fileRetentionDays.description",defaultMessage:"Set how many days file uploads are kept in Mattermost. Files older than the duration you set will be deleted nightly. The minimum time is one day."}),value:this.state.fileRetentionDays,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.FileRetentionDays")}));var r=this.renderConfirmModal();return g.a.createElement(ht,null,r,g.a.createElement("div",{className:"banner"},g.a.createElement("div",{className:"banner__content"},g.a.createElement(E.c,{id:"admin.data_retention.note.description",defaultMessage:"Caution: Once a message or a file is deleted, the action is irreversible. Please be careful when setting up a custom data retention policy. See {documentationLink} to learn more.",values:{documentationLink:g.a.createElement("a",{href:"https://about.mattermost.com/default-dataretention-documentation/",rel:"noopener noreferrer",target:"_blank"},g.a.createElement(E.c,{id:"admin.data_retention.note.description.documentationLinkText",defaultMessage:"documentation"}))}}))),g.a.createElement(_e,{id:"enableMessageDeletion",values:e,label:g.a.createElement(E.c,{id:"admin.data_retention.enableMessageDeletion.title",defaultMessage:"Message Retention:"}),helpText:g.a.createElement(E.c,{id:"admin.data_retention.enableMessageDeletion.description",defaultMessage:"Set how long Mattermost keeps messages in channels and direct messages."}),value:this.state.enableMessageDeletion,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.EnableMessageDeletion")}),n,g.a.createElement(_e,{id:"enableFileDeletion",values:t,label:g.a.createElement(E.c,{id:"admin.data_retention.enableFileDeletion.title",defaultMessage:"File Retention:"}),helpText:g.a.createElement(E.c,{id:"admin.data_retention.enableFileDeletion.description",defaultMessage:"Set how long Mattermost keeps file uploads in channels and direct messages."}),value:this.state.enableFileDeletion,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.EnableFileDeletion")}),a,g.a.createElement(pe,{id:"deletionJobStartTime",label:g.a.createElement(E.c,{id:"admin.data_retention.deletionJobStartTime.title",defaultMessage:"Data Deletion Time:"}),placeholder:N.ab("admin.data_retention.deletionJobStartTime.example",'E.g.: "02:00"'),helpText:g.a.createElement(E.c,{id:"admin.data_retention.deletionJobStartTime.description",defaultMessage:"Set the start time of the daily scheduled data retention job. Choose a time when fewer people are using your system. Must be a 24-hour time stamp in the form HH:MM."}),value:this.state.deletionJobStartTime,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.DeletionJobStartTime")}),g.a.createElement(kt,{jobType:w.p.DATA_RETENTION,disabled:"true"!==this.state.enableMessageDeletion&&"true"!==this.state.enableFileDeletion,createJobButtonText:g.a.createElement(E.c,{id:"admin.data_retention.createJob.title",defaultMessage:"Run Deletion Job Now"}),createJobHelpText:g.a.createElement(E.c,{id:"admin.data_retention.createJob.help",defaultMessage:"Initiates a Data Retention deletion job immediately."})}))}}])&&kh(n.prototype,a),r&&kh(n,r),t}();function Dh(e){return(Dh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Lh(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Ih(e){return(Ih=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Uh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qh(e,t){return(qh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Bh="csv",Fh="actiance",Gh="globalrelay",Hh=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,n=!(r=Ih(t).call(this,e))||"object"!==Dh(r)&&"function"!=typeof r?Uh(a):r,function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Uh(n),"getJobDetails",function(e){return e.data&&e.data.messages_exported?g.a.createElement(E.c,{id:"admin.complianceExport.messagesExportedCount",defaultMessage:"{count} messages exported.",values:{count:e.data.messages_exported}}):null}),n.getConfigFromState=n.getConfigFromState.bind(Uh(n)),n.renderSettings=n.renderSettings.bind(Uh(n)),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qh(e,t)}(t,Wa),n=t,(a=[{key:"getConfigFromState",value:function(e){return e.MessageExportSettings.EnableExport=this.state.enableComplianceExport,e.MessageExportSettings.ExportFormat=this.state.exportFormat,e.MessageExportSettings.DailyRunTime=this.state.exportJobStartTime,this.state.exportFormat===Gh&&(e.MessageExportSettings.GlobalRelaySettings={CustomerType:this.state.globalRelayCustomerType,SmtpUsername:this.state.globalRelaySmtpUsername,SmtpPassword:this.state.globalRelaySmtpPassword,EmailAddress:this.state.globalRelayEmailAddress}),e}},{key:"getStateFromConfig",value:function(e){var t={enableComplianceExport:e.MessageExportSettings.EnableExport,exportFormat:e.MessageExportSettings.ExportFormat,exportJobStartTime:e.MessageExportSettings.DailyRunTime};return e.MessageExportSettings.GlobalRelaySettings&&(t.globalRelayCustomerType=e.MessageExportSettings.GlobalRelaySettings.CustomerType,t.globalRelaySmtpUsername=e.MessageExportSettings.GlobalRelaySettings.SmtpUsername,t.globalRelaySmtpPassword=e.MessageExportSettings.GlobalRelaySettings.SmtpPassword,t.globalRelayEmailAddress=e.MessageExportSettings.GlobalRelaySettings.EmailAddress),t}},{key:"renderTitle",value:function(){return g.a.createElement(E.c,{id:"admin.complianceExport.title",defaultMessage:"Compliance Export (Beta)"})}},{key:"renderSettings",value:function(){var e,t=[{value:Fh,text:N.ab("admin.complianceExport.exportFormat.actiance","Actiance XML")},{value:Bh,text:N.ab("admin.complianceExport.exportFormat.csv","CSV")},{value:Gh,text:N.ab("admin.complianceExport.exportFormat.globalrelay","GlobalRelay EML")}];if(this.state.exportFormat===Gh){var n=g.a.createElement(Le,{id:"globalRelayCustomerType",values:[{value:"A9",text:N.ab("admin.complianceExport.globalRelayCustomerType.a9.description","A9/Type 9")},{value:"A10",text:N.ab("admin.complianceExport.globalRelayCustomerType.a10.description","A10/Type 10")}],label:g.a.createElement(E.c,{id:"admin.complianceExport.globalRelayCustomerType.title",defaultMessage:"Customer Type:"}),helpText:g.a.createElement(E.c,{id:"admin.complianceExport.globalRelayCustomerType.description",defaultMessage:"The type of GlobalRelay customer account that your organization has."}),value:this.state.globalRelayCustomerType?this.state.globalRelayCustomerType:"",disabled:!this.state.enableComplianceExport,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.GlobalRelaySettings.CustomerType")}),a=g.a.createElement(pe,{id:"globalRelaySmtpUsername",label:g.a.createElement(E.c,{id:"admin.complianceExport.globalRelaySmtpUsername.title",defaultMessage:"SMTP Username:"}),placeholder:N.ab("admin.complianceExport.globalRelaySmtpUsername.example",'E.g.: "globalRelayUser"'),helpText:g.a.createElement(E.c,{id:"admin.complianceExport.globalRelaySmtpUsername.description",defaultMessage:"The username that is used to authenticate against the GlobalRelay SMTP server."}),value:this.state.globalRelaySmtpUsername?this.state.globalRelaySmtpUsername:"",disabled:!this.state.enableComplianceExport,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.GlobalRelaySettings.SmtpUsername")}),r=g.a.createElement(pe,{id:"globalRelaySmtpPassword",label:g.a.createElement(E.c,{id:"admin.complianceExport.globalRelaySmtpPassword.title",defaultMessage:"SMTP Password:"}),placeholder:N.ab("admin.complianceExport.globalRelaySmtpPassword.example",'E.g.: "globalRelayPassword"'),helpText:g.a.createElement(E.c,{id:"admin.complianceExport.globalRelaySmtpPassword.description",defaultMessage:"The password that is used to authenticate against the GlobalRelay SMTP server."}),value:this.state.globalRelaySmtpPassword?this.state.globalRelaySmtpPassword:"",disabled:!this.state.enableComplianceExport,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.GlobalRelaySettings.SmtpPassword")}),i=g.a.createElement(pe,{id:"globalRelayEmailAddress",label:g.a.createElement(E.c,{id:"admin.complianceExport.globalRelayEmailAddress.title",defaultMessage:"Email Address:"}),placeholder:N.ab("admin.complianceExport.globalRelayEmailAddress.example",'E.g.: "globalrelay@mattermost.com"'),helpText:g.a.createElement(E.b,{id:"admin.complianceExport.globalRelayEmailAddress.description",defaultMessage:"The email address that your GlobalRelay server monitors for incoming Compliance Exports."}),value:this.state.globalRelayEmailAddress?this.state.globalRelayEmailAddress:"",disabled:!this.state.enableComplianceExport,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.GlobalRelaySettings.EmailAddress")});e=g.a.createElement(ht,{id:"globalRelaySettings"},n,a,r,i)}var o=g.a.createElement(Xt.b,{id:"admin.complianceExport.exportFormat.description",defaultMessage:'Format of the compliance export. Corresponds to the system that you want to import the data into.\\n \\nFor Actiance XML, compliance export files are written to the \\"exports\\" subdirectory of the configured [Local Storage Directory]({siteURL}/admin_console/environment/file_storage). For Global Relay EML, they are emailed to the configured email address.',values:{siteURL:Object(Rn.e)()}});return g.a.createElement(ht,null,g.a.createElement(le,{id:"enableComplianceExport",label:g.a.createElement(E.c,{id:"admin.service.complianceExportTitle",defaultMessage:"Enable Compliance Export:"}),helpText:g.a.createElement(Xt.b,{id:"admin.service.complianceExportDesc",defaultMessage:"When true, Mattermost will export all messages that were posted in the last 24 hours. The export task is scheduled to run once per day. See [the documentation](!https://about.mattermost.com/default-compliance-export-documentation) to learn more."}),value:this.state.enableComplianceExport,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.EnableExport")}),g.a.createElement(pe,{id:"exportJobStartTime",label:g.a.createElement(E.c,{id:"admin.complianceExport.exportJobStartTime.title",defaultMessage:"Compliance Export Time:"}),placeholder:N.ab("admin.complianceExport.exportJobStartTime.example",'E.g.: "02:00"'),helpText:g.a.createElement(E.b,{id:"admin.complianceExport.exportJobStartTime.description",defaultMessage:"Set the start time of the daily scheduled compliance export job. Choose a time when fewer people are using your system. Must be a 24-hour time stamp in the form HH:MM."}),value:this.state.exportJobStartTime,disabled:!this.state.enableComplianceExport,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.DailyRunTime")}),g.a.createElement(_e,{id:"exportFormat",values:t,label:g.a.createElement(E.c,{id:"admin.complianceExport.exportFormat.title",defaultMessage:"Export Format:"}),helpText:o,value:this.state.exportFormat,disabled:!this.state.enableComplianceExport,onChange:this.handleChange,setByEnv:this.isSetByEnv("DataRetentionSettings.ExportFormat")}),e,g.a.createElement(kt,{jobType:w.p.MESSAGE_EXPORT,disabled:!this.state.enableComplianceExport,createJobButtonText:g.a.createElement(E.c,{id:"admin.complianceExport.createJob.title",defaultMessage:"Run Compliance Export Job Now"}),createJobHelpText:g.a.createElement(E.c,{id:"admin.complianceExport.createJob.help",defaultMessage:"Initiates a Compliance Export job immediately."}),getExtraInfoText:this.getJobDetails}))}}])&&Lh(n.prototype,a),r&&Lh(n,r),t}();function Yh(e){return(Yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wh(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function zh(e){return(zh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xh(e,t){return(Xh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Jh=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=zh(t).call(this,e))||"object"!==Yh(r)&&"function"!=typeof r?Vh(a):r).getConfigFromState=n.getConfigFromState.bind(Vh(n)),n.renderSettings=n.renderSettings.bind(Vh(n)),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xh(e,t)}(t,Wa),n=t,(a=[{key:"getConfigFromState",value:function(e){return e.SqlSettings.MaxIdleConns=this.parseIntNonZero(this.state.maxIdleConns),e.SqlSettings.MaxOpenConns=this.parseIntNonZero(this.state.maxOpenConns),e.SqlSettings.Trace=this.state.trace,e.SqlSettings.QueryTimeout=this.parseIntNonZero(this.state.queryTimeout),e.SqlSettings.ConnMaxLifetimeMilliseconds=this.parseIntNonNegative(this.state.connMaxLifetimeMilliseconds),e.ServiceSettings.MinimumHashtagLength=this.parseIntNonZero(this.state.minimumHashtagLength,3,2),e}},{key:"getStateFromConfig",value:function(e){return{driverName:e.SqlSettings.DriverName,dataSource:e.SqlSettings.DataSource,maxIdleConns:e.SqlSettings.MaxIdleConns,maxOpenConns:e.SqlSettings.MaxOpenConns,trace:e.SqlSettings.Trace,queryTimeout:e.SqlSettings.QueryTimeout,connMaxLifetimeMilliseconds:e.SqlSettings.ConnMaxLifetimeMilliseconds,minimumHashtagLength:e.ServiceSettings.MinimumHashtagLength}}},{key:"renderTitle",value:function(){return g.a.createElement(E.c,{id:"admin.database.title",defaultMessage:"Database Settings"})}},{key:"renderSettings",value:function(){var e="**********"+this.state.dataSource.substring(this.state.dataSource.indexOf("@")),t=g.a.createElement("div",null);return"true"===this.props.license.IsLicensed&&(t=g.a.createElement(Y,{requestAction:d.w,helpText:g.a.createElement(E.c,{id:"admin.recycle.recycleDescription",defaultMessage:'Deployments using multiple databases can switch from one master database to another without restarting the Mattermost server by updating "config.json" to the new desired configuration and using the {reloadConfiguration} feature to load the new settings while the server is running. The administrator should then use {featureName} feature to recycle the database connections based on the new settings.',values:{featureName:g.a.createElement("b",null,g.a.createElement(E.c,{id:"admin.recycle.recycleDescription.featureName",defaultMessage:"Recycle Database Connections"})),reloadConfiguration:g.a.createElement("a",{href:"../environment/web_server"},g.a.createElement("b",null,g.a.createElement(E.c,{id:"admin.recycle.recycleDescription.reloadConfiguration",defaultMessage:"Environment > Web Server > Reload Configuration from Disk"})))}}),buttonText:g.a.createElement(E.c,{id:"admin.recycle.button",defaultMessage:"Recycle Database Connections"}),showSuccessMessage:!1,errorMessage:{id:Object(A.b)("admin.recycle.reloadFail"),defaultMessage:"Recycling unsuccessful: {error}"},includeDetailedError:!0})),g.a.createElement(ht,null,g.a.createElement("div",{className:"banner"},g.a.createElement(E.c,{id:"admin.sql.noteDescription",defaultMessage:"Changing properties in this section will require a server restart before taking effect."})),g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label col-sm-4",htmlFor:"DriverName"},g.a.createElement(E.c,{id:"admin.sql.driverName",defaultMessage:"Driver Name:"})),g.a.createElement("div",{className:"col-sm-8"},g.a.createElement("input",{type:"text",className:"form-control",value:this.state.driverName,disabled:!0}),g.a.createElement("div",{className:"help-text"},g.a.createElement(E.c,{id:"admin.sql.driverNameDescription",defaultMessage:"Set the database driver in the config.json file."})))),g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label col-sm-4",htmlFor:"DataSource"},g.a.createElement(E.c,{id:"admin.sql.dataSource",defaultMessage:"Data Source:"})),g.a.createElement("div",{className:"col-sm-8"},g.a.createElement("input",{type:"text",className:"form-control",value:e,disabled:!0}),g.a.createElement("div",{className:"help-text"},g.a.createElement(E.c,{id:"admin.sql.dataSourceDescription",defaultMessage:"Set the database source in the config.json file."})))),g.a.createElement(pe,{id:"maxIdleConns",label:g.a.createElement(E.c,{id:"admin.sql.maxConnectionsTitle",defaultMessage:"Maximum Idle Connections:"}),placeholder:N.ab("admin.sql.maxConnectionsExample",'E.g.: "10"'),helpText:g.a.createElement(E.c,{id:"admin.sql.maxConnectionsDescription",defaultMessage:"Maximum number of idle connections held open to the database."}),value:this.state.maxIdleConns,onChange:this.handleChange,setByEnv:this.isSetByEnv("SqlSettings.MaxIdleConns")}),g.a.createElement(pe,{id:"maxOpenConns",label:g.a.createElement(E.c,{id:"admin.sql.maxOpenTitle",defaultMessage:"Maximum Open Connections:"}),placeholder:N.ab("admin.sql.maxOpenExample",'E.g.: "10"'),helpText:g.a.createElement(E.c,{id:"admin.sql.maxOpenDescription",defaultMessage:"Maximum number of open connections held open to the database."}),value:this.state.maxOpenConns,onChange:this.handleChange,setByEnv:this.isSetByEnv("SqlSettings.MaxOpenConns")}),g.a.createElement(pe,{id:"queryTimeout",label:g.a.createElement(E.c,{id:"admin.sql.queryTimeoutTitle",defaultMessage:"Query Timeout:"}),placeholder:N.ab("admin.sql.queryTimeoutExample",'E.g.: "30"'),helpText:g.a.createElement(E.c,{id:"admin.sql.queryTimeoutDescription",defaultMessage:"The number of seconds to wait for a response from the database after opening a connection and sending the query. Errors that you see in the UI or in the logs as a result of a query timeout can vary depending on the type of query."}),value:this.state.queryTimeout,onChange:this.handleChange,setByEnv:this.isSetByEnv("SqlSettings.QueryTimeout")}),g.a.createElement(pe,{id:"connMaxLifetimeMilliseconds",label:g.a.createElement(E.c,{id:"admin.sql.connMaxLifetimeTitle",defaultMessage:"Maximum Connection Lifetime:"}),placeholder:N.ab("admin.sql.connMaxLifetimeExample",'E.g.: "3600000"'),helpText:g.a.createElement(E.c,{id:"admin.sql.connMaxLifetimeDescription",defaultMessage:"Maximum lifetime for a connection to the database in milliseconds."}),value:this.state.connMaxLifetimeMilliseconds,onChange:this.handleChange,setByEnv:this.isSetByEnv("SqlSettings.ConnMaxLifetimeMilliseconds")}),g.a.createElement(pe,{id:"minimumHashtagLength",label:g.a.createElement(E.c,{id:"admin.service.minimumHashtagLengthTitle",defaultMessage:"Minimum Hashtag Length:"}),placeholder:N.ab("admin.service.minimumHashtagLengthExample",'E.g.: "3"'),helpText:g.a.createElement(Xt.b,{id:"admin.service.minimumHashtagLengthDescription",defaultMessage:"Minimum number of characters in a hashtag. This must be greater than or equal to 2. MySQL databases must be configured to support searching strings shorter than three characters, [see documentation](!https://dev.mysql.com/doc/refman/8.0/en/fulltext-fine-tuning.html)."}),value:this.state.minimumHashtagLength,onChange:this.handleChange,setByEnv:this.isSetByEnv("ServiceSettings.MinimumHashtagLength")}),g.a.createElement(le,{id:"trace",label:g.a.createElement(E.c,{id:"admin.sql.traceTitle",defaultMessage:"SQL Statement Logging: "}),helpText:g.a.createElement(E.c,{id:"admin.sql.traceDescription",defaultMessage:"(Development Mode) When true, executing SQL statements are written to the log."}),value:this.state.trace,onChange:this.handleChange,setByEnv:this.isSetByEnv("SqlSettings.Trace")}),t)}}])&&Wh(n.prototype,a),r&&Wh(n,r),t}();n(429);function Kh(e){return(Kh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qh(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Zh(e){return(Zh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eg(e,t){return(eg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var tg=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=Zh(t).call(this,e))||"object"!==Kh(r)&&"function"!=typeof r?$h(a):r).getConfigFromState=n.getConfigFromState.bind($h(n)),n.doTestConfig=n.doTestConfig.bind($h(n)),n.handleSettingChanged=n.handleSettingChanged.bind($h(n)),n.handleSaved=n.handleSaved.bind($h(n)),n.renderSettings=n.renderSettings.bind($h(n)),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eg(e,t)}(t,Wa),n=t,(a=[{key:"getConfigFromState",value:function(e){return e.ElasticsearchSettings.ConnectionUrl=this.state.connectionUrl,e.ElasticsearchSettings.SkipTLSVerification=this.state.skipTLSVerification,e.ElasticsearchSettings.Username=this.state.username,e.ElasticsearchSettings.Password=this.state.password,e.ElasticsearchSettings.Sniff=this.state.sniff,e.ElasticsearchSettings.EnableIndexing=this.state.enableIndexing,e.ElasticsearchSettings.EnableSearching=this.state.enableSearching,e.ElasticsearchSettings.EnableAutocomplete=this.state.enableAutocomplete,e}},{key:"getStateFromConfig",value:function(e){return{connectionUrl:e.ElasticsearchSettings.ConnectionUrl,skipTLSVerification:e.ElasticsearchSettings.SkipTLSVerification,username:e.ElasticsearchSettings.Username,password:e.ElasticsearchSettings.Password,sniff:e.ElasticsearchSettings.Sniff,enableIndexing:e.ElasticsearchSettings.EnableIndexing,enableSearching:e.ElasticsearchSettings.EnableSearching,enableAutocomplete:e.ElasticsearchSettings.EnableAutocomplete,configTested:!0,canSave:!0,canPurgeAndIndex:e.ElasticsearchSettings.EnableIndexing}}},{key:"handleSettingChanged",value:function(e,t){"enableIndexing"===e&&(!1===t?this.setState({enableSearching:!1,enableAutocomplete:!1}):this.setState({canSave:!1,configTested:!1})),"connectionUrl"!==e&&"skipTLSVerification"!==e&&"username"!==e&&"password"!==e&&"sniff"!==e||this.setState({configTested:!1,canSave:!1}),"enableSearching"!==e&&"enableAutocomplete"!==e&&this.setState({canPurgeAndIndex:!1}),this.handleChange(e,t)}},{key:"handleSaved",value:function(){this.setState({canPurgeAndIndex:this.state.enableIndexing})}},{key:"canSave",value:function(){return this.state.canSave}},{key:"doTestConfig",value:function(e,t){var n=this,a=JSON.parse(JSON.stringify(this.props.config));this.getConfigFromState(a),Object(d.i)(a,function(){n.setState({configTested:!0,canSave:!0}),e(),n.doSubmit()},function(e){n.setState({configTested:!1,canSave:!1}),t(e)})}},{key:"getExtraInfo",value:function(e){return e.status===w.o.IN_PROGRESS?g.a.createElement(E.c,{id:"admin.elasticsearch.percentComplete",defaultMessage:"{percent}% Complete",values:{percent:Number(e.progress)}}):null}},{key:"renderTitle",value:function(){return g.a.createElement(E.c,{id:"admin.elasticsearch.title",defaultMessage:"Elasticsearch"})}},{key:"renderSettings",value:function(){return g.a.createElement(ht,null,g.a.createElement(le,{id:"enableIndexing",label:g.a.createElement(E.c,{id:"admin.elasticsearch.enableIndexingTitle",defaultMessage:"Enable Elasticsearch Indexing:"}),helpText:g.a.createElement(E.c,{id:"admin.elasticsearch.enableIndexingDescription",defaultMessage:'When true, indexing of new posts occurs automatically. Search queries will use database search until "Enable Elasticsearch for search queries" is enabled. {documentationLink}',values:{documentationLink:g.a.createElement("a",{href:"https://about.mattermost.com/default-elasticsearch-documentation/",rel:"noopener noreferrer",target:"_blank"},g.a.createElement(E.c,{id:"admin.elasticsearch.enableIndexingDescription.documentationLinkText",defaultMessage:"Learn more about Elasticsearch in our documentation."}))}}),value:this.state.enableIndexing,onChange:this.handleSettingChanged,setByEnv:this.isSetByEnv("ElasticsearchSettings.EnableIndexing")}),g.a.createElement(pe,{id:"connectionUrl",label:g.a.createElement(E.c,{id:"admin.elasticsearch.connectionUrlTitle",defaultMessage:"Server Connection Address:"}),placeholder:N.ab("admin.elasticsearch.connectionUrlExample",'E.g.: "https://elasticsearch.example.org:9200"'),helpText:g.a.createElement(E.c,{id:"admin.elasticsearch.connectionUrlDescription",defaultMessage:"The address of the Elasticsearch server. {documentationLink}",values:{documentationLink:g.a.createElement("a",{href:"https://about.mattermost.com/default-elasticsearch-server-setup/",rel:"noopener noreferrer",target:"_blank"},g.a.createElement(E.c,{id:"admin.elasticsearch.connectionUrlExample.documentationLinkText",defaultMessage:"Please see documentation with server setup instructions."}))}}),value:this.state.connectionUrl,disabled:!this.state.enableIndexing,onChange:this.handleSettingChanged,setByEnv:this.isSetByEnv("ElasticsearchSettings.ConnectionUrl")}),g.a.createElement(le,{id:"skipTLSVerification",label:g.a.createElement(E.c,{id:"admin.elasticsearch.skipTLSVerificationTitle",defaultMessage:"Skip TLS Verification:"}),helpText:g.a.createElement(E.c,{id:"admin.elasticsearch.skipTLSVerificationDescription",defaultMessage:"When true, Mattermost will not require the Elasticsearch certificate to be signed by a trusted Certificate Authority."}),value:this.state.skipTLSVerification,disabled:!this.state.enableIndexing,onChange:this.handleSettingChanged,setByEnv:this.isSetByEnv("ElasticsearchSettings.SkipTLSVerification")}),g.a.createElement(pe,{id:"username",label:g.a.createElement(E.c,{id:"admin.elasticsearch.usernameTitle",defaultMessage:"Server Username:"}),placeholder:N.ab("admin.elasticsearch.usernameExample",'E.g.: "elastic"'),helpText:g.a.createElement(E.c,{id:"admin.elasticsearch.usernameDescription",defaultMessage:"(Optional) The username to authenticate to the Elasticsearch server."}),value:this.state.username,disabled:!this.state.enableIndexing,onChange:this.handleSettingChanged,setByEnv:this.isSetByEnv("ElasticsearchSettings.Username")}),g.a.createElement(pe,{id:"password",label:g.a.createElement(E.c,{id:"admin.elasticsearch.passwordTitle",defaultMessage:"Server Password:"}),placeholder:N.ab("admin.elasticsearch.password",'E.g.: "yourpassword"'),helpText:g.a.createElement(E.c,{id:"admin.elasticsearch.passwordDescription",defaultMessage:"(Optional) The password to authenticate to the Elasticsearch server."}),value:this.state.password,disabled:!this.state.enableIndexing,onChange:this.handleSettingChanged,setByEnv:this.isSetByEnv("ElasticsearchSettings.Password")}),g.a.createElement(le,{id:"sniff",label:g.a.createElement(E.c,{id:"admin.elasticsearch.sniffTitle",defaultMessage:"Enable Cluster Sniffing:"}),helpText:g.a.createElement(E.c,{id:"admin.elasticsearch.sniffDescription",defaultMessage:"When true, sniffing finds and connects to all data nodes in your cluster automatically."}),value:this.state.sniff,disabled:!this.state.enableIndexing,onChange:this.handleSettingChanged,setByEnv:this.isSetByEnv("ElasticsearchSettings.Sniff")}),g.a.createElement(Y,{requestAction:this.doTestConfig,helpText:g.a.createElement(E.c,{id:"admin.elasticsearch.testHelpText",defaultMessage:"Tests if the Mattermost server can connect to the Elasticsearch server specified. Testing the connection only saves the configuration if the test is successful. See log file for more detailed error messages."}),buttonText:g.a.createElement(E.c,{id:"admin.elasticsearch.elasticsearch_test_button",defaultMessage:"Test Connection"}),successMessage:{id:Object(A.b)("admin.elasticsearch.testConfigSuccess"),defaultMessage:"Test successful. Configuration saved."},disabled:!this.state.enableIndexing}),g.a.createElement("div",{className:"form-group"},g.a.createElement("label",{className:"control-label col-sm-4"},g.a.createElement(E.c,{id:"admin.elasticsearch.bulkIndexingTitle",defaultMessage:"Bulk Indexing:"})),g.a.createElement("div",{className:"col-sm-8"},g.a.createElement("div",{className:"job-table-setting"},g.a.createElement(kt,{jobType:w.p.ELASTICSEARCH_POST_INDEXING,disabled:!this.state.canPurgeAndIndex,createJobButtonText:g.a.createElement(E.c,{id:"admin.elasticsearch.createJob.title",defaultMessage:"Index Now"}),createJobHelpText:g.a.createElement(E.c,{id:"admin.elasticsearch.createJob.help",defaultMessage:"All users, channels and posts in the database will be indexed from oldest to newest. Elasticsearch is available during indexing but search results may be incomplete until the indexing job is complete."}),getExtraInfoText:this.getExtraInfo})))),g.a.createElement(Y,{requestAction:d.h,helpText:g.a.createElement(E.c,{id:"admin.elasticsearch.purgeIndexesHelpText",defaultMessage:"Purging will entirely remove the indexes on the Elasticsearch server. Search results may be incomplete until a bulk index of the existing database is rebuilt."}),buttonText:g.a.createElement(E.c,{id:"admin.elasticsearch.purgeIndexesButton",defaultMessage:"Purge Index"}),successMessage:{id:Object(A.b)("admin.elasticsearch.purgeIndexesButton.success"),defaultMessage:"Indexes purged successfully."},errorMessage:{id:Object(A.b)("admin.elasticsearch.purgeIndexesButton.error"),defaultMessage:"Failed to purge indexes: {error}"},disabled:!this.state.canPurgeAndIndex,label:g.a.createElement(E.c,{id:"admin.elasticsearch.purgeIndexesButton.label",defaultMessage:"Purge Indexes:"})}),g.a.createElement(le,{id:"enableSearching",label:g.a.createElement(E.c,{id:"admin.elasticsearch.enableSearchingTitle",defaultMessage:"Enable Elasticsearch for search queries:"}),helpText:g.a.createElement(E.c,{id:"admin.elasticsearch.enableSearchingDescription",defaultMessage:"Requires a successful connection to the Elasticsearch server. When true, Elasticsearch will be used for all search queries using the latest index. Search results may be incomplete until a bulk index of the existing post database is finished. When false, database search is used."}),value:this.state.enableSearching,disabled:!this.state.enableIndexing||!this.state.configTested,onChange:this.handleSettingChanged,setByEnv:this.isSetByEnv("ElasticsearchSettings.EnableSearching")}),g.a.createElement(le,{id:"enableAutocomplete",label:g.a.createElement(E.c,{id:"admin.elasticsearch.enableAutocompleteTitle",defaultMessage:"Enable Elasticsearch for autocomplete queries:"}),helpText:g.a.createElement(E.c,{id:"admin.elasticsearch.enableAutocompleteDescription",defaultMessage:"Requires a successful connection to the Elasticsearch server. When true, Elasticsearch will be used for all autocompletion queries on users and channels using the latest index. Autocompletion results may be incomplete until a bulk index of the existing users and channels database is finished. When false, database autocomplete is used."}),value:this.state.enableAutocomplete,disabled:!this.state.enableIndexing||!this.state.configTested,onChange:this.handleSettingChanged,setByEnv:this.isSetByEnv("ElasticsearchSettings.EnableAutocomplete")}))}}])&&Qh(n.prototype,a),r&&Qh(n,r),t}(),ng=n(2346),ag=n.n(ng),rg=n(2347),ig=n.n(rg);function og(e){return(og="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sg(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function lg(e,t){return!t||"object"!==og(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function cg(e){return(cg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ug(e,t){return(ug=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var mg=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),lg(this,cg(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ug(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){var e=g.a.createElement("img",{alt:"version mismatch",className:"cluster-status",src:ag.a}),t=g.a.createElement("img",{alt:"config mismatch",className:"cluster-status",src:ag.a}),n="",a="",r=!1;this.props.clusterInfos.length&&(n=this.props.clusterInfos[0].version,a=this.props.clusterInfos[0].config_hash,r=1===this.props.clusterInfos.length),this.props.clusterInfos.map(function(r){return r.version!==n&&(e=g.a.createElement("img",{alt:"version mismatch",className:"cluster-status",src:ig.a})),r.config_hash!==a&&(t=g.a.createElement("img",{alt:"config mismatch",className:"cluster-status",src:ig.a})),null});var i=this.props.clusterInfos.map(function(n){var a=null;return""===n.hostname&&(n.hostname=N.ab("admin.cluster.unknown","unknown")),""===n.version&&(n.version=N.ab("admin.cluster.unknown","unknown")),""===n.config_hash&&(n.config_hash=N.ab("admin.cluster.unknown","unknown")),a=r?g.a.createElement("img",{alt:"Cluster status",className:"cluster-status",src:ig.a}):g.a.createElement("img",{alt:"Cluster status",className:"cluster-status",src:ag.a}),g.a.createElement("tr",{key:n.ipaddress},g.a.createElement("td",{style:dg.clusterCell},a),g.a.createElement("td",{style:dg.clusterCell},n.hostname),g.a.createElement("td",{style:dg.clusterCell},e," ",n.version),g.a.createElement("td",{style:dg.clusterCell},g.a.createElement("div",{className:"config-hash"},t," ",n.config_hash)),g.a.createElement("td",{style:dg.clusterCell},n.ipaddress))});return g.a.createElement("div",{className:"cluster-panel__table",style:dg.clusterTable},g.a.createElement("div",{className:"text-right"},g.a.createElement("button",{type:"submit",className:"btn btn-link",onClick:this.props.reload},g.a.createElement(Or,null),g.a.createElement(E.c,{id:"admin.cluster.status_table.reload",defaultMessage:" Reload Cluster Status"}))),g.a.createElement("table",{className:"table"},g.a.createElement("thead",null,g.a.createElement("tr",null,g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.cluster.status_table.status",defaultMessage:"Status"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.cluster.status_table.hostname",defaultMessage:"Hostname"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.cluster.status_table.version",defaultMessage:"Version"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.cluster.status_table.config_hash",defaultMessage:"Config File MD5"})),g.a.createElement("th",null,g.a.createElement(E.c,{id:"admin.cluster.status_table.url",defaultMessage:"Gossip Address"})))),g.a.createElement("tbody",null,i)))}}])&&sg(n.prototype,a),r&&sg(n,r),t}();!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(mg,"propTypes",{clusterInfos:b.a.array.isRequired,reload:b.a.func.isRequired});var dg={clusterTable:{margin:10,marginBottom:30},clusterCell:{whiteSpace:"nowrap"}};function pg(e){return(pg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fg(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function bg(e){return(bg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function hg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gg(e,t){return(gg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var yg=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=bg(t).call(this,e))||"object"!==pg(r)&&"function"!=typeof r?hg(a):r).load=n.load.bind(hg(n)),n.reload=n.reload.bind(hg(n)),n.interval=null,n.state={clusterInfos:null},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gg(e,t)}(t,g.a.Component),n=t,(a=[{key:"load",value:function(){var e=this;Object(d.n)(function(t){e.setState({clusterInfos:t})},null)}},{key:"UNSAFE_componentWillMount",value:function(){this.load(),this.interval=setInterval(this.load,15e3)}},{key:"componentWillUnmount",value:function(){this.interval&&clearInterval(this.interval)}},{key:"reload",value:function(e){e&&e.preventDefault(),this.setState({clusterInfos:null}),this.load()}},{key:"render",value:function(){return null==this.state.clusterInfos?g.a.createElement(W.a,null):g.a.createElement(mg,{clusterInfos:this.state.clusterInfos,reload:this.reload})}}])&&fg(n.prototype,a),r&&fg(n,r),t}();function vg(e){return(vg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _g(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Eg(e){return(Eg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Sg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Og(e,t){return(Og=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Tg=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,(n=!(r=Eg(t).call(this,e))||"object"!==vg(r)&&"function"!=typeof r?Sg(a):r).getConfigFromState=n.getConfigFromState.bind(Sg(n)),n.renderSettings=n.renderSettings.bind(Sg(n)),n.overrideHandleChange=n.overrideHandleChange.bind(Sg(n)),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Og(e,t)}(t,Wa),n=t,(a=[{key:"getConfigFromState",value:function(e){return e.ClusterSettings.Enable=this.state.Enable,e.ClusterSettings.ClusterName=this.state.ClusterName,e.ClusterSettings.OverrideHostname=this.state.OverrideHostname,e.ClusterSettings.UseIpAddress=this.state.UseIpAddress,e.ClusterSettings.UseExperimentalGossip=this.state.UseExperimentalGossip,e.ClusterSettings.GossipPort=this.parseIntNonZero(this.state.GossipPort,8074),e.ClusterSettings.StreamingPort=this.parseIntNonZero(this.state.StreamingPort,8075),e}},{key:"getStateFromConfig",value:function(e){var t=e.ClusterSettings;return{Enable:t.Enable,ClusterName:t.ClusterName,OverrideHostname:t.OverrideHostname,UseIpAddress:t.UseIpAddress,UseExperimentalGossip:t.UseExperimentalGossip,GossipPort:t.GossipPort,StreamingPort:t.StreamingPort,showWarning:!1}}},{key:"renderTitle",value:function(){return g.a.createElement(E.c,{id:"admin.advance.cluster",defaultMessage:"High Availability"})}},{key:"overrideHandleChange",value:function(e,t){this.setState({showWarning:!0}),this.handleChange(e,t)}},{key:"renderSettings",value:function(){if(!("true"===this.props.license.IsLicensed&&"true"===this.props.license.Cluster))return null;var e=null;gr.Client4.clusterId&&(e=g.a.createElement("div",{style:wg.configLoadedFromCluster,className:"alert alert-warning"},g.a.createElement(I.a,null),g.a.createElement(Xt.b,{id:"admin.cluster.loadedFrom",defaultMessage:"This configuration file was loaded from Node ID {clusterId}. Please see the Troubleshooting Guide in our [documentation](!http://docs.mattermost.com/deployment/cluster.html) if you are accessing the System Console through a load balancer and experiencing issues.",values:{clusterId:gr.Client4.clusterId}})));var t=null;this.state.showWarning&&(t=g.a.createElement("div",{style:wg.warning,className:"alert alert-warning"},g.a.createElement(I.a,null),g.a.createElement(Xt.b,{id:"admin.cluster.should_not_change",defaultMessage:"WARNING: These settings may not sync with the other servers in the cluster. High Availability inter-node communication will not start until you modify the config.json to be identical on all servers and restart Mattermost. Please see the [documentation](!http://docs.mattermost.com/deployment/cluster.html) on how to add or remove a server from the cluster. If you are accessing the System Console through a load balancer and experiencing issues, please see the Troubleshooting Guide in our [documentation](!http://docs.mattermost.com/deployment/cluster.html)."})));var n=null;return this.state.Enable&&(n=g.a.createElement(yg,null)),g.a.createElement(ht,null,e,n,g.a.createElement("div",{className:"banner"},g.a.createElement(E.c,{id:"admin.cluster.noteDescription",defaultMessage:"Changing properties in this section will require a server restart before taking effect."})),t,g.a.createElement(le,{id:"Enable",label:g.a.createElement(E.c,{id:"admin.cluster.enableTitle",defaultMessage:"Enable High Availability Mode:"}),helpText:g.a.createElement(Xt.b,{id:"admin.cluster.enableDescription",defaultMessage:"When true, Mattermost will run in High Availability mode. Please see [documentation](!http://docs.mattermost.com/deployment/cluster.html) to learn more about configuring High Availability for Mattermost."}),value:this.state.Enable,onChange:this.overrideHandleChange,setByEnv:this.isSetByEnv("ClusterSettings.Enable")}),g.a.createElement(pe,{id:"ClusterName",label:g.a.createElement(E.c,{id:"admin.cluster.ClusterName",defaultMessage:"Cluster Name:"}),placeholder:N.ab("admin.cluster.ClusterNameEx",'E.g.: "Production" or "Staging"'),helpText:g.a.createElement(E.c,{id:"admin.cluster.ClusterNameDesc",defaultMessage:"The cluster to join by name.  Only nodes with the same cluster name will join together.  This is to support Blue-Green deployments or staging pointing to the same database."}),value:this.state.ClusterName,onChange:this.overrideHandleChange,setByEnv:this.isSetByEnv("ClusterSettings.ClusterName")}),g.a.createElement(pe,{id:"OverrideHostname",label:g.a.createElement(E.c,{id:"admin.cluster.OverrideHostname",defaultMessage:"Override Hostname:"}),placeholder:N.ab("admin.cluster.OverrideHostnameEx",'E.g.: "app-server-01"'),helpText:g.a.createElement(E.c,{id:"admin.cluster.OverrideHostnameDesc",defaultMessage:"The default value of <blank> will attempt to get the Hostname from the OS or use the IP Address.  You can override the hostname of this server with this property.  It is not recommended to override the Hostname unless needed. This property can also be set to a specific IP Address if needed."}),value:this.state.OverrideHostname,onChange:this.overrideHandleChange,setByEnv:this.isSetByEnv("ClusterSettings.OverrideHostname")}),g.a.createElement(le,{id:"UseIpAddress",label:g.a.createElement(E.c,{id:"admin.cluster.UseIpAddress",defaultMessage:"Use IP Address:"}),helpText:g.a.createElement(E.b,{id:"admin.cluster.UseIpAddressDesc",defaultMessage:"When true, the cluster will attempt to communicate via IP Address vs using the hostname."}),value:this.state.UseIpAddress,onChange:this.overrideHandleChange,setByEnv:this.isSetByEnv("ClusterSettings.UseIpAddress")}),g.a.createElement(le,{id:"UseExperimentalGossip",label:g.a.createElement(E.c,{id:"admin.cluster.UseExperimentalGossip",defaultMessage:"Use Experimental Gossip:"}),helpText:g.a.createElement(E.b,{id:"admin.cluster.UseExperimentalGossipDesc",defaultMessage:"When true, the server will attempt to communicate via the gossip protocol over the gossip port.  When false the server will attempt to communicate over the streaming port. When false the gossip port and protocol are still used to determine cluster health."}),value:this.state.UseExperimentalGossip,onChange:this.overrideHandleChange,setByEnv:this.isSetByEnv("ClusterSettings.UseExperimentalGossip")}),g.a.createElement(pe,{id:"GossipPort",label:g.a.createElement(E.c,{id:"admin.cluster.GossipPort",defaultMessage:"Gossip Port:"}),placeholder:N.ab("admin.cluster.GossipPortEx",'E.g.: "8074"'),helpText:g.a.createElement(E.c,{id:"admin.cluster.GossipPortDesc",defaultMessage:"The port used for the gossip protocol.  Both UDP and TCP should be allowed on this port."}),value:this.state.GossipPort,onChange:this.overrideHandleChange,setByEnv:this.isSetByEnv("ClusterSettings.GossipPort")}),g.a.createElement(pe,{id:"StreamingPort",label:g.a.createElement(E.c,{id:"admin.cluster.StreamingPort",defaultMessage:"Streaming Port:"}),placeholder:N.ab("admin.cluster.StreamingPortEx",'E.g.: "8075"'),helpText:g.a.createElement(E.c,{id:"admin.cluster.StreamingPortDesc",defaultMessage:"The port used for streaming data between servers."}),value:this.state.StreamingPort,onChange:this.overrideHandleChange,setByEnv:this.isSetByEnv("ClusterSettings.StreamingPort")}))}}])&&_g(n.prototype,a),r&&_g(n,r),t}(),wg={configLoadedFromCluster:{marginBottom:10},warning:{marginBottom:10}};function jg(e){return(jg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xg(e,t,n,a,r,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function Pg(e){return function(){var t=this,n=arguments;return new Promise(function(a,r){var i=e.apply(t,n);function o(e){xg(i,a,r,o,s,"next",e)}function s(e){xg(i,a,r,o,s,"throw",e)}o(void 0)})}}function kg(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Cg(e){return(Cg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Mg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rg(e,t){return(Rg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ng(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ag=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Cg(t).call(this,e),n=!r||"object"!==jg(r)&&"function"!=typeof r?Mg(a):r,Ng(Mg(n),"getConfigFromState",function(e){return e.SupportSettings.CustomTermsOfServiceEnabled=n.state.termsEnabled,e.SupportSettings.CustomTermsOfServiceReAcceptancePeriod=n.parseIntNonZero(n.state.reAcceptancePeriod,w.i.DEFAULT_TERMS_OF_SERVICE_RE_ACCEPTANCE_PERIOD),e}),Ng(Mg(n),"doSubmit",function(){var e=Pg(regeneratorRuntime.mark(function e(t){var a,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n.setState({saving:!0,serverError:null}),!n.state.termsEnabled||n.state.receivedTermsText===n.state.termsText&&n.props.config.SupportSettings.CustomTermsOfServiceEnabled){e.next=8;break}return e.next=4,n.props.actions.createTermsOfService(n.state.termsText);case 4:if(!(a=e.sent).error){e.next=8;break}return n.handleAPIError(a.error,t),e.abrupt("return");case 8:r=JSON.parse(JSON.stringify(n.props.config)),r=n.getConfigFromState(r),Object(d.B)(r,function(e){n.setState(n.getStateFromConfig(e)),n.setState({saveNeeded:!1,saving:!1}),n.props.setNavigationBlocked(!1),t&&t(),n.handleSaved&&n.handleSaved(r)},function(e){n.handleAPIError(e,t,r)});case 11:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),Ng(Mg(n),"handleAPIError",function(e,t,a){n.setState({saving:!1,serverError:e.message,serverErrorId:e.id}),t&&t(),n.handleSaved&&a&&n.handleSaved(a)}),Ng(Mg(n),"getTermsOfService",Pg(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n.setState({loadingTermsText:!0}),e.next=3,n.props.actions.getTermsOfService();case 3:(t=e.sent).data&&n.setState({termsText:t.data.text,receivedTermsText:t.data.text}),n.setState({loadingTermsText:!1});case 6:case"end":return e.stop()}},e)}))),Ng(Mg(n),"handleTermsTextChange",function(e,t){n.handleChange("termsText",t)}),Ng(Mg(n),"handleTermsEnabledChange",function(e,t){n.handleChange("termsEnabled",t)}),Ng(Mg(n),"handleReAcceptancePeriodChange",function(e,t){n.handleChange("reAcceptancePeriod",t)}),Ng(Mg(n),"renderSettings",function(){return n.state.loadingTermsText?g.a.createElement(W.a,null):g.a.createElement(ht,null,g.a.createElement(le,{key:"customTermsOfServiceEnabled",id:"SupportSettings.CustomTermsOfServiceEnabled",label:g.a.createElement(E.c,{id:"admin.support.enableTermsOfServiceTitle",defaultMessage:"Enable Custom Terms of Service"}),helpText:g.a.createElement(Xt.b,{id:"admin.support.enableTermsOfServiceHelp",defaultMessage:"When true, new users must accept the terms of service before accessing any Mattermost teams on desktop, web or mobile. Existing users must accept them after login or a page refresh.\\n \\nTo update terms of service link displayed in account creation and login pages, go to [Site Configuration > Customization](../site_config/customization)."}),value:n.state.termsEnabled,disabled:!(n.props.license.IsLicensed&&"true"===n.props.license.CustomTermsOfService),onChange:n.handleTermsEnabledChange,setByEnv:n.isSetByEnv("SupportSettings.CustomTermsOfServiceEnabled")}),g.a.createElement(pe,{key:"customTermsOfServiceText",id:"SupportSettings.CustomTermsOfServiceText",type:"textarea",label:g.a.createElement(E.c,{id:"admin.support.termsOfServiceTextTitle",defaultMessage:"Custom Terms of Service Text"}),helpText:g.a.createElement(E.c,{id:"admin.support.termsOfServiceTextHelp",defaultMessage:"Text that will appear in your custom Terms of Service. Supports Markdown-formatted text."}),disabled:!n.state.termsEnabled,onChange:n.handleTermsTextChange,setByEnv:n.isSetByEnv("SupportSettings.CustomTermsOfServiceText"),value:n.state.termsText,maxLength:w.i.MAX_TERMS_OF_SERVICE_TEXT_LENGTH}),g.a.createElement(pe,{key:"customTermsOfServiceReAcceptancePeriod",id:"SupportSettings.CustomTermsOfServiceReAcceptancePeriod",type:"number",label:g.a.createElement(E.c,{id:"admin.support.termsOfServiceReAcceptanceTitle",defaultMessage:"Re-Acceptance Period:"}),helpText:g.a.createElement(E.c,{id:"admin.support.termsOfServiceReAcceptanceHelp",defaultMessage:"The number of days before Terms of Service acceptance expires, and the terms must be re-accepted."}),disabled:!n.state.termsEnabled,value:n.state.reAcceptancePeriod,onChange:n.handleReAcceptancePeriodChange,setByEnv:n.isSetByEnv("SupportSettings.CustomTermsOfServiceReAcceptancePeriod")}))}),n.state={termsEnabled:e.config.SupportSettings.CustomTermsOfServiceEnabled,reAcceptancePeriod:e.config.SupportSettings.CustomTermsOfServiceReAcceptancePeriod,loadingTermsText:!0,receivedTermsText:"",termsText:"",saveNeeded:!1,saving:!1,serverError:null,errorTooltip:!1},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rg(e,t)}(t,Wa),n=t,(a=[{key:"getStateFromConfig",value:function(e){return{termsEnabled:e.SupportSettings.CustomTermsOfServiceEnabled,reAcceptancePeriod:e.SupportSettings.CustomTermsOfServiceReAcceptancePeriod}}},{key:"componentDidMount",value:function(){this.getTermsOfService()}},{key:"renderTitle",value:function(){return g.a.createElement(E.c,{id:"admin.support.termsOfServiceTitle",defaultMessage:"Custom Terms of Service (Beta)"})}}])&&kg(n.prototype,a),r&&kg(n,r),t}();Ng(Ag,"propTypes",{actions:b.a.shape({getTermsOfService:b.a.func.isRequired,createTermsOfService:b.a.func.isRequired}).isRequired,config:b.a.object,license:b.a.object,setNavigationBlocked:b.a.func});var Dg=Object(a.connect)(null,function(e){return{actions:Object(r.bindActionCreators)({getTermsOfService:fa.getTermsOfService,createTermsOfService:fa.createTermsOfService},e)}})(Ag),Lg=g.a.createElement("tr",null,g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.connectionSecurityNone",defaultMessage:"None"})),g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.connectionSecurityNoneDescription",defaultMessage:"Mattermost will connect over an insecure connection."}))),Ig=g.a.createElement("tr",null,g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.connectionSecurityTls",defaultMessage:"TLS"})),g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.connectionSecurityTlsDescription",defaultMessage:"Encrypts the communication between Mattermost and your server."}))),Ug=g.a.createElement("tr",null,g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.connectionSecurityStart",defaultMessage:"STARTTLS"})),g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.connectionSecurityStartDescription",defaultMessage:"Takes an existing insecure connection and attempts to upgrade it to a secure connection using TLS."}))),qg=g.a.createElement("table",{className:"table table-bordered table-margin--none",cellPadding:"5"},g.a.createElement("tbody",null,Lg,Ig,Ug)),Bg=g.a.createElement("table",{className:"table table-bordered table-margin--none",cellPadding:"5"},g.a.createElement("tbody",null,Lg,Ig,Ug)),Fg=g.a.createElement("table",{className:"table table-bordered table-margin--none",cellPadding:"5"},g.a.createElement("tbody",null,Lg,Ig)),Gg=g.a.createElement("div",null,g.a.createElement("table",{className:"table table-bordered table-margin--none",cellPadding:"5"},g.a.createElement("tbody",null,g.a.createElement("tr",null,g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.webserverModeGzip",defaultMessage:"gzip"})),g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.webserverModeGzipDescription",defaultMessage:"The Mattermost server will serve static files compressed with gzip."}))),g.a.createElement("tr",null,g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.webserverModeUncompressed",defaultMessage:"Uncompressed"})),g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.webserverModeUncompressedDescription",defaultMessage:"The Mattermost server will serve static files uncompressed."}))),g.a.createElement("tr",null,g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.webserverModeDisabled",defaultMessage:"Disabled"})),g.a.createElement("td",null,g.a.createElement(E.c,{id:"admin.webserverModeDisabledDescription",defaultMessage:"The Mattermost server will not serve static files."}))))),g.a.createElement("p",{className:"help-text"},g.a.createElement(E.c,{id:"admin.webserverModeHelpText",defaultMessage:"gzip compression applies to static content files. It is recommended to enable gzip to improve performance unless your environment has specific restrictions, such as a web proxy that distributes gzip files poorly."}))),Hg=[{value:"DEBUG",display_name:"DEBUG",display_name_default:"DEBUG"},{value:"INFO",display_name:"INFO",display_name_default:"INFO"},{value:"ERROR",display_name:"ERROR",display_name_default:"ERROR"}];function Yg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){Wg(e,t,n[t])})}return e}function Wg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zg=Math.pow(1024,2),Vg={isnt:function(e){return function(t,n,a,r){return!e(t,n,a,r)}},both:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n,a){for(var r=0,i=t;r<i.length;r++){if(!(0,i[r])(e,n,a))return!1}return!0}},either:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n,a,r){for(var i=0,o=t;i<o.length;i++){if((0,o[i])(e,n,a,r))return!0}return!1}},stateMatches:function(e,t){return function(n,a){return a[e].match(t)}},stateEquals:function(e,t){return function(n,a){return a[e]===t}},stateIsTrue:function(e){return function(t,n){return Boolean(n[e])}},stateIsFalse:function(e){return function(t,n){return!n[e]}},configIsTrue:function(e,t){return function(n){return Boolean(n[e][t])}},configIsFalse:function(e,t){return function(n){return!n[e][t]}},enterpriseReady:function(e,t,n,a){return a},licensed:function(e,t,n){return"true"===n.IsLicensed},licensedForFeature:function(e){return function(t,n,a){return a.IsLicensed&&"true"===a[e]}}},Xg={about:{icon:"fa-info-circle",sectionTitle:Object(A.b)("admin.sidebar.about"),sectionTitleDefault:"About",license:{url:"about/license",title:Object(A.b)("admin.sidebar.license"),title_default:"Edition and License",isHidden:Vg.either(Vg.isnt(Vg.enterpriseReady),Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin")),searchableStrings:["admin.license.title","admin.license.uploadDesc","admin.license.keyRemove","admin.license.edition","admin.license.type","admin.license.key","Mattermost Enterprise Edition. Unlock enterprise features in this software through the purchase of a subscription from ","This software is offered under a commercial license.\n\nSee ENTERPRISE-EDITION-LICENSE.txt in your root install directory for details. See NOTICE.txt for information about open source software used in this system."],schema:{id:"LicenseSettings",component:li}}},reporting:{icon:"fa-bar-chart",sectionTitle:Object(A.b)("admin.sidebar.reporting"),sectionTitleDefault:"Reporting",system_analytics:{url:"reporting/system_analytics",title:Object(A.b)("admin.sidebar.siteStatistics"),title_default:"Site Statistics",searchableStrings:["analytics.system.title","analytics.system.totalPosts","analytics.system.activeUsers","analytics.system.totalSessions","analytics.system.totalCommands","analytics.system.totalIncomingWebhooks","analytics.system.totalOutgoingWebhooks","analytics.system.totalWebsockets","analytics.system.totalMasterDbConnections","analytics.system.totalReadDbConnections","analytics.system.postTypes","analytics.system.channelTypes","analytics.system.totalUsers","analytics.system.totalTeams","analytics.system.totalChannels","analytics.system.dailyActiveUsers","analytics.system.monthlyActiveUsers"],schema:{id:"SystemAnalytics",component:da}},team_statistics:{url:"reporting/team_statistics",title:Object(A.b)("admin.sidebar.teamStatistics"),title_default:"Team Statistics",searchableStrings:[["analytics.team.title",{team:""}],"analytics.system.info","analytics.team.totalPosts","analytics.team.activeUsers","analytics.team.totalUsers","analytics.team.publicChannels","analytics.team.privateGroups","analytics.team.recentUsers","analytics.team.newlyCreated"],schema:{id:"TeamAnalytics",component:Da}},server_logs:{url:"reporting/server_logs",title:Object(A.b)("admin.sidebar.logs"),title_default:"Server Logs",searchableStrings:["admin.logs.bannerDesc","admin.logs.title"],schema:{id:"ServerLogs",component:hm}}},user_management:{icon:"fa-users",sectionTitle:Object(A.b)("admin.sidebar.userManagement"),sectionTitleDefault:"User Management",system_user_detail:{url:"user_management/user/:user_id",schema:{id:"SystemUserDetail",component:$u}},system_users:{url:"user_management/users",title:Object(A.b)("admin.sidebar.users"),title_default:"Users",searchableStrings:[["admin.system_users.title",{siteName:""}]],schema:{id:"SystemUsers",component:Lu}},group_detail:{url:"user_management/groups/:group_id",isHidden:Vg.either(Vg.isnt(Vg.licensedForFeature("LDAPGroups")),Vg.configIsFalse("ServiceSettings","ExperimentalLdapGroupSync")),schema:{id:"GroupDetail",component:pp}},groups:{url:"user_management/groups",title:Object(A.b)("admin.sidebar.groups"),title_default:"Groups",isHidden:Vg.either(Vg.isnt(Vg.licensedForFeature("LDAPGroups")),Vg.configIsFalse("ServiceSettings","ExperimentalLdapGroupSync")),schema:{id:"Groups",component:id}},team_detail:{url:"user_management/teams/:team_id",isHidden:Vg.either(Vg.isnt(Vg.licensedForFeature("LDAPGroups")),Vg.configIsFalse("ServiceSettings","ExperimentalLdapGroupSync")),schema:{id:"TeamDetail",component:wb}},teams:{url:"user_management/teams",title:Object(A.b)("admin.sidebar.teams"),title_default:"Teams",isHidden:Vg.either(Vg.isnt(Vg.licensedForFeature("LDAPGroups")),Vg.configIsFalse("ServiceSettings","ExperimentalLdapGroupSync")),schema:{id:"Teams",component:$p}},channel_detail:{url:"user_management/channels/:channel_id",isHidden:Vg.either(Vg.isnt(Vg.licensedForFeature("LDAPGroups")),Vg.configIsFalse("ServiceSettings","ExperimentalLdapGroupSync")),schema:{id:"ChannelDetail",component:bh}},channel:{url:"user_management/channels",title:Object(A.b)("admin.sidebar.channels"),title_default:"Channels",isHidden:Vg.either(Vg.isnt(Vg.licensedForFeature("LDAPGroups")),Vg.configIsFalse("ServiceSettings","ExperimentalLdapGroupSync")),schema:{id:"Channels",component:Qb}},systemScheme:{url:"user_management/permissions/system_scheme",isHidden:Vg.isnt(Vg.licensed),schema:{id:"PermissionSystemScheme",component:xs}},teamSchemeDetail:{url:"user_management/permissions/team_override_scheme/:scheme_id",isHidden:Vg.either(Vg.isnt(Vg.licensed),Vg.isnt(Vg.licensedForFeature("CustomPermissionsSchemes"))),schema:{id:"PermissionSystemScheme",component:fl}},teamScheme:{url:"user_management/permissions/team_override_scheme",isHidden:Vg.either(Vg.isnt(Vg.licensed),Vg.isnt(Vg.licensedForFeature("CustomPermissionsSchemes"))),schema:{id:"PermissionSystemScheme",component:fl}},permissions:{url:"user_management/permissions/",title:Object(A.b)("admin.sidebar.permissions"),title_default:"Permissions",isHidden:Vg.isnt(Vg.licensed),searchableStrings:["admin.permissions.documentationLinkText","admin.permissions.teamOverrideSchemesNoSchemes","admin.permissions.loadMoreSchemes","admin.permissions.introBanner","admin.permissions.systemSchemeBannerTitle","admin.permissions.systemSchemeBannerText","admin.permissions.systemSchemeBannerButton","admin.permissions.teamOverrideSchemesTitle","admin.permissions.teamOverrideSchemesBannerText","admin.permissions.teamOverrideSchemesNewButton"],schema:{id:"PermissionSchemes",component:Ai}}},environment:{icon:"fa-server",sectionTitle:Object(A.b)("admin.sidebar.environment"),sectionTitleDefault:"Environment",web_server:{url:"environment/web_server",title:Object(A.b)("admin.sidebar.webServer"),title_default:"Web Server",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin"),schema:{id:"ServiceSettings",name:Object(A.b)("admin.environment.webServer"),name_default:"Web Server",settings:[{type:w.i.SettingsTypes.TYPE_BANNER,label:Object(A.b)("admin.rate.noteDescription"),label_default:"Changing properties in this section will require a server restart before taking effect.",banner_type:"info"},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ServiceSettings.SiteURL",label:Object(A.b)("admin.service.siteURL"),label_default:"Site URL:",help_text:Object(A.b)("admin.service.siteURLDescription"),help_text_default:"The URL that users will use to access Mattermost. Standard ports, such as 80 and 443, can be omitted, but non-standard ports are required. For example: http://example.com:8065. This setting is required.\n \nMattermost may be hosted at a subpath. For example: http://example.com:8065/company/mattermost. A restart is required before the server will work correctly.",help_text_markdown:!0,placeholder:Object(A.b)("admin.service.siteURLExample"),placeholder_default:'E.g.: "http://example.com:8065"'},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ServiceSettings.ListenAddress",label:Object(A.b)("admin.service.listenAddress"),label_default:"Listen Address:",placeholder:Object(A.b)("admin.service.listenExample"),placeholder_default:'E.g.: ":8065"',help_text:Object(A.b)("admin.service.listenDescription"),help_text_default:'The address and port to which to bind and listen. Specifying ":8065" will bind to all network interfaces. Specifying "127.0.0.1:8065" will only bind to the network interface having that IP address. If you choose a port of a lower level (called "system ports" or "well-known ports", in the range of 0-1023), you must have permissions to bind to that port. On Linux you can use: "sudo setcap cap_net_bind_service=+ep ./bin/mattermost" to allow Mattermost to bind to well-known ports.'},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.Forward80To443",label:Object(A.b)("admin.service.forward80To443"),label_default:"Forward port 80 to 443:",help_text:Object(A.b)("admin.service.forward80To443Description"),help_text_default:"Forwards all insecure traffic from port 80 to secure port 443. Not recommended when using a proxy server.",disabled_help_text:Object(A.b)("admin.service.forward80To443Description.disabled"),disabled_help_text_default:"Forwards all insecure traffic from port 80 to secure port 443. Not recommended when using a proxy server.\n \nThis setting cannot be enabled until your server is [listening](#ListenAddress) on port 443.",disabled_help_text_markdown:!0,isDisabled:Vg.isnt(Vg.stateMatches("ServiceSettings.ListenAddress",/:443$/))},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"ServiceSettings.ConnectionSecurity",label:Object(A.b)("admin.connectionSecurityTitle"),label_default:"Connection Security:",help_text:Fg,options:[{value:"",display_name:Object(A.b)("admin.connectionSecurityNone"),display_name_default:"None"},{value:"TLS",display_name:Object(A.b)("admin.connectionSecurityTls"),display_name_default:"TLS (Recommended)"}]},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ServiceSettings.TLSCertFile",label:Object(A.b)("admin.service.tlsCertFile"),label_default:"TLS Certificate File:",help_text:Object(A.b)("admin.service.tlsCertFileDescription"),help_text_default:"The certificate file to use.",isDisabled:Vg.stateIsTrue("ServiceSettings.UseLetsEncrypt")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ServiceSettings.TLSKeyFile",label:Object(A.b)("admin.service.tlsKeyFile"),label_default:"TLS Key File:",help_text:Object(A.b)("admin.service.tlsKeyFileDescription"),help_text_default:"The private key file to use.",isDisabled:Vg.stateIsTrue("ServiceSettings.UseLetsEncrypt")},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.UseLetsEncrypt",label:Object(A.b)("admin.service.useLetsEncrypt"),label_default:"Use Let's Encrypt:",help_text:Object(A.b)("admin.service.useLetsEncryptDescription"),help_text_default:"Enable the automatic retrieval of certificates from Let's Encrypt. The certificate will be retrieved when a client attempts to connect from a new domain. This will work with multiple domains.",disabled_help_text:Object(A.b)("admin.service.useLetsEncryptDescription.disabled"),disabled_help_text_default:"Enable the automatic retrieval of certificates from Let's Encrypt. The certificate will be retrieved when a client attempts to connect from a new domain. This will work with multiple domains.\n \nThis setting cannot be enabled unless the [Forward port 80 to 443](#Forward80To443) setting is set to true.",disabled_help_text_markdown:!0,isDisabled:Vg.stateIsFalse("ServiceSettings.Forward80To443")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ServiceSettings.LetsEncryptCertificateCacheFile",label:Object(A.b)("admin.service.letsEncryptCertificateCacheFile"),label_default:"Let's Encrypt Certificate Cache File:",help_text:Object(A.b)("admin.service.letsEncryptCertificateCacheFileDescription"),help_text_default:"Certificates retrieved and other data about the Let's Encrypt service will be stored in this file.",isDisabled:Vg.stateIsFalse("ServiceSettings.UseLetsEncrypt")},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"ServiceSettings.ReadTimeout",label:Object(A.b)("admin.service.readTimeout"),label_default:"Read Timeout:",help_text:Object(A.b)("admin.service.readTimeoutDescription"),help_text_default:"Maximum time allowed from when the connection is accepted to when the request body is fully read."},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"ServiceSettings.WriteTimeout",label:Object(A.b)("admin.service.writeTimeout"),label_default:"Write Timeout:",help_text:Object(A.b)("admin.service.writeTimeoutDescription"),help_text_default:"If using HTTP (insecure), this is the maximum time allowed from the end of reading the request headers until the response is written. If using HTTPS, it is the total time from when the connection is accepted until the response is written."},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"ServiceSettings.WebserverMode",label:Object(A.b)("admin.webserverModeTitle"),label_default:"Webserver Mode:",help_text:Gg,options:[{value:"gzip",display_name:Object(A.b)("admin.webserverModeGzip"),display_name_default:"gzip"},{value:"uncompressed",display_name:Object(A.b)("admin.webserverModeUncompressed"),display_name_default:"Uncompressed"},{value:"disabled",display_name:Object(A.b)("admin.webserverModeDisabled"),display_name_default:"Disabled"}]},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableInsecureOutgoingConnections",label:Object(A.b)("admin.service.insecureTlsTitle"),label_default:"Enable Insecure Outgoing Connections: ",help_text:Object(A.b)("admin.service.insecureTlsDesc"),help_text_default:"When true, any outgoing HTTPS requests will accept unverified, self-signed certificates. For example, outgoing webhooks to a server with a self-signed TLS certificate, using any domain, will be allowed. Note that this makes these connections susceptible to man-in-the-middle attacks."},{type:w.i.SettingsTypes.TYPE_BUTTON,action:d.x,key:"ReloadConfigButton",label:Object(A.b)("admin.reload.button"),label_default:"Reload Configuration From Disk",help_text:Object(A.b)("admin.reload.reloadDescription"),help_text_default:'Deployments using multiple databases can switch from one master database to another without restarting the Mattermost server by updating "config.json" to the new desired configuration and using the {featureName} feature to load the new settings while the server is running. The administrator should then use the {recycleDatabaseConnections} feature to recycle the database connections based on the new settings.',help_text_values:{featureName:g.a.createElement("b",null,g.a.createElement(E.c,{id:"admin.reload.reloadDescription.featureName",defaultMessage:"Reload Configuration from Disk"})),recycleDatabaseConnections:g.a.createElement("a",{href:"../environment/database"},g.a.createElement("b",null,g.a.createElement(E.c,{id:"admin.reload.reloadDescription.recycleDatabaseConnections",defaultMessage:"Environment > Database > Recycle Database Connections"})))},error_message:Object(A.b)("admin.reload.reloadFail"),error_message_default:"Reload unsuccessful: {error}"},{type:w.i.SettingsTypes.TYPE_BUTTON,key:"PurgeButton",action:d.s,label:Object(A.b)("admin.purge.button"),label_default:"Purge All Caches",help_text:Object(A.b)("admin.purge.purgeDescription"),help_text_default:"This will purge all the in-memory caches for things like sessions, accounts, channels, etc. Deployments using High Availability will attempt to purge all the servers in the cluster.  Purging the caches may adversely impact performance.",error_message:Object(A.b)("admin.purge.purgeFail"),error_message_default:"Purging unsuccessful: {error}"}]}},database:{url:"environment/database",title:Object(A.b)("admin.sidebar.database"),title_default:"Database",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin"),searchableStrings:["admin.database.title",["admin.recycle.recycleDescription",{featureName:"",reloadConfiguration:""}],"admin.recycle.recycleDescription.featureName","admin.recycle.recycleDescription.reloadConfiguration","admin.recycle.button","admin.sql.noteDescription","admin.sql.driverName","admin.sql.driverNameDescription","admin.sql.dataSource","admin.sql.dataSourceDescription","admin.sql.maxConnectionsTitle","admin.sql.maxConnectionsDescription","admin.sql.maxOpenTitle","admin.sql.maxOpenDescription","admin.sql.queryTimeoutTitle","admin.sql.queryTimeoutDescription","admin.sql.connMaxLifetimeTitle","admin.sql.connMaxLifetimeDescription","admin.sql.traceTitle","admin.sql.traceDescription"],schema:{id:"DatabaseSettings",component:Jh}},elasticsearch:{url:"environment/elasticsearch",title:Object(A.b)("admin.sidebar.elasticsearch"),title_default:"Elasticsearch",isHidden:Vg.either(Vg.isnt(Vg.licensedForFeature("Elasticsearch")),Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin")),searchableStrings:["admin.elasticsearch.title","admin.elasticsearch.enableIndexingTitle",["admin.elasticsearch.enableIndexingDescription",{documentationLink:""}],"admin.elasticsearch.enableIndexingDescription.documentationLinkText","admin.elasticsearch.connectionUrlTitle",["admin.elasticsearch.connectionUrlDescription",{documentationLink:""}],"admin.elasticsearch.connectionUrlExample.documentationLinkText","admin.elasticsearch.skipTLSVerificationTitle","admin.elasticsearch.skipTLSVerificationDescription","admin.elasticsearch.usernameTitle","admin.elasticsearch.usernameDescription","admin.elasticsearch.passwordTitle","admin.elasticsearch.passwordDescription","admin.elasticsearch.sniffTitle","admin.elasticsearch.sniffDescription","admin.elasticsearch.testHelpText","admin.elasticsearch.elasticsearch_test_button","admin.elasticsearch.bulkIndexingTitle","admin.elasticsearch.createJob.help","admin.elasticsearch.purgeIndexesHelpText","admin.elasticsearch.purgeIndexesButton","admin.elasticsearch.purgeIndexesButton.label","admin.elasticsearch.enableSearchingTitle","admin.elasticsearch.enableSearchingDescription"],schema:{id:"ElasticSearchSettings",component:tg}},storage:{url:"environment/file_storage",title:Object(A.b)("admin.sidebar.fileStorage"),title_default:"File Storage",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin"),schema:{id:"FileSettings",name:Object(A.b)("admin.environment.fileStorage"),name_default:"File Storage",settings:[{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"FileSettings.DriverName",label:Object(A.b)("admin.image.storeTitle"),label_default:"File Storage System:",help_text:Object(A.b)("admin.image.storeDescription"),help_text_default:'Storage system where files and image attachments are saved.\n \nSelecting "Amazon S3" enables fields to enter your Amazon credentials and bucket details.\n \nSelecting "Local File System" enables the field to specify a local file directory.',help_text_markdown:!0,options:[{value:"local",display_name:Object(A.b)("admin.image.storeLocal"),display_name_default:"Local File System"},{value:"amazons3",display_name:Object(A.b)("admin.image.storeAmazonS3"),display_name_default:"Amazon S3"}]},{type:w.i.SettingsTypes.TYPE_TEXT,key:"FileSettings.Directory",label:Object(A.b)("admin.image.localTitle"),label_default:"Local Storage Directory:",help_text:Object(A.b)("admin.image.localDescription"),help_text_default:"Directory to which files and images are written. If blank, defaults to ./data/.",placeholder:Object(A.b)("admin.image.localExample"),placeholder_default:'E.g.: "./data/"',isDisabled:Vg.isnt(Vg.stateEquals("FileSettings.DriverName","local"))},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"FileSettings.MaxFileSize",label:Object(A.b)("admin.image.maxFileSizeTitle"),label_default:"Maximum File Size:",help_text:Object(A.b)("admin.image.maxFileSizeDescription"),help_text_default:"Maximum file size for message attachments in megabytes. Caution: Verify server memory can support your setting choice. Large file sizes increase the risk of server crashes and failed uploads due to network interruptions.",placeholder:Object(A.b)("admin.image.maxFileSizeExample"),placeholder_default:"50",onConfigLoad:function(e){return e/zg},onConfigSave:function(e){return e*zg}},{type:w.i.SettingsTypes.TYPE_TEXT,key:"FileSettings.AmazonS3Bucket",label:Object(A.b)("admin.image.amazonS3BucketTitle"),label_default:"Amazon S3 Bucket:",help_text:Object(A.b)("admin.image.amazonS3BucketDescription"),help_text_default:"Name you selected for your S3 bucket in AWS.",placeholder:Object(A.b)("admin.image.amazonS3BucketExample"),placeholder_default:'E.g.: "mattermost-media"',isDisabled:Vg.isnt(Vg.stateEquals("FileSettings.DriverName","amazons3"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"FileSettings.AmazonS3Region",label:Object(A.b)("admin.image.amazonS3RegionTitle"),label_default:"Amazon S3 Region:",help_text:Object(A.b)("admin.image.amazonS3RegionDescription"),help_text_default:'AWS region you selected when creating your S3 bucket. If no region is set, Mattermost attempts to get the appropriate region from AWS, or sets it to "us-east-1" if none found.',placeholder:Object(A.b)("admin.image.amazonS3RegionExample"),placeholder_default:'E.g.: "us-east-1"',isDisabled:Vg.isnt(Vg.stateEquals("FileSettings.DriverName","amazons3"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"FileSettings.AmazonS3AccessKeyId",label:Object(A.b)("admin.image.amazonS3IdTitle"),label_default:"Amazon S3 Access Key ID:",help_text:Object(A.b)("admin.image.amazonS3IdDescription"),help_text_markdown:!0,help_text_default:"(Optional) Only required if you do not want to authenticate to S3 using an [IAM role](!https://about.mattermost.com/default-iam-role). Enter the Access Key ID provided by your Amazon EC2 administrator.",placeholder:Object(A.b)("admin.image.amazonS3IdExample"),placeholder_default:'E.g.: "AKIADTOVBGERKLCBV"',isDisabled:Vg.isnt(Vg.stateEquals("FileSettings.DriverName","amazons3"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"FileSettings.AmazonS3Endpoint",label:Object(A.b)("admin.image.amazonS3EndpointTitle"),label_default:"Amazon S3 Endpoint:",help_text:Object(A.b)("admin.image.amazonS3EndpointDescription"),help_text_default:'Hostname of your S3 Compatible Storage provider. Defaults to "s3.amazonaws.com".',placeholder:Object(A.b)("admin.image.amazonS3EndpointExample"),placeholder_default:'E.g.: "s3.amazonaws.com"',isDisabled:Vg.isnt(Vg.stateEquals("FileSettings.DriverName","amazons3"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"FileSettings.AmazonS3SecretAccessKey",label:Object(A.b)("admin.image.amazonS3SecretTitle"),label_default:"Amazon S3 Secret Access Key:",help_text:Object(A.b)("admin.image.amazonS3SecretDescription"),help_text_default:"(Optional) The secret access key associated with your Amazon S3 Access Key ID.",placeholder:Object(A.b)("admin.image.amazonS3SecretExample"),placeholder_default:'E.g.: "jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY"',isDisabled:Vg.isnt(Vg.stateEquals("FileSettings.DriverName","amazons3"))},{type:w.i.SettingsTypes.TYPE_BOOL,key:"FileSettings.AmazonS3SSL",label:Object(A.b)("admin.image.amazonS3SSLTitle"),label_default:"Enable Secure Amazon S3 Connections:",help_text:Object(A.b)("admin.image.amazonS3SSLDescription"),help_text_default:"When false, allow insecure connections to Amazon S3. Defaults to secure connections only.",isDisabled:Vg.isnt(Vg.stateEquals("FileSettings.DriverName","amazons3"))},{type:w.i.SettingsTypes.TYPE_BOOL,key:"FileSettings.AmazonS3SSE",label:Object(A.b)("admin.image.amazonS3SSETitle"),label_default:"Enable Server-Side Encryption for Amazon S3:",help_text:Object(A.b)("admin.image.amazonS3SSEDescription"),help_text_markdown:!0,help_text_default:"When true, encrypt files in Amazon S3 using server-side encryption with Amazon S3-managed keys. See [documentation](!https://about.mattermost.com/default-server-side-encryption) to learn more.",isHidden:Vg.isnt(Vg.licensedForFeature("Compliance")),isDisabled:Vg.isnt(Vg.stateEquals("FileSettings.DriverName","amazons3"))},{type:w.i.SettingsTypes.TYPE_BOOL,key:"FileSettings.AmazonS3Trace",label:Object(A.b)("admin.image.amazonS3TraceTitle"),label_default:"Enable Amazon S3 Debugging:",help_text:Object(A.b)("admin.image.amazonS3TraceDescription"),help_text_default:"(Development Mode) When true, log additional debugging information to the system logs.",isDisabled:Vg.isnt(Vg.stateEquals("FileSettings.DriverName","amazons3"))},{type:w.i.SettingsTypes.TYPE_BUTTON,action:d.D,key:"TestS3Connection",label:Object(A.b)("admin.s3.connectionS3Test"),label_default:"Test Connection",loading:Object(A.b)("admin.s3.testing"),loading_default:"Testing...",error_message:Object(A.b)("admin.s3.s3Fail"),error_message_default:"Connection unsuccessful: {error}",success_message:Object(A.b)("admin.s3.s3Success"),success_message_default:"Connection was successful"}]}},image_proxy:{url:"environment/image_proxy",title:Object(A.b)("admin.sidebar.imageProxy"),title_default:"Image Proxy",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin"),schema:{id:"ImageProxy",name:Object(A.b)("admin.environment.imageProxy"),name_default:"Image Proxy",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"ImageProxySettings.Enable",label:Object(A.b)("admin.image.enableProxy"),label_default:"Enable Image Proxy:",help_text:Object(A.b)("admin.image.enableProxyDescription"),help_text_default:"When true, enables an image proxy for loading all Markdown images."},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"ImageProxySettings.ImageProxyType",label:Object(A.b)("admin.image.proxyType"),label_default:"Image Proxy Type:",help_text:Object(A.b)("admin.image.proxyTypeDescription"),help_text_default:"Configure an image proxy to load all Markdown images through a proxy. The image proxy prevents users from making insecure image requests, provides caching for increased performance, and automates image adjustments such as resizing. See [documentation](!https://about.mattermost.com/default-image-proxy-documentation) to learn more.",help_text_markdown:!0,options:[{value:"atmos/camo",display_name:Object(A.b)("atmos/camo"),display_name_default:"atmos/camo"},{value:"local",display_name:Object(A.b)("local"),display_name_default:"local"}],isDisabled:Vg.stateIsFalse("ImageProxySettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ImageProxySettings.RemoteImageProxyURL",label:Object(A.b)("admin.image.proxyURL"),label_default:"Remote Image Proxy URL:",help_text:Object(A.b)("admin.image.proxyURLDescription"),help_text_default:"URL of your remote image proxy server.",isDisabled:Vg.either(Vg.stateIsFalse("ImageProxySettings.Enable"),Vg.stateEquals("ImageProxySettings.ImageProxyType","local"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ImageProxySettings.RemoteImageProxyOptions",label:Object(A.b)("admin.image.proxyOptions"),label_default:"Remote Image Proxy Options:",help_text:Object(A.b)("admin.image.proxyOptionsDescription"),help_text_default:"Additional options such as the URL signing key. Refer to your image proxy documentation to learn more about what options are supported.",isDisabled:Vg.either(Vg.stateIsFalse("ImageProxySettings.Enable"),Vg.stateEquals("ImageProxySettings.ImageProxyType","local"))}]}},smtp:{url:"environment/smtp",title:Object(A.b)("admin.sidebar.smtp"),title_default:"SMTP",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin"),schema:{id:"SMTP",name:Object(A.b)("admin.environment.smtp"),name_default:"SMTP",settings:[{type:w.i.SettingsTypes.TYPE_TEXT,key:"EmailSettings.SMTPServer",label:Object(A.b)("admin.environment.smtp.smtpServer.title"),label_default:"SMTP Server:",placeholder:Object(A.b)("admin.environment.smtp.smtpServer.placeholder"),placeholder_default:'Ex: "smtp.yourcompany.com", "email-smtp.us-east-1.amazonaws.com"',help_text:Object(A.b)("admin.environment.smtp.smtpServer.description"),help_text_default:"Location of SMTP email server."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"EmailSettings.SMTPPort",label:Object(A.b)("admin.environment.smtp.smtpPort.title"),label_default:"SMTP Server Port:",placeholder:Object(A.b)("admin.environment.smtp.smtpPort.placeholder"),placeholder_default:'Ex: "25", "465", "587"',help_text:Object(A.b)("admin.environment.smtp.smtpPort.description"),help_text_default:"Port of SMTP email server."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"EmailSettings.EnableSMTPAuth",label:Object(A.b)("admin.environment.smtp.smtpAuth.title"),label_default:"Enable SMTP Authentication:",help_text:Object(A.b)("admin.environment.smtp.smtpAuth.description"),help_text_default:"When true, SMTP Authentication is enabled."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"EmailSettings.SMTPUsername",label:Object(A.b)("admin.environment.smtp.smtpUsername.title"),label_default:"SMTP Server Username:",placeholder:Object(A.b)("admin.environment.smtp.smtpUsername.placeholder"),placeholder_default:'Ex: "admin@yourcompany.com", "AKIADTOVBGERKLCBV"',help_text:Object(A.b)("admin.environment.smtp.smtpUsername.description"),help_text_default:"Obtain this credential from administrator setting up your email server.",isDisabled:Vg.stateIsFalse("EmailSettings.EnableSMTPAuth")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"EmailSettings.SMTPPassword",label:Object(A.b)("admin.environment.smtp.smtpPassword.title"),label_default:"SMTP Server Password:",placeholder:Object(A.b)("admin.environment.smtp.smtpPassword.placeholder"),placeholder_default:'Ex: "yourpassword", "jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY"',help_text:Object(A.b)("admin.environment.smtp.smtpPassword.description"),help_text_default:"Obtain this credential from administrator setting up your email server.",isDisabled:Vg.stateIsFalse("EmailSettings.EnableSMTPAuth")},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"EmailSettings.ConnectionSecurity",label:Object(A.b)("admin.environment.smtp.connectionSecurity.title"),label_default:"Connection Security:",help_text:qg,options:[{value:"",display_name:Object(A.b)("admin.environment.smtp.connectionSecurity.option.none"),display_name_default:"None"},{value:"TLS",display_name:Object(A.b)("admin.environment.smtp.connectionSecurity.option.tls"),display_name_default:"TLS (Recommended)"},{value:"STARTTLS",display_name:Object(A.b)("admin.environment.smtp.connectionSecurity.option.starttls"),display_name_default:"STARTTLS"}]},{type:w.i.SettingsTypes.TYPE_BUTTON,action:d.E,key:"TestSmtpConnection",label:Object(A.b)("admin.environment.smtp.connectionSmtpTest"),label_default:"Test Connection",loading:Object(A.b)("admin.environment.smtp.testing"),loading_default:"Testing...",error_message:Object(A.b)("admin.environment.smtp.smtpFail"),error_message_default:"Connection unsuccessful: {error}",success_message:Object(A.b)("admin.environment.smtp.smtpSuccess"),success_message_default:"No errors were reported while sending an email. Please check your inbox to make sure."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"EmailSettings.SkipServerCertificateVerification",label:Object(A.b)("admin.environment.smtp.skipServerCertificateVerification.title"),label_default:"Skip Server Certificate Verification:",help_text:Object(A.b)("admin.environment.smtp.skipServerCertificateVerification.description"),help_text_default:"When true, Mattermost will not verify the email server certificate."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableSecurityFixAlert",label:Object(A.b)("admin.environment.smtp.enableSecurityFixAlert.title"),label_default:"Enable Security Alerts:",help_text:Object(A.b)("admin.environment.smtp.enableSecurityFixAlert.description"),help_text_default:"When true, System Administrators are notified by email if a relevant security fix alert has been announced in the last 12 hours. Requires email to be enabled."}]}},push_notification_server:{url:"environment/push_notification_server",title:Object(A.b)("admin.sidebar.pushNotificationServer"),title_default:"Push Notification Server",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin"),searchableStrings:["admin.environment.pushNotificationServer","admin.email.pushTitle","admin.email.pushServerTitle","admin.email.pushContentTitle","admin.email.pushContentDesc"],schema:{id:"PushNotificationsSettings",component:xh}},high_availability:{url:"environment/high_availability",title:Object(A.b)("admin.sidebar.highAvailability"),title_default:"High Availability",isHidden:Vg.either(Vg.isnt(Vg.licensedForFeature("Cluster")),Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin")),searchableStrings:["admin.advance.cluster","admin.cluster.noteDescription","admin.cluster.enableTitle","admin.cluster.enableDescription","admin.cluster.ClusterName","admin.cluster.ClusterNameDesc","admin.cluster.OverrideHostname","admin.cluster.OverrideHostnameDesc","admin.cluster.UseIpAddress","admin.cluster.UseIpAddressDesc","admin.cluster.UseExperimentalGossip","admin.cluster.UseExperimentalGossipDesc","admin.cluster.GossipPort","admin.cluster.GossipPortDesc","admin.cluster.StreamingPort","admin.cluster.StreamingPortDesc"],schema:{id:"ClusterSettings",component:Tg}},rate_limiting:{url:"environment/rate_limiting",title:Object(A.b)("admin.sidebar.rateLimiting"),title_default:"Rate Limiting",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin"),schema:{id:"ServiceSettings",name:Object(A.b)("admin.rate.title"),name_default:"Rate Limiting",settings:[{type:w.i.SettingsTypes.TYPE_BANNER,label:Object(A.b)("admin.rate.noteDescription"),label_default:"Changing properties other than Site URL in this section will require a server restart before taking effect.",banner_type:"info"},{type:w.i.SettingsTypes.TYPE_BOOL,key:"RateLimitSettings.Enable",label:Object(A.b)("admin.rate.enableLimiterTitle"),label_default:"Enable Rate Limiting:",help_text:Object(A.b)("admin.rate.enableLimiterDescription"),help_text_default:"When true, APIs are throttled at rates specified below."},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"RateLimitSettings.PerSec",label:Object(A.b)("admin.rate.queriesTitle"),label_default:"Maximum Queries per Second:",placeholder:Object(A.b)("admin.rate.queriesExample"),placeholder_default:'E.g.: "10"',help_text:Object(A.b)("admin.rate.queriesDescription"),help_text_default:"Throttles API at this number of requests per second.",isDisabled:Vg.stateEquals("RateLimitSettings.Enable",!1)},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"RateLimitSettings.MaxBurst",label:Object(A.b)("admin.rate.maxBurst"),label_default:"Maximum Burst Size:",placeholder:Object(A.b)("admin.rate.maxBurstExample"),placeholder_default:'E.g.: "100"',help_text:Object(A.b)("admin.rate.maxBurstDescription"),help_text_default:"Maximum number of requests allowed beyond the per second query limit.",isDisabled:Vg.stateEquals("RateLimitSettings.Enable",!1)},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"RateLimitSettings.MemoryStoreSize",label:Object(A.b)("admin.rate.memoryTitle"),label_default:"Memory Store Size:",placeholder:Object(A.b)("admin.rate.memoryExample"),placeholder_default:'E.g.: "10000"',help_text:Object(A.b)("admin.rate.memoryDescription"),help_text_default:'Maximum number of users sessions connected to the system as determined by "Vary rate limit by remote address" and "Vary rate limit by HTTP header".',isDisabled:Vg.stateEquals("RateLimitSettings.Enable",!1)},{type:w.i.SettingsTypes.TYPE_BOOL,key:"RateLimitSettings.VaryByRemoteAddr",label:Object(A.b)("admin.rate.remoteTitle"),label_default:"Vary rate limit by remote address:",help_text:Object(A.b)("admin.rate.remoteDescription"),help_text_default:"When true, rate limit API access by IP address.",isDisabled:Vg.stateEquals("RateLimitSettings.Enable",!1)},{type:w.i.SettingsTypes.TYPE_BOOL,key:"RateLimitSettings.VaryByUser",label:Object(A.b)("admin.rate.varyByUser"),label_default:"Vary rate limit by user:",help_text:Object(A.b)("admin.rate.varyByUserDescription"),help_text_default:"When true, rate limit API access by user athentication token.",isDisabled:Vg.stateEquals("RateLimitSettings.Enable",!1)},{type:w.i.SettingsTypes.TYPE_TEXT,key:"RateLimitSettings.VaryByHeader",label:Object(A.b)("admin.rate.httpHeaderTitle"),label_default:"Vary rate limit by HTTP header:",placeholder:Object(A.b)("admin.rate.httpHeaderExample"),placeholder_default:'E.g.: "X-Real-IP", "X-Forwarded-For"',help_text:Object(A.b)("admin.rate.httpHeaderDescription"),help_text_default:'When filled in, vary rate limiting by HTTP header field specified (e.g. when configuring NGINX set to "X-Real-IP", when configuring AmazonELB set to "X-Forwarded-For").',isDisabled:Vg.either(Vg.stateEquals("RateLimitSettings.Enable",!1),Vg.stateEquals("RateLimitSettings.VaryByRemoteAddr",!0))}]}},logging:{url:"environment/logging",title:Object(A.b)("admin.sidebar.logging"),title_default:"Logging",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin"),schema:{id:"LogSettings",name:Object(A.b)("admin.general.log"),name_default:"Logging",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"LogSettings.EnableConsole",label:Object(A.b)("admin.log.consoleTitle"),label_default:"Output logs to console: ",help_text:Object(A.b)("admin.log.consoleDescription"),help_text_default:"Typically set to false in production. Developers may set this field to true to output log messages to console based on the console level option.  If true, server writes messages to the standard output stream (stdout). Changing this setting requires a server restart before taking effect."},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"LogSettings.ConsoleLevel",label:Object(A.b)("admin.log.levelTitle"),label_default:"Console Log Level:",help_text:Object(A.b)("admin.log.levelDescription"),help_text_default:"This setting determines the level of detail at which log events are written to the console. ERROR: Outputs only error messages. INFO: Outputs error messages and information around startup and initialization. DEBUG: Prints high detail for developers working on debugging issues.",options:Hg,isDisabled:Vg.stateIsFalse("LogSettings.EnableConsole")},{type:w.i.SettingsTypes.TYPE_BOOL,key:"LogSettings.ConsoleJson",label:Object(A.b)("admin.log.consoleJsonTitle"),label_default:"Output console logs as JSON:",help_text:Object(A.b)("admin.log.jsonDescription"),help_text_default:"When true, logged events are written in a machine readable JSON format. Otherwise they are printed as plain text. Changing this setting requires a server restart before taking effect.",isDisabled:Vg.stateIsFalse("LogSettings.EnableConsole")},{type:w.i.SettingsTypes.TYPE_BOOL,key:"LogSettings.EnableFile",label:Object(A.b)("admin.log.fileTitle"),label_default:"Output logs to file: ",help_text:Object(A.b)("admin.log.fileDescription"),help_text_default:"Typically set to true in production. When true, logged events are written to the mattermost.log file in the directory specified in the File Log Directory field. The logs are rotated at 10,000 lines and archived to a file in the same directory, and given a name with a datestamp and serial number. For example, mattermost.2017-03-31.001. Changing this setting requires a server restart before taking effect."},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"LogSettings.FileLevel",label:Object(A.b)("admin.log.fileLevelTitle"),label_default:"File Log Level:",help_text:Object(A.b)("admin.log.fileLevelDescription"),help_text_default:"This setting determines the level of detail at which log events are written to the log file. ERROR: Outputs only error messages. INFO: Outputs error messages and information around startup and initialization. DEBUG: Prints high detail for developers working on debugging issues.",options:Hg,isDisabled:Vg.stateIsFalse("LogSettings.EnableFile")},{type:w.i.SettingsTypes.TYPE_BOOL,key:"LogSettings.FileJson",label:Object(A.b)("admin.log.fileJsonTitle"),label_default:"Output file logs as JSON:",help_text:Object(A.b)("admin.log.jsonDescription"),help_text_default:"When true, logged events are written in a machine readable JSON format. Otherwise they are printed as plain text. Changing this setting requires a server restart before taking effect.",isDisabled:Vg.stateIsFalse("LogSettings.EnableFile")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LogSettings.FileLocation",label:Object(A.b)("admin.log.locationTitle"),label_default:"File Log Directory:",help_text:Object(A.b)("admin.log.locationDescription"),help_text_default:"The location of the log files. If blank, they are stored in the ./logs directory. The path that you set must exist and Mattermost must have write permissions in it. Changing this setting requires a server restart before taking effect.",placeholder:Object(A.b)("admin.log.locationPlaceholder"),placeholder_default:"Enter your file location",isDisabled:Vg.stateIsFalse("LogSettings.EnableFile")},{type:w.i.SettingsTypes.TYPE_BOOL,key:"LogSettings.EnableWebhookDebugging",label:Object(A.b)("admin.log.enableWebhookDebugging"),label_default:"Enable Webhook Debugging:",help_text:Object(A.b)("admin.log.enableWebhookDebuggingDescription"),help_text_default:'When true, sends webhook debug messages to the server logs. To also output the request body of incoming webhooks, set {boldedLogLevel} to "DEBUG".',help_text_values:{boldedLogLevel:g.a.createElement("strong",null,g.a.createElement(E.c,{id:"admin.log.logLevel",defaultMessage:"Log Level"}))}},{type:w.i.SettingsTypes.TYPE_BOOL,key:"LogSettings.EnableDiagnostics",label:Object(A.b)("admin.log.enableDiagnostics"),label_default:"Enable Diagnostics and Error Reporting:",help_text:Object(A.b)("admin.log.enableDiagnosticsDescription"),help_text_default:"Enable this feature to improve the quality and performance of Mattermost by sending error reporting and diagnostic information to Mattermost, Inc. Read our [privacy policy](!https://about.mattermost.com/default-privacy-policy/) to learn more.",help_text_markdown:!0,onConfigSave:function(e,t){return t&&t!==e&&Object(hr.d)("ui","diagnostics_disabled"),e}}]}},session_lengths:{url:"environment/session_lengths",title:Object(A.b)("admin.sidebar.sessionLengths"),title_default:"Session Lengths",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin"),schema:{id:"SessionLengths",name:Object(A.b)("admin.environment.sessionLengths"),name_default:"Session Lengths",settings:[{type:w.i.SettingsTypes.TYPE_NUMBER,key:"ServiceSettings.SessionLengthWebInDays",label:Object(A.b)("admin.service.webSessionDays"),label_default:"Session Length AD/LDAP and Email (days):",help_text:Object(A.b)("admin.service.webSessionDaysDesc"),help_text_default:"The number of days from the last time a user entered their credentials to the expiry of the users session. After changing this setting, the new session length will take effect after the next time the user enters their credentials.",placeholder:Object(A.b)("admin.service.sessionDaysEx"),placeholder_default:'E.g.: "30"'},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"ServiceSettings.SessionLengthMobileInDays",label:Object(A.b)("admin.service.mobileSessionDays"),label_default:"Session Length Mobile (days):",help_text:Object(A.b)("admin.service.mobileSessionDaysDesc"),help_text_default:"The number of days from the last time a user entered their credentials to the expiry of the users session. After changing this setting, the new session length will take effect after the next time the user enters their credentials.",placeholder:Object(A.b)("admin.service.sessionDaysEx"),placeholder_default:'E.g.: "30"'},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"ServiceSettings.SessionLengthSSOInDays",label:Object(A.b)("admin.service.ssoSessionDays"),label_default:"Session Length SSO (days):",help_text:Object(A.b)("admin.service.ssoSessionDaysDesc"),help_text_default:"The number of days from the last time a user entered their credentials to the expiry of the users session. If the authentication method is SAML or GitLab, the user may automatically be logged back in to Mattermost if they are already logged in to SAML or GitLab. After changing this setting, the setting will take effect after the next time the user enters their credentials.",placeholder:Object(A.b)("admin.service.sessionDaysEx"),placeholder_default:'E.g.: "30"'},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"ServiceSettings.SessionCacheInMinutes",label:Object(A.b)("admin.service.sessionCache"),label_default:"Session Cache (minutes):",help_text:Object(A.b)("admin.service.sessionCacheDesc"),help_text_default:"The number of minutes to cache a session in memory.",placeholder:Object(A.b)("admin.service.sessionDaysEx"),placeholder_default:'E.g.: "30"'},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"ServiceSettings.SessionIdleTimeoutInMinutes",label:Object(A.b)("admin.service.sessionIdleTimeout"),label_default:"Session Idle Timeout (minutes):",help_text:Object(A.b)("admin.service.sessionIdleTimeoutDesc"),help_text_default:"The number of minutes from the last time a user was active on the system to the expiry of the user's session. Once expired, the user will need to log in to continue. Minimum is 5 minutes, and 0 is unlimited.\n \nApplies to the desktop app and browsers. For mobile apps, use an EMM provider to lock the app when not in use. In High Availability mode, enable IP hash load balancing for reliable timeout measurement.",help_text_markdown:!0,placeholder:Object(A.b)("admin.service.sessionIdleTimeoutEx"),placeholder_default:'E.g.: "60"',isHidden:Vg.isnt(Vg.licensedForFeature("Compliance")),onConfigSave:function(e){return 0!==e&&e<5?5:e}}]}},metrics:{url:"environment/performance_monitoring",title:Object(A.b)("admin.sidebar.metrics"),title_default:"Performance Monitoring",isHidden:Vg.either(Vg.isnt(Vg.licensedForFeature("Metrics")),Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin")),schema:{id:"MetricsSettings",name:Object(A.b)("admin.advance.metrics"),name_default:"Performance Monitoring",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"MetricsSettings.Enable",label:Object(A.b)("admin.metrics.enableTitle"),label_default:"Enable Performance Monitoring:",help_text:Object(A.b)("admin.metrics.enableDescription"),help_text_default:"When true, Mattermost will enable performance monitoring collection and profiling. Please see [documentation](!http://docs.mattermost.com/deployment/metrics.html) to learn more about configuring performance monitoring for Mattermost.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_TEXT,key:"MetricsSettings.ListenAddress",label:Object(A.b)("admin.metrics.listenAddressTitle"),label_default:"Listen Address:",placeholder:Object(A.b)("admin.metrics.listenAddressEx"),placeholder_default:'E.g.: ":8067"',help_text:Object(A.b)("admin.metrics.listenAddressDesc"),help_text_default:"The address the server will listen on to expose performance metrics."}]}},developer:{url:"environment/developer",title:Object(A.b)("admin.sidebar.developer"),title_default:"Developer",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin"),schema:{id:"ServiceSettings",name:Object(A.b)("admin.developer.title"),name_default:"Developer Settings",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableTesting",label:Object(A.b)("admin.service.testingTitle"),label_default:"Enable Testing Commands:",help_text:Object(A.b)("admin.service.testingDescription"),help_text_default:"When true, /test slash command is enabled to load test accounts, data and text formatting. Changing this requires a server restart before taking effect."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableDeveloper",label:Object(A.b)("admin.service.developerTitle"),label_default:"Enable Developer Mode: ",help_text:Object(A.b)("admin.service.developerDesc"),help_text_default:"When true, JavaScript errors are shown in a purple bar at the top of the user interface. Not recommended for use in production."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ServiceSettings.AllowedUntrustedInternalConnections",label:Object(A.b)("admin.service.internalConnectionsTitle"),label_default:"Allow untrusted internal connections to: ",placeholder:Object(A.b)("admin.service.internalConnectionsEx"),placeholder_default:"webhooks.internal.example.com 127.0.0.1 10.0.16.0/28",help_text:Object(A.b)("admin.service.internalConnectionsDesc"),help_text_default:"A whitelist of local network addresses that can be requested by the Mattermost server on behalf of a client. Care should be used when configuring this setting to prevent unintended access to your local network. See [documentation](https://mattermost.com/pl/default-allow-untrusted-internal-connections) to learn more.",help_text_markdown:!0}]}}},site:{icon:"fa-cogs",sectionTitle:Object(A.b)("admin.sidebar.site"),sectionTitleDefault:"Site Configuration",customization:{url:"site_config/customization",title:Object(A.b)("admin.sidebar.customization"),title_default:"Customization",schema:{id:"Customization",name:Object(A.b)("admin.site.customization"),name_default:"Customization",settings:[{type:w.i.SettingsTypes.TYPE_TEXT,key:"TeamSettings.SiteName",label:Object(A.b)("admin.team.siteNameTitle"),label_default:"Site Name:",help_text:Object(A.b)("admin.team.siteNameDescription"),help_text_default:'Name of service shown in login screens and UI. When not specified, it defaults to "Mattermost".',placeholder:Object(A.b)("admin.team.siteNameExample"),placeholder_default:'E.g.: "Mattermost"',max_length:w.i.MAX_SITENAME_LENGTH},{type:w.i.SettingsTypes.TYPE_TEXT,key:"TeamSettings.CustomDescriptionText",label:Object(A.b)("admin.team.brandDescriptionTitle"),label_default:"Site Description: ",help_text:Object(A.b)("admin.team.brandDescriptionHelp"),help_text_default:'Description of service shown in login screens and UI. When not specified, "All team communication in one place, searchable and accessible anywhere" is displayed.',placeholder:Object(A.b)("web.root.signup_info"),placeholder_default:"All team communication in one place, searchable and accessible anywhere"},{type:w.i.SettingsTypes.TYPE_BOOL,key:"TeamSettings.EnableCustomBrand",label:Object(A.b)("admin.team.brandTitle"),label_default:"Enable Custom Branding: ",help_text:Object(A.b)("admin.team.brandDesc"),help_text_default:"Enable custom branding to show an image of your choice, uploaded below, and some help text, written below, on the login page."},{type:w.i.SettingsTypes.TYPE_CUSTOM,component:Pm,isDisabled:Vg.stateIsFalse("TeamSettings.EnableCustomBrand"),key:"CustomBrandImage"},{type:w.i.SettingsTypes.TYPE_LONG_TEXT,key:"TeamSettings.CustomBrandText",label:Object(A.b)("admin.team.brandTextTitle"),label_default:"Custom Brand Text:",help_text:Object(A.b)("admin.team.brandTextDescription"),help_text_default:"Text that will appear below your custom brand image on your login screen. Supports Markdown-formatted text. Maximum 500 characters allowed.",isDisabled:Vg.stateIsFalse("TeamSettings.EnableCustomBrand"),max_length:w.i.MAX_CUSTOM_BRAND_TEXT_LENGTH},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SupportSettings.HelpLink",label:Object(A.b)("admin.support.helpTitle"),label_default:"Help Link:",help_text:Object(A.b)("admin.support.helpDesc"),help_text_default:"The URL for the Help link on the Mattermost login page, sign-up pages, and Main Menu. If this field is empty, the Help link is hidden from users."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SupportSettings.SupportEmail",label:Object(A.b)("admin.support.emailTitle"),label_default:"Support Email:",help_text:Object(A.b)("admin.support.emailHelp"),help_text_default:"Email address displayed on email notifications and during tutorial for end users to ask support questions."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SupportSettings.TermsOfServiceLink",label:Object(A.b)("admin.support.termsTitle"),label_default:"Terms of Service Link:",help_text:Object(A.b)("admin.support.termsDesc"),help_text_default:'Link to the terms under which users may use your online service. By default, this includes the "Mattermost Conditions of Use (End Users)" explaining the terms under which Mattermost software is provided to end users. If you change the default link to add your own terms for using the service you provide, your new terms must include a link to the default terms so end users are aware of the Mattermost Conditions of Use (End User) for Mattermost software.'},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SupportSettings.PrivacyPolicyLink",label:Object(A.b)("admin.support.privacyTitle"),label_default:"Privacy Policy Link:",help_text:Object(A.b)("admin.support.privacyDesc"),help_text_default:"The URL for the Privacy link on the login and sign-up pages. If this field is empty, the Privacy link is hidden from users."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SupportSettings.AboutLink",label:Object(A.b)("admin.support.aboutTitle"),label_default:"About Link:",help_text:Object(A.b)("admin.support.aboutDesc"),help_text_default:"The URL for the About link on the Mattermost login and sign-up pages. If this field is empty, the About link is hidden from users."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SupportSettings.ReportAProblemLink",label:Object(A.b)("admin.support.problemTitle"),label_default:"Report a Problem Link:",help_text:Object(A.b)("admin.support.problemDesc"),help_text_default:"The URL for the Report a Problem link in the Main Menu. If this field is empty, the link is removed from the Main Menu."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"NativeAppSettings.AppDownloadLink",label:Object(A.b)("admin.customization.appDownloadLinkTitle"),label_default:"Mattermost Apps Download Page Link:",help_text:Object(A.b)("admin.customization.appDownloadLinkDesc"),help_text_default:'Add a link to a download page for the Mattermost apps. When a link is present, an option to "Download Mattermost Apps" will be added in the Main Menu so users can find the download page. Leave this field blank to hide the option from the Main Menu.'},{type:w.i.SettingsTypes.TYPE_TEXT,key:"NativeAppSettings.AndroidAppDownloadLink",label:Object(A.b)("admin.customization.androidAppDownloadLinkTitle"),label_default:"Android App Download Link:",help_text:Object(A.b)("admin.customization.androidAppDownloadLinkDesc"),help_text_default:"Add a link to download the Android app. Users who access the site on a mobile web browser will be prompted with a page giving them the option to download the app. Leave this field blank to prevent the page from appearing."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"NativeAppSettings.IosAppDownloadLink",label:Object(A.b)("admin.customization.iosAppDownloadLinkTitle"),label_default:"iOS App Download Link:",help_text:Object(A.b)("admin.customization.iosAppDownloadLinkDesc"),help_text_default:"Add a link to download the iOS app. Users who access the site on a mobile web browser will be prompted with a page giving them the option to download the app. Leave this field blank to prevent the page from appearing."}]}},localization:{url:"site_config/localization",title:Object(A.b)("admin.sidebar.localization"),title_default:"Localization",schema:{id:"LocalizationSettings",name:Object(A.b)("admin.site.localization"),name_default:"Localization",settings:[{type:w.i.SettingsTypes.TYPE_LANGUAGE,key:"LocalizationSettings.DefaultServerLocale",label:Object(A.b)("admin.general.localization.serverLocaleTitle"),label_default:"Default Server Language:",help_text:Object(A.b)("admin.general.localization.serverLocaleDescription"),help_text_default:"Default language for system messages. Changing this will require a server restart before taking effect."},{type:w.i.SettingsTypes.TYPE_LANGUAGE,key:"LocalizationSettings.DefaultClientLocale",label:Object(A.b)("admin.general.localization.clientLocaleTitle"),label_default:"Default Client Language:",help_text:Object(A.b)("admin.general.localization.clientLocaleDescription"),help_text_default:"Default language for newly created users and pages where the user hasn't logged in."},{type:w.i.SettingsTypes.TYPE_LANGUAGE,key:"LocalizationSettings.AvailableLocales",label:Object(A.b)("admin.general.localization.availableLocalesTitle"),label_default:"Available Languages:",help_text:Object(A.b)("admin.general.localization.availableLocalesDescription"),help_text_markdown:!0,help_text_default:"Set which languages are available for users in Account Settings (leave this field blank to have all supported languages available). If you're manually adding new languages, the **Default Client Language** must be added before saving this setting.\n \nWould like to help with translations? Join the [Mattermost Translation Server](!http://translate.mattermost.com/) to contribute.",multiple:!0,no_result:Object(A.b)("admin.general.localization.availableLocalesNoResults"),no_result_default:"No results found",not_present:Object(A.b)("admin.general.localization.availableLocalesNotPresent"),not_present_default:"The default client language must be included in the available list"}]}},users_and_teams:{url:"site_config/users_and_teams",title:Object(A.b)("admin.sidebar.usersAndTeams"),title_default:"Users and Teams",schema:{id:"UserAndTeamsSettings",name:Object(A.b)("admin.site.usersAndTeams"),name_default:"Users and Teams",settings:[{type:w.i.SettingsTypes.TYPE_PERMISSION,key:"TeamSettings.EnableTeamCreation",label:Object(A.b)("admin.team.teamCreationTitle"),label_default:"Enable Team Creation: ",help_text:Object(A.b)("admin.team.teamCreationDescription"),help_text_default:"When false, only System Administrators can create teams.",permissions_mapping_name:"enableTeamCreation",isHidden:Vg.licensed},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"TeamSettings.MaxUsersPerTeam",label:Object(A.b)("admin.team.maxUsersTitle"),label_default:"Max Users Per Team:",help_text:Object(A.b)("admin.team.maxUsersDescription"),help_text_default:"Maximum total number of users per team, including both active and inactive users.",placeholder:Object(A.b)("admin.team.maxUsersExample"),placeholder_default:'E.g.: "25"'},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"TeamSettings.MaxChannelsPerTeam",label:Object(A.b)("admin.team.maxChannelsTitle"),label_default:"Max Channels Per Team:",help_text:Object(A.b)("admin.team.maxChannelsDescription"),help_text_default:"Maximum total number of channels per team, including both active and archived channels.",placeholder:Object(A.b)("admin.team.maxChannelsExample"),placeholder_default:'E.g.: "100"'},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"TeamSettings.RestrictDirectMessage",label:Object(A.b)("admin.team.restrictDirectMessage"),label_default:"Enable users to open Direct Message channels with:",help_text:Object(A.b)("admin.team.restrictDirectMessageDesc"),help_text_default:'"Any user on the Mattermost server" enables users to open a Direct Message channel with any user on the server, even if they are not on any teams together. "Any member of the team" limits the ability in the Direct Messages "More" menu to only open Direct Message channels with users who are in the same team.\n \nNote: This setting only affects the UI, not permissions on the server.',options:[{value:"any",display_name:Object(A.b)("admin.team.restrict_direct_message_any"),display_name_default:"Any user on the Mattermost server"},{value:"team",display_name:Object(A.b)("admin.team.restrict_direct_message_team"),display_name_default:"Any member of the team"}]},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"TeamSettings.TeammateNameDisplay",label:Object(A.b)("admin.team.teammateNameDisplay"),label_default:"Teammate Name Display:",help_text:Object(A.b)("admin.team.teammateNameDisplayDesc"),help_text_default:"Set how to display users' names in posts and the Direct Messages list.",options:[{value:w.i.TEAMMATE_NAME_DISPLAY.SHOW_USERNAME,display_name:Object(A.b)("admin.team.showUsername"),display_name_default:"Show username (default)"},{value:w.i.TEAMMATE_NAME_DISPLAY.SHOW_NICKNAME_FULLNAME,display_name:Object(A.b)("admin.team.showNickname"),display_name_default:"Show nickname if one exists, otherwise show first and last name"},{value:w.i.TEAMMATE_NAME_DISPLAY.SHOW_FULLNAME,display_name:Object(A.b)("admin.team.showFullname"),display_name_default:"Show first and last name"}]},{type:w.i.SettingsTypes.TYPE_PERMISSION,key:"TeamSettings.EditOthersPosts",label:Object(A.b)("admin.team.editOthersPostsTitle"),label_default:"Allow Team Administrators to edit others posts:",help_text:Object(A.b)("admin.team.editOthersPostsDesc"),help_text_default:"When true, Team Administrators and System Administrators can edit other user's posts.  When false, only System Administrators can edit other user's posts.",permissions_mapping_name:"editOthersPosts",isHidden:Vg.licensed},{type:w.i.SettingsTypes.TYPE_BOOL,key:"TeamSettings.ExperimentalViewArchivedChannels",label:Object(A.b)("admin.viewArchivedChannelsTitle"),label_default:"Allow users to view archived channels: ",help_text:Object(A.b)("admin.viewArchivedChannelsHelpText"),help_text_default:"(Experimental) When true, allows users to share permalinks and search for content of channels that have been archived. Users can only view the content in channels of which they were a member before the channel was archived."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"PrivacySettings.ShowEmailAddress",label:Object(A.b)("admin.privacy.showEmailTitle"),label_default:"Show Email Address:",help_text:Object(A.b)("admin.privacy.showEmailDescription"),help_text_default:"When false, hides the email address of members from everyone except System Administrators."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"PrivacySettings.ShowFullName",label:Object(A.b)("admin.privacy.showFullNameTitle"),label_default:"Show Full Name:",help_text:Object(A.b)("admin.privacy.showFullNameDescription"),help_text_default:"When false, hides the full name of members from everyone except System Administrators. Username is shown in place of full name."}]}},notifications:{url:"environment/notifications",title:Object(A.b)("admin.sidebar.notifications"),title_default:"Notifications",schema:{id:"notifications",name:Object(A.b)("admin.environment.notifications"),name_default:"Notifications",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"TeamSettings.EnableConfirmNotificationsToChannel",label:Object(A.b)("admin.environment.notifications.enableConfirmNotificationsToChannel.label"),label_default:"Show @channel and @all confirmation dialog:",help_text:Object(A.b)("admin.environment.notifications.enableConfirmNotificationsToChannel.help"),help_text_default:"When true, users will be prompted to confirm when posting @channel and @all in channels with over five members. When false, no confirmation is required."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"EmailSettings.SendEmailNotifications",label:Object(A.b)("admin.environment.notifications.enable.label"),label_default:"Enable Email Notifications:",help_text:Object(A.b)("admin.environment.notifications.enable.help"),help_text_default:"Typically set to true in production. When true, Mattermost attempts to send email notifications. Developers may set this field to false to skip email setup for faster development."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"EmailSettings.EnablePreviewModeBanner",label:Object(A.b)("admin.environment.notifications.enablePreviewModeBanner.label"),label_default:"Enable Preview Mode Banner:",help_text:Object(A.b)("admin.environment.notifications.enablePreviewModeBanner.help"),help_text_default:"When true, the Preview Mode banner is displayed so users are aware that email notifications are disabled. When false, the Preview Mode banner is not displayed to users.",isDisabled:Vg.either(Vg.stateIsTrue("EmailSettings.SendEmailNotifications"))},{type:w.i.SettingsTypes.TYPE_BOOL,key:"EmailSettings.EnableEmailBatching",label:Object(A.b)("admin.environment.notifications.enableEmailBatching.label"),label_default:"Enable Email Batching:",help_text:Object(A.b)("admin.environment.notifications.enableEmailBatching.help"),help_text_default:"When true, users will have email notifications for multiple direct messages and mentions combined into a single email. Batching will occur at a default interval of 15 minutes, configurable in Account Settings > Notifications.",isDisabled:Vg.either(Vg.stateIsFalse("EmailSettings.SendEmailNotifications"),Vg.configIsTrue("ClusterSettings","Enable"),Vg.configIsFalse("ServiceSettings","SiteURL"))},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"EmailSettings.EmailNotificationContentsType",label:Object(A.b)("admin.environment.notifications.contents.label"),label_default:"Email Notification Contents:",help_text:Object(A.b)("admin.environment.notifications.contents.help"),help_text_default:"**Send full message contents** - Sender name and channel are included in email notifications. Typically used for compliance reasons if Mattermost contains confidential information and policy dictates it cannot be stored in email.\n  **Send generic description with only sender name** - Only the name of the person who sent the message, with no information about channel name or message contents are included in email notifications. Typically used for compliance reasons if Mattermost contains confidential information and policy dictates it cannot be stored in email.",help_text_markdown:!0,isHidden:Vg.isnt(Vg.licensedForFeature("EmailNotificationContents")),options:[{value:"full",display_name:Object(A.b)("admin.environment.notifications.contents.full"),display_name_default:"Send full message contents"},{value:"generic",display_name:Object(A.b)("admin.environment.notifications.contents.generic"),display_name_default:"Send generic description with only sender name"}]},{type:w.i.SettingsTypes.TYPE_TEXT,key:"EmailSettings.FeedbackName",label:Object(A.b)("admin.environment.notifications.notificationDisplay.label"),label_default:"Notification Display Name:",placeholder:Object(A.b)("admin.environment.notifications.notificationDisplay.placeholder"),placeholder_default:'Ex: "Mattermost Notification", "System", "No-Reply"',help_text:Object(A.b)("admin.environment.notifications.notificationDisplay.help"),help_text_default:"Display name on email account used when sending notification emails from Mattermost.",isDisabled:Vg.stateIsFalse("EmailSettings.SendEmailNotifications")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"EmailSettings.FeedbackEmail",label:Object(A.b)("admin.environment.notifications.feedbackEmail.label"),label_default:"Notification From Address:",placeholder:Object(A.b)("admin.environment.notifications.feedbackEmail.placeholder"),placeholder_default:'Ex: "mattermost@yourcompany.com", "admin@yourcompany.com"',help_text:Object(A.b)("admin.environment.notifications.feedbackEmail.help"),help_text_default:"Email address displayed on email account used when sending notification emails from Mattermost.",isDisabled:Vg.stateIsFalse("EmailSettings.SendEmailNotifications"),isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"EmailSettings.ReplyToAddress",label:Object(A.b)("admin.environment.notifications.replyToAddress.label"),label_default:"Notification Reply-To Address:",placeholder:Object(A.b)("admin.environment.notifications.replyToAddress.placeholder"),placeholder_default:'Ex: "mattermost@yourcompany.com", "admin@yourcompany.com"',help_text:Object(A.b)("admin.environment.notifications.replyToAddress.help"),help_text_default:"Email address used in the Reply-To header when sending notification emails from Mattermost.",isDisabled:Vg.stateIsFalse("EmailSettings.SendEmailNotifications")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"EmailSettings.FeedbackOrganization",label:Object(A.b)("admin.environment.notifications.feedbackOrganization.label"),label_default:"Notification Footer Mailing Address:",placeholder:Object(A.b)("admin.environment.notifications.feedbackOrganization.placeholder"),placeholder_default:'Ex: "© ABC Corporation, 565 Knight Way, Palo Alto, California, 94305, USA"',help_text:Object(A.b)("admin.environment.notifications.feedbackOrganization.help"),help_text_default:'Organization name and address displayed on email notifications from Mattermost, such as "© ABC Corporation, 565 Knight Way, Palo Alto, California, 94305, USA". If the field is left empty, the organization name and address will not be displayed.',isDisabled:Vg.stateIsFalse("EmailSettings.SendEmailNotifications")},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"EmailSettings.PushNotificationContents",label:Object(A.b)("admin.environment.notifications.pushContents.label"),label_default:"Push Notification Contents:",help_text:Object(A.b)("admin.environment.notifications.pushContents.help"),help_text_default:'**Send generic description with only sender name** - Includes only the name of the person who sent the message in push notifications, with no information about channel name or message contents.\n **Send generic description with sender and channel names** - Includes the name of the person who sent the message and the channel it was sent in, but not the message text.\n **Send full message snippet** - Includes a message excerpt in push notifications, which may contain confidential information sent in messages. If your Push Notification Service is outside your firewall, it is *highly recommended* this option only be used with an "https" protocol to encrypt the connection.',help_text_markdown:!0,options:[{value:"generic_no_channel",display_name:Object(A.b)("admin.environment.notifications.pushContents.genericNoChannel"),display_name_default:"Send generic description with only sender name"},{value:"generic",display_name:Object(A.b)("admin.environment.notifications.pushContents.generic"),display_name_default:"Send generic description with sender and channel names"},{value:"full",display_name:Object(A.b)("admin.environment.notifications.pushContents.full"),display_name_default:"Send full message snippet"}]}]}},announcement_banner:{url:"site_config/announcement_banner",title:Object(A.b)("admin.sidebar.announcement"),title_default:"Announcement Banner",isHidden:Vg.isnt(Vg.licensed),schema:{id:"AnnouncementSettings",name:Object(A.b)("admin.site.announcementBanner"),name_default:"Announcement Banner",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"AnnouncementSettings.EnableBanner",label:Object(A.b)("admin.customization.announcement.enableBannerTitle"),label_default:"Enable Announcement Banner:",help_text:Object(A.b)("admin.customization.announcement.enableBannerDesc"),help_text_default:"Enable an announcement banner across all teams."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"AnnouncementSettings.BannerText",label:Object(A.b)("admin.customization.announcement.bannerTextTitle"),label_default:"Banner Text:",help_text:Object(A.b)("admin.customization.announcement.bannerTextDesc"),help_text_default:"Text that will appear in the announcement banner.",isDisabled:Vg.stateIsFalse("AnnouncementSettings.EnableBanner")},{type:w.i.SettingsTypes.TYPE_COLOR,key:"AnnouncementSettings.BannerColor",label:Object(A.b)("admin.customization.announcement.bannerColorTitle"),label_default:"Banner Color:",isDisabled:Vg.stateIsFalse("AnnouncementSettings.EnableBanner")},{type:w.i.SettingsTypes.TYPE_COLOR,key:"AnnouncementSettings.BannerTextColor",label:Object(A.b)("admin.customization.announcement.bannerTextColorTitle"),label_default:"Banner Text Color:",isDisabled:Vg.stateIsFalse("AnnouncementSettings.EnableBanner")},{type:w.i.SettingsTypes.TYPE_BOOL,key:"AnnouncementSettings.AllowBannerDismissal",label:Object(A.b)("admin.customization.announcement.allowBannerDismissalTitle"),label_default:"Allow Banner Dismissal:",help_text:Object(A.b)("admin.customization.announcement.allowBannerDismissalDesc"),help_text_default:"When true, users can dismiss the banner until its next update. When false, the banner is permanently visible until it is turned off by the System Admin.",isDisabled:Vg.stateIsFalse("AnnouncementSettings.EnableBanner")}]}},emoji:{url:"site_config/emoji",title:Object(A.b)("admin.sidebar.emoji"),title_default:"Emoji",schema:{id:"EmojiSettings",name:Object(A.b)("admin.site.emoji"),name_default:"Emoji",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableEmojiPicker",label:Object(A.b)("admin.customization.enableEmojiPickerTitle"),label_default:"Enable Emoji Picker:",help_text:Object(A.b)("admin.customization.enableEmojiPickerDesc"),help_text_default:"The emoji picker allows users to select emoji to add as reactions or use in messages. Enabling the emoji picker with a large number of custom emoji may slow down performance."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableCustomEmoji",label:Object(A.b)("admin.customization.enableCustomEmojiTitle"),label_default:"Enable Custom Emoji:",help_text:Object(A.b)("admin.customization.enableCustomEmojiDesc"),help_text_default:'Enable users to create custom emoji for use in messages. When enabled, Custom Emoji settings can be accessed by switching to a team and clicking the three dots above the channel sidebar, and selecting "Custom Emoji".'}]}},posts:{url:"site_config/posts",title:Object(A.b)("admin.sidebar.posts"),title_default:"Posts",schema:{id:"PostSettings",name:Object(A.b)("admin.site.posts"),name_default:"Posts",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableLinkPreviews",label:Object(A.b)("admin.customization.enableLinkPreviewsTitle"),label_default:"Enable Link Previews:",help_text:Object(A.b)("admin.customization.enableLinkPreviewsDesc"),help_text_default:"Display a preview of website content below messages, when available. Users can disable these previews from Account Settings > Display > Website Link Previews. This setting only applies to websites with OpenGraph metadata and not for image links or YouTube previews."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableSVGs",label:Object(A.b)("admin.customization.enableSVGsTitle"),label_default:"Enable SVGs:",help_text:Object(A.b)("admin.customization.enableSVGsDesc"),help_text_default:"Enable previews for SVG file attachments and allow them to appear in messages."},{type:w.i.SettingsTypes.TYPE_CUSTOM,component:Qr,key:"DisplaySettings.CustomUrlSchemes"},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ServiceSettings.GoogleDeveloperKey",label:Object(A.b)("admin.service.googleTitle"),label_default:"Google API Key:",placeholder:Object(A.b)("admin.service.googleExample"),placeholder_default:'E.g.: "7rAh6iwQCkV4cA1Gsg3fgGOXJAQ43QV"',help_text:Object(A.b)("admin.service.googleDescription"),help_text_default:"Set this key to enable the display of titles for embedded YouTube video previews. Without the key, YouTube previews will still be created based on hyperlinks appearing in messages or comments but they will not show the video title. View a [Google Developers Tutorial](!https://www.youtube.com/watch?v=Im69kzhpR3I) for instructions on how to obtain a key and add YouTube Data API v3 as a service to your key.",help_text_markdown:!0,isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin")}]}},file_sharing_downloads:{url:"site_config/file_sharing_downloads",title:Object(A.b)("admin.sidebar.fileSharingDownloads"),title_default:"File Sharing and Downloads",schema:{id:"FileSharingDownloads",name:Object(A.b)("admin.site.fileSharingDownloads"),name_default:"File Sharing and Downloads",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"FileSettings.EnableFileAttachments",label:Object(A.b)("admin.file.enableFileAttachments"),label_default:"Allow File Sharing:",help_text:Object(A.b)("admin.file.enableFileAttachmentsDesc"),help_text_default:"When false, disables file sharing on the server. All file and image uploads on messages are forbidden across clients and devices, including mobile."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"FileSettings.EnableMobileUpload",label:Object(A.b)("admin.file.enableMobileUploadTitle"),label_default:"Allow File Uploads on Mobile:",help_text:Object(A.b)("admin.file.enableMobileUploadDesc"),help_text_default:"When false, disables file uploads on mobile apps. If Allow File Sharing is set to true, users can still upload files from a mobile web browser.",isHidden:Vg.isnt(Vg.licensedForFeature("Compliance"))},{type:w.i.SettingsTypes.TYPE_BOOL,key:"FileSettings.EnableMobileDownload",label:Object(A.b)("admin.file.enableMobileDownloadTitle"),label_default:"Allow File Downloads on Mobile:",help_text:Object(A.b)("admin.file.enableMobileDownloadDesc"),help_text_default:"When false, disables file downloads on mobile apps. Users can still download files from a mobile web browser.",isHidden:Vg.isnt(Vg.licensedForFeature("Compliance"))}]}},public_links:{url:"site_config/public_links",title:Object(A.b)("admin.sidebar.publicLinks"),title_default:"Public Links",schema:{id:"PublicLinkSettings",name:Object(A.b)("admin.site.public_links"),name_default:"Public Links",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"FileSettings.EnablePublicLink",label:Object(A.b)("admin.image.shareTitle"),label_default:"Enable Public File Links: ",help_text:Object(A.b)("admin.image.shareDescription"),help_text_default:"Allow users to share public links to files and images."},{type:w.i.SettingsTypes.TYPE_GENERATED,key:"FileSettings.PublicLinkSalt",label:Object(A.b)("admin.image.publicLinkTitle"),label_default:"Public Link Salt:",help_text:Object(A.b)("admin.image.publicLinkDescription"),help_text_default:'32-character salt added to signing of public image links. Randomly generated on install. Click "Regenerate" to create new salt.'}]}}},authentication:{icon:"fa-shield",sectionTitle:Object(A.b)("admin.sidebar.authentication"),sectionTitleDefault:"Authentication",signup:{url:"authentication/signup",title:Object(A.b)("admin.sidebar.signup"),title_default:"Signup",schema:{id:"SignupSettings",name:Object(A.b)("admin.authentication.signup"),name_default:"Signup",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"TeamSettings.EnableUserCreation",label:Object(A.b)("admin.team.userCreationTitle"),label_default:"Enable Account Creation: ",help_text:Object(A.b)("admin.team.userCreationDescription"),help_text_default:"When false, the ability to create accounts is disabled. The create account button displays error when pressed."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"TeamSettings.RestrictCreationToDomains",label:Object(A.b)("admin.team.restrictTitle"),label_default:"Restrict account creation to specified email domains:",help_text:Object(A.b)("admin.team.restrictDescription"),help_text_default:'User accounts can only be created from a specific domain (e.g. "mattermost.org") or list of comma-separated domains (e.g. "corp.mattermost.com, mattermost.org"). This setting only affects email login.',placeholder:Object(A.b)("admin.team.restrictExample"),placeholder_default:'E.g.: "corp.mattermost.com, mattermost.org"'},{type:w.i.SettingsTypes.TYPE_BOOL,key:"TeamSettings.EnableOpenServer",label:Object(A.b)("admin.team.openServerTitle"),label_default:"Enable Open Server: ",help_text:Object(A.b)("admin.team.openServerDescription"),help_text_default:"When true, anyone can signup for a user account on this server without the need to be invited.",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin")},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableEmailInvitations",label:Object(A.b)("admin.team.emailInvitationsTitle"),label_default:"Enable Email Invitations: ",help_text:Object(A.b)("admin.team.emailInvitationsDescription"),help_text_default:"When true users can invite others to the system using email."},{type:w.i.SettingsTypes.TYPE_BUTTON,key:"InvalidateEmailInvitesButton",action:d.t,label:Object(A.b)("admin.team.invalidateEmailInvitesTitle"),label_default:"Invalidate pending email invites",help_text:Object(A.b)("admin.team.invalidateEmailInvitesDescription"),help_text_default:"This will invalidate active email invitations that have not been accepted by the user.  By default email invitations expire after 48 hours.",error_message:Object(A.b)("admin.team.invalidateEmailInvitesFail"),error_message_default:"Unable to invalidate pending email invites: {error}",success_message:Object(A.b)("admin.team.invalidateEmailInvitesSuccess"),success_message_default:"Pending email invitations invalidated successfully"}]}},email:{url:"authentication/email",title:Object(A.b)("admin.sidebar.email"),title_default:"Email",schema:{id:"EmailSettings",name:Object(A.b)("admin.authentication.email"),name_default:"Email",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"EmailSettings.EnableSignUpWithEmail",label:Object(A.b)("admin.email.allowSignupTitle"),label_default:"Enable account creation with email:",help_text:Object(A.b)("admin.email.allowSignupDescription"),help_text_default:"When true, Mattermost allows account creation using email and password. This value should be false only when you want to limit sign up to a single sign-on service like AD/LDAP, SAML or GitLab."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"EmailSettings.RequireEmailVerification",label:Object(A.b)("admin.email.requireVerificationTitle"),label_default:"Require Email Verification: ",help_text:Object(A.b)("admin.email.requireVerificationDescription"),help_text_default:"Typically set to true in production. When true, Mattermost requires email verification after account creation prior to allowing login. Developers may set this field to false to skip sending verification emails for faster development.",disabled_help_text:Object(A.b)("admin.security.requireEmailVerification.disabled"),disabled_help_text_default:"Email verification cannot be changed while sending emails is disabled.",isDisabled:function(e){return!e.EmailSettings.SendEmailNotifications}},{type:w.i.SettingsTypes.TYPE_BOOL,key:"EmailSettings.EnableSignInWithEmail",label:Object(A.b)("admin.email.allowEmailSignInTitle"),label_default:"Enable sign-in with email:",help_text:Object(A.b)("admin.email.allowEmailSignInDescription"),help_text_default:"When true, Mattermost allows users to sign in using their email and password."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"EmailSettings.EnableSignInWithUsername",label:Object(A.b)("admin.email.allowUsernameSignInTitle"),label_default:"Enable sign-in with username:",help_text:Object(A.b)("admin.email.allowUsernameSignInDescription"),help_text_default:"When true, users with email login can sign in using their username and password. This setting does not affect AD/LDAP login."}]}},password:{url:"authentication/password",title:Object(A.b)("admin.sidebar.password"),title_default:"Password",searchableStrings:["user.settings.security.passwordMinLength","admin.security.password",["admin.password.minimumLength",{max:"",min:""}],["admin.password.minimumLengthDescription",{max:"",min:""}],"passwordRequirements","admin.password.lowercase","admin.password.uppercase","admin.password.number","admin.password.symbol","admin.password.preview","admin.service.attemptTitle","admin.service.attemptDescription"],schema:{id:"PasswordSettings",component:Eh}},mfa:{url:"authentication/mfa",title:Object(A.b)("admin.sidebar.mfa"),title_default:"MFA",schema:{id:"ServiceSettings",name:Object(A.b)("admin.authentication.mfa"),name_default:"Multi-factor Authentication",settings:[{type:w.i.SettingsTypes.TYPE_BANNER,label:Object(A.b)("admin.mfa.bannerDesc"),label_default:"[Multi-factor authentication](!https://docs.mattermost.com/deployment/auth.html) is available for accounts with AD/LDAP or email login. If other login methods are used, MFA should be configured with the authentication provider.",label_markdown:!0,banner_type:"info"},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableMultifactorAuthentication",label:Object(A.b)("admin.service.mfaTitle"),label_default:"Enable Multi-factor Authentication:",help_text:Object(A.b)("admin.service.mfaDesc"),help_text_default:"When true, users with AD/LDAP or email login can add multi-factor authentication to their account using Google Authenticator."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnforceMultifactorAuthentication",label:Object(A.b)("admin.service.enforceMfaTitle"),label_default:"Enforce Multi-factor Authentication:",help_text:Object(A.b)("admin.service.enforceMfaDesc"),help_text_markdown:!0,help_text_default:"When true, [multi-factor authentication](!https://docs.mattermost.com/deployment/auth.html) is required for login. New users will be required to configure MFA on signup. Logged in users without MFA configured are redirected to the MFA setup page until configuration is complete.\n \nIf your system has users with login methods other than AD/LDAP and email, MFA must be enforced with the authentication provider outside of Mattermost.",isDisabled:Vg.stateIsFalse("ServiceSettings.EnableMultifactorAuthentication"),isHidden:Vg.isnt(Vg.licensedForFeature("MFA"))}]}},ldap:{url:"authentication/ldap",title:Object(A.b)("admin.sidebar.ldap"),title_default:"AD/LDAP",isHidden:Vg.isnt(Vg.licensedForFeature("LDAP")),schema:{id:"LdapSettings",name:Object(A.b)("admin.authentication.ldap"),name_default:"AD/LDAP",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"LdapSettings.Enable",label:Object(A.b)("admin.ldap.enableTitle"),label_default:"Enable sign-in with AD/LDAP:",help_text:Object(A.b)("admin.ldap.enableDesc"),help_text_default:"When true, Mattermost allows login using AD/LDAP"},{type:w.i.SettingsTypes.TYPE_BOOL,key:"LdapSettings.EnableSync",label:Object(A.b)("admin.ldap.enableSyncTitle"),label_default:"Enable Synchronization with AD/LDAP:",help_text:Object(A.b)("admin.ldap.enableSyncDesc"),help_text_default:"When true, Mattermost periodically synchronizes users from AD/LDAP. When false, user attributes are updated from AD/LDAP during user login only."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.LdapServer",label:Object(A.b)("admin.ldap.serverTitle"),label_default:"AD/LDAP Server:",help_text:Object(A.b)("admin.ldap.serverDesc"),help_text_default:"The domain or IP address of AD/LDAP server.",placeholder:Object(A.b)("admin.ldap.serverEx"),placeholder_default:'E.g.: "10.0.0.23"',isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"LdapSettings.LdapPort",label:Object(A.b)("admin.ldap.portTitle"),label_default:"AD/LDAP Port:",help_text:Object(A.b)("admin.ldap.portDesc"),help_text_default:"The port Mattermost will use to connect to the AD/LDAP server. Default is 389.",placeholder:Object(A.b)("admin.ldap.portEx"),placeholder_default:'E.g.: "389"',isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"LdapSettings.ConnectionSecurity",label:Object(A.b)("admin.connectionSecurityTitle"),label_default:"Connection Security:",help_text:Bg,options:[{value:"",display_name:Object(A.b)("admin.connectionSecurityNone"),display_name_default:"None"},{value:"TLS",display_name:Object(A.b)("admin.connectionSecurityTls"),display_name_default:"TLS (Recommended)"},{value:"STARTTLS",display_name:Object(A.b)("admin.connectionSecurityStart"),display_name_default:"STARTTLS"}],isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_BOOL,key:"LdapSettings.SkipCertificateVerification",label:Object(A.b)("admin.ldap.skipCertificateVerification"),label_default:"Skip Certificate Verification:",help_text:Object(A.b)("admin.ldap.skipCertificateVerificationDesc"),help_text_default:"Skips the certificate verification step for TLS or STARTTLS connections. Not recommended for production environments where TLS is required. For testing only.",isDisabled:Vg.stateIsFalse("LdapSettings.ConnectionSecurity")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.BaseDN",label:Object(A.b)("admin.ldap.baseTitle"),label_default:"BaseDN:",help_text:Object(A.b)("admin.ldap.baseDesc"),help_text_default:"The Base DN is the Distinguished Name of the location where Mattermost should start its search for users in the AD/LDAP tree.",placeholder:Object(A.b)("admin.ldap.baseEx"),placeholder_default:'E.g.: "ou=Unit Name,dc=corp,dc=example,dc=com"',isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.BindUsername",label:Object(A.b)("admin.ldap.bindUserTitle"),label_default:"Bind Username:",help_text:Object(A.b)("admin.ldap.bindUserDesc"),help_text_default:"The username used to perform the AD/LDAP search. This should typically be an account created specifically for use with Mattermost. It should have access limited to read the portion of the AD/LDAP tree specified in the BaseDN field.",isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.BindPassword",label:Object(A.b)("admin.ldap.bindPwdTitle"),label_default:"Bind Password:",help_text:Object(A.b)("admin.ldap.bindPwdDesc"),help_text_default:'Password of the user given in "Bind Username".',isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.UserFilter",label:Object(A.b)("admin.ldap.userFilterTitle"),label_default:"User Filter:",help_text:Object(A.b)("admin.ldap.userFilterDisc"),help_text_default:"(Optional) Enter an AD/LDAP filter to use when searching for user objects. Only the users selected by the query will be able to access Mattermost. For Active Directory, the query to filter out disabled users is (&(objectCategory=Person)(!(UserAccountControl:1.2.840.113556.1.4.803:=2))).",placeholder:Object(A.b)("admin.ldap.userFilterEx"),placeholder_default:'Ex. "(objectClass=user)"',isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.GroupFilter",label:Object(A.b)("admin.ldap.groupFilterTitle"),label_default:"Group Filter:",help_text:Object(A.b)("admin.ldap.groupFilterFilterDesc"),help_text_markdown:!0,help_text_default:"(Optional) Enter an AD/LDAP filter to use when searching for group objects. Only the groups selected by the query will be available to Mattermost. From [User Management > Groups](/admin_console/user_management/groups), select which AD/LDAP groups should be linked and configured.",placeholder:Object(A.b)("admin.ldap.groupFilterEx"),placeholder_default:'E.g.: "(objectClass=group)"',isDisabled:Vg.stateIsFalse("LdapSettings.EnableSync"),isHidden:function(e){return Vg.isnt(Vg.licensedForFeature("LDAPGroups"))&&!e.ServiceSettings.ExperimentalLdapGroupSync}},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.GroupDisplayNameAttribute",label:Object(A.b)("admin.ldap.groupDisplayNameAttributeTitle"),label_default:"Group Display Name Attribute:",help_text:Object(A.b)("admin.ldap.groupDisplayNameAttributeDesc"),help_text_default:"The attribute in the AD/LDAP server used to populate the group display names.",placeholder:Object(A.b)("admin.ldap.groupDisplayNameAttributeEx"),placeholder_default:'E.g.: "cn"',isDisabled:Vg.stateIsFalse("LdapSettings.EnableSync"),isHidden:function(e){return Vg.isnt(Vg.licensedForFeature("LDAPGroups"))&&!e.ServiceSettings.ExperimentalLdapGroupSync}},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.GroupIdAttribute",label:Object(A.b)("admin.ldap.groupIdAttributeTitle"),label_default:"Group ID Attribute:",help_text:Object(A.b)("admin.ldap.groupIdAttributeDesc"),help_text_default:"The attribute in the AD/LDAP server used as a unique identifier for Groups. This should be a AD/LDAP attribute with a value that does not change such as `entryUUID` for LDAP or `objectGUID` for Active Directory.",help_text_markdown:!0,placeholder:Object(A.b)("admin.ldap.groupIdAttributeEx"),placeholder_default:'E.g.: "objectGUID" or "entryUUID"',isDisabled:Vg.stateIsFalse("LdapSettings.EnableSync"),isHidden:function(e){return Vg.isnt(Vg.licensedForFeature("LDAPGroups"))&&!e.ServiceSettings.ExperimentalLdapGroupSync}},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.FirstNameAttribute",label:Object(A.b)("admin.ldap.firstnameAttrTitle"),label_default:"First Name Attribute:",placeholder:Object(A.b)("admin.ldap.firstnameAttrEx"),placeholder_default:'E.g.: "givenName"',help_text:Object(A.b)("admin.ldap.firstnameAttrDesc"),help_text_default:"(Optional) The attribute in the AD/LDAP server used to populate the first name of users in Mattermost. When set, users cannot edit their first name, since it is synchronized with the LDAP server. When left blank, users can set their first name in Account Settings.",isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.LastNameAttribute",label:Object(A.b)("admin.ldap.lastnameAttrTitle"),label_default:"Last Name Attribute:",placeholder:Object(A.b)("admin.ldap.lastnameAttrEx"),placeholder_default:'E.g.: "sn"',help_text:Object(A.b)("admin.ldap.lastnameAttrDesc"),help_text_default:"(Optional) The attribute in the AD/LDAP server used to populate the last name of users in Mattermost. When set, users cannot edit their last name, since it is synchronized with the LDAP server. When left blank, users can set their last name in Account Settings.",isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.NicknameAttribute",label:Object(A.b)("admin.ldap.nicknameAttrTitle"),label_default:"Nickname Attribute:",placeholder:Object(A.b)("admin.ldap.nicknameAttrEx"),placeholder_default:'E.g.: "nickname"',help_text:Object(A.b)("admin.ldap.nicknameAttrDesc"),help_text_default:"(Optional) The attribute in the AD/LDAP server used to populate the nickname of users in Mattermost. When set, users cannot edit their nickname, since it is synchronized with the LDAP server. When left blank, users can set their nickname in Account Settings.",isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.PositionAttribute",label:Object(A.b)("admin.ldap.positionAttrTitle"),label_default:"Position Attribute:",placeholder:Object(A.b)("admin.ldap.positionAttrEx"),placeholder_default:'E.g.: "title"',help_text:Object(A.b)("admin.ldap.positionAttrDesc"),help_text_default:"(Optional) The attribute in the AD/LDAP server used to populate the position field in Mattermost. When set, users cannot edit their position, since it is synchronized with the LDAP server. When left blank, users can set their position in Account Settings.",isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.EmailAttribute",label:Object(A.b)("admin.ldap.emailAttrTitle"),label_default:"Email Attribute:",placeholder:Object(A.b)("admin.ldap.emailAttrEx"),placeholder_default:'E.g.: "mail" or "userPrincipalName"',help_text:Object(A.b)("admin.ldap.emailAttrDesc"),help_text_default:"The attribute in the AD/LDAP server used to populate the email address field in Mattermost.",isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.UsernameAttribute",label:Object(A.b)("admin.ldap.usernameAttrTitle"),label_default:"Username Attribute:",placeholder:Object(A.b)("admin.ldap.usernameAttrEx"),placeholder_default:'E.g.: "sAMAccountName"',help_text:Object(A.b)("admin.ldap.usernameAttrDesc"),help_text_default:"The attribute in the AD/LDAP server used to populate the username field in Mattermost. This may be the same as the Login ID Attribute.",isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.IdAttribute",label:Object(A.b)("admin.ldap.idAttrTitle"),label_default:"ID Attribute: ",placeholder:Object(A.b)("admin.ldap.idAttrEx"),placeholder_default:'E.g.: "objectGUID" or "entryUUID"',help_text:Object(A.b)("admin.ldap.idAttrDesc"),help_text_markdown:!0,help_text_default:"The attribute in the AD/LDAP server used as a unique identifier in Mattermost. It should be an AD/LDAP attribute with a value that does not change such as `entryUUID` for LDAP or `objectGUID` for Active Directory. If a user's ID Attribute changes, it will create a new Mattermost account unassociated with their old one.\n \nIf you need to change this field after users have already logged in, use the [mattermost ldap idmigrate](!https://about.mattermost.com/default-mattermost-ldap-idmigrate) CLI tool.",isDisabled:Vg.both(Vg.stateEquals("LdapSettings.Enable",!1),Vg.stateEquals("LdapSettings.EnableSync",!1))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.LoginIdAttribute",label:Object(A.b)("admin.ldap.loginAttrTitle"),label_default:"Login ID Attribute: ",placeholder:Object(A.b)("admin.ldap.loginIdAttrEx"),placeholder_default:'E.g.: "sAMAccountName"',help_text:Object(A.b)("admin.ldap.loginAttrDesc"),help_text_markdown:!0,help_text_default:'The attribute in the AD/LDAP server used to log in to Mattermost. Normally this attribute is the same as the "Username Attribute" field above.\n \nIf your team typically uses domain/username to log in to other services with AD/LDAP, you may enter domain/username in this field to maintain consistency between sites.',isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.LoginFieldName",label:Object(A.b)("admin.ldap.loginNameTitle"),label_default:"Sign-in Field Default Text:",placeholder:Object(A.b)("admin.ldap.loginNameEx"),placeholder_default:'E.g.: "AD/LDAP Username"',help_text:Object(A.b)("admin.ldap.loginNameDesc"),help_text_default:'The placeholder text that appears in the login field on the login page. Defaults to "AD/LDAP Username".',isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"LdapSettings.SyncIntervalMinutes",label:Object(A.b)("admin.ldap.syncIntervalTitle"),label_default:"Synchronization Interval (minutes):",help_text:Object(A.b)("admin.ldap.syncIntervalHelpText"),help_text_default:'AD/LDAP Synchronization updates Mattermost user information to reflect updates on the AD/LDAP server. For example, when a user\'s name changes on the AD/LDAP server, the change updates in Mattermost when synchronization is performed. Accounts removed from or disabled in the AD/LDAP server have their Mattermost accounts set to "Inactive" and have their account sessions revoked. Mattermost performs synchronization on the interval entered. For example, if 60 is entered, Mattermost synchronizes every 60 minutes.',isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"LdapSettings.MaxPageSize",label:Object(A.b)("admin.ldap.maxPageSizeTitle"),label_default:"Maximum Page Size:",placeholder:Object(A.b)("admin.ldap.maxPageSizeEx"),placeholder_default:'E.g.: "2000"',help_text:Object(A.b)("admin.ldap.maxPageSizeHelpText"),help_text_default:"The maximum number of users the Mattermost server will request from the AD/LDAP server at one time. 0 is unlimited.",isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"LdapSettings.QueryTimeout",label:Object(A.b)("admin.ldap.queryTitle"),label_default:"Query Timeout (seconds):",placeholder:Object(A.b)("admin.ldap.queryEx"),placeholder_default:'E.g.: "60"',help_text:Object(A.b)("admin.ldap.queryDesc"),help_text_default:"The timeout value for queries to the AD/LDAP server. Increase if you are getting timeout errors caused by a slow AD/LDAP server.",isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_BUTTON,action:d.u,key:"LdapSettings.LdapTest",label:Object(A.b)("admin.ldap.ldap_test_button"),label_default:"AD/LDAP Test",help_text:Object(A.b)("admin.ldap.testHelpText"),help_text_markdown:!0,help_text_default:'Tests if the Mattemost server can connect to the AD/LDAP server specified. Please review "System Console > Logs" and [documentation](!https://mattermost.com/default-ldap-docs) to troubleshoot errors.',error_message:Object(A.b)("admin.ldap.testFailure"),error_message_default:"AD/LDAP Test Failure: {error}",success_message:Object(A.b)("admin.ldap.testSuccess"),success_message_default:"AD/LDAP Test Successful",isDisabled:Vg.both(Vg.stateIsFalse("LdapSettings.Enable"),Vg.stateIsFalse("LdapSettings.EnableSync"))},{type:w.i.SettingsTypes.TYPE_JOBSTABLE,job_type:w.i.JobTypes.LDAP_SYNC,label:Object(A.b)("admin.ldap.sync_button"),label_default:"AD/LDAP Synchronize Now",help_text:Object(A.b)("admin.ldap.syncNowHelpText"),help_text_markdown:!0,help_text_default:'Initiates an AD/LDAP synchronization immediately. See the table below for status of each synchronization. Please review "System Console > Logs" and [documentation](!https://mattermost.com/default-ldap-docs) to troubleshoot errors.',isDisabled:Vg.stateIsFalse("LdapSettings.EnableSync"),render_job:function(e){var t,n=0,a=0,r=0,i=0,o=0,s=0,l=0;return e&&e.data&&(e.data.ldap_users_count&&e.data.ldap_users_count.length>0&&(n=e.data.ldap_users_count),e.data.delete_count&&e.data.delete_count.length>0&&(a=e.data.delete_count),e.data.update_count&&e.data.update_count.length>0&&(r=e.data.update_count),e.data.ldap_groups_count&&(t=e.data.ldap_groups_count),e.data.total_ldap_groups_count&&(i=e.data.total_ldap_groups_count),e.data.group_delete_count&&(o=e.data.group_delete_count),e.data.group_member_delete_count&&(s=e.data.group_member_delete_count),e.data.group_member_add_count&&(l=e.data.group_member_add_count)),g.a.createElement("span",null,g.a.createElement(E.c,{id:t?"admin.ldap.jobExtraInfo":"admin.ldap.jobExtraInfoTotal",defaultMessage:t?"Scanned {ldapUsers, number} LDAP users and {ldapGroups, number} linked groups.":"Scanned {ldapUsers, number} LDAP users and {ldapGroups, number} groups.",values:{ldapUsers:n,ldapGroups:t||i}}),g.a.createElement("ul",null,r>0&&g.a.createElement("li",null,g.a.createElement(E.c,{id:"admin.ldap.jobExtraInfo.updatedUsers",defaultMessage:"Updated {updateCount, number} users.",values:{updateCount:r}})),a>0&&g.a.createElement("li",null,g.a.createElement(E.c,{id:"admin.ldap.jobExtraInfo.deactivatedUsers",defaultMessage:"Deactivated {deleteCount, number} users.",values:{deleteCount:a}})),o>0&&g.a.createElement("li",null,g.a.createElement(E.c,{id:"admin.ldap.jobExtraInfo.deletedGroups",defaultMessage:"Deleted {groupDeleteCount, number} groups.",values:{groupDeleteCount:o}})),s>0&&g.a.createElement("li",null,g.a.createElement(E.c,{id:"admin.ldap.jobExtraInfo.deletedGroupMembers",defaultMessage:"Deleted {groupMemberDeleteCount, number} group members.",values:{groupMemberDeleteCount:s}})),l>0&&g.a.createElement("li",null,g.a.createElement(E.c,{id:"admin.ldap.jobExtraInfo.addedGroupMembers",defaultMessage:"Added {groupMemberAddCount, number} group members.",values:{groupMemberAddCount:l}}))))}}]}},saml:{url:"authentication/saml",title:Object(A.b)("admin.sidebar.saml"),title_default:"SAML 2.0",isHidden:Vg.isnt(Vg.licensedForFeature("SAML")),schema:{id:"SamlSettings",name:Object(A.b)("admin.authentication.saml"),name_default:"SAML 2.0",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"SamlSettings.Enable",label:Object(A.b)("admin.saml.enableTitle"),label_default:"Enable Login With SAML 2.0:",help_text:Object(A.b)("admin.saml.enableDescription"),help_text_default:"When true, Mattermost allows login using SAML 2.0. Please see [documentation](!http://docs.mattermost.com/deployment/sso-saml.html) to learn more about configuring SAML for Mattermost.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"SamlSettings.EnableSyncWithLdap",label:Object(A.b)("admin.saml.enableSyncWithLdapTitle"),label_default:"Enable Synchronizing SAML Accounts With AD/LDAP:",help_text:Object(A.b)("admin.saml.enableSyncWithLdapDescription"),help_text_default:"When true, Mattermost periodically synchronizes SAML user attributes, including user deactivation and removal, from AD/LDAP. Enable and configure synchronization settings at **Authentication > AD/LDAP**. When false, user attributes are updated from SAML during user login. See [documentation](!https://about.mattermost.com/default-saml-ldap-sync) to learn more.",help_text_markdown:!0,isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_BOOL,key:"SamlSettings.EnableSyncWithLdapIncludeAuth",label:Object(A.b)("admin.saml.enableSyncWithLdapIncludeAuthTitle"),label_default:"Override SAML bind data with AD/LDAP information:",help_text:Object(A.b)("admin.saml.enableSyncWithLdapIncludeAuthDescription"),help_text_default:"When true, Mattermost will override the SAML ID attribute with the AD/LDAP ID attribute if configured or override the SAML Email attribute with the AD/LDAP Email attribute if SAML ID attribute is not present.  This will allow you automatically migrate users from Email binding to ID binding to prevent creation of new users when an email address changes for a user. Moving from true to false, will remove the override from happening.\n \n**Note:** SAML IDs must match the LDAP IDs to prevent disabling of user accounts.  Please review [documentation](!https://docs.mattermost.com/deployment/sso-saml-ldapsync.html) for more information.",help_text_markdown:!0,isDisabled:Vg.either(Vg.stateIsFalse("SamlSettings.Enable"),Vg.stateIsFalse("SamlSettings.EnableSyncWithLdap"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.IdpUrl",label:Object(A.b)("admin.saml.idpUrlTitle"),label_default:"SAML SSO URL:",help_text:Object(A.b)("admin.saml.idpUrlDesc"),help_text_default:"The URL where Mattermost sends a SAML request to start login sequence.",placeholder:Object(A.b)("admin.saml.idpUrlEx"),placeholder_default:'E.g.: "https://idp.example.org/SAML2/SSO/Login"',isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.IdpDescriptorUrl",label:Object(A.b)("admin.saml.idpDescriptorUrlTitle"),label_default:"Identity Provider Issuer URL:",help_text:Object(A.b)("admin.saml.idpDescriptorUrlDesc"),help_text_default:"The issuer URL for the Identity Provider you use for SAML requests.",placeholder:Object(A.b)("admin.saml.idpDescriptorUrlEx"),placeholder_default:'E.g.: "https://idp.example.org/SAML2/issuer"',isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_FILE_UPLOAD,key:"SamlSettings.IdpCertificateFile",label:Object(A.b)("admin.saml.idpCertificateFileTitle"),label_default:"Identity Provider Public Certificate:",help_text:Object(A.b)("admin.saml.idpCertificateFileDesc"),help_text_default:"The public authentication certificate issued by your Identity Provider.",remove_help_text:Object(A.b)("admin.saml.idpCertificateFileRemoveDesc"),remove_help_text_default:"Remove the public authentication certificate issued by your Identity Provider.",remove_button_text:Object(A.b)("admin.saml.remove.idp_certificate"),remove_button_text_default:"Remove Identity Provider Certificate",removing_text:Object(A.b)("admin.saml.removing.certificate"),removing_text_default:"Removing Certificate...",uploading_text:Object(A.b)("admin.saml.uploading.certificate"),uploading_text_default:"Uploading Certificate...",isDisabled:Vg.stateIsFalse("SamlSettings.Enable"),fileType:".crt,.cer,.cert,.pem",upload_action:d.G,remove_action:d.y},{type:w.i.SettingsTypes.TYPE_BOOL,key:"SamlSettings.Verify",label:Object(A.b)("admin.saml.verifyTitle"),label_default:"Verify Signature:",help_text:Object(A.b)("admin.saml.verifyDescription"),help_text_default:"When false, Mattermost will not verify that the signature sent from a SAML Response matches the Service Provider Login URL. Not recommended for production environments. For testing only.",isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.AssertionConsumerServiceURL",label:Object(A.b)("admin.saml.assertionConsumerServiceURLTitle"),label_default:"Service Provider Login URL:",help_text:Object(A.b)("admin.saml.assertionConsumerServiceURLPopulatedDesc"),help_text_default:"This field is also known as the Assertion Consumer Service URL.",placeholder:Object(A.b)("admin.saml.assertionConsumerServiceURLEx"),placeholder_default:'E.g.: "https://<your-mattermost-url>/login/sso/saml"',isDisabled:Vg.either(Vg.stateIsFalse("SamlSettings.Enable"),Vg.stateIsFalse("SamlSettings.Verify")),onConfigLoad:function(e,t){var n=t.ServiceSettings.SiteURL;if(n.length>0&&0===e.length){var a="/"===n[n.length-1]?"":"/";return"".concat(n).concat(a,"login/sso/saml")}return e}},{type:w.i.SettingsTypes.TYPE_BOOL,key:"SamlSettings.Encrypt",label:Object(A.b)("admin.saml.encryptTitle"),label_default:"Enable Encryption:",help_text:Object(A.b)("admin.saml.encryptDescription"),help_text_default:"When false, Mattermost will not decrypt SAML Assertions encrypted with your Service Provider Public Certificate. Not recommended for production environments. For testing only.",isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_FILE_UPLOAD,key:"SamlSettings.PrivateKeyFile",label:Object(A.b)("admin.saml.privateKeyFileTitle"),label_default:"Service Provider Private Key:",help_text:Object(A.b)("admin.saml.privateKeyFileFileDesc"),help_text_default:"The private key used to decrypt SAML Assertions from the Identity Provider.",remove_help_text:Object(A.b)("admin.saml.privateKeyFileFileRemoveDesc"),remove_help_text_default:"Remove the private key used to decrypt SAML Assertions from the Identity Provider.",remove_button_text:Object(A.b)("admin.saml.remove.privKey"),remove_button_text_default:"Remove Service Provider Private Key",removing_text:Object(A.b)("admin.saml.removing.privKey"),removing_text_default:"Removing Private Key...",uploading_text:Object(A.b)("admin.saml.uploading.privateKey"),uploading_text_default:"Uploading Private Key...",isDisabled:Vg.either(Vg.stateIsFalse("SamlSettings.Enable"),Vg.stateIsFalse("SamlSettings.Encrypt")),fileType:".key",upload_action:d.H,remove_action:d.z},{type:w.i.SettingsTypes.TYPE_FILE_UPLOAD,key:"SamlSettings.PublicCertificateFile",label:Object(A.b)("admin.saml.publicCertificateFileTitle"),label_default:"Service Provider Public Certificate:",help_text:Object(A.b)("admin.saml.publicCertificateFileDesc"),help_text_default:"The certificate used to generate the signature on a SAML request to the Identity Provider for a service provider initiated SAML login, when Mattermost is the Service Provider.",remove_help_text:Object(A.b)("admin.saml.publicCertificateFileRemoveDesc"),remove_help_text_default:"Remove the certificate used to generate the signature on a SAML request to the Identity Provider for a service provider initiated SAML login, when Mattermost is the Service Provider.",remove_button_text:Object(A.b)("admin.saml.remove.sp_certificate"),remove_button_text_default:"Remove Service Provider Certificate",removing_text:Object(A.b)("admin.saml.removing.certificate"),removing_text_default:"Removing Certificate...",uploading_text:Object(A.b)("admin.saml.uploading.certificate"),uploading_text_default:"Uploading Certificate...",isDisabled:Vg.either(Vg.stateIsFalse("SamlSettings.Enable"),Vg.stateIsFalse("SamlSettings.Encrypt")),fileType:".crt,.cer",upload_action:d.I,remove_action:d.A},{type:w.i.SettingsTypes.TYPE_BOOL,key:"SamlSettings.SignRequest",label:Object(A.b)("admin.saml.signRequestTitle"),label_default:"Sign Request:",help_text:Object(A.b)("admin.saml.signRequestDescription"),help_text_default:"When true, Mattermost will sign the SAML request using your private key. When false, Mattermost will not sign the SAML request.",isDisabled:Vg.either(Vg.stateIsFalse("SamlSettings.Encrypt"),Vg.stateIsFalse("SamlSettings.PrivateKeyFile"),Vg.stateIsFalse("SamlSettings.PublicCertificateFile"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.EmailAttribute",label:Object(A.b)("admin.saml.emailAttrTitle"),label_default:"Email Attribute:",placeholder:Object(A.b)("admin.saml.emailAttrEx"),placeholder_default:'E.g.: "Email" or "PrimaryEmail"',help_text:Object(A.b)("admin.saml.emailAttrDesc"),help_text_default:"The attribute in the SAML Assertion that will be used to populate the email addresses of users in Mattermost.",isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.UsernameAttribute",label:Object(A.b)("admin.saml.usernameAttrTitle"),label_default:"Username Attribute:",placeholder:Object(A.b)("admin.saml.usernameAttrEx"),placeholder_default:'E.g.: "Username"',help_text:Object(A.b)("admin.saml.usernameAttrDesc"),help_text_default:"The attribute in the SAML Assertion that will be used to populate the username field in Mattermost.",isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.IdAttribute",label:Object(A.b)("admin.saml.idAttrTitle"),label_default:"Id Attribute:",placeholder:Object(A.b)("admin.saml.idAttrEx"),placeholder_default:'E.g.: "Id"',help_text:Object(A.b)("admin.saml.idAttrDesc"),help_text_default:"(Optional) The attribute in the SAML Assertion that will be used to bind users from SAML to users in Mattermost.",isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.FirstNameAttribute",label:Object(A.b)("admin.saml.firstnameAttrTitle"),label_default:"First Name Attribute:",placeholder:Object(A.b)("admin.saml.firstnameAttrEx"),placeholder_default:'E.g.: "FirstName"',help_text:Object(A.b)("admin.saml.firstnameAttrDesc"),help_text_default:"(Optional) The attribute in the SAML Assertion that will be used to populate the first name of users in Mattermost.",isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.LastNameAttribute",label:Object(A.b)("admin.saml.lastnameAttrTitle"),label_default:"Last Name Attribute:",placeholder:Object(A.b)("admin.saml.lastnameAttrEx"),placeholder_default:'E.g.: "LastName"',help_text:Object(A.b)("admin.saml.lastnameAttrDesc"),help_text_default:"(Optional) The attribute in the SAML Assertion that will be used to populate the last name of users in Mattermost.",isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.NicknameAttribute",label:Object(A.b)("admin.saml.nicknameAttrTitle"),label_default:"Nickname Attribute:",placeholder:Object(A.b)("admin.saml.nicknameAttrEx"),placeholder_default:'E.g.: "Nickname"',help_text:Object(A.b)("admin.saml.nicknameAttrDesc"),help_text_default:"(Optional) The attribute in the SAML Assertion that will be used to populate the nickname of users in Mattermost.",isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.PositionAttribute",label:Object(A.b)("admin.saml.positionAttrTitle"),label_default:"Position Attribute:",placeholder:Object(A.b)("admin.saml.positionAttrEx"),placeholder_default:'E.g.: "Role"',help_text:Object(A.b)("admin.saml.positionAttrDesc"),help_text_default:"(Optional) The attribute in the SAML Assertion that will be used to populate the position of users in Mattermost.",isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.LocaleAttribute",label:Object(A.b)("admin.saml.localeAttrTitle"),label_default:"Preferred Language Attribute:",placeholder:Object(A.b)("admin.saml.localeAttrEx"),placeholder_default:'E.g.: "Locale" or "PrimaryLanguage"',help_text:Object(A.b)("admin.saml.localeAttrDesc"),help_text_default:"(Optional) The attribute in the SAML Assertion that will be used to populate the language of users in Mattermost.",isDisabled:Vg.stateIsFalse("SamlSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.LoginButtonText",label:Object(A.b)("admin.saml.loginButtonTextTitle"),label_default:"Login Button Text:",placeholder:Object(A.b)("admin.saml.loginButtonTextEx"),placeholder_default:'E.g.: "OKTA"',help_text:Object(A.b)("admin.saml.loginButtonTextDesc"),help_text_default:'(Optional) The text that appears in the login button on the login page. Defaults to "SAML".',isDisabled:Vg.stateIsFalse("SamlSettings.Enable")}]}},gitlab:{url:"authentication/gitlab",title:Object(A.b)("admin.sidebar.gitlab"),title_default:"GitLab",isHidden:Vg.licensed,schema:{id:"GitLabSettings",name:Object(A.b)("admin.authentication.gitlab"),name_default:"GitLab",onConfigLoad:function(e){var t={};return t["GitLabSettings.Url"]=e.GitLabSettings.UserApiEndpoint.replace("/api/v4/user",""),t},onConfigSave:function(e){var t=Yg({},e);return t.GitLabSettings.UserApiEndpoint=e.GitLabSettings.Url.replace(/\/$/,"")+"/api/v4/user",t},settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"GitLabSettings.Enable",label:Object(A.b)("admin.gitlab.enableTitle"),label_default:"Enable authentication with GitLab: ",help_text:Object(A.b)("admin.gitlab.enableDescription"),help_text_default:'When true, Mattermost allows team creation and account signup using GitLab OAuth.\n \n1. Log in to your GitLab account and go to Profile Settings -> Applications.\n2. Enter Redirect URIs "<your-mattermost-url>/login/gitlab/complete" (example: http://localhost:8065/login/gitlab/complete) and "<your-mattermost-url>/signup/gitlab/complete".\n3. Then use "Application Secret Key" and "Application ID" fields from GitLab to complete the options below.\n4. Complete the Endpoint URLs below.',help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.Id",label:Object(A.b)("admin.gitlab.clientIdTitle"),label_default:"Application ID:",help_text:Object(A.b)("admin.gitlab.clientIdDescription"),help_text_default:"Obtain this value via the instructions above for logging into GitLab.",placeholder:Object(A.b)("admin.gitlab.clientIdExample"),placeholder_default:'E.g.: "jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY"',isDisabled:Vg.stateIsFalse("GitLabSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.Secret",label:Object(A.b)("admin.gitlab.clientSecretTitle"),label_default:"Application Secret Key:",help_text:Object(A.b)("admin.gitlab.clientSecretDescription"),help_text_default:"Obtain this value via the instructions above for logging into GitLab.",placeholder:Object(A.b)("admin.gitlab.clientSecretExample"),placeholder_default:'E.g.: "jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY"',isDisabled:Vg.stateIsFalse("GitLabSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.Url",label:Object(A.b)("admin.gitlab.siteUrl"),label_default:"GitLab Site URL:",help_text:Object(A.b)("admin.gitlab.siteUrlDescription"),help_text_default:"Enter the URL of your GitLab instance, e.g. https://example.com:3000. If your GitLab instance is not set up with SSL, start the URL with http:// instead of https://.",placeholder:Object(A.b)("admin.gitlab.siteUrlExample"),placeholder_default:"E.g.: https://",isDisabled:Vg.stateIsFalse("GitLabSettings.Enable")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.UserApiEndpoint",label:Object(A.b)("admin.gitlab.userTitle"),label_default:"User API Endpoint:",dynamic_value:function(e,t,n){return n["GitLabSettings.Url"]?n["GitLabSettings.Url"].replace(/\/$/,"")+"/api/v4/user":""},isDisabled:!0},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.AuthEndpoint",label:Object(A.b)("admin.gitlab.authTitle"),label_default:"Auth Endpoint:",dynamic_value:function(e,t,n){return n["GitLabSettings.Url"]?n["GitLabSettings.Url"].replace(/\/$/,"")+"/oauth/authorize":""},isDisabled:!0},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.TokenEndpoint",label:Object(A.b)("admin.gitlab.tokenTitle"),label_default:"Token Endpoint:",dynamic_value:function(e,t,n){return n["GitLabSettings.Url"]?n["GitLabSettings.Url"].replace(/\/$/,"")+"/oauth/token":""},isDisabled:!0}]}},oauth:{url:"authentication/oauth",title:Object(A.b)("admin.sidebar.oauth"),title_default:"OAuth 2.0",isHidden:Vg.isnt(Vg.licensed),schema:{id:"OAuthSettings",name:Object(A.b)("admin.authentication.oauth"),name_default:"OAuth 2.0",onConfigLoad:function(e){var t={};return e.GitLabSettings&&e.GitLabSettings.Enable&&(t.oauthType=w.i.GITLAB_SERVICE),e.Office365Settings&&e.Office365Settings.Enable&&(t.oauthType=w.i.OFFICE365_SERVICE),e.GoogleSettings&&e.GoogleSettings.Enable&&(t.oauthType=w.i.GOOGLE_SERVICE),t["GitLabSettings.Url"]=e.GitLabSettings.UserApiEndpoint.replace("/api/v4/user",""),t},onConfigSave:function(e){var t=Yg({},e);return t.GitLabSettings=e.GitLabSettings||{},t.Office365Settings=e.Office365Settings||{},t.GoogleSettings=e.GoogleSettings||{},t.GitLabSettings.Enable=!1,t.Office365Settings.Enable=!1,t.GoogleSettings.Enable=!1,t.GitLabSettings.UserApiEndpoint=e.GitLabSettings.Url.replace(/\/$/,"")+"/api/v4/user",e.oauthType===w.i.GITLAB_SERVICE&&(t.GitLabSettings.Enable=!0),e.oauthType===w.i.OFFICE365_SERVICE&&(t.Office365Settings.Enable=!0),e.oauthType===w.i.GOOGLE_SERVICE&&(t.GoogleSettings.Enable=!0),delete t.oauthType,t},settings:[{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"oauthType",label:Object(A.b)("admin.oauth.select"),label_default:"Select OAuth 2.0 Service Provider:",options:[{value:"off",display_name:Object(A.b)("admin.oauth.off"),display_name_default:"Do not allow sign-in via an OAuth 2.0 provider."},{value:w.i.GITLAB_SERVICE,display_name:Object(A.b)("admin.oauth.gitlab"),display_name_default:"GitLab",help_text:Object(A.b)("admin.gitlab.EnableMarkdownDesc"),help_text_default:'1. Log in to your GitLab account and go to Profile Settings -> Applications.\n2. Enter Redirect URIs "<your-mattermost-url>/login/gitlab/complete" (example: http://localhost:8065/login/gitlab/complete) and "<your-mattermost-url>/signup/gitlab/complete".\n3. Then use "Application Secret Key" and "Application ID" fields from GitLab to complete the options below.\n4. Complete the Endpoint URLs below.',help_text_markdown:!0},{value:w.i.GOOGLE_SERVICE,display_name:Object(A.b)("admin.oauth.google"),display_name_default:"Google Apps",isHidden:Vg.isnt(Vg.licensedForFeature("GoogleOAuth")),help_text:Object(A.b)("admin.google.EnableMarkdownDesc"),help_text_default:'1. [Log in](!https://accounts.google.com/login) to your Google account.\n2. Go to [https://console.developers.google.com](!https://console.developers.google.com), click **Credentials** in the left hand sidebar and enter "Mattermost - your-company-name" as the **Project Name**, then click **Create**.\n3. Click the **OAuth consent screen** header and enter "Mattermost" as the **Product name shown to users**, then click **Save**.\n4. Under the **Credentials** header, click **Create credentials**, choose **OAuth client ID** and select **Web Application**.\n5. Under **Restrictions** and **Authorized redirect URIs** enter **your-mattermost-url/signup/google/complete** (example: http://localhost:8065/signup/google/complete). Click **Create**.\n6. Paste the **Client ID** and **Client Secret** to the fields below, then click **Save**.\n7. Finally, go to [Google+ API](!https://console.developers.google.com/apis/api/plus/overview") and click *Enable*. This might take a few minutes to propagate through Google`s systems.',help_text_markdown:!0},{value:w.i.OFFICE365_SERVICE,display_name:Object(A.b)("admin.oauth.office365"),display_name_default:"Office 365",isHidden:Vg.isnt(Vg.licensedForFeature("Office365OAuth")),help_text:Object(A.b)("admin.office365.EnableMarkdownDesc"),help_text_default:'1. [Log in](!https://login.microsoftonline.com/) to your Microsoft or Office 365 account. Make sure it`s the account on the same [tenant](!https://msdn.microsoft.com/en-us/library/azure/jj573650.aspx#Anchor_0) that you would like users to log in with.\n2. Go to [https://apps.dev.microsoft.com](!https://apps.dev.microsoft.com), click **Go to app list** > **Add an app** and use "Mattermost - your-company-name" as the **Application Name**.\n3. Under **Application Secrets**, click **Generate New Password** and paste it to the **Application Secret Password** field below.\n4. Under **Platforms**, click **Add Platform**, choose **Web** and enter **your-mattermost-url/signup/office365/complete** (example: http://localhost:8065/signup/office365/complete) under **Redirect URIs**. Also uncheck **Allow Implicit Flow**.\n5. Finally, click **Save** and then paste the **Application ID** below.',help_text_markdown:!0}]},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.Id",label:Object(A.b)("admin.gitlab.clientIdTitle"),label_default:"Application ID:",help_text:Object(A.b)("admin.gitlab.clientIdDescription"),help_text_default:"Obtain this value via the instructions above for logging into GitLab.",placeholder:Object(A.b)("admin.gitlab.clientIdExample"),placeholder_default:'E.g.: "jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY"',isHidden:Vg.isnt(Vg.stateEquals("oauthType","gitlab"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.Secret",label:Object(A.b)("admin.gitlab.clientSecretTitle"),label_default:"Application Secret Key:",help_text:Object(A.b)("admin.gitlab.clientSecretDescription"),help_text_default:"Obtain this value via the instructions above for logging into GitLab.",placeholder:Object(A.b)("admin.gitlab.clientSecretExample"),placeholder_default:'E.g.: "jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY"',isHidden:Vg.isnt(Vg.stateEquals("oauthType","gitlab"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.Url",label:Object(A.b)("admin.gitlab.siteUrl"),label_default:"GitLab Site URL:",help_text:Object(A.b)("admin.gitlab.siteUrlDescription"),help_text_default:"Enter the URL of your GitLab instance, e.g. https://example.com:3000. If your GitLab instance is not set up with SSL, start the URL with http:// instead of https://.",placeholder:Object(A.b)("admin.gitlab.siteUrlExample"),placeholder_default:"E.g.: https://",isHidden:Vg.isnt(Vg.stateEquals("oauthType","gitlab"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.UserApiEndpoint",label:Object(A.b)("admin.gitlab.userTitle"),label_default:"User API Endpoint:",dynamic_value:function(e,t,n){return n["GitLabSettings.Url"]?n["GitLabSettings.Url"].replace(/\/$/,"")+"/api/v4/user":""},isDisabled:!0,isHidden:Vg.isnt(Vg.stateEquals("oauthType","gitlab"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.AuthEndpoint",label:Object(A.b)("admin.gitlab.authTitle"),label_default:"Auth Endpoint:",dynamic_value:function(e,t,n){return n["GitLabSettings.Url"]?n["GitLabSettings.Url"].replace(/\/$/,"")+"/oauth/authorize":""},isDisabled:!0,isHidden:Vg.isnt(Vg.stateEquals("oauthType","gitlab"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GitLabSettings.TokenEndpoint",label:Object(A.b)("admin.gitlab.tokenTitle"),label_default:"Token Endpoint:",dynamic_value:function(e,t,n){return n["GitLabSettings.Url"]?n["GitLabSettings.Url"].replace(/\/$/,"")+"/oauth/token":""},isDisabled:!0,isHidden:Vg.isnt(Vg.stateEquals("oauthType","gitlab"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GoogleSettings.Id",label:Object(A.b)("admin.google.clientIdTitle"),label_default:"Client ID:",help_text:Object(A.b)("admin.google.clientIdDescription"),help_text_default:"The Client ID you received when registering your application with Google.",placeholder:Object(A.b)("admin.google.clientIdExample"),placeholder_default:'E.g.: "7602141235235-url0fhs1mayfasbmop5qlfns8dh4.apps.googleusercontent.com"',isHidden:Vg.isnt(Vg.stateEquals("oauthType","google"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GoogleSettings.Secret",label:Object(A.b)("admin.google.clientSecretTitle"),label_default:"Client Secret:",help_text:Object(A.b)("admin.google.clientSecretDescription"),help_text_default:"The Client Secret you received when registering your application with Google.",placeholder:Object(A.b)("admin.google.clientSecretExample"),placeholder_default:'E.g.: "H8sz0Az-dDs2p15-7QzD231"',isHidden:Vg.isnt(Vg.stateEquals("oauthType","google"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GoogleSettings.UserApiEndpoint",label:Object(A.b)("admin.google.userTitle"),label_default:"User API Endpoint:",dynamic_value:function(){return"https://people.googleapis.com/v1/people/me?personFields=names,emailAddresses,nicknames,metadata"},isDisabled:!0,isHidden:Vg.isnt(Vg.stateEquals("oauthType","google"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GoogleSettings.AuthEndpoint",label:Object(A.b)("admin.google.authTitle"),label_default:"Auth Endpoint:",dynamic_value:function(){return"https://accounts.google.com/o/oauth2/v2/auth"},isDisabled:!0,isHidden:Vg.isnt(Vg.stateEquals("oauthType","google"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"GoogleSettings.TokenEndpoint",label:Object(A.b)("admin.google.tokenTitle"),label_default:"Token Endpoint:",dynamic_value:function(){return"https://www.googleapis.com/oauth2/v4/token"},isDisabled:!0,isHidden:Vg.isnt(Vg.stateEquals("oauthType","google"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"Office365Settings.Id",label:Object(A.b)("admin.office365.clientIdTitle"),label_default:"Application ID:",help_text:Object(A.b)("admin.office365.clientIdDescription"),help_text_default:"The Application/Client ID you received when registering your application with Microsoft.",placeholder:Object(A.b)("admin.office365.clientIdExample"),placeholder_default:'E.g.: "adf3sfa2-ag3f-sn4n-ids0-sh1hdax192qq"',isHidden:Vg.isnt(Vg.stateEquals("oauthType","office365"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"Office365Settings.Secret",label:Object(A.b)("admin.office365.clientSecretTitle"),label_default:"Application Secret Password:",help_text:Object(A.b)("admin.office365.clientSecretDescription"),help_text_default:"The Application Secret Password you generated when registering your application with Microsoft.",placeholder:Object(A.b)("admin.office365.clientSecretExample"),placeholder_default:'E.g.: "shAieM47sNBfgl20f8ci294"',isHidden:Vg.isnt(Vg.stateEquals("oauthType","office365"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"Office365Settings.UserApiEndpoint",label:Object(A.b)("admin.office365.userTitle"),label_default:"User API Endpoint:",dynamic_value:function(){return"https://graph.microsoft.com/v1.0/me"},isDisabled:!0,isHidden:Vg.isnt(Vg.stateEquals("oauthType","office365"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"Office365Settings.AuthEndpoint",label:Object(A.b)("admin.office365.authTitle"),label_default:"Auth Endpoint:",dynamic_value:function(){return"https://login.microsoftonline.com/common/oauth2/v2.0/authorize"},isDisabled:!0,isHidden:Vg.isnt(Vg.stateEquals("oauthType","office365"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"Office365Settings.TokenEndpoint",label:Object(A.b)("admin.office365.tokenTitle"),label_default:"Token Endpoint:",dynamic_value:function(){return"https://login.microsoftonline.com/common/oauth2/v2.0/token"},isDisabled:!0,isHidden:Vg.isnt(Vg.stateEquals("oauthType","office365"))}]}}},plugins:{icon:"fa-plug",sectionTitle:Object(A.b)("admin.sidebar.plugins"),sectionTitleDefault:"Plugins (Beta)",id:"plugins",plugin_management:{url:"plugins/plugin_management",title:Object(A.b)("admin.plugins.pluginManagement"),title_default:"Plugin Management",searchableStrings:["admin.plugin.management.title","admin.plugins.settings.enable","admin.plugins.settings.enableDesc","admin.plugin.uploadTitle","admin.plugin.installedTitle","admin.plugin.installedDesc","admin.plugin.uploadDesc","admin.plugin.uploadDisabledDesc"],schema:{id:"PluginManagementSettings",component:rr}},custom:{url:"plugins/plugin_:plugin_id",schema:{id:"CustomPluginSettings",component:br}}},integrations:{icon:"fa-sitemap",sectionTitle:Object(A.b)("admin.sidebar.integrations"),sectionTitleDefault:"Integrations",id:"integrations",integration_management:{url:"integrations/integration_management",title:Object(A.b)("admin.integrations.integrationManagement"),title_default:"Integration Management",schema:{id:"CustomIntegrationSettings",name:Object(A.b)("admin.integrations.integrationManagement.title"),name_default:"Integration Management",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableIncomingWebhooks",label:Object(A.b)("admin.service.webhooksTitle"),label_default:"Enable Incoming Webhooks: ",help_text:Object(A.b)("admin.service.webhooksDescription"),help_text_default:"When true, incoming webhooks will be allowed. To help combat phishing attacks, all posts from webhooks will be labelled by a BOT tag. See [documentation](!http://docs.mattermost.com/developer/webhooks-incoming.html) to learn more.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableOutgoingWebhooks",label:Object(A.b)("admin.service.outWebhooksTitle"),label_default:"Enable Outgoing Webhooks: ",help_text:Object(A.b)("admin.service.outWebhooksDesc"),help_text_default:"When true, outgoing webhooks will be allowed. See [documentation](!http://docs.mattermost.com/developer/webhooks-outgoing.html) to learn more.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableCommands",label:Object(A.b)("admin.service.cmdsTitle"),label_default:"Enable Custom Slash Commands: ",help_text:Object(A.b)("admin.service.cmdsDesc"),help_text_default:"When true, custom slash commands will be allowed. See [documentation](!http://docs.mattermost.com/developer/slash-commands.html) to learn more.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableOAuthServiceProvider",label:Object(A.b)("admin.oauth.providerTitle"),label_default:"Enable OAuth 2.0 Service Provider: ",help_text:Object(A.b)("admin.oauth.providerDescription"),help_text_default:"When true, Mattermost can act as an OAuth 2.0 service provider allowing Mattermost to authorize API requests from external applications. See [documentation](!https://docs.mattermost.com/developer/oauth-2-0-applications.html) to learn more.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_PERMISSION,key:"ServiceSettings.EnableOnlyAdminIntegrations",label:Object(A.b)("admin.service.integrationAdmin"),label_default:"Restrict managing integrations to Admins:",help_text:Object(A.b)("admin.service.integrationAdminDesc"),help_text_default:"When true, webhooks and slash commands can only be created, edited and viewed by Team and System Admins, and OAuth 2.0 applications by System Admins. Integrations are available to all users after they have been created by the Admin.",permissions_mapping_name:"enableOnlyAdminIntegrations",isHidden:Vg.licensed},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnablePostUsernameOverride",label:Object(A.b)("admin.service.overrideTitle"),label_default:"Enable integrations to override usernames:",help_text:Object(A.b)("admin.service.overrideDescription"),help_text_default:"When true, webhooks, slash commands and other integrations, such as [Zapier](!https://docs.mattermost.com/integrations/zapier.html), will be allowed to change the username they are posting as. Note: Combined with allowing integrations to override profile picture icons, users may be able to perform phishing attacks by attempting to impersonate other users.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnablePostIconOverride",label:Object(A.b)("admin.service.iconTitle"),label_default:"Enable integrations to override profile picture icons:",help_text:Object(A.b)("admin.service.iconDescription"),help_text_default:"When true, webhooks, slash commands and other integrations, such as [Zapier](!https://docs.mattermost.com/integrations/zapier.html), will be allowed to change the profile picture they post with. Note: Combined with allowing integrations to override usernames, users may be able to perform phishing attacks by attempting to impersonate other users.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableUserAccessTokens",label:Object(A.b)("admin.service.userAccessTokensTitle"),label_default:"Enable User Access Tokens: ",help_text:Object(A.b)("admin.service.userAccessTokensDescription"),help_text_default:"When true, users can create [user access tokens](!https://about.mattermost.com/default-user-access-tokens) for integrations in **Account Settings > Security**. They can be used to authenticate against the API and give full access to the account.\n\n To manage who can create personal access tokens or to search users by token ID, go to the **User Management > Users** page.",help_text_markdown:!0}]}},bot_accounts:{url:"integrations/bot_accounts",title:Object(A.b)("admin.integrations.botAccounts"),title_default:"Bot Accounts",schema:{id:"BotAccountSettings",name:Object(A.b)("admin.integrations.botAccounts.title"),name_default:"Bot Accounts",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableBotAccountCreation",label:Object(A.b)("admin.service.enableBotTitle"),label_default:"Enable Bot Account Creation: ",help_text:Object(A.b)("admin.service.enableBotAccountCreation"),help_text_default:"When true, users can create bot accounts for integrations in **Integrations > Bot Accounts**. Bot accounts are similar to user accounts except they cannot be used to log in. See [documentation](https://mattermost.com/pl/default-bot-accounts) to learn more.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.DisableBotsWhenOwnerIsDeactivated",label:Object(A.b)("admin.service.disableBotOwnerDeactivatedTitle"),label_default:"Disable bot accounts when owner is deactivated:",help_text:Object(A.b)("admin.service.disableBotWhenOwnerIsDeactivated"),help_text_default:"When a user is deactivated, disables all bot accounts managed by the user. To re-enable bot accounts, go to **Integrations > Bot Accounts**.",help_text_markdown:!0}]}},gif:{url:"integrations/gif",title:Object(A.b)("admin.sidebar.gif"),title_default:"GIF (Beta)",schema:{id:"GifSettings",name:Object(A.b)("admin.integrations.gif"),name_default:"GIF (Beta)",settings:[{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableGifPicker",label:Object(A.b)("admin.customization.enableGifPickerTitle"),label_default:"Enable GIF Picker:",help_text:Object(A.b)("admin.customization.enableGifPickerDesc"),help_text_default:"Allow users to select GIFs from the emoji picker via a Gfycat integration."},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ServiceSettings.GfycatApiKey",label:Object(A.b)("admin.customization.gfycatApiKey"),label_default:"Gfycat API Key:",help_text:Object(A.b)("admin.customization.gfycatApiKeyDescription"),help_text_default:"Request an API key at [https://developers.gfycat.com/signup/#](!https://developers.gfycat.com/signup/#). Enter the client ID you receive via email to this field. When blank, uses the default API key provided by Gfycat.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ServiceSettings.GfycatApiSecret",label:Object(A.b)("admin.customization.gfycatApiSecret"),label_default:"Gfycat API Secret:",help_text:Object(A.b)("admin.customization.gfycatApiSecretDescription"),help_text_default:"The API secret generated by Gfycat for your API key. When blank, uses the default API secret provided by Gfycat."}]}},cors:{url:"integrations/cors",title:Object(A.b)("admin.sidebar.cors"),title_default:"CORS",isHidden:Vg.configIsTrue("ExperimentalSettings","RestrictSystemAdmin"),schema:{id:"CORS",name:Object(A.b)("admin.integrations.cors"),name_default:"CORS",settings:[{type:w.i.SettingsTypes.TYPE_TEXT,key:"ServiceSettings.AllowCorsFrom",label:Object(A.b)("admin.service.corsTitle"),label_default:"Enable cross-origin requests from:",placeholder:Object(A.b)("admin.service.corsEx"),placeholder_default:"http://example.com",help_text:Object(A.b)("admin.service.corsDescription"),help_text_default:'Enable HTTP Cross origin request from a specific domain. Use "*" if you want to allow CORS from any domain or leave it blank to disable it. Should not be set to "*" in production.'},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ServiceSettings.CorsExposedHeaders",label:Object(A.b)("admin.service.corsExposedHeadersTitle"),label_default:"CORS Exposed Headers:",placeholder:Object(A.b)("admin.service.corsHeadersEx"),placeholder_default:"X-My-Header",help_text:Object(A.b)("admin.service.corsExposedHeadersDescription"),help_text_default:"Whitelist of headers that will be accessible to the requester."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.CorsAllowCredentials",label:Object(A.b)("admin.service.corsAllowCredentialsLabel"),label_default:"CORS Allow Credentials:",help_text:Object(A.b)("admin.service.corsAllowCredentialsDescription"),help_text_default:"When true, requests that pass validation will include the Access-Control-Allow-Credentials header."},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.CorsDebug",label:Object(A.b)("admin.service.CorsDebugLabel"),label_default:"CORS Debug:",help_text:Object(A.b)("admin.service.corsDebugDescription"),help_text_default:'When true, prints messages to the logs to help when developing an integration that uses CORS. These messages will include the structured key value pair "source":"cors".'}]}}},compliance:{icon:"fa-list",sectionTitle:Object(A.b)("admin.sidebar.compliance"),sectionTitleDefault:"Compliance",data_retention:{url:"compliance/data_retention",title:Object(A.b)("admin.sidebar.dataRetentionPolicy"),title_default:"Data Retention Policy",isHidden:Vg.isnt(Vg.licensedForFeature("DataRetention")),searchableStrings:["admin.data_retention.title","admin.data_retention.messageRetentionDays.description","admin.data_retention.fileRetentionDays.description",["admin.data_retention.note.description",{documentationLink:""}],"admin.data_retention.enableMessageDeletion.title","admin.data_retention.enableMessageDeletion.description","admin.data_retention.enableFileDeletion.title","admin.data_retention.enableFileDeletion.description","admin.data_retention.deletionJobStartTime.title","admin.data_retention.deletionJobStartTime.description","admin.data_retention.createJob.title","admin.data_retention.createJob.help"],schema:{id:"DataRetentionSettings",component:Ah}},message_export:{url:"compliance/export",title:Object(A.b)("admin.sidebar.complianceExport"),title_default:"Compliance Export (Beta)",isHidden:Vg.isnt(Vg.licensedForFeature("MessageExport")),searchableStrings:["admin.service.complianceExportTitle","admin.service.complianceExportDesc","admin.complianceExport.exportJobStartTime.title","admin.complianceExport.exportJobStartTime.description","admin.complianceExport.exportFormat.title",["admin.complianceExport.exportFormat.description",{siteURL:""}],"admin.complianceExport.createJob.title","admin.complianceExport.createJob.help","admin.complianceExport.globalRelayCustomerType.title","admin.complianceExport.globalRelayCustomerType.description","admin.complianceExport.globalRelaySmtpUsername.title","admin.complianceExport.globalRelaySmtpUsername.description","admin.complianceExport.globalRelaySmtpPassword.title","admin.complianceExport.globalRelaySmtpPassword.description","admin.complianceExport.globalRelayEmailAddress.title","admin.complianceExport.globalRelayEmailAddress.description"],schema:{id:"MessageExportSettings",component:Hh}},audits:{url:"compliance/monitoring",title:Object(A.b)("admin.sidebar.complianceMonitoring"),title_default:"Compliance Monitoring",isHidden:Vg.isnt(Vg.licensed),searchableStrings:["admin.audits.title","admin.audits.reload"],schema:{id:"Audits",name:Object(A.b)("admin.compliance.complianceMonitoring"),name_default:"Compliance Monitoring",component:Hr,isHidden:Vg.isnt(Vg.licensedForFeature("Compliance")),settings:[{type:w.i.SettingsTypes.TYPE_BANNER,label:Object(A.b)("admin.compliance.newComplianceExportBanner"),label_markdown:!0,label_default:"This feature is replaced by a new [Compliance Export]({siteURL}/admin_console/compliance/export) feature, and will be removed in a future release. We recommend migrating to the new system.",label_values:{siteURL:Object(Rn.e)()},isHidden:Vg.isnt(Vg.licensedForFeature("Compliance")),banner_type:"info"},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ComplianceSettings.Enable",label:Object(A.b)("admin.compliance.enableTitle"),label_default:"Enable Compliance Reporting:",help_text:Object(A.b)("admin.compliance.enableDesc"),help_text_default:"When true, Mattermost allows compliance reporting from the **Compliance and Auditing** tab. See [documentation](!https://docs.mattermost.com/administration/compliance.html) to learn more.",help_text_markdown:!0,isHidden:Vg.isnt(Vg.licensedForFeature("Compliance"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ComplianceSettings.Directory",label:Object(A.b)("admin.compliance.directoryTitle"),label_default:"Compliance Report Directory:",help_text:Object(A.b)("admin.compliance.directoryDescription"),help_text_default:"Directory to which compliance reports are written. If blank, will be set to ./data/.",placeholder:Object(A.b)("admin.compliance.directoryExample"),placeholder_default:'E.g.: "./data/"',isDisabled:Vg.stateIsFalse("ComplianceSettings.Enable"),isHidden:Vg.isnt(Vg.licensedForFeature("Compliance"))},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ComplianceSettings.EnableDaily",label:Object(A.b)("admin.compliance.enableDailyTitle"),label_default:"Enable Daily Report:",help_text:Object(A.b)("admin.compliance.enableDailyDesc"),help_text_default:"When true, Mattermost will generate a daily compliance report.",isDisabled:Vg.stateIsFalse("ComplianceSettings.Enable"),isHidden:Vg.isnt(Vg.licensedForFeature("Compliance"))}]}},custom_terms_of_service:{url:"compliance/custom_terms_of_service",title:Object(A.b)("admin.sidebar.customTermsOfService"),title_default:"Custom Terms of Service (Beta)",isHidden:Vg.isnt(Vg.licensedForFeature("CustomTermsOfService")),searchableStrings:["admin.support.termsOfServiceTitle","admin.support.enableTermsOfServiceTitle","admin.support.enableTermsOfServiceHelp","admin.support.termsOfServiceTextTitle","admin.support.termsOfServiceTextHelp","admin.support.termsOfServiceReAcceptanceTitle","admin.support.termsOfServiceReAcceptanceHelp"],schema:{id:"TermsOfServiceSettings",component:Dg}}},experimental:{icon:"fa-flask",sectionTitle:Object(A.b)("admin.sidebar.experimental"),sectionTitleDefault:"Experimental",experimental_features:{url:"experimental/features",title:Object(A.b)("admin.sidebar.experimentalFeatures"),title_default:"Features",schema:{id:"ExperimentalSettings",name:Object(A.b)("admin.experimental.experimentalFeatures"),name_default:"Experimental Features",settings:[{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.LoginButtonColor",label:Object(A.b)("admin.experimental.ldapSettingsLoginButtonColor.title"),label_default:"AD/LDAP Login Button Color:",help_text:Object(A.b)("admin.experimental.ldapSettingsLoginButtonColor.desc"),help_text_default:"Specify the color of the AD/LDAP login button for white labeling purposes. Use a hex code with a #-sign before the code. This setting only applies to the mobile apps.",help_text_markdown:!1,isHidden:Vg.isnt(Vg.licensedForFeature("LDAP"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.LoginButtonBorderColor",label:Object(A.b)("admin.experimental.ldapSettingsLoginButtonBorderColor.title"),label_default:"AD/LDAP Login Button Border Color:",help_text:Object(A.b)("admin.experimental.ldapSettingsLoginButtonBorderColor.desc"),help_text_default:"Specify the color of the AD/LDAP login button border for white labeling purposes. Use a hex code with a #-sign before the code. This setting only applies to the mobile apps.",help_text_markdown:!1,isHidden:Vg.isnt(Vg.licensedForFeature("LDAP"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"LdapSettings.LoginButtonTextColor",label:Object(A.b)("admin.experimental.ldapSettingsLoginButtonTextColor.title"),label_default:"AD/LDAP Login Button Text Color:",help_text:Object(A.b)("admin.experimental.ldapSettingsLoginButtonTextColor.desc"),help_text_default:"Specify the color of the AD/LDAP login button text for white labeling purposes. Use a hex code with a #-sign before the code. This setting only applies to the mobile apps.",help_text_markdown:!1,isHidden:Vg.isnt(Vg.licensedForFeature("LDAP"))},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.ExperimentalEnableAuthenticationTransfer",label:Object(A.b)("admin.experimental.experimentalEnableAuthenticationTransfer.title"),label_default:"Allow Authentication Transfer:",help_text:Object(A.b)("admin.experimental.experimentalEnableAuthenticationTransfer.desc"),help_text_default:"When true, users can change their sign-in method to any that is enabled on the server, either via Account Settings or the APIs. When false, Users cannot change their sign-in method, regardless of which authentication options are enabled.",help_text_markdown:!1,isHidden:Vg.isnt(Vg.licensed)},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.CloseUnusedDirectMessages",label:Object(A.b)("admin.experimental.closeUnusedDirectMessages.title"),label_default:"Autoclose Direct Messages in Sidebar:",help_text:Object(A.b)("admin.experimental.closeUnusedDirectMessages.desc"),help_text_default:"When true, direct message conversations with no activity for 7 days will be hidden from the sidebar. When false, conversations remain in the sidebar until they are manually closed.",help_text_markdown:!1},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"ExperimentalSettings.LinkMetadataTimeoutMilliseconds",label:Object(A.b)("admin.experimental.linkMetadataTimeoutMilliseconds.title"),label_default:"Link Metadata Timeout:",help_text:Object(A.b)("admin.experimental.linkMetadataTimeoutMilliseconds.desc"),help_text_default:"The number of milliseconds to wait for metadata from a third-party link. Used with Post Metadata.",help_text_markdown:!1,placeholder:Object(A.b)("admin.experimental.linkMetadataTimeoutMilliseconds.example"),placeholder_default:'E.g.: "5000"'},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"EmailSettings.EmailBatchingBufferSize",label:Object(A.b)("admin.experimental.emailBatchingBufferSize.title"),label_default:"Email Batching Buffer Size:",help_text:Object(A.b)("admin.experimental.emailBatchingBufferSize.desc"),help_text_default:"Specify the maximum number of notifications batched into a single email.",help_text_markdown:!1,placeholder:Object(A.b)("admin.experimental.emailBatchingBufferSize.example"),placeholder_default:'E.g.: "256"'},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"EmailSettings.EmailBatchingInterval",label:Object(A.b)("admin.experimental.emailBatchingInterval.title"),label_default:"Email Batching Interval:",help_text:Object(A.b)("admin.experimental.emailBatchingInterval.desc"),help_text_default:"Specify the maximum frequency, in seconds, which the batching job checks for new notifications. Longer batching intervals will increase performance.",help_text_markdown:!1,placeholder:Object(A.b)("admin.experimental.emailBatchingInterval.example"),placeholder_default:'E.g.: "30"'},{type:w.i.SettingsTypes.TYPE_TEXT,key:"EmailSettings.LoginButtonColor",label:Object(A.b)("admin.experimental.emailSettingsLoginButtonColor.title"),label_default:"Email Login Button Color:",help_text:Object(A.b)("admin.experimental.emailSettingsLoginButtonColor.desc"),help_text_default:"Specify the color of the email login button for white labeling purposes. Use a hex code with a #-sign before the code. This setting only applies to the mobile apps.",help_text_markdown:!1},{type:w.i.SettingsTypes.TYPE_TEXT,key:"EmailSettings.LoginButtonBorderColor",label:Object(A.b)("admin.experimental.emailSettingsLoginButtonBorderColor.title"),label_default:"Email Login Button Border Color:",help_text:Object(A.b)("admin.experimental.emailSettingsLoginButtonBorderColor.desc"),help_text_default:"Specify the color of the email login button border for white labeling purposes. Use a hex code with a #-sign before the code. This setting only applies to the mobile apps.",help_text_markdown:!1},{type:w.i.SettingsTypes.TYPE_TEXT,key:"EmailSettings.LoginButtonTextColor",label:Object(A.b)("admin.experimental.emailSettingsLoginButtonTextColor.title"),label_default:"Email Login Button Text Color:",help_text:Object(A.b)("admin.experimental.emailSettingsLoginButtonTextColor.desc"),help_text_default:"Specify the color of the email login button text for white labeling purposes. Use a hex code with a #-sign before the code. This setting only applies to the mobile apps.",help_text_markdown:!1},{type:w.i.SettingsTypes.TYPE_BOOL,key:"TeamSettings.EnableUserDeactivation",label:Object(A.b)("admin.experimental.enableUserDeactivation.title"),label_default:"Enable Account Deactivation:",help_text:Object(A.b)("admin.experimental.enableUserDeactivation.desc"),help_text_default:"When true, users may deactivate their own account from **Account Settings > Advanced**. If a user deactivates their own account, they will get an email notification confirming they were deactivated. When false, users may not deactivate their own account.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"TeamSettings.ExperimentalEnableAutomaticReplies",label:Object(A.b)("admin.experimental.experimentalEnableAutomaticReplies.title"),label_default:"Enable Automatic Replies:",help_text:Object(A.b)("admin.experimental.experimentalEnableAutomaticReplies.desc"),help_text_default:"When true, users can enable Automatic Replies in **Account Settings > Notifications**. Users set a custom message that will be automatically sent in response to Direct Messages. When false, disables the Automatic Direct Message Replies feature and hides it from Account Settings.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableChannelViewedMessages",label:Object(A.b)("admin.experimental.enableChannelViewedMessages.title"),label_default:"Enable Channel Viewed WebSocket Messages:",help_text:Object(A.b)("admin.experimental.enableChannelViewedMessages.desc"),help_text_default:"This setting determines whether `channel_viewed` WebSocket events are sent, which synchronize unread notifications across clients and devices. Disabling the setting in larger deployments may improve server performance.",help_text_markdown:!1},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ExperimentalSettings.ClientSideCertEnable",label:Object(A.b)("admin.experimental.clientSideCertEnable.title"),label_default:"Enable Client-Side Certification:",help_text:Object(A.b)("admin.experimental.clientSideCertEnable.desc"),help_text_default:"Enables client-side certification for your Mattermost server. See [documentation](!https://docs.mattermost.com/deployment/certificate-based-authentication.html) to learn more.",help_text_markdown:!0,isHidden:Vg.isnt(Vg.licensedForFeature("SAML"))},{type:w.i.SettingsTypes.TYPE_DROPDOWN,key:"ExperimentalSettings.ClientSideCertCheck",label:Object(A.b)("admin.experimental.clientSideCertCheck.title"),label_default:"Client-Side Certification Login Method:",help_text:Object(A.b)("admin.experimental.clientSideCertCheck.desc"),help_text_default:"When **primary**, after the client side certificate is verified, user’s email is retrieved from the certificate and is used to log in without a password. When **secondary**, after the client side certificate is verified, user’s email is retrieved from the certificate and matched against the one supplied by the user. If they match, the user logs in with regular email/password credentials.",help_text_markdown:!0,options:[{value:"primary",display_name:"primary",display_name_default:"primary"},{value:"secondary",display_name:"secondary",display_name_default:"secondary"}],isDisabled:Vg.stateIsFalse("ExperimentalSettings.ClientSideCertEnable"),isHidden:Vg.isnt(Vg.licensedForFeature("SAML"))},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.ExperimentalEnableDefaultChannelLeaveJoinMessages",label:Object(A.b)("admin.experimental.experimentalEnableDefaultChannelLeaveJoinMessages.title"),label_default:"Enable Default Channel Leave/Join System Messages:",help_text:Object(A.b)("admin.experimental.experimentalEnableDefaultChannelLeaveJoinMessages.desc"),help_text_default:"This setting determines whether team leave/join system messages are posted in the default town-square channel.",help_text_markdown:!1},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.ExperimentalEnableHardenedMode",label:Object(A.b)("admin.experimental.experimentalEnableHardenedMode.title"),label_default:"Enable Hardened Mode:",help_text:Object(A.b)("admin.experimental.experimentalEnableHardenedMode.desc"),help_text_default:"Enables a hardened mode for Mattermost that makes user experience trade-offs in the interest of security. See [documentation](!https://docs.mattermost.com/administration/config-settings.html#enable-hardened-mode-experimental) to learn more.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.ExperimentalLdapGroupSync",label:Object(A.b)("admin.experimental.experimentalLdapGroupSync.title"),label_default:"Enable AD/LDAP Group Sync:",help_text:Object(A.b)("admin.experimental.experimentalLdapGroupSync.desc"),help_text_default:"When true, enables **AD/LDAP Group Sync** configurable under **User Management > Groups**. See [documentation](!https://mattermost.com/pl/default-ldap-group-sync) to learn more.",help_text_markdown:!0,isHidden:Vg.isnt(Vg.licensedForFeature("LDAPGroups"))},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnablePreviewFeatures",label:Object(A.b)("admin.experimental.enablePreviewFeatures.title"),label_default:"Enable Preview Features:",help_text:Object(A.b)("admin.experimental.enablePreviewFeatures.desc"),help_text_default:"When true, preview features can be enabled from **Account Settings > Advanced > Preview pre-release features**. When false, disables and hides preview features from **Account Settings > Advanced > Preview pre-release features**.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ThemeSettings.EnableThemeSelection",label:Object(A.b)("admin.experimental.enableThemeSelection.title"),label_default:"Enable Theme Selection:",help_text:Object(A.b)("admin.experimental.enableThemeSelection.desc"),help_text_default:"Enables the **Display > Theme** tab in Account Settings so users can select their theme.",help_text_markdown:!0,isHidden:Vg.isnt(Vg.licensed)},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ThemeSettings.AllowCustomThemes",label:Object(A.b)("admin.experimental.allowCustomThemes.title"),label_default:"Allow Custom Themes:",help_text:Object(A.b)("admin.experimental.allowCustomThemes.desc"),help_text_default:"Enables the **Display > Theme > Custom Theme** section in Account Settings.",help_text_markdown:!0,isHidden:Vg.isnt(Vg.licensed),isDisabled:Vg.stateIsFalse("ThemeSettings.EnableThemeSelection")},{type:w.i.SettingsTypes.TYPE_TEXT,key:"ThemeSettings.DefaultTheme",label:Object(A.b)("admin.experimental.defaultTheme.title"),label_default:"Default Theme:",help_text:Object(A.b)("admin.experimental.defaultTheme.desc"),help_text_default:"Set a default theme that applies to all new users on the system.",help_text_markdown:!0,options:[{value:"default",display_name:"default",display_name_default:"default"},{value:"organization",display_name:"organization",display_name_default:"organization"},{value:"mattermostDark",display_name:"mattermostDark",display_name_default:"mattermostDark"},{value:"windows10",display_name:"windows10",display_name_default:"windows10"}],isHidden:Vg.isnt(Vg.licensed)},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableTutorial",label:Object(A.b)("admin.experimental.enableTutorial.title"),label_default:"Enable Tutorial:",help_text:Object(A.b)("admin.experimental.enableTutorial.desc"),help_text_default:"When true, users are prompted with a tutorial when they open Mattermost for the first time after account creation. When false, the tutorial is disabled, and users are placed in Town Square when they open Mattermost for the first time after account creation.",help_text_markdown:!1},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.EnableUserTypingMessages",label:Object(A.b)("admin.experimental.enableUserTypingMessages.title"),label_default:"Enable User Typing Messages:",help_text:Object(A.b)("admin.experimental.enableUserTypingMessages.desc"),help_text_default:'This setting determines whether "user is typing..." messages are displayed below the message box. Disabling the setting in larger deployments may improve server performance.',help_text_markdown:!1},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"ServiceSettings.TimeBetweenUserTypingUpdatesMilliseconds",label:Object(A.b)("admin.experimental.timeBetweenUserTypingUpdatesMilliseconds.title"),label_default:"User Typing Timeout:",help_text:Object(A.b)("admin.experimental.timeBetweenUserTypingUpdatesMilliseconds.desc"),help_text_default:"The number of milliseconds to wait between emitting user typing websocket events.",help_text_markdown:!1,placeholder:Object(A.b)("admin.experimental.timeBetweenUserTypingUpdatesMilliseconds.example"),placeholder_default:'E.g.: "5000"',isDisabled:Vg.stateIsFalse("ServiceSettings.EnableUserTypingMessages")},{type:w.i.SettingsTypes.TYPE_BOOL,key:"TeamSettings.EnableXToLeaveChannelsFromLHS",label:Object(A.b)("admin.experimental.enableXToLeaveChannelsFromLHS.title"),label_default:"Enable X to Leave Channels from Left-Hand Sidebar:",help_text:Object(A.b)("admin.experimental.enableXToLeaveChannelsFromLHS.desc"),help_text_default:"When true, users can leave Public and Private Channels by clicking the “x” beside the channel name. When false, users must use the **Leave Channel** option from the channel menu to leave channels.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_TEXT,key:"TeamSettings.ExperimentalPrimaryTeam",label:Object(A.b)("admin.experimental.experimentalPrimaryTeam.title"),label_default:"Primary Team:",help_text:Object(A.b)("admin.experimental.experimentalPrimaryTeam.desc"),help_text_default:"The primary team of which users on the server are members. When a primary team is set, the options to join other teams or leave the primary team are disabled.",help_text_markdown:!0,placeholder:Object(A.b)("admin.experimental.experimentalPrimaryTeam.example"),placeholder_default:'E.g.: "teamname"'},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.LoginButtonColor",label:Object(A.b)("admin.experimental.samlSettingsLoginButtonColor.title"),label_default:"SAML Login Button Color:",help_text:Object(A.b)("admin.experimental.samlSettingsLoginButtonColor.desc"),help_text_default:"Specify the color of the SAML login button for white labeling purposes. Use a hex code with a #-sign before the code. This setting only applies to the mobile apps.",help_text_markdown:!1,isHidden:Vg.isnt(Vg.licensedForFeature("SAML"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.LoginButtonBorderColor",label:Object(A.b)("admin.experimental.samlSettingsLoginButtonBorderColor.title"),label_default:"SAML Login Button Border Color:",help_text:Object(A.b)("admin.experimental.samlSettingsLoginButtonBorderColor.desc"),help_text_default:"Specify the color of the SAML login button border for white labeling purposes. Use a hex code with a #-sign before the code. This setting only applies to the mobile apps.",help_text_markdown:!1,isHidden:Vg.isnt(Vg.licensedForFeature("SAML"))},{type:w.i.SettingsTypes.TYPE_TEXT,key:"SamlSettings.LoginButtonTextColor",label:Object(A.b)("admin.experimental.samlSettingsLoginButtonTextColor.title"),label_default:"SAML Login Button Text Color:",help_text:Object(A.b)("admin.experimental.samlSettingsLoginButtonTextColor.desc"),help_text_default:"Specify the color of the SAML login button text for white labeling purposes. Use a hex code with a #-sign before the code. This setting only applies to the mobile apps.",help_text_markdown:!1,isHidden:Vg.isnt(Vg.licensedForFeature("SAML"))},{type:w.i.SettingsTypes.TYPE_BOOL,key:"ServiceSettings.ExperimentalChannelOrganization",label:Object(A.b)("admin.experimental.experimentalChannelOrganization.title"),label_default:"Sidebar Organization:",help_text:Object(A.b)("admin.experimental.experimentalChannelOrganization.desc"),help_text_default:"Enables channel sidebar organization options in **Account Settings > Sidebar > Channel grouping and sorting** including options for grouping unread channels, sorting channels by most recent post and combining all channel types into a single list.",help_text_markdown:!0},{type:w.i.SettingsTypes.TYPE_BOOL,key:"DisplaySettings.ExperimentalTimezone",label:Object(A.b)("admin.experimental.experimentalTimezone.title"),label_default:"Timezone:",help_text:Object(A.b)("admin.experimental.experimentalTimezone.desc"),help_text_default:"Select the timezone used for timestamps in the user interface and email notifications. When true, the Timezone setting is visible in the Account Settings and a time zone is automatically assigned in the next active session. When false, the Timezone setting is hidden in the Account Settings.",help_text_markdown:!1},{type:w.i.SettingsTypes.TYPE_BOOL,key:"TeamSettings.ExperimentalHideTownSquareinLHS",label:Object(A.b)("admin.experimental.experimentalHideTownSquareinLHS.title"),label_default:"Town Square is Hidden in Left-Hand Sidebar:",help_text:Object(A.b)("admin.experimental.experimentalHideTownSquareinLHS.desc"),help_text_default:"When true, hides Town Square in the left-hand sidebar if there are no unread messages in the channel. When false, Town Square is always visible in the left-hand sidebar even if all messages have been read.",help_text_markdown:!0,isHidden:Vg.isnt(Vg.licensed)},{type:w.i.SettingsTypes.TYPE_BOOL,key:"TeamSettings.ExperimentalTownSquareIsReadOnly",label:Object(A.b)("admin.experimental.experimentalTownSquareIsReadOnly.title"),label_default:"Town Square is Read-Only:",help_text:Object(A.b)("admin.experimental.experimentalTownSquareIsReadOnly.desc"),help_text_default:"When true, only System Admins can post in Town Square. Other members are not able to post, reply, upload files, emoji react or pin messages to Town Square, nor are they able to change the channel name, header or purpose. When false, anyone can post in Town Square.",help_text_markdown:!0,isHidden:Vg.isnt(Vg.licensed)},{type:w.i.SettingsTypes.TYPE_BOOL,key:"EmailSettings.UseChannelInEmailNotifications",label:Object(A.b)("admin.experimental.useChannelInEmailNotifications.title"),label_default:"Use Channel Name in Email Notifications:",help_text:Object(A.b)("admin.experimental.useChannelInEmailNotifications.desc"),help_text_default:"When true, channel and team name appears in email notification subject lines. Useful for servers using only one team. When false, only team name appears in email notification subject line.",help_text_markdown:!1},{type:w.i.SettingsTypes.TYPE_NUMBER,key:"TeamSettings.UserStatusAwayTimeout",label:Object(A.b)("admin.experimental.userStatusAwayTimeout.title"),label_default:"User Status Away Timeout:",help_text:Object(A.b)("admin.experimental.userStatusAwayTimeout.desc"),help_text_default:'This setting defines the number of seconds after which the user’s status indicator changes to "Away", when they are away from Mattermost.',help_text_markdown:!1,placeholder:Object(A.b)("admin.experimental.userStatusAwayTimeout.example"),placeholder_default:'E.g.: "300"'}]}}}};function Jg(e,t){var n=[];if(e.title&&n.push(t.formatMessage({id:e.title,defaultMessage:e.title_default})),e.schema&&e.schema.name&&n.push(e.schema.name),e.searchableStrings){var a=!0,r=!1,i=void 0;try{for(var o,s=e.searchableStrings[Symbol.iterator]();!(a=(o=s.next()).done);a=!0){var l=o.value;"string"==typeof l?n.push(t.formatMessage({id:l,defaultMessage:l})):n.push(t.formatMessage({id:l[0],defaultMessage:""},l[1]))}}catch(e){r=!0,i=e}finally{try{a||null==s.return||s.return()}finally{if(r)throw i}}}if(e.schema&&e.schema.settings)for(var c=0,u=Object.values(e.schema.settings);c<u.length;c++){var m=u[c];m.label&&n.push(t.formatMessage({id:m.label,defaultMessage:m.label_default},m.label_values)),m.help_text&&"string"==typeof m.help_text&&n.push(t.formatMessage({id:m.help_text,defaultMessage:m.help_text_default},m.help_text_values)),m.remove_help_text&&n.push(t.formatMessage({id:m.remove_help_text,defaultMessage:m.remove_help_text_default})),m.remove_button_text&&n.push(t.formatMessage({id:m.remove_button_text,defaultMessage:m.remove_button_text_default}))}return n}function Kg(e){for(var t=new Mn.a,n=function(e,t){for(var n={},a=0,r=Object.values(e.about);a<r.length;a++){var i=r[a];n[i.url]=Jg(i,t)}for(var o=0,s=Object.values(e.reporting);o<s.length;o++){var l=s[o];n[l.url]=Jg(l,t)}for(var c=0,u=Object.values(e.user_management);c<u.length;c++){var m=u[c];n[m.url]=Jg(m,t)}for(var d=0,p=Object.values(e.environment);d<p.length;d++){var f=p[d];n[f.url]=Jg(f,t)}for(var b=0,h=Object.values(e.site);b<h.length;b++){var g=h[b];n[g.url]=Jg(g,t)}for(var y=0,v=Object.values(e.authentication);y<v.length;y++){var _=v[y];n[_.url]=Jg(_,t)}for(var E=0,S=Object.values(e.plugins);E<S.length;E++){var O=S[E];n[O.url]=Jg(O,t)}for(var T=0,w=Object.values(e.integrations);T<w.length;T++){var j=w[T];n[j.url]=Jg(j,t)}for(var x=0,P=Object.values(e.compliance);x<P.length;x++){var k=P[x];n[k.url]=Jg(k,t)}for(var C=0,M=Object.values(e.experimental);C<M.length;C++){var R=M[C];n[R.url]=Jg(R,t)}return n}(Xg,e),a=0,r=Object.keys(n);a<r.length;a++){var i=r[a],o="",s=!0,l=!1,c=void 0;try{for(var u,m=n[i][Symbol.iterator]();!(s=(u=m.next()).done);s=!0){o+=" "+u.value}}catch(e){l=!0,c=e}finally{try{s||null==m.return||m.return()}finally{if(l)throw c}}t.add(i,o)}return t}function Qg(e){return(Qg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zg(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function $g(e,t){return!t||"object"!==Qg(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ey(e){return(ey=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ty(e,t){return(ty=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object(A.b)("admin.field_names.allowBannerDismissal"),Object(A.b)("admin.field_names.bannerColor"),Object(A.b)("admin.field_names.bannerText"),Object(A.b)("admin.field_names.bannerTextColor"),Object(A.b)("admin.field_names.enableBanner"),Object(A.b)("admin.field_names.enableCommands"),Object(A.b)("admin.field_names.enableConfirmNotificationsToChannel"),Object(A.b)("admin.field_names.enableIncomingWebhooks"),Object(A.b)("admin.field_names.enableOAuthServiceProvider"),Object(A.b)("admin.field_names.enableOutgoingWebhooks"),Object(A.b)("admin.field_names.enablePostIconOverride"),Object(A.b)("admin.field_names.enablePostUsernameOverride"),Object(A.b)("admin.field_names.enableUserAccessTokens"),Object(A.b)("admin.field_names.enableUserCreation"),Object(A.b)("admin.field_names.maxChannelsPerTeam"),Object(A.b)("admin.field_names.maxNotificationsPerChannel"),Object(A.b)("admin.field_names.maxUsersPerTeam"),Object(A.b)("admin.field_names.postEditTimeLimit"),Object(A.b)("admin.field_names.restrictCreationToDomains"),Object(A.b)("admin.field_names.restrictDirectMessage"),Object(A.b)("admin.field_names.teammateNameDisplay");var ny=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$g(this,ey(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ty(e,t)}(t,g.a.Component),n=t,r=[{key:"propTypes",get:function(){return{name:b.a.string,title:b.a.node.isRequired,icon:b.a.string.isRequired,sectionClass:b.a.string,parentLink:b.a.string,children:b.a.node,action:b.a.node}}},{key:"defaultProps",get:function(){return{parentLink:""}}}],(a=[{key:"render",value:function(){var e=this,t=this.props.parentLink,n=g.a.createElement("div",{className:"category-title category-title--active"},g.a.createElement("i",{className:"category-icon fa "+this.props.icon}),g.a.createElement("span",{className:"category-title__text"},this.props.title),this.props.action);this.props.name&&(t+="/"+name,n=g.a.createElement(La.b,{to:t,className:"category-title",activeClassName:"category-title category-title--active"},n));var a=null;return this.props.children&&(a=g.a.createElement(l.b,{path:t,render:function(){return g.a.createElement("ul",{className:"sections "+e.props.sectionClass},g.a.Children.map(e.props.children,function(e){return null===e?null:g.a.cloneElement(e,{parentLink:t})}))}})),g.a.createElement("li",{className:"sidebar-category"},n,a)}}])&&Zg(n.prototype,a),r&&Zg(n,r),t}(),ay=n(1639),ry=n(1872),iy=n(1638),oy=n(1794),sy=n(1697),ly=n(1598),cy=function(e){var t=e.to,n=e.text;return g.a.createElement(Wi,{to:t},n)};cy.propTypes={to:b.a.string.isRequired,text:b.a.oneOfType([b.a.string,b.a.node]).isRequired};var uy=Object(ly.a)(cy);uy.displayName="MenuItemBlockableLinkImpl";var my=uy;function dy(e){return(dy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function py(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function fy(e){return(fy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function by(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hy(e,t){return(hy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yy=function(e){function t(){var e,n,a,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return a=this,r=(e=fy(t)).call.apply(e,[this].concat(o)),n=!r||"object"!==dy(r)&&"function"!=typeof r?by(a):r,gy(by(n),"handleLogout",function(e){n.props.navigationBlocked?(e.preventDefault(),n.props.actions.deferNavigation($c.e)):$c.e()}),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&hy(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){var e,t=this.props,n=t.locale,a=t.teams,r=t.siteName,i=this.context.intl.formatMessage,o=[];if(a&&a.length>0){var s=Object(Rl.a)(a,n),l=!0,c=!1,u=void 0;try{for(var m,d=s[Symbol.iterator]();!(l=(m=d.next()).done);l=!0){var p=m.value;o.push(g.a.createElement(my,{key:"team_"+p.name,to:"/"+p.name,text:N.ab("navbar_dropdown.switchTo","Switch to ")+" "+p.display_name}))}}catch(e){c=!0,u=e}finally{try{l||null==d.return||d.return()}finally{if(c)throw u}}}else e=g.a.createElement(my,{to:"/select_team",icon:g.a.createElement(E.c,{id:"select_team.icon",defaultMessage:"Select Team Icon"},function(e){return g.a.createElement("i",{className:"fa fa-exchange",title:e})}),text:N.ab("admin.nav.switch","Team Selection")});return g.a.createElement(Al.a,{ariaLabel:N.ab("admin.nav.menuAriaLabel","Admin Console Menu")},g.a.createElement(iy.a,null,o,e),g.a.createElement(iy.a,null,g.a.createElement(oy.a,{url:"https://about.mattermost.com/administrators-guide/",text:N.ab("admin.nav.administratorsGuide","Administrator Guide")}),g.a.createElement(oy.a,{url:"https://about.mattermost.com/troubleshooting-forum/",text:N.ab("admin.nav.troubleshootingForum","Troubleshooting Forum")}),g.a.createElement(oy.a,{url:"https://about.mattermost.com/commercial-support/",text:N.ab("admin.nav.commercialSupport","Commercial Support")}),g.a.createElement(sy.a,{modalId:w.r.ABOUT,dialogType:ry.a,text:i({id:"navbar_dropdown.about",defaultMessage:"About {appTitle}"},{appTitle:r||"Mattermost"})})),g.a.createElement(iy.a,null,g.a.createElement(Dl.a,{onClick:this.handleLogout,text:N.ab("navbar_dropdown.logout","Logout")})))}}])&&py(n.prototype,a),r&&py(n,r),t}();gy(yy,"propTypes",{locale:b.a.string.isRequired,siteName:b.a.string,navigationBlocked:b.a.bool,teams:b.a.arrayOf(b.a.object).isRequired,actions:b.a.shape({deferNavigation:b.a.func}).isRequired}),gy(yy,"contextTypes",{intl:E.i.isRequired});var vy=Object(a.connect)(function(e){return{locale:Object(ga.a)(e),teams:Object(ba.getMyTeams)(e),siteName:Object(c.getConfig)(e).SiteName,navigationBlocked:Object(p.a)(e)}},function(e){return{actions:Object(r.bindActionCreators)({deferNavigation:d.g},e)}})(yy);function _y(e){return(_y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ey(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Sy(e,t){return!t||"object"!==_y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Oy(e){return(Oy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ty(e,t){return(Ty=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var wy=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Sy(this,Oy(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ty(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){var e=this.props.currentUser,t=null;return e?(e.last_picture_update&&(t=g.a.createElement("img",{alt:"",className:"user__picture",src:gr.Client4.getProfilePictureUrl(e.id,e.last_picture_update)})),g.a.createElement(Nl.a,{className:"AdminSidebarHeader"},g.a.createElement("div",null,t,g.a.createElement("div",{className:"header__info"},g.a.createElement("div",{className:"team__name"},g.a.createElement(E.c,{id:"admin.sidebarHeader.systemConsole",defaultMessage:"System Console"})),g.a.createElement("div",{className:"user__name overflow--ellipsis whitespace--nowrap"},"@"+e.username)),g.a.createElement("button",{className:"style--none"},g.a.createElement(ay.a,{className:"menu-icon"}))),g.a.createElement(vy,null))):null}}])&&Ey(n.prototype,a),r&&Ey(n,r),t}();!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(wy,"propTypes",{currentUser:b.a.object});var jy=Object(a.connect)(function(e){return{currentUser:Object(m.getCurrentUser)(e)}})(wy);function xy(e){return(xy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Py(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ky(e,t){return!t||"object"!==xy(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Cy(e){return(Cy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function My(e,t){return(My=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ry=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ky(this,Cy(t).apply(this,arguments))}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&My(e,t)}(t,g.a.Component),n=t,r=[{key:"propTypes",get:function(){return{name:b.a.string.isRequired,title:b.a.node.isRequired,type:b.a.string,parentLink:b.a.string,subsection:b.a.bool,children:b.a.node,action:b.a.node}}},{key:"defaultProps",get:function(){return{parentLink:"",subsection:!1,children:[]}}}],(a=[{key:"getLink",value:function(){return this.props.parentLink+"/"+this.props.name}},{key:"render",value:function(){var e=this.getLink(),t=null;this.props.children&&(t=g.a.createElement("ul",{className:"nav nav__sub-menu subsections"},g.a.Children.map(this.props.children,function(t){return null===t?null:g.a.cloneElement(t,{parentLink:e,subsection:!0})})));var n="sidebar-section";this.props.subsection&&(n+=" sidebar-subsection");var a=g.a.createElement(Wi,{id:N.h(this.props.name),className:"".concat(n,"-title"),activeClassName:"".concat(n,"-title ").concat(n,"-title--active"),to:e},g.a.createElement("span",{className:"".concat(n,"-title__text")},this.props.title),this.props.action);return"text"===this.props.type&&(a=g.a.createElement("div",{className:"".concat(n,"-title")},g.a.createElement("span",{className:"".concat(n,"-title__text")},this.props.title),this.props.action)),g.a.createElement("li",{className:n},a,t)}}])&&Py(n.prototype,a),r&&Py(n,r),t}(),Ny=n(2348),Ay=n.n(Ny),Dy=n(1631),Ly=n.n(Dy);function Iy(e){return(Iy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Uy(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function qy(e){return(qy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function By(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fy(e,t){return(Fy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hy=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=qy(t).call(this,e),n=!r||"object"!==Iy(r)&&"function"!=typeof r?By(a):r,Gy(By(n),"redrawHighlight",Ly()(function(){null!==n.markInstance&&n.markInstance.unmark(),n.props.filter&&n.ref.current&&(n.markInstance=new Ay.a(n.ref.current),n.markInstance.mark(n.props.filter,{accuracy:"complementary"}))},100,{leading:!0,trailing:!0})),n.markInstance=null,n.ref=g.a.createRef(),n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fy(e,t)}(t,g.a.Component),n=t,(a=[{key:"render",value:function(){return setTimeout(this.redrawHighlight,0),g.a.createElement("div",{ref:this.ref},this.props.children)}}])&&Uy(n.prototype,a),r&&Uy(n,r),t}();function Yy(e){return(Yy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wy(e){return(Wy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vy(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function Xy(e,t,n){return t&&Vy(e.prototype,t),n&&Vy(e,n),e}function Jy(e,t){return(Jy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ky(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Gy(Hy,"propTypes",{filter:b.a.string.isRequired,children:b.a.node.isRequired});var Qy=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=Wy(t).call(this,e),n=!r||"object"!==Yy(r)&&"function"!=typeof r?zy(a):r,Ky(zy(n),"onFilterChange",function(e){var t=e.target.value;if(""===t)return n.setState({sections:null,filter:t}),void n.props.onFilterChange(t);null===n.idx&&(n.idx=Kg(n.context.intl));var a="",r=!0,i=!1,o=void 0;try{for(var s,l=t.split(" ")[Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var c=s.value;c.trim(),""!==c&&(a+=c+" ",a+=c+"* ")}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}var u=n.idx.search(a);if((n.setState({sections:u,filter:t}),n.props.onFilterChange(t),!n.props.navigationBlocked)&&!(-1!==u.indexOf(Ii.a.location.pathname.replace("/admin_console/","")))){var m=n.visibleSections(),d=!0,p=!1,f=void 0;try{for(var b,h=u[Symbol.iterator]();!(d=(b=h.next()).done);d=!0){var g=b.value;if(m.has(g)){Ii.a.replace("/admin_console/"+g);break}}}catch(e){p=!0,f=e}finally{try{d||null==h.return||h.return()}finally{if(p)throw f}}}}),Ky(zy(n),"updateTitle",function(){var e="";n.props.siteName&&(e=" - "+n.props.siteName),document.title=N.ab("sidebar_right_menu.console","System Console")+e}),Ky(zy(n),"visibleSections",function(){for(var e=function(e){return!!e.schema&&(!!e.title&&(!e.isHidden||!e.isHidden(n.props.config,{},n.props.license,n.props.buildEnterpriseReady)))},t=new Set,a=0,r=Object.values(Xg);a<r.length;a++)for(var i=r[a],o=0,s=Object.values(i);o<s.length;o++){var l=s[o];e(l)&&t.add(l.url)}return t}),Ky(zy(n),"renderRootMenu",function(e){var t=[];return Object.values(e).forEach(function(e,a){var r,i=[];return Object.values(e).forEach(function(e,t){if(e.title&&(!e.isHidden||!e.isHidden(n.props.config,{},n.props.license,n.props.buildEnterpriseReady))){if(null!==n.state.sections){var a=!1,r=!0,o=!1,s=void 0;try{for(var l,c=n.state.sections[Symbol.iterator]();!(r=(l=c.next()).done);r=!0){l.value===e.url&&(a=!0)}}catch(e){o=!0,s=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw s}}if(!a)return}i.push(g.a.createElement(Ry,{key:t,name:e.url,title:g.a.createElement(E.c,{id:e.title,defaultMessage:e.title_default})}))}}),0===i.length?null:("plugins"===e.id&&(r=n.renderPluginsMenu()),i.length&&t.push(g.a.createElement(ny,{key:a,parentLink:"/admin_console",icon:e.icon,sectionClass:"",title:g.a.createElement(E.c,{id:e.sectionTitle,defaultMessage:e.sectionTitleDefault})},i,r)),null)}),t}),Ky(zy(n),"renderPluginsMenu",function(){var e=[];return n.props.config.PluginSettings.Enable&&Object.values(n.props.plugins).sort(function(e,t){var n=e.name.localeCompare(t.name);return 0!==n?n:e.id.localeCompare(t.id)}).forEach(function(t){t.settings_schema&&(t.settings_schema.header||t.settings_schema.footer||t.settings_schema.settings)&&(t.settings_schema.settings&&!t.settings_schema.header&&!t.settings_schema.footer&&t.settings_schema.settings.hasOwnProperty("length")&&0===t.settings_schema.settings.length||e.push(g.a.createElement(Ry,{key:"customplugin"+t.id,name:"plugins/plugin_"+t.id,title:t.name})))}),e}),Ky(zy(n),"handleClearFilter",function(){n.setState({sections:null,filter:""}),n.props.onFilterChange("")}),n.state={sections:null,filter:""},n.idx=null,n.searchRef=g.a.createRef(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Jy(e,t)}(t,g.a.Component),Xy(t,null,[{key:"contextTypes",get:function(){return{intl:E.i.isRequired}}}]),Xy(t,[{key:"componentDidMount",value:function(){this.props.config.PluginSettings.Enable&&this.props.actions.getPlugins(),this.searchRef.current&&this.searchRef.current.focus(),this.updateTitle(),N.U()||Mt()(".admin-sidebar .nav-pills__container").perfectScrollbar({suppressScrollX:!0})}},{key:"componentDidUpdate",value:function(){N.U()||Mt()(".admin-sidebar .nav-pills__container").perfectScrollbar({suppressScrollX:!0})}},{key:"render",value:function(){var e=g.a.createElement(O.a,{id:"admin-sidebar-fitler-clear"},g.a.createElement(E.c,{id:"admin.sidebar.filter-clear",defaultMessage:"Clear search"}));return g.a.createElement("div",{className:"admin-sidebar"},g.a.createElement(jy,null),g.a.createElement("div",{className:"nav-pills__container"},g.a.createElement(Hy,{filter:this.state.filter},g.a.createElement("ul",{className:"nav nav-pills nav-stacked"},g.a.createElement("li",{className:"filter-container"},g.a.createElement(qm.a,{id:"searchIcon",className:"search__icon","aria-hidden":"true"}),g.a.createElement("input",{className:"filter "+(this.state.filter?"active":""),type:"text",onChange:this.onFilterChange,value:this.state.filter,placeholder:N.ab("admin.sidebar.filter","Find settings"),ref:this.searchRef}),this.state.filter&&g.a.createElement("div",{className:"sidebar__search-clear visible",onClick:this.handleClearFilter},g.a.createElement(kn.a,{delayShow:w.Q.OVERLAY_TIME_DELAY,placement:"bottom",overlay:e},g.a.createElement("span",{className:"sidebar__search-clear-x","aria-hidden":"true"},"×")))),this.renderRootMenu(Xg)))))}}]),t}();Ky(Qy,"propTypes",{license:b.a.object.isRequired,config:b.a.object,plugins:b.a.object,buildEnterpriseReady:b.a.bool,siteName:b.a.string,onFilterChange:b.a.func.isRequired,navigationBlocked:b.a.bool.isRequired,actions:b.a.shape({getPlugins:b.a.func.isRequired}).isRequired}),Ky(Qy,"defaultProps",{plugins:{}});var Zy=Object(a.connect)(function(e){var t=Object(c.getLicense)(e),n=Object(c.getConfig)(e),a="true"===n.BuildEnterpriseReady,r=n.SiteName;return{license:t,config:e.entities.admin.config,plugins:e.entities.admin.plugins,navigationBlocked:Object(p.a)(e),buildEnterpriseReady:a,siteName:r}},function(e){return{actions:Object(r.bindActionCreators)({getPlugins:i.getPlugins},e)}},null,{pure:!1})(Qy);function $y(e){return($y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ev(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function tv(e){return(tv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function av(e,t){return(av=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function rv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var iv=function(e){function t(e){var n,a,r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a=this,r=tv(t).call(this,e),n=!r||"object"!==$y(r)&&"function"!=typeof r?nv(a):r,rv(nv(n),"onFilterChange",function(e){n.setState({filter:e})}),rv(nv(n),"renderRoutes",function(e){var t=Object.values(Xg).reduce(function(e,t){var a=Object.values(t).filter(function(e){return(!e.isHidden||!e.isHidden(n.props.config,{},n.props.license,n.props.buildEnterpriseReady))&&!!e.schema});return e.concat(a)},[]),a=t.map(function(t){return g.a.createElement(l.b,{key:t.url,path:"".concat(n.props.match.url,"/").concat(t.url),render:function(n){return g.a.createElement(En,Object.assign({},e,n,{schema:t.schema}))}})}),r=t[0].url;return g.a.createElement(l.d,null,a,g.a.createElement(l.a,{to:"".concat(n.props.match.url,"/").concat(r)}))}),n.state={filter:""},n}var n,a,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&av(e,t)}(t,g.a.Component),n=t,(a=[{key:"componentDidMount",value:function(){this.props.actions.getConfig(),this.props.actions.getEnvironmentConfig(),this.props.actions.loadRolesIfNeeded(["channel_user","team_user","system_user","channel_admin","team_admin","system_admin"])}},{key:"mainRolesLoaded",value:function(e){return e&&e.channel_admin&&e.channel_user&&e.team_admin&&e.team_user&&e.system_admin&&e.system_user}},{key:"render",value:function(){var e=this.props,t=e.license,n=e.config,a=e.environmentConfig,r=e.showNavigationPrompt,i=e.roles,o=this.props.actions,s=o.setNavigationBlocked,c=o.cancelNavigation,u=o.confirmNavigation,m=o.editRole;if(!this.props.isCurrentUserSystemAdmin)return g.a.createElement(l.a,{to:"/"});if(!this.mainRolesLoaded(this.props.roles))return null;if(0===Object.keys(n).length)return g.a.createElement("div",null);if(n&&0===Object.keys(n).length&&"Object"===n.constructor)return g.a.createElement("div",{className:"admin-console__wrapper"},g.a.createElement(y.a,null),g.a.createElement("div",{className:"admin-console"}));var d=g.a.createElement(Pn,{show:r,onConfirm:u,onCancel:c}),p={license:t,config:n,environmentConfig:a,setNavigationBlocked:s,roles:i,editRole:m};return g.a.createElement("div",{className:"admin-console__wrapper",id:"adminConsoleWrapper"},g.a.createElement(y.a,null),g.a.createElement(v.a,null),g.a.createElement(Zy,{onFilterChange:this.onFilterChange}),g.a.createElement("div",{className:"admin-console"},g.a.createElement(Hy,{filter:this.state.filter},this.renderRoutes(p))),d,g.a.createElement(_.a,null))}}])&&ev(n.prototype,a),r&&ev(n,r),t}();rv(iv,"propTypes",{config:b.a.object.isRequired,environmentConfig:b.a.object,license:b.a.object.isRequired,buildEnterpriseReady:b.a.bool,roles:b.a.object.isRequired,match:b.a.shape({url:b.a.string.isRequired}).isRequired,showNavigationPrompt:b.a.bool.isRequired,isCurrentUserSystemAdmin:b.a.bool.isRequired,actions:b.a.shape({getConfig:b.a.func.isRequired,getEnvironmentConfig:b.a.func.isRequired,setNavigationBlocked:b.a.func.isRequired,confirmNavigation:b.a.func.isRequired,cancelNavigation:b.a.func.isRequired,loadRolesIfNeeded:b.a.func.isRequired,editRole:b.a.func.isRequired}).isRequired});t.default=Object(l.f)(Object(a.connect)(function(e){var t="true"===Object(c.getConfig)(e).BuildEnterpriseReady;return{config:s.getConfig(e),environmentConfig:s.getEnvironmentConfig(e),license:Object(c.getLicense)(e),buildEnterpriseReady:t,navigationBlocked:Object(p.a)(e),showNavigationPrompt:Object(p.c)(e),isCurrentUserSystemAdmin:Object(m.isCurrentUserSystemAdmin)(e),roles:Object(u.getRoles)(e)}},function(e){return{actions:Object(r.bindActionCreators)({getConfig:i.getConfig,getEnvironmentConfig:i.getEnvironmentConfig,setNavigationBlocked:d.C,deferNavigation:d.g,cancelNavigation:d.e,confirmNavigation:d.f,loadRolesIfNeeded:o.loadRolesIfNeeded,editRole:o.editRole},e)}})(iv))}}]);
  //# sourceMappingURL=7.7a02afa2c335a1f10fef.js.map