| 376 | `; |
| 377 | |
| 378 | const applyPredefinedRulesFunction = () => ` |
| 379 | function applyPredefinedRules() { |
| 380 | const select = document.getElementById('predefinedRules'); |
| 381 | if (!select) return; |
| 382 | const predefinedRules = select.value; |
| 383 | const checkboxes = document.querySelectorAll('.rule-checkbox'); |
| 384 | checkboxes.forEach(checkbox => { checkbox.checked = false; }); |
| 385 | if (predefinedRules === 'custom') return; |
| 386 | const rulesToApply = ${JSON.stringify(PREDEFINED_RULE_SETS)}; |
| 387 | rulesToApply[predefinedRules].forEach(rule => { |
| 388 | const checkbox = document.getElementById(rule); |
| 389 | if (checkbox) checkbox.checked = true; |
| 390 | }); |
| 391 | } |
| 392 | `; |
| 393 | |
| 394 | const submitFormFunction = () => ` |
| 395 | async function submitForm(event) { |