import { Platform } from 'react-native';
import { createAndroidTheme } from '@fluentui-react-native/android-theme';
import { createAppleTheme } from '@fluentui-react-native/apple-theme';
import { createDefaultTheme } from '@fluentui-react-native/default-theme';
import { ThemeReference } from '@fluentui-react-native/theme';
import { applyBrand } from './applyBrand';
import { applyTheme } from './applyTheme';
const themeOptions = { paletteName: 'TaskPane', appearance: 'dynamic' };
// Default applies to win32
const baseTheme = Platform.select({
    android: createAndroidTheme(themeOptions),
    ios: createAppleTheme(),
    macos: createAppleTheme(),
    default: createDefaultTheme(themeOptions),
});
const supportsHighContrastTokens = Platform.select({
    android: false,
    ios: false,
    macos: false,
    default: true,
});
export const lightnessOptions = [
    { label: 'Auto', value: 'dynamic' },
    { label: 'Light', value: 'light' },
    { label: 'Dark', value: 'dark' },
    supportsHighContrastTokens && { label: 'High Contrast', value: 'highContrast' },
];
export class TesterThemeReference extends ThemeReference {
    _themeName = Platform.OS === 'win32' ? 'Office' : 'Default';
    _brand = 'Default';
    options;
    baseTheme;
    constructor() {
        super(baseTheme, () => applyTheme(this._themeName, this.options.appearance), (parent) => applyBrand(parent, this._brand));
        this.baseTheme = baseTheme;
        this.options = themeOptions;
    }
    /** get/set the currently active theme */
    get themeName() {
        return this._themeName;
    }
    set themeName(newTheme) {
        if (newTheme !== this._themeName) {
            this._themeName = newTheme;
            this.invalidate();
        }
    }
    /** get/set the theme appearance */
    get appearance() {
        return this.options.appearance;
    }
    set appearance(lightness) {
        if (lightness !== this.options.appearance) {
            this.options.appearance = lightness;
            this.baseTheme.invalidate();
        }
    }
    /** get/set the applied brand */
    get brand() {
        return this._brand;
    }
    set brand(newBrand) {
        if (newBrand !== this._brand) {
            this._brand = newBrand;
            this.invalidate();
        }
    }
}
export const testerTheme = new TesterThemeReference();
//# sourceMappingURL=CustomThemes.js.map