"use strict";var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),n=require("lodash"),u=require("../constants.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=c(e),i=c(r);function f(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?f(Object(t),!0).forEach((function(r){o.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var a=Object.values(u.FILTERS);module.exports=function(e,r){var u=t.useState({}),c=i.default(u,2),f=c[0],s=c[1];return t.useEffect((function(){r&&s(a.reduce((function(t,u){return l(l({},t),{},o.default({},u,function(e,r,t,u){var c=r.reduce((function(e,r){return e.filter((function(e){return!t[r]||0===t[r].length||t[r].includes(e[r])}))}),u),o=n.sortBy(n.uniqBy(c.map((function(r){return r[e]}))));return o.includes("Null")?o.filter((function(e){return"Null"!==e})).concat("Null"):o}(u,a.filter((function(e){return e!==u})),e,r)))}),{}))}),[e,r]),f};
