// Copyright 2025 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export var ContentPositionSource;
(function (ContentPositionSource) {
    ContentPositionSource[ContentPositionSource["SELECTION"] = 0] = "SELECTION";
    ContentPositionSource[ContentPositionSource["LINE_FOCUS"] = 1] = "LINE_FOCUS";
})(ContentPositionSource || (ContentPositionSource = {}));
export var LineFocusType;
(function (LineFocusType) {
    LineFocusType[LineFocusType["NONE"] = 0] = "NONE";
    LineFocusType[LineFocusType["LINE"] = 1] = "LINE";
    LineFocusType[LineFocusType["WINDOW"] = 2] = "WINDOW";
})(LineFocusType || (LineFocusType = {}));
export var LineFocusMovement;
(function (LineFocusMovement) {
    LineFocusMovement[LineFocusMovement["STATIC"] = 0] = "STATIC";
    LineFocusMovement[LineFocusMovement["CURSOR"] = 1] = "CURSOR";
})(LineFocusMovement || (LineFocusMovement = {}));
export class LineFocusStyle {
    type;
    lines;
    static OFF = new LineFocusStyle(LineFocusType.NONE, 0);
    static SMALL_WINDOW = new LineFocusStyle(LineFocusType.WINDOW, 1);
    static MEDIUM_WINDOW = new LineFocusStyle(LineFocusType.WINDOW, 3);
    static LARGE_WINDOW = new LineFocusStyle(LineFocusType.WINDOW, 5);
    static UNDERLINE = new LineFocusStyle(LineFocusType.LINE, 1);
    constructor(type, lines) {
        this.type = type;
        this.lines = lines;
    }
    // TODO(crbug.com/447427066): Finalize the default mode. This is a
    // placeholder.
    static defaultValue() {
        return this.MEDIUM_WINDOW;
    }
    equals(other) {
        return this.type === other.type && this.lines === other.lines;
    }
}
let lineFocusValues;
export const getLineFocusValues = () => {
    if (!lineFocusValues || !lineFocusValues[chrome.readingMode.lineFocusOff]) {
        lineFocusValues = {
            [chrome.readingMode.lineFocusOff]: {
                value: chrome.readingMode.lineFocusOff,
                style: LineFocusStyle.OFF,
                movement: LineFocusMovement.STATIC,
            },
            [chrome.readingMode.lineFocusSmallCursorWindow]: {
                value: chrome.readingMode.lineFocusSmallCursorWindow,
                style: LineFocusStyle.SMALL_WINDOW,
                movement: LineFocusMovement.CURSOR,
            },
            [chrome.readingMode.lineFocusSmallStaticWindow]: {
                value: chrome.readingMode.lineFocusSmallStaticWindow,
                style: LineFocusStyle.SMALL_WINDOW,
                movement: LineFocusMovement.STATIC,
            },
            [chrome.readingMode.lineFocusMediumCursorWindow]: {
                value: chrome.readingMode.lineFocusMediumCursorWindow,
                style: LineFocusStyle.MEDIUM_WINDOW,
                movement: LineFocusMovement.CURSOR,
            },
            [chrome.readingMode.lineFocusMediumStaticWindow]: {
                value: chrome.readingMode.lineFocusMediumStaticWindow,
                style: LineFocusStyle.MEDIUM_WINDOW,
                movement: LineFocusMovement.STATIC,
            },
            [chrome.readingMode.lineFocusLargeCursorWindow]: {
                value: chrome.readingMode.lineFocusLargeCursorWindow,
                style: LineFocusStyle.LARGE_WINDOW,
                movement: LineFocusMovement.CURSOR,
            },
            [chrome.readingMode.lineFocusLargeStaticWindow]: {
                value: chrome.readingMode.lineFocusLargeStaticWindow,
                style: LineFocusStyle.LARGE_WINDOW,
                movement: LineFocusMovement.STATIC,
            },
            [chrome.readingMode.lineFocusCursorLine]: {
                value: chrome.readingMode.lineFocusCursorLine,
                style: LineFocusStyle.UNDERLINE,
                movement: LineFocusMovement.CURSOR,
            },
            [chrome.readingMode.lineFocusStaticLine]: {
                value: chrome.readingMode.lineFocusStaticLine,
                style: LineFocusStyle.UNDERLINE,
                movement: LineFocusMovement.STATIC,
            },
        };
    }
    return lineFocusValues;
};
// Events emitted from the toolbar to the app
export var ToolbarEvent;
(function (ToolbarEvent) {
    ToolbarEvent["LETTER_SPACING"] = "letter-spacing-change";
    ToolbarEvent["LINE_SPACING"] = "line-spacing-change";
    ToolbarEvent["THEME"] = "theme-change";
    ToolbarEvent["FONT_SIZE"] = "font-size-change";
    ToolbarEvent["FONT"] = "font-change";
    ToolbarEvent["RATE"] = "rate-change";
    ToolbarEvent["PLAY_PAUSE"] = "play-pause-click";
    ToolbarEvent["HIGHLIGHT_CHANGE"] = "highlight-change";
    ToolbarEvent["NEXT_GRANULARITY"] = "next-granularity-click";
    ToolbarEvent["PREVIOUS_GRANULARITY"] = "previous-granularity-click";
    ToolbarEvent["LINKS"] = "links-toggle";
    ToolbarEvent["IMAGES"] = "images-toggle";
    ToolbarEvent["VOICE"] = "select-voice";
    ToolbarEvent["LANGUAGE_TOGGLE"] = "voice-language-toggle";
    ToolbarEvent["PLAY_PREVIEW"] = "preview-voice";
    ToolbarEvent["LANGUAGE_MENU_OPEN"] = "language-menu-open";
    ToolbarEvent["LANGUAGE_MENU_CLOSE"] = "language-menu-close";
    ToolbarEvent["VOICE_MENU_OPEN"] = "voice-menu-open";
    ToolbarEvent["VOICE_MENU_CLOSE"] = "voice-menu-close";
    ToolbarEvent["LINE_FOCUS_STYLE"] = "line-focus-style-change";
    ToolbarEvent["LINE_FOCUS_MOVEMENT"] = "line-focus-movement-change";
    ToolbarEvent["CLOSE_ALL_MENUS"] = "close-all-menus";
    ToolbarEvent["OPEN_SETTINGS_SUBMENU"] = "open-settings-submenu";
    ToolbarEvent["PRESENTATION_CHANGE"] = "presentation-change";
    ToolbarEvent["CLOSE_SUBMENU_REQUESTED"] = "close-submenu-requested";
    ToolbarEvent["SETTINGS_OPENED"] = "settings-opened";
    ToolbarEvent["SETTINGS_CLOSED"] = "settings-closed";
})(ToolbarEvent || (ToolbarEvent = {}));
// The available menu items in Reading mode
export var SettingsOption;
(function (SettingsOption) {
    SettingsOption["COLOR"] = "color";
    SettingsOption["FONT"] = "font";
    SettingsOption["FONT_SIZE"] = "font-size";
    SettingsOption["IMAGES"] = "images";
    SettingsOption["LETTER_SPACING"] = "letter-spacing";
    SettingsOption["LINE_FOCUS"] = "line-focus";
    SettingsOption["LINE_SPACING"] = "line-spacing";
    SettingsOption["LINKS"] = "links";
    SettingsOption["PINNED_TO_TOOLBAR"] = "pinned-to-toolbar";
    SettingsOption["PRESENTATION"] = "presentation";
    SettingsOption["VOICE_HIGHLIGHT"] = "voice-highlight";
    SettingsOption["VOICE_SELECTION"] = "voice-selection";
})(SettingsOption || (SettingsOption = {}));
export const DEFAULT_SETTINGS = {
    letterSpacing: 0,
    lineSpacing: 0,
    theme: 0,
    speechRate: 0,
    font: '',
    highlightGranularity: 0,
    linksEnabled: false,
    imagesEnabled: false,
};
