"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "Cell", {
    enumerable: true,
    get: function() {
        return Cell;
    }
});
var _react = /*#__PURE__*/ _interop_require_default(require("react"));
var _reacttable = require("@tanstack/react-table");
var _Tablestyles = require("../../Table.styles");
var _utils = require("../../utils");
var _Cellstyles = require("./Cell.styles");
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
var Cell = function Cell(param) {
    var cell = param.cell, borderVariant = param.borderVariant, selected = param.selected, view = param.view, additionalProps = param.additionalProps, className = param.className;
    var _cell_column_columnDef_meta;
    var renderCell = (_cell_column_columnDef_meta = cell.column.columnDef.meta) === null || _cell_column_columnDef_meta === void 0 ? void 0 : _cell_column_columnDef_meta.renderCell;
    return /*#__PURE__*/ _react.default.createElement(_Cellstyles.Td, _object_spread({
        key: cell.id,
        borderVariant: borderVariant,
        selectionCell: cell.column.id === _utils.SELECT_COLUMN_ID,
        selected: selected,
        view: view,
        className: className
    }, additionalProps), renderCell ? renderCell(cell.getValue(), cell.row.original, cell.row.index) : (0, _reacttable.flexRender)(cell.column.columnDef.cell, cell.getContext()), cell.column.getIsResizing() && /*#__PURE__*/ _react.default.createElement(_Tablestyles.Resizer, {
        isResizing: true
    }));
};
