import { t as titleCase } from "./stringUtils-BRGdLBKx.mjs";
const getTableFieldHeadLabel = (field) => typeof field === "string" ? titleCase(field) : field.label !== void 0 ? field.label : titleCase(field.key);
const getWithGetter = (item, key) => {
  if (typeof key === "function") {
    return key(item);
  }
  return item[key];
};
const getByFieldKey = (item, field) => typeof item === "object" && item !== null ? getWithGetter(item, field.accessor ?? field.key) : item;
const formatItem = (item, field) => {
  const val = getByFieldKey(item, field);
  return typeof field.formatter === "function" ? field.formatter({ value: val, key: field.key, item }) : val;
};
const bTableSimpleProps = Object.freeze(
  Object.keys({
    bordered: 0,
    borderless: 0,
    borderVariant: 0,
    captionTop: 0,
    dark: 0,
    fixed: 0,
    hover: 0,
    id: 0,
    noBorderCollapse: 0,
    outlined: 0,
    responsive: 0,
    small: 0,
    stacked: 0,
    stickyHeader: 0,
    striped: 0,
    stripedColumns: 0,
    variant: 0,
    tableAttrs: 0,
    tableClass: 0
  })
);
const bTableLiteProps = Object.freeze(
  Object.keys({
    align: 0,
    caption: 0,
    detailsTdClass: 0,
    fieldColumnClass: 0,
    fields: 0,
    footClone: 0,
    footRowVariant: 0,
    footVariant: 0,
    headRowVariant: 0,
    headVariant: 0,
    items: 0,
    labelStacked: 0,
    modelValue: 0,
    primaryKey: 0,
    tbodyClass: 0,
    tbodyTrAttrs: 0,
    tbodyTrClass: 0,
    tfootClass: 0,
    expandedItems: 0,
    tfootTrClass: 0,
    theadClass: 0,
    theadTrClass: 0
  })
);
const getDataLabelAttr = (props, label) => props.stacked && props.labelStacked !== true ? { "data-label": label } : void 0;
export {
  getWithGetter as a,
  bTableSimpleProps as b,
  getTableFieldHeadLabel as c,
  getByFieldKey as d,
  bTableLiteProps as e,
  formatItem as f,
  getDataLabelAttr as g
};
//# sourceMappingURL=tableUtils-CEJcbxqj.mjs.map
