"use strict";
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isEventOutsideClientBounds = exports.isNodeOutsideElement = exports.isEventOusideBounds = void 0;
var deprecated_decorator_1 = __importDefault(require("deprecated-decorator"));
/**
 * Check that mouse was outside element.
 */
exports.isEventOusideBounds = deprecated_decorator_1.default({
    name: 'isEventOusideBounds',
    alternative: 'isEventOutsideClientBounds',
    version: '12.0.1',
}, function (event, element) {
    var rect = element.getBoundingClientRect();
    return ((event.pageX < rect.left || event.pageX > rect.right)
        || (event.pageY < rect.top || event.pageY > rect.bottom));
});
/**
 * Check that node is outside given element.
 */
function isNodeOutsideElement(node, element) {
    return !(element.contains(node) || element === node);
}
exports.isNodeOutsideElement = isNodeOutsideElement;
/**
 * Check that mouse was outside element.
 */
function isEventOutsideClientBounds(event, element) {
    var rect = element.getBoundingClientRect();
    return event.clientX < rect.left || event.clientX > rect.right
        || event.clientY < rect.top || event.clientY > rect.bottom;
}
exports.isEventOutsideClientBounds = isEventOutsideClientBounds;

//# sourceMappingURL=window.js.map
