import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{useState as o,useEffect as t}from"react";import n from"prop-types";import{Dialog as i,DialogTitle as c,DialogContent as l,DialogActions as a,Button as s}from"@material-ui/core";import p from"./DraggableList.js";import{jsxs as u,jsx as f}from"react/jsx-runtime";function m(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),o.push.apply(o,t)}return o}function d(r){for(var o=1;o<arguments.length;o++){var t=null!=arguments[o]?arguments[o]:{};o%2?m(Object(t),!0).forEach((function(o){e(r,o,t[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}function h(e){var n=e.open,m=e.columns,h=e.handleCloseWithOK,b=e.handleCloseWithCancel,y=o(m),O=r(y,2),j=O[0],C=O[1];t((function(){C(m)}),[m]);return u(i,{disableBackdropClick:!0,disableEscapeKeyDown:!0,fullWidth:!0,maxWidth:"xs",open:n,children:[f(c,{children:"Customize Columns"}),f(l,{children:f(p,{items:j,onSort:function(e){C(e)},onClick:function(e){var r=j.map((function(r){return r.key===e.key?d(d({},r),{},{show:!!r.disabled||!r.show}):r}));C(r)}})}),u(a,{children:[f(s,{autoFocus:!0,onClick:function(){C(m),b()},color:"primary",children:"Cancel"}),f(s,{onClick:function(){h(j)},color:"primary",variant:"contained",children:"Ok"})]})]})}h.propTypes={open:n.bool.isRequired,handleCloseWithOK:n.func.isRequired,handleCloseWithCancel:n.func.isRequired,columns:n.array.isRequired};export{h as default};
//# sourceMappingURL=CustomizeColumnsDialog.js.map
