<?php
/**
 * Admin view: the Anti-abuse panel of the settings screen.
 *
 * Included by admin/views/settings.php inside that tab's own form, so the
 * closures and the $s array defined there are in scope here.
 *
 * @package BitForgeNet_Guest_Tickets
 */

defined( 'ABSPATH' ) || exit;

// This file is a template: it is included from a method -- never at file
// scope -- so everything declared here belongs to that method's variable
// scope and not to the global one. PHPCS reads each file on its own and has
// no way to see where the include happens, so it reads these as globals.
// Stated once, for the whole file, per this plugin's suppression rule.
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
?>
	<div class="bfnet-panel">
		<div class="bfnet-panel__head"><h2><?php esc_html_e( 'Anti-abuse', 'bitforgenet-guest-tickets' ); ?></h2></div>
		<div class="bfnet-panel__body">
			<div class="bfnet-row">
				<div class="bfnet-field">
					<label for="s-rate"><?php esc_html_e( 'Bookings per hour, per visitor', 'bitforgenet-guest-tickets' ); ?></label>
					<input type="number" id="s-rate" name="bfnet_settings[rate_limit_per_hour]" min="0" max="200" value="<?php echo (int) $s['rate_limit_per_hour']; ?>">
					<p class="description"><?php esc_html_e( '0 disables the limit.', 'bitforgenet-guest-tickets' ); ?></p>
				</div>
				<div class="bfnet-field">
					<label for="s-minsec"><?php esc_html_e( 'Minimum seconds to fill the form', 'bitforgenet-guest-tickets' ); ?></label>
					<input type="number" id="s-minsec" name="bfnet_settings[min_form_seconds]" min="0" max="60" value="<?php echo (int) $s['min_form_seconds']; ?>">
				</div>
			</div>
			<?php
			$bfnet_check( 'enable_honeypot', __( 'Hidden honeypot field', 'bitforgenet-guest-tickets' ), __( 'Invisible to people, irresistible to bots.', 'bitforgenet-guest-tickets' ), $s );
			$bfnet_check( 'block_disposable_email', __( 'Reject throwaway email domains', 'bitforgenet-guest-tickets' ), '', $s );
			?>
		</div>
	</div>
