import { TOOLBARS } from "./../editor-common/index.js";
const defaultShouldCreate = {
  desktop: false,
  mobile: {
    android: false,
    ios: false
  }
};
const getDefaultToolbarSettings = ({
  pluginButtons,
  pluginButtonNames,
  textButtons
}) => {
  return [
    {
      name: TOOLBARS.QUICK_ACTIONS,
      shouldCreate: () => ({ ...defaultShouldCreate, desktop: true }),
      activateOnFloatingPlusButton: true
    },
    //TODO: check if needed
    {
      name: TOOLBARS.INSERT_PLUGIN,
      shouldCreate: () => defaultShouldCreate,
      getButtons: () => ({
        desktop: pluginButtonNames,
        mobile: {
          ios: pluginButtonNames,
          android: pluginButtonNames
        }
      })
    },
    //TODO: check if needed
    {
      name: TOOLBARS.FORMATTING,
      shouldCreate: () => defaultShouldCreate,
      getButtons: () => ({
        desktop: textButtons?.desktop,
        mobile: {
          android: textButtons?.mobile,
          ios: textButtons?.mobile
        }
      })
    },
    {
      name: TOOLBARS.SIDE,
      shouldCreate: () => {
        const shouldCreate = pluginButtons && pluginButtons.filter(
          ({ buttonSettings }) => buttonSettings.toolbars?.includes(TOOLBARS.SIDE)
        ).length > 0;
        return {
          desktop: shouldCreate,
          mobile: {
            ios: shouldCreate,
            android: shouldCreate
          }
        };
      }
    },
    {
      name: TOOLBARS.MOBILE,
      shouldCreate: () => ({
        desktop: false,
        mobile: {
          ios: true,
          android: true
        }
      }),
      getButtons: () => {
        return {
          desktop: [],
          mobile: {
            ios: textButtons?.mobile,
            android: textButtons?.mobile
          }
        };
      }
    },
    {
      name: TOOLBARS.FOOTER,
      shouldCreate: () => ({
        desktop: pluginButtons && pluginButtons.filter(
          ({ buttonSettings }) => buttonSettings.toolbars?.includes(TOOLBARS.FOOTER)
        ).length > 0,
        mobile: {
          ios: false,
          android: false
        }
      })
    },
    {
      name: TOOLBARS.STATIC,
      shouldCreate: () => ({
        desktop: true,
        mobile: {
          ios: true,
          android: false
        }
      }),
      getButtons: () => ({
        desktop: textButtons?.desktop,
        mobile: {
          ios: [],
          android: []
        }
      })
    },
    {
      name: TOOLBARS.INLINE,
      shouldCreate: () => ({
        desktop: true,
        mobile: {
          ios: false,
          android: false
        }
      }),
      getButtons: () => ({
        desktop: textButtons?.desktop,
        mobile: {
          ios: textButtons?.mobile,
          android: []
        }
      })
    },
    {
      name: TOOLBARS.PLUGIN,
      shouldCreate: () => ({
        desktop: true,
        mobile: {
          ios: true,
          android: true
        }
      })
    },
    {
      name: TOOLBARS.LINK,
      shouldCreate: () => {
        return {
          desktop: true,
          mobile: {
            ios: true,
            android: true
          }
        };
      }
    }
  ];
};
export {
  getDefaultToolbarSettings
};
//# sourceMappingURL=default-toolbar-settings.js.map
