"use strict";var e=require("@babel/runtime/helpers/classCallCheck"),t=require("@babel/runtime/helpers/createClass"),r=require("@babel/runtime/helpers/assertThisInitialized"),i=require("@babel/runtime/helpers/inherits"),o=require("@babel/runtime/helpers/possibleConstructorReturn"),n=require("@babel/runtime/helpers/getPrototypeOf"),l=require("@babel/runtime/helpers/defineProperty"),a=require("react"),s=require("emoji-mart"),u=require("prop-types"),c=require("@material-ui/core/Popover"),p=require("./IconButton/index.js"),f=require("./Icons/EmojiIcon.js"),d=require("react/jsx-runtime");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=h(e),b=h(t),j=h(r),v=h(i),P=h(o),q=h(n),E=h(l),y=h(u),R=h(c);function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=q.default(e);if(t){var o=q.default(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return P.default(this,r)}}var k=function(e){v.default(r,e);var t=S(r);function r(e){var i;return m.default(this,r),i=t.call(this,e),E.default(j.default(i),"onSelect",(function(e){var t=i.props,r=t.handleSelectEmoji,o=t.closeOnSelect;r(e),o&&i.setState({openEmojiPicker:!1})})),i.state={openEmojiPicker:!1},i}return b.default(r,[{key:"render",value:function(){var e=this;return d.jsxs(d.Fragment,{children:[d.jsx(p,{"data-testid":this.props["data-testid"],buttonRef:function(t){e.anchorEl=t},"aria-label":"Emoji",onClick:function(){return e.setState({openEmojiPicker:!0})},disableRipple:this.props.disableRipple,className:this.props.emojiIconClassName,tooltipProps:this.props.tooltipProps,children:d.jsx(f,{})}),d.jsx(R.default,{open:this.state.openEmojiPicker,anchorEl:this.anchorEl,onClose:function(){return e.setState({openEmojiPicker:!1})},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:d.jsx(s.Picker,{onSelect:this.onSelect,theme:"dark"})})]})}}]),r}(a.PureComponent);k.propTypes={handleSelectEmoji:y.default.func.isRequired,emojiIconClassName:y.default.string,disableRipple:y.default.bool,closeOnSelect:y.default.bool,"data-testid":y.default.string,tooltipProps:y.default.shape({})},k.defaultProps={emojiIconClassName:void 0,disableRipple:!1,closeOnSelect:!0,"data-testid":"generic_emojiButton",tooltipProps:{title:"Add Emoji"}},module.exports=k;
//# sourceMappingURL=EmojiIconButton.js.map
