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 _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;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
import { MOBILE_BREAKPOINT } from "../../../../../Constants/mobile";
import { resetComponent, useEditorStyleRegister } from "../../../../../Hooks/useStyle";
var genStyle = function(token) {
    return _define_property({}, token.componentCls, _define_property({
        padding: '8px',
        verticalAlign: 'middle',
        wordWrap: 'break-word',
        wordBreak: 'break-all',
        overflow: 'hidden',
        textOverflow: 'ellipsis',
        whiteSpace: 'pre-wrap',
        '&[data-select="true"]:after': {
            content: '" "',
            position: 'absolute',
            top: '0',
            left: '0',
            right: '0',
            bottom: '0',
            zIndex: 2,
            pointerEvents: 'none',
            backgroundColor: 'var(--color-primary-control-fill-secondary-hover)'
        }
    }, "@media (max-width: ".concat(MOBILE_BREAKPOINT, ")"), {
        padding: '2px'
    }));
};
/**
 * Td 样式 hook
 * @param prefixCls 组件前缀类名
 * @returns 样式相关的对象
 */ export function useStyle(prefixCls) {
    return useEditorStyleRegister('md-editor-table-td', function(token) {
        var editorToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls || 'md-editor-table-td')
        });
        return [
            resetComponent(editorToken),
            genStyle(editorToken)
        ];
    });
}
