"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const getComponentAttrStyle = (attr, index) => {
  const componentStyle = {
    zIndex: index + 1,
    left: `${attr.x}px`,
    top: `${attr.y}px`
  };
  return componentStyle;
};
const getSizeStyle = (attr, scale) => {
  return {
    width: `${scale ? scale * attr.w : attr.w}px`,
    height: `${scale ? scale * attr.h : attr.h}px`
  };
};
const getStatusStyle = (attr) => {
  return {
    display: attr.hide ? "none" : "block"
  };
};
const getPreviewConfigStyle = (previewConfig) => {
  const previewStyle = {};
  if (previewConfig) {
    if (previewConfig.overFlowHidden) {
      previewStyle.overflow = "hidden";
    }
  }
  return previewStyle;
};
const getEditCanvasConfigStyle = (canvas) => {
  const computedBackground = canvas.selectColor ? { background: canvas.background } : {
    background: `url(${canvas.backgroundImage}) center center / cover no-repeat !important`
  };
  return {
    position: "relative",
    width: canvas.width ? `${canvas.width || 100}px` : "100%",
    height: canvas.height ? `${canvas.height}px` : "100%",
    ...computedBackground
  };
};
exports.getComponentAttrStyle = getComponentAttrStyle;
exports.getEditCanvasConfigStyle = getEditCanvasConfigStyle;
exports.getPreviewConfigStyle = getPreviewConfigStyle;
exports.getSizeStyle = getSizeStyle;
exports.getStatusStyle = getStatusStyle;
