import { TRANSPARENT_HEX_COLOR } from "./../../_shared/colors.js";
import { resolveSmartBlockCssColor } from "./resolve-smart-block-css-color.js";
const computeSmartBlockWrapperVars = (blockAttrs, themeSmartBlock, type, cellCount) => {
  const isJoinedBoxes = type === "SOLID_JOINED_BOXES";
  const borderColor = isJoinedBoxes ? blockAttrs.borderColor ?? themeSmartBlock?.borderColor : themeSmartBlock?.borderColor;
  const borderWidth = isJoinedBoxes ? blockAttrs.borderWidth : void 0;
  const borderRadius = isJoinedBoxes ? blockAttrs.borderRadius : void 0;
  const vars = {
    "--ricos-internal-sb-cols": cellCount
  };
  if (borderColor) {
    if (borderColor === TRANSPARENT_HEX_COLOR) {
      vars["--ricos-internal-sb-block-border-color"] = "transparent";
    } else {
      const resolved = resolveSmartBlockCssColor(borderColor);
      if (resolved) {
        vars["--ricos-internal-sb-block-border-color"] = resolved;
      }
    }
  }
  if (borderWidth && borderWidth > 0) {
    vars["--ricos-internal-sb-block-border-width"] = `${borderWidth}px`;
  }
  if (borderRadius && borderRadius > 0) {
    vars["--ricos-internal-sb-block-border-radius"] = `${borderRadius}px`;
  }
  return vars;
};
export {
  computeSmartBlockWrapperVars
};
//# sourceMappingURL=compute-block-css-vars.js.map
