text: (window.webpackJsonp=window.webpackJsonp||[]).push([[11],{1907:function(e,t,s){"use strict";s.r(t),s.d(t,"default",(function(){return C}));var r=s(358),n=s.n(r),o=s(2),i=s(332),a=s(31),l=s(482),c=s(333),p=(s(779),s(321)),u=s(347),d=s.n(u),m=s(323),h=s(792),g=s(781),f=s(406);class b extends o.PureComponent{constructor(){super(...arguments),this.handleToggleUser=(e,t)=>e.permissions.includes(t)?this.props.revokePermissionFromUser(e.login,t):this.props.grantPermissionToUser(e.login,t),this.handleToggleGroup=(e,t)=>e.permissions.includes(t)?this.props.revokePermissionFromGroup(e.name,t):this.props.grantPermissionToGroup(e.name,t)}render(){const{filter:e,groups:t,groupsPaging:s,users:r,usersPaging:n}=this.props,i=this.props.organization?"organizations_permissions":"global_permissions",a=this.props.appState.qualifiers.includes("VW"),l=Object(f.e)(a?f.d:f.c,i);let c=0,p=0;return"users"!==e&&(c+=t.length,p+=s?s.total:t.length),"groups"!==e&&(c+=r.length,p+=n?n.total:r.length),o.createElement(o.Fragment,null,o.createElement(h.a,{filter:this.props.filter,groups:this.props.groups,loading:this.props.loading,onToggleGroup:this.handleToggleGroup,onToggleUser:this.handleToggleUser,permissions:l,query:this.props.query,users:this.props.users},o.createElement(g.a,{filter:this.props.filter,onFilter:this.props.onFilter,onSearch:this.props.onSearch,query:this.props.query})),o.createElement(d.a,{count:c,loadMore:this.props.onLoadMore,total:p}))}}var v=Object(p.connect)(e=>({appState:Object(m.getAppState)(e)}))(b);class y extends o.PureComponent{render(){const e=this.props.organization?Object(a.translate)("permissions.page"):Object(a.translate)("global_permissions.page"),t=this.props.organization?Object(a.translate)("organization_permissions.page.description"):Object(a.translate)("global_permissions.page.description");return o.createElement("header",{className:"page-header"},o.createElement("h1",{className:"page-title"},e),this.props.loading&&o.createElement("i",{className:"spinner"}),o.createElement("div",{className:"page-description"},t))}}function k(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,r)}return s}function P(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?k(Object(s),!0).forEach((function(t){O(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):k(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}function O(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class C extends o.PureComponent{constructor(e){super(e),this.mounted=!1,this.loadUsersAndGroups=(e,t)=>{const{organization:s}=this.props,{filter:r,query:n}=this.state,o="groups"!==r?l.i({q:n||void 0,organization:s&&s.key,p:e}):Promise.resolve({paging:void 0,users:[]}),i="users"!==r?l.h({q:n||void 0,organization:s&&s.key,p:t}):Promise.resolve({paging:void 0,groups:[]});return Promise.all([o,i])},this.loadHolders=()=>(this.setState({loading:!0}),this.loadUsersAndGroups().then(([e,t])=>{this.mounted&&this.setState({groups:t.groups,groupsPaging:t.paging,loading:!1,users:e.users,usersPaging:e.paging})},this.stopLoading)),this.onLoadMore=()=>{const{usersPaging:e,groupsPaging:t}=this.state;return this.setState({loading:!0}),this.loadUsersAndGroups(e?e.pageIndex+1:1,t?t.pageIndex+1:1).then(([e,t])=>{this.mounted&&this.setState(({groups:s,users:r})=>({groups:[...s,...t.groups],groupsPaging:t.paging,loading:!1,users:[...r,...e.users],usersPaging:e.paging}))},this.stopLoading)},this.onFilter=e=>{this.setState({filter:e},this.loadHolders)},this.onSearch=e=>{this.setState({query:e},this.loadHolders)},this.addPermissionToGroup=(e,t,s)=>e.map(e=>e.name===t?P({},e,{permissions:[...e.permissions,s]}):e),this.addPermissionToUser=(e,t,s)=>e.map(e=>e.login===t?P({},e,{permissions:[...e.permissions,s]}):e),this.removePermissionFromGroup=(e,t,s)=>e.map(e=>e.name===t?P({},e,{permissions:n()(e.permissions,s)}):e),this.removePermissionFromUser=(e,t,s)=>e.map(e=>e.login===t?P({},e,{permissions:n()(e.permissions,s)}):e),this.grantPermissionToGroup=(e,t)=>this.mounted?(this.setState(({groups:s})=>({groups:this.addPermissionToGroup(s,e,t)})),l.o({groupName:e,permission:t,organization:this.props.organization&&this.props.organization.key}).then(()=>{},()=>{this.mounted&&this.setState(({groups:s})=>({groups:this.removePermissionFromGroup(s,e,t)}))})):Promise.resolve(),this.grantPermissionToUser=(e,t)=>this.mounted?(this.setState(({users:s})=>({users:this.addPermissionToUser(s,e,t)})),l.p({login:e,permission:t,organization:this.props.organization&&this.props.organization.key}).then(()=>{},()=>{this.mounted&&this.setState(({users:s})=>({users:this.removePermissionFromUser(s,e,t)}))})):Promise.resolve(),this.revokePermissionFromGroup=(e,t)=>this.mounted?(this.setState(({groups:s})=>({groups:this.removePermissionFromGroup(s,e,t)})),l.t({groupName:e,permission:t,organization:this.props.organization&&this.props.organization.key}).then(()=>{},()=>{this.mounted&&this.setState(({groups:s})=>({groups:this.addPermissionToGroup(s,e,t)}))})):Promise.resolve(),this.revokePermissionFromUser=(e,t)=>this.mounted?(this.setState(({users:s})=>({users:this.removePermissionFromUser(s,e,t)})),l.u({login:e,permission:t,organization:this.props.organization&&this.props.organization.key}).then(()=>{},()=>{this.mounted&&this.setState(({users:s})=>({users:this.addPermissionToUser(s,e,t)}))})):Promise.resolve(),this.stopLoading=()=>{this.mounted&&this.setState({loading:!1})},this.state={filter:"all",groups:[],loading:!0,query:"",users:[]}}componentDidMount(){this.mounted=!0,this.loadHolders()}componentWillUnmount(){this.mounted=!1}render(){return o.createElement("div",{className:"page page-limited"},o.createElement(c.a,{suggestions:"global_permissions"}),o.createElement(i.a,{defer:!1,title:Object(a.translate)("global_permissions.permission")}),o.createElement(y,{loading:this.state.loading,organization:this.props.organization}),o.createElement(v,{filter:this.state.filter,grantPermissionToGroup:this.grantPermissionToGroup,grantPermissionToUser:this.grantPermissionToUser,groups:this.state.groups,groupsPaging:this.state.groupsPaging,loadHolders:this.loadHolders,loading:this.state.loading,onFilter:this.onFilter,onLoadMore:this.onLoadMore,onSearch:this.onSearch,query:this.state.query,revokePermissionFromGroup:this.revokePermissionFromGroup,revokePermissionFromUser:this.revokePermissionFromUser,users:this.state.users,usersPaging:this.state.usersPaging}))}}},324:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(311),n=s(2),o=s(370),i=s(340);s(341);var a=s(316);t.default=function(e){var t=e.tagName,s=void 0===t?"div":t;return n.createElement(s,{className:r("help-tooltip",e.className)},n.createElement(a.default,{mouseLeaveDelay:.25,onShow:e.onShow,overlay:e.overlay,placement:e.placement},n.createElement("span",{className:"display-inline-flex-center"},e.children||n.createElement(i.ThemeConsumer,null,(function(e){return n.createElement(o.default,{fill:e.colors.gray71,size:12})})))))}},333:function(e,t,s){"use strict";s.d(t,"a",(function(){return o}));var r=s(2),n=s(360);function o({suggestions:e}){return r.createElement(n.a.Consumer,null,({addSuggestions:t,removeSuggestions:s})=>r.createElement(i,{addSuggestions:t,removeSuggestions:s,suggestions:e}))}class i extends r.PureComponent{componentDidMount(){this.props.addSuggestions(this.props.suggestions)}componentDidUpdate(e){e.suggestions!==this.props.suggestions&&(this.props.removeSuggestions(this.props.suggestions),this.props.addSuggestions(e.suggestions))}componentWillUnmount(){this.props.removeSuggestions(this.props.suggestions)}render(){return null}}},339:function(e,t,s){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(e,t)},function(e,t){function s(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)});Object.defineProperty(t,"__esModule",{value:!0});var o=s(311),i=s(2),a=s(318);s(366);var l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleClick=function(e){e.preventDefault(),e.currentTarget.blur(),t.props.disabled||t.props.onCheck(!t.props.checked,t.props.id)},t}return n(t,e),t.prototype.render=function(){var e=this.props,t=e.checked,s=e.children,r=e.disabled,n=e.id,l=e.loading,c=e.right,p=e.thirdState,u=e.title,d=o("icon-checkbox",{"icon-checkbox-checked":t,"icon-checkbox-single":p,"icon-checkbox-disabled":r});return s?i.createElement("a",{"aria-checked":t,className:o("link-checkbox",this.props.className,{note:r,disabled:r}),href:"#",id:n,onClick:this.handleClick,role:"checkbox",title:u},c&&s,i.createElement(a.default,{loading:Boolean(l)},i.createElement("i",{className:d})),!c&&s):l?i.createElement(a.default,null):i.createElement("a",{"aria-checked":t,className:o(d,this.props.className),href:"#",id:n,onClick:this.handleClick,role:"checkbox",title:u})},t.defaultProps={thirdState:!1},t}(i.PureComponent);t.default=l},341:function(e,t,s){var r=s(313),n=s(342);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[e.i,n,""]]);var o={insert:"head",singleton:!1},i=(r(n,o),n.locals?n.locals:{});e.exports=i},342:function(e,t,s){(t=s(314)(!1)).push([e.i,".help-tooltip{display:inline-flex;align-items:center;vertical-align:middle}.help-toolip-link{display:block;width:12px;height:12px;border:none}",""]),e.exports=t},347:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(311),n=s(2),o=s(31),i=s(320),a=s(318),l=s(312);t.default=function(e){var t,s=e.className,c=e.count,p=e.loading,u=e.needReload,d=e.total,m=e.ready,h=void 0===m||m,g=d&&d>c;return u&&e.reload?t=n.createElement(l.Button,{className:"spacer-left","data-test":"reload",disabled:p,onClick:e.reload},o.translate("reload")):g&&e.loadMore&&(t=n.createElement(l.Button,{className:"spacer-left",disabled:p,"data-test":"show-more",onClick:e.loadMore},o.translate("show_more"))),n.createElement("footer",{className:r("spacer-top note text-center",{"new-loading":!h},s)},o.translateWithParameters("x_of_y_shown",i.formatMeasure(c,"INT",null),i.formatMeasure(d,"INT",null)),t,p&&n.createElement(a.default,{className:"text-bottom spacer-left position-absolute"}))}},366:function(e,t,s){var r=s(313),n=s(367);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[e.i,n,""]]);var o={insert:"head",singleton:!1},i=(r(n,o),n.locals?n.locals:{});e.exports=i},367:function(e,t,s){(t=s(314)(!1)).push([e.i,".icon-checkbox{display:inline-block;line-height:1;vertical-align:top;padding:1px 2px;box-sizing:border-box}a.icon-checkbox{border-bottom:none}.icon-checkbox:focus{outline:none}.icon-checkbox:before{content:\" \";display:inline-block;width:10px;height:10px;border:1px solid #236a97;border-radius:2px;transition:border-color .2s ease,background-color .2s ease,background-image .2s ease,box-shadow .4s ease}.icon-checkbox:not(.icon-checkbox-disabled):focus:before,.link-checkbox:not(.disabled):focus:focus .icon-checkbox:before{box-shadow:0 0 0 3px rgba(35,106,151,.25)}.icon-checkbox-checked:before{background-color:#4b9fd5;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' clip-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='1.414'%3E%3Cpath d='M12 4.665c0 .172-.06.318-.18.438l-5.55 5.55c-.12.12-.266.18-.438.18s-.318-.06-.438-.18L2.18 7.438C2.06 7.317 2 7.17 2 7s.06-.318.18-.44l.878-.876c.12-.12.267-.18.44-.18.17 0 .317.06.437.18l1.897 1.903 4.233-4.24c.12-.12.266-.18.438-.18s.32.06.44.18l.876.88c.12.12.18.265.18.438z' fill='%23fff' fill-rule='nonzero'/%3E%3C/svg%3E\");border-color:#4b9fd5}.icon-checkbox-checked.icon-checkbox-single:before{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' clip-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='1.414'%3E%3Cpath d='M10 4.698A.697.697 0 0 0 9.302 4H4.698A.697.697 0 0 0 4 4.698v4.604c0 .386.312.698.698.698h4.604A.697.697 0 0 0 10 9.302V4.698z' fill='%23fff'/%3E%3C/svg%3E\")}.icon-checkbox-disabled:before{border:1px solid #bbb;cursor:not-allowed}.icon-checkbox-disabled.icon-checkbox-checked:before{background-color:#bbb}.icon-checkbox-invisible{visibility:hidden}.link-checkbox{color:inherit;border-bottom:none}.link-checkbox.disabled,.link-checkbox.disabled:hover,.link-checkbox.disabled label{color:#777;cursor:not-allowed}.link-checkbox:active,.link-checkbox:focus,.link-checkbox:hover{color:inherit}",""]),e.exports=t},388:function(e,t,s){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(e,t)},function(e,t){function s(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)});Object.defineProperty(t,"__esModule",{value:!0});var o=s(311),i=s(2);s(397);var a=s(316),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.renderOption=function(e){var s=e.value===t.props.value,r=t.props.name+"__"+e.value;return i.createElement("li",{key:e.value.toString()},i.createElement("input",{checked:s,disabled:e.disabled,id:r,name:t.props.name,onChange:function(){return t.props.onCheck(e.value)},type:"radio"}),i.createElement(a.default,{overlay:e.tooltip||void 0},i.createElement("label",{htmlFor:r},e.label)))},t}return n(t,e),t.prototype.render=function(){return i.createElement("ul",{className:o("radio-toggle",this.props.className)},this.props.options.map(this.renderOption))},t.defaultProps={disabled:!1,value:null},t}(i.PureComponent);t.default=l},397:function(e,t,s){var r=s(313),n=s(398);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[e.i,n,""]]);var o={insert:"head",singleton:!1},i=(r(n,o),n.locals?n.locals:{});e.exports=i},398:function(e,t,s){(t=s(314)(!1)).push([e.i,".radio-toggle{font-size:0;white-space:nowrap}.radio-toggle,.radio-toggle>li{display:inline-block;vertical-align:middle}.radio-toggle>li{font-size:12px}.radio-toggle>li:first-child>label{border-top-left-radius:2px;border-bottom-left-radius:2px}.radio-toggle>li:last-child>label{border-top-right-radius:2px;border-bottom-right-radius:2px}.radio-toggle>li+li>label{border-left:none}.radio-toggle>li>label{display:inline-block;padding:0 12px;margin:0;border:1px solid #236a97;color:#236a97;height:22px;line-height:22px;cursor:pointer;font-weight:600}.radio-toggle input[type=radio]{display:none}.radio-toggle input[type=radio]:checked+label{background-color:#236a97;color:#fff}.radio-toggle input[type=radio]:disabled+label{color:#bbb;border-color:#ddd;background:#ebebeb;cursor:not-allowed}",""]),e.exports=t},406:function(e,t,s){"use strict";s.d(t,"b",(function(){return o})),s.d(t,"c",(function(){return i})),s.d(t,"d",(function(){return a})),s.d(t,"a",(function(){return c})),s.d(t,"e",(function(){return u})),s.d(t,"f",(function(){return d}));var r=s(31),n=s(6);const o=["user","codeviewer","issueadmin","securityhotspotadmin","admin","scan"],i=["admin",{category:"administer",permissions:["gateadmin","profileadmin"]},"scan",{category:"creator",permissions:["provisioning"]}],a=["admin",{category:"administer",permissions:["gateadmin","profileadmin"]},"scan",{category:"creator",permissions:["provisioning","applicationcreator","portfoliocreator"]}],l=["user","admin"],c={TRK:o,VW:l,SVW:l,APP:l,DEV:["user","admin"]};function p(e,t){const s=e=>{const t="".concat(e,".sonarcloud");return Object(n.isSonarCloud)()&&Object(r.hasMessage)(t)?Object(r.translate)(t):Object(r.translate)(e)};return{key:e,name:s("".concat(t,".").concat(e)),description:s("".concat(t,".").concat(e,".desc"))}}function u(e,t){return e.map(e=>"object"==typeof e?{category:e.category,permissions:e.permissions.map(e=>p(e,t))}:p(e,t))}function d(e){return Boolean(e&&e.category)}},482:function(e,t,s){"use strict";s.d(t,"p",(function(){return o})),s.d(t,"u",(function(){return i})),s.d(t,"o",(function(){return a})),s.d(t,"t",(function(){return l})),s.d(t,"l",(function(){return c})),s.d(t,"f",(function(){return p})),s.d(t,"y",(function(){return u})),s.d(t,"g",(function(){return d})),s.d(t,"x",(function(){return m})),s.d(t,"b",(function(){return h})),s.d(t,"c",(function(){return g})),s.d(t,"r",(function(){return f})),s.d(t,"w",(function(){return b})),s.d(t,"q",(function(){return v})),s.d(t,"v",(function(){return y})),s.d(t,"a",(function(){return k})),s.d(t,"s",(function(){return P})),s.d(t,"n",(function(){return O})),s.d(t,"m",(function(){return C})),s.d(t,"i",(function(){return E})),s.d(t,"h",(function(){return j})),s.d(t,"k",(function(){return x})),s.d(t,"j",(function(){return _})),s.d(t,"e",(function(){return w})),s.d(t,"d",(function(){return S}));var r=s(9),n=s(326);function o(e){return Object(r.post)("/api/permissions/add_user",e).catch(n.a)}function i(e){return Object(r.post)("/api/permissions/remove_user",e).catch(n.a)}function a(e){return Object(r.post)("/api/permissions/add_group",e).catch(n.a)}function l(e){return Object(r.post)("/api/permissions/remove_group",e).catch(n.a)}function c(e){const t="/api/permissions/search_templates";return e?Object(r.getJSON)(t,{organization:e}):Object(r.getJSON)(t)}function p(e){return Object(r.postJSON)("/api/permissions/create_template",e)}function u(e){return Object(r.post)("/api/permissions/update_template",e)}function d(e){return Object(r.post)("/api/permissions/delete_template",e).catch(n.a)}function m(e,t){return Object(r.post)("/api/permissions/set_default_template",{templateId:e,qualifier:t})}function h(e){return Object(r.post)("/api/permissions/apply_template",e).catch(n.a)}function g(e){return Object(r.post)("/api/permissions/bulk_apply_template",e)}function f(e){return Object(r.post)("/api/permissions/add_user_to_template",e)}function b(e){return Object(r.post)("/api/permissions/remove_user_from_template",e)}function v(e){return Object(r.post)("/api/permissions/add_group_to_template",e)}function y(e){return Object(r.post)("/api/permissions/remove_group_from_template",e)}function k(e,t){return Object(r.post)("/api/permissions/add_project_creator_to_template",{templateId:e,permission:t})}function P(e,t){return Object(r.post)("/api/permissions/remove_project_creator_from_template",{templateId:e,permission:t})}function O(e){return e.ps||(e.ps=100),Object(r.getJSON)("/api/permissions/users",e).catch(n.a)}function C(e){return e.ps||(e.ps=100),Object(r.getJSON)("/api/permissions/groups",e).catch(n.a)}function E(e){return e.ps||(e.ps=100),Object(r.getJSON)("/api/permissions/users",e)}function j(e){return e.ps||(e.ps=100),Object(r.getJSON)("/api/permissions/groups",e)}function x(e,t,s,n){const o={templateId:e,ps:100};return t&&(o.q=t),s&&(o.permission=s),n&&Object.assign(o,{organization:n}),Object(r.getJSON)("/api/permissions/template_users",o).then(e=>e.users)}function _(e,t,s,n){const o={templateId:e,ps:100};return t&&(o.q=t),s&&(o.permission=s),n&&Object.assign(o,{organization:n}),Object(r.getJSON)("/api/permissions/template_groups",o).then(e=>e.groups)}function w(e,t){return Object(r.post)("/api/projects/update_visibility",{project:e,visibility:t}).catch(n.a)}function S(e,t){return Object(r.post)("/api/projects/update_default_visibility",{organization:e,projectVisibility:t}).catch(n.a)}},493:function(e,t,s){var r=s(400)((function(e,t,s){e[s?0:1].push(t)}),(function(){return[[],[]]}));e.exports=r},598:function(e,t,s){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,s=1,r=arguments.length;s<r;s++)for(var n in t=arguments[s])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},n=this&&this.__rest||function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(s[r[n]]=e[r[n]])}return s};Object.defineProperty(t,"__esModule",{value:!0});var o=s(2),i=s(315);t.default=function(e){var t=e.fill,s=(e.size,n(e,["fill","size"]));return o.createElement(i.ThemedIcon,r({viewBox:"0 0 36 36"},s),(function(e){var s=e.theme;return o.createElement("g",{transform:"matrix(0.0625,0,0,0.0625,3,4)"},o.createElement("path",{d:"M148.25,224C121.25,224.833 99.167,235.5 82,256L48.5,256C34.833,256 23.333,252.625 14,245.875C4.667,239.125 0,229.25 0,216.25C0,157.417 10.333,128 31,128C32,128 35.625,129.75 41.875,133.25C48.125,136.75 56.25,140.292 66.25,143.875C76.25,147.458 86.167,149.25 96,149.25C107.167,149.25 118.25,147.333 129.25,143.5C128.417,149.667 128,155.167 128,160C128,183.167 134.75,204.5 148.25,224ZM416,383.25C416,403.25 409.917,419.042 397.75,430.625C385.583,442.208 369.417,448 349.25,448L130.75,448C110.583,448 94.417,442.208 82.25,430.625C70.083,419.042 64,403.25 64,383.25C64,374.417 64.292,365.792 64.875,357.375C65.458,348.958 66.625,339.875 68.375,330.125C70.125,320.375 72.333,311.333 75,303C77.667,294.667 81.25,286.542 85.75,278.625C90.25,270.708 95.417,263.958 101.25,258.375C107.083,252.792 114.208,248.333 122.625,245C131.042,241.667 140.333,240 150.5,240C152.167,240 155.75,241.792 161.25,245.375C166.75,248.958 172.833,252.958 179.5,257.375C186.167,261.792 195.083,265.792 206.25,269.375C217.417,272.958 228.667,274.75 240,274.75C251.333,274.75 262.583,272.958 273.75,269.375C284.917,265.792 293.833,261.792 300.5,257.375C307.167,252.958 313.25,248.958 318.75,245.375C324.25,241.792 327.833,240 329.5,240C339.667,240 348.958,241.667 357.375,245C365.792,248.333 372.917,252.792 378.75,258.375C384.583,263.958 389.75,270.708 394.25,278.625C398.75,286.542 402.333,294.667 405,303C407.667,311.333 409.875,320.375 411.625,330.125C413.375,339.875 414.542,348.958 415.125,357.375C415.708,365.792 416,374.417 416,383.25ZM160,64C160,81.667 153.75,96.75 141.25,109.25C128.75,121.75 113.667,128 96,128C78.333,128 63.25,121.75 50.75,109.25C38.25,96.75 32,81.667 32,64C32,46.333 38.25,31.25 50.75,18.75C63.25,6.25 78.333,0 96,0C113.667,0 128.75,6.25 141.25,18.75C153.75,31.25 160,46.333 160,64ZM336,160C336,186.5 326.625,209.125 307.875,227.875C289.125,246.625 266.5,256 240,256C213.5,256 190.875,246.625 172.125,227.875C153.375,209.125 144,186.5 144,160C144,133.5 153.375,110.875 172.125,92.125C190.875,73.375 213.5,64 240,64C266.5,64 289.125,73.375 307.875,92.125C326.625,110.875 336,133.5 336,160ZM480,216.25C480,229.25 475.333,239.125 466,245.875C456.667,252.625 445.167,256 431.5,256L398,256C380.833,235.5 358.75,224.833 331.75,224C345.25,204.5 352,183.167 352,160C352,155.167 351.583,149.667 350.75,143.5C361.75,147.333 372.833,149.25 384,149.25C393.833,149.25 403.75,147.458 413.75,143.875C423.75,140.292 431.875,136.75 438.125,133.25C444.375,129.75 448,128 449,128C469.667,128 480,157.417 480,216.25ZM448,64C448,81.667 441.75,96.75 429.25,109.25C416.75,121.75 401.667,128 384,128C366.333,128 351.25,121.75 338.75,109.25C326.25,96.75 320,81.667 320,64C320,46.333 326.25,31.25 338.75,18.75C351.25,6.25 366.333,0 384,0C401.667,0 416.75,6.25 429.25,18.75C441.75,31.25 448,46.333 448,64Z",style:{fill:t||s.colors.gray67}}))}))}},779:function(e,t,s){var r=s(313),n=s(780);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[e.i,n,""]]);var o={insert:"head",singleton:!1},i=(r(n,o),n.locals?n.locals:{});e.exports=i},780:function(e,t,s){(t=s(314)(!1)).push([e.i,'.permissions-table .permission-column.selected{background-color:#d9edf7}.permissions-table .permission-column-inner{width:100px}.permissions-table .divider{background:#fff;padding:16px 0}.permissions-table .divider:after{display:block;content:"";background:#e6e6e6;height:1px;width:100%}',""]),e.exports=t},781:function(e,t,s){"use strict";s.d(t,"a",(function(){return c}));var r=s(2),n=s(388),o=s.n(n),i=s(350),a=s.n(i),l=s(31);function c(e){const t=[{value:"all",label:Object(l.translate)("all")},{value:"users",label:Object(l.translate)("users.page")},{value:"groups",label:Object(l.translate)("user_groups.page")}];return r.createElement("div",{className:"display-flex-row"},r.createElement(o.a,{name:"users-or-groups",onCheck:e.onFilter,options:t,value:e.filter}),r.createElement("div",{className:"flex-1 spacer-left"},r.createElement(a.a,{minLength:3,onChange:e.onSearch,placeholder:Object(l.translate)("search.search_for_users_or_groups"),value:e.query})))}},792:function(e,t,s){"use strict";s.d(t,"a",(function(){return z}));var r=s(329),n=s.n(r),o=s(493),i=s.n(o),a=s(2),l=s(31),c=s(406),p=s(358),u=s.n(p),d=s(598),m=s.n(d),h=s(311),g=s(339),f=s.n(g);class b extends a.PureComponent{render(){const{loading:e,onCheck:t,permission:s,permissionItem:r,selectedPermission:n}=this.props;return Object(c.f)(s)?a.createElement("td",{className:"text-middle"},s.permissions.map(s=>a.createElement("div",{key:s.key},a.createElement(f.a,{checked:r.permissions.includes(s.key),disabled:e.includes(s.key),id:s.key,onCheck:t},a.createElement("span",{className:"little-spacer-left"},s.name))))):a.createElement("td",{className:h("permission-column text-center text-middle",{selected:s.key===n})},a.createElement(f.a,{checked:r.permissions.includes(s.key),disabled:e.includes(s.key),id:s.key,onCheck:t}))}}class v extends a.PureComponent{constructor(){super(...arguments),this.mounted=!1,this.state={loading:[]},this.stopLoading=e=>{this.mounted&&this.setState(t=>({loading:u()(t.loading,e)}))},this.handleCheck=(e,t)=>{void 0!==t&&(this.setState(e=>({loading:[...e.loading,t]})),this.props.onToggle(this.props.group,t).then(()=>this.stopLoading(t),()=>this.stopLoading(t)))}}componentDidMount(){this.mounted=!0}componentWillUnmount(){this.mounted=!1}render(){const{group:e}=this.props;return a.createElement("tr",null,a.createElement("td",{className:"nowrap text-middle"},a.createElement("div",{className:"display-inline-block text-middle big-spacer-right"},a.createElement(m.a,null)),a.createElement("div",{className:"display-inline-block text-middle"},a.createElement("div",null,a.createElement("strong",null,e.name)),a.createElement("div",{className:"little-spacer-top",style:{whiteSpace:"normal"}},e.description))),this.props.permissions.map(t=>a.createElement(b,{key:Object(c.f)(t)?t.category:t.key,loading:this.state.loading,onCheck:this.handleCheck,permission:t,permissionItem:e,selectedPermission:this.props.selectedPermission})))}}var y=s(324),k=s.n(y),P=s(316),O=s.n(P),C=s(325),E=s(427);class j extends a.PureComponent{constructor(){super(...arguments),this.handlePermissionClick=e=>{e.preventDefault(),e.currentTarget.blur();const{permission:t}=this.props;this.props.onSelectPermission&&!Object(c.f)(t)&&this.props.onSelectPermission(t.key)},this.getTooltipOverlay=()=>{const{permission:e}=this.props;return Object(c.f)(e)?e.permissions.map(e=>a.createElement(a.Fragment,{key:e.key},a.createElement("b",{className:"little-spacer-right"},e.name,":"),a.createElement(E.a,{key:e.key,message:e.description}),a.createElement("br",null))):this.props.showPublicProjectsWarning&&["user","codeviewer"].includes(e.key)?a.createElement("div",null,a.createElement(E.a,{message:e.description}),a.createElement(C.Alert,{className:"spacer-top",variant:"warning"},Object(l.translate)("projects_role.public_projects_warning"))):a.createElement(E.a,{message:e.description})}}render(){const{onSelectPermission:e,permission:t}=this.props;let s;return s=Object(c.f)(t)?Object(l.translate)("global_permissions",t.category):e?a.createElement(O.a,{overlay:Object(l.translateWithParameters)("global_permissions.filter_by_x_permission",t.name)},a.createElement("a",{href:"#",onClick:this.handlePermissionClick},t.name)):t.name,a.createElement("th",{className:h("permission-column text-center text-middle",{selected:!Object(c.f)(t)&&t.key===this.props.selectedPermission})},a.createElement("div",{className:"permission-column-inner"},s,a.createElement(k.a,{className:"spacer-left",overlay:this.getTooltipOverlay()})))}}var x=s(371),_=s(6);class w extends a.PureComponent{constructor(){super(...arguments),this.mounted=!1,this.state={loading:[]},this.stopLoading=e=>{this.mounted&&this.setState(t=>({loading:u()(t.loading,e)}))},this.handleCheck=(e,t)=>{void 0!==t&&(this.setState(e=>({loading:[...e.loading,t]})),this.props.onToggle(this.props.user,t).then(()=>this.stopLoading(t),()=>this.stopLoading(t)))}}componentDidMount(){this.mounted=!0}componentWillUnmount(){this.mounted=!1}render(){const{user:e}=this.props,t=this.props.permissions.map(t=>a.createElement(b,{key:Object(c.f)(t)?t.category:t.key,loading:this.state.loading,onCheck:this.handleCheck,permission:t,permissionItem:e,selectedPermission:this.props.selectedPermission}));return"<creator>"===e.login?a.createElement("tr",null,a.createElement("td",{className:"nowrap text-middle"},a.createElement("div",{className:"display-inline-block text-middle"},a.createElement("div",null,a.createElement("strong",null,e.name)),a.createElement("div",{className:"little-spacer-top",style:{whiteSpace:"normal"}},Object(l.translate)(Object(_.isSonarCloud)()?"permission_templates.project_creators.explanation.sonarcloud":"permission_templates.project_creators.explanation")))),t):a.createElement("tr",null,a.createElement("td",{className:"nowrap text-middle"},a.createElement(x.a,{className:"text-middle big-spacer-right",hash:e.avatar,name:e.name,size:36}),a.createElement("div",{className:"display-inline-block text-middle"},Object(_.isSonarCloud)()?a.createElement(a.Fragment,null,a.createElement("div",null,a.createElement("strong",null,e.name)),a.createElement("div",{className:"note little-spacer-top"},e.login)):a.createElement(a.Fragment,null,a.createElement("div",null,a.createElement("strong",null,e.name),a.createElement("span",{className:"note spacer-left"},e.login)),a.createElement("div",{className:"little-spacer-top"},e.email)))),t)}}function S(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,r)}return s}function N(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?S(Object(s),!0).forEach((function(t){T(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):S(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}function T(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class z extends a.PureComponent{constructor(){super(...arguments),this.state={initialPermissionsCount:{}},this.handleGroupToggle=(e,t)=>{const s=e.id||e.name;return void 0===this.state.initialPermissionsCount[s]&&this.setState(t=>({initialPermissionsCount:N({},t.initialPermissionsCount,{[s]:e.permissions.length})})),this.props.onToggleGroup(e,t)},this.handleUserToggle=(e,t)=>(void 0===this.state.initialPermissionsCount[e.login]&&this.setState(t=>({initialPermissionsCount:N({},t.initialPermissionsCount,{[e.login]:e.permissions.length})})),this.props.onToggleUser(e,t)),this.getItemInitialPermissionsCount=e=>{const t=this.isPermissionUser(e)?e.login:e.id||e.name;return void 0!==this.state.initialPermissionsCount[t]?this.state.initialPermissionsCount[t]:e.permissions.length}}componentDidUpdate(e){this.props.filter===e.filter&&this.props.query===e.query||this.setState({initialPermissionsCount:{}})}isPermissionUser(e){return void 0!==e.login}renderEmpty(){const e=this.props.permissions.length+1;return a.createElement("tr",null,a.createElement("td",{colSpan:e},Object(l.translate)("no_results_search")))}renderItem(e,t){return this.isPermissionUser(e)?a.createElement(w,{key:"user-".concat(e.login),onToggle:this.handleUserToggle,permissions:t,selectedPermission:this.props.selectedPermission,user:e}):a.createElement(v,{group:e,key:"group-".concat(e.id||e.name),onToggle:this.handleGroupToggle,permissions:t,selectedPermission:this.props.selectedPermission})}render(){const{permissions:e}=this.props,t=n()([...this.props.users,...this.props.groups],e=>this.isPermissionUser(e)&&"<creator>"===e.login?0:e.name),[s,r]=i()(t,e=>this.getItemInitialPermissionsCount(e));return a.createElement("div",{className:"boxed-group boxed-group-inner"},a.createElement("table",{className:"data zebra permissions-table"},a.createElement("thead",null,a.createElement("tr",null,a.createElement("td",{className:"nowrap bordered-bottom"},this.props.children),e.map(e=>a.createElement(j,{key:Object(c.f)(e)?e.category:e.key,onSelectPermission:this.props.onSelectPermission,permission:e,selectedPermission:this.props.selectedPermission,showPublicProjectsWarning:this.props.showPublicProjectsWarning})))),a.createElement("tbody",null,0===t.length&&!this.props.loading&&this.renderEmpty(),s.map(t=>this.renderItem(t,e)),s.length>0&&r.length>0&&a.createElement(a.Fragment,null,a.createElement("tr",null,a.createElement("td",{className:"divider",colSpan:20})),a.createElement("tr",null)),r.map(t=>this.renderItem(t,e)))))}}}}]);
  //# sourceMappingURL=11.m.0b0c998c.chunk.js.map