import{u as useSelector,ag as selectIsFullscreenEnabled,ab as rootApiSelector,aq as preferredLanguageSelector,ar as controllerNodeRedImageSelector,as as automateControllerUrlSelector,at as controllerUrlSelector,j as jsxRuntimeExports,bf as img$8,B as Box,n as hidePanel,q as mountPanel}from"./js-core.esm4.js";import{l as selectors$6,s as selectActiveResourceTab,b as selectActiveResourceSearchValues,h as actions,S as SHARED_TEXT$2}from"./js-core.esm40.js";import{E as EResourceTypeValue}from"./js-core.esm15.js";import{t as tableInfiniteScroll}from"./js-core.esm9.js";import{b0 as FlowCenter2}from"./js-core.esm7.js";import{E as EmptySearch,R as ResourceCard}from"./js-core.esm104.js";import{I as IFlowWidgetTabs,a as IFlowWidgetActivityTabs}from"./js-core.esm17.js";import{u as useDispatch}from"./js-core.esm12.js";import"./js-core.esm30.js";import"./js-core.esm28.js";import"./js-core.esm33.js";import"./js-core.esm37.js";var selectItems=selectors$6.selectItems,selectHasMore=selectors$6.selectHasMore,selectReadStatus=selectors$6.selectReadStatus,selectOffset=selectors$6.selectOffset,TableInfiniteScroll=tableInfiniteScroll.jsx.TableInfiniteScroll,FlowsTable=function(){var s=useDispatch(),r=useSelector(selectIsFullscreenEnabled),e=useSelector(selectActiveResourceTab),t=useSelector(selectActiveResourceSearchValues),l=useSelector(rootApiSelector),a=useSelector(preferredLanguageSelector)||"en",i=useSelector(controllerNodeRedImageSelector),o=useSelector(automateControllerUrlSelector),n=(n=useSelector(controllerUrlSelector))||o.replace("automate-",""),o=!!t[e],c=function(){s(actions.flows.readStart(null))},t=useSelector(selectItems),e=useSelector(selectHasMore),u=useSelector(selectOffset),m=useSelector(selectReadStatus),d=SHARED_TEXT$2.flows.emptyState,p=SHARED_TEXT$2.flows.errorState;return jsxRuntimeExports.jsx(TableInfiniteScroll,{hasMore:e,fetchMore:c,fetchOnMount:0===t.length,TableEmptyStateComponent:o?jsxRuntimeExports.jsx(EmptySearch,{}):void 0,offset:u,items:t,itemHeight:150,isLoading:"pending"===m,error:"failure"===m,TableRowComponent:function(e){var o=e.item,e="".concat(149,"px");return jsxRuntimeExports.jsx(Box,{onClick:function(){return console.log("Item Clicked",o)},sx:{width:"100%",height:e,borderBottom:"1px solid #D5DFE9","&:hover":{backgroundColor:"#f2f5f9",cursor:"pointer"}},children:jsxRuntimeExports.jsx(ResourceCard,{onClick:function(){var e,t;e={name:t="FLOW_DETAILS_PANEL",config:{engineId:(e=o).id,openFlowRunningInstances:!1,config:{apiRoot:l,controllerNodeRedImage:i,controllerUrl:n,defaultCluster:"prd5-21xbyq0x-4h0s-o685-snas-oovhdai552v9",graphQLEndpoint:"v3/graphql"},locale:a,tabs:[IFlowWidgetTabs.Overview,IFlowWidgetTabs.Versions,IFlowWidgetTabs.Activity],activityTabs:[IFlowWidgetActivityTabs.Jobs,IFlowWidgetActivityTabs.ScheduledJobs],onExitClicked:function(){return s(hidePanel(t))},onDeleteFlow:function(){c(),s(hidePanel(t))}}},s(mountPanel({panelId:t,microFrontend:e,panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:r?0:55,marginStart:r?0:80,size:"large",parentPanelId:"RESOURCE_CENTER",dimmed:0,dimmedStatus:"dimParent",borderBottom:!0}}))},height:e,cardType:EResourceTypeValue.flow,name:null==o?void 0:o.name,status:null==o?void 0:o.state,description:null==o?void 0:o.description,industries:null==o?void 0:o.industries,price:null==o?void 0:o.price,deploymentModel:null==o?void 0:o.deploymentModel,owner:null==o||null==(e=o.ownerOrganization)?void 0:e.name,isCertified:null==o||null==(e=o.testingDetails)?void 0:e.isCertified,avatarUrl:(null==o?void 0:o.signedLogoPath)||(null==o?void 0:o.signedIconPath),fallbackIcon:jsxRuntimeExports.jsx(FlowCenter2,{})})})},MessageEmptyState:jsxRuntimeExports.jsx(d,{}),MessageErrorState:jsxRuntimeExports.jsx(p,{}),CustomEmptyStateImage:img$8})};export{FlowsTable as default};
