"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 defaults_exports = {};
__export(defaults_exports, {
  TABLE_DEFAULTS: () => TABLE_DEFAULTS,
  TABLE_VERTICAL_PADDING: () => TABLE_VERTICAL_PADDING,
  getDefaultCellPadding: () => getDefaultCellPadding,
  getMinColumnWidthForPadding: () => getMinColumnWidthForPadding,
  normalizePadding: () => normalizePadding
});
module.exports = __toCommonJS(defaults_exports);
var import_consts = require("./consts.js");
const TABLE_VERTICAL_PADDING = 16;
const TABLE_DEFAULTS = {
  cellPadding: [10, 10, 10, 10],
  cellSpacing: 0
};
const getDefaultCellPadding = () => TABLE_DEFAULTS.cellPadding[0];
const normalizePadding = (padding, defaults) => {
  if (!padding || padding.length === 0) {
    return defaults;
  }
  if (padding.length === 1) {
    return [padding[0], padding[0], padding[0], padding[0]];
  }
  if (padding.length === 2) {
    return [padding[0], padding[1], padding[0], padding[1]];
  }
  if (padding.length === 3) {
    return [padding[0], padding[1], padding[2], padding[1]];
  }
  return padding;
};
const getMinColumnWidthForPadding = (cellPadding) => {
  const padding = normalizePadding(cellPadding, [...TABLE_DEFAULTS.cellPadding]);
  const paddingLeft = padding[3] ?? padding[1] ?? padding[0] ?? 10;
  const paddingRight = padding[1] ?? padding[0] ?? 10;
  const horizontalPadding = paddingLeft + paddingRight;
  const defaultHorizontalPadding = TABLE_DEFAULTS.cellPadding[1] + TABLE_DEFAULTS.cellPadding[3];
  return import_consts.CELL_MANUAL_MIN_WIDTH + (horizontalPadding - defaultHorizontalPadding);
};
//# sourceMappingURL=defaults.js.map
