"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 open_cell_shape_picker_exports = {};
__export(open_cell_shape_picker_exports, {
  openCellShapePicker: () => openCellShapePicker
});
module.exports = __toCommonJS(open_cell_shape_picker_exports);
var import_pm_node_types = require("./../../_shared/pm-node-types.js");
var import_smart_block_shape_picker_modal = require("../components/smart-block-shape-picker-modal.js");
var import_data_hooks = require("../data-hooks.js");
const openCellShapePicker = (editor, cellId, referenceElement) => {
  if (!editor) {
    return;
  }
  const smartBlockExt = editor.extensionManager.extensions.find(
    (ext) => ext.name === import_pm_node_types.PmNodeType.SMART_BLOCK
  );
  const services = smartBlockExt?.options?.services;
  if (!services) {
    return;
  }
  services.modals.togglePluginPanel({
    id: import_data_hooks.DATA_HOOKS.CELL_SHAPE_PICKER,
    Component: import_smart_block_shape_picker_modal.SmartBlockShapePickerModal,
    componentProps: { cellId },
    isMobile: services.context.isMobile,
    positioning: {
      referenceElement,
      placement: "bottom"
    }
  });
};
//# sourceMappingURL=open-cell-shape-picker.js.map
