(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[6614],{3075:e=>{e.exports=function(){return this.wp.i18n}()},8601:e=>{e.exports=function(){return this.wp.element}()},23270:e=>{e.exports=function(){return this.itsec["user-groups"].api}()},31033:(e,t,s)=>{"use strict";var r=s(51609),n=s(38125),i=s(3075),o=s(8601),a=s(31987),l=s(88356),u=s(56196),c=s(68440),p=s(23270),d=s(46627),g=s(81923),m=s(39959);const h=(0,g.A)("div",{target:"e1f9t0q75"})({name:"damvy5",styles:"display:flex;gap:1rem"}),f=(0,g.A)(m.Modal,{target:"e1f9t0q74"})({name:"9b2neq",styles:"max-width:766px;min-width:480px;.components-modal__content{padding:0;}.components-modal__header{padding:.5rem 1.5rem;}.components-modal__header-heading{font-size:1rem;}"}),w=(0,g.A)("div",{target:"e1f9t0q73"})({name:"lsfn84",styles:"padding:.5rem 1.5rem"}),_=(0,g.A)("div",{target:"e1f9t0q72"})({name:"wd4z5z",styles:"display:flex;gap:1rem;flex-direction:row;flex-wrap:wrap;padding:1.25rem 0 2rem 0"}),x=(0,g.A)(l.EY,{target:"e1f9t0q71"})("background:",(({theme:e})=>e.colors.surface.secondary),";border-radius:25px;padding:.5rem;"),E=(0,g.A)(l.$n,{target:"e1f9t0q70"})({name:"qc0g5u",styles:"margin:1rem 0 1.5rem 0"});function y(){const[e,t]=(0,o.useState)(!1),{matchables:s,queryParams:n}=(0,a.useSelect)((e=>({matchables:e(p.store).getMatchables(),queryParams:e(d.userSecurityStore).getQueryParams("main")||{}})),[]),c=s.filter((e=>"user-group"===e.type)).map((e=>({value:e.id,label:e.label,indeterminate:!1}))),g=n.solid_user_groups||[];return(0,r.createElement)(React.Fragment,null,(0,r.createElement)(u.EditingModalActionFill,null,(0,r.createElement)(u.EditingModalActionDropdown,{title:(0,i.__)("Add to a User Group","better-wp-security"),description:(0,i.__)("Add the selected users to new user groups.","better-wp-security"),dropdownTitle:(0,i.__)("Add to User Groups","better-wp-security"),dropdownButtonText:(0,i.__)("Add to User Groups","better-wp-security"),slug:"add-user-groups",options:c,confirmationText:(0,i.__)("Adding User Groups","better-wp-security")})),(0,r.createElement)(u.UserSecurityFilterFill,null,(0,r.createElement)(l.OV,{slug:"solid_user_groups",title:(0,i.__)("User Groups","better-wp-security"),options:c})),(0,r.createElement)(u.UserSecurityActionsFill,null,(0,r.createElement)(h,null,(0,r.createElement)(l.$n,{text:(0,i.__)("Edit User Group Settings","better-wp-security"),onClick:()=>{t(!0)},disabled:0===g.length})),e&&(0,r.createElement)(S,{matchables:s,setIsOpen:t,selectedUserGroupIds:g})))}function S({matchables:e,setIsOpen:t,selectedUserGroupIds:s}){const n=(0,c.useSettingsDefinitions)(),{saveBulkEdits:o,saveGroupSettings:l}=(0,a.useDispatch)(c.store),{isSaving:u}=(0,a.useSelect)((e=>({isSaving:s.length>1?e(c.store).isSavingBulkEdits(s):e(p.store).isUpdatingSettings(s[0])})),[s]);if(!s)return null;const d=s.map((t=>e.find((e=>e.id===t))));return(0,r.createElement)(f,{title:(0,i.__)("Edit User Group Settings","better-wp-security"),className:"itsec-apply-css-vars",onRequestClose:()=>{t(!1)}},(0,r.createElement)(w,null,(0,r.createElement)(b,{selectedUserGroups:d}),(0,r.createElement)(c.SettingsForm,{definitions:n,settingComponent:s.length>1?c.BulkSettingField:c.SingleSettingField,groupIds:s.length>1?s:null,groupId:1===s.length?s[0]:null}),(0,r.createElement)(E,{text:(0,i.__)("Update User Group Settings","better-wp-security"),variant:"primary",onClick:async()=>{s.length>1?await o(s):await l(s[0]),t(!1)},align:"right",isBusy:u})))}function b({selectedUserGroups:e}){return(0,r.createElement)(React.Fragment,null,(0,r.createElement)(l.EY,{level:4,text:(0,i.__)("User groups selected","better-wp-security"),weight:l.uL.HEAVY,size:l.$C.NORMAL}),(0,r.createElement)(_,null,e.slice(0,10).map(((e,t)=>(0,r.createElement)(x,{text:e.label,weight:l.uL.HEAVY,key:t})))))}s.p=window.itsecWebpackPublicPath,(0,i.setLocaleData)({"":{}},"ithemes-security-pro"),(0,n.registerPlugin)("itsec-user-groups-user-security",{render:()=>(0,r.createElement)(y,null)})},31987:e=>{e.exports=function(){return this.wp.data}()},38125:e=>{e.exports=function(){return this.wp.plugins}()},39959:e=>{e.exports=function(){return this.wp.components}()},46627:e=>{e.exports=function(){return this.itsec.packages.data}()},51609:e=>{"use strict";e.exports=window.React},55933:e=>{e.exports=function(){return this.wp.primitives}()},56196:e=>{e.exports=function(){return this.itsec.pages["user-security"]}()},68440:e=>{e.exports=function(){return this.itsec["user-groups"].ui}()},77172:e=>{e.exports=function(){return this.wp.url}()},79860:e=>{e.exports=function(){return this.wp.keycodes}()},89897:e=>{e.exports=function(){return this.wp.compose}()},89959:e=>{e.exports=function(){return this.wp.date}()}},e=>{e.O(0,[8356],(()=>e(e.s=31033)));var t=e.O();((window.itsec=window.itsec||{})["user-groups"]=window.itsec["user-groups"]||{})["user-security"]=t}]);