import { tooltipLegacyDriverFactory } from '../Tooltip/Tooltip.driver';
import { linearProgressBarDriverFactory as coreLinearProgressBarDriverFactory } from './LinearProgressBarCore/LinearProgressBarCore.driver';
import { dataHooks } from './LinearProgressBar.constants';
const linearProgressBarDriverFactory = ({ element, eventTrigger, wrapper, }) => {
    const getElementByDataHook = (dataHook) => element?.querySelector(`[data-hook='${dataHook}']`) || undefined;
    const createTooltipDriver = () => tooltipLegacyDriverFactory({
        element: getElementByDataHook(dataHooks.tooltip),
        eventTrigger,
    });
    const coreProgressBarDriver = coreLinearProgressBarDriverFactory({
        element,
        wrapper,
        eventTrigger,
    });
    return {
        ...coreProgressBarDriver,
        isErrorIconShown: () => !!getElementByDataHook(dataHooks.errorIcon),
        isSuccessIconShown: () => !!getElementByDataHook(dataHooks.successIcon),
        getTooltipErrorMessage: () => {
            const tooltipDriver = createTooltipDriver();
            return tooltipDriver.getTooltipText();
        },
        getSkin: () => element?.getAttribute('data-skin'),
        getPadding: () => element?.getAttribute('data-padding'),
    };
};
export default linearProgressBarDriverFactory;
//# sourceMappingURL=LinearProgressBar.driver.js.map