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 attach_image_from_string_exports = {};
__export(attach_image_from_string_exports, {
  attachImageFromString: () => attachImageFromString
});
module.exports = __toCommonJS(attach_image_from_string_exports);
var import_core = require("@dynatrace/strato-components-preview/core");
var import_attach_image_from_shape = require("./attach-image-from-shape.js");
var import_attach_image_from_text = require("./attach-image-from-text.js");
var import_is_valid_shape = require("./is-valid-shape.js");
const attachImageFromString = (map, shape, suffix = "", outputSize) => {
  const isShape = (0, import_is_valid_shape.isValidShape)(shape);
  const name = isShape ? `${shape}-${suffix}` : `emoji-${suffix}`;
  if (isShape) {
    (0, import_attach_image_from_shape.attachImageFromShape)(map, shape, name, outputSize);
  } else {
    const sanitizedShape = (0, import_core._sanitizeSymbol)(shape);
    (0, import_attach_image_from_text.attachImageFromText)(map, sanitizedShape, name, outputSize);
  }
};
