Liferay.Loader.define("portal-workflow-metrics-web@2.0.42/js/shared/components/filter/hooks/useFilterStatic.es", ['module', 'exports', 'require', 'frontend-js-react-web$react', '../util/filterUtil.es', './useFilterState.es'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.useFilterStatic = void 0;

    var _react = require("frontend-js-react-web$react");

    var _filterUtil = require("../util/filterUtil.es");

    var _useFilterState2 = require("./useFilterState.es");

    /**
     * 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 useFilterStatic = function useFilterStatic(_ref) {
      var filterKey = _ref.filterKey,
          prefixKey = _ref.prefixKey,
          propertyKey = _ref.propertyKey,
          staticItems = _ref.staticItems,
          withoutRouteParams = _ref.withoutRouteParams;

      var _useFilterState = (0, _useFilterState2.useFilterState)((0, _filterUtil.getCapitalizedFilterKey)(prefixKey, filterKey), withoutRouteParams),
          items = _useFilterState.items,
          selectedItems = _useFilterState.selectedItems,
          selectedKeys = _useFilterState.selectedKeys,
          setItems = _useFilterState.setItems;

      (0, _react.useEffect)(function () {
        var mappedItems = (0, _filterUtil.buildFilterItems)({
          items: staticItems,
          propertyKey: propertyKey,
          selectedKeys: selectedKeys
        });
        setItems(mappedItems); // eslint-disable-next-line react-hooks/exhaustive-deps
      }, [selectedKeys, staticItems]);
      return {
        items: items,
        selectedItems: selectedItems
      };
    };

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