"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/web-app-firewall/submit-handler"],{1351:(e,t,n)=>{n.r(t);var s=n(88);const o=s.Locale.getSection("components.forms.web-app-firewall"),l=s.Locale.getSection("components.buttons");t.default=({currentWebServer:e,currentRuleSet:t,isCustomized:n,needPresetWarning:r})=>{const c=[];let i=!1;const u=document.getElementById("ruleSets-webServer")?.value;"nginx"===u&&e!==u&&n&&(c.push(o.lmsg("nginxIsIncompatible")),i=!0);const m=document.getElementById("ruleSets-ruleSet-crs")?.checked;m&&"crs"!==t&&c.push(o.lmsg("ruleSetCrsConfirmDescription"));const d=document.getElementById("ruleEngine-DetectionOnly"),a=document.getElementById("config-configPreset-thorough");if(!r||d&&!d.checked||a&&!a.checked||c.push(o.lmsg("detectionOnlyAndThoroughModeWarning")),!c.length)return!0;let g=c[0],p="p",h=e=>e;return c.length>1&&(g=c.map((e=>`<li>${e}</li>`)).join(""),p="ul"),i&&(h=e=>`${e}<div class="indent-box"><input type="checkbox" class="checkbox" id="resetBox" value="true"><div class="indent-box-content"><label for="resetBox">${o.lmsg("nginxResetCustomizations")}</label></div></div>`),new Promise((e=>{s.messageBox.show({type:s.messageBox.TYPE_YESNO,subtype:s.messageBox.SUBTYPE_CONFIRM,text:o.lmsg("ruleSetCrsConfirmTitle"),description:g,descriptionWrapperTag:p,descriptionDecorator:h,onYesClick:()=>{document.getElementById("resetBox")?.checked&&(document.getElementById("ruleSets-resetCustomizations").value="true"),e(!0)},onNoClick:()=>{e(!1)},buttonTitles:{yes:l.lmsg("yes"),no:l.lmsg("no")}})}))}}}]);
//# sourceMappingURL=submit-handler.js.map?15490fa98233b49a3d7a