const Breakpoints = {
    SM_MIN: 0,
    SM_MAX: 767,
    MD_MIN: 768,
    MD_MAX: 991,
    LG_MIN: 992,
    LG_MAX: 1199,
    XL_MIN: 1200,
    XL_MAX: Infinity,
};

const randomHash = (prefix = 'id') => {
    return `${prefix}-${Math.random().toString(36).substring(2, 9)}-${Date.now().toString(36)}`;
};
const isNullOrUndefined = (value) => value === null || value === undefined;
const isMousePositionOutsideOfElement = (event, elementArea) => {
    const eventX = event.clientX;
    const eventY = event.clientY;
    return (eventX < elementArea.left ||
        eventX >= elementArea.right ||
        eventY < elementArea.top ||
        eventY >= elementArea.bottom);
};
const getElementPositionInfo = (element) => {
    const rect = element.getBoundingClientRect();
    const scrollTop = window.scrollY || document.documentElement.scrollTop;
    const scrollLeft = window.scrollX || document.documentElement.scrollLeft;
    const elementHeight = rect.height;
    const elementWidth = rect.width;
    const elementVerticalCenter = elementHeight / 2;
    const elementHorizontalCenter = elementWidth / 2;
    return {
        top: rect.top + scrollTop,
        left: rect.left + scrollLeft,
        right: rect.left + scrollLeft + elementWidth,
        elementHeight,
        elementWidth,
        elementVerticalCenter,
        elementHorizontalCenter,
    };
};
const getElementLeftoverContentAvailable = (element) => {
    const windowWidth = window.innerWidth;
    const popoverElementTriggerRect = element.getBoundingClientRect();
    const freeDistanceToBottom = window.innerHeight - popoverElementTriggerRect.bottom;
    const freeDistanceToTop = popoverElementTriggerRect.top;
    const freeDistanceToLeft = popoverElementTriggerRect.left;
    const freeDistanceToRight = windowWidth - popoverElementTriggerRect.right;
    return {
        freeDistanceToBottom,
        freeDistanceToTop,
        freeDistanceToLeft,
        freeDistanceToRight,
    };
};
const enableScroll = () => {
    document.body.style.overflow = 'auto';
};
const disableScroll = () => {
    document.body.style.overflow = 'hidden';
};
function deepClone(value, weakMap = new WeakMap()) {
    if (value !== null && typeof value === 'object') {
        if (weakMap.has(value))
            return weakMap.get(value);
    }
    if (value === null || typeof value !== 'object' || value instanceof Function) {
        return value;
    }
    if (value instanceof Date) {
        return new Date(value.getTime());
    }
    if (Array.isArray(value)) {
        const arr = [];
        weakMap.set(value, arr);
        value.forEach((item, i) => {
            arr[i] = deepClone(item, weakMap);
        });
        return arr;
    }
    if (value instanceof Map) {
        const result = new Map();
        weakMap.set(value, result);
        value.forEach((v, k) => {
            result.set(deepClone(k, weakMap), deepClone(v, weakMap));
        });
        return result;
    }
    if (value instanceof Set) {
        const result = new Set();
        weakMap.set(value, result);
        value.forEach((v) => {
            result.add(deepClone(v, weakMap));
        });
        return result;
    }
    if (ArrayBuffer.isView(value)) {
        return new value.constructor(value);
    }
    if (value instanceof ArrayBuffer) {
        return value.slice(0);
    }
    const obj = Object.create(Object.getPrototypeOf(value));
    weakMap.set(value, obj);
    const keys = Reflect.ownKeys(value);
    keys.forEach((key) => {
        const desc = Object.getOwnPropertyDescriptor(value, key);
        if ('value' in desc) {
            desc.value = deepClone(value[key], weakMap);
        }
        Object.defineProperty(obj, key, desc);
    });
    return obj;
}

/**
 * Generated bundle index. Do not edit.
 */

export { Breakpoints, deepClone, disableScroll, enableScroll, getElementLeftoverContentAvailable, getElementPositionInfo, isMousePositionOutsideOfElement, isNullOrUndefined, randomHash };
//# sourceMappingURL=seniorsistemas-angular-components-utils.mjs.map
