import { TOOLBAR_DROPDOWN_PANEL } from "./../../_shared/dropdown-modal/data-hooks.js";
import { dataHook } from "./../../wix-rich-content-common/index.js";
import {
  TEXT_ALIGNMENT_DROPDOWN_BUTTON,
  TEXT_ALIGNMENT_DROPDOWN_OPTION_CENTER,
  TEXT_ALIGNMENT_DROPDOWN_OPTION_JUSTIFY,
  TEXT_ALIGNMENT_DROPDOWN_OPTION_LEFT,
  TEXT_ALIGNMENT_DROPDOWN_OPTION_RIGHT
} from "./dropdown/data-hooks.js";
const createTextAlignTestkit = (getBase) => {
  const options = {
    LEFT: TEXT_ALIGNMENT_DROPDOWN_OPTION_LEFT,
    CENTER: TEXT_ALIGNMENT_DROPDOWN_OPTION_CENTER,
    RIGHT: TEXT_ALIGNMENT_DROPDOWN_OPTION_RIGHT,
    JUSTIFY: TEXT_ALIGNMENT_DROPDOWN_OPTION_JUSTIFY
  };
  return {
    content: {},
    toolbars: {
      createTextButtonToolbars: (getTextButtonToolbarBase) => {
        const getButton = async () => getTextButtonToolbarBase().get(dataHook(TEXT_ALIGNMENT_DROPDOWN_BUTTON));
        const getModal = async () => getBase().get(dataHook(TOOLBAR_DROPDOWN_PANEL));
        return {
          getButton,
          getModal,
          click: async () => {
            const button = await getButton();
            await button.click();
          },
          clickModalValue: async (value) => {
            const modal = await getModal();
            const button = await modal.get(dataHook(options[value]));
            await button.click();
          },
          getSelectedModalValue: async () => {
            const modal = await getModal();
            const button = await modal.get('[aria-selected="true"]');
            const allHooks = await button.attr("data-hook");
            return Object.entries(options).find(
              ([_, value]) => allHooks?.includes(value)
            )?.[0];
          }
        };
      }
    }
  };
};
export {
  createTextAlignTestkit
};
//# sourceMappingURL=text-align.testkit.js.map
