import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { cloneDeep, set } from "lodash-es";
import { useIntl } from "react-intl";
import { Bubble, BubbleHoverTrigger } from "@gooddata/sdk-ui-kit";
import { messages } from "../../../locales.js";
import { getTranslation } from "../../utils/translations.js";
export function ContinuousLineControl({ properties, valuePath = "continuousLine.enabled", checked = false, disabled = false, pushData, }) {
    const intl = useIntl();
    const onValueChanged = (event) => {
        const clonedProperties = cloneDeep(properties);
        set(clonedProperties, `controls.${valuePath}`, event.target.checked);
        pushData?.({ properties: clonedProperties });
    };
    return (_jsxs(BubbleHoverTrigger, { showDelay: 0, hideDelay: 0, children: [
            _jsxs("label", { className: "input-checkbox-label", children: [
                    _jsx("input", { "aria-label": valuePath, checked: checked, disabled: disabled, type: "checkbox", className: "input-checkbox s-continuous-line", onChange: onValueChanged }), _jsx("span", { className: "input-label-text", children: getTranslation(messages["canvasContinuousLineLabel"].id, intl) })
                ] }), !disabled && (_jsx(Bubble, { className: "bubble-primary continuous-line-tooltip", alignPoints: [{ align: "cr cl" }], arrowOffsets: { "cr cl": [-75, 0] }, children: getTranslation(messages["canvasContinuousLineTooltip"].id, intl) }))] }));
}
//# sourceMappingURL=ContinuousLineControl.js.map