芝麻web文件管理V1.00
编辑当前文件:/home/ezdajrnh/public_html/wp-content/plugins/better-wp-security/dist/user-groups/settings.js
/*! For license information please see settings.js.LICENSE.txt */ (globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[5329],{2873:e=>{e.exports=function(){return this.wp.hooks}()},3075:e=>{e.exports=function(){return this.wp.i18n}()},6767:(e,t,r)=>{"use strict";var n=r(51609),s=r(3075),o=r(38125),i=(r(29672),r(46627)),a=r(23270),l=r(26425),u=r(39959);function c({groupId:e,disabled:t}){return(0,n.createElement)(React.Fragment,null,(0,n.createElement)(g,{groupId:e,disabled:t}),(0,n.createElement)(ae,{groupId:e,disabled:t}),(0,n.createElement)(me,{groupId:e,disabled:t}))}var d=r(31987),p=r(68440);function g({groupId:e,disabled:t=!1}){const{label:r}=(0,d.useSelect)((t=>({label:t(p.store).getEditedGroupAttribute(e,"label")||""})),[e]),{editGroup:o}=(0,d.useDispatch)(p.store);return(0,n.createElement)(u.TextControl,{label:(0,s.__)("Group Name","better-wp-security"),value:r,maxLength:50,disabled:t,onChange:t=>o(e,{label:t}),__nextHasNoMarginBottom:!0})}var m=r(81923),h=r(56347),f=r(54625),E=r(55095),v=r(88356),b=r(98883);const _=(0,m.A)(v.Nz,{target:"ex8nmdm0"})({name:"syl0ps",styles:"padding:.5rem 1.5rem 1rem;align-items:center;flex-wrap:wrap"});function y(){const{navIds:e}=(0,d.useSelect)((e=>({navIds:e(p.store).getMatchableNavIds()})),[]),{createLocalGroup:t}=(0,d.useDispatch)(p.store),r=(0,l.useNavigateTo)(),{root:o}=(0,h.g)();return e?(0,n.createElement)(_,{orientation:"horizontal"},e.map((e=>(0,n.createElement)(w,{key:e,groupId:e,root:o}))),(0,n.createElement)(v.$n,{variant:"tertiary",icon:E.A,label:(0,s.__)("Create User Group","better-wp-security"),onClick:async()=>{const{id:e}=await t();r(`/${o}/user-groups/${e}`)}})):null}function w({groupId:e,root:t}){const{label:r}=(0,d.useSelect)((t=>({label:t(p.store).getEditedMatchableLabel(e)})),[e]);return(0,n.createElement)(f.k2,{to:`/${t}/user-groups/${e}`,component:(0,b.kk)(v.W0)},r||(0,s.__)("Untitled","better-wp-security"))}var I=r(47926);const L=(0,m.A)("div",{target:"entfely0"})({name:"s9thde",styles:"max-width:830px;width:100%;flex-grow:1"});function S({module:e,children:t}){return(0,n.createElement)(L,null,(0,n.createElement)(Se,null,(0,n.createElement)(v.zY,{title:(0,s.__)("Imported User Groups","better-wp-security"),description:(0,s.__)("Click any user group to edit its features or its members before importing.","better-wp-security")})),(0,n.createElement)(l.OnboardHeader,{title:e.title,description:(0,n.createElement)(I.VK,{content:e.help,noWrap:!0}),showNext:!0,showIndicator:!0}),t)}var x=r(7e3),O=r(8601);const C=(0,m.A)(v.ui,{target:"e1vwm4mq0"})("border:1px solid ",(({theme:e})=>e.colors.border.normal),";");function N(){const{url:e,path:t,params:{root:r}}=(0,h.W5)(),{hash:s,search:o}=(0,h.zy)(),{navIds:a,module:l}=(0,d.useSelect)((e=>({navIds:e(p.store).getMatchableNavIds(),module:e(i.MODULES_STORE_NAME).getModule("user-groups")})),[]);return null!==a&&l?(0,n.createElement)(h.dO,null,(0,n.createElement)(h.qh,{path:`${t}/multi`},(0,n.createElement)(k,{module:l})),(0,n.createElement)(h.qh,{path:`${t}/:groupId`},(0,n.createElement)(A,{module:l,root:r})),(0,n.createElement)(h.qh,{path:t},"onboard"===r&&(0,n.createElement)(ee,null),"onboard"!==r&&a.length>0&&(0,n.createElement)(h.rd,{to:`${e}/${a[0]}/${o}${s}`}))):null}function A({module:e,root:t}){const{groupId:r}=(0,h.g)();return(0,n.createElement)(D,{root:t,module:e,groupId:r},(0,n.createElement)(C,null,(0,n.createElement)(Le,null),(0,n.createElement)(y,null),(0,n.createElement)($,{groupId:r})),(0,n.createElement)(fe,{groupId:r}))}function k({module:e}){const[t]=(0,x.pE)("back",x.fr),[r,o]=(0,x.pE)("id",(0,x.IQ)(x.xn,[]));return(0,n.createElement)(React.Fragment,null,(0,n.createElement)(C,null,(0,n.createElement)(v.zY,{title:(0,s.__)("User Groups","better-wp-security"),description:(0,n.createElement)(I.VK,{content:e.help,noWrap:!0})},(0,n.createElement)(f.N_,{to:t?`/settings/user-groups/${t}`:"/settings/user-groups",component:(0,b.kk)(v.EY),as:"a",decoration:"none",variant:v.J3.MUTED,text:(0,s.__)("Cancel Group Edit","better-wp-security")})),(0,n.createElement)(T,{selected:r,setSelected:o}),(0,n.createElement)(V,{groupIds:r})),(0,n.createElement)(ve,{groupIds:r}))}function D({root:e,module:t,groupId:r,children:o}){const i=(0,O.useMemo)((()=>({groupId:r})),[r]);return"onboard"===e?(0,n.createElement)(re,{module:t},o):"import"===e?(0,n.createElement)(S,{module:t},o):(0,n.createElement)(React.Fragment,null,(0,n.createElement)(Se,null,(0,n.createElement)(v.zY,{title:(0,s.__)("User Groups","better-wp-security"),description:(0,n.createElement)(I.VK,{content:t.help,noWrap:!0})},(0,n.createElement)(we,{fillProps:i}))),o)}var M=r(66087);const G=(0,m.A)(v.Kp,{target:"e1qle9621"})({name:"1nzdh6",styles:".components-tab-panel__tabs{padding:0 1.5rem;}.components-tab-panel__tab-content{padding:1rem 1.5rem;}"}),R=(0,m.A)(I.VS,{target:"e1qle9620"})({name:"8dk3vg",styles:"margin-bottom:1rem"});function $({groupId:e}){const{root:t}=(0,h.g)(),{hash:r}=(0,h.zy)(),{type:o,isSaving:i,notFound:l,error:c}=(0,d.useSelect)((t=>({type:t(p.store).getMatchableType(e),error:t(p.store).getError(e),isSaving:t(p.store).isSavingGroupOrSettings(e),notFound:t(a.store).isGroupNotFound(e)})),[e]),g=(0,O.useMemo)((()=>[{name:"settings",title:(0,s.__)("Features","better-wp-security"),Component:_e},"user-group"===o&&{name:"edit",title:(0,s.__)("Edit Group","better-wp-security"),Component:be}].filter(M.isPlainObject)),[o]);return l?(0,n.createElement)(h.rd,{to:`/${t}/user-groups`}):(0,n.createElement)(u.Disabled,{isDisabled:i},(0,n.createElement)(G,{tabs:g},(({Component:t})=>(0,n.createElement)(t,{groupId:e,highlight:r.substring(1)},(0,n.createElement)(R,{apiError:c})))))}function V({groupIds:e}){const{errors:t}=(0,d.useSelect)((e=>({errors:e(p.store).getBulkErrorsList()})),[]),r=(0,O.useMemo)((()=>[{name:"settings",title:(0,s.__)("Features","better-wp-security"),Component:ye}]),[]);return(0,n.createElement)(G,{tabs:r,isStyled:!0},(({Component:r})=>(0,n.createElement)(r,{groupIds:e},(0,n.createElement)(R,{errors:t}))))}var H=r(88053);const U=(0,m.A)("fieldset",{target:"e1xcjnx23"})({name:"1i6y9la",styles:"display:flex;flex-wrap:wrap;align-items:center;padding:.5rem 1.5rem 1rem;gap:0.75rem"}),W=(0,m.A)(v.ui,{target:"e1xcjnx22"})({name:"adif5y",styles:"position:relative;display:inline;border-radius:1.5rem"}),P=(0,m.A)("input",{target:"e1xcjnx21"})({name:"1ouiv6l",styles:"opacity:0;position:absolute;width:100%;height:100%"}),F=(0,m.A)(v.EY,{target:"e1xcjnx20"})({name:"1nx3mrv",styles:"padding:0.75rem 1.25rem 0.75rem 0.75rem"});function T({selected:e,setSelected:t}){const{matchables:r}=(0,d.useSelect)((e=>({matchables:e(a.store).getMatchables()||[]})),[]);return(0,n.createElement)("div",{className:"itsec-user-groups-multi-group-selector"},(0,n.createElement)(U,null,(0,n.createElement)(u.VisuallyHidden,{as:"legend"},(0,s.__)("User Groups","better-wp-security")),r.map((r=>(0,n.createElement)(B,{key:r.id,id:r.id,selected:e,setSelected:t})))))}function B({id:e,selected:t,setSelected:r}){const{label:s}=(0,d.useSelect)((t=>({label:t(p.store).getEditedMatchableLabel(e)})),[e]),o=t.includes(e);return(0,n.createElement)(W,{variant:o?v.ls.SECONDARY:v.ls.PRIMARY},(0,n.createElement)(P,{type:"checkbox",checked:o,onChange:n=>(n=>{r(n?[...t,e]:(0,M.without)(t,e),"replaceIn")})(n.target.checked),id:`itsec-multi-group-selector-group-${e}`}),(0,n.createElement)(F,{text:s,variant:v.J3.DARK,weight:v.uL.HEAVY,as:"label",htmlFor:`itsec-multi-group-selector-group-${e}`,icon:o?H.A:E.A,iconColor:!o&&"#6817C5"}))}const j=(0,m.A)("div",{target:"em21pmf0"})({name:"olj6q7",styles:"max-width:530px;display:flex;flex-direction:column;gap:1.75rem"}),z=(0,n.createElement)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)("path",{d:"M9 4C7.35156 4 6 5.35156 6 7V26H6.42188C6.85938 27.1094 7.74219 28 9 28H26V26H9C8.4375 26 8 25.5625 8 25C8 24.4375 8.4375 24 9 24H26V4H9ZM9 6H24V22H9C8.64844 22 8.3125 22.0781 8 22.1875V7C8 6.4375 8.4375 6 9 6ZM10 10V12H22V10H10Z",fill:"#9675F7"})),q=(0,n.createElement)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)("path",{d:"M22 2C17.5938 2 14 5.59375 14 10C14 10.7109 14.1875 11.3516 14.3594 11.9844L13.875 12.4688L10 8.58594V5.44531L9.53125 5.15625L4.85938 2.23438L2.23438 4.8125L5.4375 10H8.58594L12.4687 13.875L5.17188 21.1719C3.61719 22.7266 3.61719 25.2734 5.17188 26.8281C6.72656 28.3828 9.27344 28.3828 10.8281 26.8281L16 21.6562L21.1719 26.8281C22.7266 28.3828 25.2734 28.3828 26.8281 26.8281C28.3828 25.2734 28.3828 22.7266 26.8281 21.1719L23.5 17.8438C27.1953 17.1406 30 13.8906 30 10C30 8.66406 29.6406 7.42188 29.0781 6.33594L28.4453 5.125L27.4844 6.09375L23.1875 10.3828L21.6172 8.8125L26.875 3.54688L25.6641 2.92188C24.5781 2.35938 23.3359 2 22 2ZM22 4C22.4531 4 22.8438 4.21875 23.2734 4.32813L18.7891 8.8125L23.1875 13.2109L27.6797 8.72656C27.7812 9.15625 28 9.54688 28 10C28 13.3281 25.3281 16 22 16C21.3125 16 20.6562 15.8594 20 15.625L19.4062 15.4219L9.41406 25.4141C8.625 26.2031 7.375 26.2031 6.58594 25.4141C5.79688 24.625 5.79688 23.375 6.58594 22.5859L16.5781 12.5938L16.375 12C16.1406 11.3438 16 10.6875 16 10C16 6.67188 18.6719 4 22 4ZM5.14062 4.76563L8 6.55469V7.83594L7.83594 8H6.5625L4.77344 5.11719L5.14062 4.76563ZM20.0156 17.6406C20.2187 17.6953 20.4219 17.7422 20.625 17.7969L25.4141 22.5859C26.2031 23.375 26.2031 24.625 25.4141 25.4141C24.625 26.2031 23.375 26.2031 22.5859 25.4141L17.4141 20.2422L20.0156 17.6406Z",fill:"#9675F7"}));var Y=r(28887),K=r(99103),J=r(62932);function Z(){const{select:e,resolveSelect:t}=(0,d.useRegistry)(),{createLocalGroup:r,editGroup:n,editGroupSetting:o,createdDefaultGroups:u}=(0,d.useDispatch)(p.store);return async()=>{if(e(p.store).hasCreatedDefaultGroups())return e(p.store).getMatchableNavIds();const c={administrator:(0,s.__)("Administrators","better-wp-security"),editor:(0,s.__)("Editors","better-wp-security"),author:(0,s.__)("Authors","better-wp-security"),contributor:(0,s.__)("Contributors","better-wp-security"),subscriber:(0,s.__)("Subscribers","better-wp-security")},d=await t(i.MODULES_STORE_NAME).getEditedModules(),g=await t(a.store).getMatchables(),m=e(p.store).getLocalGroupIds(),h=e(l.ONBOARD_STORE_NAME).getAnswers(),f={administrator:[],editor:[],author:[],contributor:[],subscriber:[]};for(const t of(0,M.map)((0,M.filter)(g,{type:"user-group"}),"id").concat(m)){const r=e(p.store).getEditedGroupAttribute(t,"canonical");for(const e of r)f[e].push(t)}const E={};for(const e of h)(0,M.isPlainObject)(e.canonical_group_substitutions)&&Object.assign(E,e.canonical_group_substitutions);for(const e in c){if(!c.hasOwnProperty(e))continue;const t=f[e];if(E.hasOwnProperty(e)){if(null===E[e]&&!t.length)continue;t.push(E[e])}if(0===t.length){const s=(0,Y.A)();r(s),n(s,{label:c[e],canonical:[e]}),t.push(s)}"subscriber"===e&&t.push("everybody-else");for(const r of d)if("active"===r.status.selected)for(const n in r.user_groups){if(!r.user_groups.hasOwnProperty(n))continue;if(!r.user_groups[n].default)continue;let s=r.user_groups[n].default;if(Array.isArray(s)||(s=[s]),(0,M.intersection)(["all",e],s).length>0)for(const e of t)o(e,r.id,n,!0)}for(const r of h)if(r.user_groups_settings[e])for(const n in r.user_groups_settings[e])if(r.user_groups_settings[e].hasOwnProperty(n))for(const s of r.user_groups_settings[e][n])for(const e of t)o(e,n,s,!0)}return u(),e(p.store).getMatchableNavIds()}}function X(){const e=Z(),{registerCompletionStep:t}=(0,d.useDispatch)(l.ONBOARD_STORE_NAME),{saveGroups:r,saveGroupSettingsAsBatch:n}=(0,d.useDispatch)(p.store);(0,b.ee)(X,(()=>{t({id:"savingUserGroups",label:(0,s.__)("Create User Groups","better-wp-security"),priority:15,callback:async()=>(await e(),r())}),t({id:"savingUserGroupsSetting",label:(0,s.__)("Setup User Group Settings","better-wp-security"),priority:20,callback:()=>n()})}))}function Q(){const{registerProvider:e}=(0,d.useDispatch)(K.E);(0,b.ee)(Q,(()=>{e("user-group-settings",(0,s.__)("User Group Settings","better-wp-security"),25,(({registry:e,evaluate:t,results:r})=>e.select(a.store).getSettingDefinitions((0,J.qD)()).reduce(((e,n)=>(0,M.reduce)(n.settings,((e,s,o)=>{var i,a,l;return t.stringMatch(s.title)||t.stringMatch(s.description)||t.keywordMatch(s.keywords)?(null!==(l=(i=r.groups)[a=n.id])&&void 0!==l||(i[a]={title:n.title,items:[]}),r.groups[n.id].items.push({title:s.title,description:s.description,route:`/settings/user-groups?module=${n.id}#${n.id}/${o}`}),e++):e}),e)),0))),e("user-groups",(0,s.__)("User Groups","better-wp-security"),50,(({registry:e,evaluate:t,results:r})=>(e.select(p.store).getAvailableGroups()||[]).reduce(((e,n)=>t.stringMatch(n.label)?(r.items.push({title:n.label,description:n.description,route:`/settings/user-groups/${n.id}`}),e++):e),0)))}))}function ee(){const e=(0,l.useNavigateTo)(),t=Z(),r=function(){const{resolveSelect:e}=(0,d.useRegistry)(),{editGroupSetting:t}=(0,d.useDispatch)(p.store);return async()=>{const r=await e(i.MODULES_STORE_NAME).getEditedModules(),n=await e(p.store).getMatchableNavIds();for(const e of n)for(const n of r)if("active"===n.status.selected)for(const r in n.user_groups)n.user_groups.hasOwnProperty(r)&&"all"===n.user_groups[r].default&&t(e,n.id,r,!0)}}();return(0,n.createElement)(j,null,(0,n.createElement)(u.Flex,{as:"header",gap:2,direction:"column",expanded:!1},(0,n.createElement)(v.DZ,{level:2,size:v.$C.EXTRA_LARGE,variant:v.J3.DARK,text:(0,s.__)("User Groups","better-wp-security")}),(0,n.createElement)(v.EY,{size:v.$C.SUBTITLE_SMALL,variant:v.J3.DARK,weight:v.uL.HEAVY,text:(0,s.__)("Enable or disable security features for specific groups of users.","better-wp-security")}),(0,n.createElement)(v.EY,{variant:v.J3.MUTED,text:(0,s.__)("Default user groups are the roles that already exist in WordPress, like Authors, Editors, and Administrators. Custom user groups can include any existing user or role. User groups allow you to define unique security options and requirements for each group. Create and enforce group security policies with default and custom user groups.","better-wp-security")})),(0,n.createElement)(u.Flex,{gap:12},(0,n.createElement)(l.SelectableCard,{title:(0,s.__)("Default User Groups","better-wp-security"),icon:z,direction:"vertical",onClick:async()=>{const n=await t();await r(),e(`/onboard/user-groups/${n[0]}`)}}),(0,n.createElement)(l.SelectableCard,{title:(0,s.__)("Custom User Groups","better-wp-security"),icon:q,direction:"vertical",onClick:()=>{e("/onboard/user-groups/everybody-else")}})))}const te=(0,m.A)("div",{target:"e16tg84q0"})({name:"s9thde",styles:"max-width:830px;width:100%;flex-grow:1"});function re({module:e,children:t}){const{createdDefaultGroups:r}=(0,d.useSelect)((e=>({createdDefaultGroups:e(p.store).hasCreatedDefaultGroups()})),[]);return(0,n.createElement)(te,null,(0,n.createElement)(Se,null,(0,n.createElement)(v.zY,{title:r?(0,s.__)("Default User Groups","better-wp-security"):(0,s.__)("Custom User Groups","better-wp-security"),description:r?(0,s.__)("Click any default user group to edit its features or its members.","better-wp-security"):(0,s.__)("Create custom user groups for each set of users you want to have a different security policy.","better-wp-security")})),(0,n.createElement)(l.OnboardHeader,{title:e.title,description:(0,n.createElement)(I.VK,{content:e.help,noWrap:!0}),showNext:!0,showIndicator:!0}),t)}var ne=r(98616),se=r.n(ne),oe=r(52238);const ie=se()(((e,t)=>{const r=[{value:"$administrator$",label:(0,s.__)("Administrator Capabilities","better-wp-security")},{value:"$editor$",label:(0,s.__)("Editor Capabilities","better-wp-security")},{value:"$author$",label:(0,s.__)("Author Capabilities","better-wp-security")},{value:"$contributor$",label:(0,s.__)("Contributor Capabilities","better-wp-security")},{value:"$subscriber$",label:(0,s.__)("Subscriber Capabilities","better-wp-security")}];t&&r.unshift({value:"$super-admin$",label:(0,s.__)("Super Admin","better-wp-security")}),(0,M.some)(e,(e=>""===e.canonical))&&r.push({value:"$other$",label:(0,s.__)("Other","better-wp-security"),selectable:!1});for(const t in e){if(!e.hasOwnProperty(t))continue;const{canonical:n,label:s}=e[t];r.push({value:t,parent:n.length>0?`$${n}$`:"$other$",label:s})}return Object.values(r)}));function ae({groupId:e,disabled:t=!1}){const{roles:r,canonical:o,available:i,schema:a}=(0,d.useSelect)((t=>({roles:t(p.store).getEditedGroupAttribute(e,"roles")||[],canonical:t(p.store).getEditedGroupAttribute(e,"canonical")||[],available:t("ithemes-security/core").getRoles(),schema:t("ithemes-security/core").getSchema("ithemes-security-user-group")})),[e]),{editGroup:l}=(0,d.useDispatch)(p.store),u=(0,M.get)(a,["properties","canonical","items","enum"],[]).includes("super-admin"),c=[...r,...o.map((e=>`$${e}$`))];return(0,n.createElement)(oe.wU,{label:(0,s.__)("Select Roles","better-wp-security"),help:(0,s.__)("Add users with the selected roles to this group.","better-wp-security"),value:c,disabled:t,options:ie(i,u),onChange:t=>{const[r,n]=(0,J.cM)(t,(e=>e.startsWith("$")&&e.endsWith("$")));l(e,{roles:n,canonical:(0,M.without)(r.map((e=>e.slice(1,-1))),"other")})}})}var le=r(85631),ue=r.n(le),ce=r(77172),de=r(89897);function pe(e){return{value:e.id,label:e.name,user:e}}const ge=e=>t=>new Promise(((r,n)=>{ue()({path:(0,ce.addQueryArgs)("/wp/v2/users",{search:t,per_page:100,context:"embed",itsec_global:!0})}).then((t=>(t.forEach(e),t))).then((e=>r(e.map(pe)))).catch(n)}));function me({groupId:e,disabled:t=!1}){const r=(0,de.useInstanceId)(me),{editGroup:o}=(0,d.useDispatch)(p.store),{receiveUser:i}=(0,d.useDispatch)("ithemes-security/core"),{users:a,loading:l}=(0,d.useSelect)((t=>{const r=t(p.store).getEditedGroupAttribute(e,"users")||[],n=[];let s=!1;return r.forEach((e=>{const r=t("ithemes-security/core").getUser(e);r?n.push(r):t("core/data").isResolving("ithemes-security/core","getUser",[e])&&(s=!0)})),{users:n,loading:s}}),[e]),[c,g]=(0,O.useState)(""),m=`itsec-user-group-panel-users__select-${r}`,h=l?[]:a.map(pe),f=(0,O.useMemo)((()=>ge(i)),[i]);return(0,n.createElement)(u.BaseControl,{className:"itsec-user-group-panel-users__select-control",label:(0,s.__)("Select Users","better-wp-security"),help:(0,s.__)("Select specific users to add to this group.","better-wp-security"),id:m},(0,n.createElement)(I.DW,{classNamePrefix:"components-itsec-async-select-control",inputId:m,isDisabled:t||l,isLoading:l,isMulti:!0,cacheOptions:!0,defaultOptions:!0,loadOptions:f,value:h,onChange:t=>o(e,{users:(0,M.map)(t,"value")}),inputValue:c,onInputChange:e=>g(e)}))}const he=(0,m.A)(u.Flex,{target:"efw12bs0"})({name:"hltamm",styles:"margin-top:2rem"});function fe({groupId:e}){const{isDirty:t,isSaving:r}=(0,d.useSelect)((t=>({isDirty:t(p.store).isDirty(e),isSaving:t(p.store).isSavingGroupOrSettings(e)})),[e]),{saveGroupAndSettings:o,resetEdits:i}=(0,d.useDispatch)(p.store),{root:a}=(0,h.g)(),{goNext:c}=(0,l.useNavigation)();return(0,n.createElement)(he,{justify:"end"},(0,n.createElement)(u.FlexItem,null,(0,n.createElement)(v.$n,{variant:"secondary",onClick:()=>i(e),disabled:!t},(0,s.__)("Undo Changes","better-wp-security"))),"settings"===a&&(0,n.createElement)(u.FlexItem,null,(0,n.createElement)(v.$n,{variant:"primary",onClick:()=>o(e),isBusy:r,disabled:r||!t},(0,s.__)("Save","better-wp-security"))),"settings"!==a&&(0,n.createElement)(v.$n,{text:(0,s.__)("Next","better-wp-security"),variant:"primary",onClick:c}))}const Ee=(0,m.A)(u.Flex,{target:"eluqwtc0"})({name:"hltamm",styles:"margin-top:2rem"});function ve({groupIds:e}){const{isDirty:t,isSaving:r}=(0,d.useSelect)((t=>({isDirty:t(p.store).hasBulkSettingEdits(),isSaving:t(p.store).isSavingBulkEdits(e)})),[e]),{saveBulkEdits:o,resetBulkGroupSettingEdits:i}=(0,d.useDispatch)(p.store);return(0,n.createElement)(Ee,{justify:"end"},(0,n.createElement)(u.FlexItem,null,(0,n.createElement)(v.$n,{variant:"secondary",onClick:()=>i(e),disabled:!t},(0,s.__)("Undo Changes","better-wp-security"))),(0,n.createElement)(u.FlexItem,null,(0,n.createElement)(v.$n,{variant:"primary",onClick:()=>o(e),isBusy:r,disabled:r||!t},(0,s.__)("Save","better-wp-security"))))}function be({groupId:e,children:t}){const{label:r,isLoading:o}=(0,d.useSelect)((t=>({label:t(p.store).getEditedGroupAttribute(e,"label"),isLoading:t("core/data").isResolving(a.store,"getGroup",[e])||t("core/data").isResolving(i.coreStore,"getIndex")})),[e]),{deleteGroup:l}=(0,d.useDispatch)(p.store),[g,m]=(0,v.Jg)({onContinue:()=>l(e),title:(0,s.__)("Confirm your action","better-wp-security"),body:(0,s.sprintf)((0,s.__)("Are you sure you want to delete the “%s” user group?","better-wp-security"),null!=r?r:(0,s.__)("Untitled","better-wp-security")),continueText:(0,s.__)("Delete User Group","better-wp-security")});return(0,n.createElement)(React.Fragment,null,m,(0,n.createElement)(Ie,null,(0,n.createElement)(v.$n,{text:(0,s.__)("Delete User Group","better-wp-security"),variant:"tertiary",isDestructive:!0,onClick:g})),(0,n.createElement)(u.Disabled,{isDisabled:o},t,(0,n.createElement)(c,{groupId:e,disabled:o})))}function _e({groupId:e,highlight:t,moduleFilter:r,children:o}){const{root:i}=(0,h.g)(),l=(0,p.useSettingsDefinitions)({module:r}),{isLoading:c}=(0,d.useSelect)((t=>{let r=!1;if(!t(p.store).isLocalGroup(e)){const n=t(a.store).getGroupSettings(e),s=t(a.store).isResolving("getGroupSettings",[e]);r=!n&&s}return{isLoading:r}}),[e]);return(0,n.createElement)(React.Fragment,null,"settings"===i&&(0,n.createElement)(Ie,null,(0,n.createElement)(f.N_,{to:`/settings/user-groups/multi?id=${e}&back=${e}`,component:(0,b.kk)(v.EY),as:"a",variant:v.J3.ACCENT,text:(0,s.__)("Edit Multiple Groups","better-wp-security")})),(0,n.createElement)(u.Disabled,{isDisabled:c},o,(0,n.createElement)(p.SettingsForm,{definitions:l,settingComponent:p.SingleSettingField,groupId:e,disabled:c,highlight:t})))}function ye({groupIds:e,children:t}){const r=(0,p.useSettingsDefinitions)();return(0,n.createElement)(u.Disabled,{isDisabled:!e.length},t,(0,n.createElement)(p.SettingsForm,{definitions:r,settingComponent:p.BulkSettingField,groupIds:e}))}const{Slot:we,Fill:Ie}=(0,u.createSlotFill)("UserGroupsPageHeaderAction"),{Slot:Le,Fill:Se}=(0,u.createSlotFill)("UserGroupsPageHeader");var xe=r(8227),Oe=r(2873);function Ce(){return X(),Q(),(0,n.createElement)(l.Page,{id:"user-groups",title:(0,s.__)("User Groups","better-wp-security"),icon:"groups",priority:10,roots:["settings","import"]},(()=>(0,n.createElement)(N,null)))}(0,Oe.addAction)("ithemes-security.onboard.applyAnswerResponse","ithemes-security/user-groups/onboard.applyAnswerResponse",(function(e,t){for(const r of t.user_groups)e.dispatch(p.store).createLocalGroup(r.id)&&e.dispatch(p.store).editGroup(r.id,(0,M.pick)(r,["label","users","roles","canonical"]));for(const r in t.user_groups_settings){if(!t.user_groups_settings.hasOwnProperty(r)||!(0,xe.A)(r))continue;const n=t.user_groups_settings[r];if(n)for(const t in n)if(n.hasOwnProperty(t))for(const s of n[t])e.dispatch(p.store).editGroupSetting(r,t,s,!0)}})),(0,Oe.addAction)("ithemes-security.onboard.reset","ithemes-security/user-groups/onboard.reset",(function(e){e.dispatch(p.store).deleteLocalGroups(),e.dispatch(p.store).resetAllEdits()})),r.p=window.itsecWebpackPublicPath,(0,s.setLocaleData)({"":{}},"ithemes-security-pro"),(0,o.registerPlugin)("itsec-user-groups",{render:()=>(0,n.createElement)(Ce,null)})},8227:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,s=function(e){return"string"==typeof e&&n.test(e)}},8601:e=>{e.exports=function(){return this.wp.element}()},11431:e=>{e.exports=function(){return this.wp.a11y}()},23270:e=>{e.exports=function(){return this.itsec["user-groups"].api}()},26425:e=>{e.exports=function(){return this.itsec.pages.settings}()},28887:(e,t,r)=>{"use strict";var n;r.d(t,{A:()=>u});var s=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(s)}for(var i=r(8227),a=[],l=0;l<256;++l)a.push((l+256).toString(16).substr(1));const u=function(e,t,r){var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var s=0;s<16;++s)t[r+s]=n[s];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]).toLowerCase();if(!(0,i.A)(r))throw TypeError("Stringified UUID is invalid");return r}(n)}},29672:e=>{e.exports=function(){return this.wp.notices}()},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}()},46942:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var e="",t=0;t
{"use strict";e.exports=window.React},55095:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(51609),s=r(55933);const o=(0,n.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(s.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"}))},55933:e=>{e.exports=function(){return this.wp.primitives}()},57677:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(8601);const s=(0,n.forwardRef)((function({icon:e,size:t=24,...r},s){return(0,n.cloneElement)(e,{width:t,height:t,...r,ref:s})}))},62247:e=>{e.exports=function(){return this.wp.isShallowEqual}()},66087:e=>{"use strict";e.exports=window.lodash},68440:e=>{e.exports=function(){return this.itsec["user-groups"].ui}()},70404:(e,t,r)=>{"use strict";function n(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function s(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function o(e,t){if(e.clientHeight
t||o>e&&i
=t&&a>=r?o-e-n:i>t&&a
r?i-t+s:0}r.d(t,{A:()=>u});var a=function(e,t){var r=window,s=t.scrollMode,a=t.block,l=t.inline,u=t.boundary,c=t.skipOverflowHiddenElements,d="function"==typeof u?u:function(e){return e!==u};if(!n(e))throw new TypeError("Invalid target");for(var p,g,m=document.scrollingElement||document.documentElement,h=[],f=e;n(f)&&d(f);){if((f=null==(g=(p=f).parentElement)?p.getRootNode().host||null:g)===m){h.push(f);break}null!=f&&f===document.body&&o(f)&&!o(document.documentElement)||null!=f&&o(f,c)&&h.push(f)}for(var E=r.visualViewport?r.visualViewport.width:innerWidth,v=r.visualViewport?r.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,y=e.getBoundingClientRect(),w=y.height,I=y.width,L=y.top,S=y.right,x=y.bottom,O=y.left,C="start"===a||"nearest"===a?L:"end"===a?x:L+w/2,N="center"===l?O+I/2:"end"===l?S:O,A=[],k=0;k
=0&&O>=0&&x<=v&&S<=E&&L>=$&&x<=H&&O>=U&&S<=V)return A;var W=getComputedStyle(D),P=parseInt(W.borderLeftWidth,10),F=parseInt(W.borderTopWidth,10),T=parseInt(W.borderRightWidth,10),B=parseInt(W.borderBottomWidth,10),j=0,z=0,q="offsetWidth"in D?D.offsetWidth-D.clientWidth-P-T:0,Y="offsetHeight"in D?D.offsetHeight-D.clientHeight-F-B:0,K="offsetWidth"in D?0===D.offsetWidth?0:R/D.offsetWidth:0,J="offsetHeight"in D?0===D.offsetHeight?0:G/D.offsetHeight:0;if(m===D)j="start"===a?C:"end"===a?C-v:"nearest"===a?i(_,_+v,v,F,B,_+C,_+C+w,w):C-v/2,z="start"===l?N:"center"===l?N-E/2:"end"===l?N-E:i(b,b+E,E,P,T,b+N,b+N+I,I),j=Math.max(0,j+_),z=Math.max(0,z+b);else{j="start"===a?C-$-F:"end"===a?C-H+B+Y:"nearest"===a?i($,H,G,F,B+Y,C,C+w,w):C-($+G/2)+Y/2,z="start"===l?N-U-P:"center"===l?N-(U+R/2)+q/2:"end"===l?N-V+T+q:i(U,V,R,P,T+q,N,N+I,I);var Z=D.scrollLeft,X=D.scrollTop;C+=X-(j=Math.max(0,Math.min(X+j/J,D.scrollHeight-G/J+Y))),N+=Z-(z=Math.max(0,Math.min(Z+z/K,D.scrollWidth-R/K+q)))}A.push({el:D,top:j,left:z})}return A};function l(e){return e===Object(e)&&0!==Object.keys(e).length}const u=function(e,t){var r=e.isConnected||e.ownerDocument.documentElement.contains(e);if(l(t)&&"function"==typeof t.behavior)return t.behavior(r?a(e,t):[]);if(r){var n=function(e){return!1===e?{block:"end",inline:"nearest"}:l(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var r="scrollBehavior"in document.body.style;e.forEach((function(e){var n=e.el,s=e.top,o=e.left;n.scroll&&r?n.scroll({top:s,left:o,behavior:t}):(n.scrollTop=s,n.scrollLeft=o)}))}(a(e,n),n.behavior)}}},74596:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(51609),s=r(55933);const o=(0,n.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(s.Path,{d:"M7 11.5h10V13H7z"}))},75795:e=>{"use strict";e.exports=window.ReactDOM},76154:e=>{"use strict";e.exports=window.moment},77172:e=>{e.exports=function(){return this.wp.url}()},79860:e=>{e.exports=function(){return this.wp.keycodes}()},84156:(e,t,r)=>{"use strict";var n,s;function o(e){return[e]}function i(){var e={clear:function(){e.head=null}};return e}function a(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;n
l}),n={},s="undefined"!=typeof WeakMap},85631:e=>{e.exports=function(){return this.wp.apiFetch}()},88053:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(51609),s=r(55933);const o=(0,n.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(s.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}))},89897:e=>{e.exports=function(){return this.wp.compose}()},89959:e=>{e.exports=function(){return this.wp.date}()},99103:(e,t,r)=>{"use strict";r.d(t,{E:()=>W,v:()=>k});var n={};r.r(n),r.d(n,{REGISTER_PROVIDER:()=>V,registerProvider:()=>$});var s={};r.r(s),r.d(s,{getProviders:()=>H});var o=r(58168),i=r(51609),a=r(54625),l=r(56347),u=r(17929),c=r(66087),d=r(39959),p=r(3075),g=r(8601),m=r(31987),h=r(89897),f=r(79860),E=r(11431),v=r(88356),b=r(98883),_=r(52238);function y(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function w(e,t){return e.get(L(e,t))}function I(e,t,r){return e.set(L(e,t),r),r}function L(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var S=new WeakMap,x=new WeakMap,O=new WeakMap,C=new WeakMap,N=new WeakMap;class A{constructor(e,t){y(this,S,void 0),y(this,x,void 0),y(this,O,void 0),y(this,C,void 0),y(this,N,void 0),I(S,this,e),I(x,this,t),I(O,this,t.select(W).getProviders()),this._prepare()}_prepare(){I(N,this,w(S,this).split(/\s+/g).map((e=>e.trim().toLowerCase())).filter((e=>!!e)));const e=w(S,this).endsWith(" ");I(C,this,new RegExp(w(N,this).map(((t,r)=>r+1!==w(N,this).length||e?`(?=.*\\b${(0,c.escapeRegExp)(t)}\\b)`:`(?=.*\\b${(0,c.escapeRegExp)(t)})`)).join("")+".+","gi"))}_stringMatch(e){return e&&w(C,this).test(e)}_keywordMatch(e){return!(!e||!e.length)&&e.some((e=>w(N,this).some(((t,r)=>e.includes(" ")?this._stringMatch(e):r===w(N,this).length-1?e.startsWith(t):t===e))))}getResults(){if(w(S,this).length<3)return[{},0];let e=0;const t=[],r={stringMatch:e=>this._stringMatch(e),keywordMatch:e=>this._keywordMatch(e)};for(const n of w(O,this)){const s={title:n.title,items:[],groups:{}};e+=n.callback({evaluate:r,results:s,registry:w(x,this)}),!s.items.length&&(0,c.isEmpty)(s.groups)||t.push(s)}return[t,e]}}const k=(0,g.forwardRef)((function({onPick:e=c.noop,showResults:t},r){const[n,s]=(0,g.useState)(""),[a,l]=(0,g.useState)(!1),u=(0,g.useRef)(),d=(0,g.useRef)(),[_,y]=(0,g.useState)([]),w=(0,m.useRegistry)(),I=(0,g.useCallback)((e=>{const t=new A(e,w).getResults();y(t[0]),(0,E.speak)((0,p.sprintf)((0,p._n)("%d result found.","%d results found.",t[1],"better-wp-security"),t[1]))}),[w]),L=(0,h.useDebounce)(I,50),S=(0,g.useCallback)((e=>{u.current&&(e.preventDefault(),u.current.focus())}),[u]);return(0,h.useKeyboardShortcut)("/",S),(0,i.createElement)("div",(0,o.A)({className:"itsec-search"},(0,b.$I)((()=>l(!1)))),(0,i.createElement)("div",null,(0,i.createElement)(v.qz,{value:n,onChange:e=>{s(e),L(e)},onFocus:()=>l(!0),onKeyDown:e=>{e.keyCode===f.DOWN&&(e.preventDefault(),d.current.focus())},ref:(0,b.SV)([r,u]),placeholder:(0,p.__)("Search for features, settings, and more","better-wp-security"),omitSeparators:!0,size:"large"}),(a||t)&&n.length>=3&&(0,i.createElement)(D,{results:_,exitSearch:t=>{e(t),l(!1)},ref:d,onPick:e})))})),D=(0,g.forwardRef)((function({results:e,exitSearch:t,onPick:r},n){const s=(0,g.useRef)();(0,g.useImperativeHandle)(n,(()=>({focus(){s.current.focus()}})));const a=(0,h.useInstanceId)(D,"itsec-search"),m=a+"__result__",E=function(){const e=(0,l.W6)();return(t,r="push")=>e[r]((0,u.yJ)(t))}(),[v,b]=(0,g.useState)("");return(0,c.isEmpty)(e)?null:(0,i.createElement)(React.Fragment,null,(0,i.createElement)(d.VisuallyHidden,{id:a+"__label"},(0,p.__)("Search Results","better-wp-security")),(0,i.createElement)(_.NL,{className:"itsec-search__results",id:a,active:v&&m+v,onNavigate:e=>b(e.substring(m.length)),onKeyDown:({keyCode:e})=>{!v||e!==f.ENTER&&e!==f.SPACE||(r(v),E(v),t())},onFocus:()=>{if(!v&&!(0,c.isEmpty)(e)){const[,t]=Object.entries(e)[0];if(t.items?.length)b(t.items[0].route);else if(!(0,c.isEmpty)(t.groups)){const[,e]=Object.entries(t.groups)[0];b(e.items[0].route)}}},role:"listbox",descendantRoles:"option",ref:s,"aria-labelledby":a+"__label"},(0,c.map)(e,((e,r)=>(0,i.createElement)(M,(0,o.A)({key:r},e,{active:v,idPrefix:m,exitSearch:t}))))))}));function M({title:e,items:t,groups:r,...n}){const s=(0,h.useInstanceId)(D,"itsec-search__kind");return(0,i.createElement)("ul",{className:"itsec-search__kind",role:"group","aria-labelledby":s},(0,i.createElement)("li",{role:"presentation",id:s},e),(t||[]).map((e=>(0,i.createElement)(R,(0,o.A)({key:e.route},e,n)))),(0,c.map)(r,((e,t)=>(0,i.createElement)(G,(0,o.A)({key:t},e,n)))))}function G({title:e,items:t,...r}){const n=(0,h.useInstanceId)(D,"itsec-search__group");return(0,i.createElement)("ul",{className:"itsec-search__group",role:"group","aria-labelledby":n},(0,i.createElement)("li",{role:"presentation",id:n},(0,i.createElement)("span",null,e)),(t||[]).map((e=>(0,i.createElement)(R,(0,o.A)({key:e.route},e,r)))))}function R({title:e,description:t,route:r,active:n,idPrefix:s,exitSearch:o}){return(0,i.createElement)("li",{className:"itsec-search__result",role:"option","aria-selected":n===r||void 0,id:s+r,"aria-label":e},(0,i.createElement)(a.N_,{to:r,tabIndex:-1,onClick:()=>o(r)},(0,i.createElement)("span",null,e),(0,i.createElement)(_.VK,{content:t,noHtml:!0,tagName:"p"})))}function $(e,t,r,n){return{type:V,slug:e,title:t,priority:r,callback:n}}const V="REGISTER_PROVIDER",H=(0,r(84156).A)((e=>(0,c.sortBy)(e.providers,"priority")),(e=>e.providers)),U={providers:{}},W="ithemes-security/search";(0,m.registerStore)(W,{actions:n,selectors:s,reducer:function(e=U,t){return t.type===V?{...e,providers:{...e.providers,[t.slug]:(0,c.omit)(t,["type"])}}:e}})}},e=>{e.O(0,[9427,8356,2038,3733,8363,5152,2932,3520,7926,2238],(()=>e(e.s=6767)));var t=e.O();((window.itsec=window.itsec||{})["user-groups"]=window.itsec["user-groups"]||{}).settings=t}]);