"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/domain/restriction"],{2641:(e,t,o)=>{o.r(t),o.d(t,{Toggles:()=>r,default:()=>a});var s=o(285),l=o(89),i=o(286),n=o(287),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},2640:(e,t,o)=>{o.r(t),o.d(t,{default:()=>i});var s=o(285),l=o(2641);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?8ff62eeddec66fba6316