<?php

return [
    'control_service' => [
        'base_url' => env('PHOTOBOOTH_CONTROL_BASE_URL'),
        'token' => env('PHOTOBOOTH_CONTROL_TOKEN'),
        'timeout' => (int) env('PHOTOBOOTH_CONTROL_TIMEOUT', 5),
    ],
    'ftp' => [
        'host' => env('PHOTOBOOTH_FTP_HOST'),
        'port' => (int) env('PHOTOBOOTH_FTP_PORT', 2121),
    ],
    'credentials' => [
        'username_prefix' => env('PHOTOBOOTH_USERNAME_PREFIX', 'pb'),
        'username_length' => (int) env('PHOTOBOOTH_USERNAME_LENGTH', 8),
        'password_length' => (int) env('PHOTOBOOTH_PASSWORD_LENGTH', 8),
    ],
    'rate_limit_per_minute' => (int) env('PHOTOBOOTH_RATE_LIMIT_PER_MINUTE', 20),
    'expiry_grace_days' => (int) env('PHOTOBOOTH_EXPIRY_GRACE_DAYS', 1),
    'import' => [
        'disk' => env('PHOTOBOOTH_IMPORT_DISK', 'photobooth'),
        'max_files_per_run' => (int) env('PHOTOBOOTH_IMPORT_MAX_FILES', 50),
        'allowed_extensions' => array_values(array_filter(array_map(
            fn ($ext) => strtolower(trim($ext)),
            explode(',', env('PHOTOBOOTH_ALLOWED_EXTENSIONS', 'jpg,jpeg,png,webp'))
        ))),
    ],
    'sparkbooth' => [
        'allowed_extensions' => array_values(array_filter(array_map(
            fn ($ext) => strtolower(trim($ext)),
            explode(',', env('SPARKBOOTH_ALLOWED_EXTENSIONS', env('PHOTOBOOTH_ALLOWED_EXTENSIONS', 'jpg,jpeg,png,webp')))
        ))),
        'max_size_kb' => (int) env('SPARKBOOTH_MAX_SIZE_KB', 8192),
        'rate_limit_per_minute' => (int) env('SPARKBOOTH_RATE_LIMIT_PER_MINUTE', env('PHOTOBOOTH_RATE_LIMIT_PER_MINUTE', 20)),
        'response_format' => env('SPARKBOOTH_RESPONSE_FORMAT', 'json'),
    ],
    'connect_code' => [
        'length' => (int) env('PHOTOBOOTH_CONNECT_CODE_LENGTH', 6),
        'expires_minutes' => (int) env('PHOTOBOOTH_CONNECT_CODE_EXPIRES_MINUTES', 10),
    ],
];
