"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _react = require('react');var _material = require('@mui/material');var _jsxruntime = require('react/jsx-runtime');function C(e){return _(e)||S(e)||v(e)||g()}function g(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _(e){if(Array.isArray(e))return m(e)}function x(e,n){return j(e)||T(e,n)||v(e,n)||I()}function I(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(e,n){if(e){if(typeof e=="string")return m(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(e,n):void 0}}function m(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function T(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var t,c,s,l,i=[],o=!0,f=!1;try{if(s=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;o=!1}else for(;!(o=(t=s.call(r)).done)&&(i.push(t.value),i.length!==n);o=!0);}catch(y){f=!0,c=y}finally{try{if(!o&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(f)throw c}}return i}}function j(e){if(Array.isArray(e))return e}var H=function(n){var r=n.options,t=n.selectedOptions,c=n.onChange,s=_react.useState.call(void 0, null),l=x(s,2),i=l[0],o=l[1],f=function(u){o(u.currentTarget)},y=function(){o(null)},A=function(u){var p=t.indexOf(u),h=C(t);p===-1?h.push(u):h.splice(p,1),c(h)};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _material.Chip,{label:"Filter",onClick:f}),_jsxruntime.jsx.call(void 0, _material.Menu,{anchorEl:i,open:!!i,onClose:y,children:r.map(function(a){return _jsxruntime.jsxs.call(void 0, _material.MenuItem,{onClick:function(){return A(a)},children:[_jsxruntime.jsx.call(void 0, _material.Checkbox,{checked:t.indexOf(a)>-1}),_jsxruntime.jsx.call(void 0, _material.ListItemText,{primary:a})]},a)})})]})},U= exports.a =H;exports.a = U;
//# sourceMappingURL=chunk-BGH43QAC.js.map