<commit_before>import { $ } from 'lib';

type options = {
    isCompact: boolean,
    themesPath: string,
    insertBefore?: string
}
const defaultOptions: options = {
    isCompact: false,
    themesPath: './themes/',
    insertBefore: ''
};

const idStylePrefix = 'core-ui-theme-styles-';
const idSpritesPrefix = 'core-ui-sprites-';

export default class ThemeService {
    static __appliedThemes: Set<string>;
    static __isDarkTheme: boolean;
    static __initializeListeners: Array<Function>;
    static options: options;

    static initialize(opt: options) {
        this.options = _.defaults(opt, defaultOptions);
        this.__appliedThemes = new Set();

        this.__setTheme('new');
        if (this.options.isCompact) {
            this.__setTheme('main');
        }

        this.__initializeListeners.forEach(listener => listener());
    }<commit_msg>[#474857] Fix listeners error<commit_after>import { $ } from 'lib';

type options = {
    isCompact: boolean,
    themesPath: string,
    insertBefore?: string
}
const defaultOptions: options = {
    isCompact: false,
    themesPath: './themes/',
    insertBefore: ''
};

const idStylePrefix = 'core-ui-theme-styles-';
const idSpritesPrefix = 'core-ui-sprites-';

export default class ThemeService {
    static __appliedThemes: Set<string>;
    static __isDarkTheme: boolean;
    static __initializeListeners: Array<Function>;
    static options: options;

    static initialize(opt: options) {
        this.options = _.defaults(opt, defaultOptions);
        this.__appliedThemes = new Set();

        this.__setTheme('new');
        if (this.options.isCompact) {
            this.__setTheme('main');
        }

        this.__initializeListeners?.forEach(listener => listener());
    }
{'fraction_non_alphanumeric': 0.12421652421652421, 'fraction_numerical': 0.003418803418803419, 'mean_word_length': 3.1809523809523808, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1050202', 'n_tokens_mistral': 514, 'n_tokens_neox': 497, 'n_words': 115}