const DEFAULT_LIBRARY_CONFIG = {
    libraries: [],
    metadata: {
        version: '1.0.0',
        lastUpdated: new Date().toISOString(),
        description: 'Empty default configuration - libraries should be configured at runtime'
    }
};
export class StandardLibraryManager {
    static { this.configuration = DEFAULT_LIBRARY_CONFIG; }
    static setConfiguration(config) {
        this.configuration = config;
    }
    static getConfiguration() {
        return this.configuration;
    }
    static getEnabledLibraries() {
        return this.configuration.libraries.filter(lib => lib.isEnabled);
    }
    static getLibrariesByCategory(category) {
        return this.configuration.libraries.filter(lib => lib.category === category && lib.isEnabled);
    }
    static getCoreLibraries() {
        return this.configuration.libraries.filter(lib => lib.isCore && lib.isEnabled);
    }
    static getComponentLibraries() {
        return this.configuration.libraries.filter(lib => !lib.isRuntimeOnly && lib.isEnabled);
    }
    static getLibraryById(id) {
        return this.configuration.libraries.find(lib => lib.id === id);
    }
    static getLibraryUrls() {
        const urls = {};
        this.configuration.libraries
            .filter(lib => lib.isEnabled)
            .forEach(lib => {
            const key = lib.id.replace(/-/g, '_').toUpperCase();
            urls[key] = lib.cdnUrl;
            if (lib.cdnCssUrl) {
                urls[`${key}_CSS`] = lib.cdnCssUrl;
            }
        });
        return urls;
    }
    static resetToDefault() {
        this.configuration = DEFAULT_LIBRARY_CONFIG;
    }
}
export function createStandardLibraries() {
    if (typeof window === 'undefined') {
        return {};
    }
    const libs = {};
    StandardLibraryManager.getComponentLibraries().forEach(lib => {
        const globalValue = window[lib.globalVariable];
        if (globalValue !== undefined) {
            libs[lib.globalVariable] = globalValue;
        }
    });
    return libs;
}
//# sourceMappingURL=standard-libraries.js.map