import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { FormattedMessage } from "react-intl";
import { Bubble, BubbleHoverTrigger } from "@gooddata/sdk-ui-kit";
import { BaseChartConfigurationPanel } from "./BaseChartConfigurationPanel.js";
import { messages } from "../../../locales.js";
import { BUBBLE_ARROW_OFFSET_X, BUBBLE_ARROW_OFFSET_Y, HIDE_DELAY_DEFAULT, SHOW_DELAY_DEFAULT, } from "../../constants/bubble.js";
import { CheckboxControl } from "../configurationControls/CheckboxControl.js";
import { ConfigSection } from "../configurationControls/ConfigSection.js";
import { ContinuousLineControl } from "../configurationControls/ContinuousLineControl.js";
import { DataLabelsControl } from "../configurationControls/DataLabelsControl.js";
import { DataPointsControl } from "../configurationControls/DataPointsControl.js";
import { DistinctPointShapesControl } from "../configurationControls/DistintcPointShapesControl.js";
export class LineChartBasedConfigurationPanel extends BaseChartConfigurationPanel {
    renderConfigurationPanel() {
        const { gridEnabled, axes } = this.getControlProperties();
        const { properties, propertiesMeta, pushData, panelConfig, dataLabelDefaultValue = false, } = this.props;
        const { isDataPointsControlDisabled, isContinuousLineControlDisabled, isDistinctPointShapesDisabled, } = panelConfig;
        const controlsDisabled = this.isControlDisabled();
        const continuousLineEnabled = properties?.controls?.["continuousLine"]?.enabled;
        const shouldContinuousLineControlDisabled = controlsDisabled || isContinuousLineControlDisabled;
        const distinctPointShapesEnabled = properties?.controls?.["distinctPointShapes"]?.enabled;
        const shouldDistinctPointShapesDisabled = controlsDisabled || isDataPointsControlDisabled || !isDistinctPointShapesDisabled;
        return (_jsxs(BubbleHoverTrigger, { showDelay: SHOW_DELAY_DEFAULT, hideDelay: HIDE_DELAY_DEFAULT, children: [
                _jsxs("div", { children: [this.renderColorSection(), this.getBaseChartAxisSection(axes), this.renderLegendSection(), this.renderInteractionsSection(), _jsxs(ConfigSection, { id: "canvas_section", className: "gd-canvas-section", title: messages["canvasTitle"].id, propertiesMeta: propertiesMeta, properties: properties, pushData: pushData, children: [
                                _jsx(DataLabelsControl, { pushData: pushData, properties: properties, isDisabled: controlsDisabled, defaultValue: dataLabelDefaultValue }), _jsx(DataPointsControl, { pushData: pushData, properties: properties, isDisabled: controlsDisabled || isDataPointsControlDisabled, showDisabledMessage: isDataPointsControlDisabled }), _jsx(DistinctPointShapesControl, { pushData: pushData, checked: shouldDistinctPointShapesDisabled ? false : distinctPointShapesEnabled, properties: properties, disabled: shouldDistinctPointShapesDisabled }), _jsx(CheckboxControl, { valuePath: "grid.enabled", labelText: messages["canvasGridLine"].id, properties: properties, checked: gridEnabled, disabled: controlsDisabled, pushData: pushData }), _jsx(ContinuousLineControl, { properties: properties, checked: shouldContinuousLineControlDisabled ? false : continuousLineEnabled, disabled: controlsDisabled || isDataPointsControlDisabled, pushData: pushData })
                            ] }), this.renderForecastSection(), this.renderAnomaliesSection(), this.renderAdvancedSection()] }), _jsx(Bubble, { className: this.getBubbleClassNames(), arrowOffsets: { "tc bc": [BUBBLE_ARROW_OFFSET_X, BUBBLE_ARROW_OFFSET_Y] }, alignPoints: [{ align: "tc bc" }], children: _jsx(FormattedMessage, { id: "properties.config.not_applicable" }) })
            ] }));
    }
}
//# sourceMappingURL=LineChartBasedConfigurationPanel.js.map