import { Decoration_Type, Node_Type } from "./../../../ricos-schema/legacy/wix/rich_content/v1/index.js";
import {
  ACTION_BUTTON_TYPE,
  ANCHOR_TYPE,
  APP_EMBED_TYPE,
  AUDIO_TYPE,
  COLLAPSIBLE_LIST_TYPE,
  DIVIDER_TYPE,
  EMBED_TYPE,
  EXTERNAL,
  FILE_UPLOAD_TYPE,
  GALLERY_TYPE,
  GIPHY_TYPE,
  HTML_TYPE,
  IMAGE_TYPE,
  IMAGE_TYPE_LEGACY,
  LINK_BUTTON_TYPE,
  LINK_PREVIEW_TYPE,
  LINK_TYPE,
  MENTION_TYPE,
  POLL_TYPE,
  RICOS_NODE_TYPE_TO_DATA_FIELD,
  SPOILER_TYPE,
  TABLE_TYPE,
  VIDEO_TYPE,
  VIDEO_TYPE_LEGACY
} from "../../consts.js";
import { fromEntries } from "../../utils.js";
var BlockType = /* @__PURE__ */ ((BlockType2) => {
  BlockType2["Unstyled"] = "unstyled";
  BlockType2["HeaderOne"] = "header-one";
  BlockType2["HeaderTwo"] = "header-two";
  BlockType2["HeaderThree"] = "header-three";
  BlockType2["HeaderFour"] = "header-four";
  BlockType2["HeaderFive"] = "header-five";
  BlockType2["HeaderSix"] = "header-six";
  BlockType2["UnorderedListItem"] = "unordered-list-item";
  BlockType2["OrderedListItem"] = "ordered-list-item";
  BlockType2["Blockquote"] = "blockquote";
  BlockType2["CodeBlock"] = "code-block";
  BlockType2["Atomic"] = "atomic";
  return BlockType2;
})(BlockType || {});
var HeaderLevel = /* @__PURE__ */ ((HeaderLevel2) => {
  HeaderLevel2[HeaderLevel2["header-one"] = 1] = "header-one";
  HeaderLevel2[HeaderLevel2["header-two"] = 2] = "header-two";
  HeaderLevel2[HeaderLevel2["header-three"] = 3] = "header-three";
  HeaderLevel2[HeaderLevel2["header-four"] = 4] = "header-four";
  HeaderLevel2[HeaderLevel2["header-five"] = 5] = "header-five";
  HeaderLevel2[HeaderLevel2["header-six"] = 6] = "header-six";
  return HeaderLevel2;
})(HeaderLevel || {});
const FROM_DRAFT_LIST_TYPE = {
  ["unordered-list-item" /* UnorderedListItem */]: Node_Type.BULLETED_LIST,
  ["ordered-list-item" /* OrderedListItem */]: Node_Type.ORDERED_LIST
};
const TO_DRAFT_LIST_TYPE = fromEntries(
  Object.entries(FROM_DRAFT_LIST_TYPE).map(([key, value]) => [value, key])
);
const TO_RICOS_NODE_TYPE = {
  [LINK_BUTTON_TYPE]: Node_Type.BUTTON,
  [ACTION_BUTTON_TYPE]: Node_Type.BUTTON,
  [DIVIDER_TYPE]: Node_Type.DIVIDER,
  [FILE_UPLOAD_TYPE]: Node_Type.FILE,
  [GALLERY_TYPE]: Node_Type.GALLERY,
  [GIPHY_TYPE]: Node_Type.GIF,
  [HTML_TYPE]: Node_Type.HTML,
  [IMAGE_TYPE]: Node_Type.IMAGE,
  [IMAGE_TYPE_LEGACY]: Node_Type.IMAGE,
  [COLLAPSIBLE_LIST_TYPE]: Node_Type.COLLAPSIBLE_LIST,
  [LINK_PREVIEW_TYPE]: Node_Type.LINK_PREVIEW,
  [APP_EMBED_TYPE]: Node_Type.APP_EMBED,
  [VIDEO_TYPE]: Node_Type.VIDEO,
  [AUDIO_TYPE]: Node_Type.AUDIO,
  [VIDEO_TYPE_LEGACY]: Node_Type.VIDEO,
  [POLL_TYPE]: Node_Type.POLL,
  [TABLE_TYPE]: Node_Type.TABLE,
  [EMBED_TYPE]: Node_Type.EMBED,
  [EXTERNAL]: Node_Type.EXTERNAL
};
const DUPLICATE_KEYS = [IMAGE_TYPE_LEGACY, VIDEO_TYPE_LEGACY];
const FROM_RICOS_ENTITY_TYPE = fromEntries(
  Object.entries(TO_RICOS_NODE_TYPE).filter(([key]) => !DUPLICATE_KEYS.includes(key)).map(([key, value]) => [value, key])
);
const TO_RICOS_DECORATION_TYPE = {
  BOLD: Decoration_Type.BOLD,
  ITALIC: Decoration_Type.ITALIC,
  UNDERLINE: Decoration_Type.UNDERLINE,
  [SPOILER_TYPE]: Decoration_Type.SPOILER,
  [ANCHOR_TYPE]: Decoration_Type.ANCHOR,
  [MENTION_TYPE]: Decoration_Type.MENTION,
  [LINK_TYPE]: Decoration_Type.LINK,
  [EXTERNAL]: Decoration_Type.EXTERNAL
};
const TO_RICOS_INLINE_STYLE_TYPE = {
  BOLD: { type: Decoration_Type.BOLD, fontWeightValue: 700 },
  NOT_BOLD: { type: Decoration_Type.BOLD, fontWeightValue: 400 },
  ITALIC: { type: Decoration_Type.ITALIC, italicData: true },
  NOT_ITALIC: { type: Decoration_Type.ITALIC, italicData: false },
  UNDERLINE: { type: Decoration_Type.UNDERLINE, underlineData: true },
  NOT_UNDERLINE: { type: Decoration_Type.UNDERLINE, underlineData: false }
};
const TO_RICOS_PLUGIN_TYPE = {
  ...TO_RICOS_NODE_TYPE,
  ...TO_RICOS_DECORATION_TYPE
};
const FROM_RICOS_DECORATION_TYPE = fromEntries(
  Object.entries(TO_RICOS_DECORATION_TYPE).map(([key, value]) => [value, key])
);
const ENTITY_DECORATION_TO_MUTABILITY = {
  [ANCHOR_TYPE]: "MUTABLE",
  [LINK_TYPE]: "MUTABLE",
  [MENTION_TYPE]: "SEGMENTED",
  EMOJI_TYPE: "IMMUTABLE"
};
const DRAFT_BLOCK_TYPE_TO_DATA_FIELD = {
  ["unstyled" /* Unstyled */]: "paragraphData",
  ["unordered-list-item" /* UnorderedListItem */]: "paragraphData",
  ["ordered-list-item" /* OrderedListItem */]: "paragraphData",
  ["header-one" /* HeaderOne */]: "headingData",
  ["header-two" /* HeaderTwo */]: "headingData",
  ["header-three" /* HeaderThree */]: "headingData",
  ["header-four" /* HeaderFour */]: "headingData",
  ["header-five" /* HeaderFive */]: "headingData",
  ["header-six" /* HeaderSix */]: "headingData",
  ["code-block" /* CodeBlock */]: "codeBlockData",
  ["blockquote" /* Blockquote */]: "paragraphData"
};
const DRAFT_PLUGIN_TYPE_TO_DATA_FIELD = fromEntries(
  Object.entries(TO_RICOS_NODE_TYPE).map(([key, value]) => [
    key,
    RICOS_NODE_TYPE_TO_DATA_FIELD[value]
  ])
);
const ENTITY_DECORATION_TO_DATA_FIELD = {
  [ANCHOR_TYPE]: "anchorData",
  [LINK_TYPE]: "linkData",
  [MENTION_TYPE]: "mentionData",
  EMOJI_TYPE: "emojiData"
};
const DECORATION_TO_DATA_FIELD = {
  COLOR: "colorData",
  FONT_SIZE: "fontSizeData"
};
const TO_RICOS_DECORATION_DATA_FIELD = {
  ...ENTITY_DECORATION_TO_DATA_FIELD,
  ...DECORATION_TO_DATA_FIELD
};
const TO_RICOS_DATA_FIELD = {
  ...TO_RICOS_DECORATION_DATA_FIELD,
  ...DRAFT_PLUGIN_TYPE_TO_DATA_FIELD,
  ...DRAFT_BLOCK_TYPE_TO_DATA_FIELD
};
export {
  BlockType,
  ENTITY_DECORATION_TO_MUTABILITY,
  FROM_DRAFT_LIST_TYPE,
  FROM_RICOS_DECORATION_TYPE,
  FROM_RICOS_ENTITY_TYPE,
  HeaderLevel,
  TO_DRAFT_LIST_TYPE,
  TO_RICOS_DATA_FIELD,
  TO_RICOS_DECORATION_DATA_FIELD,
  TO_RICOS_DECORATION_TYPE,
  TO_RICOS_INLINE_STYLE_TYPE,
  TO_RICOS_NODE_TYPE,
  TO_RICOS_PLUGIN_TYPE
};
//# sourceMappingURL=consts.js.map
