import{jsxs as o,jsx as s}from"react/jsx-runtime";import{useState as c}from"react";import{GithubPicker as n,ChromePicker as i}from"react-color";import{Button as r,ClickAwayListener as t}from"@material-ui/core";import{PaletteIcon as e}from"../../../icons/iconParkIcons.js";import"../../../icons/customIcons/icons/AddMessage.js";import"../../../icons/customIcons/icons/Attention.js";import"../../../icons/customIcons/icons/Collapse.js";import"../../../icons/customIcons/icons/Dashboard.js";import"../../../icons/customIcons/icons/Expand.js";import"../../../icons/customIcons/icons/FolderClosed.js";import"../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../icons/customIcons/icons/FolderOpened.js";import"../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../icons/customIcons/icons/LessOrEqual.js";import"../../../icons/customIcons/icons/Search.js";import"../../../icons/customIcons/icons/Wellhub.js";import"../../../icons/customIcons/icons/MultiRuler.js";import"../../../icons/customIcons/icons/Checkbox.js";import"../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../icons/customIcons/icons/Radio.js";import"../../../icons/customIcons/icons/RadioChecked.js";import"../../../icons/customIcons/icons/SimulFrac.js";import"../../../icons/customIcons/icons/ZipperFrac.js";import"../../../icons/customIcons/icons/CautionFilled.js";import"../../../icons/customIcons/icons/MoreApp.js";import m from"./style.css.js";var u=function(u){var l=u.onChange,a=u.currentValue,p=u.defaultValue,d=void 0===p?"#FF0000":p,j=u.condensed,I=u.colors,h=void 0===I?["#FF0000","#00FF00","#0000FF"]:I,f=u.lensColor,C=void 0===f?"#fff":f,F=c(!1),k=F[0],v=F[1],x=c(a||d),b=x[0],E=x[1],g=function(){return l(b)};return o("div",{className:m.colorEditor,children:[s(r,{variant:"contained",color:"primary",onClick:function(){return v(!0)},className:m.button,style:{backgroundColor:b,color:C},size:"small",children:s(e,{size:16})}),k&&s(t,{mouseEvent:"onMouseDown",touchEvent:"onTouchStart",onClickAway:function(){v(!1),g()},children:s("div",{className:m.colorEditorPickerContainer,children:j?s(n,{color:b,onChange:function(o){E(o.hex),v(!1),g()},colors:h,triangle:"hide"}):s(i,{color:b,onChange:function(o){E(o.hex),g()}})})})]})};export{u as ColorEditor,u as default};
