Liferay.Loader.define('portal-workflow-metrics-web@2.0.42/js/shared/components/filter/util/filterEvents.es', ['module', 'exports', 'require'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.removeClickOutsideListener = exports.handleClickOutside = exports.buildFallbackItems = exports.addClickOutsideListener = void 0;

    /**
     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
     *
     * The contents of this file are subject to the terms of the Liferay Enterprise
     * Subscription License ("License"). You may not use this file except in
     * compliance with the License. You can obtain a copy of the License by
     * contacting Liferay, Inc. See the License for the specific language governing
     * permissions and limitations under the License, including but not limited to
     * distribution rights of the Software.
     */
    var buildFallbackItems = function buildFallbackItems(fallbackKeys) {
      if (fallbackKeys) {
        return fallbackKeys.map(function (key) {
          return {
            active: true,
            key: key
          };
        });
      }

      return null;
    };

    exports.buildFallbackItems = buildFallbackItems;

    var handleClickOutside = function handleClickOutside(callback, wrapperRef) {
      return function (event) {
        var clickOutside = wrapperRef && !wrapperRef.contains(event.target);

        if (clickOutside) {
          callback(event);
        }
      };
    };

    exports.handleClickOutside = handleClickOutside;

    var addClickOutsideListener = function addClickOutsideListener(listener) {
      document.addEventListener('mousedown', listener);
    };

    exports.addClickOutsideListener = addClickOutsideListener;

    var removeClickOutsideListener = function removeClickOutsideListener(listener) {
      document.removeEventListener('mousedown', listener);
    };

    exports.removeClickOutsideListener = removeClickOutsideListener;
    //# sourceMappingURL=filterEvents.es.js.map
  }
});
//# sourceMappingURL=filterEvents.es.js.map