"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 default_toolbar_settings_exports = {};
__export(default_toolbar_settings_exports, {
  getDefaultToolbarSettings: () => getDefaultToolbarSettings
});
module.exports = __toCommonJS(default_toolbar_settings_exports);
var import_editor_common = require("./../editor-common/index.js");
const defaultShouldCreate = {
  desktop: false,
  mobile: {
    android: false,
    ios: false
  }
};
const getDefaultToolbarSettings = ({
  pluginButtons,
  pluginButtonNames,
  textButtons
}) => {
  return [
    {
      name: import_editor_common.TOOLBARS.QUICK_ACTIONS,
      shouldCreate: () => ({ ...defaultShouldCreate, desktop: true }),
      activateOnFloatingPlusButton: true
    },
    //TODO: check if needed
    {
      name: import_editor_common.TOOLBARS.INSERT_PLUGIN,
      shouldCreate: () => defaultShouldCreate,
      getButtons: () => ({
        desktop: pluginButtonNames,
        mobile: {
          ios: pluginButtonNames,
          android: pluginButtonNames
        }
      })
    },
    //TODO: check if needed
    {
      name: import_editor_common.TOOLBARS.FORMATTING,
      shouldCreate: () => defaultShouldCreate,
      getButtons: () => ({
        desktop: textButtons?.desktop,
        mobile: {
          android: textButtons?.mobile,
          ios: textButtons?.mobile
        }
      })
    },
    {
      name: import_editor_common.TOOLBARS.SIDE,
      shouldCreate: () => {
        const shouldCreate = pluginButtons && pluginButtons.filter(
          ({ buttonSettings }) => buttonSettings.toolbars?.includes(import_editor_common.TOOLBARS.SIDE)
        ).length > 0;
        return {
          desktop: shouldCreate,
          mobile: {
            ios: shouldCreate,
            android: shouldCreate
          }
        };
      }
    },
    {
      name: import_editor_common.TOOLBARS.MOBILE,
      shouldCreate: () => ({
        desktop: false,
        mobile: {
          ios: true,
          android: true
        }
      }),
      getButtons: () => {
        return {
          desktop: [],
          mobile: {
            ios: textButtons?.mobile,
            android: textButtons?.mobile
          }
        };
      }
    },
    {
      name: import_editor_common.TOOLBARS.FOOTER,
      shouldCreate: () => ({
        desktop: pluginButtons && pluginButtons.filter(
          ({ buttonSettings }) => buttonSettings.toolbars?.includes(import_editor_common.TOOLBARS.FOOTER)
        ).length > 0,
        mobile: {
          ios: false,
          android: false
        }
      })
    },
    {
      name: import_editor_common.TOOLBARS.STATIC,
      shouldCreate: () => ({
        desktop: true,
        mobile: {
          ios: true,
          android: false
        }
      }),
      getButtons: () => ({
        desktop: textButtons?.desktop,
        mobile: {
          ios: [],
          android: []
        }
      })
    },
    {
      name: import_editor_common.TOOLBARS.INLINE,
      shouldCreate: () => ({
        desktop: true,
        mobile: {
          ios: false,
          android: false
        }
      }),
      getButtons: () => ({
        desktop: textButtons?.desktop,
        mobile: {
          ios: textButtons?.mobile,
          android: []
        }
      })
    },
    {
      name: import_editor_common.TOOLBARS.PLUGIN,
      shouldCreate: () => ({
        desktop: true,
        mobile: {
          ios: true,
          android: true
        }
      })
    },
    {
      name: import_editor_common.TOOLBARS.LINK,
      shouldCreate: () => {
        return {
          desktop: true,
          mobile: {
            ios: true,
            android: true
          }
        };
      }
    }
  ];
};
//# sourceMappingURL=default-toolbar-settings.js.map
