"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["app/domain/restriction"],{3197(e,t,o){o.r(t),o.d(t,{Toggles:()=>r,default:()=>a});var s=o(378),l=o(95),i=o(379),n=o(763),g=o.n(n);const r=({listToggleStatus:e,resolutionToggleStatus:t,resolutionToggleIsAllowed:o=!1})=>{const[n,g]=(0,s.useState)(e),[r,a]=(0,s.useState)(t),[u,d]=(0,s.useState)(!1),[c,T]=(0,s.useState)(!1),S=l.Locale.getSection("admin.components.lists.restricteddomains");(0,s.useEffect)(()=>{g(e),a(t)},[e,t]);return(0,s.jsxs)(s.Fragment,{children:[o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Switch,{id:"resolutionToggle",onChange:e=>(e=>{a(e=>!e),T(!0),l.api.post("/admin/domain-restriction/resolution-restriction",{toState:e}).finally(()=>T(!1))})(e),loading:c,checked:r,children:S.lmsg("toggleResolution")}),(0,s.jsx)("br",{})]}),(0,s.jsx)(i.Switch,{id:"listToggle",onChange:e=>(e=>{g(e=>!e),d(!0),l.api.post("/admin/domain-restriction/list-restriction",{toState:e}).finally(()=>d(!1))})(e),loading:u,checked:n,children:S.lmsg("toggleProhibitedList")})]})};r.propTypes={listToggleStatus:g().bool.isRequired,resolutionToggleStatus:g().bool.isRequired,resolutionToggleIsAllowed:g().bool};const a=r},3196(e,t,o){o.r(t),o.d(t,{default:()=>i});var s=o(378),l=o(3197);const i=({listToggleStatus:e,resolutionToggleStatus:t,resolutionToggleIsAllowed:o,renderTo:i})=>{(0,s.render)((0,s.jsx)(l.Toggles,{listToggleStatus:e,resolutionToggleStatus:t,resolutionToggleIsAllowed:o}),document.getElementById(i))}}}]);
//# sourceMappingURL=restriction.js.map?1526111a80b8ff6ed829