"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 get_heading_in_selection_exports = {};
__export(get_heading_in_selection_exports, {
  getHeadingInSelection: () => getHeadingInSelection
});
module.exports = __toCommonJS(get_heading_in_selection_exports);
var import_v1 = require("./../../ricos-schema/legacy/wix/rich_content/v1/index.js");
const headingMap = {
  1: "header-one",
  2: "header-two",
  3: "header-three",
  4: "header-four",
  5: "header-five",
  6: "header-six"
};
const getHeadingInSelection = (content, _services, _editor) => {
  if (Array.isArray(content) && content.length > 0) {
    const headingLevel = content.find((node) => node.type.name === import_v1.Node_Type.HEADING)?.attrs?.level;
    if (!headingLevel || content[0].type.name === import_v1.Node_Type.PARAGRAPH) {
      return "unstyled";
    }
    return headingMap[headingLevel];
  }
  return void 0;
};
//# sourceMappingURL=get-heading-in-selection.js.map
