"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var layout_testkit_exports = {};
__export(layout_testkit_exports, {
  createLayoutTestkit: () => createLayoutTestkit
});
module.exports = __toCommonJS(layout_testkit_exports);
var import_unidriver = require("@wix/design-system/dist/testkit/unidriver");
var import_ricos_types = require("./../../ricos-types/index.js");
var import_data_hooks = require("./../../_shared/data-hooks.js");
var import_dropdown_modal_uni_driver = require("./../../_shared/dropdown-modal/dropdown-modal-uni-driver.js");
var import_wix_rich_content_common = require("./../../wix-rich-content-common/index.js");
var import_new_color_picker_unidriver = require("./../../ui-components/color-picker/new-color-picker/new-color-picker-unidriver.js");
var import_position_select_with_label_unidriver = require("./../../ui-components/position-select-with-label/position-select-with-label-unidriver.js");
var import_data_hooks2 = require("./data-hooks.js");
var import_shared = require("./shared.js");
const createLayoutTestkit = (getBase) => {
  return {
    content: {},
    clickLayoutHandle: async (layoutId) => {
      await (await getBase().get((0, import_wix_rich_content_common.dataHook)(`${import_data_hooks2.LAYOUT_HANDLE}-${layoutId}`))).click();
    },
    toolbars: {
      createAddButtonToolbars: (getAddButtonToolbarBase) => ({
        click: async () => {
          const button = getAddButtonToolbarBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.INSERT_LAYOUT_BUTTON));
          await button.click();
        },
        toolbarsToAddIn: import_shared.toolbarsToAddIn
      }),
      createPluginToolbar: (getPluginToolbarBase) => ({
        clickSettings: async () => {
          await (await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT).get(
            (0, import_wix_rich_content_common.dataHook)(import_data_hooks.PLUGIN_TOOLBAR_SETTINGS_BUTTON)
          )).click();
        },
        clickVerticalAlignment: async () => {
          await (await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT).get(
            (0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_TOOLBAR_VERTICAL_ALIGNMENT_BUTTON)
          )).click();
        },
        selectVerticalAlignment: async (index) => {
          const dropdown = (0, import_dropdown_modal_uni_driver.createDropdownModalUniDriver)(getBase);
          await (await dropdown.optionAtIndex(index)).click();
        },
        clickAddCell: async () => {
          await (await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT).get(
            (0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_PLUGIN_TOOLBAR_ADD_CELL_BUTTON)
          )).click();
        },
        clickDelete: async () => {
          await (await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT).get(
            (0, import_wix_rich_content_common.dataHook)(import_data_hooks.PLUGIN_TOOLBAR_DELETE_BUTTON)
          )).click();
        },
        exists: async () => {
          try {
            return getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT).exists();
          } catch {
            return false;
          }
        },
        setAsHeaderButtonExists: async () => {
          try {
            const button = await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT).get(
              (0, import_wix_rich_content_common.dataHook)(import_data_hooks.PLUGIN_TOOLBAR_SET_AS_HEADER_BUTTON)
            );
            return button.exists();
          } catch {
            return false;
          }
        },
        clickSetAsHeader: async () => {
          await (await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT).get(
            (0, import_wix_rich_content_common.dataHook)(import_data_hooks.PLUGIN_TOOLBAR_SET_AS_HEADER_BUTTON)
          )).click();
        },
        setAsFooterButtonExists: async () => {
          try {
            const button = await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT).get(
              (0, import_wix_rich_content_common.dataHook)(import_data_hooks.PLUGIN_TOOLBAR_SET_AS_FOOTER_BUTTON)
            );
            return button.exists();
          } catch {
            return false;
          }
        },
        clickSetAsFooter: async () => {
          await (await getPluginToolbarBase(import_ricos_types.RicosPluginToolbarNames.LAYOUT).get(
            (0, import_wix_rich_content_common.dataHook)(import_data_hooks.PLUGIN_TOOLBAR_SET_AS_FOOTER_BUTTON)
          )).click();
        }
      })
    },
    insertModal: {
      getNativeElement: async () => {
        const modal = await getBase().get((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.INSERT_LAYOUT_MODAL));
        return modal.getNative();
      },
      waitForElement: async () => {
        await getBase().get((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.INSERT_LAYOUT_MODAL));
      },
      exists: async () => {
        try {
          const sidePanelDriver = (0, import_unidriver.SidePanelUniDriver)(
            getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.INSERT_LAYOUT_MODAL)),
            getBase()
          );
          return sidePanelDriver.exists();
        } catch {
          return false;
        }
      },
      close: async () => {
        const sidePanelDriver = (0, import_unidriver.SidePanelUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.INSERT_LAYOUT_MODAL)),
          getBase()
        );
        return sidePanelDriver.clickClose();
      },
      twoColumnsSelection: (0, import_unidriver.ThumbnailUniDriver)(
        getBase().$((0, import_wix_rich_content_common.dataHook)("insert-layout-modal-two-columns")),
        getBase()
      ),
      threeColumnsSelection: (0, import_unidriver.ThumbnailUniDriver)(
        getBase().$((0, import_wix_rich_content_common.dataHook)("insert-layout-modal-three-columns")),
        getBase()
      ),
      atPresetSelection: (presetIndex) => (0, import_unidriver.ThumbnailUniDriver)(
        getBase().$$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.INSERT_LAYOUT_MODAL_PRESET)).at(presetIndex),
        getBase()
      )
    },
    settings: {
      modal: (0, import_unidriver.SidePanelUniDriver)(getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_MODAL_ID)), getBase()),
      tabs: (0, import_unidriver.TabsUniDriver)(getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_TABS)), getBase()),
      colorPickerModal: (0, import_new_color_picker_unidriver.createNewColorPickerUniDriver)(getBase),
      designTab: {
        backgroundTypeToggle: (0, import_unidriver.SegmentedToggleUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKGROUND_TYPE_TOGGLE)),
          getBase()
        ),
        backgroundColorInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKGROUND_COLOR_INPUT)),
          getBase()
        ),
        backgroundColorPicker: (0, import_unidriver.FillPreviewUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKGROUND_COLOR_PICKER)),
          getBase()
        ),
        backgroundImage: (0, import_unidriver.ImageViewerUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKGROUND_IMAGE_VIEWER)),
          getBase()
        ),
        backgroundImageOpacityInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKGROUND_IMAGE_OPACITY_INPUT)),
          getBase()
        ),
        backgroundScalingSelect: (0, import_unidriver.DropdownUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKGROUND_SCALING_SELECT)),
          getBase()
        ),
        backgroundPositionSelect: (0, import_position_select_with_label_unidriver.createPositionSelectorWithLabelUniDriver)(
          () => getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKGROUND_POSITION_SELECT))
        ),
        borderColorInput: (0, import_unidriver.NumberInputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BORDER_COLOR_INPUT)),
          getBase()
        ),
        borderColorPicker: (0, import_unidriver.FillPreviewUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BORDER_COLOR_PICKER)),
          getBase()
        ),
        borderWidthInput: (0, import_unidriver.NumberInputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BORDER_WIDTH_INPUT)),
          getBase()
        ),
        borderRadiusInput: (0, import_unidriver.NumberInputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BORDER_RADIUS_INPUT)),
          getBase()
        ),
        backdropToggle: (0, import_unidriver.ToggleSwitchUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKDROP_TOGGLE)),
          getBase()
        ),
        backdropTypeToggle: (0, import_unidriver.SegmentedToggleUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKDROP_TYPE_TOGGLE)),
          getBase()
        ),
        backdropColorInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKDROP_COLOR_INPUT)),
          getBase()
        ),
        backdropColorPicker: (0, import_unidriver.FillPreviewUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKDROP_COLOR_PICKER)),
          getBase()
        ),
        backdropImage: (0, import_unidriver.ImageViewerUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKDROP_IMAGE_VIEWER)),
          getBase()
        ),
        backdropImageOpacityInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKDROP_IMAGE_OPACITY_INPUT)),
          getBase()
        ),
        backdropScalingSelect: (0, import_unidriver.DropdownUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKDROP_SCALING_SELECT)),
          getBase()
        ),
        backdropPositionSelect: (0, import_position_select_with_label_unidriver.createPositionSelectorWithLabelUniDriver)(
          () => getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_BACKDROP_POSITION_SELECT))
        ),
        designTargetLayout: (0, import_unidriver.ThumbnailUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_DESIGN_TARGET_LAYOUT)),
          getBase()
        ),
        designTargetCell: (0, import_unidriver.ThumbnailUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_DESIGN_TARGET_CELL)),
          getBase()
        )
      },
      layoutTab: {
        gapInput: (0, import_unidriver.InputUniDriver)(getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_GAP)), getBase()),
        paddingToggleIndividual: (0, import_unidriver.ToggleButtonUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_PADDING_TOGGLE_INDIVIDUAL)),
          getBase()
        ),
        paddingTopInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_PADDING_TOP)),
          getBase()
        ),
        paddingRightInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_PADDING_RIGHT)),
          getBase()
        ),
        paddingBottomInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_PADDING_BOTTOM)),
          getBase()
        ),
        paddingLeftInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_PADDING_LEFT)),
          getBase()
        ),
        paddingHorizontalInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_PADDING_HORIZONTAL)),
          getBase()
        ),
        paddingVerticalInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_PADDING_VERTICAL)),
          getBase()
        ),
        verticalMarginToggleIndividual: (0, import_unidriver.ToggleButtonUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_VERTICAL_MARGIN_TOGGLE_INDIVIDUAL)),
          getBase()
        ),
        verticalMarginInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_VERTICAL_MARGIN)),
          getBase()
        ),
        verticalMarginTopInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_VERTICAL_MARGIN_TOP)),
          getBase()
        ),
        verticalMarginBottomInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_VERTICAL_MARGIN_BOTTOM)),
          getBase()
        ),
        responsivenessHeader: (0, import_unidriver.IconButtonUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_RESPONSIVENESS_HEADER_TOGGLE)),
          getBase()
        ),
        responsivenessBehaviourStack: (0, import_unidriver.ThumbnailUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_RESPONSIVENESS_BEHAVIOUR_STACK)),
          getBase()
        ),
        responsivenessBehaviourWrap: (0, import_unidriver.ThumbnailUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_RESPONSIVENESS_BEHAVIOUR_WRAP)),
          getBase()
        ),
        responsivenessBreakpointInput: (0, import_unidriver.InputUniDriver)(
          getBase().$((0, import_wix_rich_content_common.dataHook)(import_data_hooks2.LAYOUT_SETTINGS_RESPONSIVENESS_BREAKPOINT_INPUT)),
          getBase()
        )
      }
    }
  };
};
//# sourceMappingURL=layout.testkit.js.map
