import Lang from '../util/i18n.js';
import { got, db, sendMsg, createNotice, escapeText, hasPerm } from './util.js';
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const {limit: {verification: verificationLimit}, usergroups} = require('../util/default.json');
const fieldset = {
channel: '
'
+ ''
+ ''
+ '
'
+ '',
role: ''
+ ''
+ ''
+ ''
+ ''
+ ''
+ ''
+ '
'
+ '',
usergroup: ''
+ ''
+ ''
+ ''
+ ''
+ ''
+ '
',
editcount: ''
+ '',
postcount: ''
+ ''
+ ''
+ '
'
+ 'Only Fandom wikis:'
+ ''
+ ''
+ '
'
+ ''
+ ''
+ '
'
+ ''
+ ''
+ '
',
accountage: ''
+ '',
rename: ''
+ '',
save: '',
delete: ''
};
/**
* Create a settings form
* @param {import('cheerio').CheerioAPI} $ - The response body
* @param {String} header - The form header
* @param {import('./i18n.js').default} dashboardLang - The user language
* @param {Object} settings - The current settings
* @param {String} settings.channel
* @param {String} settings.role
* @param {String} settings.usergroup
* @param {Number} settings.editcount
* @param {Number} settings.postcount
* @param {Number} settings.accountage
* @param {Boolean} settings.rename
* @param {String} [settings.defaultrole]
* @param {import('./util.js').Channel[]} guildChannels - The guild channels
* @param {import('./util.js').Role[]} guildRoles - The guild roles
* @param {String} wiki - The guild wiki
*/
function createForm($, header, dashboardLang, settings, guildChannels, guildRoles, wiki) {
var readonly = ( process.env.READONLY ? true : false );
var fields = [];
let channel = $('').append(fieldset.channel);
channel.find('label').text(dashboardLang.get('verification.form.channel'));
let curCat = null;
channel.find('#wb-settings-channel').append(
$('