import{__assign as e}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as i,jsxs as r}from"react/jsx-runtime";import{memo as o,useRef as a,useEffect as t}from"react";import n from"classnames";import{noop as l}from"lodash";import{withTheme as s}from"@material-ui/core";import d from"./RealTimeValuesBox/RealTimeBoxEditDialog.js";import{useStyles as m}from"./RealTimeSidebarStyles.js";import{ORIENTATIONS as p}from"./enums.js";import u from"./RealTimeSidebarContext.js";import c from"./SidebarFooter.js";import h from"./RealTimeValuesBox/RealTimeBoxList.js";import S from"./SidebarTitle.js";var f=s(o((function(o){var s,f,g,b,v=o.isSidebarOpen,T=o.handleOpenCloseSidebar,C=o.isResponsive,H=o.theme,j=o.sourceArray,O=o.findSource,y=o.onAppSettingChange,R=o.appSettings,x=o.assetKey,z=o.setting,D=o.realTimeTypes,E=o.isDialogOpen,A=o.paramToEdit,B=o.handleOpenCloseDialog,F=o.handleChangeParamToEdit,L=o.sidebarHorizontalHeight,N=void 0===L?400:L,P=o.onLayoutChange,V=void 0===P?l:P,K=a(null),k=m({sidebarHorizontalHeight:N}),W=C?p.horizontal:p.vertical,_=n(v&&"fullSize",((s={})[k.rtSidebarWhiteTheme]=H.isLightTheme,s[k.rtSidebarVertical]=!C,s[k.rtSidebarHorizontal]=C,s)),q=n(k.rtSidebarContent,W,((f={})[k.rtSidebarContentFullSize]=v,f)),w=n([k.rtSidebarHandler],((g={})[k.rtSidebarHandlerFullSize]=v,g));return t((function(){var e;(null===(e=null==K?void 0:K.current)||void 0===e?void 0:e.clientHeight)&&V(K.current.clientHeight)}),[null===(b=null==K?void 0:K.current)||void 0===b?void 0:b.clientHeight,v]),i(u.Provider,e({value:{isSidebarOpen:v,onAppSettingChange:y,appSettings:R,assetKey:x,setting:z,realTimeTypes:D,orientation:W,handleOpenCloseSidebar:T,handleChangeParamToEdit:F,handleOpenCloseDialog:B}},{children:r("div",e({className:_,ref:K},{children:[i("div",{className:w,onClick:function(){return T(!0)}}),i(S,{}),r("div",e({className:q},{children:[i(h,{sourceArray:j,findSource:O}),i(d,{isDialogOpen:E,paramToEdit:A,handleCloseRealTimeDialog:function(){return B(!1)}})]})),i(c,{onSidebarOpened:function(){return T(!0)},onSidebarClosed:function(){return T(!1)}})]}))}))})));export{f as default};
