(window.webpackJsonpPlesk=window.webpackJsonpPlesk||[]).push([["app/profile/announcement-settings"],{1072:function(e,n,t){"use strict";t.r(n);var o=t(156),c=t(155),a=t(145),s=t(1073);n.default=({id:e,email:n,infoClosed:t,dialogShown:l})=>{const d=a.Locale.getSection("admin.components.forms.admin.announcement-settings"),i=document.getElementById("".concat(e,"-loader")),r=document.getElementById("".concat(e)),u=document.getElementById("".concat(e,"-info")),p=document.getElementById("".concat(e,"-checkbox")),y=document.getElementById("".concat(e,"-checkbox-block")),m=document.getElementById("".concat(e,"-radio-block")),g=document.getElementById("".concat(e,"-warning")),f=document.getElementById("".concat(e,"-retry")),h=e=>e.some(e=>"send_personalized_announce"===e.type),v=async()=>{y.style.display="none",m.style.display="none",g.style.display="none",i.style.display="";try{const{consents:e,status:f}=await a.api.get(Object(a.prepareUrl)("/my-profile/get-consent"),{email:n});if(i.style.display="none","error"!==f&&e){const n=e.filter(e=>e.enabled);(e=>{h(e)||(e.length>0?!t&&Object(c.render)(Object(c.createElement)(s.default,{onClose:()=>a.api.post(Object(a.prepareUrl)("/my-profile/close-consent-info"))},d.lmsg("consentGivenInfo")),u):l&&Object(c.render)(Object(c.createElement)(o.StatusMessage,{intent:"info"},d.lmsg("consentNotGivenInfo")),u))})(n),(e=>{h(e)?(p.checked=!0,y.style.display="",r.value="send_personalized_announce",p.addEventListener("change",e=>{r.value=e.target.checked?"send_personalized_announce":"none"})):e.length>0?(m.style.display="",r.value="send_announce",m.addEventListener("change",e=>{r.value=e.target.value})):(p.checked=!1,y.style.display="",r.value="none",p.addEventListener("change",e=>{r.value=e.target.checked?"send_personalized_announce":"none"}))})(n)}else g.style.display=""}catch{i.style.display="none",g.style.display=""}};f.addEventListener("click",e=>{e.preventDefault(),v()}),v()}},1073:function(e,n,t){"use strict";t.r(n);var o=t(156),c=t(155),a=t(276),s=t.n(a);const l=({children:e,onClose:n})=>{const[t,a]=Object(c.useState)(!0);return t?Object(c.createElement)(o.StatusMessage,{intent:"info",onClose:()=>{n(),a(!1)}},e):null};l.propTypes={children:s.a.node.isRequired,onClose:s.a.func.isRequired},n.default=l}}]);
//# sourceMappingURL=announcement-settings.js.map?ae89d1b0a162b01e820b