"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),a=require("prop-types"),n=require("moment"),i=require("@material-ui/pickers"),o=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=u(e),f=u(t),m=u(a),l=u(n);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){c.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=["MM/DD/YYYY HH:mm","M/D/YYYY HH:mm","MM/DD/YYYY, HH:mm","M/D/YYYY, HH:mm","MMM DD, YYYY HH:mm","MMM D, YYYY HH:mm","MM/DD/YY HH:mm","M/D/YY HH:mm"],d=new RegExp("[^\\.\\ \\,\\[a-zA-Z0-9_]*$]+","gi"),b=function(e){var t=e.format,a=e.onChange,n=e.label,u=e["data-testid"],c=r.useState(t),m=f.default(c,2),s=m[0],b=m[1],D=r.useState(null),y=f.default(D,2),H=y[0],M=y[1];return o.jsx(i.KeyboardDateTimePicker,Y(Y({rifmFormatter:function(e){return e},refuse:d,inputValue:H},e),{},{"data-testid":"".concat(u,"_").concat(n),format:s,onChange:function(e,r){var n=l.default(r,[].concat(p,[t]),!0),i=n.isValid();b((function(e){return i?n.creationData().format:e})),M(r),a(i?n:e,r)}}))};b.propTypes={onChange:m.default.func.isRequired,format:m.default.string,label:m.default.string,"data-testid":m.default.string},b.defaultProps={format:"MM/DD/YYYY HH:mm",label:"Date","data-testid":"KeyboardDateTimePicker"},module.exports=b;
//# sourceMappingURL=KeyboardDateTimePicker.js.map
