<?php
if (!defined('ABSPATH'))
    exit;

// define('ADMIN_UI_URL', 'http://127.0.0.1:3010');
// define('WIDGET_URL', 'https://mori-js.s3.ir-thr-at1.arvanstorage.ir/widget.js');
// define('BACKEND_URL', 'https://api.mori.style');
// define('CRAWLER_URL', 'https://gollum.mori.style');
// define('MORI_STYLE_API_URL', 'http://host.docker.internal:3000');
// define('SHOW_WORDPRESS_DEBUG_LOG', false);


// Production constants
define('ADMIN_UI_URL', 'https://mori-js.s3.ir-thr-at1.arvanstorage.ir/admin-ui');
define('WIDGET_URL', 'https://mori-js.s3.ir-thr-at1.arvanstorage.ir/widget.js');
define('BACKEND_URL', 'https://api.mori.style');
define('CRAWLER_URL', 'https://gollum.mori.style');
define('MORI_STYLE_API_URL', 'https://mori.style');
define('SHOW_WORDPRESS_DEBUG_LOG', false);


class Dori_Chatbot_API_Constants
{
    const BOT_CREATION_AUTH_TOKEN = "doridoridori";

    const ENDPOINT_ADD_SELLER_ACCOUNT = "/add-woocommerce-seller-account";
    const ENDPOINT_CRAWL_PROGRESS = "/crawl-progress";
    const ENDPOINT_EXTRACT_BOT_DATA = "/woocommerce-seller/extract-bot-data";

    const ENDPOINT_CREATE_BOT = "/seller/bot";
    const ENDPOINT_HEALTH_CHECK = "/seller/health-check";

    const ENDPOINT_WOOCOMMERCE_LOOKUP_USER = "/woocommerce/lookup-user";
    const ENDPOINT_WOOCOMMERCE_INTEGRATE = "/woocommerce/integrate";

    const ENDPOINT_ROI_WEBHOOK = "/roi/webhook/wordpress";

    const ENDPOINT_WC_SYSTEM_STATUS = "/wp-json/wc/v3/";

    public static function get_server_base_url()
    {
        if (defined('BACKEND_URL') && !empty(BACKEND_URL)) {
            return BACKEND_URL;
        }

        return 'https://api.mori.style';
    }

    public static function get_crawler_base_url()
    {
        return defined('CRAWLER_URL') ? CRAWLER_URL : 'https://gollum.mori.style';
    }

    public static function get_woocommerce_api_base_url()
    {
        return trailingslashit(get_site_url());
    }

    public static function get_admin_ui_url()
    {
        return defined('ADMIN_UI_URL') ? ADMIN_UI_URL : 'https://mori-js.s3.ir-thr-at1.arvanstorage.ir/admin-ui';
    }

    public static function get_widget_url()
    {
        return defined('WIDGET_URL') ? WIDGET_URL : 'https://mori-js.s3.ir-thr-at1.arvanstorage.ir/widget.js';
    }

    public static function get_show_debug_log()
    {
        return defined('SHOW_WORDPRESS_DEBUG_LOG') ? SHOW_WORDPRESS_DEBUG_LOG : false;
    }

    public static function get_mori_style_base_url()
    {
        return defined('MORI_STYLE_API_URL') ? MORI_STYLE_API_URL : 'https://mori.style';
    }
}
