summaryrefslogtreecommitdiffstats
path: root/web/gui/v2/5091.07dfc76b1d5c1623c330.chunk.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/gui/v2/5091.07dfc76b1d5c1623c330.chunk.js')
-rw-r--r--web/gui/v2/5091.07dfc76b1d5c1623c330.chunk.js1
1 files changed, 0 insertions, 1 deletions
diff --git a/web/gui/v2/5091.07dfc76b1d5c1623c330.chunk.js b/web/gui/v2/5091.07dfc76b1d5c1623c330.chunk.js
deleted file mode 100644
index 7cce6a80d..000000000
--- a/web/gui/v2/5091.07dfc76b1d5c1623c330.chunk.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="86010b2d-1ac4-4bff-b289-075d781a279c",e._sentryDebugIdIdentifier="sentry-dbid-86010b2d-1ac4-4bff-b289-075d781a279c")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"6845f9ce010d5a446e5d4a40f17204cb8341a07a"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[5091],{36560:function(e,t,n){n.d(t,{H:function(){return A},Z:function(){return _}});var r=n(87462),o=n(29439),a=n(67294),i=n(64969),l=n(46667),c=n(37518),s=n(86242),d=n(28350),u=n(36459),m=(n(19601),n(21249),n(57640),n(9924),n(71893)),f=n(94666),p=n(31203),g=n(52428),h=(0,m.default)(i.Flex).withConfig({displayName:"adminsList__RowFlex",componentId:"sc-1pb9ob2-0"})(["&:hover{background:",";}"],(0,i.getColor)("elementBackground")),v=(0,m.default)(i.Icon).withConfig({displayName:"adminsList__StyledIcon",componentId:"sc-1pb9ob2-1"})(["cursor:pointer;"]),b=function(e){var t=Object.assign({},((0,u.Z)(e),e)),n=(0,f.nP)();return a.createElement(i.Flex,(0,r.Z)({column:!0,border:{side:"top",color:"borderSecondary"},flex:"grow",padding:[1,0],height:{max:50},overflow:"auto"},t),n.map((function(e){return a.createElement(h,{flex:{grow:0,shrink:0},key:e.id,padding:[0,4],justifyContent:"between",height:10,alignItems:"center"},a.createElement(i.Flex,{key:e.id,gap:2,alignItems:"center"},a.createElement(p.Z,{src:e.avatarURL,title:e.name}),a.createElement(i.Text,null,e.name),a.createElement(i.Text,{color:"textLite"},e.email)),a.createElement(v,{onClick:(0,g.J)(e.email,{text:"Admin email address copied to your clipboard."}),size:"small",name:"copy",color:"primary"}))})))},y=(0,m.default)(i.Icon).withConfig({displayName:"styled__StyledWarningIcon",componentId:"sc-q96c2w-0"})(["border-radius:50%;overflow:hidden;background:",";"],(0,i.getColor)(["neutral","white"])),w=(0,m.default)(i.Icon).withConfig({displayName:"styled__StyledCheckmarkIcon",componentId:"sc-q96c2w-1"})(["border-radius:50%;overflow:hidden;background:",";padding:6px;width:24px;height:24px;"],(0,i.getColor)("elementBackground")),E=(0,m.default)(i.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-q96c2w-2"})(["transform:",";"],(function(e){return e.closed?"none":"rotate(180deg)"})),x=n(45987),O=n(91008),C=["gaPrefix"],k=function(e){var t=e.gaPrefix,n=void 0===t?"onboarding":t,o=(0,x.Z)(e,C);return a.createElement(i.Flex,(0,r.Z)({column:!0,gap:1,color:"textDescription"},o),a.createElement(i.Text,null,"Need help?"),a.createElement(i.Text,null,"Use our"," ",a.createElement(O.Z,{href:"https://community.netdata.cloud/",target:"_blank","data-ga":"".concat(n,"::click-forums::allpages")},"forums")," ","or public"," ",a.createElement(O.Z,{href:"https://discord.gg/mPZ6WZKKG2",target:"_blank","data-ga":"".concat(n,"::click-discord::allpages")},"discord channel")))},I=n(72911),Z=n(91268),j=n(73531),S=n(33335),P=n(46189),N=n(89250),T=n(92432),D=P.Z.demoSlug,B=(0,m.default)(i.Button).withConfig({displayName:"headerButtons__StyledButton",componentId:"sc-11mwk9m-0"})(["&&{padding:2px 16px;font-size:12px;height:auto;width:auto;min-width:96px;}"]),F=function(){var e=(0,N.s0)();return a.createElement(i.Flex,{gap:4},a.createElement(O.Z,{href:"https://learn.netdata.cloud/docs/architecture/deployment-strategies",rel:"noopener noreferrer",target:"_blank"},"Possible Deployment Strategies"),!window.envSettings.onprem&&a.createElement(B,{"data-ga":"no-nodes-view::click-demo::no-nodes-header",flavour:"default",onClick:function(t){e("/spaces/".concat(D)),(0,T.L)("no-nodes-view","click-demo","no-nodes-header"),t.preventDefault()},label:"Live Demo"}))},M=n(8741),A=function(){return a.createElement(a.Fragment,null,a.createElement(i.Flex,{column:!0,"data-testid":"noNodesView-memberSection",gap:1},a.createElement(i.Flex,{alignItems:"center","data-testid":"noNodesView-memberHeader",gap:4,height:10,padding:[0,3]},a.createElement(w,{"data-testid":"noNodesView-memberHeaderIcon",name:"checkmark_s",color:"textLite"}),a.createElement(i.Flex,{justifyContent:"between",flex:!0},a.createElement(i.H3,{color:"textDescription","data-testid":"noNodesView-memberHeaderText"},"You are a member and only space admins can connect new nodes"),a.createElement(F,null))),a.createElement(i.Flex,{"data-testid":"noNodesView-memberDescription",padding:[0,0,2,13]},a.createElement(i.Text,{color:"textDescription","data-testid":"noNodesView-memberDescriptionText"},"Please contact anyone from the list in order to do so"))),a.createElement(i.Flex,{"data-testid":"noNodesView-memberAdminsListSection",padding:[0,0,0,12]},a.createElement(b,{"data-testid":"noNodesView-memberAdminsList"})))},_=function(e){var t=e.videoId,n=(0,c.UL)(),u=(0,s.Z)(n),m=(0,o.Z)(u,2),f=m[0],p=m[1],g=p.onAddNodes,h=p.selectedNodes,v=f.claimedNodeIds.length>0,b=(0,l.Z)(!0),x=(0,o.Z)(b,2),O=x[0],C=x[1],P=(0,S.gI)("node:Create");return a.createElement(Z.Z,{column:!1,"data-testid":"noNodesViewPage",gap:12,padding:[6],margin:[0,0,8],rightBar:a.createElement(j.Z,null),overflow:"auto"},a.createElement(i.Flex,{column:!0,"data-testid":"noNodesView-cmdSection",flex:{grow:0,shrink:1},width:"100%",gap:2},a.createElement(i.Flex,{"data-testid":"noNodesView-warningBanner",alignItems:"center",background:"warningBackground",gap:4,height:{min:10},padding:[0,3],round:!0},a.createElement(y,{"data-testid":"noNodesView-warningBannerIcon",name:"exclamation",color:"warning"}),a.createElement(i.Text,{color:"bright","data-testid":"noNodesView-warningBannerText"},"You have no nodes.")),P&&a.createElement(a.Fragment,null,a.createElement(i.Flex,{alignItems:"center","data-testid":"noNodesView-adminSection",justifyContent:"between",onClick:v?C:null,cursor:v?"pointer":null},a.createElement(i.Flex,{alignItems:"center","data-testid":"noNodesView-adminHeader",gap:4,height:10,padding:[0,3]},a.createElement(w,{"data-testid":"noNodesView-adminHeaderIcon",name:"checkmark_s",color:"textLite"}),a.createElement(i.H3,{"data-testid":"noNodesView-adminHeaderText",color:"textDescription"},"Connect new nodes")),a.createElement(i.Flex,{gap:4,alignItems:"center"},a.createElement(F,null),v&&a.createElement(E,{closed:!O,"data-testid":"noNodesView-adminClaimedNodesIcon",name:"chevron_down",color:"textLite"}))),a.createElement(i.Collapsible,{"data-testid":"noNodesView-adminClaimNodesContainer",open:O},a.createElement(i.Flex,{"data-testid":"noNodesView-adminClaimNodes",padding:[0,0,0,12]},a.createElement(M.Z,null)))),!P&&a.createElement(A,null),v&&a.createElement(a.Fragment,null,a.createElement(i.Flex,{alignItems:"center","data-testid":"noNodesView-availableNodesHeader",gap:4,height:10,padding:[0,3]},a.createElement(w,{"data-testid":"noNodesView-availableNodesHeaderIcon",name:"checkmark_s",color:"textLite"}),a.createElement(i.H3,{color:"textDescription","data-testid":"noNodesView-availableNodesHeaderText"},"Add already available nodes")),a.createElement(i.Flex,{height:"100%","data-testid":"noNodesView-availableNodesContainer",padding:[0,0,0,12]},a.createElement(d.Z,(0,r.Z)({"data-testid":"noNodesView-availableNodesList"},f,{onAddNodes:g,canAddNodes:!!h.length,padding:[2,0,8]}))))),t&&a.createElement(i.Flex,{column:!0,"data-testid":"noNodesView-videoSection",flex:{shrink:0,grow:0}},a.createElement(I.Z,{"data-testid":"noNodesView-onboardingVideo",height:296,width:520,videoId:t}),a.createElement(k,{"data-testid":"noNodesView-needHelp",padding:[8,0]})))}},73531:function(e,t,n){n.d(t,{Z:function(){return N}});var r,o=n(87462),a=n(4942),i=n(45987),l=(n(21249),n(57640),n(9924),n(67294)),c=n(64969),s=n(54316),d=n(29814),u=n(72843),m=n(36459),f=n(29439),p=(n(19601),n(46667)),g=n(65211),h=n(97945),v=n(64344),b=n(31509),y=n(50308),w=n.n(y),E=n(3581),x=n(62200),O="Dismissible",C="Collapsed",k={info:{iconName:"information",color:{active:"success",notActive:"textLite"},width:"19px",dataTestId:"nodeInfo-alertsTab",Content:v.Z,label:"Info"},alerts:{iconName:"alarm_bell",color:{active:"success",notActive:"textLite"},width:"14px",Content:b.Z,dataTestId:"nodeInfo-alertsTab",label:"Alerts"}},I=(r={},(0,a.Z)(r,O,(function(){var e=(0,g.d)({resetOnUnmount:!0}),t=(0,f.Z)(e,3);return{isOpen:!!t[0],onClose:t[2],isDismissible:!0,onToggle:w()}})),(0,a.Z)(r,C,(function(e){var t=e.defaultCollapsedState,n=e.nodeId,r=(0,p.Z)(t),o=(0,f.Z)(r,3),i=o[0],c=o[1],s=o[2],d=(0,E.j)(x.G1,n),u=(0,f.Z)(d,2),m=u[0],g=u[1],h=(0,l.useRef)(m),v=(0,l.useCallback)((function(){i||g((0,a.Z)({},n,h.current)),c()}),[i]);return(0,l.useEffect)((function(){i||(h.current=m,g((0,a.Z)({},n,0)))}),[i]),(0,l.useEffect)((function(){0!==m&&s()}),[m]),{isOpen:i,onClose:w(),isDismissible:!1,onToggle:v}})),r),Z=function(e){var t=e.showCollapsed,n=e.tabs,r=void 0===n?k:n,o=e.defaultCollapsedState,a=void 0===o||o,i=(0,g.d)({resetOnUnmount:!0}),l=(0,f.Z)(i,1)[0],c=(0,h.Ne)([l]),s=(0,f.Z)(c,1)[0],d=t?C:O,u=Object.assign({},((0,m.Z)(r),r)),p=I[d]({defaultCollapsedState:a,nodeId:s.id}),v=p.isOpen,b=p.onClose,y=p.isDismissible,w=p.onToggle,Z=(0,E.j)(d===C?x.G1:x.$9,s.id),j=(0,f.Z)(Z,2);return{isOpen:v,onClose:b,isDismissible:y,onToggle:w,availableTabs:u,node:s,selectedTab:j[0],setSelectedTab:j[1],nodeIds:[s.id]}},j=["showCollapsed","tabsToShow"],S=function(e){var t=e.isActive,n=e.color,r=e.width,o=e.name;return l.createElement(c.Icon,{name:o,color:t?n.active:n.notActive,width:r})},P=function(e){var t=e.showCollapsed,n=e.tabsToShow,r=void 0===n?["info","alerts"]:n,m=(0,i.Z)(e,j),f=Z({showCollapsed:t}),p=f.isOpen,g=f.onToggle,h=f.onClose,v=f.node,b=f.availableTabs,y=f.selectedTab,w=f.setSelectedTab,E=f.nodeIds;return(0,l.useLayoutEffect)((function(){var e=setTimeout((function(){return window.dispatchEvent(new Event("resize"))}),400);return function(){return clearTimeout(e)}}),[p]),l.createElement(s.ZP,{collapsedComponent:t&&l.createElement(d.Z,{onClickTab:function(e){g(),w((0,a.Z)({},v.id,e))},tabsToShow:r,availableTabs:b}),isOpen:p,onClose:h,onToggle:g,header:t?l.createElement(u.Z,{onToggle:g,isOpen:p,title:"Single Node"}):l.createElement(s.Dh,{isOpen:p,onClose:h,node:v})},l.createElement(c.Tabs,{selected:y,onChange:function(e){return w((0,a.Z)({},v.id,e))},noDefaultBorder:!0,column:!0,overflow:"hidden",height:"100%"},r.map((function(e,t){var n=b[e],r=n.iconName,a=n.color,i=n.width,s=n.Content,d=n.dataTestId;return l.createElement(c.Tab,{"data-testid":d,maxWidth:"50%",key:r,small:!0,label:l.createElement(S,{isActive:y===t,name:r,color:a,width:i})},l.createElement(c.Flex,{column:!0,overflow:{vertical:"auto"},height:"calc(100% - 60px)",position:"relative",gap:4,padding:[1,3]},l.createElement(s,(0,o.Z)({nodeIds:E,node:v},m))))}))))},N=(0,l.memo)(P)},31509:function(e,t,n){n.d(t,{Z:function(){return b}});var r=n(29439),o=n(93433),a=(n(2707),n(21249),n(57640),n(9924),n(67294)),i=n(64969),l=n(77796),c=n(12008),s=n(82351),d=(n(92222),n(71893)),u=n(89405),m=n(50358),f=(0,d.default)(i.TextSmall).withConfig({displayName:"alertItem__ClickableTextSmall",componentId:"sc-10tk55c-0"})(["cursor:pointer;transition:opacity 0.3s ease-in-out;&:hover{opacity:0.7;}"]),p=(0,d.default)(i.Flex).withConfig({displayName:"alertItem__StyledFlex",componentId:"sc-10tk55c-1"})(["&:last-child{border:none;}"]),g=function(e){var t=e.alert,n=e.onAlertClick,r=t.value,o=t.instance,l=t.lastStatusChange,c=t.id,s=t.status,d=t.units,g=t.name,h=(0,u.rA)(),v=h.localeTimeString,b=h.localeDateString,y=(0,a.useMemo)((function(){var e=new Date(1e3*l);return isNaN(e.valueOf())?"":"".concat(b(e,{long:!1})," ").concat(v(e,{secs:!1}))}),[l,v,b]),w=(0,a.useCallback)((function(){n({alertId:c})}),[]);return a.createElement(p,{column:!0,padding:[4,0],gap:2,border:{color:"border",side:"bottom"},"data-testid":"alertItem","data-test-name":"alertItem-".concat(g)},a.createElement(f,{wordBreak:"break-all",strong:!0,onClick:w,"data-testid":"alertItem-chartId"},o),a.createElement(f,{onClick:w,"data-testid":"alertItem-alertName"},g),a.createElement(i.Flex,{alignItems:"center",justifyContent:"between",margin:[1,0,0]},a.createElement(m.Z,{loaded:!0,status:s,units:d,value:r,flex:!1,"data-testid":"alertItem-alertValuePill"}),a.createElement(i.TextMicro,{color:"textLite","data-testid":"alertItem-alertDate"},y)))},h=n(61294),v=function(e,t){return e.status===t.status?0:"critical"===e.status?-1:1},b=function(e){var t=e.nodeIds,n=(0,l.rw)(t),d=(0,c.ER)(n),u=(0,a.useMemo)((function(){return(0,o.Z)(d).sort(v)}),[d]),m=(0,h.Z)(),f=(0,r.Z)(m,4),p=f[0],b=f[1],y=f[3],w=d.length?"(".concat(d.length,")"):"";return a.createElement(i.Flex,{width:"100%",column:!0,overflow:"hidden",padding:[2,0]},a.createElement(i.Flex,{column:!0,gap:5},a.createElement(s.Z,{content:"Currently Active alerts",align:"bottom"},a.createElement(i.TextBig,{strong:!0,"data-testid":"nodeAlertsView-activeAlerts-header"},"Alerts ",w)),!d.length&&a.createElement(i.Flex,{column:!0,gap:8,padding:[0,5],"data-testid":"nodesAlertsView-blankSlate",alignItems:"center"},a.createElement(i.Icon,{name:"checkmark",width:"90px",height:"90px"}),a.createElement(i.H4,{textAlign:"center"},"This node has no active alerts, you are all good!"))),a.createElement(i.Flex,{column:!0,overflow:{vertical:"auto"}},u.map((function(e){return a.createElement(g,{key:e.id,alert:e,onAlertClick:b})}))),p&&y)}},64344:function(e,t,n){n.d(t,{Z:function(){return E}});var r=n(29439),o=n(67294),a=n(64969),i=n(97945),l=n(76184),c=n(32586),s=n(89050),d=function(e){var t=e.node.labels||{},n=t._cloud_instance_region,r=t._cloud_instance_type,a=t._cloud_provider_type;return(0,s.O2)(n)&&(0,s.O2)(r)&&(0,s.O2)(a)?null:o.createElement(l.Z,{name:"Cloud Instance Info"},o.createElement(c.Z,{iconName:"ipNetworking",name:"Cloud provider",size:"small",testId:"rightBar-nodeInfoContent-cloudProvider"},(0,s.MC)(a)),o.createElement(c.Z,{iconName:"universe",name:"Cloud region",size:"small",testId:"rightBar-nodeInfoContent-cloudRegion"},(0,s.MC)(n)),o.createElement(c.Z,{iconName:"disk",name:"Instance type",size:"small",testId:"rightBar-nodeInfoContent-instanceType"},(0,s.MC)(r)))},u=n(83925),m=n(11389),f=function(e){var t=e.node,n=(0,s.Q5)(t.state);return o.createElement(l.Z,{link:"https://learn.netdata.cloud/docs/agent/aclk",name:"Connection"},o.createElement(c.Z,{size:"small",name:"Status",iconName:"integrations",testId:"rightBar-connectionGroup-connectionStatus"},o.createElement(m.Z,{rawState:n})),o.createElement(c.Z,{size:"small",name:"Netdata Agent",iconName:"netdata",testId:"rightBar-connectionGroup-agentVersion"},t.version),t.updateSeverity&&o.createElement(c.Z,{size:"small",name:"Update Status",iconName:"update",testId:"rightBar-connectionGroup-agentVersion"},o.createElement(u.Z,{name:t.name,os:t.os.id,container:t.hw.container,warningLevel:t.updateSeverity,labels:t.labels||{},version:t.version,text:t.updateSeverity})))},p=(n(21249),n(57640),n(9924),n(18339)),g=function(e){var t;return(null===(t=p.D[e])||void 0===t?void 0:t.iconName)||"services"},h=function(e){var t,n=e.node;return null!==(t=n.services)&&void 0!==t&&t.length?o.createElement(l.Z,{link:"https://learn.netdata.cloud/docs/agent/collectors/collectors#service-and-application-collectors",name:"Services"},n.services.map((function(e){return o.createElement(c.Z,{size:"small",key:e,iconName:g(e),name:e,testId:"rightBar-ServicesGroup-service-".concat(e)})}))):null},v=(n(57327),n(41539),n(88449),n(2490),n(59849),n(47941),n(23157),function(e){var t=e.node,n=(void 0===t?{}:t).labels,r=void 0===n?{}:n,a=Object.keys(r).filter((function(e){return!e.startsWith("_")}));return o.createElement(l.Z,{link:"https://learn.netdata.cloud/guides/using-host-labels",name:"Host labels",isEnabled:a.length>0,noDataLabel:"No Data"},a.length>0&&a.map((function(e){return o.createElement(c.Z,{size:"small",key:e,name:e,testId:"rightBar-hostLabelsGroup-label"},r[e])})))}),b=(n(38862),n(52428)),y=function(e){var t=e.node;return o.createElement(l.Z,{name:"Files"},o.createElement(a.Flex,{gap:1,padding:[0,1],alignItems:"center"},o.createElement(a.Box,{sx:{fontWeight:"500",letterSpacing:"1px"},as:a.Text,color:"textLite"},"{;}"),o.createElement(a.TextSmall,null,"View node info in"),o.createElement(a.Flex,{cursor:"pointer",gap:1,onClick:(0,b.J)(JSON.stringify(t),{text:"JSON copied to clipboard"})},o.createElement(a.TextSmall,{color:"primary"},"json"),o.createElement(a.Icon,{color:"primary",size:"small",name:"copy"}))))},w=(0,o.memo)(y),E=function(e){var t,n=e.nodeIds,u=(0,i.Ne)(n),m=(0,r.Z)(u,1)[0],p=(0,s.jo)(m.container,m.virtualization);return o.createElement(a.Flex,{column:!0,gap:1,overflow:{horizontal:"hidden",vertical:"auto"},padding:[2,1,2,0],width:"100%"},o.createElement(a.TextBig,{strong:!0},"Info"),o.createElement(a.Flex,{column:!0,padding:[2,0,3],border:{side:"bottom",color:"borderSecondary"}},false,o.createElement(a.TextSmall,{"data-testid":"rightBar-nodeInfoContent-hostname",strong:!0},"Hostname: ",m.name)),o.createElement(f,{node:m}),o.createElement(d,{node:m}),o.createElement(l.Z,{name:"System info"},o.createElement(c.Z,{size:"small",name:"Type",iconName:"virtualization",testId:"rightBar-nodeInfoContent-type"},o.createElement(a.Pill,{hollow:!0,icon:p.icon,iconSize:p.iconSize,flavour:"neutral"},p.label)),o.createElement(c.Z,{size:"small",name:"O/S version",iconName:"database",testId:"rightBar-nodeInfoContent-osVersions"},(0,s.cB)(m.os.nm,m.os.v,", ")),o.createElement(c.Z,{iconName:"viewSingleNode",name:"Architecture",size:"small",testId:"rightBar-nodeInfoContent-architecture"},(0,s.MC)(m.hw.architecture)),!(null===(t=m.os)||void 0===t||!t.kernel)&&o.createElement(c.Z,{size:"small",name:"Kernel",iconName:"metrics_explorer",testId:"rightBar-nodeInfoContent-kernel"},(0,s.cB)(m.os.kernel.nm,m.os.kernel.v,", ")),o.createElement(c.Z,{size:"small",name:"CPU",iconName:"cpu",testId:"rightBar-nodeInfoContent-cpu"},(0,s.ys)(m.hw.cpuFrequency)," (",(0,s.MC)(m.hw.cpus,1===m.hw.cpus?"Core":"Cores"),")"),o.createElement(c.Z,{size:"small",name:"Memory",iconName:"ram",testId:"rightBar-nodeInfoContent-ram"},(0,s.MC)((0,s.yo)(m.hw.memory),"RAM")),o.createElement(c.Z,{size:"small",name:"Hard disk size",iconName:"disk",testId:"rightBar-nodeInfoContent-disk"},(0,s.yo)(m.hw.diskSpace))),o.createElement(v,{node:m}),o.createElement(h,{node:m}),o.createElement(w,{node:m}))}},67915:function(e,t,n){n.d(t,{Z:function(){return Zt}});n(92222);var r=n(67294),o=n(64969),a=n(78266),i=n(74059),l=n(95383),c=n(37518),s=(n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(15861)),d=n(4942),u=n(64687),m=n.n(u),f=n(4480),p=n(83338),g=n(8018);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,d.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=(0,f.CG)({key:"roomSettings",get:function(e){var t=e.id,n=e.key;return function(e){var r=(0,e.get)((0,p.Z)(t));return n?r[n]:r}},set:function(e){var t=e.id,n=e.key;return function(e,r){(0,e.set)((0,p.Z)(t),(function(e){return n?v(v({},e),{},(0,d.Z)({},n,r)):r}))}}}),y=function(e,t){return(0,f.sJ)(b({id:e,key:t}))},w=function(e,t){var n=y(e,t),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.key,r=t.shouldPersist,o=void 0===r||r,a=(0,f.Zl)(b({id:e,key:n})),i=(0,g.O9)(e);return(0,f._8)((function(t){var r=t.snapshot;return function(){var t=(0,s.Z)(m().mark((function t(l){var c;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a(l),o){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,r.getPromise(b({id:e}));case 5:return c=t.sent,t.prev=6,t.next=9,i({settings:v(v({},c),n?(0,d.Z)({},n,l):l)});case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(6),a(n?c[n]:c);case 14:case"end":return t.stop()}}),t,null,[[6,11]])})));return function(e){return t.apply(this,arguments)}}()}),[e,n,i])}(e,{key:t});return[n,r]},E=n(96929),x=n(36560),O=n(29439),C=(n(26699),n(32023),n(21249),n(57640),n(9924),n(88553)),k=n(29495),I=n(93433),Z=n(9058),j=(n(69826),n(31672),n(59461),n(74916),n(4723),n(89014)),S=function(e,t){return e&&e.getRoot().getChildren().find((function(e){return e.match({id:"nodes-".concat(t)})}))},P=n(16978),N=function(e){var t=e.id,n=e.roomId,o=e.nodeId,a=e.context,i=e.dimensions,l=(0,Z.e)(),c=(0,r.useMemo)((function(){var e=S(l,n),r=[t,o,a].join("-"),c=e.getNode({id:r});return c?(c.updateAttribute("selectedDimensions",i.map((function(e){return e.name}))),c):(c=l.makeChart({attributes:{id:r,nodesScope:[o],contextScope:[a],pixelsPerPoint:20,selectedDimensions:i.map((function(e){return e.name}))}}),e.appendChild(c),c)}),[a,t,o,n,l]);return r.createElement(P.Z,{chart:c,hasHeader:!1,hasFooter:!1,hasFilters:!1})},T=(0,r.memo)(N),D=n(71893),B=D.default.div.withConfig({displayName:"styled__ViewContainer",componentId:"sc-azglin-0"})(["position:absolute;top:0;bottom:0;left:0;right:0;padding-bottom:20px;"]),F=D.default.div.withConfig({displayName:"styled__TableContainer",componentId:"sc-azglin-1"})(["width:100%;height:100%;position:relative;"]),M=(0,D.default)(o.VirtualizedTable).withConfig({displayName:"styled__StyledTable",componentId:"sc-azglin-2"})(["padding:8px 16px;.table-head{z-index:10;margin-bottom:12px;top:0;position:sticky;background:",";z-index:100;}.table-body{position:relative;width:100%;}.column-head{&:not(:first-of-type):not(:last-of-type){border-right:1px solid ",";}}.table-row{background:",";border-bottom:1px solid ",";min-width:100%;width:auto !important;*{white-space:nowrap;}}.group-head{font-weight:bold;font-size:16px;font-style:normal;line-height:20px;display:flex;align-items:center;color:",";}.table-body{padding-bottom:0;}"],(0,o.getColor)("mainBackground"),(0,o.getColor)("border"),(0,o.getColor)("mainBackground"),(0,o.getColor)("border"),(0,o.getColor)("text")),A=(0,D.default)(o.Flex).attrs((function(){return{column:!0,gap:2,height:{min:14},padding:[3]}})).withConfig({displayName:"styled__CellContent",componentId:"sc-azglin-3"})([""]),_=D.default.div.withConfig({displayName:"styled__ChartsContainer",componentId:"sc-dcttle-0"})([""]),L=(0,D.default)(A).withConfig({displayName:"styled__Cell",componentId:"sc-dcttle-1"})(["position:relative;border-radius:0;padding:"," "," "," ",";justify-content:center;border-bottom:1px solid #f1f2f3;&:last-of-type{border-bottom:0;}"],(0,o.getSizeBy)(0),(0,o.getSizeBy)(0),(0,o.getSizeBy)(0),(0,o.getSizeBy)(1)),R=n(38626),z=function(e){var t=e.id,n=e.context,a=e.row,i=e.title,l=e.dimensions,s=a.original,d=(0,c.UL)();return s.isLive?r.createElement(_,null,r.createElement(R.Z,{text:i||n,maxLength:19,TextComponent:o.TextSmall,color:"textDescription",margin:[1,0,1,2],as:"div"}),r.createElement(L,{"data-testid":"chartCell-".concat(n)},r.createElement(T,{id:t,context:n,nodeId:s.id,roomId:d,dimensions:l}))):null},V=(n(82772),n(62200)),K=n(65211),H=n(3581),G=n(3322),U=n(89050),W=n(87462),q=n(45987),Q=n(4312),J=n(33335),$=n(46667),Y=n(82040),X=n(5633),ee=(0,D.default)(o.Button).attrs({flavour:"hollow",neutral:!0,tiny:!0}).withConfig({displayName:"styled__ActionButton",componentId:"sc-t0bp9o-0"})(["&&&{border-color:",";&:hover{background-color:",";}.button-icon{"," fill:",";}}"],(0,o.getColor)("nodeBadgeBorder"),(0,o.getColor)("nodeBadgeBackground"),(function(e){var t=e.iconSize;return t&&"\n height: ".concat(t,";\n width: ").concat(t,";\n ")}),(0,o.getColor)("textDescription")),te=(0,D.default)(ee).attrs({icon:"trashcan",iconSize:"15px"}).withConfig({displayName:"styled__ObsoleteButton",componentId:"sc-t0bp9o-1"})([""]),ne=(0,D.default)(ee).attrs({icon:"removeNode"}).withConfig({displayName:"styled__RemoveButton",componentId:"sc-t0bp9o-2"})([""]),re=(0,D.default)(o.Box).attrs({background:"placeholder",height:4,width:.25}).withConfig({displayName:"styled__InfoSeparator",componentId:"sc-t0bp9o-3"})([""]),oe=(0,D.default)(o.Flex).withConfig({displayName:"styled__NodeActions",componentId:"sc-t0bp9o-4"})(["display:none;margin-left:auto;"]),ae=(0,D.default)(o.Flex).attrs({margin:[0,-2,-2]}).withConfig({displayName:"styled__NodeChartsContainer",componentId:"sc-t0bp9o-5"})([""]),ie=(0,D.default)(o.Flex).attrs({alignItems:"center",gap:1}).withConfig({displayName:"styled__NodeNameContainer",componentId:"sc-t0bp9o-6"})(["&:hover{h5{color:#00ab44;text-decoration:underline;text-decoration-color:#00ab44;}svg{fill:#00ab44;}}"]),le=(0,D.default)(o.H5).attrs((function(e){var t=e.isLive;return{cursor:t?"pointer":"auto",color:t?"text":"textDescription"}})).withConfig({displayName:"styled__NodeName",componentId:"sc-t0bp9o-7"})([""]),ce=(0,D.default)(o.Flex).attrs({column:!0,gap:1,padding:[2],round:!0,width:"100%"}).withConfig({displayName:"styled__NodeRow",componentId:"sc-t0bp9o-8"})(["&:hover{background:",";","{display:flex;}}"],(0,o.getColor)("miniChartsContainer"),oe),se=["connectivity","id","name"],de=function(e){var t=e.connectivity,n=e.id,o=e.name,a=(0,q.Z)(e,se),i=(0,J.gI)("node:Delete"),l=!(0,c.Hm)().untouchable,s=(0,$.Z)(),d=(0,O.Z)(s,4),u=d[0],m=d[2],f=d[3],p=(0,$.Z)(),g=(0,O.Z)(p,4),h=g[0],v=g[2],b=g[3];return r.createElement(oe,(0,W.Z)({alignSelf:"end",gap:1,"data-testid":"node-actions"},a),l&&r.createElement(r.Fragment,null,r.createElement(Q.Z,{badge:"actionRemove","data-testid":"remove-node-action"},r.createElement(ne,{"data-ga":"nodes-table-row::click-remove-node::nodes-view",onClick:v})),h&&r.createElement(X.ZP,{ids:[n],name:o,onClose:b})),i&&"Offline"===t&&r.createElement(r.Fragment,null,r.createElement(Q.Z,{badge:"actionObsolete","data-testid":"obsolete-node-action"},r.createElement(te,{"data-ga":"nodes-table-row::click-obsolete-node::nodes-view",onClick:m})),u&&r.createElement(Y.ZP,{ids:[n],name:o,onClose:f})))},ue=n(39583),me=["instanceType","name","providerType"],fe=function(e){var t=e.instanceType,n=e.name,a=e.providerType,i=(0,q.Z)(e,me);return r.createElement(Q.Z,(0,W.Z)({badge:"cloudInfo","data-testid":"node-cloud-info",nodeName:n},i),r.createElement(o.Flex,{alignItems:"center",gap:1},r.createElement(o.Icon,{color:"textDescription","data-testid":"node-cloud-info-icon",name:"ipNetworking",width:"18px",height:"18px"}),r.createElement(o.TextSmall,{color:"textDescription","data-testid":"node-cloud-info-text"},(0,U.MC)(a)," \u2022 ",(0,U.MC)(t))))},pe=["connectivity","name"],ge=function(e){var t=e.connectivity,n=e.name,a=(0,q.Z)(e,pe);return r.createElement(Q.Z,(0,W.Z)({badge:"connectivity",connectivityState:t,"data-testid":"node-connectivity",nodeName:n},a),r.createElement(o.Icon,{name:"connectivityStatus".concat(t),width:"18px",height:"18px"}))},he=["onClick"],ve=function(e){var t=e.onClick,n=(0,q.Z)(e,he);return r.createElement(Q.Z,(0,W.Z)({badge:"info","data-testid":"node-info-cta"},n),r.createElement(o.Icon,{color:"textDescription",cursor:"pointer",height:"18px",width:"18px",name:"information",onClick:t}))},be=["name"],ye=function(e){var t=e.name,n=(0,q.Z)(e,be);return r.createElement(Q.Z,(0,W.Z)({badge:"k8s","data-testid":"node-kubernetes",nodeName:t},n),r.createElement(o.Flex,{alignItems:"center",gap:1},r.createElement(o.Icon,{color:"textDescription","data-testid":"node-kubernetes-icon",name:"serviceKubernetes",width:"18px",height:"18px"}),r.createElement(o.TextSmall,{color:"textDescription","data-testid":"node-kubernetes-text"},"k8s")))},we=["kernelName","kernelVersion","name"],Ee=function(e){var t=e.kernelName,n=e.kernelVersion,a=e.name,i=(0,q.Z)(e,we);return r.createElement(Q.Z,(0,W.Z)({badge:"kernel","data-testid":"node-kernel",nodeName:a},i),r.createElement(o.TextSmall,{color:"textDescription"},(0,U.cB)(t,n)))},xe=n(72233),Oe=n(79655),Ce=n(97945),ke=["id","state","isLive","name"],Ie=function(e){var t=e.isLive,n=e.name;return r.createElement(r.Fragment,null,r.createElement(le,{"data-testid":"node-name-text",isLive:t},n),r.createElement(o.Icon,{color:"placeholder","data-testid":"node-name-icon",name:"goToNode",width:"18px",height:"18px"}))},Ze=function(e){var t=e.id,n=e.state,o=e.isLive,a=e.name,i=(0,q.Z)(e,ke),l=(0,Ce.m3)(t);return"stale"===n||o?r.createElement(Oe.rU,(0,W.Z)({"data-testid":"node-name-link",to:l},i),r.createElement(ie,{"data-testid":"node-name-container"},r.createElement(Ie,{isLive:o,name:a}))):r.createElement(Ie,{isLive:o,name:a})},je=n(88866),Se=["architecture","cpuFrequency","cpus","diskSpace","memory","name","os","osName"],Pe=function(e){var t,n,a=e.architecture,i=e.cpuFrequency,l=e.cpus,c=e.diskSpace,s=e.memory,d=e.name,u=e.os,m=e.osName,f=(0,q.Z)(e,Se);return r.createElement(Q.Z,(0,W.Z)({badge:"systemInfo","data-testid":"node-system-info",nodeName:d},f),r.createElement(o.Flex,{alignItems:"center",gap:1},r.createElement(o.Icon,{color:"textDescription","data-testid":"node-system-info-icon",name:(null===(t=je._[m])||void 0===t?void 0:t.iconName)||(null===(n=je.V[u])||void 0===n?void 0:n.iconName)||"os",width:"16px",height:"16px"}),r.createElement(o.TextSmall,{color:"textDescription","data-testid":"node-system-info-text"},(0,U.MC)(m)," \u2022 ",(0,U.ys)(i)," \u2022"," ",(0,U.MC)(l,1===l?"Core":"Cores")," \u2022 ",(0,U.MC)(a)," ","\u2022 ",(0,U.MC)((0,U.yo)(s),"RAM")," \u2022"," ",(0,U.MC)((0,U.yo)(c),"HD"))))},Ne=["container","name","virtualization"],Te=function(e){var t=e.container,n=e.name,a=e.virtualization,i=(0,q.Z)(e,Ne),l=(0,U.jo)(t,a);return r.createElement(Q.Z,(0,W.Z)({badge:"type","data-testid":"node-type",nodeName:n,nodeType:l.label},i),r.createElement(o.Flex,{alignItems:"center",gap:1},r.createElement(o.Icon,{color:"textDescription","data-testid":"node-type-icon",name:l.icon,height:l.iconSize,width:l.iconSize}),r.createElement(o.TextSmall,{color:"textDescription","data-testid":"node-type-text"},l.label)))},De=n(83925),Be=[{id:"os",accessor:"os",show:!1},{id:"alertStatus",accessor:"alertStatus",show:!1},{id:"nodeStatus",accessor:"nodeStatus",show:!1},{id:"name",accessor:"name",show:!0,width:"full",InnerRow:function(e){var t,n,a=e.cell,i=e.children,l=e.row.original,c=l.name,s=l.hw,u=l.os,m=l.capabilities,f=l.container,p=l.updateSeverity,g=l.labels,h=l.id,v=l.isLive,b=l.state,y=l.version,w=null===(t=m.funcs)||void 0===t?void 0:t.enabled,E=null===(n=m.ml)||void 0===n?void 0:n.enabled,x=(0,U.Q5)(b),C=(0,K.d)(),k=(0,O.Z)(C,2)[1],I=(0,H.j)(V.$9),Z=(0,O.Z)(I,2)[1],j=g||{},S=j._cloud_instance_type,P=j._cloud_provider_type,N="true"===(null===g||void 0===g?void 0:g._is_k8s_node),T=!(0,U.O2)(S)||!(0,U.O2)(P),D=(0,r.useCallback)((function(e){k(h),Z((0,d.Z)({},h,V.Ku.indexOf(e)))}),[h]),B=(0,r.useCallback)((function(){return D("alerts")}),[D]),F=(0,r.useCallback)((function(){return D("info")}),[D]),M=(0,G.Eq)();return r.createElement(ce,{"data-testid":"nodeRow-".concat(a.value)},r.createElement(o.Flex,{alignItems:"center","data-testid":"nodeRow-basic-info",gap:2,height:{min:6}},r.createElement(ge,{connectivity:x,"data-testid":"nodeRow-connectivity-".concat(x.toLowerCase()),name:a.value}),r.createElement(re,{"data-testid":"nodeRow-separator"}),r.createElement(Ze,{"data-testid":"nodeRow-name",id:h,name:a.value,isLive:v,state:b}),r.createElement(re,{"data-testid":"nodeRow-separator"}),r.createElement(ve,{onClick:F,"data-testid":"nodeRow-more-info-cta"}),r.createElement(re,{"data-testid":"nodeRow-separator"}),r.createElement(ue.Z,{id:h,isLive:v,"data-testid":"nodeRow-alerts",name:a.value,onClick:B}),r.createElement(re,{"data-testid":"nodeRow-separator"}),r.createElement(xe.Z,{badge:"ml","data-testid":"nodeRow-machine-learning-status",enabled:E,name:a.value},r.createElement(o.Icon,{name:"anomaliesLens",size:"small",color:"text"})),r.createElement(re,{"data-testid":"nodeRow-separator"}),r.createElement(xe.Z,{badge:"fn","data-testid":"nodeRow-fn-status",enabled:w,name:a.value,onClick:function(){return M(h)}},r.createElement(o.Icon,{name:"functions",size:"small",color:"text"})),p&&r.createElement(r.Fragment,null,r.createElement(re,{"data-testid":"nodeRow-separator"}),r.createElement(De.Z,{name:c,os:u.id,container:f,warningLevel:p,labels:g,version:y,text:p,"data-testid":"nodeRow-needs-update"})),r.createElement(de,{"data-testid":"nodeRow-node-actions",id:h,name:a.value,connectivity:x})),r.createElement(o.Flex,{alignItems:"center","data-testid":"nodeRow-detailed-info",gap:2},r.createElement(Pe,{architecture:s.architecture,cpuFrequency:s.cpuFrequency,cpus:s.cpus,"data-testid":"nodeRow-system-info",diskSpace:s.diskSpace,memory:s.memory,name:a.value,osName:u.nm,os:u.id}),r.createElement(re,{"data-testid":"nodeRow-separator"}),!(null===u||void 0===u||!u.kernel)&&r.createElement(Ee,{"data-testid":"nodeRow-kernel",kernelName:u.kernel.nm,kernelVersion:u.kernel.v,name:a.value}),r.createElement(re,{"data-testid":"nodeRow-separator"}),N&&r.createElement(r.Fragment,null,r.createElement(ye,{"data-testid":"nodeRow-kubernetes",name:a.value}),r.createElement(re,{"data-testid":"nodeRow-separator"})),r.createElement(Te,{container:s.container,"data-testid":"nodeRow-type",name:a.value,virtualization:s.virtualization}),T&&r.createElement(r.Fragment,null,r.createElement(re,{"data-testid":"nodeRow-separator"}),r.createElement(fe,{"data-testid":"nodeRow-cloud-info",instanceType:S,name:a.value,providerType:P}))),i&&r.createElement(ae,{"data-testid":"nodeRow-charts"},i))}}],Fe=function(e){var t=e.map((function(e){return function(e){var t=e.id,n=e.hidden,o=e.context,a=e.title,i=e.dimensions;return{id:t||o,accessor:t||o,width:176,show:!n,disableGlobalFilter:!0,parentRow:"name",Cell:function(e){var n=e.row;return r.createElement(z,{id:t,context:o,row:n,title:a,dimensions:i})}}}(e)}));return[].concat(Be,(0,I.Z)(t))},Me=n(95248),Ae=function(e){var t=e.roomId,n=e.groupMode,o=(0,Me.H7)({extraKey:"nodesView"}),i=(0,Ce.Ne)(o),l=(0,r.useState)([]),c=(0,O.Z)(l,2),s=c[0],d=c[1],u=(0,k.uA)(t),m=(0,r.useRef)(),f=(0,r.useRef)(),p=(0,r.useMemo)((function(){return Fe(u)}),[u]),g=(0,r.useCallback)((function(e,t,n){var r=n.filteredNodeIds;return r.length<1?e:e.filter((function(e){var t=e.original;return r.includes(t.id)}))}),[]),h=(0,r.useMemo)((function(){return{sortBy:[{id:"name",desc:!1}],groupBy:[n],columnOrder:p.map((function(e){return e.id})),hiddenColumns:p.filter((function(e){return!e.show})).map((function(e){return e.id})),globalFilter:{filteredNodeIds:o}}}),[n,p,o]),v=(0,r.useMemo)((function(){return i.map((function(e){if(!e.isLive)return(0,U.oy)(e,j.Lo);var t=j.Id+j.m4+j.En;return(0,U.oy)(e,t)}))}),[i,h,u]);(0,r.useEffect)((function(){m.current&&v.length&&m.current.resetAfterIndex(0,!1)}),[v,s]);var b=(0,C.Z)(),y=(0,O.Z)(b,2),w=y[0],E=y[1],x=E.width,I=E.height,Z=(0,r.useCallback)((function(e,t){var n=e.overscanStartIndex,r=e.overscanStopIndex,o=(0,U.Aw)({orderedRows:t,start:n,end:r});d(o)}),[t]),S=(0,r.useMemo)((function(){return{width:x,height:I,itemSize:U.I$,variableSize:!0,overscanCount:j.d6,verticalGutter:j.En,itemKey:U._0,outerRef:f,onItemsRendered:Z}}),[x,I,Z]),P=v.length;return r.createElement(B,null,P?r.createElement(F,{ref:w},r.createElement(M,{callbackRef:m,columns:p,controlledState:h,data:v,groupsOrderSettings:j.Ho,hideHeader:!0,childrenInRow:!0,layoutType:"block",groupByFn:U.V3,globalFilter:g,virtualizedSettings:S,chartsPerNodeLimit:9})):r.createElement(a.Z,{title:"Loading nodes and charts..."}))},_e=n(91268),Le=n(73531),Re=n(92432),ze=n(53030),Ve=n(89149),Ke=n(16645),He=n(7693),Ge=n(92903),Ue=n(5429),We=n(40970),qe=n(89479),Qe=function(){},Je=function(e){var t=e.roomId,n=e.id,a=e.onRemove,i=void 0===a?Qe:a,l=(0,c.tE)(t,"name"),d=(0,k.xQ)(n,"title"),u=(0,k.c0)(t),f=(0,$.Z)(),p=(0,O.Z)(f,4),g=p[0],h=p[2],v=p[3],b=function(){var e=(0,s.Z)(m().mark((function e(){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u(n);case 2:i();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return r.createElement(r.Fragment,null,r.createElement(o.Button,{danger:!0,flavour:"hollow",onClick:h,label:"Delete metric","data-testid":"remove-metric"}),g&&r.createElement(o.ConfirmationDialog,{"data-ga":"remove-metric-dialog","data-testid":"removeMetricDialog",handleConfirm:b,handleDecline:v,message:r.createElement(r.Fragment,null,"You are about to remove ",r.createElement("strong",null,d)," metric.",r.createElement("br",null),"Are you sure you want to continue?"),title:"Remove metric from ".concat(l)}))},$e=["title","help","link","disclaimer","children"],Ye=function(e){var t=e.link,n=e.children;return r.createElement(o.Flex,{as:"a",target:"_blank",href:t,gap:1,alignItems:"end"},r.createElement(o.TextNano,{textDecoration:"undeline"},n),r.createElement(o.Icon,{color:"text",name:"question",width:"16px",height:"16px"}))},Xe=function(e){var t=e.title,n=e.help,a=e.link,i=e.disclaimer,l=e.children,c=(0,q.Z)(e,$e);return r.createElement(o.Flex,(0,W.Z)({gap:1,column:!0},c),r.createElement(o.Flex,{justifyContent:"between",alignItems:"baseline"},r.createElement(o.Text,{as:"label",margin:[0]},t),n&&r.createElement(Ye,{link:a},n)),l,i&&r.createElement(o.TextSmall,null,i))},et=n(26398),tt={value:"all",label:"All"},nt=function(e){var t=e.dimensions,n=e.units;return{dimensions:t?[tt].concat((0,I.Z)(t.map((function(e){return{value:e.id,label:e.name}})))):[tt],units:n}},rt=["spaceId","roomId","id","onClose"];function ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(n),!0).forEach((function(t){(0,d.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var it=function(e){var t=e.isNew;return r.createElement(o.Flex,{as:"span",gap:1},"Manage room",r.createElement(o.TextBig,{color:"textLite"},"/"),r.createElement(o.TextBig,{color:"textLite"},t?"Add":"Edit"," Metric"))},lt=function(e){var t=e.spaceId,n=e.roomId,a=e.id,i=e.onClose,l=(0,q.Z)(e,rt),c="new"===a,s=(0,k.jN)(a),d=(0,k.Y6)(n,{shouldPersist:!1}),u=(0,k.xQ)(a),m=(0,r.useRef)(u),f=u.title,p=u.context,g=u.dimensions,h=void 0===g?[]:g,v=function(){d(a,m.current),i()};(0,r.useEffect)((function(){c&&s()}),[]);var b=(0,Me.TA)({extraKey:"nodesView"}),y=(0,We.Z)(n,b,{spaceId:t});if(y)throw y;var w=(0,qe.jg)(n),E=(0,r.useMemo)((function(){return w.map((function(e){return{value:e,label:e}}))}),[w]),x=(0,qe.hH)(n),C=(0,r.useMemo)((function(){return p&&{value:p,label:p}}),[p]),I=(0,Ue.Z)((function(){return{enabled:!!p,fetch:function(){return function(e,t,n){return et.Z.get("".concat(V.li,"/spaces/").concat(e,"/rooms/").concat(t,"/contexts/").concat(encodeURIComponent(n)),{transform:nt})}(t,n,p)},initialValue:{dimensions:[],units:""}}}),[t,n,p]),Z=(0,O.Z)(I,2),j=Z[0],S=j.dimensions,P=j.units,N=Z[1],T=(0,r.useCallback)((function(e){var t=e.value;d(a,"context",t),d(a,"dimensions",[]),d(a,"title",t)}),[a]),D=(0,r.useMemo)((function(){return S?1===S.length||h.length===S.length-1||0===h.length?[tt]:h.map((function(e){return{value:e.id,label:e.name}})):[tt]}),[h,S]),B=(0,r.useCallback)((function(e){var t=e.filter((function(e){return e.value!==tt.value})),n=(0===e.length||t.length!==e.length&&0!==h.length||t.length===S.length-1?[]:t).map((function(e){return{id:e.value,name:e.label}}));d(a,"dimensions",n)}),[a,h,S]),F=(0,k.VP)(n),M=(0,r.useCallback)((function(){return F(at(at({},u),{},{id:a,enableAllDimensions:0===h.length,unit:P})).then(i)}),[u]),A=(0,r.useCallback)((function(e){var t=e.target.value;t.length<=30&&d(a,"title",t)}),[a]),_=!f||!p||N||!x;return r.createElement(Ke.u6,(0,W.Z)({right:!0,closeOnEsc:!0,closeOnOverlayClick:!0,onClose:v},l),r.createElement(He.x,{onClose:v,title:r.createElement(it,{isNew:c})},r.createElement(o.Button,{label:"Save",onClick:M,disabled:_})),r.createElement(Ge.B,null,c?"Add a new metric (column)":"Edit metric"),r.createElement(Ke.TZ,null,r.createElement(o.Flex,{gap:6,column:!0},r.createElement(Xe,{title:"Context",help:"What is a context?",link:"https://learn.netdata.cloud/docs/data-collection/chart-dimensions-contexts-and-families#context","data-testid":"manageMetrics-context"},r.createElement(o.Select,{options:E,value:C,onChange:T,isLoading:!x,"data-testid":"manageMetrics-contextSelect"})),r.createElement(Xe,{title:"Metric Title","data-testid":"manageMetrics-title"},r.createElement(o.TextInput,{name:"title",placeholder:"Type name",value:f,onChange:A,metaShrinked:!0})),r.createElement(Xe,{title:"Dimensions",help:"What is a dimension?",link:"https://learn.netdata.cloud/docs/data-collection/chart-dimensions-contexts-and-families#dimension",disclaimer:D[0]===tt&&"The returned value is the sum of all selected dimensions.","data-testid":"manageMetrics-dimensions"},r.createElement(o.Select,{isMulti:!0,options:S,value:D,onChange:B,isLoading:N,isDisabled:!C,"data-testid":"manageMetrics-dimensionSelect"})),!c&&r.createElement(o.Flex,{justifyContent:"end"},r.createElement(Je,{roomId:n,id:a,onRemove:i})))))},ct=(0,D.default)(o.Checkbox).withConfig({displayName:"styled__Checkbox",componentId:"sc-1czrg41-0"})(["color:",";font-size:12px;margin-left:",";width:100%;> span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:",";}"],(0,o.getColor)("text"),(0,o.getSizeBy)(0),(0,o.getSizeBy)(25)),st=(0,D.default)(o.Flex).attrs({height:"1px",margin:[4,0]}).withConfig({displayName:"styled__Divider",componentId:"sc-1czrg41-1"})(["background-color:rgba(0,0,0,0.12);"]),dt=(0,D.default)(o.ListItem).withConfig({displayName:"styled__ListItem",componentId:"sc-1czrg41-2"})(["align-items:center;display:flex;flex-direction:row;font-size:",";justify-content:space-between;padding-left:",";"],(0,o.getSizeBy)(3),(0,o.getSizeBy)(0)),ut=(0,D.default)(o.Drop).attrs({align:{top:"bottom",right:"right"},animation:!0,background:"dropdown",column:!0,margin:[.5,0,0],overflow:{vertical:"auto"},padding:[4],round:1,width:70}).withConfig({displayName:"styled__MetricsDropdown",componentId:"sc-1czrg41-3"})(["box-sizing:content-box;"]),mt=(0,D.default)(o.Button).attrs({neutral:!0,flavour:"borderless",small:!0}).withConfig({displayName:"styled__OptionButton",componentId:"sc-1czrg41-4"})(["&&&{font-size:14px;font-weight:normal;justify-content:flex-start;padding-left:",";}"],(0,o.getSizeBy)(2)),ft=(0,D.default)(o.Button).withConfig({displayName:"styled__PencilButton",componentId:"sc-1czrg41-5"})(["> svg.button-icon{width:",";height:",";opacity:0;}"],(0,o.getSizeBy)(4),(0,o.getSizeBy)(4)),pt=(0,D.default)(o.Button).withConfig({displayName:"styled__MetricsButton",componentId:"sc-1czrg41-6"})(["&&&{width:100%;}"]),gt=function(e){var t=e.isOpen,n=e.onClose,o=e.onEdit,a=e.roomId,i=e.targetRef,l=(0,k.dh)(a),c=(0,O.Z)(l,2),s=c[0],d=c[1];if(!i.current||!t)return null;var u=function(e){o(e),n()};return r.createElement(ut,{close:n,"data-testid":"metricsMenu",onClickOutside:n,onEsc:n,target:i.current},s.map((function(e){return r.createElement(dt,{"data-testid":"metricsMenu-metric-".concat(e.title),key:e.id},r.createElement(ct,{checked:!e.hidden,"data-testid":"metricsMenu-metricCheckbox",label:e.title,onChange:function(){return d(e.id,"hidden",!e.hidden)}}),r.createElement(ft,{"data-testid":"metricsMenu-editMetric",flavour:"borderless",icon:"pencilSolid",neutral:!0,onClick:function(){return u(e.id)}}))})),s.length>0&&r.createElement(st,{"data-testid":"metricsMenu-divider"}),r.createElement(dt,{"data-testid":"metricsMenu-addMetricItem"},r.createElement(pt,{"data-testid":"metricsMenu-addMetricButton",label:"Add new metric",icon:"plus",onClick:function(){return u("new")},small:!0})))},ht=function(e){var t=e.spaceId,n=e.roomId,a=(0,$.Z)(),i=(0,O.Z)(a,4),l=i[0],c=i[2],s=i[3],d=(0,r.useState)(null),u=(0,O.Z)(d,2),m=u[0],f=u[1],p=(0,r.useRef)();return r.createElement(r.Fragment,null,r.createElement(o.Button,{"data-ga":"metric-setting::click-metric-setting::hm-nodes","data-testid":"metricSettings-button",flavour:"hollow",icon:"gear",neutral:!0,onClick:c,ref:p,label:"Metrics",small:!0}),r.createElement(gt,{isOpen:l,onClose:s,onEdit:f,roomId:n,targetRef:p}),m&&r.createElement(lt,{"data-testid":"metricsManagement",spaceId:t,roomId:n,id:m,onClose:function(){return f(null)}}))},vt=n(38671);function bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(n),!0).forEach((function(t){(0,d.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wt=function(){return(0,Re.L)("grouping","click-grouping","hm-nodes")},Et=[{icon:"node",label:"Node status",value:"nodeStatus","data-ga":"grouping::click-grouping-node-status::hm-nodes"},{icon:"alarm_bell",label:"Alert status",value:"alertStatus","data-ga":"grouping::click-grouping-status::hm-nodes"}],xt={Option:function(e){var t=e.innerProps,n=e.data,o=e.isSelected;return r.createElement(mt,(0,W.Z)({},n,t,{active:o}))}},Ot={control:function(e){return yt(yt({},e),{},{height:32,minHeight:32,width:160})},indicatorSeparator:function(){return{display:"none"}},dropdownIndicator:function(e){return yt(yt({},e),{},{height:20,minHeight:20,paddingRight:4,paddingTop:0,paddingBottom:0})},valueContainer:function(e){return yt(yt({},e),{},{paddingTop:0,paddingBottom:0})}},Ct=function(){var e=(0,i.th)(),t=(0,c.UL)(),n=(0,$.Z)(),a=(0,O.Z)(n,4),l=a[0],s=a[2],d=a[3],u=(0,vt.Z)().onIntegrationsClick,m=w(t,"groupMode"),f=(0,O.Z)(m,2),p=f[0],g=f[1],h=(0,r.useMemo)((function(){return Et.find((function(e){return e.value===p}))||Et[0]}),[p]),v=(0,r.useCallback)((function(e){var t=e.value;return g(t)}),[g]);return r.createElement(o.Flex,{alignItems:"center","data-testid":"agentsHead-actions",flexWrap:!1,gap:3},r.createElement(o.Select,{components:xt,label:"Group by",onChange:v,onMenuOpen:wt,options:Et,styles:Ot,value:h}),r.createElement(ht,{roomId:t,spaceId:e}),r.createElement(o.Button,{icon:"integrations",flavour:"hollow",onClick:u,small:!0},"Integrations"),l&&r.createElement(Ve.Z,{onClose:d}),r.createElement(ze.Z,{"data-ga":"add-nodes::click-add-nodes::hm-nodes","data-testid":"agentsHead-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:s,small:!0}))},kt=n(20046),It=function(e){var t=e.children;return r.createElement(o.Flex,{width:"100%",justifyContent:"between",background:"mainBackground",padding:[2,4]},r.createElement(kt.Z,null),r.createElement(o.Box,{padding:[2,0],sx:{marginLeft:"auto"}},t))},Zt=function(){var e=(0,i.th)(),t=(0,c.UL)(),n=y(t,"groupMode"),s=(0,E.zN)(),d=(0,i.Q6)();!function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).host,n=(0,Z.e)(),o=(0,r.useRef)();(0,r.useMemo)((function(){if(n){var r=S(n,e);r&&r.destroy(),r=n.makeContainer({attributes:{host:t,enabledXAxis:!1,id:"nodes-".concat(e),hasToolbox:!1,height:"".concat(j.m4,"px"),groupingMethod:"average",groupBy:["dimension"],aggregationMethod:"avg",legend:!1,axisLabelFontSize:7,yAxisLabelWidth:20,hasYlabel:!1}}),o.current=r,n.appendChild(r)}}),[e]),(0,r.useLayoutEffect)((function(){return function(){return o.current&&o.current.destroy()}}),[])}(t,{host:d?"".concat(window.envSettings.agentApiUrl,"/api/v2"):"".concat(window.envSettings.apiUrl,"/api/v3/spaces/").concat(e,"/rooms/").concat(t)});var u=(0,l.y3)(e,"loaded"),m=(0,E.X7)(t,"loaded"),f=(0,c.tE)(t,"fullyLoaded"),p=d?!m:!u||!m||!f;return m&&!s.length?r.createElement(x.Z,null):r.createElement(_e.Z,{rightBar:r.createElement(Le.Z,null),gap:1},r.createElement(It,null,r.createElement(Ct,null)),r.createElement(o.Flex,{column:!0,"data-testid":"agents",flex:!0},r.createElement(o.Flex,{"data-testid":"agents-content",flex:!0,position:"relative"},p?r.createElement(a.Z,{title:"Loading nodes..."}):r.createElement(Ae,{spaceId:e,roomId:t,groupMode:"services"===n?"nodeStatus":n}))))}},65211:function(e,t,n){n.d(t,{d:function(){return l}});var r=n(93433),o=(n(92222),n(4480)),a=n(77823),i=(0,o.cn)({key:"selectedNode",default:null}),l=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).resetOnUnmount,t=void 0!==e&&e,n=(0,o.rb)(i);return(0,a.Z)((function(){t&&n()})),[].concat((0,r.Z)((0,o.FV)(i)),[n])}},3581:function(e,t,n){n.d(t,{j:function(){return s}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(4480);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=(0,o.xu)({key:"selectedTab",default:{}}),c=(0,o.CG)({key:"selectedTabsState",get:function(e){var t=e.id,n=e.key;return function(e){var r=(0,e.get)(l(t));return n?r[n]:r}},set:function(e){var t=e.id,n=e.key;return function(e,r){(0,e.set)(l(t),(function(e){return{id:t,selectedTabs:i(i({},e[n]),r)}}))}}}),s=function(e,t){var n,r,a="selectedTabs",i=(n=e,r=a,(0,o.sJ)(c({id:n,key:r}))),l=(i?i[t]:0)||0,s=function(e,t){return(0,o.Zl)(c({id:e,key:t}))}(e,a);return[l,s,i]}},2077:function(e,t,n){n.d(t,{mt:function(){return k},yp:function(){return C},VG:function(){return x},d5:function(){return I},$g:function(){return O}});n(82526),n(57327),n(88449),n(59849),n(38880),n(49337),n(33321),n(69070);var r=n(29439),o=n(4942),a=(n(92222),n(85827),n(41539),n(25387),n(2490),n(72608),n(47941),n(15581),n(34514),n(54747),n(82772),n(26699),n(32023),n(61874),n(9653),n(67294)),i=n(4480),l=n(95248),c=n(18761),s={byContext:{},loaded:!1,loading:!1,method:null,options:null,group:"average",totalDimensionsCount:0},d=(0,i.xu)({key:"weights",default:s});function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=(0,i.CG)({key:"weightsState",get:function(e){return function(t){return(0,t.get)(d(e))}},set:function(e){return function(t,n){return(0,t.set)(d(e),n)}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),p={ci:"context",ni:"node",ii:"instance",di:"dimension"},g=function(e,t){return function(n){return(0,o.Z)({},p[e.name],t[e.dictionary][n])}},h={ni:g,ii:function(e,t){return function(n,r,a){return(0,o.Z)({},p[e.name],t[e.dictionary][n]?"".concat(t[e.dictionary][n],"@").concat(t.nodes[r[a.ni]]):null)}},ci:g,di:g,row_type:function(e){return function(t){return{type:e.value[t]}}},weight:function(){return function(e){return{weight:e}}},timeframe:function(e){return function(t){return{highlight:e.labels.reduce((function(e,n,r){return m(m({},e),{},(0,o.Z)({},n,t[r]))}),{})}}},"baseline timeframe":function(e){return function(t){return{baseline:e.labels.reduce((function(e,n,r){return m(m({},e),{},(0,o.Z)({},n,t[r]))}),{})}}}},v={contexts:"ci",nodes:"ni",instances:"ii",dimensions:"di"},b={contexts:"id",nodes:"nodeId",instances:"id",dimensions:"id"},y=function(e,t){return null===e||e>t?t:e},w=function(e,t){return null===e||e<t?t:e},E=function(e){var t=e.flavour,n=e.data,r=e.aggregation,o=e.options,a={},i=0;if("rhs"==t){var l,c=(null===(l=n.v_schema)||void 0===l?void 0:l.items)||[];a=n.result.reduce((function(e,t){var n=t.id,o=t.v;return e[n]=c.reduce((function(e,t,n){var a=t.name,i=t.labels.indexOf(r);return e[a]=o[n][i],e}),{}),e}),{})}else{var s=function(e){var t=Object.keys(e.dictionaries).reduce((function(t,n){t[n]||(t[n]={});var r=b[n];return e.dictionaries[n].forEach((function(e){return t[n][e[v[n]]]="nodeId"===r?e.nd||e.mg:e[r]})),t}),{}),n={},r=e.schema.items.reduce((function(e,r,o){var a=(h[r.name]||h.default)(r,t);return e.push(a),n[r.name]=o,e}),[]);return function(e){return e.reduce((function(t,o,a){return m(m({},t),r[a](o,e,n))}),{})}}(n);a=n.result.reduce((function(e,t){var n=s(t),r=n.dimension,a=n.node,l=n.context,c=n.instance,d=n.type,u=n.weight,m=n.highlight,f=n.baseline;if("node"===d)return e;var p,g,h=(p=e,g=l,function(e,t,n,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:y;n&&(n&&"undefined"===typeof p[g][t][n]&&(p[g][t][n]={}),"undefined"===typeof p[g][t][n][e]&&(p[g][t][n][e]=null),r&&(p[g][t][n][e]=a(p[g][t][n][e],o)))});e[l]||(e[l]={dimensions:{},instances:{},nodes:{},weight:null});var v=!!o&&o.includes("anomaly-bit");h("weight","dimensions",r,"dimension"===d,u,v?w:y),h("weight","instances",c,"instance"===d,u,v?w:y),h("weight","nodes",a,"node"===d,u,v?w:y);var b=m?100*m.anomaly_count/m.count:0;h("arHighlight","dimensions",r,"dimension"===d,b,w),h("arHighlight","instances",c,"instance"===d,b,w),h("arHighlight","nodes",a,"node"===d,b,w);var E=f?100*(f.anomaly_count-m.anomaly_count)/(f.count-m.count)===0?1:f.count-m.count:0;h("arBaseline","dimensions",r,"dimension"===d,E,w),h("arBaseline","instances",c,"instance"===d,E,w),h("arBaseline","nodes",a,"node"===d,E,w);var x=E?b/E:0;return h("score","dimensions",r,"dimension"===d,x,w),h("score","instances",c,"instance"===d,x,w),h("score","nodes",a,"node"===d,x,w),"context"===d?e[l].weight=null===e[l].weight||e[l].weight>u?u:e[l].weight:"dimension"===d&&(i+=1),e}),{})}return{byContext:a,totalDimensionsCount:i}},x=function(e,t,n){var r=(0,a.useRef)();return[(0,i._8)((function(o){var a=o.set;return function(o){var i=o.flavour,l=o.highlightAfter,d=o.highlightBefore,u=o.baselineAfter,p=o.baselineBefore,g=o.method,h=o.options,v=o.group,b=o.context,y=o.nodeIds,w=o.aggregation,x=o.groupBy;return a(f(e),m(m({},s),{},{loading:!0})),r.current&&r.current.cancel(),r.current=(0,c.B3)(t,n,{highlightAfter:l,highlightBefore:d,baselineAfter:u,baselineBefore:p,method:g,options:h,group:v,context:b,nodeIds:y,aggregation:w,groupBy:x}),r.current.then((function(t){var n=t.data,r=E({flavour:i,data:n,aggregation:w,options:h}),o=r.byContext,l=r.totalDimensionsCount;a(f(e),{loading:!1,loaded:!0,byContext:o,options:h,totalDimensionsCount:l,method:g,group:v,error:null})})).catch((function(t){var n;if(!t.isCancel)throw a(f(e),m(m({},s),{},{error:(null===t||void 0===t||null===(n=t.response)||void 0===n?void 0:n.data)||t})),t}))}}),[e]),(0,i._8)((function(t){var n=t.reset;return function(){r.current&&r.current.cancel(),n(f(e))}}),[e])]},O=function(e){return(0,i.sJ)(f(e))},C=function(e){return(0,i.rb)(f(e))},k=.01,I=function(e,t,n){var o=x(e,t,n),i=(0,r.Z)(o,2),c=i[0],s=i[1],d=O(e),u=d.loaded,f=d.loading,p=d.byContext,g=d.totalDimensionsCount,h=d.options,v=function(){var e=(0,l.by)("threshold");return e?Number.parseFloat(e):k}(),b=(0,a.useMemo)((function(){var e=0,t=null===h||void 0===h?void 0:h.includes("raw"),n=Object.keys(p).reduce((function(n,r){var o=Object.keys(p[r].dimensions).reduce((function(e,n){return!t&&p[r].dimensions[n].weight>v||(e[n]=p[r].dimensions[n]),e}),{}),a=Object.keys(o).length;return e+=a,a?(n[r]=m(m({},p[r]),{},{dimensions:o}),n):n}),{});return[n,Object.keys(n),e]}),[u,v]),y=(0,r.Z)(b,3),w=y[0],E=y[1],C=y[2];return{threshold:v,metadata:w,contexts:E,dimensionsCount:C,totalDimensionsCount:g,loaded:u,loading:f,getWeights:c,resetWeights:s}}},89479:function(e,t,n){n.d(t,{W2:function(){return p},Q7:function(){return x},PP:function(){return w},dA:function(){return E},Ni:function(){return I},pT:function(){return Z},MS:function(){return k},If:function(){return j},jg:function(){return b},QX:function(){return y},hH:function(){return g},Cd:function(){return O},qU:function(){return h},z3:function(){return C},w4:function(){return v}});n(82526),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(93433),o=n(4942),a=(n(47941),n(66992),n(41539),n(70189),n(78783),n(88921),n(96248),n(13599),n(11477),n(64362),n(15389),n(90401),n(45164),n(91238),n(54837),n(87485),n(56767),n(76651),n(61437),n(35285),n(39865),n(33948),n(92222),n(85827),n(25387),n(2490),n(72608),n(64211),n(41874),n(67294)),i=n(4480),l=n(37394),c=n(37518),s=n(41331),d={ids:(0,i.xu)({key:"roomChartIds",default:[]}),updatedAt:(0,i.xu)({key:"roomChartsUpdatedAt",default:""}),loaded:(0,i.xu)({key:"roomChartsLoaded",default:!1}),error:(0,i.xu)({key:"roomChartsError",default:null}),versions:(0,i.xu)({key:"versions",default:{}})};function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=(0,i.xu)({key:"roomsChartBatchState",default:{}}),p=(0,i.CG)({key:"roomChartState",get:function(e){var t=e.id,n=e.key;return function(e){return(0,e.get)(d[n](t))}},set:function(e){var t=e.id,n=e.key;return function(e,r){(0,e.set)(d[n](t),r)}}}),g=function(e){return!!(0,i.sJ)(p({id:e,key:"loaded"}))},h=function(e){return(0,i.sJ)(p({id:e,key:"versions"}))},v=function(e){var t=(0,i.Zl)(p({id:e,key:"versions"}));return(0,a.useCallback)((function(e){return t((function(t){return e="function"===typeof e?e(t):e,(0,s.ZP)(t,e,{omit:["contextsSoftHash"]})?t:e}))}),[])},b=function(e){return(0,i.sJ)(p({id:e,key:"ids"}))},y=function(e,t){return(0,i.sJ)(p({id:e,key:t}))},w=(0,i.CG)({key:"roomChartsState",get:function(e){var t=e.id,n=e.key;return function(e){var r=(0,e.get)(f(t))||l.ak;return n?r[n]:r}},set:function(e){var t=e.id,n=e.key;return function(e,r){var a=e.set;"function"!==typeof r?Object.keys(r).length<1||a(f(t),(function(e){return m(m({},e),{},(0,o.Z)({},n,r))})):a(f(t),(function(e){return m(m({},e),{},(0,o.Z)({},n,r(e[n])))}))}}}),E=(0,i.CG)({key:"roomChartsState/ids",get:function(e){var t=e.roomId;return function(e){return(0,e.get)(d.ids(t))}},set:function(e){var t=e.roomId,n=e.merge,o=void 0===n||n;return function(e,n){(0,e.set)(d.ids(t),(function(e){var t=o?(0,r.Z)(new Set([].concat((0,r.Z)(n),(0,r.Z)(e)))):n;return(0,s.ZP)(t,e)?e:t}))}}}),x=(0,i.CG)({key:"roomChartsState/initialize",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.id,n=e.merge,r=void 0===n||n;return function(e,n){var o=e.set,a=n.values,i=n.merge;o(f(t),(function(e){var t=Object.keys(a).reduce((function(t,n){var o=a[n].id;return t[o]=m(m(m(m({},l.ak),(r||i)&&e[o]),a[n]),{},{loaded:!0}),t}),m({},e));return r&&(0,s.ZP)(t,e,{omit:["lastEntry","firstEntry","family"]})?e:t}))}}}),O=function(e,t){return(0,i.sJ)(w({id:e,key:t}))},C=function(e){return(0,i._8)((function(t){var n=t.set;return function(t){return n(f(e),t)}}),[])},k=function(e,t){return(0,i._8)((function(n){var r=n.snapshot;return function(n){return m(m({},r.getLoadable(w({id:e,key:n})).contents),(null===t||void 0===t?void 0:t[n])||{})}}),[e,t])},I=function(e){var t,n,r,o=(0,c.UL)(),a=(0,i.sJ)(f(o));return(null===(t=a[e])||void 0===t?void 0:t.visible)&&!(null!==(n=a[e])&&void 0!==n&&n.filteredOut)&&!(null!==(r=a[e])&&void 0!==r&&r.hidden)},Z=function(e){var t=(0,c.UL)(),n=(0,i.sJ)(f(t));return e.some((function(e){var t,r,o;return(null===(t=n[e])||void 0===t?void 0:t.visible)&&!(null!==(r=n[e])&&void 0!==r&&r.filteredOut)&&!(null!==(o=n[e])&&void 0!==o&&o.hidden)}))},j=function(){var e=(0,c.UL)(),t=(0,i.sJ)(f(e));return(0,a.useCallback)((function(e){return e.some((function(e){var n,r,o;return(null===(n=t[e])||void 0===n?void 0:n.visible)&&!(null!==(r=t[e])&&void 0!==r&&r.filteredOut)&&!(null!==(o=t[e])&&void 0!==o&&o.hidden)}))}),[e,t])}},20046:function(e,t,n){n.d(t,{Z:function(){return y}});var r=n(29439),o=(n(92222),n(21249),n(57640),n(9924),n(57327),n(41539),n(88449),n(2490),n(59849),n(67294)),a=n(93433),i=(n(26699),n(32023),n(64969)),l=n(27856),c=n(82351),s=function(e){var t=e.message,n=e.children,s=e.warningMessage,d=(0,o.useRef)(),u=(0,o.useRef)([]),m=(0,i.useNavigationArrow)(d,u,n,!0),f=(0,r.Z)(m,3),p=f[0],g=f[1],h=f[2];(0,o.useEffect)((function(){if(d.current){var e=d.current,t=(0,l.D)(300,(function(){h()}));return t(),e.addEventListener("scroll",h),window.addEventListener("resize",t),function(){e.removeEventListener("scroll",h),window.removeEventListener("resize",t)}}}),[n]);var v=(0,o.useCallback)((function(e){e&&(u.current.includes(e)||(u.current=[].concat((0,a.Z)(u.current),[e])),n.length<u.current.length&&(u.current=u.current.filter((function(t){return t.getAttribute("data-testid")===e.getAttribute("data-testid")}))))}),[n]),b=(0,o.useMemo)((function(){return o.Children.map(n,(function(e,t){var n="tab-".concat(t);return o.cloneElement(e,{key:n,ref:v})}))}),[n]);return o.createElement(i.Flex,{"data-testid":"selected-nodes-container",alignItems:"center",width:"100%"},o.createElement(i.Flex,{alignItems:"center"},o.createElement(i.TextSmall,{whiteSpace:"nowrap","data-testid":"selected-nodes-container-message",color:"primary"},t,":"),s&&o.createElement(i.Flex,{padding:[0,1,0],margin:[0,0,1],justifyContent:"center"},o.createElement(c.Z,{plain:!0,content:s,align:"bottom"},o.createElement(i.Icon,{width:"16px",height:"16px","data-testid":"selected-nodes-container-warning-icon",color:"warningText",name:"warning_triangle_hollow"})))),p&&o.createElement(i.Flex,{"data-testid":"selected-nodes-arrowLeft",cursor:"pointer",onClick:function(e){e.preventDefault();var t=d.current;t.scrollTo({left:t.scrollLeft-200,behavior:"smooth"})},padding:[2]},o.createElement(i.Icon,{name:"navLeft",color:"text",width:8,height:8})),o.createElement(i.Flex,{ref:d,overflow:"hidden",padding:[1],gap:1},b),g&&o.createElement(i.Flex,{"data-testid":"selected-nodes-arrowRight",cursor:"pointer",onClick:function(e){e.preventDefault();var t=d.current;t.scrollTo({left:t.scrollLeft+200,behavior:"smooth"})},padding:[2]},o.createElement(i.Icon,{name:"navRight",color:"text",width:8,height:8})))},d=(0,o.memo)(s),u=n(91008),m=function(e){var t=e.onClose,n=e.id;return o.createElement(i.Box,{"data-testid":"selected-node-item-remove-button-".concat(n),sx:{marginLeft:"auto"},as:i.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"border",position:"absolute",right:"2px"})},f=(0,o.forwardRef)((function(e,t){var n=e.tooltipText,r=e.onClose,a=e.id,l=e.showToolTip,c=e.onClickAnchor,s=e.displayText,d=e.isAnchorDisabled;return o.createElement(i.Flex,{width:"100%",ref:t,"data-testid":"selected-node-item-".concat(a)},o.createElement(i.Pill,{background:"nodeBadgeBackground",padding:[0],borderColor:"nodeBadgeBackground"},o.createElement(i.Flex,{position:"relative",width:{max:"300px"},gap:2,alignItems:"center",padding:[1,4,1,2]},o.createElement(u.Z,{Component:i.TextSmall,showToolTip:l,content:n,align:"bottom",isBasic:!0,disabled:d,onClick:c,cursor:"pointer",color:"text",hoverColor:"primary",visitedColor:"accent",disabledColor:"textLite"},s),o.createElement(m,{onClose:r,id:a}))))})),p=n(64637),g=n(95248),h=n(97945),v=n(82902),b=(0,o.forwardRef)((function(e,t){var n=e.onRemove,r=e.nodeId,a=(0,h.bV)(r,"name"),i=(0,h.bV)(r,"isOffline"),l=(0,p.a)(a,30),c=(0,h.WR)(r);return o.createElement(f,{onClose:n,id:r,displayText:l,tooltipText:a,showToolTip:l!==a,isAnchorDisabled:i,onClickAnchor:c,ref:t})})),y=(0,o.memo)((function(){var e=(0,g.wT)(),t=(0,r.Z)(e,2),n=t[0],a=t[1],l=(0,g.H7)(),c=(0,h.Mm)(l);if(!((null===n||void 0===n?void 0:n.length)>0))return o.createElement("div",null);var s=c.length!==l.length?"Some of the nodes you have selected are unreachable, therefore their metrics are not included in the charts.":"";return o.createElement(i.Flex,{width:"100%",overflow:"hidden"},o.createElement(d,{warningMessage:s,message:"You have selected ".concat(l.length," ").concat((0,v.V6)(l.length))},l.map((function(e){return o.createElement(b,{key:e,onRemove:function(){return a(n.filter((function(t){return t!==e})))},nodeId:e})}))))}))},4571:function(e,t,n){n.d(t,{Z:function(){return Ot}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(87462),o=n(29439),a=n(4942),i=n(67294),l=n(89250),c=n(74662),s=n(36560),d=n(2077),u=n(5441),m=n(25517),f=n(95248),p=n(45987),g=n(64969),h=(n(26699),n(32023),n(92222),n(39714),n(71893)),v=n(48286),b=n(92432),y=n(82351),w=n(97945),E=n(74059),x=n(37518),O=(n(69826),h.default.div.withConfig({displayName:"selections__Separator",componentId:"sc-1cc7y18-0"})(["width:1px;height:",";background:",";"],(0,g.getSizeBy)(2.5),(0,g.getColor)("borderSecondary"))),C=[{label:"Volume",value:"volume"},{label:"KS2",value:"ks2"}],k=[{label:"Average",value:"average"},{label:"Median",value:"median"},{label:"Min",value:"min"},{label:"Max",value:"max"},{label:"Stddev",value:"stddev"}],I=[{label:"Metrics",value:""},{label:"Anomaly Rate",value:"anomaly-bit"}],Z=function(){return i.createElement(g.Flex,{column:!0,gap:1,alignItems:"center",width:"220px"},i.createElement(g.TextMicro,{color:"white"},"Choose the algorithm you want to be used to identify correlations across metrics:"),i.createElement(g.TextMicro,null,i.createElement(g.TextMicro,{color:"white",strong:!0},"KS2:")," ","A statistical test comparing the distribution of the highlighted window to the baseline."),i.createElement(g.TextMicro,null,i.createElement(g.TextMicro,{color:"white",strong:!0},"Volume:")," ","Percentage change in averages between highlighted window and baseline."))},j=function(){return i.createElement(g.Flex,{column:!0,gap:1,alignItems:"center",width:"220px"},i.createElement(g.TextMicro,{color:"white"},"What aggregation function do you want to apply when aggregating multiple datapoints for metric correlations."))},S=function(){return i.createElement(g.Flex,{column:!0,gap:1,alignItems:"center",width:"220px"},i.createElement(g.TextMicro,{color:"white"},"Do you want to find correlations over the metric values or the anomaly rates of each metric."))},P=function(e){var t=e.runGetWeights,n=e.nodeIds,r=e.flavour,o=(0,d.$g)({nodeIds:n,flavour:r}),l=o.method,c=o.options,s=o.group,u=null!==c&&void 0!==c&&c.includes(I[1].value)?I[1].value:"",m=(0,i.useCallback)((function(e){return function(n){var r=n.value;r="options"!==e?r:r?[r]:[];var o=(0,a.Z)({method:l,options:[c],group:s},e,r);t(o)}}),[l,c,s]),f=(0,i.useMemo)((function(){return{method:C.find((function(e){return e.value===l})),group:k.find((function(e){return e.value===s})),option:I.find((function(e){return e.value===u}))}}),[l,s,u]);return s?i.createElement(g.Flex,{gap:2},i.createElement(g.Flex,{gap:1,alignItems:"center"},i.createElement(g.TextSmall,{color:"textLite"},"Method:"),i.createElement(g.Select,{options:C,value:f.method,onChange:m("method")}),i.createElement(y.Z,{isBasic:!0,plain:!0,content:Z,align:"bottom"},i.createElement(g.Icon,{name:"information",color:"textDescription",size:"small"}))),i.createElement(O,null),i.createElement(g.Flex,{gap:1,alignItems:"center"},i.createElement(g.TextSmall,{color:"textLite"},"Aggregation:"),i.createElement(g.Select,{options:k,value:f.group,onChange:m("group")}),i.createElement(y.Z,{isBasic:!0,plain:!0,content:j,align:"bottom"},i.createElement(g.Icon,{name:"information",color:"textDescription",size:"small"}))),i.createElement(O,null),i.createElement(g.Flex,{gap:1,alignItems:"center"},i.createElement(g.TextSmall,{color:"textLite"},"Data:"),i.createElement(g.Select,{options:I,value:f.option,onChange:m("options")}),i.createElement(y.Z,{isBasic:!0,plain:!0,content:S,align:"bottom"},i.createElement(g.Icon,{name:"information",color:"textDescription",size:"small"}))),i.createElement(O,null)):null},N=n(89405),T=function(e){var t=e.highlightAfter,n=e.highlightBefore,r=e.baseline,o=(0,N.rA)(),a=o.localeDateString,l=o.localeTimeString,c=new Date(t),s=new Date(n),d=new Date(r),u=new Date(t),m=Math.round((n-t)/1e3),p=Math.round((t-r)/1e3),h=(0,f.TQ)("highlight");return i.createElement(g.Flex,{gap:4,alignItems:"center"},i.createElement(g.Flex,{gap:2},i.createElement(g.Flex,{column:!0,gap:1},i.createElement(g.TextSmall,{color:"textLite"},"Selected area:"),i.createElement(g.TextSmall,{color:"textLite"},"Reference baseline:")),i.createElement(g.Flex,{column:!0,gap:1},i.createElement(g.TextSmall,{"data-testid":"metricCorrelation-selectedArea"},a(c,{long:!1}),","," ",l(c),"\xa0->\xa0",a(s,{long:!1}),","," ",l(s)),i.createElement(g.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline"},a(d,{long:!1}),","," ",l(d),"\xa0->\xa0",a(u,{long:!1}),","," ",l(u))),i.createElement(g.Flex,{column:!0,gap:1},i.createElement(g.TextSmall,{color:"textLite"},"Duration:"),i.createElement(g.TextSmall,{color:"textLite"},"Duration:")),i.createElement(g.Flex,{column:!0,gap:1},i.createElement(g.TextSmall,{"data-testid":"metricCorrelation-selecteArea-duration"},m,"\xa0secs"),i.createElement(g.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline-duration"},p,"\xa0secs"))),i.createElement(y.Z,{content:"Clear selection",align:"bottom",isBasic:!0},i.createElement(g.Button,{neutral:!0,flavour:"borderless",icon:"trashcan",onClick:function(){h({after:null,before:null})},"data-ga":"metric-correlation::click-delete::charts-view","data-testid":"metricCorrelation-delete"})))};function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var B=(0,h.default)(g.Button).withConfig({displayName:"correlation__LogoButton",componentId:"sc-15d72m3-0"})(["&&{pointer-events:none;}"]),F=(0,h.default)(g.Button).withConfig({displayName:"correlation__CloseButton",componentId:"sc-15d72m3-1"})(["position:absolute !important;top:-3px;right:-3px;"]),M=(0,h.default)(g.Button).attrs({padding:[0],margin:[0,0,0,1.5],width:"auto"}).withConfig({displayName:"correlation__StyledButton",componentId:"sc-15d72m3-2"})(["height:16px !important;> span{margin:0 !important;}"]),A=function(e){var t=e.flavour,n=(0,E.th)(),r=(0,x.UL)(),l=(0,w.pG)(),c=(0,i.useMemo)((function(){return l?[l]:[]}),[l]),s=(0,f.TA)({extraKey:t,defaultValue:c}),u="singleNode"===t?c:s,m=(0,i.useState)(!1),p=(0,o.Z)(m,2),h=p[0],O=p[1],C=(0,i.useState)(),k=(0,o.Z)(C,2),I=k[0],Z=k[1],j=(0,d.d5)({nodeIds:u,flavour:t},n,r),S=j.threshold,N=j.totalDimensionsCount,A=j.dimensionsCount,_=j.loaded,L=j.loading,R=j.getWeights,z=j.resetWeights,V=(0,d.$g)({nodeIds:u,flavour:t}),K=V.method,H=V.options,G=V.group,U=(0,f.by)("highlight"),W=U.after,q=U.before,Q=W-4*(q-W),J=!!W;(0,i.useEffect)((function(){if(_){var e="default-result";if(G){var t=null!==H&&void 0!==H&&H.includes("anomaly-bit")?"anomaly-bit":"metrics";e="default-result-".concat(K,"-").concat(G,"-").concat(t)}return(0,b.L)("metrics-correlation",e,"charts-view",A.toString())}}),[_]),(0,v.Z)((function(){W&&O(!0)}),[W]);var $=(0,f.TQ)("correlation"),Y=(0,f.TQ)("threshold"),X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};O(!1),Z(),R(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({highlightAfter:W,highlightBefore:q,baselineAfter:Q,baselineBefore:W,method:K,options:H,group:G,nodeIds:u},e)).then((function(){return Y(d.mt)}))},ee=!J||L;return(0,v.Z)((function(){_&&h&&J&&X()}),[_,J,h]),i.createElement(g.Flex,{round:2,background:"elementBackground",padding:[2,6,2,2],alignItems:"center",justifyContent:"between",flex:!0,"data-testid":"correlation",position:"relative",height:{min:"64px"},gap:2},J?_?i.createElement(g.Flex,{"data-testid":"metricCorrelation-resultsContainer",column:!0,width:"100%"},i.createElement(g.Flex,{justifyContent:"between",alignItems:"center",gap:1},i.createElement(g.Flex,{alignItems:"center",gap:1},i.createElement(g.Icon,{name:"correlation",color:"primary",width:"16px",height:"16px"}),i.createElement(g.TextSmall,null,"Analysed"," ",i.createElement(g.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsAnalyzed"},N)," ","and found"," ",i.createElement(g.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsFound"},A)," ","correlated metrics."),i.createElement(y.Z,{content:"Clear results"},i.createElement(M,{flavour:"borderless",neutral:!0,disabled:L||!_&&!J,onClick:function(){Y(d.mt),z(),(0,b.L)("metrics-correlation","click-delete","charts-view","".concat(_?"finish":"start"))},"data-testid":"metricCorrelation-clear",small:!0,icon:"reload"}))),i.createElement(P,{runGetWeights:X,nodeIds:u,flavour:t})),i.createElement(g.Flex,{width:"100%"},i.createElement(g.Flex,{alignItems:"center",gap:3,margin:[0,2,0,5],width:"100%"},i.createElement(g.TextNano,{whiteSpace:"nowrap",color:"textDescription"},"Show less"),i.createElement(g.InputRange,{"data-testid":"metricCorrelation-resultsSlider",min:0,max:1,onChange:function(e){return Y(e.target.value.toString())},onClick:function(){return(0,b.L)("metric-correlation","click-slider","charts-view")},step:.01,value:S}),i.createElement(g.TextNano,{whiteSpace:"nowrap",color:"textDescription"},"Show more")),i.createElement(i.Fragment,null,i.createElement(y.Z,{content:"Give us your feedback! Was it useful?",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover"},i.createElement(g.Flex,null,i.createElement(g.Button,{flavour:"+"===I?"hollow":"borderless",disabled:I,icon:"thumb_up",onClick:function(){return Z("+")},"data-ga":"metric-correlation::click-thumbs-up::charts-view","data-testid":"metricCorrelation-thumbsUp",small:!0}),i.createElement(g.Button,{flavour:"-"===I?"hollow":"borderless",disabled:I,icon:"thumb_down",onClick:function(){return Z("-")},"data-ga":"metric-correlation::click-thumbs-down::charts-view","data-testid":"metricCorrelation-thumbsDown",small:!0})))))):i.createElement(g.Flex,{alignItems:"center","data-testid":"correlationView-timePeriod-container",gap:4},i.createElement(B,{icon:"logo_s",isLoading:L}),L?i.createElement(g.H5,{"data-testid":"metricCorrelation-loadingCalculation"},"Calculating metric correlations..."):i.createElement(T,{highlightAfter:W,highlightBefore:q,baseline:Q})):i.createElement(g.Flex,{alignItems:"center",gap:1},i.createElement(g.Icon,{name:"correlation",color:"primary"}),i.createElement(g.Text,null,"Select a timeframe on any chart and find correlated metrics. Visit documentation"),i.createElement("a",{href:"https://learn.netdata.cloud/docs/cloud/insights/metric-correlations",target:"_blank",rel:"noreferrer"},i.createElement(g.Icon,{name:"nav_arrow_goto",color:"primary",width:"12px",height:"12px"}))),i.createElement(g.Flex,{alignItems:"center"},(!_||L)&&i.createElement(y.Z,{content:ee?"Select an area of interest on any chart":"Click to find correlated metrics for the selected area",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover"},i.createElement(g.Button,{label:L?"Loading...":"Find correlations",isLoading:!1,onClick:X,disabled:ee,flavour:"hollow","data-ga":"metric-correlation::click-find-correlation::charts-view","data-testid":"metricCorrelation-find",small:!0,margin:[0,2,0,0]})),i.createElement(y.Z,{content:"Close",align:"bottom"},i.createElement(F,{neutral:!0,flavour:"borderless",onClick:function(){$(!1),Y(d.mt),z(),(0,b.L)("metrics-correlation","click-close","charts-view","".concat(_?"finish":"start"))},"data-ga":"metric-correlation::click-close::charts-view","data-testid":"metricCorrelation-close",icon:"x"}))))},_=function(){var e=(0,f.TQ)("correlation");return i.createElement(y.Z,{content:function(){return i.createElement(g.Box,null,i.createElement("strong",null,"Troubleshoot with Metric Correlations"),i.createElement("br",null),i.createElement("br",null),"Metric correlations will help you identify potential root causes for an observed issue.",i.createElement("br",null),"It will automatically analyse all available metrics for irregular behavior for the same timeframe.")},align:"bottom",activateOn:"hover",isBasic:!0},i.createElement(g.Button,{width:"118px",flavour:"hollow",label:"Metric Correlations",onClick:function(){e(!0)},"data-ga":"metrics-correlation::click-metric-correlations::charts-view","data-testid":"run-correlation",small:!0}))},L=n(20046),R=n(94829),z=n(88866),V=n(4312),K=n(77796),H=n(12008),G=n(89050),U=h.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-1fhfk7c-0"})(["background:",";height:20px;width:1px;"],(0,g.getColor)("border")),W=n(83925);function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var J=function(e){var t,n,r=e.setSidebarTab,o=(0,w.pG)(),a=(0,K.ev)(o),l=(0,H.n_)(a),c=l.critical,s=l.warning,d=(0,w.bV)(o),u=d.hw,m=d.cpus,f=d.isLive,p=d.name,h=d.os,v=d.state,b=d.updateSeverity,y=d.labels,E=d.version,x={dataTestId:"singleNode",isLive:f},O=(0,G.kR)(Q({count:c,type:"critical"},x)),C=(0,G.kR)(Q({count:s,type:"warning"},x)),k=(0,G.Q5)(v),I=(0,G.jo)(u.container,u.virtualization),Z=(0,R.Z)("(min-width: 1760px)");return i.createElement(g.Flex,{alignItems:"center",background:"panelBg",border:{side:"all",color:"border"},"data-testid":"singleNode-badges-container",flex:!1,gap:2,padding:[2,4],round:1},i.createElement(g.TextSmall,{"data-testid":"singleNode-".concat(p),strong:!0},p),i.createElement(U,{"data-testid":"singleNode-separator"}),i.createElement(g.Flex,{"data-testid":"singleNode-info-alerts-badges",gap:1},i.createElement(V.Z,{badge:"info","data-testid":"singleNode-nodeInfo-cta"},i.createElement(g.Pill,{background:"nodeBadgeBackground",borderColor:"border",color:"nodeBadgeColor",flavour:"neutral",icon:"information",iconSize:"18px",onClick:function(){return r(2)},padding:[1,2],size:"large"})),i.createElement(V.Z,{badge:"alerts",nodeName:p},i.createElement(g.AlertMasterCard,{onClick:O.text||C.text?function(){return r(1)}:null,pillLeft:O,pillRight:C,size:"large"})),b&&i.createElement(W.Z,{"data-testid":"singleNode-update-cta",name:p,os:h.id,container:u.container,warningLevel:b,labels:y,version:E,text:b})),i.createElement(U,{"data-testid":"singleNode-separator"}),i.createElement(g.Flex,{alignItems:"center",border:{side:"all",color:"border"},"data-testid":"singleNode-system-info-badges",gap:1,padding:[1],round:999},i.createElement(V.Z,{badge:"connectivity",connectivityState:k,"data-testid":"singleNode-connectivityStateInfo",nodeName:p},i.createElement(g.Pill,{background:"nodeBadgeBackground",borderColor:"border",color:"nodeBadgeColor",flavour:"neutral",hollow:!0,size:"large"},k)),i.createElement(V.Z,{badge:"type","data-testid":"singleNode-nodeTypeInfo",nodeName:p,nodeType:I.label},i.createElement(g.Pill,{background:"nodeBadgeBackground",borderColor:"border",color:"nodeBadgeColor",flavour:"neutral",hollow:!0,icon:I.icon,iconSize:I.iconSize,size:"large"},I.label)),Z&&i.createElement(V.Z,{badge:"systemInfo","data-testid":"singleNode-systemInfo",nodeName:p},i.createElement(g.Pill,{background:"nodeBadgeBackground",borderColor:"border",color:"nodeBadgeColor",flavour:"neutral",hollow:!0,normal:!0,size:"large",icon:(null===(t=z._[h.nm])||void 0===t?void 0:t.iconName)||(null===(n=z.V[h.id])||void 0===n?void 0:n.iconName)||"os"},(0,G.ys)(u.cpuFrequency)," (",m," ",1===u.cpus?"Core":"Cores",") -"," ",(0,G.yo)(u.memory)," RAM - ",(0,G.yo)(u.diskSpace)))))},$=n(38671),Y=function(){var e=(0,$.Z)().onIntegrationsClick;return i.createElement(i.Fragment,null,i.createElement(g.Button,{icon:"integrations",flavour:"hollow",onClick:e,small:!0,label:"Integrations","data-ga":"integrations::click-integrations::charts-view","data-testid":"btn-show-integrations"}))},X=["flavour"],ee={singleNode:J,default:L.Z},te=(0,i.memo)((function(e){var t=e.flavour,n=(0,p.Z)(e,X),r=(0,f.by)("correlation"),o=ee[t]||ee.default;return i.createElement(g.Flex,{alignItems:!r&&"center",background:"mainBackground",column:r,"data-testid":"overview-header",gap:2,justifyContent:r?"start":"between",padding:[2,2,2,4],width:"100%"},r?i.createElement(A,{flavour:t}):i.createElement(i.Fragment,null,i.createElement(o,n),i.createElement(g.Flex,{gap:2},i.createElement(Y,null),i.createElement(_,null))))})),ne=n(15394),re=n(81961),oe=n(22962),ae=n(61152),ie=n(69743),le=n(56102),ce=n(11835),se=(n(31672),n(59461),n(74916),n(4723),n(21249),n(57640),n(9924),n(69968)),de=n(88553),ue=(n(48564),n(79424),n(71824)),me=n(17638),fe=n(85993),pe=n(62525),ge=n(41481),he=n(16978),ve=n(9058),be=n(64504),ye=n(89479),we=function(e){return function(t){return"overview-page::".concat(e.getAttribute("id"),"::").concat(t)}},Ee=["chartId"],xe=["id","ids"];function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ke=(0,ue.wJ)((function(e){var t=e.id,n=e.menuChartAttributes,r=(0,x.UL)(),o=(0,ve.e)(),a=(0,be.u)(),l=(0,i.useMemo)((function(){var e,i="head-".concat(t),l=a.getChildren().find((function(e){return e.match({id:i})}));if(!l){var c=Ce({contextScope:[(e=n).chartId]},(0,p.Z)(e,Ee));l=o.makeChart({attributes:Ce(Ce({},c),{},{roomId:r,id:i}),makeTrack:we}),a.appendChild(l)}return l}),[r,t,a]);return(0,ye.Ni)(n.chartId)?i.createElement(he.Z,{chart:l,"data-track":l.track("container")}):null})),Ie=function(e,t){return e.layout||console.warn(t,"has no layout set, default values will be used."),Ce(Ce({x:0,y:0,w:3,h:5,i:e.id,chartId:e.chartId},e.layout),{},{minW:1,minH:1,static:!1})},Ze={lg:12,md:12,sm:12,xs:12,xxs:1},je={lg:40,md:30,sm:30,xs:30,xxs:30},Se=function(e){var t=e.id,n=e.ids,a=(0,p.Z)(e,xe),l=(0,ue.mQ)(n,Ie),c=(0,ge.J1)().filteredChartsCount,s=(0,ue.MS)(t),d=(0,i.useMemo)((function(){return{lg:l.filter((function(e){if(!e)return!1;var t=s(e.chartId);return t.visible&&!t.filteredOut&&!t.hidden}))}}),[n,l,c]),u=(0,i.useState)("lg"),m=(0,o.Z)(u,2),f=m[0],g=m[1],h=(0,de.Z)(),v=(0,o.Z)(h,2),b=v[0],y=v[1].width,w=(0,i.useMemo)((function(){return d.lg.map((function(e){var t=e.i;return i.createElement("div",{key:t},i.createElement(ke,{key:t,id:t}))}))}),[d]);return n.length?i.createElement(me.n,(0,r.Z)({width:"100%",margin:[2,0,0]},a,{ref:b}),i.createElement(se.Responsive,{layouts:d,rowHeight:je[f],cols:Ze,margin:[4,4],measureBeforeMount:!0,style:{minWidth:"100%",minHeight:"166px"},width:y||1e3,compactType:"horizontal",onBreakpointChange:g,useCSSTransforms:!1,isDraggable:!1,isResizable:!1},w)):null},Pe=(0,fe.Lj)(Se,(function(e){return{ids:e.headIds}})),Ne=(0,pe.Ji)(Se,(function(e){return{ids:e.headIds}})),Te=["id"],De=function(e){var t=e.id,n=(0,p.Z)(e,Te);return i.createElement(ie.d,(0,r.Z)({id:t},n),i.createElement(le.Y,{id:t}),i.createElement(ce.f,{id:t}),i.createElement(Pe,{id:t}))},Be=(0,i.memo)(De),Fe=n(18039),Me=["id"],Ae=["height"];function _e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_e(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Re=[],ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):Re,selectedInstances:e.instances?Object.keys(e.instances):Re,selectedNodes:e.nodes?Object.keys(e.nodes):Re,weight:e.weight}},Ve=function(e){var t=e.id,n=(0,p.Z)(e,Me),o=(0,x.UL)(),a=(0,be.u)(),l=(0,ue.nI)(t),c=l.height,s=void 0===c?0:c,d=(0,p.Z)(l,Ae),u=(0,ve.e)(),m=(0,i.useMemo)((function(){var e=a.getNode({id:t});return e||(e=u.makeChart({attributes:Le({contextScope:[t],height:(0,Fe.C)(a,t,s+360),id:t,roomId:o},d),makeTrack:we}),a.appendChild(e),e)}),[a,o,t]),f=(0,ue.Q8)(t,ze),g=f.weight,h=f.selectedDimensions,v=f.selectedInstances,b=f.selectedNodes;return(0,i.useEffect)((function(){m&&g&&(m.updateAttributes({selectedDimensions:h,selectedInstances:v,selectedNodes:b}),m.trigger("fetch"))}),[o,t,g,h.length,v.length,b.length]),i.createElement(he.Z,(0,r.Z)({margin:[0,0,2],chart:m,"data-chartid":t,"data-track":m.track("container")},n))},Ke=i.memo(Ve,(function(e,t){return e.id===t.id})),He=["id","subMenuId"],Ge=function(e){var t=e.id,n=e.subMenuId,o=(0,p.Z)(e,He);return i.createElement(Ke,(0,r.Z)({id:t,role:"graphics-object","aria-roledescription":"chart","data-submenuid":n},o))},Ue=(0,i.memo)(Ge),We=n(14048),qe=n(12664),Qe=function(e){var t=e.id;return i.createElement(We.D,{gap:0,id:t},i.createElement(qe.o,{id:t,margin:[1,0,0]}),i.createElement(Ne,{id:t}))},Je=(0,i.memo)(Qe),$e=function(e){var t=e.id,n=(0,x.UL)(),r=(0,ve.e)(),a=(0,ue.MS)(),l=(0,fe.nk)(t).subMenuChartIds,c=(0,be.u)(),s=(0,i.useMemo)((function(){var e=(0,o.Z)(l,1)[0],i=(a(e),c.getChildren().find((function(e){return e.match({id:t})})));if(i)return i;var s=l.map((function(e){return{value:e,label:a(e).context}}));return i=r.makeChart({attributes:{id:t,contextScope:[e],roomId:n,composite:!0,chartLibrary:"groupBoxes",groupBy:["label"],groupByLabel:["k8s_namespace","k8s_pod_name"],aggregationMethod:"avg",eliminateZeroDimensions:!1,contextItems:s},makeTrack:we}),c.appendChild(i),i}),[t,c]);return i.createElement(he.Z,{margin:[0,0,2],chart:s,"data-chartid":t,"data-track":s.track("container")})},Ye=["id"],Xe=function(e){var t=e.id,n=(0,p.Z)(e,Ye);return i.createElement(ie.d,{id:t,padding:[6,0,0]},i.createElement(le.Y,{id:t}),i.createElement(ce.f,{id:t,padding:[2,0,0]}),i.createElement($e,(0,r.Z)({id:t},n)))},et={k8s:(0,i.memo)(Xe)},tt=function(e){if(et[e.flavour])return et[e.flavour];switch(e.level){case 0:return Be;case 1:return Je;case 2:return Ue;default:return null}},nt=function(e){var t=e.onChartNameChange,n=e.initialChartName,r=e.dashboardOptions,a=e.linkToGo,l=e.contextToGo,s=(0,ae.Z)("addToDashboardModal"),d=(0,o.Z)(s,4),u=d[0],m=d[3],f=(0,ne.Z)({onChartNameChange:t,initialChartName:n,linkToGo:a,contextToGo:l}),p=f.setActiveMenuGroupId,g=f.setActiveSubMenuId;return i.createElement(c.v,null,i.createElement(re.Z,{onActiveMenuGroupId:p,onActiveSubMenuId:g,getComponent:tt,dashboardOptions:r,initialChartName:n}),u&&i.createElement(oe.Z,{onClose:m}))},rt=n(91268),ot=n(41506),at=n(43969),it=n(78266),lt=n(72911),ct=n(73531),st=n(8741),dt=n(62200),ut=n(91008),mt=n(33335),ft=n(41898),pt=function(){var e=(0,x.UL)(),t=(0,mt.gI)("node:Create");return i.createElement(rt.Z,{column:!1,"data-testid":"noNodesViewPage",gap:12,padding:[6],rightBar:i.createElement(ct.Z,null)},i.createElement(g.Flex,{column:!0,gap:5,flex:{shrink:0,grow:0},"data-testid":"noKubernetesView-videoSection"},i.createElement(lt.Z,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:dt.mX[0]}),i.createElement(lt.Z,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:dt.mX[1]})),i.createElement(g.Flex,{column:!0,gap:4},i.createElement(g.Box,{border:{side:"bottom",color:"borderSecondary"}},i.createElement(g.Box,{margin:[0,0,2,0]},i.createElement(ut.Z,{href:"https://learn.netdata.cloud/guides/monitor/kubernetes-k8s-netdata",target:"_blank",rel:"noopener noreferrer","data-ga":"k8s-tab::click-link-guides::kubernetes-overview-and-visualizations"},i.createElement(g.TextBig,{color:"primary"},"Kubernetes monitoring with Netdata: Overview and visualizations"))),i.createElement(g.Box,{margin:[0,0,2,0]},i.createElement(ut.Z,{href:"https://learn.netdata.cloud/docs/cloud/visualize/kubernetes",target:"_blank",rel:"noopener noreferrer","data-ga":"k8s-tab::click-link-guides::kubernetes-visualizations"},i.createElement(g.TextBig,{color:"primary"},"Kubernetes visualizations")))),i.createElement(g.Flex,{column:!0,gap:4},t?i.createElement(st.Z,{integrationId:ft.O_,rooms:[e]}):i.createElement(s.H,null))))};function gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ht=(0,i.memo)((function(){var e=(0,H.O0)(),t=(0,o.Z)(e,2),n=t[0],r=t[1],l=(0,ve.e)(),c=!!n&&!!l&&l.getNode({id:n.context}),s=function(){if(r(null),null!==n&&void 0!==n&&n.context&&c){var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gt(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},c.getAttribute("overlays"));delete e.alert,c.updateAttribute("overlays",e),history.replaceState({},"")}};(0,i.useEffect)((function(){return s}),[]);var d=(0,x.UL)(),u=(0,ye.Cd)((null===n||void 0===n?void 0:n.context)&&d,null===n||void 0===n?void 0:n.context);if(!n||null===u||void 0===u||!u.loaded)return null;var m=u.firstEntry;return i.createElement(g.Layer,{backdrop:!1,position:"top",margin:[26,0,0],padding:[26,0,0]},i.createElement(g.Flex,{background:["neutral","black"],padding:[1,2],gap:2},i.createElement(g.TextSmall,{color:["neutral","porcelain"]},"Alert in ",i.createElement(g.TextSmall,{color:"bright"},n.instance)," on"," ",i.createElement(g.TextSmall,{color:"bright"},new Date(1e3*n.lastStatusChange).toLocaleString()),!m&&" doesn't exist on the node anymore",!!m&&m>n.lastStatusChange&&" exceeds agent data retention settings"),i.createElement(g.Flex,{flex:!1},i.createElement(g.Icon,{name:"x",color:"bright",onClick:s,size:"small"}))))})),vt=ht;function bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wt={NoChartsView:at.Z,NoNodesView:s.Z,rightBar:{title:"Filters",hiddenTabs:["info"],Component:ot.Z,props:{}},dashboardOptions:{},loadingMessage:"Loading charts...",Header:te},Et={overview:yt(yt({},wt),{},{rightBar:yt(yt({},wt.rightBar),{},{title:"Overview"})}),k8s:yt(yt({},wt),{},{NoChartsView:pt,NoNodesView:pt,rightBar:yt(yt({},wt.rightBar),{},{title:"Kubernetes"}),loadingMessage:"Loading k8s charts..."}),singleNode:yt(yt({},wt),{},{rightBar:yt(yt({},wt.rightBar),{},{title:"Single Node",hiddenTabs:["filters"],props:{showCollapsed:!0}})})},xt=function(){return function(){var e=(0,u.E)(),t=(0,d.yp)({nodeIds:e,flavour:"rhs"}),n=(0,m.$B)(),r=(0,o.Z)(n,2),a=r[0],l=r[1],c=(0,f.by)(),s=c.after,p=c.before;(0,i.useEffect)((function(){t()}),[a,l,s,p])}(),null},Ot=(0,i.memo)((function(e){var t=e.flavour,n=void 0===t?"overview":t,a=e.invalidationKey,s=e.nodeIds,d=e.loaded,u=e.getChart,m=e.chartIds,f=e.areChartsIdsEmpty,p=e.showNoChartsView,g=e.showNoNodesView,h=e.initializing,v=e.chartName,b=e.setChartName,y=e.chartsLoaded,w=e.widthRef,E=Et[n],x=E.dashboardOptions,O=E.NoChartsView,C=E.NoNodesView,k=E.rightBar,I=E.loadingMessage,Z=E.Header,j=(0,l.TH)().state,S=(0,i.useState)(0),P=(0,o.Z)(S,2),N=P[0],T=P[1];return g?i.createElement(C,null):h?i.createElement(it.Z,{title:"Please wait while charts are being initialized.",body:"Thank you for your patience!"}):d?p?i.createElement(i.Fragment,null,i.createElement(Z,{flavour:n}),i.createElement(O,null)):i.createElement(c.Z,{key:a,getChart:u,chartIds:m,linkToGo:null===j||void 0===j?void 0:j.chartName},i.createElement(xt,null),i.createElement(vt,null),i.createElement(rt.Z,{ref:w,rightBar:i.createElement(k.Component,(0,r.Z)({nodeIds:s,title:k.title,initialChartName:v,hiddenTabs:k.hiddenTabs,selectedTab:N,setSelectedTab:T,flavour:n,loaded:y},k.props)),gap:1},i.createElement(Z,{flavour:n,setSidebarTab:T}),y?f?i.createElement(at.Z,null):i.createElement(nt,{dashboardOptions:x,initialChartName:v,onChartNameChange:b,linkToGo:null===j||void 0===j?void 0:j.chartName,contextToGo:null===j||void 0===j?void 0:j.contextToGo}):i.createElement(it.Z,{title:I}))):i.createElement(it.Z,{title:I})}))},30569:function(e,t,n){n.d(t,{Z:function(){return g}});var r=n(87462),o=(n(92222),n(67294)),a=n(89250),i=n(97945),l=n(7335),c=n(74059),s=n(54227),d=n(58591),u=n(29439),m=n(37518),f=n(95248),p=function(e){var t=(0,m.A3)(),n=(0,a.s0)(),r=(0,f.I0)("alert_id"),i=(0,u.Z)(r,2),l=i[0],c=i[1];(0,o.useEffect)((function(){l&&(c(),n("".concat(t,"/alerts/").concat(l,":::").concat(e)))}),[l,e])},g=function(e){return function(t){var n=(0,c.th)(),u=(0,i.pG)();p(u);var m=(0,i.bV)(u,"isLive"),f=(0,i.bV)(u,"name");(0,s.bV)({title:f,id:u,destination:u});var g=(0,i.TQ)(u,n),h=(0,l.DH)();(0,o.useEffect)((function(){if(m&&"hasValue"===g.state){var e=g.contents;null!==e&&void 0!==e&&e.uid&&f&&h(e.uid,null,f)}}),[g,m,f]);var v=(0,a.s0)(),b=(0,a.UO)(),y=b.spaceSlug,w=b.roomSlug;(0,o.useEffect)((function(){var e=(0,d.np)("alarm_id");if(e){var t=(0,d.np)("alarm_chart");(0,d.bp)(["alarm_id","alarm_chart"]),v("/spaces/".concat(y,"/rooms/").concat(w,"/alerts/").concat(e,":::").concat(u,"?chart=").concat(t).concat(location.hash),{replace:!0})}}),[]);var E=(0,o.useMemo)((function(){return[u]}),[u]);return o.createElement(e,(0,r.Z)({flavour:"singleNode",nodeIds:E},t))}}},97363:function(e,t,n){n.d(t,{Z:function(){return T}});var r=n(87462),o=n(45987),a=n(67294),i=n(64969),l=n(37518),c=n(97193),s=n(8144),d=["roomId","flavour"],u=function(e){var t=e.roomId,n=e.flavour,i=(0,o.Z)(e,d),l=function(e){return(0,a.useMemo)((function(){return{Live:{head:{label:"Live nodes",textColor:"textLite",iconName:"connectivityStatusLive",hasAlerts:!0},node:{textColor:"text",showAlerts:!0}},Stale:{head:{label:"Stale nodes",textColor:"textLite",iconName:"connectivityStatusStale",hasAlerts:!0},node:{textColor:"text",showAlerts:!0}},Offline:{head:{label:"Offline nodes",textColor:"textLite",iconName:"connectivityStatusOffline",disabled:!0},node:{textColor:"textLite",disabled:!0}}}}),[e])}(n);return"singleNode"===n?null:a.createElement(s.Z,(0,r.Z)({title:"Nodes",testIdPrefix:"nodes",baseKey:t,extraKey:n,param:"selectedIds"},i),a.createElement(c.Z,{baseKey:t,extraKey:n,statusProps:l,background:"mainBackground",itemProps:{padding:[1,1,1,.5],maxLength:24},searchMargin:[0,0,2],height:{max:"300px"}}))},m=(n(47941),n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(29439)),f=n(4942),p=(n(21249),n(57640),n(9924),n(69720),n(85827),n(41539),n(25387),n(2490),n(72608),n(57327),n(88449),n(59849),n(95248)),g=n(597),h=n(80239),v=n(46742);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var y=function(e){var t=e.extraKey,n=e.param,r=e.paramKey,o=(0,g.K)({extraKey:t,omit:[n],keepAll:!0}),i=(0,p.tk)(n,{extraKey:t});return(0,a.useMemo)((function(){return Object.entries(o.reduce((function(e,t){return e[t[r]]=(e[t[r]]||0)+(t.hidden?0:1),e}),function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){(0,f.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},h.VP[n]||{}))).map((function(e){var t=(0,m.Z)(e,2);return{id:t[0],count:t[1]}}))}),[o.filter((function(e){return e.hidden})).length,i])},w=function(e){return e.id},E=function(e){var t=e.baseKey,n=e.param,r=e.paramKey,o=e.extraKey,i=e.testIdPrefix,l=e.title,c=y({param:n,extraKey:o,paramKey:r});return c.length?a.createElement(s.Z,{title:l,testIdPrefix:i,baseKey:t,extraKey:o,param:n},a.createElement(v.ZP,{param:n,baseKey:t,extraKey:o,testIdPrefix:i,collection:c,getValue:w,getLabel:w})):null},x=n(93433),O=(n(92222),n(86535),n(99244),n(74326),n(82499),n(64211),n(41874),n(26699),n(32023),n(66992),n(70189),n(78783),n(88921),n(96248),n(13599),n(11477),n(64362),n(15389),n(90401),n(45164),n(91238),n(54837),n(87485),n(56767),n(76651),n(61437),n(35285),n(39865),n(33948),n(91966)),C=n.n(O),k=n(48286),I=["baseKey","extraKey","param","testIdPrefix","itemsProps","itemProps"];function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach((function(t){(0,f.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var S=function(e){var t=e.baseKey,n=e.extraKey,l=e.param,c=e.testIdPrefix,d=e.itemsProps,u=e.itemProps,f=(0,o.Z)(e,I),h=function(e){var t=e.extraKey,n=e.param,r=(0,g.K)({extraKey:t,omit:[n],keepAll:!0}),o=(0,p.tk)(n,{extraKey:t});return(0,a.useMemo)((function(){return Object.entries(r.reduce((function(e,t){var n=t.type,r=t.component,o=t.hidden;return e[n]=e[n]||{count:0,children:{}},e[n].count=(e[n].count||0)+(o?0:1),e[n].children[r]=(e[n].children[r]||0)+(o?0:1),e}),{})).reduce((function(e,t){var n=(0,m.Z)(t,2),r=n[0],o=n[1],a=o.count,i=o.children;return e.push({id:r,count:a,children:Object.entries(i).map((function(e){var t=(0,m.Z)(e,2),n=t[0],o=t[1];return{value:"".concat(r,"|").concat(n),label:n,count:o,level:1}}))}),e}),[])}),[r.filter((function(e){return e.hidden})).length,o])}({param:l,extraKey:n}),v=(0,p.I0)(l,{defaultValue:[],key:t,extraKey:n}),b=(0,m.Z)(v,2),y=b[0],w=b[1];(0,k.Z)((function(){h.length&&y.length&&w((function(e){return e.filter((function(e){return h.some((function(t){return t.children.some((function(t){return t.value===e}))}))}))}))}),[h.length,w]);var E=(0,a.useCallback)((function(e){var t=e.value,n=e.checked;w((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(t)?n?(0,x.Z)(new Set([].concat((0,x.Z)(e),(0,x.Z)(t)))):C()(e,t):n?[].concat((0,x.Z)(e),[t]):e.filter((function(e){return e!==t}))}))}),[w]),O=(0,a.useMemo)((function(){return function(e){var t=e.options,n=e.selected,r=e.itemsProps;if(!t.length)return[];var o=t.flatMap((function(e){return e.children.map((function(e){return e.value}))})),a=o.length===n.length,i=!a&&!!n.length;return[j(j({},r.head),{},{label:"Select all",value:o,selected:a,indeterminate:i})].concat((0,x.Z)(t.flatMap((function(e){var t=e.id,o=e.children,a=e.count,i=n.length&&!o.some((function(e){return!n.includes(e.value)})),l=!i&&n.length&&o.some((function(e){return n.includes(e.value)}));return o.reduce((function(e,t){var o=n.includes(t.value);return[].concat((0,x.Z)(e),[j(j(j({},r.row),t),{},{selected:o})])}),[j(j({},r.head),{},{label:t,value:o.map((function(e){return e.value})),selected:i,indeterminate:l,count:a})])}))))}({options:h,selected:y,itemsProps:d})}),[y,w,h]);return h.length?a.createElement(s.Z,{title:"Alert type & component",testIdPrefix:c,baseKey:t,extraKey:n,param:l},a.createElement(i.MenuDropdown,(0,r.Z)({hideShadow:!0,height:{max:"300px"},width:{max:"600px"},background:"mainBackground",overflow:"auto",padding:[0,0,3],"data-testid":"".concat(c,'-filter-selections"'),searchMargin:[0,0,2],items:O,onItemClick:E,value:y,"data-value":y.join(",")||"all-selected",hasSearch:h.length>5,itemProps:j({testIdPrefix:c},u)},f))):null};S.defaultProps=v.ZP.defaultProps;var P=S,N=["flavour"],T=(0,a.memo)((function(e){var t=e.flavour,n=(0,o.Z)(e,N),c=(0,l.UL)();return a.createElement(i.Flex,(0,r.Z)({column:!0,overflow:{vertical:"auto"},padding:[0,0,30]},n),"alerts"===t&&a.createElement(a.Fragment,null,a.createElement(E,{title:"Alert status",testIdPrefix:"alert-status",baseKey:c,extraKey:t,param:"alertStatuses",paramKey:"status"}),a.createElement(E,{title:"Alert class",testIdPrefix:"alert-class",baseKey:c,extraKey:t,param:"alertClasses",paramKey:"class"}),a.createElement(P,{testIdPrefix:"alert-type-component",baseKey:c,extraKey:t,param:"alertTypeComponents"}),a.createElement(E,{title:"Alert role",testIdPrefix:"alert-role",baseKey:c,extraKey:t,param:"alertRoles",paramKey:"recipient"})),a.createElement(u,{roomId:c,flavour:t}))}))},41506:function(e,t,n){n.d(t,{Z:function(){return G}});n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(87462),o=n(29439),a=n(45987),i=n(4942),l=(n(57327),n(41539),n(88449),n(2490),n(59849),n(47941),n(26699),n(32023),n(21249),n(57640),n(9924),n(67294)),c=n(71893),s=n(64969),d=n(46667),u=n(54316),m=n(29814),f=n(72843),p=n(31509),g=n(64344),h=n(82351),v=(n(23157),n(74916),n(15306),n(80744)),b=n(15394),y=n(92432),w=n(6609),E=n(93433),x=(n(85827),n(25387),n(72608),n(92222),n(85993)),O=n(45335),C=n(46189),k=n(74059),I=n(37518),Z=C.Z.demoSlug,j=C.Z.demoFavourites,S=(0,c.default)(s.Icon).attrs({size:"small",name:"chevron_left",color:"textLite"}).withConfig({displayName:"favourites__StyledChevron",componentId:"sc-mwcyj8-0"})(["transition:transform 0.2s ease-in-out;"]),P={showChildren:!1},N=function(e){var t,n=e.onMenuGroupClick,r=e.onSubMenuClick,a=e.initialChartName,i=(0,k.uk)(),c=(0,I.vf)(),u=Z===i&&j[c]||[],m=(0,x.UG)((t=u,function(e){return t.reduce((function(t,n){return e[n]?[].concat((0,E.Z)(t),[n]):t}),[])})),f=(0,b.Z)({onMenuGroupClick:n,onSubMenuClick:r}),p=f.onMenuGroupClick,g=f.onSubMenuClick,h=(0,d.Z)(!0),y=(0,o.Z)(h,2),w=y[0],C=y[1],N=(0,O.sm)();return(0,l.useEffect)((function(){N&&!a&&m.length&&n(m[0])}),[N,a]),m.length?l.createElement(s.Flex,{column:!0,gap:1,border:{side:"bottom",color:"borderSecondary"},padding:[0,0,2]},l.createElement(s.Flex,{onClick:C,cursor:"pointer",alignItems:"center",justifyContent:"between"},l.createElement(s.Flex,{gap:1,alignItems:"center"},l.createElement("i",{className:"fa-regular fa-star"}),l.createElement(s.Text,{strong:!0,color:"textFocus"},"Favourites")),l.createElement(S,{rotate:w?1:3,alignSelf:"end"})),l.createElement(s.Collapsible,{open:w,padding:[0,0,0,2]},l.createElement(v.v,{menuGroupIds:m,onMenuGroupClick:p,onSubMenuClick:g,menuGroupProps:P}))):null},T=function(e){return(0,y.L)("metric-sidebar","click-".concat(B(e)),"mn-overview")},D=function(e){var t=B(e);(0,y.L)("metric-sidebar","click-".concat(t),"mn-overview",t)},B=function(e){return e.startsWith("Kubernetes")?"k8s":e.replace(/[^\w]/g,"-").toLowerCase()},F=function(e){var t=e.initialChartName,n=e.loaded,r=e.hasSearch,o=void 0===r||r,a=(0,b.Z)({onMenuGroupClick:T,onSubMenuClick:D,loaded:n}),i=a.onMenuGroupClick,c=a.onSubMenuClick;return l.createElement(l.Fragment,null,o&&l.createElement(s.Flex,{column:!0,position:"sticky",top:"0",gap:1},l.createElement(s.Text,{strong:!0},"Sections and Charts"),l.createElement(w.Z,null)),n&&l.createElement(l.Fragment,null,l.createElement(N,{onMenuGroupClick:i,onSubMenuClick:c,initialChartName:t}),l.createElement(v._,{position:"relative",onMenuGroupClick:i,onSubMenuClick:c,width:"100%"})))},M=n(97363),A=["tabs","hiddenTabs","title","nodeIds","selectedTab","setSelectedTab"];function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R={color:{active:"success",notActive:"textLite"}},z={chartIndexing:L(L({},R),{},{iconName:"charts_view",Content:F,dataTestId:"nodeInfo-chartIndexing",label:"Charts"}),filters:L(L({},R),{},{iconName:"filterList",Content:M.Z,dataTestId:"nodeInfo-filters",label:"Filters"}),alerts:L(L({},R),{},{iconName:"alarm_bell",Content:p.Z,dataTestId:"nodeInfo-alertsTab",label:"Alerts"}),info:L(L({},R),{},{iconName:"information",dataTestId:"nodeInfo-alertsTab",Content:g.Z,label:"Info"})},V=[],K=(0,c.default)(s.Tabs).withConfig({displayName:"sidebar__StyledTabs",componentId:"sc-1d5ify6-0"})(["overflow:hidden;height:100%;"]),H=function(e){var t=e.isActive,n=e.color,r=e.name,o=e.label;return l.createElement(h.Z,{plain:!0,content:o},l.createElement(s.Icon,{name:r,color:t?n.active:n.notActive,height:"18px",width:"18px"}))},G=function(e){var t=e.tabs,n=void 0===t?z:t,i=e.hiddenTabs,c=void 0===i?V:i,p=e.title,g=e.nodeIds,h=void 0===g?V:g,v=e.selectedTab,b=e.setSelectedTab,y=(0,a.Z)(e,A),w=(0,d.Z)(!0),E=(0,o.Z)(w,2),x=E[0],O=E[1],C=(0,l.useMemo)((function(){return Object.keys(n).filter((function(e){return!c.includes(e)}))}),[c]),k=(0,l.useCallback)((function(e){b(e),O()}),[]);return l.createElement(u.ZP,{collapsedComponent:l.createElement(m.Z,{onClickTab:k,availableTabs:n,tabsToShow:C}),isOpen:x,header:l.createElement(f.Z,{isOpen:x,onToggle:O,title:p})},l.createElement(s.Flex,{"data-testid":"overview-info",column:!0,overflow:"hidden",height:"100%"},l.createElement(K,{selected:v,onChange:b,noDefaultBorder:!0},C.map((function(e,t){var o=n[e],a=o.iconName,i=o.color,c=o.Content,d=o.dataTestId,u=o.label;return l.createElement(s.Tab,{style:{display:1===C.length?"none":"inherit"},"data-testid":d,maxWidth:"100%",key:a,small:!0,label:l.createElement(H,{isActive:v===t,name:a,color:i,label:u})},l.createElement(s.Flex,{column:!0,overflow:"hidden",height:"100%",position:"relative",gap:3,padding:[2,3]},l.createElement(c,(0,r.Z)({nodeIds:h},y))))})))))}},64504:function(e,t,n){n.d(t,{B:function(){return l},u:function(){return i}});n(69826),n(41539),n(31672),n(2490),n(59461),n(74916),n(4723);var r=n(4480),o=n(9058),a=(0,r.cn)({key:"currentChartsContainerKey",default:null}),i=function(){var e=(0,o.e)(),t=(0,r.sJ)(a);return e&&e.getRoot().getChildren().find((function(e){return e.match({id:t})}))},l=function(){return(0,r.Zl)(a)}},77901:function(e,t,n){n.d(t,{Z:function(){return L}});n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(29439),a=(n(26699),n(32023),n(92222),n(47941),n(67294)),i=n(88553),l=n(44536),c=n(89250),s=n(74059),d=n(37518),u=n(96929),m=n(89479),f=n(40970),p=n(97945),g=n(2077),h=n(41481),v=n(42448),b=n(95248),y=n(12008),w=n(39840),E=n(39612);function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(69826),n(31672),n(59461),n(74916),n(4723);var C=n(24298),k=n(96415),I=n(70873),Z=n(43460),j=n(84817),S=n(9058),P=n(48286),N=n(18039),T=n(64504);function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var A={default:{shouldHide:function(){return!1}},k8s:{shouldHide:function(e){return!e.context.includes("k8s")}}},_=[],L=function(e){return(0,a.memo)((function(t){var n=t.flavour,r=void 0===n?"overview":n,x=t.nodeIds,D=void 0===x?_:x,F=(0,s.th)(),L=(0,d.UL)(),R=(0,b.TA)({extraKey:r,defaultValue:D});R=D.length?D:R;var z=(0,u.fD)(),V=(0,m.hH)(L),K=(0,c.TH)().state,H=(0,m.Cd)(L),G=(0,p.Mm)(R),U=(0,f.Z)(L,G,{spaceId:F}),W=(0,g.d5)({nodeIds:R,flavour:r},F,L),q=W.contexts,Q=W.metadata,J=W.loaded,$=W.dimensionsCount,Y=function(){var e=(0,c.TH)().state,t=(void 0===e?{}:e)||{},n=t.alertId,r=void 0===n?null:n,i=t.after,s=t.before,d=(0,l.Z)(r),u=r||d,m=(0,y.O0)(),f=(0,o.Z)(m,2)[1],p=(0,y.E5)(u);return(0,y.yx)(p.id),(0,a.useEffect)((function(){p.fullyLoaded&&f(O(O({},p),{},{formattedLastStatusChangeValue:(0,w.m9)(p.lastStatusChangeValue,p.units),after:i,before:s}))}),[p.id,p.fullyLoaded]),[u,p.id?"chart_".concat((0,E.Z)(p.context)):null]}(),X=(0,o.Z)(Y,2)[1],ee=D?D.join():r,te=(0,s.Q6)(),ne=(0,i.Z)(),re=(0,o.Z)(ne,2),oe=re[0],ae=re[1].width;!function(e,t,n){var r=n.width,i=n.host;if(!i)throw"No host provided";var l=(0,S.e)(),s=(0,a.useRef)(),d=(0,y.O0)(),u=(0,o.Z)(d,1)[0],f=(0,m.QX)(e,"error"),p=(0,b.I0)(),g=(0,o.Z)(p,2),h=g[0].correlation,v=g[1],w=(0,c.TH)(),E=w.state,x=w.pathname,O=(0,T.B)(),D=(0,m.qU)(e),F=(0,m.w4)(e);(0,a.useLayoutEffect)((function(){if(e&&l&&!f){var n=l.getRoot().getChildren().find((function(e){return e.match({id:x})}));if(!n)return n=l.makeContainer({attributes:{id:x,roomId:e,host:i,navigation:h?"highlight":"pan",overlays:{proceeded:{type:"proceeded"}},composite:!0,nodesScope:t,hasCorrelation:!0,versions:D,width:r,toolboxElements:[Z.default,k.default,I.default,j.Z]}}),l.appendChild(n),O(x),s.current=n,(0,C.unregister)((0,N.M)(l,n),l.on("correlation",(function(e,t){t&&v({correlation:!0})})),n.onAttributeChange("versions",F));O(x)}}),[e,f,x]),(0,a.useMemo)((function(){s.current&&(s.current.setAttribute("width",r),s.current.getNodes().forEach((function(e){return e.updateAttribute("width",r)})))}),[s.current,r]),(0,P.Z)((function(){s.current&&s.current.getNodes().forEach((function(e){e.updateAttribute("nodesScope",t),e.getAttribute("active")&&"chart"===e.type&&e.fetch()}))}),[s.current,t]),(0,a.useEffect)((function(){s.current&&s.current.getApplicableNodes({syncHighlight:!0}).forEach((function(e){e.updateAttribute("navigation",h?"highlight":"pan")}))}),[s.current,h]),(0,a.useEffect)((function(){return function(){return s.current&&s.current.destroy()}}),[]),(0,a.useEffect)((function(){if(s.current&&u){var e=s.current.getNode({id:u.context});if(e){var t=e.getAttribute("overlays");e.updateAttribute("overlays",B(B({},t),{},{alarm:{type:"alarm",status:u.status,value:u.formattedLastStatusChangeValue,when:u.lastStatusChange}})),e.updateAttributes({selectedInstances:["".concat(u.instance,"@").concat(u.nodeId)],selectedNodes:[u.nodeId]})}var n=!!u&&s.current.on("chartLoaded",(function(e){var t=e.getAttribute("id");if(u.context===t){var r=e.getAttribute("overlays");e.updateAttribute("overlays",B(B({},r),{},{alarm:{type:"alarm",status:u.status,value:u.formattedLastStatusChangeValue,when:u.lastStatusChange}})),e.updateAttributes({selectedInstances:["".concat(u.instance,"@").concat(u.nodeId)],selectedNodes:[u.nodeId]}),n()}}));return(0,C.unregister)(n)}}),[s.current,u]),(0,a.useEffect)((function(){if(s.current&&E&&E.context){var e=E.context,t=E.chartId,n=E.nodeId,r=s.current.getNode({id:e});r&&r.updateAttributes({selectedInstances:["".concat(t,"@").concat(n)],selectedNodes:[n]});var o=t&&n&&s.current.on("chartLoaded",(function(r){var a=r.getAttribute("id");e===a&&(r.updateAttributes({selectedInstances:["".concat(t,"@").concat(n)],selectedNodes:[n]}),o())}));return function(){return E&&(0,C.unregister)(o)}}}),[s.current,E])}(L,R,{host:te?"".concat(window.envSettings.agentApiUrl,"/api/v2"):"".concat(window.envSettings.apiUrl,"/api/v3/spaces/").concat(F,"/rooms/").concat(L),width:ae});var ie=(0,m.jg)(L),le=J?Q:H,ce=A[r]||A.default,se=(0,h.Np)(J?q:ie,H,L,M(M({},ce),{},{force:J,cacheKey:"".concat(r,"-").concat($)})),de=(0,m.MS)(L,Q),ue=(0,l.Z)(U),me=se<1,fe=(0,b.I0)("chartName",{key:L,extraKey:ee}),pe=(0,o.Z)(fe,2),ge=pe[0],he=pe[1];(0,a.useEffect)((function(){L&&he(X||(null===K||void 0===K?void 0:K.chartName)||ge)}),[L,X]);var ve=(0,T.u)(),be=Object.keys(le).length<1&&V||R.length&&!G.length,ye=(0,b.H7)({extraKey:r});if(D=D.length?D:ye,!be&&!1!==ue&&U&&"No data for this period"!==U&&!Object.keys(le).length)throw U;return a.createElement(e,{nodeIds:D,loaded:!!L&&z&&ve,getChart:de,areChartsIdsEmpty:me,showNoNodesView:z&&!D.length,showNoChartsView:be,initializing:U&&(0,v.V)(U),chartName:ge,setChartName:he,chartsLoaded:V&&!!ae,invalidationKey:L,flavour:r,chartIds:J?q:ie,widthRef:oe})}))}},72869:function(e,t,n){n.d(t,{Z:function(){return De}});var r={};n.r(r),n.d(r,{OSTableSchema:function(){return L},agentTableSchema:function(){return R},dashboardsTableSchema:function(){return _},dockerTableSchema:function(){return A},machinesTableSchema:function(){return M}});var o=n(87462),a=n(45987),i=n(29439),l=n(4942),c=(n(41539),n(64211),n(2490),n(41874),n(47941),n(85827),n(25387),n(72608),n(21249),n(57640),n(9924),n(82526),n(41817),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(67294)),s=n(64969),d=n(18997),u=n(41331),m=n(37518),f=n(25819),p=n(74059),g=n(78266),h=n(93433),v=(n(92222),n(91008)),b=n(92432),y=n(89250),w=n(39840),E=n(65351),x=n(85287),O=(0,c.memo)((function(e){var t=e.count,n=e.testId;return c.createElement(s.TextHuge,{strong:!0,color:"textDescription",alignSelf:"center","data-testid":n,overflow:"hidden"},isNaN(t)?"-":(0,x.d)(t))})),C=(n(26833),n(2707),n(18446)),k=n.n(C),I=n(71893),Z=n(90509),j={metrics:(0,I.css)(["tbody tr{&:nth-child(odd){background:",";}&:nth-child(even){background:",";}}thead tr{background:",";}"],(0,Z.getColor)("nodeBadgeBackground"),(0,Z.getColor)("panelBg"),(0,Z.getColor)("panelBg")),progressBar:(0,I.css)(["tr{background:",";}"],(0,Z.getColor)("panelBg"))},S=(0,I.default)(s.NetdataTable).attrs({coloredSortedColumn:!1}).withConfig({displayName:"styled__StyledTable",componentId:"sc-1kpag36-0"})(["&&{width:100%;height:auto;align-self:start;th,td{padding:4px 8px;min-width:auto;height:32px;width:auto;}","}"],(function(e){var t=e.layout;return j[t]||j.metrics})),P=(0,I.default)(s.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-1kpag36-1"})(["float:right;cursor:pointer;"]),N=[{id:"value",desc:!1}],T=function(e){var t=e.columns,n=e.data,r=e.layout,o=void 0===r?"metrics":r,a=e.sortBy,i=void 0===a?N:a;return null!==n&&void 0!==n&&n.length?c.createElement(S,{layout:o,data:n,dataColumns:t,sortBy:i,enableSorting:!0}):c.createElement(s.Flex,{width:"100%"},c.createElement(s.TextSmall,{color:"textLite",alignSelf:"center",margin:[0,"auto"]},"No data"))},D=n(44109),B=n(38626),F={name:function(e){return function(e,t){var n=t.maxLength;return{id:"name",accessorKey:"name",header:e,cell:function(e){var t=e.getValue;return n?c.createElement(B.Z,{maxLength:n,text:t(),TextComponent:s.TextSmall}):c.createElement(s.TextSmall,null,t())}}}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},value:{id:"value",header:"#",accessorKey:"value",cell:function(e){var t=e.getValue;return c.createElement(s.TextSmall,{strong:!0},t())}},goToDashboard:{id:"goToDashboard",accessorKey:"value",header:"",cell:function(e){var t=e.cell,n=e.getValue,r=t.row.original.path,o=(0,y.s0)(),a=(0,c.useCallback)((function(){(0,b.L)("total-cust-dashboard","click-cust-dasbhoard","hm-page",n()),o("".concat(r,"/").concat(n()))}),[r,n()]);return c.createElement(P,{name:"goToNode",width:"14px",height:"14px",color:"textDescription",onClick:a})}},progressBar:function(e){return{id:"value",accessorKey:"value",header:e.header,cell:function(e){var t=e.cell,n=e.getValue,r=t.row.original,o=r.name,a=r.total,i=r.color,l=a?n()/a:0,d=(0,D.e)(l);return c.createElement(s.Flex,{column:!0,margin:[1,0,0,0]},o?c.createElement(s.Flex,{justifyContent:"between"},c.createElement(s.TextSmall,null,o),c.createElement(s.TextSmall,{strong:!0},n())):null,c.createElement(s.ProgressBar,{color:i,width:d}))}}}},M=[F.name("VM"),F.value],A=[F.name("Containers"),F.value],_=[F.name("Latest Updated",{maxLength:24}),F.goToDashboard],L=[F.progressBar({header:"OS",dataEntry:"nodesByOS"})],R=[F.progressBar({header:"Agent Version",dataEntry:"nodesByAgentVersion"})],z=(0,c.memo)((function(e){var t=e.data,n=e.schemaKey,o=e.testId,a=Object.values(t).reduce((function(e,t){return e+t}),0),i=Object.keys(t).map((function(e){return{name:e,value:t[e],total:a}})).sort((function(e,t){return t.value-e.value}));return c.createElement(s.Flex,{padding:[0,4],height:"100%","data-testid":"".concat(o,"-table-container"),overflow:"hidden"},c.createElement(T,{columns:r[n],data:i,layout:"progressBar"}))}),(function(e,t){return k()(e,t)}));function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var H=[{id:"name",desc:!1}],G=function(e){var t=e.count,n=e.data,r=(0,p.uk)(),o=(0,m.vf)(),a=function(e){var t=e.data,n=void 0===t?[]:t,r=e.path;return null===n||void 0===n?void 0:n.map((function(e){return K(K({},e),{},{value:e.slug,path:r})}))}({data:n,path:"/spaces/".concat(r,"/rooms/").concat(o,"/dashboards")});return c.createElement(s.Flex,{column:!0,alignItems:"center","data-testid":"totalDashboards-table-container",margin:[0,4],gap:2,overflow:"hidden"},c.createElement(O,{count:t,testId:"total-dashboards-value"}),c.createElement(T,{columns:_,data:a,sortBy:H}))},U=(0,c.memo)(G,(function(e,t){return k()(e,t)})),W=n(9446),q=(0,I.default)(s.TextSmall).withConfig({displayName:"pieChartLabels__StyledText",componentId:"sc-15uxiq-0"})(["display:flex;align-items:center;cursor:",";&:hover{opacity:",";}"],(function(e){return e.onClick?"pointer":"auto"}),(function(e){return e.onClick?"0.7":"1"})),Q=(0,c.memo)((function(e){var t=e.title,n=e.value,r=e.color,o=e.onClick,a=void 0===o?null:o;return c.createElement(s.Flex,{alignItems:"center",justifyContent:"between",width:"100%",gap:4,flex:{grow:1,shrink:0}},c.createElement(s.Flex,{gap:1},c.createElement(s.Flex,{width:"4px",height:"16px",background:r}),c.createElement(q,{whiteSpace:"nowrap",onClick:a},t,a&&c.createElement(s.Icon,{color:"textLite",margin:[0,0,0,1],name:"nav_arrow_goto",height:"10px",width:"10px"}))),c.createElement(s.Text,{strong:!0},null!==n&&void 0!==n?n:"-"))})),J=function(e){var t=e.data;return c.createElement(s.Flex,{column:!0,alignItems:"start",justifyContent:"center",gap:5},t.map((function(e,t){var n=e.title,r=e.value,o=e.color,a=e.onClick;return c.createElement(Q,{key:"".concat(n,"-").concat(r,"-").concat(t),title:n,value:r,color:o,onClick:a})})))};function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var X=function(e){var t=e.data,n=e.theme;return t.map((function(e){return Y(Y({},e),{},{color:(0,s.getColor)(e.color)({theme:n})})}))},ee=function(e){var t=e.chartData,n=void 0===t?[]:t,r=e.lineWidth,o=void 0===r?15:r,a=e.animate,i=void 0===a||a,l=e.label,d=e.hasData,u=(0,c.useContext)(I.ThemeContext);return c.createElement(s.Flex,{gap:4,margin:[0,4],height:{min:"100px",max:"130px"},alignItems:"center"},c.createElement(J,{data:n}),c.createElement(s.Flex,{height:"100px",flex:{grow:1,shrink:1}},d?c.createElement(W.PieChart,{label:function(){return l},labelStyle:{fontSize:"24px",fontWeight:400,fontFamily:"IBM Plex Sans",lineHeight:" 32px",fill:(0,s.getColor)("textDescription")({theme:u})},labelPosition:0,data:X({data:n,theme:u}),lineWidth:o,animate:i}):c.createElement(s.Icon,{color:"border",name:"pie_chart_skeleton",width:"100px",height:"100px",alignSelf:"center"})))},te=function(e){return Object.keys(e).reduce((function(t,n){return[].concat((0,h.Z)(t),[{name:n,value:e[n]}])}),[]).sort((function(e,t){return t.value-e.value}))},ne=function(e){var t=e.data,n=t.vm,r=t.docker,o=t.chartData,a=t.hasData,i=te(n),l=te(r);return c.createElement(s.Flex,{justifyContent:"around","data-testid":"nodesByMachine-tables-container",overflow:"hidden"},c.createElement(s.Flex,{flex:{grow:1,shrink:0},basis:"200px"},c.createElement(ee,{chartData:o,hasData:a})),c.createElement(s.Flex,{gap:2,flex:{grow:1,shrink:0},basis:"50%",padding:[0,4,0,2]},c.createElement(T,{columns:M,data:i}),c.createElement(T,{columns:A,data:l})))},re=(0,c.memo)(ne,(function(e,t){return k()(e,t)})),oe=n(82351);function ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var le=(0,I.default)(s.Text).withConfig({displayName:"nodesByDataReplication__StyledValue",componentId:"sc-19v6tvl-0"})(["line-height:17px;"]),ce=function(e){var t=e.parent,n=e.child,r=t+n,o=(0,D.e)(t/r);return c.createElement(s.Flex,{column:!0,gap:1},c.createElement(s.Flex,{justifyContent:"between","data-testid":"nodesByDataReplication-parent-child"},c.createElement(me,{name:"Parents",value:t,background:["blue","aquamarine"]}),c.createElement(me,{name:"Children",value:n,background:["purple","lilac"]})),c.createElement(s.ProgressBar,{background:["purple","lilac"],color:["blue","aquamarine"],width:o}))},se={r_1:{label:"1",color:["blue","indigo"]},r_2:{label:"2",color:["green","limeGreen"]},"r_*":{label:">2",color:["yellow","seaBuckthorn"]}},de=function(){return c.createElement(s.Flex,{column:!0,gap:1,alignItems:"center",width:"220px","data-testid":"nodesByDataReplication-information-text",overflow:"hidden"},c.createElement(s.TextMicro,{color:"white"},c.createElement(s.TextMicro,{color:"white",strong:!0},"Replication factor 1:")," ","The node's data are only on the node itself. Lose the node, lose the data!"),c.createElement(s.TextMicro,{color:"white"},c.createElement(s.TextMicro,{color:"white",strong:!0},"Replication factor 2:")," ","The node's metrics are replicated to one parent. The parent can trigger alerts for the child."),c.createElement(s.TextMicro,{color:"white"},c.createElement(s.TextMicro,{color:"white",strong:!0},"Replication factor ",">2",":")," ","Same as 2, but with the metrics replicated to more than one parent. Each parent in the hierarchy can trigger alerts for its children."),c.createElement(s.TextMicro,{color:"white",margin:[2,0]},"Aim to have most of your nodes with at least a factor of 2 and your critical ones with ",">2","."))},ue=function(e){var t=(0,c.useMemo)((function(){var t=Object.keys(se).reduce((function(t,n,r){var o,a=e[n]||0;return[].concat((0,h.Z)(t),[ie(ie({key:n},se[n]),{},{value:a,sumValue:((null===(o=t[r-1])||void 0===o?void 0:o.sumValue)||0)+a})])}),[]);return[t,t[t.length-1].sumValue]}),[e]),n=(0,i.Z)(t,2),r=n[0],o=n[1];return c.createElement(s.Flex,{column:!0,margin:[6,0,0]},c.createElement(s.Flex,{margin:[0,0,2],gap:1},c.createElement(s.TextSmall,null,"Replication factor"),c.createElement(oe.Z,{isBasic:!0,plain:!0,content:de,align:"bottom"},c.createElement(s.Icon,{name:"information",color:"textDescription",size:"small"}))),c.createElement(s.Flex,{justifyContent:"between",margin:[0,0,1],"data-testid":"nodesByDataReplication-replications"},r.map((function(e){return c.createElement(me,{key:e.key,name:e.label,value:e.value,background:e.color})}))),c.createElement(s.ProgressBar,{background:"nodeBadgeBackground",value:r.map((function(e){return{width:(0,D.e)(e.value/o),color:e.color}}))}))},me=function(e){var t=e.name,n=e.value,r=void 0===n?"-":n,o=e.background,a=void 0===o?"text":o;return c.createElement(s.Flex,{alignItems:"center"},c.createElement(s.Flex,{width:"4px",height:"16px",background:a,round:3,margin:[0,1,0,0]}),c.createElement(s.TextSmall,{color:"textDescription",margin:[0,3,0,0]},t),c.createElement(le,{color:"textDescription",strong:!0},r))},fe=function(e){var t=e.parentChild,n=e.replication;return c.createElement(s.Flex,{column:!0,margin:[4,4,1],"data-testid":"nodesByDataReplication-container"},c.createElement(ce,t),c.createElement(ue,n))},pe={dataReplication:function(){return(0,b.L)("nodes-data-replication","click-link-stream-replication","hm-page")},dataRetention:function(){return(0,b.L)("nodes-data-retention","click-link-dbengine-retention","hm-page")}},ge=function(){var e=(0,m.A3)(),t=(0,y.s0)(),n=(0,w.yi)(),r=(0,E.Z)("manageWarRoom").handleOpenModal,o=(0,c.useCallback)((function(){return r("users")}),[]);return{claimedNodes:{props:{title:"Nodes",description:"Number of nodes claimed to Netdata in current room",basis:"calc(100%/12)",flex:{grow:"1",shrink:"0"},onClick:function(){return t("".concat(e,"/nodes"))},testId:"claimedNodes"},Component:O,selector:function(e){var t=e.nodes;return t?{count:t.offline+t.online+t.stale,updatedAt:t.updatedAt}:{count:"-"}}},nodesByStatus:{props:{title:"Nodes by status",description:"Breakdown of the nodes by their status in regards to Netdata",tooltip:c.createElement(s.Flex,{column:!0,width:{max:"200px"},gap:2},c.createElement(s.TextMicro,{color:"white"},c.createElement(s.TextMicro,{color:"white",strong:!0},"Live:")," ","Node is actual collecting and streaming metrics to Netdata"),c.createElement(s.TextMicro,{color:"white"},c.createElement(s.TextMicro,{color:"white",strong:!0},"Stale:")," ","Node is currently offline and not streaming metrics to Netdata. It can show historical data from a parent node"),c.createElement(s.TextMicro,{color:"white"},c.createElement(s.TextMicro,{color:"white",strong:!0},"Offline:")," ","Node is currently offline, not streaming metrics to Netdata and not available in any parent nodes"),c.createElement(s.TextMicro,{color:"white"},c.createElement(s.TextMicro,{color:"white",strong:!0},"Unseen:")," ","Nodes have never been connected to Netdata, they are claimed but no successful connection was established")),basis:"calc(100%/6)",flex:{grow:"2",shrink:"0"},testId:"nodesByStatus"},Component:ee,selector:function(n){var r=n.nodes,o=function(e){var t;return null!==(t=null===r||void 0===r?void 0:r[e])&&void 0!==t?t:"-"},a=function(){return t("".concat(e,"/nodes"))};return{chartData:[{title:"Live",value:o("online"),color:"live",onClick:a},{title:"Stale",value:o("stale"),color:"stale",onClick:a},{title:"Offline",value:o("offline"),color:"offline",onClick:a},{title:"Unseen",value:o("unseen"),color:"unseen",onClick:a}],hasData:!!r&&!r.error,updatedAt:null===r||void 0===r?void 0:r.updatedAt}}},nodesByML:{props:{title:"Nodes by ML",description:"Breakdown of the nodes in regards to our ML features",basis:"calc(100%/6)",flex:{grow:"2",shrink:"0"},onClick:function(){return t("".concat(e,"/anomalies"))},testId:"nodesByML"},Component:ee,selector:function(e){var t,n,r,o,a,i,l=e.nodes;return{chartData:[{title:"Enabled",value:null!==(t=null===l||void 0===l||null===(n=l.ml)||void 0===n?void 0:n.enabled)&&void 0!==t?t:"-",color:["blue","aquamarine"]},{title:"Disabled",value:null!==(r=null===l||void 0===l||null===(o=l.ml)||void 0===o?void 0:o.disabled)&&void 0!==r?r:"-",color:["yellow","yellow100"]},{title:"Not Capable",value:null!==(a=null===l||void 0===l||null===(i=l.ml)||void 0===i?void 0:i.notCapable)&&void 0!==a?a:"-",color:"placeholder"}],hasData:!!l&&!l.error,updatedAt:null===l||void 0===l?void 0:l.updatedAt}}},nodesByMachine:{props:{title:"Nodes over type of machine/technology",description:"Breakdown of the machines/technology where Netdata is running on",basis:"550px",flex:{grow:"5",shrink:"0"},testId:"nodesByMachine"},Component:re,selector:function(e){var t,n,r,o,a,i,l,c,s,d,u,m=e.nodes;return{data:{vm:null!==(t=null===m||void 0===m?void 0:m.vmTechnology)&&void 0!==t?t:{},docker:null!==(n=null===m||void 0===m?void 0:m.containerRuntime)&&void 0!==n?n:{},chartData:[{title:"Bare Metal",value:null!==(r=null===m||void 0===m||null===(o=m.type)||void 0===o?void 0:o.bareMetal)&&void 0!==r?r:"-",color:["blue","indigo"]},{title:"VM",value:null!==(a=null===m||void 0===m||null===(i=m.type)||void 0===i?void 0:i.virtualMachine)&&void 0!==a?a:"-",color:["blue","cyan"]},{title:"Container",value:null!==(l=null===m||void 0===m||null===(c=m.type)||void 0===c?void 0:c.container)&&void 0!==l?l:"-",color:["purple","lilac"]}].concat((0,h.Z)(null!==m&&void 0!==m&&null!==(s=m.type)&&void 0!==s&&s.unknown?[{title:"Unknown",value:null!==(d=null===m||void 0===m||null===(u=m.type)||void 0===u?void 0:u.unknown)&&void 0!==d?d:"-",color:"placeholder"}]:[])),hasData:!!m&&!m.error},updatedAt:null===m||void 0===m?void 0:m.updatedAt}}},nodesByDataReplication:{props:{title:"Nodes by data replication",description:c.createElement(c.Fragment,null,"Summary of your"," ",c.createElement(v.Z,{Component:s.TextMicro,href:"https://learn.netdata.cloud/docs/metrics-storage-management/enable-streaming",target:"_blank",onClick:pe.dataReplication},"streaming and replication")," ","status across your nodes"),basis:"calc(100%/6)",flex:{grow:"1",shrink:"0"},minWidth:"250px",testId:"nodesByDataReplication"},Component:fe,selector:function(e){var t=e.nodes;return t&&!t.error?{parentChild:{parent:t.parent,child:t.child},replication:t.replicationFactor,updatedAt:t.updatedAt}:{parentChild:{},replication:{}}}},nodesByOS:{props:{title:"Nodes by O/S version",description:"Breakdown of the nodes in regards to the O/S version they are running",basis:"430px",flex:{grow:"5",shrink:"0"},schemaKey:"OSTableSchema",dataGa:"node-os-version",testId:"nodesByOS"},Component:z,selector:function(e){var t=e.nodes;return t&&!t.error?{data:t.osVersion,updatedAt:t.updatedAt}:{data:{}}}},nodesByAgentVersion:{props:{title:"Nodes by Agent version",description:"Breakdown of the nodes in regards to the Agent version running on them",basis:"430px",flex:{grow:"5",shrink:"0"},schemaKey:"agentTableSchema",dataGa:"node-agent-version",testId:"nodesByAgentVersion"},Component:z,selector:function(e){var t=e.nodes;return t&&!t.error?{data:t.agentVersion,updatedAt:t.updatedAt}:{data:{}}}},activeAlerts:{props:{title:"Active Alerts",description:"Breakdown of the active alerts by status across all live nodes",basis:"calc(100%/6)",flex:{grow:"0",shrink:"0"},testId:"activeAlerts"},Component:ee,selector:function(e){var t=e.alarms;return t&&!t.error?{chartData:[{title:"Critical",value:t.critical,color:"errorText",onClick:function(){return n("critical")}},{title:"Warning",value:t.warning,color:"warningText",onClick:function(){return n("warning")}}],label:t.critical+t.warning,hasData:!!t&&!t.error&&t.critical+t.warning,updatedAt:t.updatedAt}:{chartData:[{title:"Critical",value:"-",color:"errorText",onClick:function(){return n("critical")}},{title:"Warning",value:"-",color:"warningText",onClick:function(){return n("warning")}}],hasData:!!t&&!t.error}}},usersByRole:{props:{title:"Users by role",description:"Breakdown of the users by their role",basis:"calc(100%/6)",flex:{grow:"0",shrink:"0"},onClick:function(){return o()},testId:"usersByRole"},Component:ee,selector:function(e){var t=e.spaceroom;return t&&!t.error?{chartData:[{title:"admin",value:t.admin,color:["green","green140"]},{title:"user",value:t.user,color:["purple","lilac"]}],label:t.admin+t.user,hasData:!!t&&!t.error,updatedAt:t.updatedAt}:{chartData:[{title:"admin",value:"-",color:["green","green140"]},{title:"user",value:"-",color:["purple","lilac"]}],hasData:!!t&&!t.error}}},totalDashboards:{props:{title:"Total Dashboards",description:"Number of the currently available custom dashboards in room",basis:"calc(100%/6)",flex:{grow:"0",shrink:"0"},testId:"totalDashboards"},Component:U,selector:function(e){var t=e.dashboards;return t&&!t.error?{count:t.dashboards,data:t.lastUpdated,updatedAt:t.updatedAt}:{count:"-",data:[]}}}}},he=function(e){var t=e.title,n=e.description,r=e.tooltip;return c.createElement(s.Flex,{column:!0,margin:[4,4,3],height:{min:12}},c.createElement(s.Flex,{gap:1,alignItems:"center"},c.createElement(s.Text,{color:"text","data-testid":"metrics-header-title"},t),r&&c.createElement(oe.Z,{isBasic:!0,plain:!0,content:r,align:"bottom"},c.createElement(s.Icon,{name:"information",color:"textDescription",size:"small"}))),c.createElement(s.TextMicro,{color:"textDescription","data-testid":"metrics-header-description"},n))},ve=(0,c.memo)(he),be=n(43337),ye=n(20709),we=function(e){var t=e.updatedAt,n=(0,c.useState)(),r=(0,i.Z)(n,2)[1],o=function(e){if(!e)return"";var t=new Date(e);return t.getTime()?(0,ye.Z)(t,new Date):""}(t);return(0,be.Z)((function(){return r(Math.random())}),6e4),c.createElement(s.Flex,{justifyContent:"end",margin:[2,4]},c.createElement(s.TextFemto,{color:"textLite","data-testid":"metrics-footer-last-updated"},"Last updated: ",o||"-"))},Ee=n(95248),xe=n(96929),Oe=n(36560),Ce=n(20046),ke=["basis","title","flex","description","tooltip","minWidth","onClick","testId"];function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var je=function(e,t){var n=(0,p.th)(),r=(0,m.UL)(),o=(0,Ee.H7)();(0,d.Z)((function(){return{enabled:!!(n&&r&&o.length&&null!==e&&void 0!==e&&e.length),fetch:function(){return(0,f.mP)(n,r,e,o)},onReceive:function(e){var n=e.data;return t((function(e){var t=Ze(Ze(Ze({},e),n),{},{charts:Ze(Ze({},e.charts),n.charts)});return function(e,t){return e===t||!Object.keys(e).some((function(n){return!(0,u.ZP)(e[n],t[n],{omit:["updatedAt","latency"]})}))}(t,e)?e:t}))},onFail:function(t){return e.reduce((function(e,n){var r=n.name;return Ze(Ze({},e),{},(0,l.Z)({},r,{error:t}))}),{})},pollingOptions:{pollingInterval:588e3}}}),[n,r,o.length,e])},Se=[{name:"charts",projections:"points"}],Pe=[{name:"charts",projections:"retention"}],Ne=[{name:"charts",projections:"metrics"}],Te=[{name:"nodes"},{name:"spaceroom"},{name:"alarms"},{name:"dashboards"}],De=function(){var e=(0,c.useState)({}),t=(0,i.Z)(e,2),n=t[0],r=t[1];je(Se,r),je(Pe,r),je(Ne,r),je(Te,r);var l=(0,xe.zN)(),d=(0,xe.fD)(),u=ge();return d?d&&!l.length?c.createElement(Oe.Z,null):c.createElement(c.Fragment,null,c.createElement(s.Flex,{alignItems:"center",background:"mainBackground","data-testid":"home-header",gap:2,justifyContent:"between",padding:[2,4],width:"100%"},c.createElement(Ce.Z,null)),c.createElement(s.Flex,{flexWrap:!0,overflow:"auto",padding:[0,0,4,4],"data-testid":"roomHome-layout-container"},Object.keys(u).map((function(e){var t=u[e],r=t.props,i=r.basis,l=r.title,d=r.flex,m=r.description,f=r.tooltip,p=r.minWidth,g=void 0===p?"250px":p,h=r.onClick,v=void 0===h?null:h,b=r.testId,y=(0,a.Z)(r,ke),w=t.Component,E=(0,t.selector)(n);return c.createElement(s.Flex,{key:e,column:!0,basis:i,flex:d,height:"280px",width:{min:g},margin:[4,4,0,0],background:"panelBg",justifyContent:"between",round:!0,"data-testid":"metrics-container-".concat(b),onClick:v,cursor:v?"pointer":"auto"},c.createElement(ve,(0,o.Z)({title:l,description:m,tooltip:f},E)),c.createElement(w,(0,o.Z)({testId:e},y,E)),c.createElement(we,E))})))):c.createElement(g.Z,{title:"Loading room stats..."})}},37497:function(e,t,n){n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(15861),a=n(64687),i=n.n(a),l=n(4480),c=n(67294),s=n(37518),d=n(25819);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(e,t){var n=(0,l._8)((function(n){var r=n.snapshot,a=n.set;return(0,o.Z)(i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,r.getPromise((0,s.n2)({id:t,key:"fullyLoaded"}));case 2:if(!n.sent){n.next=5;break}return n.abrupt("return");case 5:(0,d.fv)(e,t).then((function(t){var n=t.data;a((0,s.ZB)(),m(m({},n),{},{spaceId:e,fullyLoaded:!0,loaded:!0}))}));case 6:case"end":return n.stop()}}),n)})))}),[e,t]);(0,c.useEffect)((function(){e&&t&&n()}),[e,t])}},60464:function(e,t,n){var r=n(93433),o=n(4942),a=(n(21249),n(57640),n(9924),n(41539),n(15581),n(2490),n(34514),n(54747),n(85827),n(25387),n(72608),n(92222),n(47941),n(82526),n(57327),n(88449),n(59849),n(38880),n(49337),n(33321),n(69070),n(4480)),i=n(18997),l=n(12008),c=n(48450),s=n(77796),d=n(99322),u=n(16634);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).polling,o=void 0===n||n,m=(0,a._8)((function(e){var n=e.set;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).data,o=void 0===e?[]:e;n((0,d.e8)({id:t,key:"ids"}),o.map((function(e){return e.id}))),n((0,d.e8)({id:t,key:"loaded"}),!0),n((0,d.e8)({id:t,key:"updatedAt"}),(new Date).toISOString()),n((0,d.e8)({id:t,key:"error"}),null),o.forEach((function(e){n((0,l.fp)({id:e.id}),(function(t){return f(f({},t),{},{loaded:!0},e)}))}));var a=o.reduce((function(e,t){var n=t.id,o=t.nodeId;return e[o]=[].concat((0,r.Z)(e[o]||[]),[n]),e}),{});n(s.in,a)}}),[e,t]),p=(0,a._8)((function(e){var n=e.set;return function(e){n((0,d.e8)({id:t,key:"error"}),(0,u.Z)(e))}}));(0,i.Z)((function(){return{enabled:!!e&&!!t,polling:o,fetch:function(){return(0,c.sr)(e,t)},onFail:p,onReceive:m,force:!0}}),[e,t])}},40970:function(e,t,n){n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(29439),a=(n(47941),n(92222),n(67294)),i=n(44536),l=n(68035),c=n(89479),s=n(95248),d=n(25819),u=n(42448);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.spaceId,m=n.autorun,p=void 0!==m&&m,g=(0,a.useState)(null),h=(0,o.Z)(g,2),v=h[0],b=h[1],y=(0,s.by)(),w=y.after,E=y.before,x=(0,a.useRef)();x.current={after:w<0?w:Math.floor(w/1e3),before:w<0?0:Math.ceil(E/1e3)};var O=function(e){if(e&&null!==e&&void 0!==e&&e.response){var t=e.response.data.errorMsgKey;b(t)}else b(e)},C=(0,a.useMemo)((function(){return(0,u.V)(v)?5e3:65e3}),[v]),k=(0,a.useRef)(),I=(0,c.w4)(e),Z=function(e){var t=e.results,n=e.versions;I((function(e){return f(f({},e),n)})),b((!t||!Object.keys(t).length)&&"No data for this period")},j=(0,c.qU)(e).contextsHardHash,S=(0,i.Z)(j);return(0,l.Z)((function(){return{cache:!1,key:"spaces.".concat(r,".rooms.").concat(e,".charts"),polling:!1,autorun:p||Boolean(r&&e),fetch:function(){return(0,d.Mn)(r,e,t,f({},x.current))},association:{getIds:function(){return(0,c.dA)({roomId:e,merge:k.current===t})},getError:function(){return(0,c.W2)({id:e,key:"error"})},getLoaded:function(){return(0,c.W2)({id:e,key:"loaded"})},getUpdatedAt:function(){return(0,c.W2)({id:e,key:"updatedAt"})}},getResource:function(t){return(0,c.PP)({id:e,key:t})},getResourcesInitializer:function(){var n=(0,c.Q7)({id:e,merge:k.current===t});return k.current=t,n},getResourceInitialState:function(e){return f({fullyLoaded:!0},e)},onFail:O,pollingOptions:{pollingInterval:C},onReceive:Z,after:w,nodeIds:t,force:!0}}),[r,e,t,C,!!S&&!!j&&S!==j,w,E]),v}},29748:function(e,t,n){var r=n(4942),o=(n(2707),n(41539),n(15581),n(2490),n(34514),n(54747),n(21249),n(57640),n(9924),n(47941),n(82526),n(57327),n(88449),n(59849),n(38880),n(49337),n(33321),n(69070),n(4480)),a=n(47133),i=n(18997),l=n(74059),c=n(37518),s=n(25819),d=n(5934);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(){var e=(0,l.th)(),t=(0,c.UL)(),n=(0,o._8)((function(e){var n=e.set;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).data,r=(void 0===e?{}:e).results;if(n((0,d.oq)({id:t,key:"loaded"}),!0),null!==r&&void 0!==r&&r.length){var o=r.sort((function(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"accent"})}));o.forEach((function(e){return n((0,a.lz)(e.id),(function(t){return m(m({},t),{},{loaded:!0},e)}))}));var i=o.map((function(e){return e.id}));n((0,d.oq)({id:t,key:"ids"}),i)}}}));(0,i.Z)((function(){return{enabled:!!e&&!!t,fetch:function(){return(0,s.j2)(e,t)},onReceive:n}}),[e,t])}},39904:function(e,t,n){n(92222);var r=n(68035),o=n(274),a=n(34912),i=n(44197),l=n(1229),c=n(33335);t.Z=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).polling,s=void 0===n||n,d=(0,c.gI)("room:ReadUsers");(0,r.Z)((function(){return{key:"spaces.".concat(e,".rooms.").concat(t,".members"),autorun:!!e&&!!t&&d,fetch:function(){return(0,o.fQ)(e,t)},polling:s,association:{getError:function(){return(0,l.Ci)({id:t,key:"error"})},getIds:function(){return(0,l.Ci)({id:t,key:"ids"})},getLoaded:function(){return(0,l.Ci)({id:t,key:"loaded"})},getUpdatedAt:function(){return(0,l.Ci)({id:t,key:"updatedAt"})}},sort:function(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"accent"})},getResource:function(e){return(0,a.mX)({id:e})},getResourcesInitializer:function(){return a.Bb},getResourceInitialState:function(){return i.E},pollingOptions:{pollingInterval:18e4}}}),[e,t])}},29516:function(e,t,n){var r=n(18997),o=n(4480),a=n(48450),i=n(45781),l=n(95383),c=n(33335);t.Z=function(e){var t=(0,o._8)((function(t){var n=t.set;return function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).data.results;n((0,i.e$)({id:e}),t)}})),n=(0,o._8)((function(t){var n=t.set;return function(t){return n((0,i.e$)({id:e,key:"error"}),t)}})),s=(0,l.y3)(e,"loaded"),d=(0,c.gI)("alert:ReadAll");(0,r.Z)((function(){return{enabled:d&&!!e&&s,fetch:function(){return(0,a.Kp)(e)},onFail:n,onReceive:t,pollingOptions:{pollingInterval:15e4}}}),[e,!!s])}},29983:function(e,t,n){var r=n(4480),o=n(68035),a=n(274),i=n(34912),l=n(94666),c=n(1229),s=n(33335);t.Z=function(e){var t=(0,r._8)((function(t){var n=t.set;return function(t){var r=t.results;return n((0,l.J9)(e),r)}})),n=(0,s.gI)("user:ReadAll");(0,o.Z)((function(){return{key:"spaces.".concat(e,".members"),autorun:!!e&&n,fetch:function(){return(0,a.Q5)(e)},association:{getError:function(){return(0,c.Ci)({id:e,key:"error"})},getIds:function(){return(0,l.WA)({id:e,key:"ids"})},getLoaded:function(){return(0,l.WA)({id:e,key:"loaded"})},getUpdatedAt:function(){return(0,l.WA)({id:e,key:"updatedAt"})}},sort:function(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"accent"})},getResource:function(e){return(0,i.mX)({id:e})},getResourcesInitializer:function(){return i.Bb},onReceive:t,pollingOptions:{pollingInterval:315e3}}}),[e])}},37682:function(e,t,n){var r=n(67294),o=n(6557),a=n.n(o),i=n(18446),l=n.n(i),c=n(44682);t.Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a(),n=(0,r.useRef)();return(0,c.Sz)(e,(function(e){var r=t(e);return l()(n.current,r)||(n.current=r),n.current}))}},69063:function(e,t,n){n(92222),n(74916),n(77601);var r=n(67294),o=n(89250),a=n(9058),i=n(24298),l=n(74059),c=n(37518);t.Z=function(){var e=(0,a.e)(),t=function(){var e=(0,l.uk)(),t=(0,c.vf)();return"/spaces/".concat(e,"/rooms/").concat(t,"/overview")}(),n=(0,o.s0)();(0,r.useEffect)((function(){if(e)return(0,i.unregister)(e.on("goToLink",(function(e,r){var o,a=t;return e.getParent().getAttribute("roomId")&&(a=e.getParent().getId(),a=/^\/spaces/.test(a)?a:t),n(a,r?{state:{chartName:r},replace:!0}:{state:{contextToGo:null===e||void 0===e||null===(o=e.getAttribute("contextScope"))||void 0===o?void 0:o[0]},replace:!0})})))}),[e,t])}},9449:function(e,t,n){var r=n(67294),o=n(44682);t.Z=function(e){var t=(0,r.useRef)();return(0,o.Sz)(e,(function(e){return t.current=e,!1})),t}},18997:function(e,t,n){var r=n(29439),o=(n(41539),n(88674),n(17727),n(67294)),a=n(50308),i=n.n(a),l=n(9058),c=n(46189),s=n(29283),d=n(13477);t.Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,l.e)(),a=(0,o.useMemo)((function(){return n?n.getRoot():null}),[n]),u=(0,o.useMemo)(e,t),m=(0,o.useRef)(!1),f=(0,s.Z)(),p=(0,r.Z)(f,2)[1],g=(0,o.useCallback)((function(e){m.current=!1;var t=u.fetch,n=u.onStart,r=void 0===n?i():n,o=u.onFail,l=void 0===o?i():o,s=u.onReceive,d=void 0===s?i():s,f=u.onSettle,g=void 0===f?i():f,h=u.polling,v=void 0===h||h,b=u.pollingOptions;r();var y={timeoutId:null,promise:null},w=function(){return y.promise=t(e),y.promise.then(d).catch((function(e){if(!e.isCancel)throw e})),y.promise},E=function e(){y.timeoutId=setTimeout((function(){return null!==b&&void 0!==b&&b.shouldPause&&a&&(a.getAttribute("hovering")||a.getAttribute("paused"))?e():p.current?void w().then((function(){return!m.current&&v&&e()})).catch((function(t){return!m.current&&!t.isCancel&&v&&e()})):e()}),(null===b||void 0===b?void 0:b.pollingInterval)||c.Z.pollingInterval)};return w().then((function(){return!m.current&&v&&E()})).catch((function(e){return!e.isCancel&&l(e)})).finally(g),function(){var e,t;m.current=!0,null===(e=y.promise)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),clearTimeout(y.timeoutId)}}),t),h=(0,d.Iy)("isAnonymous");return(0,o.useEffect)((function(){var e=u.enabled,t=void 0===e||e,n=u.force;if(!h||void 0!==n&&n)return t?g():void 0}),[g]),g}},3975:function(e,t,n){n.d(t,{QF:function(){return c},vq:function(){return s}});var r=n(67294),o=n(89250),a=n(37518),i=n(74059),l=function(e,t,n){var o=t();(0,r.useLayoutEffect)((function(){o!==e&&n(e)}),[o,e])},c=function(){var e=(0,o.UO)().roomSlug,t=(0,a.TF)();return l(e,a.vf,t),e},s=function(){var e=(0,o.UO)().spaceSlug,t=(0,i.$v)();return l(e,i.uk,t),e};t.ZP=function(){return[s(),c()]}}}]); \ No newline at end of file