export function imperialRaidEnvironment(payload){ const lines=payload.split(/(?<=\n)/),matches=[]; for(let i=0;i1)throw Error('Duplicate Imperial raid activation setting requires review'); if(matches.length)lines[matches[0]]='IMPERIAL_RAIDS_ENABLED=true'+(lines[matches[0]].endsWith('\r\n')?'\r\n':lines[matches[0]].endsWith('\n')?'\n':''); else{if(payload&&!payload.endsWith('\n'))lines.push('\n');lines.push('IMPERIAL_RAIDS_ENABLED=true\n');} return lines.join(''); }