"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),b=require("react"),I=require("react-redux"),p=require("semantic-ui-react"),d=require("../reducers/data.js"),h=n=>{const{appliedFilters:a,initialFilters:e,"data-group":t,onClean:g,onApply:m,"data-app":c="csv","data-reset-label":f="Reset All Filters"}=n,F=b.useMemo(()=>Object.keys(e).some(i=>{const r=e[i],l=(a[i]||[]).filter(o=>o!==Number.MIN_SAFE_INTEGER);if(l.length===0)return!1;if(r.length===1&&r[0]===Number.MIN_SAFE_INTEGER&&l.length>0)return!0;const u=r.length!==l.length&&!r.every(o=>l.includes(o));return console.log("res",u),u}),[e,a]);return s.jsxs(p.Container,{fluid:!0,className:`data-filters-reset ignore ${F?"":"disabled"}`,onClick:i=>{g({app:c,group:t}),m({app:c,group:t})},children:[s.jsx("span",{children:f}),s.jsx("span",{children:s.jsx(p.Icon,{name:"undo alternate",className:"custom-undo-icon"})})]})},N=(n,a)=>{const{"data-group":e,"data-app":t="csv"}=a;return{appliedFilters:n.getIn(["data","filters",t,e])?n.getIn(["data","filters",t,e]).toJS():{},initialFilters:n.getIn(["data","filters","initial",t,e])?n.getIn(["data","filters","initial",t,e]).toJS():{}}},R={onClean:d.cleanFilter,onApply:d.applyFilter},j=I.connect(N,R)(h);exports.default=j;
