import{jsxs as o,jsx as i}from"react/jsx-runtime";import n from"classnames";import{useState as t,useCallback as s,useEffect as l}from"react";import{makeStyles as c}from"@material-ui/core";import{UndoIcon as e,FiveIcon as d,MoveInIcon as r,PlusIcon as a,MinusIcon as m}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{ToolboxButton as u}from"./ToolboxButton.js";var p=c((function(o){var i=o.palette;return{toolboxContainer:{position:"absolute",zIndex:1,right:function(o){var i=o.right;return i+7},bottom:function(o){var i=o.bottom;return i+8},width:30,height:"fit-content",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"4px 0"},activeIcon:{color:"".concat(i.primary.main," !important")},tooltipButton:{width:30,height:30,backgroundColor:i.background.b6,minWidth:0},disabledButton:{cursor:"not-allowed",color:"".concat(i.primary.text6," !important"),backgroundColor:"".concat(i.background.b6," !important")}}})),v=function(c){var v,b,h,I,g,j,C,f,x,k,B,Z,z,O,N,F=c.isPaneEnabled,E=c.handleTogglePane,R=c.handleToggleBrush,T=c.isBrushEnabled,P=c.isZoomed,w=c.chart,y=c.customToolboxContainerClass,A=c.handleZoomReset,D=c.handleZoomOut,M=c.handleZoomIn,q=c.controls,S=t({bottom:0,right:0}),W=S[0],G=S[1],L=p({bottom:W.bottom,right:W.right}),H=s((function(){var o,i,n,t,s,l,c=null===(n=null===(i=null===(o=null==w?void 0:w.getOption())||void 0===o?void 0:o.grid)||void 0===i?void 0:i[0])||void 0===n?void 0:n.bottom,e=null===(l=null===(s=null===(t=null==w?void 0:w.getOption())||void 0===t?void 0:t.grid)||void 0===s?void 0:s[0])||void 0===l?void 0:l.right;c===W.bottom&&e===W.right||G({bottom:+c,right:+e})}),[W,w]);l((function(){!w||W.bottom||W.right||w.on("rendered",H)}),[w]);return o("div",{className:n(L.toolboxContainer,y),children:[P&&i(u,{icon:i(e,{size:"small"}),title:"Reset Zoom",onClick:A,disabled:null===(j=null==q?void 0:q.resetZoom)||void 0===j?void 0:j.disabled,className:n(L.tooltipButton,(v={},v[L.disabledButton]=null===(C=null==q?void 0:q.resetZoom)||void 0===C?void 0:C.disabled,v))}),i(u,{icon:i(d,{className:n(F&&L.activeIcon),size:"small"}),onClick:function(){E(!F),R(!1)},title:"Pan",disabled:!P||(null===(f=null==q?void 0:q.pane)||void 0===f?void 0:f.disabled),className:n(L.tooltipButton,(b={},b[L.disabledButton]=!P||(null===(x=null==q?void 0:q.pane)||void 0===x?void 0:x.disabled),b))}),i(u,{icon:i(r,{className:n(T&&L.activeIcon),size:"small"}),onClick:function(){R(!T),E(!1)},title:"Drag To Zoom",disabled:null===(k=null==q?void 0:q.brush)||void 0===k?void 0:k.disabled,className:n(L.tooltipButton,(h={},h[L.disabledButton]=null===(B=null==q?void 0:q.brush)||void 0===B?void 0:B.disabled,h))}),i(u,{icon:i(a,{size:"small"}),onClick:M,title:"Zoom In",disabled:null===(Z=null==q?void 0:q.zoomIn)||void 0===Z?void 0:Z.disabled,className:n(L.tooltipButton,(I={},I[L.disabledButton]=null===(z=null==q?void 0:q.zoomIn)||void 0===z?void 0:z.disabled,I))}),i(u,{icon:i(m,{size:"small"}),onClick:D,title:"Zoom Out",disabled:!P||(null===(O=null==q?void 0:q.zoomOut)||void 0===O?void 0:O.disabled),className:n(L.tooltipButton,(g={},g[L.disabledButton]=!P||(null===(N=null==q?void 0:q.zoomOut)||void 0===N?void 0:N.disabled),g))})]})};export{v as Toolbox};
