// Copyright 2017-2025, University of Colorado Boulder
/**
 * Content for a KeyboardHelpDialog that describes how to use sliders.
 *
 * @author Jesse Greenberg
 */
import { string_scenery_phet_keyboardHelpDialog_sliderControls_StringProperty } from '../../strings/keyboardHelpDialog/sliderControls.js';
import { string_scenery_phet_keyboardHelpDialog_maximum_StringProperty } from '../../strings/keyboardHelpDialog/maximum.js';
import { string_scenery_phet_keyboardHelpDialog_minimum_StringProperty } from '../../strings/keyboardHelpDialog/minimum.js';
import { string_scenery_phet_keyboardHelpDialog_jumpToMaximum_StringProperty } from '../../strings/keyboardHelpDialog/jumpToMaximum.js';
import { string_scenery_phet_keyboardHelpDialog_jumpToMinimum_StringProperty } from '../../strings/keyboardHelpDialog/jumpToMinimum.js';
import { string_scenery_phet_keyboardHelpDialog_adjustSlider_StringProperty } from '../../strings/keyboardHelpDialog/adjustSlider.js';
import { string_scenery_phet_keyboardHelpDialog_adjustInSmallerSteps_StringProperty } from '../../strings/keyboardHelpDialog/adjustInSmallerSteps.js';
import { string_scenery_phet_keyboardHelpDialog_adjustInLargerSteps_StringProperty } from '../../strings/keyboardHelpDialog/adjustInLargerSteps.js';
import { string_scenery_phet_keyboardHelpDialog_adjust_StringProperty } from '../../strings/keyboardHelpDialog/adjust.js';
import { string_scenery_phet_keyboardHelpDialog_slider_StringProperty } from '../../strings/keyboardHelpDialog/slider.js';
import { string_scenery_phet_keyboardHelpDialog_verbSliderPattern_StringProperty } from '../../strings/keyboardHelpDialog/verbSliderPattern.js';
import { string_scenery_phet_keyboardHelpDialog_verbInSmallerStepsPattern_StringProperty } from '../../strings/keyboardHelpDialog/verbInSmallerStepsPattern.js';
import { string_scenery_phet_keyboardHelpDialog_verbInLargerStepsPattern_StringProperty } from '../../strings/keyboardHelpDialog/verbInLargerStepsPattern.js';
import { string_scenery_phet_a11y_keyboardHelpDialog_slider_leftRightArrowKeys_StringProperty } from '../../strings/a11y/keyboardHelpDialog/slider/leftRightArrowKeys.js';
import { string_scenery_phet_a11y_keyboardHelpDialog_slider_upDownArrowKeys_StringProperty } from '../../strings/a11y/keyboardHelpDialog/slider/upDownArrowKeys.js';
import { string_scenery_phet_a11y_keyboardHelpDialog_slider_defaultStepsDescriptionPattern_StringProperty } from '../../strings/a11y/keyboardHelpDialog/slider/defaultStepsDescriptionPattern.js';
import { string_scenery_phet_a11y_keyboardHelpDialog_slider_orKeysPattern_StringProperty } from '../../strings/a11y/keyboardHelpDialog/slider/orKeysPattern.js';
import { string_scenery_phet_a11y_keyboardHelpDialog_slider_shiftLeftRightArrowKeys_StringProperty } from '../../strings/a11y/keyboardHelpDialog/slider/shiftLeftRightArrowKeys.js';
import { string_scenery_phet_a11y_keyboardHelpDialog_slider_shiftUpDownArrowKeys_StringProperty } from '../../strings/a11y/keyboardHelpDialog/slider/shiftUpDownArrowKeys.js';
import { string_scenery_phet_a11y_keyboardHelpDialog_slider_smallerStepsDescriptionPattern_StringProperty } from '../../strings/a11y/keyboardHelpDialog/slider/smallerStepsDescriptionPattern.js';
import { string_scenery_phet_a11y_keyboardHelpDialog_slider_largerStepsDescriptionPattern_StringProperty } from '../../strings/a11y/keyboardHelpDialog/slider/largerStepsDescriptionPattern.js';
import { string_scenery_phet_keyboardHelpDialog_jumpToMinimumPattern_StringProperty } from '../../strings/keyboardHelpDialog/jumpToMinimumPattern.js';
import { string_scenery_phet_keyboardHelpDialog_jumpToMaximumPattern_StringProperty } from '../../strings/keyboardHelpDialog/jumpToMaximumPattern.js';
import { string_scenery_phet_a11y_keyboardHelpDialog_slider_jumpToMinimumDescriptionPattern_StringProperty } from '../../strings/a11y/keyboardHelpDialog/slider/jumpToMinimumDescriptionPattern.js';
import { string_scenery_phet_a11y_keyboardHelpDialog_slider_jumpToMaximumDescriptionPattern_StringProperty } from '../../strings/a11y/keyboardHelpDialog/slider/jumpToMaximumDescriptionPattern.js';
import '../../../../globals.js';
import PatternStringProperty from '../../../../axon/js/PatternStringProperty.js';
import Enumeration from '../../../../phet-core/js/Enumeration.js';
import EnumerationValue from '../../../../phet-core/js/EnumerationValue.js';
import optionize from '../../../../phet-core/js/optionize.js';
import HBox from '../../../../scenery/js/layout/nodes/HBox.js';
import AccessibleValueHandlerHotkeyDataCollection from '../../../../sun/js/accessibility/AccessibleValueHandlerHotkeyDataCollection.js';
import Tandem from '../../../../tandem/js/Tandem.js';
import KeyboardHelpIconFactory from './KeyboardHelpIconFactory.js';
import KeyboardHelpSection from './KeyboardHelpSection.js';
import KeyboardHelpSectionRow from './KeyboardHelpSectionRow.js';
// Configurations of arrow keys that can be displayed for 'Move between items in a group'
export class ArrowKeyIconDisplay extends EnumerationValue {
}
ArrowKeyIconDisplay.UP_DOWN = new ArrowKeyIconDisplay();
ArrowKeyIconDisplay.LEFT_RIGHT = new ArrowKeyIconDisplay();
ArrowKeyIconDisplay.BOTH = new ArrowKeyIconDisplay();
ArrowKeyIconDisplay.enumeration = new Enumeration(ArrowKeyIconDisplay);
class SliderControlsKeyboardHelpSection extends KeyboardHelpSection {
    constructor(providedOptions) {
        // If you provide a string for the verb or slider, it will be filled into the default pattern
        // for all rows so you cannot customize each row individually.
        ;
        ;
        ;
        const ownsMaximumStringProperty = providedOptions && 'maximumStringProperty' in providedOptions;
        const ownsMinimumStringProperty = providedOptions && 'minimumStringProperty' in providedOptions;
        const options = optionize()({
            arrowKeyIconDisplay: ArrowKeyIconDisplay.BOTH,
            headingStringProperty: string_scenery_phet_keyboardHelpDialog_sliderControls_StringProperty,
            verbStringProperty: string_scenery_phet_keyboardHelpDialog_adjust_StringProperty,
            sliderStringProperty: string_scenery_phet_keyboardHelpDialog_slider_StringProperty,
            maximumStringProperty: string_scenery_phet_keyboardHelpDialog_maximum_StringProperty,
            minimumStringProperty: string_scenery_phet_keyboardHelpDialog_minimum_StringProperty,
            jumpToMaximumStringProperty: string_scenery_phet_keyboardHelpDialog_jumpToMaximum_StringProperty,
            jumpToMinimumStringProperty: string_scenery_phet_keyboardHelpDialog_jumpToMinimum_StringProperty,
            adjustSliderStringProperty: string_scenery_phet_keyboardHelpDialog_adjustSlider_StringProperty,
            adjustInSmallerStepsStringProperty: string_scenery_phet_keyboardHelpDialog_adjustInSmallerSteps_StringProperty,
            adjustInLargerStepsStringProperty: string_scenery_phet_keyboardHelpDialog_adjustInLargerSteps_StringProperty,
            includeSmallerStepsRow: true,
            includeLargerStepsRow: true,
            additionalRows: []
        }, providedOptions);
        let adjustSliderStringProperty = options.adjustSliderStringProperty;
        let adjustInSmallerStepsStringProperty = options.adjustInSmallerStepsStringProperty;
        let adjustInLargerStepsStringProperty = options.adjustInLargerStepsStringProperty;
        if (options.verbStringProperty !== string_scenery_phet_keyboardHelpDialog_adjust_StringProperty ||
            options.sliderStringProperty !== string_scenery_phet_keyboardHelpDialog_slider_StringProperty) {
            // we are filling in the verb and name
            adjustSliderStringProperty = new PatternStringProperty(string_scenery_phet_keyboardHelpDialog_verbSliderPattern_StringProperty, {
                verb: options.verbStringProperty,
                slider: options.sliderStringProperty
            }, { tandem: Tandem.OPT_OUT });
            adjustInSmallerStepsStringProperty = new PatternStringProperty(string_scenery_phet_keyboardHelpDialog_verbInSmallerStepsPattern_StringProperty, {
                verb: options.verbStringProperty
            }, { tandem: Tandem.OPT_OUT });
            adjustInLargerStepsStringProperty = new PatternStringProperty(string_scenery_phet_keyboardHelpDialog_verbInLargerStepsPattern_StringProperty, {
                verb: options.verbStringProperty
            }, { tandem: Tandem.OPT_OUT });
        }
        const keysStringProperty = (options.arrowKeyIconDisplay === ArrowKeyIconDisplay.LEFT_RIGHT) ? string_scenery_phet_a11y_keyboardHelpDialog_slider_leftRightArrowKeys_StringProperty :
            (options.arrowKeyIconDisplay === ArrowKeyIconDisplay.UP_DOWN) ? string_scenery_phet_a11y_keyboardHelpDialog_slider_upDownArrowKeys_StringProperty :
                (options.arrowKeyIconDisplay === ArrowKeyIconDisplay.BOTH) ?
                    new PatternStringProperty(string_scenery_phet_a11y_keyboardHelpDialog_slider_orKeysPattern_StringProperty, {
                        leftRight: string_scenery_phet_a11y_keyboardHelpDialog_slider_leftRightArrowKeys_StringProperty,
                        upDown: string_scenery_phet_a11y_keyboardHelpDialog_slider_upDownArrowKeys_StringProperty
                    }, { tandem: Tandem.OPT_OUT }) : null;
        ;
        const keyboardHelpDialogDefaultStepsStringProperty = new PatternStringProperty(string_scenery_phet_a11y_keyboardHelpDialog_slider_defaultStepsDescriptionPattern_StringProperty, {
            verb: options.verbStringProperty,
            slider: options.sliderStringProperty,
            keys: keysStringProperty
        }, { tandem: Tandem.OPT_OUT });
        const shiftKeysStringProperty = (options.arrowKeyIconDisplay === ArrowKeyIconDisplay.LEFT_RIGHT) ? string_scenery_phet_a11y_keyboardHelpDialog_slider_shiftLeftRightArrowKeys_StringProperty :
            (options.arrowKeyIconDisplay === ArrowKeyIconDisplay.UP_DOWN) ? string_scenery_phet_a11y_keyboardHelpDialog_slider_shiftUpDownArrowKeys_StringProperty :
                (options.arrowKeyIconDisplay === ArrowKeyIconDisplay.BOTH) ? new PatternStringProperty(string_scenery_phet_a11y_keyboardHelpDialog_slider_orKeysPattern_StringProperty, {
                    leftRight: string_scenery_phet_a11y_keyboardHelpDialog_slider_shiftLeftRightArrowKeys_StringProperty,
                    upDown: string_scenery_phet_a11y_keyboardHelpDialog_slider_shiftUpDownArrowKeys_StringProperty
                }, { tandem: Tandem.OPT_OUT }) : null;
        ;
        const keyboardHelpDialogSmallerStepsStringProperty = new PatternStringProperty(string_scenery_phet_a11y_keyboardHelpDialog_slider_smallerStepsDescriptionPattern_StringProperty, {
            verb: options.verbStringProperty,
            keys: shiftKeysStringProperty
        }, { tandem: Tandem.OPT_OUT });
        const keyboardHelpDialogLargerStepsStringProperty = new PatternStringProperty(string_scenery_phet_a11y_keyboardHelpDialog_slider_largerStepsDescriptionPattern_StringProperty, {
            verb: options.verbStringProperty
        }, { tandem: Tandem.OPT_OUT });
        let jumpToMinimumStringProperty = options.jumpToMinimumStringProperty;
        if (ownsMinimumStringProperty) {
            jumpToMinimumStringProperty = new PatternStringProperty(string_scenery_phet_keyboardHelpDialog_jumpToMinimumPattern_StringProperty, {
                minimum: options.minimumStringProperty
            }, { tandem: Tandem.OPT_OUT });
        }
        let jumpToMaximumStringProperty = options.jumpToMaximumStringProperty;
        if (ownsMaximumStringProperty) {
            jumpToMaximumStringProperty = new PatternStringProperty(string_scenery_phet_keyboardHelpDialog_jumpToMaximumPattern_StringProperty, {
                maximum: options.maximumStringProperty
            }, { tandem: Tandem.OPT_OUT });
        }
        const jumpToMinimumDescriptionStringProperty = new PatternStringProperty(string_scenery_phet_a11y_keyboardHelpDialog_slider_jumpToMinimumDescriptionPattern_StringProperty, {
            minimum: options.minimumStringProperty
        }, { tandem: Tandem.OPT_OUT });
        const jumpToMaximumDescriptionStringProperty = new PatternStringProperty(string_scenery_phet_a11y_keyboardHelpDialog_slider_jumpToMaximumDescriptionPattern_StringProperty, {
            maximum: options.maximumStringProperty
        }, { tandem: Tandem.OPT_OUT });
        // 'Move sliders' content
        const leftRightArrowKeysRowIcon = KeyboardHelpIconFactory.iconRow([
            KeyboardHelpIconFactory.fromHotkeyData(AccessibleValueHandlerHotkeyDataCollection.LEFT_ARROW_HOTKEY_DATA),
            KeyboardHelpIconFactory.fromHotkeyData(AccessibleValueHandlerHotkeyDataCollection.RIGHT_ARROW_HOTKEY_DATA)
        ]);
        const shiftPlusLeftRightIcon = KeyboardHelpIconFactory.shiftPlusIcon(leftRightArrowKeysRowIcon);
        const upDownArrowKeysRowIcon = KeyboardHelpIconFactory.iconRow([
            KeyboardHelpIconFactory.fromHotkeyData(AccessibleValueHandlerHotkeyDataCollection.UP_ARROW_HOTKEY_DATA),
            KeyboardHelpIconFactory.fromHotkeyData(AccessibleValueHandlerHotkeyDataCollection.DOWN_ARROW_HOTKEY_DATA)
        ]);
        const shiftPlusUpDownIcon = KeyboardHelpIconFactory.shiftPlusIcon(upDownArrowKeysRowIcon);
        const leftRightOrUpDownIcon = KeyboardHelpIconFactory.iconOrIcon(leftRightArrowKeysRowIcon, upDownArrowKeysRowIcon);
        let adjustSliderIcon = null;
        let adjustSliderSmallerStepsIcons = null;
        switch (options.arrowKeyIconDisplay) {
            case ArrowKeyIconDisplay.LEFT_RIGHT:
                adjustSliderIcon = leftRightArrowKeysRowIcon;
                adjustSliderSmallerStepsIcons = [shiftPlusLeftRightIcon];
                break;
            case ArrowKeyIconDisplay.UP_DOWN:
                adjustSliderIcon = upDownArrowKeysRowIcon;
                adjustSliderSmallerStepsIcons = [shiftPlusUpDownIcon];
                break;
            default:
                ;
                adjustSliderIcon = leftRightOrUpDownIcon;
                adjustSliderSmallerStepsIcons = [shiftPlusLeftRightIcon, shiftPlusUpDownIcon];
        }
        const adjustSliderRow = KeyboardHelpSectionRow.labelWithIcon(adjustSliderStringProperty, adjustSliderIcon, {
            labelInnerContent: keyboardHelpDialogDefaultStepsStringProperty
        });
        const adjustSliderInSmallerStepsRow = KeyboardHelpSectionRow.labelWithIconList(adjustInSmallerStepsStringProperty, adjustSliderSmallerStepsIcons, {
            labelInnerContent: keyboardHelpDialogSmallerStepsStringProperty
        });
        // 'move in larger steps' content
        const pageUpKeyNode = KeyboardHelpIconFactory.fromHotkeyData(AccessibleValueHandlerHotkeyDataCollection.PAGE_UP_HOTKEY_DATA);
        const pageDownKeyNode = KeyboardHelpIconFactory.fromHotkeyData(AccessibleValueHandlerHotkeyDataCollection.PAGE_DOWN_HOTKEY_DATA);
        const pageUpPageDownIcon = new HBox({
            children: [pageUpKeyNode, pageDownKeyNode],
            spacing: KeyboardHelpIconFactory.DEFAULT_ICON_SPACING
        });
        const adjustInLargerStepsRow = KeyboardHelpSectionRow.labelWithIcon(adjustInLargerStepsStringProperty, pageUpPageDownIcon, {
            labelInnerContent: keyboardHelpDialogLargerStepsStringProperty
        });
        // 'move to minimum value' content
        const homeKeyNode = KeyboardHelpIconFactory.fromHotkeyData(AccessibleValueHandlerHotkeyDataCollection.HOME_HOTKEY_DATA);
        const jumpToMinimumRow = KeyboardHelpSectionRow.labelWithIcon(jumpToMinimumStringProperty, homeKeyNode, {
            labelInnerContent: jumpToMinimumDescriptionStringProperty
        });
        // 'move to maximum value' content
        const endKeyNode = KeyboardHelpIconFactory.fromHotkeyData(AccessibleValueHandlerHotkeyDataCollection.END_HOTKEY_DATA);
        const jumpToMaximumRow = KeyboardHelpSectionRow.labelWithIcon(jumpToMaximumStringProperty, endKeyNode, {
            labelInnerContent: jumpToMaximumDescriptionStringProperty
        });
        // assemble final content for KeyboardHelpSection
        const content = [
            adjustSliderRow,
            ...(options.includeSmallerStepsRow ? [adjustSliderInSmallerStepsRow] : []),
            ...(options.includeLargerStepsRow ? [adjustInLargerStepsRow] : []),
            jumpToMinimumRow,
            jumpToMaximumRow,
            ...options.additionalRows
        ];
        super(options.headingStringProperty, content, options);
    }
}
SliderControlsKeyboardHelpSection.ArrowKeyIconDisplay = ArrowKeyIconDisplay;
export default SliderControlsKeyboardHelpSection;
//# sourceMappingURL=SliderControlsKeyboardHelpSection.js.map