<?php
/**
 * LuxStrat Theme Registry
 *
 * Central registry for all Luxembourg structuring themes.
 * Add new themes here — the scheduler, generator, and admin
 * will pick them up automatically.
 *
 * @package DamalionBlogAI
 * @subpackage LuxStrat
 */

if ( ! defined( 'ABSPATH' ) ) exit;

class DBA_LuxStrat_Registry {

    /**
     * Return all registered Luxembourg structuring themes.
     *
     * Each theme key is a slug used in meta, options, and cron references.
     * To add a new theme, just add another entry to this array.
     *
     * @return array Associative array of theme_slug => config
     */
    public static function get_themes() {

        $themes = array(

            'scsp' => array(
                'label'       => 'SLP / SCSp – Special Limited Partnership (Société en Commandite Spéciale)',
                'short_label' => 'SLP / SCSp (Special Limited Partnership)',
                'slug'        => 'scsp',
                'description' => 'The Luxembourg Special Limited Partnership (SLP / SCSp / Société en Commandite Spéciale) is a flexible, tax-transparent vehicle widely used for private equity, venture capital, real estate, and alternative investment fund structuring. The SLP abbreviation is commonly used in English-language practice for the SCSp.',
                'keywords'    => array(
                    'Luxembourg SCSp', 'Luxembourg SLP', 'Special Limited Partnership Luxembourg',
                    'Société en Commandite Spéciale', 'SLP fund structuring', 'SCSp fund structuring',
                    'SCSp vs SLP', 'SCSp tax transparency', 'SLP tax transparency',
                    'SCSp private equity', 'SCSp venture capital', 'SCSp limited partnership agreement',
                    'SCSp general partner', 'SCSp AIFMD', 'SCSp carried interest',
                    'SLP private equity Luxembourg', 'SLP venture capital Luxembourg',
                ),
                'h2_blueprint' => array(
                    'What Is the Luxembourg SCSp (Special Limited Partnership)?',
                    'Key Structural Features of the SCSp',
                    'Tax Transparency and Fiscal Treatment of the SCSp',
                    'SCSp in Private Equity and Venture Capital Structuring',
                    'Setting Up a Luxembourg SCSp: Requirements and Process',
                ),
                'category_slugs_en' => array( 'private-equity', 'investment-funds' ),
                'category_slugs_fr' => array( 'capital-investissement', 'fonds-dinvestissement' ),
                'pillar_urls' => array(
                    'https://www.damalion.com/luxembourg-special-limited-partnership/',
                ),
                'color'       => '#1a365d',
            ),

            'raif' => array(
                'label'       => 'RAIF – Reserved Alternative Investment Fund',
                'short_label' => 'RAIF (Reserved Alternative Investment Fund)',
                'slug'        => 'raif',
                'description' => 'The Luxembourg Reserved Alternative Investment Fund (RAIF / Fonds d\'Investissement Alternatif Réservé) is a regulated but CSSF-unlicensed fund vehicle managed by an authorised AIFM, suitable for real estate, private equity, debt, and infrastructure strategies.',
                'keywords'    => array(
                    'Luxembourg RAIF', 'Reserved Alternative Investment Fund', 'RAIF fund formation',
                    'RAIF vs SIF', 'RAIF AIFM requirement', 'RAIF real estate fund',
                    'RAIF private equity fund', 'RAIF debt fund', 'RAIF tax regime',
                    'RAIF subscription tax', 'RAIF CSSF', 'RAIF compartments',
                ),
                'h2_blueprint' => array(
                    'What Is a Luxembourg RAIF?',
                    'RAIF vs SIF: Key Regulatory and Structural Differences',
                    'RAIF Tax Regime and Subscription Tax',
                    'Compartment Structuring Under the RAIF Framework',
                    'RAIF Formation: Requirements, Timeline, and AIFM Appointment',
                ),
                'category_slugs_en' => array( 'alternative-investment-fund-aifm', 'investment-funds' ),
                'category_slugs_fr' => array( 'fonds-dinvestissement-alternatif-aifm', 'fonds-dinvestissement' ),
                'pillar_urls' => array(
                    'https://www.damalion.com/luxembourg-reserved-alternative-investment-fund/',
                ),
                'color'       => '#2d6a4f',
            ),

            'depositary_bank' => array(
                'label'       => 'Depositary Bank – Fund Depositary Services in Luxembourg',
                'short_label' => 'Depositary Bank',
                'slug'        => 'depositary-bank',
                'description' => 'Luxembourg depositary banks play a critical role in fund governance, safekeeping of assets, cash flow monitoring, and regulatory oversight under AIFMD and UCITS frameworks.',
                'keywords'    => array(
                    'Luxembourg depositary bank', 'fund depositary Luxembourg', 'depositary services AIFMD',
                    'UCITS depositary', 'depositary bank obligations', 'cash flow monitoring depositary',
                    'safekeeping of assets Luxembourg', 'depositary liability', 'depositary bank selection',
                    'CSSF depositary requirements', 'depositary vs custodian', 'prime broker depositary',
                ),
                'h2_blueprint' => array(
                    'Role of the Depositary Bank in Luxembourg Fund Structures',
                    'Depositary Obligations Under AIFMD and UCITS',
                    'Asset Safekeeping and Cash Flow Monitoring Duties',
                    'Depositary Liability and Investor Protection',
                    'How to Select a Depositary Bank in Luxembourg',
                ),
                'category_slugs_en' => array( 'depositary-custodian-bank', 'investment-funds' ),
                'category_slugs_fr' => array( 'gestion-des-actifs', 'fonds-dinvestissement' ),
                'pillar_urls' => array(
                    'https://www.damalion.com/depositary-bank-in-luxembourg/',
                ),
                'color'       => '#7c3aed',
            ),

            'sicav_raif' => array(
                'label'       => 'SICAV-RAIF – Variable Capital Investment Company structured as RAIF',
                'short_label' => 'SICAV-RAIF',
                'slug'        => 'sicav-raif',
                'description' => 'The SICAV-RAIF combines the open-ended variable capital structure (SICAV) with the regulatory flexibility of the RAIF regime, enabling efficient multi-compartment fund platforms for institutional investors.',
                'keywords'    => array(
                    'Luxembourg SICAV-RAIF', 'SICAV RAIF structure', 'variable capital RAIF',
                    'SICAV-RAIF compartments', 'SICAV-RAIF vs SICAV-SIF', 'SICAV-RAIF real estate',
                    'SICAV-RAIF private equity', 'SICAV-RAIF umbrella fund', 'SICAV-RAIF subscription tax',
                    'SICAV-RAIF AIFM', 'SICAV-RAIF formation', 'open-ended RAIF Luxembourg',
                ),
                'h2_blueprint' => array(
                    'What Is a Luxembourg SICAV-RAIF?',
                    'SICAV-RAIF vs SICAV-SIF: Which Structure to Choose?',
                    'Multi-Compartment Structuring With SICAV-RAIF',
                    'SICAV-RAIF Tax Treatment and Subscription Tax',
                    'Establishing a SICAV-RAIF Platform in Luxembourg',
                ),
                'category_slugs_en' => array( 'alternative-investment-fund-aifm', 'asset-management' ),
                'category_slugs_fr' => array( 'fonds-dinvestissement-alternatif-aifm', 'gestion-des-investissements' ),
                'pillar_urls' => array(
                    'https://www.damalion.com/sicav-raif-in-luxembourg/',
                ),
                'color'       => '#b45309',
            ),

        );

        /**
         * Filter: dba_luxstrat_themes
         *
         * Allows external code or other modules to register additional
         * Luxembourg structuring themes at runtime.
         *
         * @param array $themes Current theme registry.
         */
        return apply_filters( 'dba_luxstrat_themes', $themes );
    }

    /**
     * Get a single theme config by slug.
     *
     * @param  string $slug Theme slug key.
     * @return array|null   Theme config or null if not found.
     */
    public static function get_theme( $slug ) {
        $themes = self::get_themes();
        return isset( $themes[ $slug ] ) ? $themes[ $slug ] : null;
    }

    /**
     * Get theme slugs as a flat array.
     *
     * @return array
     */
    public static function get_theme_slugs() {
        return array_keys( self::get_themes() );
    }

    /**
     * Get themes formatted for admin select dropdowns.
     *
     * @return array slug => label
     */
    public static function get_theme_options() {
        $options = array();
        foreach ( self::get_themes() as $slug => $config ) {
            $options[ $slug ] = $config['short_label'];
        }
        return $options;
    }
}
