"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addGlobalBlurListener = void 0;
function addGlobalBlurListener($element, listener) {
    const _listener = (event) => {
        const { relatedTarget } = event;
        if (relatedTarget === null) {
            listener(event);
        }
    };
    $element.addEventListener('blur', _listener, true);
    return () => {
        $element.removeEventListener('blur', _listener, true);
    };
}
exports.addGlobalBlurListener = addGlobalBlurListener;
//# sourceMappingURL=addGlobalBlurListener.js.map