import e from"@babel/runtime/helpers/defineProperty";import{jsx as t,Fragment as r,jsxs as i}from"react/jsx-runtime";import{memo as o,useContext as n}from"react";import l from"react-draggable-list";import a from"classnames";import{makeStyles as m}from"@material-ui/core";import c from"../../IconButton/index.js";import{PlusIcon as s}from"../../../icons/iconParkIcons.js";import u from"./RealTimeBox.js";import d from"../RealTimeSidebarContext.js";import{ORIENTATIONS as p}from"../enums.js";function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function v(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?f(Object(i),!0).forEach((function(r){e(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):f(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var b=m((function(){return{boxListVertical:{padding:"10px 0 16px",overflowX:"hidden"},rtBoxListHorizontal:{display:"flex",flexWrap:"wrap"},cTpRtBoxAddButtonContainer:{marginTop:8,textAlign:"center"}}})),g=o((function(o){var m=o.sourceArray,f=o.findSource,g=o.classNames,y=b(),O=n(d),j=O.onAppSettingChange,x=O.appSettings,T=O.assetKey,h=O.orientation,B=O.realTimeTypes,S=O.setting,P=O.handleOpenCloseDialog;return t(r,{children:h===p.vertical?i("div",{className:a(y.boxListVertical,null==g?void 0:g.item),children:[t(l,{list:m,itemKey:function(e){return e.key},template:function(e){return t(u,v(v({},e),{},{classNames:{item:null==g?void 0:g.item,itemTitle:null==g?void 0:g.itemTitle,itemTitleBorder:null==g?void 0:g.itemTitleBorder,itemValue:null==g?void 0:g.itemValue,itemSeparator:null==g?void 0:g.itemSeparator}}))},padding:0,unsetZIndex:!0,container:function(){return document.body},onMoveEnd:function(t){var r=t.map((function(e){return e.key}));j("rtValuesSetting",v(v({},x.rtValuesSetting),{},e({},T,r)))}}),t("div",{className:a(y.cTpRtBoxAddButtonContainer,null==g?void 0:g.buttons),children:t(c,{"data-testid":"addRealTimeValuesButton",color:"primary",tooltipProps:{title:"Add"},onClick:function(){return P(!0)},children:t(s,{})})})]}):t("div",{className:y.rtBoxListHorizontal,children:S.map((function(e){var r;return t(u,{isDraggable:!1,item:null!==(r=f(e,B))&&void 0!==r?r:void 0,classNames:{item:null==g?void 0:g.item,itemTitle:null==g?void 0:g.itemTitle,itemTitleBorder:null==g?void 0:g.itemTitleBorder,itemValue:null==g?void 0:g.itemValue,itemSeparator:null==g?void 0:g.itemSeparator}},"".concat(e))}))})})}));export{g as default};
//# sourceMappingURL=RealTimeBoxList.js.map
