(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[675],{98404:(e,t,r)=>{"use strict";r.r(t);var n=r(6293),s=r(95122),i=r(3571),a=r(64893),o=r(87514),c=r.n(o),l=r(48015),p=r(33590),u=r(91991),d=r(31600);function h(e){let{label:t,detectIp:r}=e;return(0,n.createElement)("div",{className:"itsec-global-detected-ip"},(0,n.createElement)(a.Button,{variant:"secondary",onClick:r},(0,s.__)("Check IP","better-wp-security")),(0,n.createElement)("span",null,t))}function g(e){let{value:t,onChange:r,ip:i}=e;return(0,n.createElement)(a.Button,{variant:"secondary",onClick:()=>{r([...t,i])},disabled:!i,className:"itsec-global-add-authorized-ip"},(0,s.__)("Add my current IP to the authorized hosts list","better-wp-security"))}function m(){const{label:e,detectIp:t,ip:r}=function(){const{proxy:e,proxyHeader:t,schema:r}=(0,l.useSelect)((e=>({proxy:e(d.MODULES_STORE_NAME).getEditedSetting("global","proxy"),proxyHeader:e(d.MODULES_STORE_NAME).getEditedSetting("global","proxy_header"),schema:e(d.MODULES_STORE_NAME).getSettingSchema("global","proxy")}))),i=(0,n.useCallback)((()=>{const n={proxy:r.enum.includes(e)?e:r.default};return"manual"===n.proxy&&(n.args={header:t}),c()({method:"POST",path:"ithemes-security/rpc/global/detect-ip",data:n})}),[e,t,r]),{execute:a,status:o,value:p,error:h}=(0,u.r5)(i,!!e&&!!r);let g;switch(o){case"idle":break;case"pending":g=(0,s.__)("Detecting IP","better-wp-security");break;case"success":g=(0,s.sprintf)((0,s.__)("Detected IP: %s","better-wp-security"),p.ip);break;case"error":g=(0,s.sprintf)((0,s.__)("Error detecting IP: %s","better-wp-security"),h.message||(0,s.__)("Unknown error."))}return{label:g,detectIp:a,ip:p?.ip}}();return(0,n.createElement)(React.Fragment,null,(0,n.createElement)(p.bB,{name:"itsec_global_lockout_white_list"},(e=>{let{formData:t,onChange:s}=e;return(0,n.createElement)(g,{value:t,onChange:s,ip:r})})),(0,n.createElement)(p.bB,{name:"itsec_global_proxy"},(()=>(0,n.createElement)(h,{label:e,detectIp:t}))))}r.p=window.itsecWebpackPublicPath,(0,s.setLocaleData)({"":{}},"ithemes-security-pro"),(0,i.registerPlugin)("itsec-global-settings",{render:()=>(0,n.createElement)(m,null)})},31600:e=>{e.exports=function(){return this.itsec.packages.data}()},82839:e=>{e.exports=function(){return this.wp.a11y}()},87514:e=>{e.exports=function(){return this.wp.apiFetch}()},64893:e=>{e.exports=function(){return this.wp.components}()},9576:e=>{e.exports=function(){return this.wp.compose}()},48015:e=>{e.exports=function(){return this.wp.data}()},6293:e=>{e.exports=function(){return this.wp.element}()},95122:e=>{e.exports=function(){return this.wp.i18n}()},81834:e=>{e.exports=function(){return this.wp.isShallowEqual}()},81019:e=>{e.exports=function(){return this.wp.keycodes}()},3571:e=>{e.exports=function(){return this.wp.plugins}()},14776:e=>{e.exports=function(){return this.wp.primitives}()},73470:e=>{e.exports=function(){return this.wp.url}()},99196:e=>{"use strict";e.exports=window.React},91850:e=>{"use strict";e.exports=window.ReactDOM},92819:e=>{"use strict";e.exports=window.lodash}},e=>{e.O(0,[271,652,96,639,991,144,155],(()=>(98404,e(e.s=98404))));var t=e.O();((window.itsec=window.itsec||{}).global=window.itsec.global||{}).settings=t}]);