<?php

use App\Services\Scraping\PuppeteerListingScraper;

return [

    'puppeteer' => [
        'enabled' => env('SCRAPING_PUPPETEER_ENABLED', false),
        'node_binary' => env('SCRAPING_NODE_BINARY', 'node'),
        'listing_script' => env('SCRAPING_LISTING_SCRIPT', 'scripts/scraping/scrape-listing.js'),
        'timeout_seconds' => (int) env('SCRAPING_LISTING_TIMEOUT', 180),
        'browser_channel' => env('SCRAPING_BROWSER_CHANNEL', 'chrome'),
        'browser_engine' => env('SCRAPING_BROWSER_ENGINE', 'auto'),
        'browser_engines' => env('SCRAPING_BROWSER_ENGINES', 'chrome,firefox,chromium'),
        // Kohls and Marshalls try firefox → stealth → chrome automatically (see scripts/scraping/sites/*.js).
        'headless' => env('SCRAPING_HEADLESS', 'true'),
        'proxy' => env('SCRAPING_PROXY'),
        'proxy_username' => env('SCRAPING_PROXY_USERNAME'),
        'proxy_password' => env('SCRAPING_PROXY_PASSWORD'),
        'cookies_file' => env('SCRAPING_COOKIES_FILE'),
    ],

    'listing_scraper' => env('SCRAPING_LISTING_SCRAPER', PuppeteerListingScraper::class),

    'ranking' => [
        'enabled' => env('CATALOG_PRODUCT_RANKING_ENABLED', true),
        'ai_enabled' => env('CATALOG_PRODUCT_RANKING_AI_ENABLED', true),
        'limit' => (int) env('CATALOG_RANKED_PRODUCT_LIMIT', 10),
    ],

];
