import{__assign as o}from'./../../../../ext-esm/tslib/tslib.es6.js';import{jsxs as i,jsx as n}from"react/jsx-runtime";import t from"classnames";import{useState as s,useCallback as l,useEffect as c}from"react";import{makeStyles as e}from"@material-ui/core";import{UndoIcon as d,FiveIcon as r,MoveInIcon as a,PlusIcon as m,MinusIcon as u}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 p}from"./ToolboxButton.js";var v=e((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")}}})),b=function(e){var b,h,I,g,j,C,f,x,k,B,Z,z,O,N,F,E=e.isPaneEnabled,R=e.handleTogglePane,T=e.handleToggleBrush,P=e.isBrushEnabled,w=e.isZoomed,y=e.chart,A=e.customToolboxContainerClass,D=e.handleZoomReset,M=e.handleZoomOut,q=e.handleZoomIn,S=e.controls,W=s({bottom:0,right:0}),G=W[0],L=W[1],_=v({bottom:G.bottom,right:G.right}),H=l((function(){var o,i,n,t,s,l,c=null===(n=null===(i=null===(o=null==y?void 0:y.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==y?void 0:y.getOption())||void 0===t?void 0:t.grid)||void 0===s?void 0:s[0])||void 0===l?void 0:l.right;c===G.bottom&&e===G.right||L({bottom:+c,right:+e})}),[G,y]);c((function(){!y||G.bottom||G.right||y.on("rendered",H)}),[y]);return i("div",o({className:t(_.toolboxContainer,A)},{children:[w&&n(p,{icon:n(d,{size:"small"}),title:"Reset Zoom",onClick:D,disabled:null===(C=null==S?void 0:S.resetZoom)||void 0===C?void 0:C.disabled,className:t(_.tooltipButton,(b={},b[_.disabledButton]=null===(f=null==S?void 0:S.resetZoom)||void 0===f?void 0:f.disabled,b))}),n(p,{icon:n(r,{className:t(E&&_.activeIcon),size:"small"}),onClick:function(){R(!E),T(!1)},title:"Pan",disabled:!w||(null===(x=null==S?void 0:S.pane)||void 0===x?void 0:x.disabled),className:t(_.tooltipButton,(h={},h[_.disabledButton]=!w||(null===(k=null==S?void 0:S.pane)||void 0===k?void 0:k.disabled),h))}),n(p,{icon:n(a,{className:t(P&&_.activeIcon),size:"small"}),onClick:function(){T(!P),R(!1)},title:"Drag To Zoom",disabled:null===(B=null==S?void 0:S.brush)||void 0===B?void 0:B.disabled,className:t(_.tooltipButton,(I={},I[_.disabledButton]=null===(Z=null==S?void 0:S.brush)||void 0===Z?void 0:Z.disabled,I))}),n(p,{icon:n(m,{size:"small"}),onClick:q,title:"Zoom In",disabled:null===(z=null==S?void 0:S.zoomIn)||void 0===z?void 0:z.disabled,className:t(_.tooltipButton,(g={},g[_.disabledButton]=null===(O=null==S?void 0:S.zoomIn)||void 0===O?void 0:O.disabled,g))}),n(p,{icon:n(u,{size:"small"}),onClick:M,title:"Zoom Out",disabled:!w||(null===(N=null==S?void 0:S.zoomOut)||void 0===N?void 0:N.disabled),className:t(_.tooltipButton,(j={},j[_.disabledButton]=!w||(null===(F=null==S?void 0:S.zoomOut)||void 0===F?void 0:F.disabled),j))})]}))};export{b as Toolbox};
