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);

// src/components/PisellBasicGrid/utils/index.ts
var utils_exports = {};
__export(utils_exports, {
  ALIGN_CONTENT_MAP: () => ALIGN_CONTENT_MAP,
  ALIGN_MAP: () => ALIGN_MAP,
  COMPONENT_PREFIX: () => COMPONENT_PREFIX,
  DIRECTION_MAP: () => DIRECTION_MAP,
  JUSTIFY_MAP: () => JUSTIFY_MAP,
  WRAP_MAP: () => WRAP_MAP,
  calculateFlexBasis: () => calculateFlexBasis,
  getRowKey: () => getRowKey,
  normalizeGap: () => normalizeGap
});
module.exports = __toCommonJS(utils_exports);
var normalizeGap = (value) => {
  if (value === void 0 || value === null) {
    return void 0;
  }
  if (typeof value === "number") {
    return `${value}px`;
  }
  return value;
};
var calculateFlexBasis = (columns, gap) => {
  const gapValue = normalizeGap(gap) || "0px";
  const gapCount = columns - 1;
  if (gapCount <= 0) {
    return "100%";
  }
  return `calc((100% - ${gapValue} * ${gapCount}) / ${columns})`;
};
var getRowKey = (item, index, rowKey) => {
  if (typeof rowKey === "function") {
    return rowKey(item, index);
  }
  if (typeof rowKey === "string" && item && typeof item === "object") {
    const key = item[rowKey];
    if (key !== void 0 && key !== null) {
      return String(key);
    }
  }
  return String(index);
};
var DIRECTION_MAP = {
  horizontal: "row",
  "horizontal-reverse": "row-reverse",
  vertical: "column",
  "vertical-reverse": "column-reverse"
};
var WRAP_MAP = {
  nowrap: "nowrap",
  wrap: "wrap",
  "wrap-reverse": "wrap-reverse"
};
var JUSTIFY_MAP = {
  start: "flex-start",
  end: "flex-end",
  center: "center",
  between: "space-between",
  around: "space-around",
  evenly: "space-evenly"
};
var ALIGN_MAP = {
  start: "flex-start",
  end: "flex-end",
  center: "center",
  stretch: "stretch",
  baseline: "baseline"
};
var ALIGN_CONTENT_MAP = {
  start: "flex-start",
  end: "flex-end",
  center: "center",
  between: "space-between",
  around: "space-around",
  stretch: "stretch"
};
var COMPONENT_PREFIX = "pisell-basic-grid";
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ALIGN_CONTENT_MAP,
  ALIGN_MAP,
  COMPONENT_PREFIX,
  DIRECTION_MAP,
  JUSTIFY_MAP,
  WRAP_MAP,
  calculateFlexBasis,
  getRowKey,
  normalizeGap
});
