"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSize = void 0;
function getSize(element) {
    if (!(element instanceof HTMLElement)) {
        const range = document.createRange();
        range.selectNodeContents(element);
        const rects = range.getClientRects();
        const rect = rects[0] || { width: 0, height: 0 };
        return rect;
    }
    const bb = element.getBoundingClientRect();
    const { width, height } = bb;
    return { width, height };
}
exports.getSize = getSize;
//# sourceMappingURL=getSize.js.map