"use strict";var r=require('./../../ext-esm/tslib/tslib.es6.js'),e=require("react/jsx-runtime"),n=require("react"),o=require("@material-ui/core"),t=require("../ColorPicker/PaletteChromePicker/PaletteChromePicker.js"),a={rgba:function(r){return"rgba(".concat(r.rgb.r,", ").concat(r.rgb.g,", ").concat(r.rgb.b,", ").concat(r.rgb.a,")")},rgb:function(r){return"rgb(".concat(r.rgb.r,", ").concat(r.rgb.g,", ").concat(r.rgb.b,")")},hex:function(r){return r.hex},rgba_rgb:function(r){return 1===r.rgb.a?a.rgb(r):a.rgba(r)},rgba_hex:function(r){return 1===r.rgb.a?a.hex(r):a.rgba(r)}},i=function(t){var i=t.color,c=t.onChange,l=t.anchorEl,p=t.handleClose,g=t.converter,s=t.popoverAnchorOrigin,b=t.popoverTransformOrigin,u=t.pickerComponent,h=t.classes,f=t.enableTransparencyPalette,x=n.useRef();return e.jsx("div",r.__assign({className:h.root},{children:e.jsx(o.Popover,r.__assign({id:"colors-popper",action:x,open:Boolean(l),anchorEl:l,onClose:p,anchorOrigin:s,transformOrigin:b},{children:e.jsx(u,{color:i,onChange:function(r){var e=a[g](r);c(e)},onSizeChange:function(){x.current&&x.current.updatePosition()},enableTransparencyPalette:f})}))}))};i.defaultProps={converter:"rgba_hex",pickerComponent:t,popoverAnchorOrigin:{vertical:"bottom",horizontal:"left"},popoverTransformOrigin:{vertical:"top",horizontal:"left"},enableTransparencyPalette:!1,anchorEl:null};var c=o.withStyles({root:{position:"relative",display:"flex"},popper:{zIndex:1500},topLabel:{marginBottom:"8px",fontSize:"15px",lineHeight:"17px",letterSpacing:"0.4px",color:"#BDBDBD",whiteSpace:"nowrap"},rightLabel:{marginLeft:"8px",fontSize:"16px"}})(i);module.exports=c;
