File: //opt/netdata/usr/local/share/netdata/web/v3/110.1ba0a8046070fda051d6.chunk.js
try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="825402dd-2f67-4f0a-b9a4-0d22e84f54eb",e._sentryDebugIdIdentifier="sentry-dbid-825402dd-2f67-4f0a-b9a4-0d22e84f54eb")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"3f08f25a08844f19a100a9f4d8b4be2360ab3354"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[110],{549:(e,t,n)=>{n.d(t,{G:()=>E,A:()=>H});var r=n(33185),o=n(63766),i=n(78152),s=(n(98992),n(72577),n(81454),n(37550),n(96540)),a=n(6304),l=n(74891),c=n(83747),d=n(80590),u=n(94404),h=(n(54520),n(3949),n(4719)),x=n(55125),g=n(74848);const m=(0,s.memo)((e=>{let{matchType:t,value:n,sublabel:r,onRemove:i}=e;return(0,g.jsx)(o.Pill,{flavour:"neutral",hollow:!0,children:(0,g.jsxs)(o.Flex,{gap:1,alignItems:"center",children:[(0,g.jsxs)(o.Flex,{column:!0,gap:0,overflow:"hidden",flex:!0,children:[(0,g.jsxs)(o.TextSmall,{strong:!0,truncate:!0,children:[t,": ",n]}),r&&(0,g.jsx)(o.TextMicro,{color:"textLite",truncate:!0,children:r})]}),(0,g.jsx)(o.Icon,{name:"x",size:"small",onClick:i,cursor:"pointer",color:"textLite",_hover:{color:"text"}})]})})}));n(71517),n(11379),n(93777),n(14190),n(12359),n(86097),n(17273),n(27415),n(19929),n(37583),n(55122),n(20230),n(57268),n(79733);var p=n(19186),f=n(87083),j=n(24609),b=n(258),v=n(60602);const y=["labels","dimensions","instances"],w=(e,t,n)=>{const[r,o]=(0,s.useState)(""),i=(0,v.A)(r,300),[a,l]=(0,s.useState)(null),[c,d]=(0,s.useState)(!1),u=(0,p.ID)(),h=(0,j.vt)(),x=(0,f.w7)({extraKey:n,merge:!1,scoped:!0}),g=(0,s.useMemo)((()=>{if(e?.contexts)return e.contexts}),[e]);(0,s.useEffect)((()=>{if(!i.trim())return l(null),void d(!1);d(!0),(0,b.Xx)(u,i,{selectedNodes:x,scopeContexts:g,spaceId:h}).then((e=>{const t=e?.data?.contexts;if(!t)return void l(null);const n={},r={dimensions:new Map},o=new Map,i=new Map,s={dimensions:0,instances:0,labels:0},a=/^\.\.\.\s+(\d+)\s+(values?|instances?|dimensions?)\s+more$/i;Object.entries(t).forEach((e=>{let[t,n]=e;const l=n.title||t;n.dimensions&&n.dimensions.forEach((e=>{const n=e.match(a);n?s.dimensions+=parseInt(n[1],10):(r.dimensions.has(e)||r.dimensions.set(e,[]),r.dimensions.get(e).push({title:l,contextId:t}))})),n.instances&&n.instances.forEach((e=>{const n=e.match(a);if(n)return void(s.instances+=parseInt(n[1],10));const r=e.split("."),i=r[r.length-1];o.has(i)||o.set(i,{contextIds:[],contextToInstance:{},contexts:[]});const c=o.get(i);c.contextIds.push(t),c.contextToInstance[t]=e,c.contexts.push({title:l,contextId:t})})),n.labels&&Object.entries(n.labels).forEach((e=>{let[n,r]=e;if(Array.isArray(r)){i.has(n)||i.set(n,new Map);const e=i.get(n);r.forEach((n=>{const r=n.match(a);r?s.labels+=parseInt(r[1],10):(e.has(n)||e.set(n,[]),e.get(n).push({title:l,contextId:t}))}))}}))})),Object.entries(r).forEach((e=>{let[t,r]=e;(r.size>0||s[t]>0)&&(n[t]=[],r.forEach(((e,r)=>{const o=e.map((e=>e.contextId)),i=e.map((e=>e.title));let s;s=1===e.length?e[0].title:2===e.length?`${e[0].title}, ${e[1].title}`:`${e[0].title}, ${e[1].title} and ${e.length-2} more`,n[t].push({value:r,label:r,sublabel:s,contextIds:o,allContextTitles:i})})),n[t].sort(((e,t)=>e.label.localeCompare(t.label))),s[t]>0&&n[t].push({value:null,label:`+${s[t]} more`,sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0}))})),(o.size>0||s.instances>0)&&(n.instances=[],o.forEach(((e,t)=>{const{contextIds:r,contextToInstance:o,contexts:i}=e,s=i.map((e=>e.title));let a;a=1===i.length?i[0].title:2===i.length?`${i[0].title}, ${i[1].title}`:`${i[0].title}, ${i[1].title} and ${i.length-2} more`,n.instances.push({value:t,label:t,sublabel:a,contextIds:r,contextToInstance:o,allContextTitles:s})})),n.instances.sort(((e,t)=>e.label.localeCompare(t.label))),s.instances>0&&n.instances.push({value:null,label:`+${s.instances} more`,sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0})),i.size>0&&(n.labels=[],i.forEach(((e,t)=>{const r=[];e.forEach(((e,n)=>{const o=e.map((e=>e.contextId)),i=e.map((e=>e.title));let s;s=1===e.length?e[0].title:2===e.length?`${e[0].title}, ${e[1].title}`:`${e[0].title}, ${e[1].title} and ${e.length-2} more`,r.push({value:`${t}:${n}`,label:n,sublabel:s,contextIds:o,allContextTitles:i})})),r.sort(((e,t)=>e.label.localeCompare(t.label))),n.labels.push({labelKey:t,items:r})})),n.labels.sort(((e,t)=>e.labelKey?t.labelKey?e.labelKey.localeCompare(t.labelKey):-1:1)),s.labels>0&&n.labels.push({labelKey:null,items:[{value:null,label:`+${s.labels} more`,sublabel:"Keep typing to narrow results",contextIds:[],isTruncationNotice:!0}]})),l(n),d(!1)})).catch((e=>{console.error("Context search error:",e),l(null),d(!1)}))}),[i,u,h,x,g]);const m=(0,s.useCallback)(((n,r)=>{t({matchType:n,value:r.value,label:r.label,sublabel:r.sublabel,contextIds:r.contextIds,contextToInstance:r.contextToInstance,menuId:e?.id})}),[t,e?.id]);return{searchValue:r,setSearchValue:o,debouncedSearchValue:i,searchResults:a,isLoading:c,onSelectResult:m}},C=(0,s.memo)((e=>{let{children:t,...n}=e;const r=(0,s.useRef)(null);return(0,s.useEffect)((()=>{const e=r.current;if(!e)return;const t=()=>{const t=e.scrollLeft>0,n=e.scrollLeft+e.clientWidth<e.scrollWidth,r=[];t&&r.push("inset 10px 0 10px -10px rgba(0, 0, 0, 0.2)"),n&&r.push("inset -10px 0 10px -10px rgba(0, 0, 0, 0.2)"),e.style.boxShadow=r.join(", ")};return t(),e.addEventListener("scroll",t),()=>{e.removeEventListener("scroll",t)}}),[]),(0,g.jsx)(o.Flex,{ref:r,overflow:"auto",...n,children:t})}));var I=n(45087);const k=(0,s.memo)((e=>{let{parentIds:t,allFilters:n,onGoToParent:r}=e;const i=(0,s.useMemo)((()=>t?.find((e=>n[e]&&Object.keys(n[e]).length>0))||null),[t,n]),a=(0,h.b)(i);if(!i||!a)return null;const l=a.shortName||a.name||"parent section";return(0,g.jsx)(I.A,{content:`Go to ${l}`,align:"bottom",children:(0,g.jsx)(o.IconButton,{icon:"arrowUp",flavour:"borderless",onClick:()=>r(i),padding:[0],small:!0})})})),A=(0,s.memo)((e=>{let{menuId:t,parentIds:n,activeMenuId:r,onMenuChange:i}=e;const a=((e,t)=>{const n=(0,h.b)(e),r=(0,h.yy)(),o=(t||[]).map((e=>r[e])).filter(Boolean);return(0,s.useMemo)((()=>{const r=[];return o.forEach(((e,n)=>{r.push({label:e.shortName||e.name,value:t[t.length-1-n]})})),n&&r.push({label:n.shortName||n.name,value:e}),r}),[e,t,n,o])})(t,n);return(0,g.jsx)(o.Menu,{value:r,items:a,onChange:i,dropProps:{align:{top:"bottom",left:"left"}},dropdownProps:{width:"200px"},caret:!0,padding:[0],small:!0})})),S=(0,s.memo)((e=>{let{menuId:t,onClose:n,flavour:r,parentIds:i,onGoToParent:a}=e;const[l,d]=(0,s.useState)(t),u=(0,h.b)(l),p=(0,x.X)(),{filters:f,addFilter:j,removeFilter:b,clearFilters:v}=(0,x.w)(u?.contexts,l),{searchValue:S,setSearchValue:T,debouncedSearchValue:F,searchResults:N,isLoading:M,onSelectResult:L}=w(u,j,r),$=(e,t)=>f.some((n=>n.matchType===e&&n.value===t)),D=(e,t)=>{if($(e,t.value)){const n=f.find((n=>n.matchType===e&&n.value===t.value));b(n)}else L(e,t)};return(0,g.jsx)(o.Layer,{onClickOutside:n,onEsc:n,children:(0,g.jsxs)(o.Flex,{column:!0,background:"dropdown",border:!0,round:3,width:{base:"600px",max:"100%"},overflow:"hidden","data-testid":"context-search-modal",children:[(0,g.jsxs)(o.Flex,{padding:[2,3],border:{side:"bottom"},alignItems:"center",justifyContent:"between",children:[(0,g.jsxs)(o.Flex,{alignItems:"center",gap:.5,children:[(0,g.jsx)(o.TextSmall,{children:"Filter chart in"}),i?.length>0?(0,g.jsx)(A,{menuId:t,parentIds:i,activeMenuId:l,onMenuChange:d}):(0,g.jsx)(o.TextSmall,{children:u?.name||"this section"})]}),(0,g.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[a&&(0,g.jsx)(k,{parentIds:i,allFilters:p,onGoToParent:a}),f.length>0&&(0,g.jsx)(o.Button,{label:"Clear All",flavour:"borderless",onClick:v,"data-testid":"context-search-clear-all",padding:[0],small:!0})]})]}),(0,g.jsx)(o.Flex,{padding:[3],column:!0,border:{side:"bottom"},children:(0,g.jsx)(o.TextInput,{value:S,onChange:e=>T(e.target.value),placeholder:"Search dimensions, labels...","data-testid":"context-search-input",autoFocus:!0,iconLeft:(0,g.jsx)(o.Icon,{name:M?"loading":"search",color:"textLite",size:"small"}),width:"100%"})}),(0,g.jsxs)(o.Flex,{column:!0,overflow:"auto",style:{opacity:M?.5:1,filter:M?"blur(2px)":"none",transition:"height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, filter 0.2s ease"},height:null===N?"152px":N&&Object.keys(N).length>0?"400px":"199px",children:[null===N&&(0,g.jsx)(o.Flex,{column:!0,gap:3,padding:[3],flex:!0,children:(0,g.jsxs)(o.Flex,{column:!0,gap:2,children:[(0,g.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[(0,g.jsx)(o.Icon,{name:"search",size:"small",color:"textLite"}),(0,g.jsx)(o.TextSmall,{color:"textLite",children:"Search charts based on dimensions, instances and labels"})]}),(0,g.jsxs)(o.Flex,{alignItems:"center",gap:2,children:[(0,g.jsx)(o.Icon,{name:"filter",size:"small",color:"textLite"}),(0,g.jsxs)(o.TextSmall,{color:"textLite",children:["Results are scoped to ",u?.name||"this section"," charts"]})]})]})}),N&&Object.keys(N).length>0&&(0,g.jsx)(o.Flex,{column:!0,gap:3,padding:[2,0],flex:!0,children:y.map((e=>{const t=N[e];return t&&0!==t.length?(0,g.jsxs)(o.Flex,{column:!0,gap:1,children:[(0,g.jsx)(o.Flex,{padding:[1,3],alignItems:"center",position:"sticky",top:0,background:"dropdown",zIndex:1,children:(0,g.jsx)(o.TextSmall,{strong:!0,color:"textLite",children:e.charAt(0).toUpperCase()+e.slice(1)})}),"labels"===e?(0,g.jsx)(o.Flex,{column:!0,children:t.map(((t,n)=>(0,g.jsxs)(o.Flex,{column:!0,children:[t.labelKey&&(0,g.jsx)(o.Flex,{padding:[1,3],alignItems:"center",position:"sticky",top:"20px",background:"dropdown",zIndex:1,children:(0,g.jsx)(o.TextMicro,{strong:!0,color:"textLite",children:t.labelKey})}),t.items.map(((t,n)=>{const r=!t.isTruncationNotice&&$(e,t.value);return(0,g.jsx)(o.Flex,{padding:[2,3],cursor:t.isTruncationNotice?"default":"pointer",background:r?"neutralHighlight":void 0,_hover:t.isTruncationNotice?{}:{background:"secondaryHighlight"},onClick:t.isTruncationNotice?void 0:()=>D(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,g.jsxs)(o.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[r&&(0,g.jsx)(o.Icon,{name:"check",size:"small",color:"primary"}),(0,g.jsxs)(o.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,g.jsx)(o.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,g.jsx)(g.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,g.jsx)(I.A,{content:(0,g.jsxs)(c.A,{column:!0,gap:1,children:[(0,g.jsxs)(o.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," ","contexts:"]}),(0,g.jsx)(o.Flex,{flexWrap:!0,children:t.allContextTitles.map(((e,n)=>(0,g.jsxs)(o.TextSmall,{children:[e,n<t.allContextTitles.length-1?", ":""]},n)))})]}),plain:!0,children:(0,g.jsx)(o.TextMicro,{color:"textLite",children:t.sublabel})}):(0,g.jsx)(o.TextMicro,{color:"textLite",children:t.sublabel})})]})]})},`${e}-${t.value}-${n}`)}))]},n)))}):(0,g.jsx)(o.Flex,{column:!0,children:t.map(((t,n)=>{const r=!t.isTruncationNotice&&$(e,t.value);return(0,g.jsx)(o.Flex,{padding:[2,3],cursor:t.isTruncationNotice?"default":"pointer",background:r?"neutralHighlight":void 0,_hover:t.isTruncationNotice?{}:{background:"secondaryHighlight"},onClick:t.isTruncationNotice?void 0:()=>D(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,g.jsxs)(o.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[r&&(0,g.jsx)(o.Icon,{name:"check",size:"small",color:"primary"}),(0,g.jsxs)(o.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,g.jsx)(o.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,g.jsx)(g.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,g.jsx)(I.A,{content:(0,g.jsxs)(c.A,{column:!0,gap:1,children:[(0,g.jsxs)(o.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," contexts:"]}),(0,g.jsx)(o.Flex,{flexWrap:!0,children:t.allContextTitles.map(((e,n)=>(0,g.jsxs)(o.TextSmall,{children:[e,n<t.allContextTitles.length-1?", ":""]},n)))})]}),plain:!0,children:(0,g.jsx)(o.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})}):(0,g.jsx)(o.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})})]})]})},`${e}-${t.value}-${n}`)}))})]},e):null}))}),!M&&""!==F.trim()&&null!==N&&0===Object.keys(N).length&&(0,g.jsxs)(o.Flex,{padding:[6,3],justifyContent:"center",alignItems:"center",column:!0,gap:2,flex:!0,children:[(0,g.jsx)(o.Icon,{name:"search",size:"medium",color:"textLite"}),(0,g.jsx)(o.TextSmall,{color:"textLite",children:"No results found"}),(0,g.jsx)(o.TextMicro,{color:"textLite",children:"Try different search terms"})]}),f.length>0&&(0,g.jsxs)(o.Flex,{column:!0,gap:2,padding:[3,3,0],border:{side:"top"},position:"sticky",bottom:0,background:"dropdown",children:[(0,g.jsxs)(o.H5,{children:["Active Filters (",f.length,")"]}),(0,g.jsx)(C,{gap:2,padding:[0,0,3],children:f.map(((e,t)=>(0,g.jsx)(m,{matchType:e.matchType,value:e.label,sublabel:e.sublabel,onRemove:()=>b(e)},`${e.matchType}-${e.value}-${t}`)))})]})]})]})})}));var T=n(33962),F=n(49163),N=n(63928),M=n(95565),L=n(1444);const $=(0,d.A)((0,l.A)(o.Flex)),D=(0,u.A)((0,l.A)(o.IconButton)),B=(0,s.memo)((e=>{let{menuId:t,menuName:n,contexts:r}=e;const{filters:i}=(0,x.w)(r,t);return i&&0!==i.length?(0,g.jsxs)(o.Flex,{column:!0,children:[(0,g.jsxs)(o.TextMicro,{color:"textLite",children:["Filters in ",n," (",i.length,")"]}),(0,g.jsx)(o.Flex,{column:!0,children:i.map((e=>(0,g.jsxs)(o.TextSmall,{children:[e.matchType,": ",(0,g.jsx)(o.Text,{strong:!0,children:e.label})]},`${e.matchType}-${e.label}`)))})]}):null})),R=(0,s.memo)((e=>{let{parentIds:t}=e;return t&&0!==t.length?(0,g.jsx)(o.Flex,{column:!0,gap:1,children:t.map((e=>{const t=(0,h.b)(e);return t?(0,g.jsx)(B,{menuId:e,menuName:t.shortName||t.name||e,contexts:t.contexts},e):null}))}):null})),P=(0,s.memo)((e=>{let{menuId:t,menuName:n,flavour:r,parentIds:i}=e;const l=(0,h.b)(t),d=(0,x.X)(),u=(0,T.Ud)(),[m,,p,f]=(0,a.A)(),j=!!(d[t]&&Object.keys(d[t]).length>0),b=!(!i||!i.some((e=>d[e]&&Object.keys(d[e]).length>0))),v=(0,s.useCallback)((e=>{u(e),f()}),[u,f]),y=(0,s.useMemo)((()=>j||b?(0,g.jsxs)(c.A,{column:!0,gap:2,children:[(0,g.jsx)(B,{menuId:t,menuName:n,contexts:l?.contexts}),(0,g.jsx)(R,{parentIds:i})]}):`Search in ${n}`),[j,b,t,n,l?.contexts,i]);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)($,{position:"relative",tooltip:y,payload:{menuId:t},children:[(0,g.jsx)(o.IconButton,{icon:"filterList",onClick:p,flavour:"borderless",padding:[0],"data-testid":"context-search-button","data-active":j,"data-indeterminate":b,height:"16px",width:"16px"}),b&&(0,g.jsx)(o.Box,{position:"absolute",top:"2px",right:"2px",background:"accentAI",round:"50%",width:"6px",height:"6px"})]}),m&&(0,g.jsx)(S,{menuId:t,onClose:f,flavour:r,parentIds:i,onGoToParent:v})]})})),V={LocalDashboard:"Favourites can be saved when the agent is part of a Netdata cloud space.",DemoSpace:"Favourites cannot be saved on a demo space.",FreePlan:()=>(0,g.jsxs)(o.Flex,{column:!0,gap:1,children:[(0,g.jsx)(o.Text,{children:"Favourites can be saved only on a paid plan."}),(0,g.jsx)(M.A,{children:(0,g.jsx)(o.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},_=(0,s.memo)((e=>{let{menuId:t,menuName:n,flavour:r}=e;const[o,,i,l]=(0,a.A)(),c=(0,F._)({params:{type:["favourites"],path:[`/${r}`],entity:t}}),d=c.find((e=>{let{entity:n}=e;return n===t}))?.id,u=!!d,h=(0,N.yK)({onResolve:l}),x=(0,N.z2)(d,{onResolve:l}),{disabled:m,reason:p}=(0,L.A)(),f=(0,s.useCallback)((()=>{m||(i(),u?x():h({type:"favourites",entity:t,path:`/${r}`,value:{menuId:t,sortOrder:Date.now()}}))}),[m,u,x,h,t,r,i]),j=(0,s.useMemo)((()=>({tooltip:m&&p?V[p]||V.default:u?`Remove ${n} from your favourites`:`Add ${n} to your favourites`,disabled:o||m,..."FreePlan"===p?{tooltipProps:{align:"bottom",activateOn:"hover",isBasic:!0,allowHoverOnTooltip:!0}}:{}})),[u,o,n,m,p]);return(0,g.jsx)(D,{icon:u?"heart":"heart_hollow",onClick:f,disabled:o||m,flavour:"borderless",padding:[0],"data-testid":"toggle-favourite-button","data-active":u,payload:{menuId:t},height:"12px",width:"12px",...j})})),O=(0,r.default)(o.Flex).withConfig({displayName:"withMenuActions__StyledWrapper",componentId:"sc-vbh3xj-0"})(["&&& button[data-indeterminate],&&& button[data-active]{",' &[data-indeterminate="true"]{color:',";fill:",";svg,path{fill:",';}}&[data-active="true"]{color:',";fill:",";svg,path{fill:",";}}&:hover{color:",";fill:",";svg,path{fill:",';}}&[data-active="true"]:hover{color:',";fill:",";svg,path{fill:",";}}}"],(e=>`\n color: ${(0,o.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e)};\n fill: ${(0,o.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e)};\n\n svg,\n path {\n fill: ${(0,o.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e)};\n }\n `),(0,o.getColor)("textLite"),(0,o.getColor)("textLite"),(0,o.getColor)("textLite"),(0,o.getColor)("primary"),(0,o.getColor)("primary"),(0,o.getColor)("primary"),(0,o.getColor)("text"),(0,o.getColor)("text"),(0,o.getColor)("text"),(0,o.getColor)("accent"),(0,o.getColor)("accent"),(0,o.getColor)("accent")),E=e=>{let{children:t,menuId:n,menuName:r,flavour:s,parentIds:a,hasCharts:l,hasFilters:c=i.af}=e;return(0,g.jsxs)(O,{alignItems:"center",justifyContent:"between",hasCharts:l,gap:1,children:[t,(0,g.jsxs)(o.Flex,{alignItems:"center",gap:1,children:[c&&(0,g.jsx)(P,{menuId:n,menuName:r,flavour:s,parentIds:a}),(0,g.jsx)(_,{menuId:n,menuName:r,flavour:s})]})]})},H=e=>t=>t.enableFavourites&&t.contexts?.length?(0,g.jsx)(E,{menuId:t._id,menuName:t.name,flavour:t.flavour,parentIds:t.parentIds,hasCharts:!!t.selfChartIds?.length,children:(0,g.jsx)(e,{...t})}):(0,g.jsx)(e,{...t})},5020:(e,t,n)=>{n.d(t,{Oq:()=>o,Q:()=>i,bP:()=>s,ml:()=>r});const r=(e,t)=>e.on("sizeChanged",((e,n,r)=>{if(e.getParent()!==t)return;const o=e.getAttribute("id"),i=t.getAttribute("host"),s=`chart_height.${i}/${o}`;localStorage.setItem(s,n);const a=`chart_width.${i}/${o}`;localStorage.setItem(a,r)})),o=(e,t,n)=>{const r=`chart_height.${e.getAttribute("host")}/${t}`,o=localStorage.getItem(r);return o?/px/.test(o)?parseInt(o.replace("px",""),10):parseInt(o,10):n},i=e=>{e?.id&&localStorage.setItem(`chart_layout/${e.id}`,JSON.stringify(e))},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=localStorage.getItem(`chart_layout/${e}`);try{let e=JSON.parse(r);return e?(e=(e=>{let{i:t,id:n=t,x:r,left:o=r,y:i,top:s=i,w:a,width:l=a,h:c,height:d=c,expanded:u=!1}=e;return{id:n,width:l,height:d,left:o,top:s,expanded:u}})(e),{...n,...t,...e}):{...n,...t}}catch{return{...n,...t}}}},9962:(e,t,n)=>{n.d(t,{I:()=>r});const r=e=>{let{error:t,testPrefix:n,onClick:r,flavour:o,value:i}=e;return{"data-testid":n?`${n}-${o}`:o,flavour:o,...r&&{onClick:r},text:t?"-":`${i}`}}},14963:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(96540),o=n(63766),i=n(50239),s=n(74848);const a=e=>{let{children:t,onClick:n,...a}=e;const l=(0,i.UH)(),c=(0,r.useCallback)((e=>{const{hash:t=""}=e.target;t.startsWith("#menu")&&(e.preventDefault(),l.goToLink(t.substr(1))),n&&n(e)}),[l]);return"string"===typeof t?(0,s.jsx)(o.TextSmall,{color:"textDescription",dangerouslySetInnerHTML:{__html:t},onClick:c,...a}):t||null}},17178:(e,t,n)=>{n.d(t,{A:()=>p});var r=n(96540),o=n(88934),i=n(19186),s=n(24609),a=n(93335),l=n(41716),c=n(93883),d=n(93912),u=n(74848);const h=()=>{const e=(0,l.s)("error"),t=(0,l.s)("updatedAt");return(0,u.jsx)(d.A,{title:"Alerts & Notifications",description:"View raised and configured alerts across your infrastructure.",children:(0,u.jsx)(c.A,{error:e,updatedAt:t})})};var x=n(99728),g=n(39175),m=n(77234);const p=()=>{const e=(0,i.r9)(),t=(0,o.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/insights/report-preview/:reportId"),n=(0,x.JT)("dashboard:ReadAll"),l=(e=>{let{path:t,matchReportPreview:n}=e;return(0,r.useMemo)((()=>({[m.x.home]:{id:"home",title:"Home",icon:"room_home",path:`${t}/home`,exact:!0,dataGa:"view-picker::click-view-home::global-view",testId:"viewPicker-home",tooltip:{title:"Summary",description:"An overview of your infrastructure."}},[m.x.overview]:{id:"overview",title:"Metrics",icon:"room_overview",path:`${t}/overview`,exact:!0,dataGa:"view-picker::click-view-overview::global-view",testId:"viewPicker-overview",tooltip:{title:"Metrics Explorer",description:"All metrics from all nodes, containers, VMs, SNMP devices, applications, and synthetic checks, in one universal, aggregated, infrastructure-level dashboard."}},[m.x.nodes]:{id:"nodes",title:"Nodes",icon:"nodes_hollow",path:`${t}/nodes`,exact:!0,dataGa:"view-picker::click-view-nodes::global-view",testId:"viewPicker-nodes",tooltip:{title:"Nodes Explorer",description:"All your infrastructure nodes."}},...!window.envSettings.isAgent&&!window.envSettings.onprem&&{[m.x.k8s]:{id:"k8s",title:"K8s",icon:"serviceKubernetes",path:`${t}/kubernetes`,exact:!0,dataGa:"view-picker::click-view-kubernetes::global-view",testId:"viewPicker-kubernetes",tooltip:{title:"Kubernetes Explorer",description:"All Kubernetes clusters, pods, containers and workloads."}}},[m.x.top]:{id:"top",title:"Top",icon:"top",path:`${t}/top`,exact:!0,dataGa:"view-picker::click-view-fn::global-overview",testId:"viewPicker-fn",tooltip:{title:"Top Consumers",description:"Explore top consumers, including processes, containers, services, network connections, and more."}},[m.x.logs]:{id:"logs",title:"Logs",icon:"logs",path:`${t}/logs`,exact:!0,dataGa:"view-picker::click-view-logs::global-overview",testId:"viewPicker-logs",tooltip:{title:"Logs Explorer",description:"Search, filter, and analyze system and application logs."}},[m.x.dashboards]:{id:"dashboards",title:"Dashboards",icon:"dashboard",path:`${t}/dashboards`,exact:!0,dataGa:"view-picker::click-view-dashboard::global-view",testId:"viewPicker-customDashboards",tooltip:{title:"Custom Dashboards",description:"Create, and manage personalized dashboards tailored to your needs."},droppable:!0,droppableProps:{dropArea:!0,dropinDashboards:!0}},[m.x.dashboard]:{id:"dashboard",title:"Dashboard",icon:"dashboard",path:`${t}/dashboard`,exact:!0,dataGa:"view-picker::click-view-dashboard::global-view",testId:"viewPicker-customDashboard",tooltip:{title:"Custom Dashboard",description:"Edit a personalized dashboard tailored to your needs."},droppable:!0,droppableProps:{dropArea:!0,dashboardId:g.LA}},[m.x.alerts]:{id:"alerts",title:"Alerts",icon:"alarm",path:`${t}/alerts`,exact:!0,dataGa:"view-picker::click-view-alerts::global-view",testId:"viewPicker-alerts",tooltip:(0,u.jsx)(h,{}),children:(0,u.jsx)(a.W,{})},[m.x.ar]:{id:"ar",title:"Anomalies",icon:"anomaliesLens",path:`${t}/anomalies`,exact:!0,dataGa:"view-picker::click-view-anomalies::global-view",testId:"viewPicker-anomalies",tooltip:{title:"Anomaly Advisor",description:"Machine-learning powered root cause analysis, blast radius detection, and cascading effect tracing across nodes."}},[m.x.events]:{id:"events",title:"Events",icon:"feed",path:`${t}/events`,exact:!0,dataGa:"view-picker::click-view-feed::global-view",testId:"viewPicker-feed",tooltip:{title:"Activity Feed",description:"Alert transitions and notifications, node connections and disconnections, administrative events."}},[m.x.insights]:{id:"insights",title:"AI Insights",icon:"ai",path:`${t}/insights`,exact:!n,dataGa:"view-picker::click-view-insights::global-view",testId:"viewPicker-insights",tooltip:{title:"AI Insights and Reports",description:"Automatically investigate, troubleshoot and generate deep dive infrastructure analysis reports using Netdata AI."},iconColor:"primaryAI"}})),[t,n])})({path:e,matchReportPreview:t}),c=(0,s.dg)(),d=(0,i.GJ)();var p,f;return[(0,r.useMemo)((()=>[!c&&!d&&l.home,l.nodes,l.overview,l.top,l.logs,!c&&!window.envSettings.onprem&&l.k8s,!c&&n&&l.dashboards,c&&n&&l.dashboard,l.alerts,l.events,l.ar,l.insights].filter(Boolean)),[e,t,c]),(p=e,f=!c,(0,r.useMemo)((()=>({[`${p}/overview`]:!0,[`${p}/home`]:!0,[`${p}/nodes`]:!0,[`${p}/dashboards`]:!0,[`${p}/dashboard`]:!0,[`${p}/alerts`]:!0,[`${p}/anomalies`]:!0,[`${p}/top`]:!0,[`${p}/logs`]:!0,[`${p}/events`]:!0,[`${p}/insights`]:!0})),[p,f]))]}},27024:(e,t,n)=>{n.d(t,{A:()=>T});var r=n(96540),o=n(63766),i=n(31141),s=n(32788),a=n(29263),l=n(47410),c=n(16866),d=n(24609),u=n(19371),h=n(41579),x=n(19186),g=n(67294),m=n(5907),p=n(92726),f=n(62718),j=n(93536),b=n(38757),v=n(6304),y=n(50433),w=n(45706),C=n(28864),I=n(52795),k=n(74848);const A=(0,r.memo)((e=>{let{id:t,spaceId:n,roomId:i,chartId:s,name:a}=e;const[l,,c,h]=(0,v.A)(),{fullyLoaded:g,processing:f}=(0,p.fz)(t),j=(0,C.DH)(t,{onSuccess:()=>{(0,y.jE)(`Chart added to ${a}`),h()}}),b=l&&g,A=(0,d.ns)(n,"slug"),S=(0,x.wz)(i,"slug"),T=(0,m.nM)(t),F=(0,w.A)(l&&t,{spaceId:n,spaceSlug:A,roomId:i,roomSlug:S}),N=(0,u.eg)();(0,r.useEffect)((()=>{if(F||!b)return;const e=N.getNode({id:s}),t=(0,I.h)(e.getAttributes());T(t.contextScope,t,(()=>setTimeout(j,100)))}),[b,F]);const M=l&&(f||F);return(0,k.jsx)(o.Button,{icon:"plus",onClick:c,isLoading:M,disabled:M,alignSelf:"end"})})),S=e=>{let{spaceId:t,roomId:n,chartId:r}=e;return[{id:"name",accessorKey:"name",header:"Dashboards",cell:e=>{let{getValue:t}=e;return(0,k.jsxs)(o.Flex,{alignItems:"center",gap:3,children:[(0,k.jsx)(o.Icon,{name:"dashboards",size:"small",color:"text"}),(0,k.jsx)(o.Text,{children:t()})]})}},{id:"plusButton",accessorKey:"id",header:"",cell:e=>{let{getValue:o,row:i}=e;return(0,k.jsx)(A,{id:o(),spaceId:t,roomId:n,chartId:r,name:i.original.name})}}]},T=e=>{let{onClose:t}=e;(0,h.A)();const n=(0,x.ID)(),v=(0,x.XA)("name"),y=(0,d.vt)(),{params:w={},params:{chartId:C}}=(0,i.A)("addToDashboardModal"),I=(0,g.q)(),A=(0,p.Sf)(I),[T,F]=(0,r.useState)(""),[N,M]=(0,r.useState)(!1),L=T.length>0,$=(0,m.W6)(y,n,{onSuccess:t}),D=(0,u.eg)().getNode({id:C}),B=(0,r.useMemo)((()=>S({spaceId:y,roomId:n,chartId:C})),[y,n,C]),R=()=>{if(!D)return;const{aggregationMethod:e,selectedDimensions:t,groupBy:n,groupByLabel:r,groupingMethod:o,chartType:i,selectedLabels:s,nodesScope:a,selectedInstances:l,selectedNodes:c,contextScope:d}=D.getAttributes(),[u]=d;$(T,d,{...(0,j.L)(u),aggregationMethod:e,selectedDimensions:t,groupBy:n,groupByLabel:r,groupingMethod:o,chartType:i,selectedLabels:s,nodesScope:a,selectedInstances:l,selectedNodes:c})},P=(0,g.RQ)();return(0,k.jsxs)(s.GO,{onClose:t,children:[(0,k.jsx)(a.z,{onClose:t,title:"Add to Dashboard"}),(0,k.jsx)(l.U,{children:"Select Dashboard"}),(0,k.jsxs)(s.Yv,{gap:3,overflow:"hidden",height:"100%",children:[(0,k.jsxs)(o.H6,{children:["Add chart to one or more dashboards from the ",v]}),P?(0,k.jsx)(o.Table,{dataColumns:B,data:A}):(0,k.jsx)(f.UG,{rows:3}),(0,k.jsxs)(o.Flex,{column:!0,padding:[3,0],gap:1,children:[(0,k.jsxs)(o.H6,{children:["Create a new dashboard and add ",C," to it"]}),(0,k.jsx)(b.A,{value:T,label:"Name",onChange:e=>F(e.target.value),isValid:N,setIsValid:M,isDirty:L,instantFeedback:"all",onKeyDown:e=>e.keyCode===c.I7&&N&&R}),(0,k.jsx)(o.Button,{label:"Create & add",onClick:R,disabled:!D||!T})]})]})]})}},27496:(e,t,n)=>{n.d(t,{n:()=>s});var r=n(14963),o=n(4719),i=n(74848);const s=(0,o.aV)((e=>e.children?(0,i.jsx)(r.A,{as:"p",role:"document",...e}):null),(e=>{let{info:t}=e;return{children:t}}))},30863:(e,t,n)=>{n.d(t,{A:()=>D});n(98992),n(54520),n(81454);var r=n(96540),o=n(63766),i=n(73700),s=n(69457),a=n(51220),l=n(53749),c=n(48106),d=n(20871);n(72577);let u=null;n(25509),n(65223),n(60321),n(41927),n(11632),n(64377),n(66771),n(12516),n(68931),n(52514),n(35694),n(52774),n(49536),n(21926),n(94483),n(16215);var h=n(57530),x=n(43375);n(8872);var g=n(33185),m=n(98131),p=n(33962),f=n(4719),j=n(56876),b=n(549),v=n(74848);const y=(0,r.memo)((e=>{let{id:t,name:n,icon:i,isLast:s}=e;const{onMenuClick:a}=(0,j.A)(),l=(0,r.useCallback)((()=>{a({id:t})}),[t,a]),c=(0,r.useMemo)((()=>({alignItems:"center",gap:1,...s?{}:{cursor:"pointer",onClick:l}})),[s,l]);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(o.Flex,{...c,children:[i?(0,v.jsx)(m.o,{icon:i,active:!0,containerProps:{width:"auto"}}):null,(0,v.jsx)(o.Text,{color:"primary",strong:!0,children:n})]}),s?null:(0,v.jsx)(o.Text,{color:"primary",strong:!0,children:">"})]})})),w=(0,r.memo)((e=>{let{menu:t}=e;const{id:n,shortName:i,name:s,icon:a,parentMenus:l}=t||{},c=(0,r.useMemo)((()=>[...l||[],{id:n,name:i||s,icon:a}]),[t]);return n?(0,v.jsx)(o.Flex,{alignItems:"center",gap:1,children:c.map(((e,t)=>(0,v.jsx)(y,{isLast:t===c.length-1,...e},e.id)))}):null})),C=(0,g.default)(o.Flex).attrs((e=>({position:"sticky",top:0,width:"100%",alignItems:"center",justifyContent:"between",padding:[2,1,2,2],zIndex:15,...e}))).withConfig({displayName:"headerAggregator__StyledContainer",componentId:"sc-10l70s7-0"})(["backdrop-filter:blur(5px);"]),I=["nodes"],k=e=>{let{flavour:t,tools:n=[],hasFilters:i}=e;const s=(0,p.W2)(),a=(0,f.b)(s),l=(0,r.useContext)(g.ThemeContext);return!I.includes(t)&&a?(0,v.jsxs)(C,{background:(0,o.getRgbColor)("mainBackground",.8)({theme:l}),children:[(0,v.jsx)(w,{menu:a}),(0,v.jsx)(b.G,{menuId:s,menuName:a.shortName||a.name,hasFilters:i,flavour:t,parentIds:a.parentIds,hasCharts:!0,children:n.map((e=>{let{Component:t,...n}=e;return t?(0,v.jsx)(t,{...n},n.id):null}))})]}):null},A=(0,r.memo)(k),S="8px 2px",T="1px 2px",F={root:T,submenu:T,default:S},N=[{flavour:"root",id:"System-0"}],M=(0,r.memo)((e=>{let{getComponent:t,element:n,index:o,...i}=e;const s=(0,r.useMemo)((()=>n&&t(n)),[n?.id,o]),a=(0,r.useMemo)((()=>!!N.find((e=>{let{id:t,flavour:r}=e;return t===n.id&&r===n.flavour}))),[n]);return!s||a?null:(0,v.jsx)(s,{...n,index:o,...i,isVisible:!0},n.id)})),L=(0,r.memo)((e=>{let{flavour:t,elements:n,onScroll:s,dashboardOptions:l,getComponent:d,stickyBg:g="mainBackground",stickyRef:m,nextStickyRef:p,stickyIndexes:f,tmpStickyRef:j,containerWidth:b,headerProps:y={},ref:w}=e;const C=(e=>{const t=(0,r.useRef)(),n=(0,r.useRef)(),o=(0,r.useRef)(0),i=(0,r.useRef)(0);return(0,r.useCallback)((r=>{if(t.current!==e.length&&(i.current=0),n.current&&(i.current<5||t.current!==e.length)){i.current=i.current+1,t.current=e.length;const s=e.findIndex((e=>e.id===n.current.id));if(-1===s)return;const{start:a}=r.getMeasurements()[s];return r.scrollToOffset(a+o.current),clearTimeout(u),void(u=setTimeout((()=>i.current=5),200))}t.current=e.length;const s=r.scrollOffset;let a=0;const l=r.getMeasurements().find((e=>(a+=e.size,a>s)));l&&(n.current=e[l.index],o.current=s-l.start)}),[e])})(n),I=(0,r.useRef)(),[k,T]=(0,r.useState)(0),N=((e,t,n)=>{let{stickyRef:o,nextStickyRef:i,tmpStickyRef:s}=n;const a=(0,r.useRef)(),{active:l}=(0,x.fF)(),c=(0,r.useRef)();return c.current=l,(0,r.useCallback)((e=>{if(c.current&&c.current.data.current.isResizer)return a.current;if(!t)return a.current=(0,h.vp)(e),a.current;i.current=Number(Object.keys(t).find((t=>e.startIndex<t))),o.current=Number(Object.keys(t).reverse().find((t=>e.startIndex>=t))),i.current-e.startIndex===1&&(o.current=NaN);let n=(0,h.vp)(e);return null!==s.current&&(n=[...n,s.current]),isNaN(o.current)?a.current=[...new Set(n)].sort(((e,t)=>e-t)):a.current=[...new Set([o.current,...n])].sort(((e,t)=>e-t)),a.current}),[e,t])})(n,f,{stickyRef:m,nextStickyRef:p,tmpStickyRef:j}),L=(0,a.Te)({count:n.length,getScrollElement:()=>w.current,overscan:2,enableSmoothScroll:!1,estimateSize:e=>n[e].size,onChange:C,rangeExtractor:N,scrollPaddingStart:0});I.current=L,(0,c.A)(L,n);const $=(0,r.useCallback)((0,i.n)(100,(function(){s(...arguments),w.current&&T(w.current.scrollTop)})),[s]);return(0,v.jsxs)("div",{ref:w,style:{minHeight:"100%",width:"100%",overflow:"auto"},onScroll:$,children:[(0,v.jsx)(A,{flavour:t,...y}),(0,v.jsxs)("div",{style:{minHeight:`${L.getTotalSize()}px`,width:"100%",position:"relative"},children:[k>0&&!isNaN(m.current)&&(0,v.jsx)(o.Box,{sx:{top:0,left:0,width:"100%",padding:S,position:"sticky",zIndex:10,boxShadow:"2px 6px 6px -7px rgba(0, 0, 0, 0.4)"},background:g,children:(0,v.jsx)(M,{...l,element:n[m.current],index:m.current,getComponent:d})},m.current),L.getVirtualItems().map((e=>{const t=F[n[e.index].flavour]||F.default;return(0,v.jsx)(o.Box,{ref:L.measureElement,sx:{top:0,left:0,width:"100%",padding:t,position:"absolute",transform:`translateY(${e.start}px)`},"data-index":e.index,children:(0,v.jsx)(M,{...l,element:n[e.index],index:e.index,getComponent:d,containerWidth:b})},e.key)}))]})]})}),((e,t)=>e.elements.length===t.elements.length&&e.containerWidth===t.containerWidth)),$=e=>{let{flavour:t,onActiveMenuId:n,getComponent:o,dashboardOptions:i,initialChartName:a,checkVisibility:c,...u}=e;const h=(0,l.bD)(),x=(0,s.qR)((e=>e.filter((e=>{const t=e.contexts||e.contextScope||e.chartIds||[e.id];return c?c(t,e.menuId||e.id,e.parentIds):h(t)})))),[{stickyRef:g,nextStickyRef:m,tmpStickyRef:p},f]=(e=>{const t=(0,s.Tg)(),n=(0,r.useRef)(null),o=(0,r.useMemo)((()=>e.reduce(((e,n,r)=>{let{id:o,sticky:i}=n;return t[o]&&"undefined"!==typeof i&&i&&(e[r]=!0),e}),{})),[e]),i=(0,r.useRef)(),a=(0,r.useRef)(),l=(0,r.useCallback)((e=>!!o[e]),[o]),c=(0,r.useCallback)((e=>i.current===e),[]);return[{stickyRef:i,nextStickyRef:a,isSticky:l,isActiveSticky:c,tmpStickyRef:n},o,t]})(x),j=(0,r.useRef)(),b=(0,r.useRef)(),y=(0,r.useMemo)((()=>(b.current&&b.current.cancel(),b.current=(0,d.A)({stickyRef:g}),()=>b.current(j.current,n))),[x.length,n]);return(0,r.useLayoutEffect)((()=>{x.length&&y()}),[x.length,a]),(0,v.jsx)(L,{flavour:t,elements:x,onScroll:y,dashboardOptions:i,getComponent:o,ref:j,stickyRef:g,nextStickyRef:m,stickyIndexes:f,tmpStickyRef:p,...u})},D=(0,r.memo)($)},31035:(e,t,n)=>{n.d(t,{$:()=>h,A:()=>x});var r=n(96540),o=n(30569),i=n(97940),s=n(24609),a=n(77389),l=n(63231),c=n(86706),d=n(82505),u=n(99728);const h=e=>`spaces.${e}.members`,x=e=>{const t=(0,s.vt)(),n=(0,o.yF)((0,r.useCallback)(((n,r,o)=>{let{results:i}=o;r((0,c.jX)({id:e,spaceId:t}),i)}),[e,t])),x=(0,u.JT)("user:ReadAll");(0,i.A)((()=>({key:h(e),autorun:!!e&&x,fetch:()=>(0,a.kE)(e),association:{getError:()=>(0,d.x2)({id:e,key:"error"}),getIds:()=>(0,c.kd)({id:e,key:"ids"}),getLoaded:()=>(0,c.kd)({id:e,key:"loaded"}),getUpdatedAt:()=>(0,c.kd)({id:e,key:"updatedAt"})},sort:(e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"accent",ignorePunctuation:!0}),getResource:e=>(0,l.m)({id:e}),getResourcesInitializer:()=>l.WJ,onReceive:n,pollingOptions:{pollingInterval:315e3}})),[e,x])}},41579:(e,t,n)=>{n.d(t,{A:()=>u});n(98992),n(3949),n(81454);var r=n(96540),o=n(30569),i=n(92726),s=n(91539),a=n(24609),l=n(19186),c=n(258),d=n(67294);const u=()=>{const e=(0,a.vt)(),t=(0,l.ID)(),n=(0,o.yF)((0,r.useCallback)((function(e,n){let{data:{results:r}={}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n((0,d.z_)({id:t,key:"loaded"}),!0),r?.length){const e=r.sort(((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:"accent",ignorePunctuation:!0})));e.forEach((e=>n((0,i._d)(e.id),e)));const o=e.map((e=>{let{id:t}=e;return t}));n((0,d.z_)({id:t,key:"ids"}),o)}}),[])),u=(0,r.useCallback)((()=>{(0,c.SJ)(e,t).then(n).catch((()=>{}))}),[e,t]);return(0,s.A)((()=>({polling:!1,enabled:!!e&&!!t,fetch:()=>(0,c.SJ)(e,t),onReceive:n})),[e,t]),u}},42964:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(74848);const o=e=>{let{isOnboarding:t,withOuties:n=!0}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{width:t?"120":"320",height:t?"120":"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute"},children:[(0,r.jsx)("g",{id:"node_inset_shadow",filter:"url(#inset_shadow)",children:(0,r.jsx)("path",{d:"M152.015 44.7406C156.958 41.8937 163.042 41.8937 167.985 44.7406L255.908 95.3794C260.867 98.2354 263.923 103.522 263.923 109.244V210.455C263.923 216.177 260.867 221.464 255.908 224.319L167.985 274.958C163.042 277.805 156.958 277.805 152.015 274.958L64.0916 224.319C59.1329 221.464 56.077 216.177 56.077 210.455V109.244C56.077 103.522 59.1329 98.2354 64.0916 95.3795L152.015 44.7406Z",fill:"rgba(0,0,0,.3)"})}),(0,r.jsx)("path",{id:"outtie_1",d:"M152.264 24.9838C157.053 22.2259 162.947 22.2259 167.736 24.9838L272.979 85.5983C277.783 88.365 280.744 93.4864 280.744 99.0299V220.192C280.744 225.735 277.783 230.856 272.979 233.623L167.736 294.238C162.947 296.996 157.053 296.996 152.264 294.238L47.0206 233.623C42.2169 230.856 39.2564 225.735 39.2564 220.192V99.0299C39.2564 93.4864 42.2169 88.365 47.0206 85.5983L152.264 24.9838Z",stroke:"#003314"}),n&&(0,r.jsx)("path",{id:"outtie_2",d:"M152.264 5.03243C157.053 2.2745 162.947 2.2745 167.736 5.03242L290.3 75.6226C295.104 78.3893 298.064 83.5108 298.064 89.0542V230.167C298.064 235.711 295.104 240.832 290.3 243.599L167.736 314.189C162.947 316.947 157.053 316.947 152.264 314.189L29.7001 243.599C24.8964 240.832 21.9359 235.711 21.9359 230.167V89.0542C21.9359 83.5107 24.8964 78.3893 29.7001 75.6226L152.264 5.03243Z",stroke:"#003314"}),(0,r.jsx)("defs",{children:(0,r.jsxs)("filter",{id:"inset_shadow",x:"56.0769",y:"42.6054",width:"207.846",height:"234.488",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.jsx)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,r.jsx)("feOffset",{}),(0,r.jsx)("feGaussianBlur",{stdDeviation:"15"}),(0,r.jsx)("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),(0,r.jsx)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.2 0 0 0 0 0.0784314 0 0 0 1 0"}),(0,r.jsx)("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_759_2378"})]})})]}),(0,r.jsxs)("svg",{width:t?"120":"320",height:t?"120":"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute"},children:[(0,r.jsx)("path",{id:"outtie_1_highlight",d:"M152.264 24.9838C157.053 22.2259 162.947 22.2259 167.736 24.9838L272.979 85.5983C277.783 88.365 280.744 93.4864 280.744 99.0299V220.192C280.744 225.735 277.783 230.856 272.979 233.623L167.736 294.238C162.947 296.996 157.053 296.996 152.264 294.238L47.0206 233.623C42.2169 230.856 39.2564 225.735 39.2564 220.192V99.0299C39.2564 93.4864 42.2169 88.365 47.0206 85.5983L152.264 24.9838Z",stroke:"#34ff84"}),n&&(0,r.jsx)("path",{id:"outtie_2_highlight",d:"M152.264 5.03243C157.053 2.2745 162.947 2.2745 167.736 5.03242L290.3 75.6226C295.104 78.3893 298.064 83.5108 298.064 89.0542V230.167C298.064 235.711 295.104 240.832 290.3 243.599L167.736 314.189C162.947 316.947 157.053 316.947 152.264 314.189L29.7001 243.599C24.8964 240.832 21.9359 235.711 21.9359 230.167V89.0542C21.9359 83.5107 24.8964 78.3893 29.7001 75.6226L152.264 5.03243Z",stroke:"#bbffd6"})]})]})}},47413:(e,t,n)=>{n.d(t,{A:()=>x});n(98992),n(81454);var r=n(96540),o=n(88934),i=n(1817),s=n(44245),a=n(93335),l=n(63766),c=n(19075),d=n(74848);const u={warning:"warning",critical:"error"},h=e=>{let{alertId:t}=e;const n=(0,c.JL)(t,"status");return u[n]?(0,d.jsx)(l.Flex,{alignSelf:"center",margin:[0,0,0,2],round:1,background:u[n],width:2,height:2}):null},x=e=>{const t=(0,o.Zp)(),n=(0,o.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/:type/*"),l=(0,s._F)(),c=(0,s.xK)(),u=(0,s.NU)(),x=n?n.pathnameBase:"/spaces",{pathname:g}=(0,o.zy)(),m=(0,i.A)(e[g]&&g,!0),p=(0,r.useCallback)(((e,n)=>{if(!n)return c(e);const r=l[e-1],o=l[e+1],i=(n,r)=>{t(`${n}${r?`/${r}`:""}`),c(e)};return m?i(m):r?i(r.path,r.params):o?i(o.path,o.params):i(x)}),[l,c,x,m]);return[(0,r.useMemo)((()=>l.map((e=>({...e,children:e.id&&"nodes"===e.type?(0,d.jsx)(a.N,{nodeId:e.id}):"alerts"===e.type?(0,d.jsx)(h,{alertId:e.id}):null})))),[l]),(e,t)=>{-1===e&&-1===t||u({sourceIndex:e,destinationIndex:t})},p]}},48106:(e,t,n)=>{n.d(t,{A:()=>d});n(98992),n(72577);var r=n(96540),o=n(69457),i=n(4719),s=n(50239),a=n(66814);const l=e=>{const t=(0,r.useRef)();return(0,a.i7)(e,(e=>(t.current=e,!1))),t},c=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.id===t)return n;if(r.children&&r.children.length>0){const e=c(r.children,t);if(-1!==e)return n+1+e}}return-1},d=(e,t)=>{const n=(0,o.NF)(),a=l(i.tu),d=l(o.i8),u=(0,s.Gr)(),h=(0,r.useMemo)((()=>({goToElement:function(n){let{leaf:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!(!t.length||!e)&&(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;new Promise((n=>{const r=t=>{if(0===t)return n();e(),setTimeout((()=>r(--t)))};r(t)}))}((()=>{let o=c(t,n);if(r)for(;t[o]?.level<(t[o+1]?.level??999999);)o+=1;if(-1!==o)return e.scrollToIndex(o,{align:"center"})}),5),!0)},goToLink:e=>{const t=Object.values(a.current).find((t=>t.link&&t.link===e));if(t)return h.goToElement(t.id,{leaf:!0});if(d.current){const t=Object.values(d.current).find((t=>t.link&&t.link.includes(e)));if(t)return h.goToElement(t.id,{leaf:!0})}}})),[n,t]);return(0,r.useLayoutEffect)((()=>{u(h)}),[h]),h}},54025:(e,t,n)=>{n.d(t,{t:()=>i});var r=n(63766),o=n(74848);const i=e=>{let{id:t,testId:n="chart-sub-menu-container",...i}=e;return(0,o.jsx)(r.Flex,{column:!0,gap:2,id:t,"data-testid":n,"data-menuid":t,...i})}},55048:(e,t,n)=>{n.d(t,{A:()=>c});n(98992),n(54520);var r=n(96540),o=n(46587),i=n(24609),s=n(19186),a=n(81685),l=n(79022);const c=()=>{const e=(0,o.NJ)(),t=(0,i.vt)(),n=(0,s.ID)(),[,c]=(0,a.x)(),d=(0,r.useCallback)((()=>{const r=(0,l.l8)({userId:e,spaceId:t,roomId:n});return c(r),r}),[e,t,n,c]),u=(0,r.useCallback)((r=>{(0,l.zz)({userId:e,spaceId:t,roomId:n},r),c(r)}),[e,t,n,c]),h=(0,r.useCallback)((e=>{const t=d();u(t.filter((t=>t!==e)))}),[e,t,n]);return[d,u,h]}},60602:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(96540),o=n(68531);const i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const[i,s]=(0,r.useState)(e);return(0,o.A)((()=>s(e)),t,[e,...n]),i}},63996:(e,t,n)=>{n.d(t,{t:()=>h});var r=n(96540),o=n(63766),i=n(45087),s=n(4719),a=n(549),l=n(75144),c=n(74848);const d=e=>{let{name:t,level:n,descendantIds:i,enableFavourites:s,ref:a,...l}=e;const d=(0,r.useMemo)((()=>Array.from(Array(n)).fill("-").join("")),[n]),u=(0,r.useMemo)((()=>s?`${d} ${t}`:t),[s,d,t]),h=(0,r.useMemo)((()=>({...!s||i?.length&&!l?.selfChartIds?.length?{}:{color:"primary"},...l})),[i,l]);return"string"===typeof t?(0,c.jsx)(o.Text,{strong:!0,ref:a,...h,children:u}):t||null},u=(0,a.A)((e=>{let{hasTooltip:t,hasInfo:n,...r}=e;return t&&n?(0,c.jsx)(i.A,{content:(0,c.jsx)(l.X,{id:r.id}),isBasic:!0,children:(0,c.jsx)(d,{...r})}):(0,c.jsx)(d,{...r})})),h=(0,s.aV)(u,(e=>{let{name:t,info:n,...r}=e;return{name:t,hasInfo:!!n,...r}}))},69001:(e,t,n)=>{n.d(t,{h:()=>i});var r=n(63766),o=n(74848);const i=e=>{let{id:t,...n}=e;return(0,o.jsx)(r.Flex,{column:!0,"data-testid":"chart-menu-wrapper","data-menuid":t,...n})}},72060:(t,n,r)=>{r.d(n,{A:()=>o});const o=t=>{try{if(!t)return null;const e=document.createElement("a");return e.href=t,/https?/.test(e.protocol)?new URL(e.protocol+"//"+e.host+e.pathname+e.search+e.hash).toString():null}catch(e){return null}}},75144:(e,t,n)=>{n.d(t,{X:()=>s});var r=n(4719),o=n(14963),i=n(74848);const s=(0,r.aV)((e=>e.children?(0,i.jsx)(o.A,{as:"p",role:"document",...e}):null),(e=>{let{info:t}=e;return{children:t}}))},77234:(e,t,n)=>{n.d(t,{x:()=>r});const r={home:"home",overview:"overview",nodes:"nodes",k8s:"k8s",top:"top",logs:"logs",dashboards:"dashboards",dashboard:"dashboard",alerts:"alerts",ar:"ar",events:"events",insights:"insights"}},80110:(e,t,n)=>{n.r(t),n.d(t,{SettingsContainer:()=>kc,default:()=>Sc});var r=n(96540),o=n(39175),i=n(7960),s=n(19707),a=n(72060),l=n(55164),c=n(63474),d=n(62718),u=n(37617),h=n(1174),x=n(92318),g=n(99728),m=n(99094),p=(n(98992),n(54520),n(72577),n(81454),n(8872),n(25509),n(65223),n(60321),n(41927),n(11632),n(64377),n(66771),n(12516),n(68931),n(52514),n(35694),n(52774),n(49536),n(21926),n(94483),n(16215),n(30569)),f=n(88934),j=n(91539),b=n(24609),v=n(19186),y=n(18739),w=n(58247),C=n(16922),I=n(81685),k=n(22068),A=n(55048),S=n(63872),T=n(44245),F=n(77234),N=n(95428);const M=()=>document.querySelectorAll(`[data-testid='${N.Q}']`).length;var L=n(78152),$=n(4204);const D=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),{refresh:n}=(0,y.JN)(),o=(0,g.JT)("insights:ReadReport"),[i,s]=(0,k.A)(),[a,l]=(0,A.A)(),[c,d]=(0,S.A)(),{pathname:u}=(0,f.zy)(),h=u.includes(F.x.insights)&&!u.includes(m.p9),[,,,x]=(0,I.W5)(),[,N]=(0,T.m0)({tabId:F.x.insights}),[D]=(0,I.ly)(),B=(0,p.yF)((0,r.useCallback)(((r,o,u)=>{let{data:g}=u;const p=(g?.reports||[]).filter((e=>{let{definitionId:t}=e;return L.UY||t!==m.oG.alertInvestigation})),f=i(),j=a(),b=p.filter((e=>{let{status:t,isScheduled:n}=e;return!n&&!m.bs.includes(t)})).map((e=>{let{id:t}=e;return t})),v=f.filter((e=>b.includes(e))),y=v.filter((e=>!j.includes(e))),{COMPLETED:w,FAILED:I}=function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((t,n)=>{const r=e.find((e=>e.id===n));return r?{...t,[r.status]:[...t[r.status]||[],r.id]}:t}),{COMPLETED:[],FAILED:[]})}(y,p);if(y.length&&(w.length&&c({header:"New report",text:"A new report has been generated!"}),I.length&&(s(f.filter((e=>!I.includes(e)))),d({header:"Error",text:"Failed to generate report."})),l(Array.from(new Set([...j,...y.filter((e=>!I.includes(e)))]))),(w.length||I.length)&&(x(),n()),!h&&w.length+I.length>0)){const e=w.length>0?"success":"error";N({color:e})}o((0,C.Tj)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,reports:p.map((e=>({...e,isUnread:v.includes(e.id)})))})))}),[e,t,i,s,a,l,x,n,c,d,h,N])),R=(0,p.yF)((0,r.useCallback)(((n,r,o)=>{r((0,C.Tj)({spaceId:e,roomId:t}),(e=>({...e,loaded:!0,error:o?.response?.data||"Something went wrong"})))}),[e,t]));return(0,j.A)((()=>({enabled:!$.ei&&o&&!!e&&!!t,force:!0,polling:!!D.length,fetch:()=>(e=>{let{spaceId:t,roomId:n}=e;const r=(0,w.eF)({spaceId:t,roomId:n}),o=(0,w.XN)({spaceId:t,roomId:n});return Promise.all([r,o]).then((e=>{let[t,n]=e;const r=[...t?.data?.reports||[],...(n?.data||[]).map((e=>({...e,isScheduled:!0})))];return Promise.resolve({data:{reports:r}})}))})({spaceId:e,roomId:t}),onFail:R,onReceive:B,pollingOptions:{pollingInterval:h?5e3:15e3,checkPauseCondition:M}})),[e,t,h,o,D.length])};var B=n(83268),R=n(37479),P=n(60908),V=n(85660),_=n(88255),O=n(50271),E=n(24013),H=n(87083),z=n(49435),K=n(42790),W=n(34843),G=n(52035),q=n(84929);const U={filteredNodesIds:[],filteredNodesCount:0,nodesCount:0},J=(0,q.Iz)((()=>(0,G.eU)(U))),Y=()=>{const e=(0,v.ID)();return(0,W.md)(J(e))},Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView";const t=(0,v.ID)();return(0,K.rW)("tocSearch",{key:t,extraKey:e,defaultValue:"",flavour:"val"})},Q=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;if(null===e)return 0;if("string"===typeof e){const n=t(e);return n>0?n:0}if(Array.isArray(e)){let n=0;for(const r of e){const e=Q(r,t);e>n&&(n=e)}return n}if("object"===typeof e){let n=0;for(const r in e){const o=Q(e[r],t);o>n&&(n=o)}return n}return 0},X=["version","labels","hw","os","state","nodeStatus","health","replicationFactor","replication","technology"],ee=function(e,t){let{shouldHide:n=()=>!1,cacheKey:o,extraKey:i="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=(0,E.Gt)(e),a=function(){const e=Z(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView");return"string"!==typeof e?"":e.trim().toLowerCase()}(i),[l,c,d]=(0,r.useMemo)((()=>{let e=0,t=0;const r=s.filter((e=>!n(e)));t=r.length;const o=r.map((t=>{let n=0,r=0,o=0;if(a){const{name:e,...i}=t;r=t.name?(0,z.pe)(e,a):0,o=Q(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return X.reduce(((t,n)=>(void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]),t)),{})}(i),(e=>(0,z.pe)(String(e),a,{scoreFactor:.6,minScore:.6})));n=("Live"===t.nodeStatus?100:"Stale"===t.nodeStatus?50:0)+10*r+o}const i=!!a&&!(r>.3||o>.3);return i||(e+=1),{id:t.id,searchScore:n,included:!i}})).filter((e=>e.included));return[o,t,e]}),[a,s,o]),u=(()=>{const e=(0,v.ID)();return(0,W.Xr)(J(e))})(),h=(0,r.useMemo)((()=>l.map((e=>{let{id:t}=e;return t}))),[l]),x=(0,r.useMemo)((()=>l.reduce(((e,t)=>{let{id:n,searchScore:r}=t;return r>0&&(e[n]=r),e}),{})),[l]);return(0,r.useEffect)((()=>{u({filteredNodeIds:h,filteredNodesCount:d,nodesCount:c})}),[h,c,d,t]),[h,x,c]};var te=n(87733),ne=n(18907),re=n(76621),oe=n(63766),ie=n(41514),se=n(68531),ae=n(74848);const le=e=>{let{extraKey:t}=e;const[n,o]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView";const t=(0,v.ID)();return(0,K.N9)("tocSearch",{key:t,extraKey:e,defaultValue:"",flavour:"val"})}(t),[i,s]=(0,r.useState)(n||"");return(0,se.A)((()=>{o(i),(0,ie.H)("toc-search","search-automatic-trigger","nodes-view",i)}),300,[i]),(0,r.useEffect)((()=>{n!==i&&s(n)}),[n]),(0,ae.jsx)(oe.TextInput,{iconLeft:(0,ae.jsx)(oe.Icon,{name:"search",color:i?"textFocus":"textLite",width:"14px",height:"14px"}),iconRight:!!i&&(0,ae.jsx)(oe.IconButton,{icon:"x",iconColor:i?"textFocus":"textLite",width:"14px",height:"14px",onClick:()=>{s(""),(0,ie.H)("toc-search","clear-search-button","nodes-view")},padding:[0],neutral:!0,"data-testid":"filterNodesInput-clearButton"}),value:i,onChange:e=>s(e.target.value),size:"small",placeholder:"Search nodes",name:"Search nodes","data-testid":"filterNodesInput",containerStyles:{width:"100%"}})};var ce=n(73700);const de=(0,ce.s)(300,((e,t)=>(0,ie.H)("toc-search","search-results","nodes-view",e,`${t} -- nodes`))),ue=()=>{const e=Z(),{filteredNodesCount:t,nodesCount:n}=Y();return(0,r.useEffect)((()=>{e&&de(e,t)}),[e,t]),(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)(oe.TextMicro,{alignSelf:"end",color:"textLite",margin:[1,0,0],"data-testid":"numberOfNodesIndication",children:["Showing"," ",(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-filteredNodesCount",children:t})," ","of total"," ",(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-nodesCount",children:n})," ","nodes"]})})},he=()=>{const{filteredNodesCount:e}=Y();return e?null:(0,ae.jsxs)(oe.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription"}),(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})},xe=e=>{let{extraKey:t}=e;return(0,ae.jsxs)(oe.Flex,{column:!0,alignItems:"center",children:[(0,ae.jsx)(le,{extraKey:t}),(0,ae.jsx)(ue,{}),(0,ae.jsx)(he,{})]})};var ge=n(79748);const me=()=>(0,ae.jsxs)(oe.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,ae.jsx)(oe.Box,{margin:[0,4,0,0],children:(0,ae.jsx)(oe.Box,{as:oe.Icon,width:10,height:10,name:"nodes_update"})}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:2,children:[(0,ae.jsx)(oe.Text,{strong:!0,children:"Couldn't find the node you were looking for? "}),(0,ae.jsxs)(oe.Text,{color:"textDescription",children:["Netdata can be used to monitor all kinds of infrastructure, from tiny stand-alone IoT devices to complex hybrid setups combining on-premise and cloud infrastructure, mixing bare-metal servers, virtual machines and containers. Check our"," ",(0,ae.jsx)(ge.A,{href:"https://learn.netdata.cloud/docs/deployment-guides",target:"_blank","data-ga":"node-area::click-link-collectors::nodes-view",children:"deployments guides"})," ","and start monitor your infrastructure."]})]})]}),pe=e=>{let{children:t}=e;return(0,ae.jsxs)(oe.Flex,{column:!0,flex:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",children:[(0,ae.jsxs)(oe.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,ae.jsx)(oe.H3,{margin:[0,0,4],children:"No nodes to display"}),(0,ae.jsx)(oe.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),t,(0,ae.jsx)(me,{})]})};var fe=n(6304),je=n(63589),be=n(89590),ve=n(32788),ye=n(29263),we=n(47410),Ce=n(32052),Ie=n(22871),ke=n(25291),Ae=n(53749);const Se=()=>{},Te=e=>{let{roomId:t,id:n,onRemove:r=Se}=e;const o=(0,v.wz)(t,"name"),i=(0,Ie.e6)(t,n,"title"),s=(0,Ie.gV)(t),[a,,l,c]=(0,fe.A)();return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(oe.Button,{danger:!0,flavour:"hollow",onClick:l,label:"Delete metric","data-testid":"remove-metric"}),a&&(0,ae.jsx)(oe.ConfirmationDialog,{"data-ga":"remove-metric-dialog","data-testid":"removeMetricDialog",handleConfirm:async()=>{await s(n),r()},handleDecline:c,message:(0,ae.jsxs)(ae.Fragment,{children:["You are about to remove ",(0,ae.jsx)("strong",{children:i})," metric.",(0,ae.jsx)("br",{}),"Are you sure you want to continue?"]}),title:`Remove metric from ${o}`})]})},Fe=e=>{let{link:t,children:n}=e;return(0,ae.jsxs)(oe.Flex,{as:"a",target:"_blank",href:t,gap:1,alignItems:"end",children:[(0,ae.jsx)(oe.TextNano,{textDecoration:"undeline",children:n}),(0,ae.jsx)(oe.Icon,{color:"text",name:"question",width:"16px",height:"16px"})]})},Ne=e=>{let{title:t,help:n,link:r,disclaimer:o,children:i,...s}=e;return(0,ae.jsxs)(oe.Flex,{gap:1,column:!0,...s,children:[(0,ae.jsxs)(oe.Flex,{justifyContent:"between",alignItems:"baseline",children:[(0,ae.jsx)(oe.Text,{as:"label",margin:[0],children:t}),n&&(0,ae.jsx)(Fe,{link:r,children:n})]}),i,o&&(0,ae.jsx)(oe.TextSmall,{children:o})]})};var Me=n(91130),Le=n(16866);const $e=e=>{let{dimensions:t}=e;return{dimensions:t.map((e=>{let{name:t}=e;return{value:t,label:t}}))}},De=e=>{let{isNew:t}=e;return(0,ae.jsxs)(oe.Flex,{as:"span",gap:1,children:["Manage room",(0,ae.jsx)(oe.TextBig,{color:"textLite",children:"/"}),(0,ae.jsxs)(oe.TextBig,{color:"textLite",children:[t?"Add":"Edit"," Metric"]})]})},Be=[{value:"value",label:"Value"},{value:"progressBar",label:"Progress Bar"}],Re=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"min",label:"Minimum"},{value:"max",label:"Maximum"}],Pe=[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}],Ve=e=>{let{spaceId:t,roomId:n,id:o,onClose:i,tabId:s,...a}=e;const l="new"===o,c=(0,Ie.uB)(n,o),d=(0,Ie.e6)(n,o),[u,h]=(0,r.useState)(d),{title:x,context:g,dimensions:m=[],totalDimensions:p=[],calculateTotal:f=!1,columnFlavour:j="value",aggregation:b="sum",fractionDigits:v=1,hideUnits:y=!1,align:w="center"}=u;(0,r.useEffect)((()=>{l&&c()}),[]);const C=(0,H.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),I=(0,ke.A)(n,C,{spaceId:t});if(I)throw I;const k=(0,Ae.OL)(n),A=(0,r.useMemo)((()=>k.map((e=>({value:e,label:e})))),[k]),S=(0,Ae._0)(n),T=(0,r.useMemo)((()=>g&&{value:g,label:g}),[g]),[{dimensions:F},N]=(0,Ce.A)((()=>({enabled:!!g,fetch:()=>((e,t,n)=>Me.A.get(`${Le.P8}/spaces/${e}/rooms/${t}/contexts/${encodeURIComponent(n)}`,{transform:$e}))(t,n,g),initialValue:{dimensions:[]}})),[t,n,g]),M=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,context:t,dimensions:[],title:t})))}),[]),L=(0,r.useMemo)((()=>F?0===m.length?[]:m.map((e=>({value:e,label:e}))):[]),[m,F]),$=(0,r.useMemo)((()=>F?0===p.length?[]:p.map((e=>({value:e,label:e}))):[]),[p,F]),D=(0,r.useCallback)((e=>{N||h((t=>({...t,dimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[N]),B=(0,Ie.tQ)(n),R=(0,r.useCallback)((()=>B({...u,id:o,type:s}).then(i)),[u,o,s,i,B]),P=(0,r.useCallback)((e=>{let{target:{value:t}}=e;t.length<=30&&h((e=>({...e,title:t,header:t,headerString:t})))}),[]),V=(0,r.useCallback)((e=>{N||h((t=>({...t,totalDimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[N]),_=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,columnFlavour:t,calculateTotal:"value"!==t&&e.calculateTotal})))}),[]),O=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,aggregation:t})))}),[]),E=(0,r.useCallback)((e=>{let{value:t}=e;h((e=>({...e,align:t})))}),[]),z=(0,r.useCallback)((e=>{let{target:{value:t}}=e;const n=parseInt(t,10);!isNaN(n)&&n>=0&&n<=3&&h((e=>({...e,fractionDigits:n})))}),[]),K=(0,r.useCallback)((e=>{let{target:{checked:t}}=e;h((e=>({...e,hideUnits:t})))}),[]),W=(0,r.useCallback)((e=>{let{target:{checked:t}}=e;h((e=>({...e,calculateTotal:t,totalDimensions:t?e.totalDimensions:[]})))}),[]),G=!x||!g;return(0,ae.jsxs)(ve.GO,{onClose:i,...a,children:[(0,ae.jsx)(ye.z,{onClose:i,title:(0,ae.jsx)(De,{isNew:l}),children:(0,ae.jsx)(oe.Button,{label:"Save",onClick:R,disabled:G})}),(0,ae.jsx)(we.U,{children:l?"Add a new metric (column)":"Edit metric"}),(0,ae.jsx)(ve.Yv,{children:(0,ae.jsxs)(oe.Flex,{gap:6,column:!0,children:[(0,ae.jsx)(Ne,{title:"Context",help:"What is a context?",link:"https://learn.netdata.cloud/docs/dashboards-and-charts/netdata-charts#contexts","data-testid":"manageMetrics-context",children:(0,ae.jsx)(oe.Select,{options:A,value:T,onChange:M,isLoading:!S,"data-testid":"manageMetrics-contextSelect"})}),(0,ae.jsx)(Ne,{title:"Metric Title","data-testid":"manageMetrics-title",children:(0,ae.jsx)(oe.TextInput,{name:"title",placeholder:"Type name",value:x,onChange:P})}),(0,ae.jsx)(Ne,{title:"Dimensions",help:"What is a dimension?",link:"https://learn.netdata.cloud/docs/dashboards-and-charts/netdata-charts#dimensions",disclaimer:"Dimensions to use for value calculation. Leave blank to use all available dimensions.","data-testid":"manageMetrics-dimensions",children:(0,ae.jsx)(oe.Select,{isMulti:!0,options:F,value:L,onChange:D,isLoading:N,isDisabled:!T,"data-testid":"manageMetrics-dimensionSelect"})}),(0,ae.jsx)(Ne,{title:"Display Type","data-testid":"manageMetrics-columnFlavour",children:(0,ae.jsx)(oe.Select,{options:Be,value:{value:j,label:"value"===j?"Value":"Progress Bar"},onChange:_,"data-testid":"manageMetrics-columnFlavourSelect"})}),(0,ae.jsx)(oe.Toggle,{labelRight:"Calculate as percentage of total",checked:f,onChange:W,"data-testid":"manageMetrics-calculateTotalToggle",colored:!0}),f&&(0,ae.jsx)(Ne,{title:"Total Dimensions",disclaimer:"Dimensions to use for total calculation. Leave blank to use all available dimensions.","data-testid":"manageMetrics-totalDimensions",children:(0,ae.jsx)(oe.Select,{isMulti:!0,options:F,value:$,onChange:V,isLoading:N,isDisabled:!T,"data-testid":"manageMetrics-totalDimensionSelect"})}),(0,ae.jsx)(Ne,{title:"Aggregation","data-testid":"manageMetrics-aggregation",children:(0,ae.jsx)(oe.Select,{options:Re,value:(0,r.useMemo)((()=>Re.find((e=>e.value===(b||"sum")))),[b]),onChange:O,"data-testid":"manageMetrics-aggregationSelect"})}),(0,ae.jsx)(Ne,{title:"Decimal Places","data-testid":"manageMetrics-fractionDigits",children:(0,ae.jsx)(oe.TextInput,{type:"number",name:"fractionDigits",min:"0",max:"3",value:v,onChange:z})}),(0,ae.jsx)(Ne,{title:"Hide Units","data-testid":"manageMetrics-hideUnits",children:(0,ae.jsx)(oe.Toggle,{checked:y,onChange:K,"data-testid":"manageMetrics-hideUnitsToggle"})}),(0,ae.jsx)(Ne,{title:"Text Alignment","data-testid":"manageMetrics-align",children:(0,ae.jsx)(oe.Select,{options:Pe,value:{value:w,label:Pe.find((e=>e.value===w))?.label},onChange:E,"data-testid":"manageMetrics-alignSelect"})}),!l&&(0,ae.jsx)(oe.Flex,{justifyContent:"end",children:(0,ae.jsx)(Te,{roomId:n,id:o,onRemove:i})})]})})]})};var _e=n(49163),Oe=n(45087),Ee=n(43375),He=n(43627),ze=n(74979);const Ke=e=>{let{metric:t,onToggle:n,onEdit:r,disabled:o}=e;const{attributes:i,listeners:s,setNodeRef:a,transform:l,transition:c}=(0,He.gl)({id:t.id}),d={transform:ze.Ks.Transform.toString(l),transition:c};return(0,ae.jsx)("div",{ref:a,style:d,...i,children:(0,ae.jsxs)(oe.Flex,{"data-testid":`metricsMenu-metric-${t.title}`,justifyContent:"between",alignItems:"center",padding:[1,0],children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[!o&&(0,ae.jsx)(oe.Icon,{name:"nav_dots",color:"textLite",cursor:"grab",size:"small",...s}),(0,ae.jsx)(oe.Checkbox,{checked:!t.hidden,"data-testid":"metricsMenu-metricCheckbox",label:t.title,onChange:n})]}),(0,ae.jsx)(oe.IconButton,{"data-testid":"metricsMenu-editMetric",flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:r,width:"10px",height:"10px"})]})})},We=e=>{let{isOpen:t,onClose:n,onEdit:o,roomId:i,targetRef:s,tabId:a}=e;const[l,c]=(0,Ie.tY)(i),d=(0,r.useMemo)((()=>l.filter((e=>e.type===a))),[a,l]),[u,h]=(0,r.useState)(d.map((e=>e.id)));(0,r.useEffect)((()=>{h(d.map((e=>e.id)))}),[d]);const x=(0,Ee.FR)((0,Ee.MS)(Ee.AN),(0,Ee.MS)(Ee.uN,{coordinateGetter:He.JR})),g=(0,Ie._E)(i,a),m=(0,r.useCallback)((e=>{const{active:t,over:n}=e;if(t?.id&&n?.id&&t.id!==n.id){const e=u.indexOf(t.id),r=u.indexOf(n.id),o=(0,He.be)(u,e,r);h(o),g(o)}}),[u,g]),p=(0,_e._)({roomId:i,params:{type:"roomMetrics",entity:"metrics",path:"/nodes"}})[0],f=(0,Ie.Ul)(i,a);if(!s.current||!t)return null;const j=e=>{o(e),n()};return(0,ae.jsxs)(oe.Drop,{align:{top:"bottom",right:"right"},animation:!0,background:"dropdown",column:!0,margin:[.5,0,0],overflow:{vertical:"auto"},padding:[3],round:!0,width:70,close:n,"data-testid":"metricsMenu",onClickOutside:n,onEsc:n,target:s.current,gap:1,children:[(0,ae.jsx)(oe.Button,{"data-testid":"metricsMenu-addMetricButton",label:"Add new metric",icon:"plus",onClick:()=>j("new"),small:!0,alignSelf:"end"}),(0,ae.jsx)(Ee.Mp,{sensors:x,collisionDetection:Ee.fp,onDragEnd:m,children:(0,ae.jsx)(He.gB,{items:u,strategy:He._G,children:(0,ae.jsx)(oe.Flex,{column:!0,children:u.map((e=>{const t=d.find((t=>t.id===e));return t?(0,ae.jsx)(Ke,{metric:t,onToggle:()=>c(t.id,(e=>({...e,hidden:!e.hidden,type:a}))),onEdit:()=>j(t.id),disabled:!1},t.id):null}))})})}),p&&(0,ae.jsx)(Oe.A,{content:"All metrics will be reset to defaults",children:(0,ae.jsx)(oe.Button,{padding:[0],"data-testid":"metricsMenu-resetButton",label:"Reset to default metrics",flavour:"borderless",onClick:f,small:!0,danger:!0,alignSelf:"end"})})]})},Ge=e=>{let{spaceId:t,roomId:n,tabId:o}=e;const[i,,s,a]=(0,fe.A)(),[l,c]=(0,r.useState)(null),d=(0,r.useRef)();return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(oe.Button,{"data-ga":"metric-setting::click-metric-setting::hm-nodes","data-testid":"metricSettings-button",flavour:"hollow",icon:"gear",neutral:!0,onClick:s,ref:d,label:"Metrics",small:!0}),(0,ae.jsx)(We,{isOpen:i,onClose:a,onEdit:c,roomId:n,tabId:o,targetRef:d}),l&&(0,ae.jsx)(Ve,{"data-testid":"metricsManagement",spaceId:t,roomId:n,tabId:o,id:l,onClose:()=>c(null)})]})};var qe=n(94404);const Ue=()=>(0,ie.H)("grouping","click-grouping","hm-nodes"),Je=(0,qe.A)(je.A),Ye=[{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"}],Ze=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),[n,,o,i]=(0,fe.A)(),[s,a]=(0,O.TS)(t,"groupMode"),l=(0,r.useMemo)((()=>Ye.find((e=>e.value===s))||Ye[0]),[s]),c=(0,r.useCallback)((e=>{let{value:t}=e;return a(t)}),[a]);return(0,ae.jsxs)(oe.Flex,{alignItems:"center","data-testid":"agentsHead-actions",flexWrap:!1,gap:3,children:[(0,ae.jsx)(oe.Select,{label:"Group by",onChange:c,onMenuOpen:Ue,options:Ye,value:l}),(0,ae.jsx)(Ge,{roomId:t,spaceId:e}),n&&(0,ae.jsx)(be.A,{onClose:i}),(0,ae.jsx)(Je,{"data-ga":"add-nodes::click-add-nodes::hm-nodes","data-testid":"agentsHead-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:o,small:!0})]})},Qe=()=>(0,ae.jsx)(oe.Flex,{width:"100%",justifyContent:"end",background:"mainBackground",padding:[2],children:(0,ae.jsx)(Ze,{})});n(3949);var Xe=n(85163),et=n(84535);const tt="clear",nt="warning",rt="critical",ot="unreachable";var it=n(49181);const st={alertStatus:{[rt]:1,[nt]:2,[tt]:3,[ot]:4},nodeStatus:{Live:1,Stale:2,Offline:3}},at={nodeStatus:e=>(0,it.GM)(e.state),alertStatus:e=>(0,it.vt)(e),vendor:e=>e.labels?.vendor||"Unknown",type:e=>e.labels?.type||"Unknown",location:e=>e.labels?.sysLocation||e.labels?.location||"Unknown","":()=>"Nodes"};var lt=n(56876),ct=n(30863),dt=n(69001),ut=n(95836),ht=n(27496);const xt=e=>{let{id:t,...n}=e;return(0,ae.jsxs)(dt.h,{id:t,...n,children:[(0,ae.jsx)(ut.$,{id:t}),(0,ae.jsx)(ht.n,{id:t})]})},gt=(0,r.memo)(xt);var mt=n(16373),pt=n(90901),ft=n(82103),jt=n(55759),bt=n(77186),vt=n(59400);const yt=e=>{let{connectivity:t,id:n,name:r,...o}=e;const i=(0,g.JT)("node:Delete"),s=!(0,v.XA)().untouchable,[a,,l,c]=(0,fe.A)(),[d,,u,h]=(0,fe.A)();return(0,ae.jsxs)(vt.SS,{alignSelf:"end",gap:1,"data-testid":"node-actions",...o,children:[s&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(ft.A,{badge:"actionRemove","data-testid":"remove-node-action",children:(0,ae.jsx)(vt.d0,{"data-ga":"nodes-table-row::click-remove-node::nodes-view",onClick:u})}),d&&(0,ae.jsx)(bt.Ay,{ids:[n],name:r,onClose:h})]}),i&&"Offline"===t&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(ft.A,{badge:"actionObsolete","data-testid":"obsolete-node-action",children:(0,ae.jsx)(vt.AS,{"data-ga":"nodes-table-row::click-obsolete-node::nodes-view",onClick:l})}),a&&(0,ae.jsx)(jt.Ay,{ids:[n],name:r,onClose:c})]})]})};var wt=n(97336);const Ct=e=>{let{instanceType:t,name:n,providerType:r,...o}=e;return(0,ae.jsx)(ft.A,{badge:"cloudInfo","data-testid":"node-cloud-info",nodeName:n,...o,children:(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-cloud-info-icon",name:"ipNetworking",width:"18px",height:"18px"}),(0,ae.jsxs)(oe.TextSmall,{color:"textDescription","data-testid":"node-cloud-info-text",children:[(0,it.ws)(r)," \u2022 ",(0,it.ws)(t)]})]})})},It=e=>{let{connectivity:t,name:n,...r}=e;return(0,ae.jsx)(ft.A,{badge:"connectivity",connectivityState:t,"data-testid":"node-connectivity",nodeName:n,...r,children:(0,ae.jsx)(oe.Icon,{name:`connectivityStatus${t}`,width:"18px",height:"18px"})})},kt=e=>{let{onClick:t,...n}=e;return(0,ae.jsx)(ft.A,{badge:"info","data-testid":"node-info-cta",...n,children:(0,ae.jsx)(oe.Icon,{color:"textDescription",cursor:"pointer",height:"18px",width:"18px",name:"information",onClick:t})})},At=e=>{let{name:t,...n}=e;return(0,ae.jsx)(ft.A,{badge:"k8s","data-testid":"node-kubernetes",nodeName:t,...n,children:(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-kubernetes-icon",name:"serviceKubernetes",width:"18px",height:"18px"}),(0,ae.jsx)(oe.TextSmall,{color:"textDescription","data-testid":"node-kubernetes-text",children:"k8s"})]})})},St=e=>{let{kernelName:t,kernelVersion:n,name:r,...o}=e;return(0,ae.jsx)(ft.A,{badge:"kernel","data-testid":"node-kernel",nodeName:r,...o,children:(0,ae.jsx)(oe.TextSmall,{color:"textDescription",children:(0,it.Ud)(t,n)})})};var Tt=n(52253),Ft=n(41708),Nt=n(92834);const Mt=e=>{let{architecture:t,cpuFrequency:n,cpus:r,diskSpace:o,memory:i,name:s,os:a,osName:l,timezone:c,...d}=e;return(0,ae.jsx)(ft.A,{badge:"systemInfo","data-testid":"node-system-info",nodeName:s,...d,children:(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-system-info-icon",name:et.u[l]?.iconName||et.U[a]?.iconName||"os",width:"16px",height:"16px"}),(0,ae.jsxs)(oe.TextSmall,{color:"textDescription","data-testid":"node-system-info-text",children:[(0,it.ws)(l)," \u2022 ",(0,it.O)(n)," \u2022"," ",(0,it.ws)(r,1===r?"Core":"Cores")," \u2022"," ",(0,it.ws)(t)," \u2022"," ",(0,it.ws)((0,it.RI)(i),"RAM")," \u2022"," ",(0,it.ws)((0,it.RI)(o),"HD"),!!c&&(0,ae.jsxs)(ae.Fragment,{children:[" ","\u2022 ",(0,ae.jsx)(Nt.A,{timezone:c})]})]})]})})},Lt=e=>{let{container:t,name:n,virtualization:r,...o}=e;const i=(0,it.Pg)(t,r);return(0,ae.jsx)(ft.A,{badge:"type","data-testid":"node-type",nodeName:n,nodeType:i.label,...o,children:(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{color:"textDescription","data-testid":"node-type-icon",name:i.icon,height:i.iconSize,width:i.iconSize}),(0,ae.jsx)(oe.TextSmall,{color:"textDescription","data-testid":"node-type-text",children:i.label})]})})};var $t=n(71236);const Dt=e=>{let{health:t={}}=e;const{silencingState:n}=t.alerts||{},{state:r}=n||{};return"NONE"!=r?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(oe.Flex,{children:(0,ae.jsx)($t.A,{flavour:"node",silencing:n})})]}):null};var Bt=n(74891);const Rt=(0,Bt.A)((0,qe.A)(oe.Button)),Pt=e=>{let{id:t}=e;const n=(0,f.Zp)(),o=(0,b.bq)(),i=(0,r.useCallback)((()=>{const e={nodeId:t};n(`/spaces/${o}/settings/notifications#notificationsActiveTab=1&silencingRulePrefill=${JSON.stringify(e)}`)}),[]);return(0,ae.jsx)(Rt,{feature:"SilencingNode",payload:{nodeId:""},tooltip:"Create a new silencing rule for this node",flavour:"hollow",icon:"alarm_off",iconWidth:"12px",onClick:i})};var Vt=n(36504),_t=n(92942),Ot=n(19371),Et=n(63928);const Ht=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"servers";const n=(0,_e._)({params:{type:["favourites"],path:[`/${e}/${t}`]}}),o=(0,r.useMemo)((()=>n.filter((e=>{let{value:t}=e;return t?.nodeId})).sort(((e,t)=>(e.value.sortOrder||0)-(t.value.sortOrder||0))).map((e=>{let{value:t}=e;return t.nodeId}))),[n]),i=(0,r.useMemo)((()=>n.reduce(((e,t)=>({...e,...t.value?.nodeId?{[t.value.nodeId]:t}:{}})),{})),[n]),s=(0,Et.xS)(),a=(0,r.useCallback)((async e=>{const t=e.map(((e,t)=>{const n=i[e];if(n)return s({...n,value:{...n.value,sortOrder:t}})}));await Promise.all(t.filter(Boolean))}),[i,s]);return{favoriteNodeIds:o,settingsByNodeId:i,handleOrderChange:a}},zt=(e,t)=>e&&e.getRoot().getChildren().find((e=>e.match({id:`nodes-${t}`}))),Kt=(e,t)=>`table-metrics-${e}-${t}`,Wt=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"sum";const o=zt(e,t);if(!o)return null;const i=Kt(n,r);return o.getNode({id:i})};var Gt=n(28657);const qt=e=>{let{id:t,roomId:n,nodeId:o,context:i,dimensions:s}=e;const a=(0,Ot.eg)(),l=(0,r.useMemo)((()=>{const e=zt(a,n),r=[t,o,i].join("-");if(!e)return null;let l=e.getNode({id:r});return l?(l.updateAttribute("selectedDimensions",s),l):(l=a.makeChart({attributes:{id:r,nodesScope:[o],contextScope:[i],pixelsPerPoint:20,selectedDimensions:s}}),e.appendChild(l),l)}),[i,t,o,n,a]);return l?(0,ae.jsx)(Gt.A,{chart:l,hasHeader:!1,hasFooter:!1,hasFilters:!1,height:100}):null},Ut=(0,r.memo)(qt);var Jt=n(74518);const Yt=e=>{let{id:t,context:n,nodeId:r,isLive:o,hidden:i,title:s,dimensions:a}=e;const l=(0,v.ID)();return i||!o?null:(0,ae.jsxs)(oe.Flex,{column:!0,"data-testid":`metrics-chart-${n}`,flex:"grow",basis:"174px",children:[(0,ae.jsx)(Jt.A,{text:s||n,TextComponent:oe.TextSmall,color:"textDescription",margin:[1,0,1,2],as:"div"}),(0,ae.jsx)(Ut,{id:t,context:n,nodeId:r,roomId:l,dimensions:a})]})};var Zt=n(91421),Qt=n(3319);const Xt=e=>{let{node:t,...n}=e;const[,o]=(0,Zt.PJ)(),{sendButtonClickedLog:i}=(0,Qt.A)(),s=t.capabilities?.dyncfg?.enabled,a=t.isLive&&s,l=a?"Configure this node":t.isLive?"Node cannot be configured":"Cannot configure a non live node",c=(0,r.useCallback)((()=>{a&&(o(!0,{nodeId:t.id}),i({feature:"DyncfgNode",description:"Configure node",nodeId:t?.id,nodeName:t?.name}))}),[a,t,o,i]),d=(0,r.useMemo)((()=>({name:"gear",size:"small",color:a?"text":"disabled",cursor:a?"pointer":"auto",onClick:c})),[a,c]);return(0,ae.jsx)(ft.A,{content:l,children:(0,ae.jsx)(oe.Flex,{...n,children:(0,ae.jsx)(oe.Icon,{...d})})})};var en=n(51262);const tn=(nn=Xt,e=>(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(nn,{...e})]}));var nn;const rn=e=>{let{id:t,name:n,hw:o,os:i,ni:s,capabilities:a,container:l,updateSeverity:c,bugs:d,labels:u,isLive:h,state:x,version:g,extraKey:m,health:p,menuId:f,eligibility:j}=e;const y=(0,b.dg)(),w=(0,v.ID)(),C=a.funcs?.enabled,I=a.ml?.enabled,k=(0,it.GM)(x),{isNodeRestricted:A}=(0,en.A)(),{restricted:S}=A(t),{_cloud_instance_type:T,_cloud_provider_type:F,_timezone:N}=u||{},M="true"===u?._is_k8s_node,L=!(0,it.Po)(T)||!(0,it.Po)(F),$=(0,K.Fw)("sidebarTab",{flavour:"val",extraKey:m}),D=(0,K.Fw)("sidebarOpen",{flavour:"bool"}),B=(0,K.Fw)("sidebarNodeId",{flavour:"val",extraKey:m}),R=(0,r.useCallback)((e=>{D(!0),$(e),B(t)}),[t,B,D,$]),P=(0,r.useCallback)((()=>R("alerts")),[R]),V=(0,r.useCallback)((()=>R("info")),[R]),_=(0,mt.Id)(),O=(0,pt.I)(),E=(0,Ie.Vw)(w);return(0,ae.jsxs)(oe.Flex,{"data-testid":`nodeRow-${n}`,"data-menuid":f||t,padding:[1],column:!0,gap:1,round:!0,children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center","data-testid":"nodeRow-basic-info",gap:2,height:{min:6},children:[(0,ae.jsx)(It,{connectivity:k,"data-testid":`nodeRow-connectivity-${k.toLowerCase()}`,name:n}),(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(Ft.A,{"data-testid":"nodeRow-name",id:t,name:n,isLive:h,state:x,eligibility:j}),(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(kt,{onClick:V,"data-testid":"nodeRow-more-info-cta"}),(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(wt.A,{id:t,isLive:h,"data-testid":"nodeRow-alerts",name:n,onClick:P}),(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(Tt.A,{badge:"ml","data-testid":"nodeRow-machine-learning-status",enabled:I,name:n,onClick:()=>O(t),children:(0,ae.jsx)(oe.Icon,{name:"anomaliesLens",size:"small",color:"text"})}),(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(Tt.A,{badge:"fn","data-testid":"nodeRow-fn-status",enabled:C,name:n,onClick:()=>_(t),children:(0,ae.jsx)(oe.Icon,{name:"functions",size:"small",color:"text"})}),c&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(Vt.A,{name:n,os:i.id,container:l,warningLevel:c,labels:u,version:g,text:c,"data-testid":"nodeRow-needs-update"})]}),!!(d||[]).length&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(_t.A,{bugs:d,"data-testid":"nodeRow-bugs"})]}),(0,ae.jsx)(tn,{node:{id:t,name:n,isLive:h,ni:s,capabilities:a}}),(0,ae.jsx)(yt,{"data-testid":"nodeRow-node-actions",id:t,name:n,connectivity:k}),y?null:(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Dt,{health:p}),(0,ae.jsx)(Pt,{id:t})]})]}),(0,ae.jsxs)(oe.Flex,{alignItems:"center","data-testid":"nodeRow-detailed-info",gap:2,children:[(0,ae.jsx)(Mt,{architecture:o.architecture,cpuFrequency:o.cpuFrequency,cpus:o.cpus,"data-testid":"nodeRow-system-info",diskSpace:o.diskSpace,memory:o.memory,name:n,osName:i.nm,os:i.id,timezone:N}),(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),!!i?.kernel&&(0,ae.jsx)(St,{"data-testid":"nodeRow-kernel",kernelName:i.kernel.nm,kernelVersion:i.kernel.v,name:n}),(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),M&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(At,{"data-testid":"nodeRow-kubernetes",name:n}),(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"})]}),(0,ae.jsx)(Lt,{container:o.container,"data-testid":"nodeRow-type",name:n,virtualization:o.virtualization}),L&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(vt.K,{"data-testid":"nodeRow-separator"}),(0,ae.jsx)(Ct,{"data-testid":"nodeRow-cloud-info",instanceType:T,name:n,providerType:F})]})]}),!S&&!!E?.length&&(0,ae.jsx)(oe.Flex,{"data-testid":"nodeRow-charts",gap:1,children:E.map((e=>(0,ae.jsx)(Yt,{...e,nodeId:t,isLive:h},e.id)))})]})},on=e=>{switch(e.level){case 0:return gt;case 1:return rn;default:return null}},sn=e=>{let{onChartNameChange:t,initialChartName:n,dashboardOptions:r,linkToGo:o,contextToGo:i,...s}=e;const{setActiveMenuId:a}=(0,lt.A)({onChartNameChange:t,initialChartName:n,linkToGo:o,contextToGo:i});return(0,ae.jsx)(ne.H,{...s,children:(0,ae.jsx)(ct.A,{flavour:"nodes",onActiveMenuId:a,getComponent:on,dashboardOptions:r,initialChartName:n,checkVisibility:()=>!0})})};var an=n(69457),ln=n(20871),cn=n(48106),dn=n(33185),un=n(24155);const hn=(0,dn.default)(oe.Box).attrs((e=>({...e}))).withConfig({displayName:"loader__Grid",componentId:"sc-yd9b7n-0"})(["display:grid;grid-template-columns:1fr 6fr 1fr;gap:8px;"]),xn=()=>(0,ae.jsxs)(oe.Flex,{column:!0,gap:2,children:[(0,ae.jsx)(un.A,{height:"38px"}),(0,ae.jsx)(hn,{children:Array.from(Array(15).keys()).map((e=>(0,ae.jsxs)(r.Fragment,{children:[(0,ae.jsx)(un.A,{height:"32px"}),(0,ae.jsx)(un.A,{height:"32px"}),(0,ae.jsx)(un.A,{height:"32px"})]},e)))})]});var gn=n(9962),mn=(n(30670),n(36310)),pn=n(39483);const fn=e=>{let{children:t,contextName:n,dimensions:r,aggregationMethod:o="sum",fractionDigits:i,totalDimensions:s,calculateTotal:a}=e;const{chart:l,state:c}=(0,mn.useHeadlessChart)(),{contextGroups:d}=(0,pn.useTableMatrix)();if(!d)return t({data:null,loading:!c.loaded&&c.loading,error:c.error});if(c.empty)return t({data:null,loading:!c.loaded&&c.loading,error:"No data available"});const u=d[n];if(!u)return t({data:null,loading:!c.loaded&&c.loading,error:"Context not found"});const h=l.getPayload()?.data?.length-1||0;if(a){const e=r&&r.length>0?(Array.isArray(r)?r:[r]).map((e=>u[e]?.[0])).filter(Boolean):Object.values(u).flat().filter(Boolean),n=s&&s.length>0?s.map((e=>u[e]?.[0])).filter(Boolean):Object.values(u).flat().filter(Boolean);if(0===e.length||0===n.length)return t({data:null,loading:!c.loaded&&c.loading,error:"Required dimensions not found"});const o=e.reduce(((e,t)=>e+(l.getDimensionValue(t,h)||0)),0),a=n.reduce(((e,t)=>e+(l.getDimensionValue(t,h)||0)),0),d=a>0?o/a*100:0,x=e[0];return t({data:{value:o,convertedValue:l.getConvertedValue(o,{fractionDigits:i,dimensionId:x}),total:l.getConvertedValue(a,{fractionDigits:i,dimensionId:x}),percentage:d,units:l.getUnitSign({dimensionId:x}),dimensionId:x},loading:!c.loaded&&c.loading,error:null})}let x,g,m,p,f;if(!r||Array.isArray(r)&&0===r.length){if(p=Object.values(u).flat(),f=p[0],0===p.length)return t({data:null,loading:!c.loaded&&c.loading,error:"No dimensions found"});x=l.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=l.getConvertedValue(x,{dimensionId:f,fractionDigits:i})}else if("string"===typeof r){if(p=u[r],f=p[0],!p?.length)return t({data:null,loading:!c.loaded&&c.loading,error:"Dimension not found"});x=l.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=l.getConvertedValue(x,{dimensionId:f,fractionDigits:i}),m=l.selectDimensionColor(p[0])}else if(Array.isArray(r)){if(p=r.flatMap((e=>u[e])).filter(Boolean),f=p[0],0===p.length)return t({data:null,loading:!c.loaded&&c.loading,error:"No valid dimensions found"});x=l.getAggregatedDimensionValue(p,h,{aggregationMethod:o}),g=l.getConvertedValue(x,{dimensionId:f,fractionDigits:i})}return t({data:{value:parseFloat(x)||0,convertedValue:g||"0",dimensionId:f,units:f?l.getUnitSign({dimensionId:f}):"",...m&&{color:m}},loading:!c.loaded&&c.loading,error:null})},jn=e=>{let{nodeId:t,contextName:n,dimensions:o,aggregationMethod:i="sum",fractionDigits:s,totalDimensions:a,calculateTotal:l,children:c}=e;const d=(0,Ot.eg)(),u=(0,v.ID)(),[h,x]=(0,r.useState)((()=>Wt(d,u,t,i)));return(0,r.useEffect)((()=>{if(h)return;const e=(e,n)=>{n.getId()!==Kt(t,i)&&n.getId()!==h?.getId()&&x(n)},n=()=>x(Wt(d,u,t,i));return d.on("nodeAdded",e),d.on("nodesContainerUpdated",n),n(),()=>{d.off("nodeAdded",e),d.off("nodesContainerUpdated",n)}}),[d,h]),h?(0,ae.jsx)(mn.default,{chart:h,children:(0,ae.jsx)(fn,{contextName:n,dimensions:o,aggregationMethod:i,fractionDigits:s,totalDimensions:a,calculateTotal:l,children:c})}):c({data:null,loading:!0,error:"Chart not found"})},bn=()=>(0,ae.jsx)(un.A,{width:"80%",height:"8px"}),vn={value:e=>({id:e.columnId,header:(0,ae.jsx)(oe.Text,{strong:!0,children:e.header}),headerString:e.headerString,accessorKey:e.columnId,size:e.size,minSize:e.minSize,maxSize:e.maxSize,align:e.align,category:"Metrics",enableSorting:!1,...e.labelProps&&{labelProps:e.labelProps},cell:t=>{let{row:n}=t;const r=n.original,o=r.id||r.nd;return(0,ae.jsx)(jn,{nodeId:o,contextName:e.context,dimensions:e.dimensions,aggregationMethod:e.aggregation||"sum",fractionDigits:e.fractionDigits,totalDimensions:e.totalDimensions,calculateTotal:e.calculateTotal,children:t=>{let{data:n,loading:r}=t;if(r)return(0,ae.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ae.jsx)(bn,{})});if(!n)return(0,ae.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ae.jsx)(oe.Text,{children:"-"})});const o=n.convertedValue&&n.total;return(0,ae.jsxs)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",gap:.5,children:[(0,ae.jsx)(oe.Text,{textAlign:"right",children:o?(0,ae.jsxs)(ae.Fragment,{children:[n.convertedValue,"/",n.total]}):n.convertedValue}),!e.hideUnits&&n.units&&(0,ae.jsx)(oe.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:n.units})]})}})},renderString:t=>{const n=t.original[e.columnId];return(0,it.Po)(n)?"":`${n.convertedValue} ${e.hideUnits?"":n.units}`},sortingFn:(t,n)=>(t.original[e.columnId]?.value||0)-(n.original[e.columnId]?.value||0)}),progressBar:e=>({id:e.columnId,header:(0,ae.jsx)(oe.Text,{strong:!0,children:e.header}),headerString:e.headerString,accessorKey:e.columnId,size:e.size,minSize:e.minSize,maxSize:e.maxSize,align:e.align,category:"Metrics",enableSorting:!1,...e.labelProps&&{labelProps:e.labelProps},cell:t=>{let{row:n}=t;const r=n.original,o=r.id||r.nd;return(0,ae.jsx)(jn,{nodeId:o,contextName:e.context,dimensions:e.dimensions,aggregationMethod:e.aggregation||"sum",fractionDigits:e.fractionDigits,totalDimensions:e.totalDimensions,calculateTotal:e.calculateTotal,children:t=>{let{data:n,loading:r}=t;if(r)return(0,ae.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ae.jsx)(bn,{})});if(!n)return(0,ae.jsx)(oe.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,ae.jsx)(oe.Text,{children:"-"})});const o="undefined"!==typeof n.convertedValue&&"undefined"!==typeof n.total,i=o?n.percentage:parseFloat(n.convertedValue)||0,s=Math.min(i,100);return(0,ae.jsxs)(oe.Flex,{column:!0,width:"100%",alignItems:o?"center":"end",gap:2,children:[(0,ae.jsxs)(oe.Flex,{alignItems:"end",justifyContent:o?"between":"end",width:"100%",children:[o&&(0,ae.jsxs)(oe.Flex,{alignItems:"end",gap:.5,children:[(0,ae.jsxs)(oe.Text,{children:[n.convertedValue,"/",n.total]}),!e.hideUnits&&n.units&&(0,ae.jsx)(oe.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:n.units})]}),(0,ae.jsxs)(oe.Flex,{alignItems:"end",children:[(0,ae.jsx)(oe.Text,{children:Math.round(i)}),(0,ae.jsx)(oe.TextMicro,{color:"textLite",strong:!0,children:"%"})]})]}),(0,ae.jsx)(oe.ProgressBar,{background:"panelBg",color:"textLite",height:.5,width:`${s}%`,containerWidth:"100%",border:"none",overflow:"hidden"})]})}})},renderString:t=>{const n=t.original[e.columnId];return(0,it.Po)(n)?"":`${n.convertedValue} / ${n.total} (${n.percentage.toFixed(1)}%)`},sortingFn:(t,n)=>(t.original[e.columnId]?.percentage||t.original[e.columnId]?.value||0)-(n.original[e.columnId]?.percentage||n.original[e.columnId]?.value||0)}),metadata:e=>({id:e.columnId,header:(0,ae.jsx)(oe.Text,{strong:!0,children:e.header}),headerString:e.headerString,accessorKey:e.accessorKey,size:e.size,minSize:e.minSize,maxSize:e.maxSize,align:e.align||"left",category:"Labels",cell:t=>{let{row:n}=t;const r=n.original,o=e.accessorKey.split(".");let i=r;for(const e of o)if(i=i?.[e],void 0===i)break;if(e.fallbackKeys)for(const s of e.fallbackKeys){if(!(0,it.Po)(i))break;const e=s.split(".");let t=r;for(const n of e)if(t=t?.[n],void 0===t)break;i=t}return(0,it.Po)(i)?(0,ae.jsx)(oe.Flex,{alignItems:"end",width:"100%",children:(0,ae.jsx)(oe.Text,{children:"-"})}):(0,ae.jsx)(oe.Flex,{alignItems:"center",width:"100%",children:(0,ae.jsx)(oe.Text,{children:i})})},renderString:t=>{const n=t.original,r=e.accessorKey.split(".");let o=n;for(const e of r)if(o=o?.[e],void 0===o)break;if(e.fallbackKeys)for(const i of e.fallbackKeys){if(!(0,it.Po)(o))break;const e=i.split(".");let t=n;for(const n of e)if(t=t?.[n],void 0===t)break;o=t}return(0,it.Po)(o)?"-":o},sortingFn:"basic"})};var yn=n(71341);const wn=e=>{let{osEntry:t}=e;if(!t)return(0,ae.jsx)(oe.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"});if(t.iconName)return(0,ae.jsx)(oe.Icon,{name:t.iconName,width:"18px",height:"18px",color:"textDescription",viewBox:"0 0 100 100"});if(t.logoFilename){const e=`${x.A.assetsBaseURL}/img/logos/os/${t.logoFilename}`;return(0,ae.jsx)("img",{src:e,width:"18px",height:"18px",alt:t.title})}return(0,ae.jsx)(oe.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"})},Cn=e=>{let{headerText:t="Server"}=e;return{id:"server",header:(0,ae.jsx)(oe.Text,{strong:!0,children:t}),headerString:t,accessorKey:"name",size:200,minSize:60,maxSize:400,align:"center",category:"Device",enableHiding:!1,cell:e=>{let{row:t}=e;const n=t.original,r=(0,it.GM)(n.state),o=n.os?.nm||n.labels?.os_name,i=n.os?.id,s=n.labels?.vendor,a=et.u[o]||et.U[i]||et.u[s],l="Live"===r?yn.P.live.indicatorWrapperColor:"Stale"===r?yn.P.stale.indicatorWrapperColor:yn.P.offline.indicatorWrapperColor;return(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:l,flex:!1}),(0,ae.jsx)(oe.Flex,{width:5,height:5,flex:!1,alignItems:"center",justifyContent:"center",children:(0,ae.jsx)(wn,{osEntry:a})}),(0,ae.jsx)(Ft.A,{id:n.id||n.nd,name:n.nm||n.name,state:n.state,isLive:n.isLive})]})},renderString:e=>e.original.name||e.original.nm,sortingFn:"basic"}},In=e=>({id:"alerts",header:(0,ae.jsx)(oe.Text,{strong:!0,children:"Alerts"}),headerString:"Alerts",accessorFn:e=>{const{warning:t=0,critical:n=0}=e.health?.alerts||{};return 3*n+2*t},size:80,minSize:60,maxSize:400,align:"center",category:"Device",cell:t=>{let{row:n}=t;const o=n.original,{warning:i=0,critical:s=0}=o.health?.alerts||{},a=i+s>0,l=(0,K.Fw)("sidebarTab",{flavour:"val",extraKey:e}),c=(0,K.Fw)("sidebarOpen",{flavour:"bool"}),d=(0,K.Fw)("sidebarNodeId",{flavour:"val",extraKey:e}),u=(0,r.useCallback)((e=>{e.stopPropagation(),c(!0),l("alerts"),d(o.id)}),[o.id,d,c,l]),h=(0,gn.I)({flavour:s>0?"error":"disabledError",value:s||" "}),x=(0,gn.I)({flavour:i>0?"warning":"disabledWarning",value:i||" "});return(0,ae.jsx)(oe.Flex,{alignItems:"center",justifyContent:"center",opacity:a?1:.3,children:(0,ae.jsx)(oe.MasterCard,{"data-testid":"alertsMastercard",onClick:a?u:null,pillLeft:h,pillRight:x,size:"small",height:"20px"})})},renderString:e=>{const{warning:t=0,critical:n=0}=e.original.health?.alerts||{};return t+n},sortingFn:"basic"}),kn=(e,t)=>{let{extraKey:n="nodesView",tabId:o="servers"}=t;return(0,r.useMemo)((()=>{const t="snmp"===o?"Device":"Server",r=(e=>e.map((e=>{const t=vn[e.columnFlavour];return t?t(e):(console.warn(`Unknown column flavour: ${e.columnFlavour}`),vn.value(e))})))(e)||[],i=r.reduce(((e,t)=>{const n=t.category||"Metrics";return e[n]||(e[n]=[]),e[n].push(t),e}),{});return[{id:"Server",isPlaceholder:!0,columns:[Cn({headerText:t}),In(n)],notFlex:!0},...Object.entries(i).map((e=>{let[t,n]=e;return{id:t,header:"",columns:n,notFlex:!0}}))]}),[e,n,o])};var An=n(1444),Sn=n(95565);const Tn={LocalDashboard:"Favourites can be saved when the agent is part of a Netdata cloud space.",DemoSpace:"Favourites cannot be saved on a demo space.",FreePlan:()=>(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.Text,{children:"Favourites can be saved only on a paid plan."}),(0,ae.jsx)(Sn.A,{children:(0,ae.jsx)(oe.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},Fn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"servers";const[n,,o,i]=(0,fe.A)(),s=(0,Et.yK)({onResolve:i}),a=(0,Et.z2)(null,{onResolve:i}),{disabled:l,reason:c}=(0,An.A)(),d=(0,r.useCallback)((async function(n,r){let{tabId:i=t,flavour:c=e}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!l&&n&&(o(),r?await a(r.id):await s({type:"favourites",entity:n,path:`/${c}/${i}`,value:{nodeId:n,sortOrder:Date.now()}}))}),[l,s,a,o,e,t]);return{isLoading:n,disabled:l,reason:Tn[c]||Tn.default,toggleFavorite:d}},Nn={[rt]:"error",[nt]:"warning",[tt]:"success",[ot]:"textLite"},Mn={Live:"live",Stale:"stale",Offline:"offline",critical:"live",warning:"live",clear:"live"},Ln={nodeStatus:!0,critical:!0,warning:!0,clear:!0},$n=e=>{let{rows:t,name:n,groupMode:r}=e;const o=Ln[r]||Ln[n],i=t.map((e=>e.original.id)),s=(0,E.BU)(i).length,a=(0,E.Ig)(i).length,l=(0,E.GE)(i).length;return(0,ae.jsx)(Oe.A,{content:(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:4,background:"dropdown",round:!0,padding:[2,3],children:[(!o||Mn[n]===Mn.Live)&&(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:yn.P.live.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Live: ",s]})]}),(!o||Mn[n]===Mn.Stale)&&(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:yn.P.stale.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Stale: ",a]})]}),(!o||Mn[n]===Mn.Offline)&&(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:yn.P.offline.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Offline: ",l]})]})]}),align:"right",children:(0,ae.jsxs)(oe.Text,{color:"textLite",children:["(",(!o||Mn[n]===Mn.Live)&&(0,ae.jsx)(oe.Text,{color:yn.P.live.statusTextColor,children:s}),!o&&"/",(!o||Mn[n]===Mn.Stale)&&(0,ae.jsx)(oe.Text,{color:yn.P.stale.statusTextColor,children:a}),!o&&"/",(!o||Mn[n]===Mn.Offline)&&(0,ae.jsx)(oe.Text,{color:yn.P.offline.statusTextColor,children:l}),")"]})})},Dn=e=>{let{row:t,name:n,groupMode:r,...o}=e;const i=t.getIsExpanded(),s=(a=n,yn.P[a?.toLowerCase?.()]?.statusTextColor||Nn[a]||"text");var a;return(0,ae.jsx)(oe.Flex,{height:"44px",alignItems:"center",flex:!0,width:"100%",background:"tableRowBg2",_hover:{background:"tableRowBg2Hover"},...o,children:(0,ae.jsxs)(oe.Flex,{position:"sticky",left:"0px",width:"auto",padding:[2,3],gap:2,children:[(0,ae.jsx)(oe.Icon,{name:"chevron_left",size:"small",color:"textLite",rotate:i?1:3}),(0,ae.jsx)(oe.Text,{color:s,strong:!0,children:n}),(0,ae.jsx)($n,{rows:t.subRows,groupMode:r,name:n})]})})},Bn=e=>{let{tabId:t,flavour:n,onClickRow:r,columnPinning:o,columnVisibility:i,columnSizing:s,onColumnSizingChange:a,sortBy:l,onSortingChange:c,rowActions:d,columns:u}=e;const{favoriteNodeIds:h}=Ht(n,t),[x,g]=(0,fe.A)(!0),m=(0,E.Gt)(h),p={getIsExpanded:()=>x,subRows:m.map((e=>({original:e})))};return m.length?(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)("div",{children:[(0,ae.jsx)(Dn,{row:p,name:"Favourites",onClick:g}),(0,ae.jsx)(oe.Collapsible,{open:x,children:(0,ae.jsx)(oe.Table,{data:m,dataColumns:u,rowActions:d,onClickRow:r,enableSorting:!0,sortBy:l,onSortingChange:c,enableColumnPinning:!0,enableResizing:!0,columnVisibility:i,columnSizing:s,onColumnSizingChange:a,background:"tableRowBg2",columnPinning:o})})]})}):null};var Rn=n(25293);const Pn={right:["actions"],left:["server"]},Vn={nodeStatus:{Live:!0},default:!0},_n=e=>{let{id:t}=e;return t},On=(e=>t=>{let{nodeIdsLoaded:n,...r}=t;return(0,v.XA)("fullyLoaded")&&!!n?(0,ae.jsx)(e,{...r}):(0,ae.jsx)(xn,{})})((e=>{let{nodeIds:t,tabNodeIds:n,onChartNameChange:o,initialChartName:i,tabId:s="servers",flavour:a="nodesView"}=e;const l=(0,an.qR)(),c=(0,v.ID)(),d=(0,O.Cq)(c,s),u=(0,O.A3)(c,s),h=(0,Ie.vh)(c,s),[x,m]=(0,K.r$)("expanded",{extraKey:`${a}-${s}-${d||"ungrouped"}`,flavour:"obj",defaultValue:Vn[d]||Vn.default}),[p,f]=(0,r.useState)(null),[j,y]=(0,r.useState)(null),w=(0,r.useCallback)(((e,t)=>{f({ids:[e],name:t})}),[]),C=(0,r.useCallback)(((e,t)=>{y({ids:[e],name:t})}),[]),I=kn(h,{extraKey:a,tabId:s}),k=(0,r.useMemo)((()=>(e=>{const t={nodeStatus:{name:"Node status",columns:[]},alertStatus:{name:"Alerts",columns:[]}};return"snmp"===e?{...t,vendor:{name:"Vendor",columns:[]},type:{name:"Type",columns:[]},location:{name:"Location",columns:[]}}:t})(s)),[s]),A=(0,r.useMemo)((()=>h.reduce(((e,t)=>(t.hidden&&(e[t.columnId]=!1),e)),{})),[h]),[S,T]=(0,K.r$)("columnVisibility",{extraKey:`${a}-${s}`,flavour:"obj",defaultValue:A}),[F,N]=(0,K.r$)("columnSizing",{extraKey:`${a}-${s}`,flavour:"obj",defaultValue:{}}),[M,L]=(0,K.r$)("sortBy",{extraKey:`${a}-${s}`,flavour:"arrobj",defaultValue:[]}),$=(0,K.Fw)("sidebarTab",{flavour:"val",extraKey:a}),D=(0,K.Fw)("sidebarOpen",{flavour:"bool"}),B=(0,K.Fw)("sidebarNodeId",{flavour:"val",extraKey:a}),R=(0,r.useCallback)(((e,t)=>{D(!0),$(e),B(t)}),[B,D,$]),P=(0,r.useCallback)((e=>{let{data:t}=e;t.isGroup||R("info",t.id)}),[R]),V=((e,t)=>{let{flavour:n,onRemoveNode:o,onObsoleteNode:i,onClickNode:s}=t;const a=(0,g.JT)("node:Delete"),l=(0,v.XA)(),c=(0,b.dg)(),d=!l.untouchable,{isLoading:u,toggleFavorite:h,disabled:x,reason:m}=Fn(n,e),{settingsByNodeId:p}=Ht(n,e),f=(0,r.useRef)(null);return f.current=t=>{const r=p[t];h(t,r,{flavour:n,tabId:e})},(0,r.useMemo)((()=>({...!c&&d&&{remove:{icon:"remove",tooltipText:"Remove node from room",handleAction:e=>o(e.id,e.name),confirmation:!0,confirmationText:e=>`Remove ${e.name} from room?`,isDisabled:()=>!1}},...!c&&!d&&{obsolete:{icon:"delete",tooltipText:"Delete node permanently",handleAction:e=>i(e.id,e.name),confirmation:!0,confirmationText:e=>`Delete ${e.name} permanently?`,isDisabled:e=>{const t=(0,it.GM)(e.state);return a&&"Offline"!==t}}},info:{handleAction:e=>s({data:e})},favorite:{icon:e=>p[e.id]?"heart_broken":"heart",tooltipText:e=>p[e.id]?"Remove from favorites":"Add to favorites",handleAction:e=>f.current(e.id),confirmation:!1,isVisible:()=>!0,isDisabled:u||x,iconColor:"textNoFocus",disabledTooltipText:m||"Saving..."}})),[a,c,d,o,i,u,x,p,s])})(s,{flavour:a,onRemoveNode:w,onObsoleteNode:C,onClickNode:P}),{setActiveMenuId:_}=(0,lt.A)({onChartNameChange:o,initialChartName:i}),E=(0,r.useRef)(),H=(0,r.useRef)(),z=(0,r.useMemo)((()=>(E.current&&E.current.cancel(),E.current=(0,ln.A)({elementQueryParam:"[data-id]",dataMenuId:"data-id"}),()=>E.current(H.current?.scrollElement,_))),[l.length,_]);(0,r.useLayoutEffect)((()=>{l.length&&z()}),[l.length,i]);const W=(0,r.useRef)(),G=(0,r.useMemo)((()=>({overscan:30,virtualRef:H,onScroll:z})),[z]),q=(0,r.useMemo)((()=>l.filter(Boolean)),[l]);(0,cn.A)(H.current,q);const U=(0,r.useMemo)((()=>e=>(0,ae.jsx)(Dn,{groupMode:d,...e})),[d]);return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Bn,{tabId:s,flavour:a,onRemoveNode:w,onObsoleteNode:C,onClickRow:P,columnPinning:Pn,columnVisibility:S,columnSizing:F,onColumnSizingChange:N,sortBy:M,onSortingChange:L,rowActions:V,columns:I}),t.length?(0,ae.jsx)(oe.Table,{title:(0,ae.jsx)(Rn.A,{extraKey:`${a}-${s}`,nodeIds:n,tabId:s}),data:q,dataColumns:I,rowActions:V,onClickRow:P,enableSorting:!0,sortBy:M,onSortingChange:L,enableColumnVisibility:!0,enableColumnPinning:!0,enableResizing:!0,columnPinning:Pn,columnVisibility:S,onColumnVisibilityChange:T,columnSizing:F,onColumnSizingChange:N,groupByColumns:k,grouping:d||"",onGroupByChange:u,getSubRows:e=>e.children,enableExpanding:!0,getRowId:_n,expanded:x,onExpandedChange:m,GroupRow:U,virtualizeOptions:G,tableRef:W,background:"tableRowBg2"}):(0,ae.jsx)(pe,{children:(0,ae.jsx)(Rn.A,{extraKey:`${a}-${s}`,nodeIds:n,tabId:s})}),p&&(0,ae.jsx)(bt.Ay,{ids:p.ids,name:p.name,onClose:()=>f(null)}),j&&(0,ae.jsx)(jt.Ay,{ids:j.ids,name:j.name,onClose:()=>y(null)})]})}));var En=n(71581);const Hn=(0,qe.A)(je.A),zn=e=>{let{children:t,tabId:n,...r}=e;const[o,,i,s]=(0,fe.A)(),a=(0,b.vt)(),l=(0,v.ID)();return(0,ae.jsxs)(oe.Flex,{alignItems:"end",justifyContent:"between",width:"100%",background:"mainBackground",padding:[0,0,0,4],border:{side:"bottom",size:"1px",type:"solid",color:"borderSecondary"},...r,children:[t,(0,ae.jsxs)(oe.Flex,{alignItems:"center",padding:[2,3],gap:2,children:[o&&(0,ae.jsx)(be.A,{onClose:s}),(0,ae.jsx)(Ge,{spaceId:a,roomId:l,tabId:n}),(0,ae.jsx)(Hn,{"data-ga":"add-nodes::click-add-nodes::hm-nodes-table","data-testid":"nodesTable-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:i,small:!0,flavour:"hollow"})]})]})},Kn=e=>{let{allNodes:t,activeTabId:n,onTabChange:o,children:i}=e;const s=(0,En.yT)(t),a=(0,r.useMemo)((()=>{const e=s.findIndex((e=>e.id===n));return e>=0?e:0}),[n,s]),l=(0,r.useCallback)((e=>{const t=s[e];t&&o&&o(t.id)}),[s,o]),c=(0,r.useMemo)((()=>e=>(0,ae.jsx)(zn,{...e,tabId:n})),[n]);return(0,ae.jsx)(oe.Tabs,{selected:a,onChange:l,height:"100%",padding:[4,4,2],TabsHeader:c,gap:4,children:s.map(((e,t)=>(0,ae.jsx)(oe.Tab,{label:(0,ae.jsx)(oe.Text,{color:t===a?"primary":"menuItem",children:e.label}),"data-testid":`nodes-tab-${e.id}`,padding:[2,4],maxWidth:"100%",green:!0,children:i},e.id)))})},Wn=e=>{let{tabId:t,filteredIds:n,totalCount:r}=e;const o=(0,En.K3)(t),i=o?.label||"Nodes",s=(0,E.BU)(n).length,a=(0,E.Ig)(n).length,l=(0,E.GE)(n).length;return(0,ae.jsxs)(oe.Flex,{"data-testid":"nodes-view-stats-header",width:"100%",height:"44px",justifyContent:"between",alignItems:"center",background:"mainBackground",padding:[0,3],border:"border",round:!0,children:[(0,ae.jsxs)(oe.Text,{strong:!0,children:["Total ",i,": ",r]}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:4,children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:yn.P.live.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Live: ",s]})]}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:yn.P.stale.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Stale: ",a]})]}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,children:[(0,ae.jsx)(oe.Flex,{width:2,height:2,round:"50%",background:yn.P.offline.indicatorWrapperColor}),(0,ae.jsxs)(oe.Text,{children:["Offline: ",l]})]})]})]})},Gn=["config"],qn=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,B.nj)(),o=(0,E.dG)(),i=(e=>{const t=(0,v.ID)(),n=(0,O.Cq)(t,e),o=at[n];return(0,r.useCallback)((e=>{const t=o?.(e);return{name:t,priority:st[n]?.[t],icon:"nodeStatus"===n?`connectivityStatus${t}`:null}}),[n,o])})(o),s=(0,O.Cq)(t,o),a=(0,E.TL)(),l=(0,H.w7)({extraKey:`nodesView-${o}`,merge:!1,scoped:!0}),c=(0,E.Gt)(),d=(0,En.On)(o),u=(0,r.useMemo)((()=>c.reduce(((e,t)=>(d(t)||e.push(t.id),e)),[])),[d,c]),h=(0,E.Y7)(),[g,{width:m}]=(0,V.A)(),p=(0,te.K)({spaceId:e,roomId:t}),[f,j,y]=ee(l,t,{shouldHide:L.f9?d:void 0,cacheKey:o,extraKey:`nodesView-${o}`});!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],{host:n,width:o,tabId:i="servers",flavour:s="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(0,Ot.eg)(),l=(0,r.useMemo)((()=>{if(!a)return;let r=zt(a,e);if(r)return r;o&&(r=a.makeContainer({attributes:{host:n,enabledXAxis:!1,id:`nodes-${e}`,height:"75px",groupingMethod:"average",groupBy:["dimension"],aggregationMethod:"avg",legend:!1,axisLabelFontSize:7,yAxisLabelWidth:20,hasYlabel:!1,nodesScope:t,containerWidth:o}}),a.appendChild(r))}),[e,i,o]),{favoriteNodeIds:c}=Ht(s,i),d=(0,Ie.vh)(e,i);(0,r.useMemo)((()=>{if(!L.f9)return;if(!l||!t?.length&&!c?.length)return;const e=d.reduce(((e,t)=>{if(!t.context)return e;const n=t.aggregation||"sum";return e[n]||(e[n]=new Set),e[n].add(t.context),e}),{});[...t,...c].forEach((t=>{Object.entries(e).forEach((e=>{let[n,r]=e;const o=`table-metrics-${t}-${n}`;let i=l.getNode({id:o});if(i&&(s=new Set(i.getAttribute("contextScope")),c=r,s.size===c.size&&[...s].every((e=>c.has(e)))))return;var s,c;i?.destroy();const d=Array.from(r);0!==d.length&&(i=a.makeChart({attributes:{id:o,contextScope:d,nodesScope:[t],aggregationMethod:n,groupingMethod:"average",groupBy:["label","dimension","context","node"],groupByLabel:["device"],tableColumns:["context","dimension"],chartLibrary:"table",points:1}}),l.appendChild(i))}))})),a.trigger("nodesContainerUpdated")}),[l,t,c,n,a,i,o,d])}(t,f,{host:p,width:m,tabId:o,flavour:"nodesView"});const[w,C]=(0,K.N9)("nodeIdToGo",{key:t,extraKey:"nodesView",flavour:"val"}),I=(0,r.useCallback)((e=>{a(e)}),[a]),k=(0,r.useCallback)((function(e,t){return function(e,t){let{getGrouping:n,extraKey:r,searchScores:o,groupMode:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={},a={};((e,t)=>{let{getNode:n,getGrouping:r,nodeMenus:o,menusById:i,searchScores:s}=t;e.forEach((e=>{const t=n(e);if(!t)return;const{name:i,priority:s,icon:a}=r(t);o[e]={...t,groupId:i,subMenuId:e,priority:s,groupIcon:a}})),[...e].sort(((e,t)=>{const n=s?.[e]||0,r=s?.[t]||0;if(r!==n)return r-n;const i=(o[e]?.priority||0)-(o[t]?.priority||0);if(0!==i)return i;const a=(o[e]?.groupId||"").localeCompare(o[t]?.groupId||"",void 0,{sensitivity:"accent",ignorePunctuation:!0});return 0!==a?a:(o[e]?.name||"").localeCompare(o[t]?.name||"",void 0,{sensitivity:"accent",ignorePunctuation:!0})})).forEach((e=>{const t=o[e];if(!t)return;const n=`${t.groupId}|${t.subMenuId}`;i[t.groupId]||(i[t.groupId]={byId:{},nodeIds:[]}),i[t.groupId].byId[n]||(i[t.groupId].byId[n]={byId:{},nodeIds:[]}),i[t.groupId].byId[n].nodeIds.push(t.id),i[t.groupId].nodeIds.push(t.id)}))})(e,{getNode:t,getGrouping:n,nodeMenus:s,menusById:a,searchScores:o});const l=Object.keys(a).reduce(((e,t)=>{const{nodeIds:n}=a[t],o=s[n[0]];return e[t]={level:0,name:o.groupId,id:t,childrenIds:n,link:`${(0,Xe.A)(`menu_${t}`)}`,size:24,forceVisibility:!0,icon:o.groupIcon,extraKey:r,styleProps:{important:!1,grouping:!0}},n.forEach((n=>{const o=s[n],i=et.u[o.os?.nm||o.labels?.os_name]||et.U[o.os?.id]||et.u[o.labels?.vendor];e[n]={...o,level:1,id:n,menuId:t,link:`${(0,Xe.A)(`menu_${t}_submenu_${n}`)}`,size:24,forceVisibility:!0,icon:i?.iconName||i?.logoFilename&&`${x.A.assetsBaseURL}/img/logos/os/${i.logoFilename}`||"os",extraKey:r}})),e}),{}),c=Object.keys(a);let d=-1;const u=c.reduce(((e,t)=>{if(d+=1,!L.f9){const n={...l[t],sticky:!0};return[...e,n,...l[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,l[t]])),[])]}return i?[...e,{...l[t],isGroup:!0,children:l[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,l[t]])),[])}]:[...e,...l[t].childrenIds.reduce(((e,t)=>(d+=1,[...e,l[t]])),[])]}),[]);return s=null,a=null,{stickyIds:{},allElements:u,menuIds:c,menuById:l}}(e,t,{...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},searchScores:j})}),[j]);return(0,ae.jsx)(ne.A,{getObject:h,ids:f,getMenu:k,getGrouping:i,groupMode:s,deps:[i,j,o,s],extraKey:"nodesView",children:(0,ae.jsx)(_.A,{ref:g,position:"relative",sidebar:(0,ae.jsx)(re.Ay,{hiddenTabs:Gn,nodeIds:u,title:"Nodes",initialChartName:w,viewFlavour:"nodesView",flavour:`nodesView-${o}`,loaded:!0,FilterInputContainer:xe,extraKey:`nodesView-${o}`}),children:!!m&&(0,ae.jsxs)(ae.Fragment,{children:[!L.f9&&(0,ae.jsx)(Qe,{}),!L.f9&&n&&!f.length&&l.length?(0,ae.jsx)(pe,{}):L.f9?(0,ae.jsxs)(Kn,{allNodes:c,activeTabId:o,onTabChange:I,nodesCount:y,children:[(0,ae.jsx)(Wn,{tabId:o,filteredIds:f,totalCount:y}),(0,ae.jsx)(On,{nodeIdsLoaded:n,nodeIds:f,tabNodeIds:u,initialChartName:w,onChartNameChange:C,tabId:o,flavour:"nodesView"})]}):(0,ae.jsx)(sn,{initialChartName:w,onChartNameChange:C})]})})})},Un=()=>{const e=(0,v.ID)(),t=(0,B.CK)();return(0,B.gr)(e,"loaded")&&!t.length?(0,ae.jsx)(P.Ay,{feature:"NodesView",mode:"NoNodesView",children:(0,ae.jsx)(R.A,{})}):(0,ae.jsx)(P.Ay,{feature:"NodesView",children:(0,ae.jsx)(qn,{})})},Jn=()=>{const e=(0,E.nl)(),t=(0,E.xY)(e,"name");return(0,T.ZB)({title:t,id:e,destination:e,tooltip:{title:t,description:"Monitor and analyze metrics, alerts, and performance for this specific node in your infrastructure."}}),null};var Yn=n(258);var Zn=n(98545),Qn=n(6196),Xn=n(1705),er=n(2626),tr=n(41716),nr=n(65448);var rr=n(6387),or=n(65380);const ir=e=>t=>`histogram::${e.getAttribute("id")}::${t}`,sr=e=>{let{container:t,...n}=e;const o=(0,Ot.eg)(),i=(0,r.useMemo)((()=>{if(!t)return null;let e=t.getNode({id:"dummy-chart"});return e||(e=o.makeChart({attributes:{id:"dummy-chart",chartLibrary:"dygraph",sparkline:!0,hasToolbox:!1,hasHoverPopover:!1,contextScope:["anomaly_detection.anomaly_rate"],aggregationMethod:"max",postAggregationMethod:"max",postgroupBy:["selected"],showPostAggregations:!0,groupingMethod:"max",expandable:!1,chartType:"stacked",colors:[["#DBE1E1","#353F3F"]],showAnomalies:!1,showAnnotations:!1,overlays:{latestTime:{type:"latestTime"}}},makeTrack:ir}),t.appendChild(e),e)}),[t]);return(0,r.useEffect)((()=>()=>i&&i.destroy()),[i]),(0,ae.jsx)(oe.Flex,{flex:!1,width:"100%",height:5,position:"sticky",bottom:"0",left:"0",right:"0",children:(0,ae.jsx)(Gt.A,{"data-chartid":"dummy-chart",chart:i,overflow:"hidden",hasHeader:!1,hasFooter:!1,hasFilters:!1,tile:!1,...n,round:0})})};var ar=n(55093),lr=n(77148),cr=n(38773);const dr=()=>(0,ae.jsxs)(oe.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,ae.jsx)(oe.Box,{margin:[0,4,0,0],children:(0,ae.jsx)(oe.Box,{as:oe.Icon,width:10,height:10,name:"nodes_update"})}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:2,children:[(0,ae.jsx)(oe.Text,{strong:!0,children:"Couldn't find the chart you were looking for? "}),(0,ae.jsxs)(oe.Text,{color:"textDescription",children:["Netdata has zero-configuration auto-detection for most applications and systems, this is achieved using collectors. If you miss some specific chart please check our"," ",(0,ae.jsx)(ge.A,{href:"https://learn.netdata.cloud/docs/agent/collectors",target:"_blank","data-ga":"chart-area::click-link-collectors::charts-view",children:"list of collectors"})," ","to see if any additional step is needed."]})]})]}),ur=()=>(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:6,margin:[8,0,0,0],children:[(0,ae.jsx)(lr.A,{}),(0,ae.jsxs)(oe.Flex,{gap:1,alignItems:"center",justifyContent:"center",padding:[2],background:"successSemi",children:[(0,ae.jsx)(Sn.A,{children:(0,ae.jsx)(oe.Text,{color:"primary",children:"Upgrade to Business for unlimited access"})}),(0,ae.jsx)(oe.Text,{children:"or"}),(0,ae.jsx)(cr.A,{children:(0,ae.jsx)(oe.Text,{color:"primary",children:"review your Space active Nodes"})})]})]}),hr=e=>{let{noPreferredNodesError:t,children:n}=e;return(0,ae.jsxs)(oe.Flex,{column:!0,flex:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",children:[(0,ae.jsxs)(oe.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,ae.jsx)(oe.H3,{margin:[0,0,4],children:"No charts to display"}),(0,ae.jsx)(oe.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),(0,ae.jsx)(dr,{}),t&&(0,ae.jsx)(ur,{}),n]})};var xr=n(93997);const gr=()=>{const[e,t]=(0,xr.sK)(),n=(0,v.ID)(),o=(0,b.vt)(),i=(0,H.w7)(),s=(0,r.useCallback)((0,ce.s)(300,(e=>{const r=e.target.value;t(r),(0,ie.H)("toc-search","search-automatic-trigger","charts-view",r),r&&(0,Yn.Xx)(n,r,{selectedNodes:i,spaceId:o}).then((e=>{console.log("Context search results:",e)})).catch((e=>{console.error("Context search error:",e)}))})),[n,o,i]),[a,l,,,{resetValue:c}]=(0,oe.useInputValue)({value:e,onChange:s}),d=(0,r.useCallback)((()=>{t(""),c(),(0,ie.H)("toc-search","clear-search-button","charts-view")}),[]);return(0,ae.jsx)(oe.TextInput,{value:a,onChange:l,size:"small",iconRight:a&&(0,ae.jsx)(oe.Icon,{name:"x",color:"textLite",cursor:"pointer",size:"small",onClick:d,"data-testid":"filterChartsInput-clearButton"}),placeholder:"Search charts",name:"Search charts","data-testid":"filterChartsInput",containerStyles:{width:"100%"}})};var mr=n(61841);const pr=(0,ce.s)(300,((e,t)=>(0,ie.H)("toc-search","search-results","charts-view",e,`${t} -- charts`))),fr=()=>{const e=(0,f.Zp)(),[t]=(0,mr.Ay)(),n=(0,xr.Um)(),{filteredChartsCount:o,chartsCount:i}=(0,xr.Ad)();(0,r.useEffect)((()=>{n&&pr(n,o)}),[n,o]);const s=(0,r.useCallback)((n=>{n.preventDefault(),e(`/spaces/${t}/settings/configurations`,{replace:!0})}),[t,e]);return(0,ae.jsxs)(oe.Flex,{alignItems:"center",justifyContent:"between",width:"100%",children:[(0,ae.jsxs)(oe.TextMicro,{color:"textLite",margin:[1,0,0],"data-testid":"numberOfChartsIndication",children:["Showing"," ",(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-filteredChartsCount",children:o})," ","of total"," ",(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-chartsCount",children:i})," ","charts"]}),(0,ae.jsx)(ge.A,{Component:oe.TextMicro,margin:[1,0,0],"data-ga":`toc-search::click-link-collectors::${name}`,onClick:s,target:"_blank",rel:"noopener noreferrer",children:"Add more charts"})]})},jr=()=>{const{filteredChartsCount:e}=(0,xr.Ad)();return e||null===e?null:(0,ae.jsxs)(oe.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription"}),(0,ae.jsx)(oe.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})};var br=n(14512);const vr=()=>(0,ae.jsxs)(oe.Flex,{column:!0,alignItems:"center",children:[(0,ae.jsx)(gr,{}),(0,ae.jsx)(fr,{}),(0,ae.jsx)(br.A,{}),(0,ae.jsx)(jr,{})]}),yr=e=>{let{width:t=443,height:n=249,videoId:r,...o}=e;return(0,ae.jsx)(oe.Flex,{...o,children:(0,ae.jsx)(oe.Box,{className:"video-responsive",children:(0,ae.jsx)("iframe",{width:t,height:n,src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Embedded youtube"})})})};var wr=n(58218),Cr=n(14815);const Ir=()=>{const e=(0,v.ID)(),t=(0,g.JT)("node:Create");return(0,ae.jsxs)(_.A,{column:!1,"data-testid":"noNodesViewPage",gap:12,padding:[6],children:[(0,ae.jsxs)(oe.Flex,{column:!0,gap:5,flex:{shrink:0,grow:0},"data-testid":"noKubernetesView-videoSection",children:[(0,ae.jsx)(yr,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:Le.BX[0]}),(0,ae.jsx)(yr,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:Le.BX[1]})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:4,children:[(0,ae.jsxs)(oe.Box,{border:{side:"bottom",color:"borderSecondary"},children:[(0,ae.jsx)(oe.Box,{margin:[0,0,2,0],children:(0,ae.jsx)(ge.A,{href:"https://learn.netdata.cloud/docs/netdata-agent/installation/kubernetes",target:"_blank",rel:"noopener noreferrer","data-ga":"k8s-tab::click-link-guides::kubernetes-overview-and-visualizations",children:(0,ae.jsx)(oe.TextBig,{color:"primary",children:"Kubernetes monitoring with Netdata: Overview and visualizations"})})}),(0,ae.jsx)(oe.Box,{margin:[0,0,2,0],children:(0,ae.jsx)(ge.A,{href:"https://learn.netdata.cloud/docs/dashboards-and-charts/kubernetes-tab",target:"_blank",rel:"noopener noreferrer","data-ga":"k8s-tab::click-link-guides::kubernetes-visualizations",children:(0,ae.jsx)(oe.TextBig,{color:"primary",children:"Kubernetes visualizations"})})})]}),(0,ae.jsx)(oe.Flex,{column:!0,gap:4,children:t?(0,ae.jsx)(wr.A,{integrationId:Cr.v2,rooms:[e]}):(0,ae.jsx)(R.S,{})})]})]})};var kr=n(67012),Ar=n(77611);const Sr=dn.default.div.withConfig({displayName:"selections__Separator",componentId:"sc-1cc7y18-0"})(["width:1px;height:",";background:",";"],(0,oe.getSizeBy)(2.5),(0,oe.getColor)("borderSecondary")),Tr=[{label:"Volume",value:"volume"},{label:"KS2",value:"ks2"}],Fr=[{label:"Average",value:"average"},{label:"Median",value:"median"},{label:"Min",value:"min"},{label:"Max",value:"max"},{label:"Stddev",value:"stddev"}],Nr=[{label:"Metrics",value:""},{label:"Anomaly Rate",value:"anomaly-bit"}],Mr=()=>(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:[(0,ae.jsx)(oe.TextMicro,{children:"Choose the algorithm you want to be used to identify correlations across metrics:"}),(0,ae.jsxs)(oe.TextMicro,{children:[(0,ae.jsx)(oe.TextMicro,{strong:!0,children:"KS2:"})," A statistical test comparing the distribution of the highlighted window to the baseline."]}),(0,ae.jsxs)(oe.TextMicro,{children:[(0,ae.jsx)(oe.TextMicro,{strong:!0,children:"Volume:"})," Percentage change in averages between highlighted window and baseline."]})]}),Lr=()=>(0,ae.jsx)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,ae.jsx)(oe.TextMicro,{children:"What aggregation function do you want to apply when aggregating multiple datapoints for metric correlations."})}),$r=()=>(0,ae.jsx)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,ae.jsx)(oe.TextMicro,{children:"Do you want to find correlations over the metric values or the anomaly rates of each metric."})}),Dr=e=>{let{runGetWeights:t,nodeIds:n,flavour:o}=e;const{method:i,options:s,group:a}=(0,Ar.G9)({nodeIds:n,flavour:o}),l=s?.includes(Nr[1].value)?Nr[1].value:"",c=(0,r.useCallback)((e=>n=>{let{value:r}=n;r="options"!==e?r:r?[r]:[];t({method:i,options:[s],group:a,[e]:r})}),[i,s,a]),d=(0,r.useMemo)((()=>({method:Tr.find((e=>e.value===i)),group:Fr.find((e=>e.value===a)),option:Nr.find((e=>e.value===l))})),[i,a,l]);return a?(0,ae.jsxs)(oe.Flex,{gap:2,children:[(0,ae.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Method:"}),(0,ae.jsx)(oe.Select,{options:Tr,value:d.method,onChange:c("method")}),(0,ae.jsx)(Oe.A,{isBasic:!0,plain:!0,content:Mr,align:"bottom",children:(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ae.jsx)(Sr,{}),(0,ae.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Aggregation:"}),(0,ae.jsx)(oe.Select,{options:Fr,value:d.group,onChange:c("group")}),(0,ae.jsx)(Oe.A,{isBasic:!0,plain:!0,content:Lr,align:"bottom",children:(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ae.jsx)(Sr,{}),(0,ae.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Data:"}),(0,ae.jsx)(oe.Select,{options:Nr,value:d.option,onChange:c("options")}),(0,ae.jsx)(Oe.A,{isBasic:!0,plain:!0,content:$r,align:"bottom",children:(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,ae.jsx)(Sr,{})]}):null};var Br=n(64587);const Rr=e=>{let{highlightAfter:t,highlightBefore:n,baseline:r}=e;const{localeDateString:o,localeTimeString:i}=(0,Br.$j)(),s=new Date(t),a=new Date(n),l=new Date(r),c=new Date(t),d=Math.round((n-t)/1e3),u=Math.round((t-r)/1e3),h=(0,K.rI)("highlight");return(0,ae.jsxs)(oe.Flex,{gap:4,alignItems:"center",children:[(0,ae.jsxs)(oe.Flex,{gap:2,children:[(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Selected area:"}),(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Reference baseline:"})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-selectedArea",children:[o(s,{long:!1}),","," ",i(s),"\xa0->\xa0",o(a,{long:!1}),","," ",i(a)]}),(0,ae.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline",children:[o(l,{long:!1}),","," ",i(l),"\xa0->\xa0",o(c,{long:!1}),","," ",i(c)]})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Duration:"}),(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:"Duration:"})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-selecteArea-duration",children:[d,"\xa0secs"]}),(0,ae.jsxs)(oe.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline-duration",children:[u,"\xa0secs"]})]})]}),(0,ae.jsx)(Oe.A,{content:"Clear selection",align:"bottom",isBasic:!0,children:(0,ae.jsx)(oe.Button,{neutral:!0,flavour:"borderless",icon:"trashcan",onClick:()=>{h({after:null,before:null})},"data-ga":"metric-correlation::click-delete::charts-view","data-testid":"metricCorrelation-delete"})})]})},Pr=(0,qe.A)(oe.Button),Vr=(0,dn.default)(oe.Button).withConfig({displayName:"correlation__LogoButton",componentId:"sc-15d72m3-0"})(["&&{pointer-events:none;}"]),_r=(0,dn.default)(oe.Button).withConfig({displayName:"correlation__CloseButton",componentId:"sc-15d72m3-1"})(["position:absolute !important;top:-3px;right:-3px;"]),Or=(0,qe.A)(_r),Er=(0,dn.default)(oe.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;}"]),Hr=e=>{let{flavour:t}=e;const n=(0,b.vt)(),o=(0,v.ID)(),i=(0,E.nl)(),s=(0,r.useMemo)((()=>i?[i]:[]),[i]),a=(0,H.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),l="singleNode"===t?s:a,[c,d]=(0,r.useState)(!1),[u,h]=(0,r.useState)(),{threshold:x,totalDimensionsCount:g,dimensionsCount:m,loaded:p,loading:f,getWeights:j,resetWeights:y}=(0,Ar.Yy)({nodeIds:l,flavour:t},n,o),{method:w,options:C,group:I}=(0,Ar.G9)({nodeIds:l,flavour:t}),{after:k,before:A}=(0,K.rW)("highlight"),S=k-4*(A-k),T=!!k;(0,r.useEffect)((()=>{if(p){let e="default-result";if(I){const t=C?.includes("anomaly-bit")?"anomaly-bit":"metrics";e=`default-result-${w}-${I}-${t}`}return(0,ie.H)("metrics-correlation",e,"charts-view",m.toString())}}),[p]),(0,kr.A)((()=>{k&&d(!0)}),[k]);const F=(0,K.rI)("correlation"),N=(0,K.rI)("threshold"),M=(0,K.rI)("highlight"),L=(0,r.useCallback)((()=>{F(!1),M({after:null,before:null}),N(Ar.UG),y(),(0,ie.H)("metrics-correlation","click-close","charts-view",""+(p?"finish":"start"))}),[F,M,N,y,p]),$=(0,r.useCallback)((()=>{N(Ar.UG),y(),(0,ie.H)("metrics-correlation","click-delete","charts-view",""+(p?"finish":"start"))}),[N,y,p]),D=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(!1),h(),j({highlightAfter:k,highlightBefore:A,baselineAfter:S,baselineBefore:k,method:w,options:C,group:I,nodeIds:l,...e}).then((()=>N(Ar.UG)))},B=!T||f;return(0,kr.A)((()=>{p&&c&&T&&D()}),[p,T,c]),(0,r.useEffect)((()=>()=>y()),[]),(0,ae.jsxs)(oe.Flex,{round:2,background:"elementBackground",padding:[2,6,2,2],margin:[2,0],alignItems:"center",justifyContent:"between",flex:!0,"data-testid":"correlation",position:"relative",height:{min:"64px"},gap:2,children:[T?p?(0,ae.jsx)(P._0,{feature:"MetricCorrelations",totalDimensionsCount:g,dimensionsCount:m,children:(0,ae.jsxs)(oe.Flex,{"data-testid":"metricCorrelation-resultsContainer",column:!0,width:"100%",children:[(0,ae.jsxs)(oe.Flex,{justifyContent:"between",alignItems:"center",gap:1,children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{name:"correlation",color:"primary",width:"16px",height:"16px"}),(0,ae.jsxs)(oe.TextSmall,{children:["Analysed"," ",(0,ae.jsx)(oe.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsAnalyzed",children:g})," ","and found"," ",(0,ae.jsx)(oe.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsFound",children:m})," ","correlated metrics."]}),(0,ae.jsx)(Oe.A,{content:"Clear results",children:(0,ae.jsx)(Er,{flavour:"borderless",neutral:!0,disabled:f||!p&&!T,onClick:$,"data-testid":"metricCorrelation-clear",small:!0,icon:"reload"})})]}),(0,ae.jsx)(Dr,{runGetWeights:D,nodeIds:l,flavour:t})]}),(0,ae.jsxs)(oe.Flex,{width:"100%",children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:3,margin:[0,2,0,5],width:"100%",children:[(0,ae.jsx)(oe.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show less"}),(0,ae.jsx)(oe.InputRange,{"data-testid":"metricCorrelation-resultsSlider",min:0,max:1,onChange:e=>N(e.target.value.toString()),onClick:()=>(0,ie.H)("metric-correlation","click-slider","charts-view"),step:.01,value:x}),(0,ae.jsx)(oe.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show more"})]}),(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(Oe.A,{content:"Give us your feedback! Was it useful?",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover",children:(0,ae.jsxs)(oe.Flex,{children:[(0,ae.jsx)(oe.Button,{flavour:"+"===u?"hollow":"borderless",disabled:u,icon:"thumb_up",onClick:()=>h("+"),"data-ga":"metric-correlation::click-thumbs-up::charts-view","data-testid":"metricCorrelation-thumbsUp",small:!0}),(0,ae.jsx)(oe.Button,{flavour:"-"===u?"hollow":"borderless",disabled:u,icon:"thumb_down",onClick:()=>h("-"),"data-ga":"metric-correlation::click-thumbs-down::charts-view","data-testid":"metricCorrelation-thumbsDown",small:!0})]})})})]})]})}):(0,ae.jsxs)(oe.Flex,{alignItems:"center","data-testid":"correlationView-timePeriod-container",gap:4,children:[(0,ae.jsx)(Vr,{icon:"logo_s",isLoading:f}),f?(0,ae.jsx)(oe.H5,{"data-testid":"metricCorrelation-loadingCalculation",children:"Calculating metric correlations..."}):(0,ae.jsx)(Rr,{highlightAfter:k,highlightBefore:A,baseline:S})]}):(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Icon,{name:"correlation",color:"primary"}),(0,ae.jsx)(oe.Text,{children:"Select a timeframe on any chart and find correlated metrics. Visit documentation"}),(0,ae.jsx)("a",{href:"https://learn.netdata.cloud/docs/cloud/insights/metric-correlations",target:"_blank",rel:"noreferrer",children:(0,ae.jsx)(oe.Icon,{name:"nav_arrow_goto",color:"primary",width:"12px",height:"12px"})})]}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",children:[(!p||f)&&(0,ae.jsx)(Oe.A,{content:B?"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",children:(0,ae.jsx)(Pr,{label:f?"Loading...":"Find correlations",isLoading:!1,onClick:D,disabled:B,flavour:"hollow","data-ga":"metric-correlation::click-find-correlation::charts-view","data-testid":"metricCorrelation-find",small:!0,margin:[0,2,0,0],feature:"MetricCorrelations"})}),(0,ae.jsx)(Oe.A,{content:"Close",align:"bottom",children:(0,ae.jsx)(Or,{neutral:!0,flavour:"borderless",onClick:L,"data-ga":"metric-correlation::click-close::charts-view","data-testid":"metricCorrelation-close",icon:"x",feature:"MetricCorrelations"})})]})]})},zr=e=>{let{children:t}=e;return(0,ae.jsxs)(oe.Flex,{"data-testid":"selected-nodes-container",gap:1,alignItems:"center",width:"100%",children:[(0,ae.jsx)(oe.Flex,{alignItems:"center",children:(0,ae.jsx)(oe.TextSmall,{whiteSpace:"nowrap","data-testid":"selected-nodes-container-message",color:"primary",children:"Selected filters:"})}),(0,ae.jsx)(oe.Flex,{height:{max:50},overflow:{vertical:"auto"},padding:[1],gap:1,alignItems:"center",flexWrap:!0,children:t})]})},Kr=(0,r.memo)(zr),Wr=e=>{let{onRemove:t}=e;return(0,ae.jsx)(oe.Box,{"data-testid":"remove-button",as:oe.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"textLite"})},Gr=e=>{let{removeFilter:t,group:n,id:r,value:o,isAnchorDisabled:i,onClick:s,ref:a}=e;const[l,c]=o.split("|"),d=c?`${l} > ${c}`:l;return(0,ae.jsx)(oe.Flex,{ref:a,"data-testid":`selected-node-item-${r}`,children:(0,ae.jsx)(oe.Pill,{flavour:"neutral",hollow:!0,children:(0,ae.jsxs)(oe.Flex,{position:"relative",gap:2,alignItems:"center",children:[s?(0,ae.jsx)(ge.A,{Component:oe.TextSmall,disabled:i,onClick:s,cursor:"pointer",color:"text",hoverColor:"primary",visitedColor:"accent",disabledColor:"textLite",children:d}):(0,ae.jsx)(oe.TextSmall,{children:d}),(0,ae.jsx)(Wr,{onRemove:()=>t({param:n,removedValue:r}),id:r})]})})})},qr=(0,r.memo)(Gr),Ur={selectedNodeIds:"Node",nodeStatuses:"Status",nodeLabels:"Host label",nodeCapabilities:"Capability",nodeVersions:"Version"},Jr=e=>{let{group:t,subGroup:n,groupLabel:o,values:i,filtersByLabel:s={},hasUnion:a,union:l="AND",removeFilter:c,Component:d=qr}=e;const u=o||Ur[t];if(!Array.isArray(i)||!i.length)return null;const h="nodeLabels"!==t||n?{}:s,x=Object.entries(h);return x.length?x.map(((e,n)=>{let[r,o]=e;return(0,ae.jsx)(Jr,{group:t,subGroup:r,groupLabel:`${Ur[t]} ${r}`,values:o,hasUnion:n>0,removeFilter:c},n)})):(0,ae.jsxs)(r.Fragment,{children:[a&&(0,ae.jsx)(oe.TextSmall,{strong:!0,children:l}),(0,ae.jsxs)(oe.Pill,{flavour:"neutral",hollow:!0,gap:1,TextComponent:oe.Flex,textProps:{alignItems:"center",gap:1},flexWrap:!0,children:[(0,ae.jsxs)(oe.TextNano,{strong:!0,children:[u,":"]}),i.map(((e,o)=>(0,ae.jsxs)(r.Fragment,{children:[o>0&&(0,ae.jsx)(oe.TextSmall,{strong:!0,children:"OR"}),(0,ae.jsx)(d,{removeFilter:c,id:n?`${n}|${e}`:e,value:e,group:t})]},e)))]})]},"filter")},Yr=e=>{let{removeFilter:t,value:n,ref:r}=e;const o=(0,E.xY)(n,"name"),i=(0,E.xY)(n,"isOffline"),s=(0,E.d3)(n);return(0,ae.jsx)(qr,{ref:r,removeFilter:t,group:"selectedNodeIds",id:n,value:o,isAnchorDisabled:i,onClick:s})},Zr=(0,r.memo)((e=>{let{flavour:t}=e;const[[n,r=[]],o]=(0,H._e)({extraKey:t,merge:!1});if(!n.length&&!r.length)return(0,ae.jsx)("div",{});const i=(0,H.Pt)(n);return(0,ae.jsx)(oe.Flex,{width:"100%",overflow:"hidden",padding:[2,0],children:(0,ae.jsxs)(Kr,{children:[n.map(((e,t)=>{let[n,r]=e;return(0,ae.jsx)(Jr,{group:n,values:r,filtersByLabel:i,hasUnion:t>0,removeFilter:o},n)})),(0,ae.jsx)(Jr,{group:"selectedNodeIds",values:r,hasUnion:!!n.length&&!!r.length,union:"OR",removeFilter:o,Component:Yr})]})})}));var Qr=n(88434);const Xr={overview:Zr,default:null},eo=(0,r.memo)((e=>{let{flavour:t,...n}=e;const{showCorrelation:r}=(0,Qr.A)(),o=Xr[t]||Xr.default;return(0,ae.jsx)(oe.Flex,{alignItems:!r&&"center",background:"mainBackground",column:r,"data-testid":"overview-header",gap:2,justifyContent:r?"start":"between",padding:[0,2,0,4],width:"100%",children:r?(0,ae.jsx)(Hr,{flavour:t}):!!o&&(0,ae.jsx)(o,{...n,flavour:t})})})),to=eo;var no=n(27024),ro=n(98591),oo=n(47213);const io=e=>{let{id:t,contexts:n,menuId:r,parentIds:o,...i}=e;const s=(0,Ae.bD)();return(0,oo.q)(s)(n,r||t,o)?(0,ae.jsx)(dt.h,{id:t,...i,children:(0,ae.jsx)(ut.$,{id:t,hasTooltip:!0,flavour:i.extraKey,enableFavourites:!0,level:i.level,descendantIds:i.descendantIds,selfChartIds:i.selfChartIds})}):null},so=(0,r.memo)(io);var ao=n(5020),lo=n(80744),co=n(64156),uo=n(28973),ho=n(1817),xo=n(2404),go=n.n(xo),mo=n(52795),po=n(23565);const fo=(0,G.eU)(null),jo=()=>{const e=(0,Ot.eg)(),t=(0,W.md)(fo);return e&&e.getRoot().getChildren().find((e=>e.match({id:t})))},bo=e=>t=>`overview-page::${e.getAttribute("id")}::${t}`;var vo=n(54251),yo=n(77679);const wo={},Co=(e,t,n)=>{const o=(0,v.ID)(),[i,s]=(0,yo.w)(),a=i?s:o,l=(0,K.rW)("contextSearchFilters",{key:a,extraKey:"chartFilters",flavour:"obj",defaultValue:wo});return(0,r.useMemo)((()=>{const r=Array.isArray(e)?e:[e];if(!r.length||!r[0])return null;const o=t?[t,...n||[]]:[];if(0===o.length)return null;const i={dimensions:[],instances:[],labels:[]};o.forEach((e=>{const t=l[e];t&&r.forEach((e=>{const n=t[e];if(!n)return;(Array.isArray(n)?n:[n]).forEach((e=>{switch(e.matchType){case"dimensions":i.dimensions.includes(e.value)||i.dimensions.push(e.value);break;case"instances":e.instanceName&&(i.instances.includes(e.instanceName)||i.instances.push(e.instanceName));break;case"labels":i.labels.includes(e.value)||i.labels.push(e.value)}}))}))}));return i.dimensions.length>0||i.instances.length>0||i.labels.length>0?i:null}),[l,e,t,n])},Io=[],ko=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):Io,selectedInstances:e.instances?Object.keys(e.instances):Io,selectedNodes:e.nodes?Object.keys(e.nodes):Io,weight:e.weight}},Ao=e=>{let{style:t,handleProps:n,attributes:o,listeners:i,dragging:s,dragOverlay:a,id:l,resizeHandle:c,onChangeHeight:d,onRemove:u,expanded:h,ref:x,menuId:g,subMenuId:m,parentIds:p,...f}=e;const j=(0,r.useRef)({}),b=(0,v.ID)(),y=jo(),{contextScope:w,...C}=(0,an.aA)(l),I=(0,Ot.eg)(),{sendLog:k,isReady:A}=(0,Qt.A)(),S=(0,po.CS)({type:"chart",entity:w?w.join(","):l,path:"/"}),T=Co(w,m||g,p),F=(0,r.useMemo)((()=>{if(!y)return null;let e=y.getNode({id:a?`dragOverlay-${l}`:l});const t=(0,mo.A)(S,!0);if(e)return j.current=(0,mo.A)({...e.getAttributes(),...e.getAttribute("pristine"),pristine:{}}),T&&!go()(e.getAttribute("prevMatches"),T)&&e.setAttributes({selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...T.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...T.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...T.labels||[]])),prevMatches:T}),e;e=I.makeChart({attributes:{id:a?`dragOverlay-${l}`:l,roomId:b,expandable:!0,...C,contextScope:w,expanded:h,toolboxProps:{drag:{...n,...i,...o}}},makeTrack:bo}),y.appendChild(e),j.current=(0,mo.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");return e.setAttributes({...j.current,...t,...T&&!go()(e.getAttribute("prevMatches"),T)&&{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...T.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...T.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...T.labels||[]])),prevMatches:T}}),(0,vo.A)(e,r,e.getAttribute("chartLibrary")),e}),[y,b,l,a]);(0,r.useLayoutEffect)((()=>{F&&A&&"function"===typeof k&&F.updateAttribute("logOptions",{sendLog:k,payload:{feature:"Overview"}})}),[F,k,A]);const{weight:N,selectedDimensions:M,selectedInstances:L,selectedNodes:$}=(0,an.uy)(w.join("|"),ko),D=(0,ho.A)(S),B=(0,ho.A)(T,!0),R=(0,ho.A)(M.length),P=(0,ho.A)(L.length),V=(0,ho.A)($.length);return(0,kr.A)((()=>{if(!F)return;const e=F.getAttribute("chartLibrary"),t={};if(!N||R===M.length&&P===L.length&&V===$.length?S&&!go()(D,S)&&Object.assign(t,{...j.current,...(0,mo.A)(S,!0)}):Object.assign(t,{selectedDimensions:M,selectedInstances:L,selectedNodes:$}),T&&!go()(B,T)){const e=F.getAttributes();Object.assign(t,{selectedDimensions:Array.from(new Set([...e.selectedDimensions||[],...t.selectedDimensions||[],...T.dimensions||[]])),selectedInstances:Array.from(new Set([...e.selectedInstances||[],...t.selectedInstances||[],...T.instances||[]])),selectedLabels:Array.from(new Set([...e.selectedLabels||[],...t.selectedLabels||[],...T.labels||[]])),prevMatches:T})}Object.keys(t).length>0&&(F.updateAttributes(t),(0,vo.A)(F,e,F.getAttribute("chartLibrary")),F.trigger("fetch"))}),[F,b,l,S,T,N,M.length,L.length,$.length]),(0,r.useLayoutEffect)((()=>{F&&t&&(F.updateAttributes({height:t.height,width:t.width}),F.trigger("resize"))}),[F,t.height,t.width]),(0,r.useLayoutEffect)((()=>{if(F)return(0,uo.unregister)(F.onAttributeChange("expanded",(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e===(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))return;const{expandedHeight:t}=F.getAttributes();d(l,(e?1:-1)*t)})))}),[F]),(0,kr.A)((()=>{F&&F.updateAttributes({toolboxProps:{drag:{...n,...i,...o,dragging:s}}})}),[F,s]),F?(0,ae.jsxs)(oe.Box,{ref:x,style:t,children:[(0,ae.jsx)(Gt.A,{chart:F,"data-chartid":a?`dragOverlay-${l}`:l,"data-track":F.track("container"),height:t.height,width:"100%"}),c]},y&&y.getId()):null},So=(0,r.memo)(Ao,((e,t)=>e.id===t.id&&e.style===t.style)),To=function(){let{id:e,layout:t={},contextScope:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ao.bP)(e,t,{left:0,top:0,width:12,height:6,id:e,chartId:e,...t,minWidth:12,maxWidth:12,minHeight:4,static:!1,dashboardable:!0,contextScope:n})},Fo=e=>{let{id:t,menuId:n,subMenuId:o,parentIds:i,containerWidth:s,...a}=e;const l=(0,an.aA)(t,To),c=(0,Ae.bD)(),d=(0,oo.q)(c),[u,h]=(0,r.useState)((()=>[l])),x=(e,t)=>{(0,ao.Q)(t),h(e)},g=(0,r.useRef)(1),m=(e,t)=>{const n=u.findIndex((t=>t.id===e));-1!==n&&(u[n]={...u[n],height:u[n].height+t/lo.NA,expanded:t>0},x([...u],u[n]),g.current+=1)},p=(0,co.A)("(max-width: 767px)"),f=(0,r.useMemo)((()=>(g.current+=1,u.filter((e=>{if(!e)return!1;const t=e.contextScope||[e.chartId]||0;return d(t,o||n,i)})))),[u,d,o,n,i]),j=(0,r.useMemo)((()=>e=>{let{id:t,...r}=e;return(0,ae.jsx)(So,{id:t,role:"graphics-object","aria-roledescription":"chart","data-menuid":o||n,menuId:n,subMenuId:o,onChangeHeight:m,parentIds:i,...r},t)}),[o,n,i]);return(0,ae.jsx)(lo.Ay,{cacheId:g.current,rootId:t,containerId:t,onDragEnd:x,items:f,containerWidth:s-(p?16:26),"data-menuid":o||n,...a,Item:j,rearrangeable:!0})},No=(0,r.memo)(Fo);var Mo=n(54025),Lo=n(63996);const $o=e=>{let{id:t,contexts:n,menuId:r,parentIds:o,extraKey:i,descendantIds:s,level:a,selfChartIds:l}=e;const c=(0,Ae.bD)();return(0,oo.q)(c)(n,r||t,o)?(0,ae.jsx)(Mo.t,{gap:0,id:t,testId:"chart-sub-menu-container-overview",children:(0,ae.jsx)(Lo.t,{id:t,margin:[1,0,0],hasTooltip:!0,flavour:i,enableFavourites:!0,level:a,descendantIds:s,selfChartIds:l})}):null},Do=(0,r.memo)($o);var Bo=n(4719);const Ro=e=>{let{id:t}=e;const n=(0,v.ID)(),o=(0,Ot.eg)(),i=(0,an.Vt)(),{chartIds:s}=(0,Bo.b)(t),a=jo(),l=(0,r.useMemo)((()=>{const[e]=s;let r=a.getChildren().find((e=>e.match({id:t})));if(r)return r;const l=s.map((e=>({value:e,label:i(e).context})));return r=o.makeChart({attributes:{id:`custom-k8s-map-${t}`,contextScope:[e],roomId:n,composite:!0,chartLibrary:"groupBoxes",groupBy:["label"],groupByLabel:["k8s_namespace","k8s_pod_name"],aggregationMethod:"avg",eliminateZeroDimensions:!1,contextItems:l,toolboxElements:[]},makeTrack:bo}),a.appendChild(r),r}),[t,a]);return(0,ae.jsx)(Gt.A,{margin:[0,0,2],chart:l,"data-chartid":t,"data-track":l.track("container")},a.getId())},Po=e=>{let{id:t,...n}=e;return(0,ae.jsxs)(dt.h,{id:t,padding:[6,0,0],children:[(0,ae.jsx)(ut.$,{id:t}),(0,ae.jsx)(ht.n,{id:t,padding:[2,0,0]}),(0,ae.jsx)(Ro,{id:t,...n})]})},Vo=(0,r.memo)(Po);n(37550);const _o=[],Oo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):_o,selectedInstances:e.instances?Object.keys(e.instances):_o,selectedNodes:e.nodes?Object.keys(e.nodes):_o,weight:e.weight}},Eo=(0,an.BK)((e=>{let{style:t,id:n,menuChartAttributes:o,resizeHandle:i,handleProps:s,listeners:a,dragging:l,dragOverlay:c,onChangeHeight:d,expanded:u,ref:h,menuId:x,subMenuId:g,parentIds:m}=e;const p=(0,r.useRef)({}),f=(0,v.ID)(),j=(0,Ot.eg)(),b=jo(),y=(0,po.CS)({type:"chart",entity:n,path:"/"}),w=Co(o.contextScope,g||x,m),C=(0,r.useMemo)((()=>{let e=b.getChildren().find((e=>e.match({id:c?`dragOverlay-${n}`:n})));const t=(0,mo.A)(y,!0);if(e)p.current=(0,mo.A)({...e.getAttributes(),...e.getAttribute("pristine")}),w&&!go()(e.getAttribute("prevMatches"),w)&&e.setAttributes({selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...w.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...w.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...w.labels||[]])),prevMatches:w});else{e=j.makeChart({attributes:{expandable:!0,...o,roomId:f,id:c?`dragOverlay-${n}`:n,isHead:!0,expanded:u},makeTrack:bo,toolboxProps:{drag:{...s,...a}}}),p.current=(0,mo.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");e.setAttributes({...p.current,...t,...w&&go()(e.getAttribute("prevMatches"),w)&&{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...w.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...w.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...w.labels||[]])),prevMatches:w}}),(0,vo.A)(e,r,e.getAttribute("chartLibrary")),b.appendChild(e)}return e}),[f,n,b]),{weight:I,selectedDimensions:k,selectedInstances:A,selectedNodes:S}=(0,an.uy)(o.contextScope?.join("|"),Oo),T=(0,ho.A)(y),F=(0,ho.A)(w,!0,go()),N=(0,ho.A)(k.length),M=(0,ho.A)(A.length),L=(0,ho.A)(S.length);(0,kr.A)((()=>{if(!C)return;const e={},t=C.getAttribute("chartLibrary");if(!I||N===k.length&&M===A.length&&L===S.length?y&&!go()(T,y)&&Object.assign(e,{...p.current,...(0,mo.A)(y,!0)}):Object.assign(e,{selectedDimensions:k,selectedInstances:A,selectedNodes:S}),w&&!go()(F,w)){const t=C.getAttributes();Object.assign(e,{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...e.selectedDimensions||[],...w.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...e.selectedInstances||[],...w.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...e.selectedLabels||[],...w.labels||[]])),prevMatches:w})}Object.keys(e).length>0&&(C.updateAttributes(e),(0,vo.A)(C,t,C.getAttribute("chartLibrary")),C.trigger("fetch"))}),[C,f,n,y,w,I,k.length,A.length,S.length]),(0,r.useLayoutEffect)((()=>{C.updateAttributes({toolboxProps:{drag:{...s,...a,dragging:l}}})}),[C,l]),(0,r.useLayoutEffect)((()=>{if(C)return(0,uo.unregister)(C.onAttributeChange("expanded",(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e===(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))return;const{expandedHeight:t}=C.getAttributes();d(n,(e?1:-1)*t)})))}),[C]),(0,kr.A)((()=>{if(!C)return;const e=parseFloat(t.height);e&&!isNaN(e)&&(C.updateAttribute("height",e),C.trigger("resize"))}),[t.height]);return(0,Ae.Bu)(o.contextScope)?(0,ae.jsxs)("div",{ref:h,style:t,children:[(0,ae.jsx)(Gt.A,{chart:C,"data-track":C.track("container"),"data-chartid":c?`dragOverlay-${n}`:n,height:t.height,width:"100%"}),i]},b.getId()):null})),Ho=(e,t,n)=>(e.layout||console.warn(t,"has no layout set, default values will be used."),(0,ao.bP)(t,e.layout,{left:n%2,top:4*parseInt(n/2),width:6,height:4,id:e.id,contextScope:e.contextScope,minWidth:1,minHeight:1,static:!1,dashboardable:!0})),zo=(0,r.memo)((e=>{let{itemIds:t,containerWidth:n,id:o,subMenuId:i,menuId:s,parentIds:a}=e;const l=(0,an.dd)(t,Ho),{filteredChartsCount:c}=(0,xr.Ad)(),d=(0,co.A)("(max-width: 767px)"),u=(0,Ae.bD)(),h=(0,oo.q)(u),[x,g]=(0,r.useState)((()=>l)),m=(e,t)=>{(0,ao.Q)(t),g(e)},p=(0,r.useRef)(1),[f,j]=(0,r.useState)(!1),b=(0,r.useMemo)((()=>t.some((e=>null!==localStorage.getItem(`chart_layout/${e}`)))),[t]),v=(0,r.useCallback)((()=>{t.forEach((e=>{localStorage.removeItem(`chart_layout/${e}`)})),p.current+=1,g(l)}),[t,l]);(0,r.useEffect)((()=>{const e=()=>{p.current+=1,g(l)};return window.addEventListener("resetChartLayout",e),()=>window.removeEventListener("resetChartLayout",e)}),[l,d]);const y=(0,r.useMemo)((()=>(p.current+=1,x.filter((e=>!!e&&(!!e.contextScope&&h(e.contextScope,s,a)))))),[t,x,c,h,s,a]);return y.length?(0,ae.jsxs)(oe.Flex,{position:"relative",width:"100%",onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[f&&b&&(0,ae.jsx)(oe.Flex,{position:"absolute",top:2,right:2,zIndex:10,background:"dropdown",round:1,padding:[1],border:!0,children:(0,ae.jsx)(Oe.A,{content:"Reset all charts to default layout",align:"left",children:(0,ae.jsx)(oe.IconButton,{icon:"refresh",onClick:v,flavour:"borderless",padding:[1],"data-testid":"grid-reset-layout-button"})})}),(0,ae.jsx)(lo.Ay,{cacheId:p.current,rootId:o,containerId:o,"data-chartid":o,"data-menuid":i||s,onDragEnd:m,items:y,containerWidth:n-(d?16:26),gridTracks:d?1:12,Item:Eo,rearrangeable:!0,itemProps:{onChangeHeight:(e,t)=>{const n=x.findIndex((t=>t.id===e));-1!==n&&(x[n]={...x[n],height:x[n].height+t/lo.NA,expanded:t>0},m([...x],x[n]),p.current+=1)},menuId:s,subMenuId:i,parentIds:a},compactType:"vertical"})]}):null}),((e,t)=>e.itemIds===t.itemIds&&e.containerWidth===t.containerWidth)),Ko={k8s:Vo,root:so,submenu:Do,chart:No,grid:zo},Wo=e=>{if(Ko[e.flavour])return Ko[e.flavour];switch(e.level){case 0:return so;case 1:return Do;case 2:return No;default:return null}},Go=e=>{let{flavour:t,onChartNameChange:n,initialChartName:r,dashboardOptions:o,linkToGo:i,contextToGo:s,containerWidth:a}=e;const[l,,,c]=(0,ro.A)("addToDashboardModal"),{setActiveMenuId:d}=(0,lt.A)({onChartNameChange:n,initialChartName:r,linkToGo:i,contextToGo:s}),u=(0,Ae.bD)(),h=(0,oo.q)(u);return(0,ae.jsxs)(ne.H,{children:[(0,ae.jsx)(ct.A,{flavour:t,onActiveMenuId:d,getComponent:Wo,dashboardOptions:o,initialChartName:r,containerWidth:a,checkVisibility:h}),l&&(0,ae.jsx)(no.A,{onClose:c})]})};var qo=n(19075);const Uo=(0,r.memo)((()=>{const[e,t]=(0,qo.KB)(),n=(0,Ot.eg)(),o=!!e&&!!n&&n.getNode({id:e.context}),i=()=>{if(t(null),!e?.context||!o)return;const n={...o.getAttribute("overlays")};delete n.alert,o.updateAttribute("overlays",n),history.replaceState({},"")};(0,r.useEffect)((()=>i),[]);const s=(0,v.ID)(),a=(0,Ae.R7)(e?.context&&s,e?.context);if(!e||!a?.loaded)return null;const{firstEntry:l}=a;return(0,ae.jsx)(oe.Layer,{backdrop:!1,position:"top",margin:[26,0,0],padding:[26,0,0],children:(0,ae.jsxs)(oe.Flex,{background:"tooltip",padding:[1,2],gap:2,children:[(0,ae.jsxs)(oe.TextSmall,{children:["Showing alert in ",(0,ae.jsx)(oe.TextSmall,{strong:!0,children:e.instance})," on"," ",(0,ae.jsx)(oe.TextSmall,{strong:!0,children:new Date(1e3*e.lastStatusChange).toLocaleString()}),!l&&" doesn't exist on the node anymore",!!l&&l>e.lastStatusChange&&" exceeds agent data retention settings"]}),(0,ae.jsx)(oe.Flex,{flex:!1,children:(0,ae.jsx)(oe.Icon,{name:"x",color:"tooltipText",onClick:i,size:"small"})})]})})})),Jo=Uo;var Yo=n(14070);const Zo={NoChartsView:hr,NoNodesView:R.A,sidebar:{title:"Filters",hiddenTabs:["info"],Component:re.Ay,props:{}},dashboardOptions:{},loadingMessage:"Loading charts...",Header:to},Qo={overview:{...Zo,sidebar:{...Zo.sidebar,title:"Metrics"},feature:"Overview"},k8s:{...Zo,NoChartsView:Ir,NoNodesView:Ir,sidebar:{...Zo.sidebar,title:"Kubernetes"},loadingMessage:"Loading k8s charts...",feature:"Kubernetes"},singleNode:{...Zo,sidebar:{...Zo.sidebar,title:"Single Node",hiddenTabs:["filters"],props:{showCollapsed:!0}},feature:"SingleNode"}},Xo=()=>((0,or.A)(),null),ei=(0,r.memo)((e=>{let{flavour:t="overview",invalidationKey:n,nodeIds:r,loaded:o,getChart:i,chartIds:s,areChartsIdsEmpty:a,showNoChartsView:l,showNoNodesView:d,initializing:u,chartName:h,setChartName:x,chartsLoaded:g,widthRef:m,containerWidth:p,nodesKey:j,blurred:b,blurProps:v={},BlurredContent:y,noPreferredNodesError:w}=e;const{dashboardOptions:C,NoChartsView:I,NoNodesView:k,sidebar:A,Header:S,feature:T="Overview"}=Qo[t],{state:F}=(0,f.zy)(),[N,,,M]=(0,Yo.A)(),L=jo();return d?(0,ae.jsx)(P.Ay,{feature:T,mode:"NoNodesView",children:(0,ae.jsx)(k,{})}):u?(0,ae.jsx)(ar.A,{title:"Please wait while charts are being initialized.",body:"Thank you for your patience!"}):o?(0,ae.jsx)(P.Ay,{feature:T,children:(0,ae.jsxs)(ne.A,{getObject:i,ids:s,linkToGo:F?.chartName,extraKey:t,deps:[j],children:[(0,ae.jsx)(Xo,{}),(0,ae.jsx)(Jo,{}),(0,ae.jsxs)(_.A,{ref:m,sidebar:(0,ae.jsx)(A.Component,{nodeIds:r,title:A.title,initialChartName:h,hiddenTabs:A.hiddenTabs,flavour:t,loaded:g,FilterInputContainer:vr,...A.props}),blurred:b,blurProps:v,BlurredContent:y,children:[(0,ae.jsx)(S,{flavour:t}),g||w?l||a?(0,ae.jsx)(I,{noPreferredNodesError:w}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Go,{flavour:t,dashboardOptions:C,initialChartName:h,onChartNameChange:x,linkToGo:F?.chartName,contextToGo:F?.contextToGo,containerWidth:p}),N&&M]}):(0,ae.jsx)(c.O2,{}),(0,ae.jsx)(sr,{container:L})]})]},n)}):(0,ae.jsx)(c.O2,{})})),ti=ei,ni=e=>t=>{const n=(0,E.nl)(),o=(0,r.useMemo)((()=>[n]),[n]);return(0,ae.jsx)(e,{flavour:"singleNode",nodeIds:o,nodeId:n,...t},n)};var ri=n(64867),oi=n(12407),ii=n(17829);var si=n(13752),ai=n(92815),li=n(72582),ci=n(82650),di=n(78072),ui=n(95980),hi=n(91832),xi=n(6504),gi=n(22332),mi=n(62709);const pi=(0,dn.default)(oe.Icon).withConfig({displayName:"styled__StyledAlertDot",componentId:"sc-12w0ym-0"})(["position:absolute;top:0;right:-1px;width:6px;height:6px;"]);var fi=n(96026);const ji=(0,Bt.A)((e=>{let{alertName:t,close:n,tooltip:o,...i}=e;const[,s]=(0,Yo.A)(),{sendLog:a}=(0,Qt.A)(),l=(0,r.useCallback)((e=>{e.stopPropagation(),s({alertName:t}),a({feature:"MetricsChartManageAlerts",description:"Show alert",alertName:t}),n()}),[t,s,n,a]);return(0,ae.jsx)(oe.IconButton,{icon:"goToNode",iconColor:"textLite",onClick:l,neutral:!0,padding:[0],width:"16px",height:"16px",...i})})),bi=(0,Bt.A)((e=>{let{alertName:t,nodes:n,close:o,tooltip:i,...s}=e;const{goToEdit:a}=(0,fi.q)({alertName:t,nodeIds:n}),{sendLog:l}=(0,Qt.A)(),c=(0,r.useCallback)((e=>{e.stopPropagation(),l({feature:"MetricsChartManageAlerts",description:"Edit alert",alertName:t}),a(),o()}),[n,o,a,l]);return(0,ae.jsx)(oe.IconButton,{icon:"pencilOutline",iconColor:"textLite",onClick:c,neutral:!0,padding:[0],width:"12px",height:"12px",...s})})),vi=e=>{let{item:{value:t,label:n,alerts:r={},nodes:o,onClick:i,...s},index:a,style:l,close:c,onItemClick:d,...u}=e;const{cl:h=0,cr:x=0,wr:g=0}=r,m={text:x,flavour:x?"error":"disabledError"},p={text:g,flavour:g?"warning":"disabledWarning"},f={text:h,flavour:h?"clear":"disabledClear"};return(0,ae.jsxs)(oe.MenuItemContainer,{"data-index":a,onClick:e=>{i&&i(e)},...s,...u,style:l,alignItems:"center",justifyContent:"between",gap:2,padding:[1,2],overflow:"hidden",cursor:"default",children:[(0,ae.jsx)(oe.Flex,{width:{max:"180px"},alignItems:"center",children:(0,ae.jsx)(Jt.A,{text:n,TextComponent:oe.Text})}),(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.MasterCard,{pillLeft:m,pillRight:p,pillEnd:f}),(0,ae.jsx)(ji,{alertName:t,close:c,tooltip:"Show alert instances",tooltipProps:{align:"bottom"}}),(0,ae.jsx)(bi,{alertName:t,nodes:o,close:c,tooltip:"Edit this alert configuration",tooltipProps:{align:"bottom"}})]})]})};var yi=n(39423),wi=n(7134),Ci=n(41395),Ii=n(76661),ki=n(21885),Ai=n(73087);const Si=function(e){let{fallback:t="*",transform:n=e=>e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.length?e.map(n).join("|").replace(/\|+/g,"|"):t},Ti=function(){let{entityProps:e,context:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=(0,Ii.A)(),[,o]=(0,Zt.QH)();return(0,r.useCallback)((r=>{let{context:i=t,entityProps:s=e,aggregationMethod:a,groupingMethod:l,selectedDimensions:c,selectedLabels:d,selectedInstances:u,viewUpdateEvery:h,selectedNodeLabelsFilter:x,after:g,before:m,title:p}=r;const[f,j]=(e=>{if(!e)return["average",null];const t=e.match(/([a-zA-Z]+)(\d+)/);if(!t)return["average",null];const[,n,r]=t;return[n.toLowerCase(),parseInt(r,10)]})(l),b=(v=u,Array.isArray(v)&&0!==v.length?v.map((e=>{const t=e.split("@");return t.length>1?t[0]:e})).join("|"):"");var v;const y=g?g<0?Math.max(g,-600):Math.max(parseInt(-1*(m-g)/1e3,10),-600):-600,w=(e=>{if(!e)return"";const t=(0,Ai.F)({start:0,end:e});return`${(0,wi.Vj)(t)}`})(Math.abs(1e3*y)),C="avg"===a?"average":a||"sum",I=`${(0,Ci.Zr)(C)} of ${p} over ${w}`,k={format_version:1,rules:[{enabled:!0,type:b?"instance":"template",config:{match:{on:b||i,host_labels:Si(x),instance_labels:Si(d)},value:{database_lookup:{data_source:"samples",time_group:f,time_group_value:j,after:y,before:0,dims_group:C,dimensions:Si(c),options:["unaligned"]},update_every:Math.min(h,60)||60},summary:p,info:I,type:"",component:"",classification:""}}],name:(0,Ci.Yv)(`${w} ${p}`,{underscored:!0})};o(n({template:ki.Sd,formData:k,entityProps:s}))}),[n,o,e])};const Fi={events:{extraKey:"feedFilters",page:"events",alertNamesKey:"alert_names",period:{after:-n(71336).d_,before:0}},alerts:{extraKey:"alerts",page:"alerts",alertNamesKey:"alertNames"}},Ni=function(){let{flavour:e="events"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,v.ID)(),n=(0,f.Zp)(),[o,i]=(0,mr.Ay)(),s=(0,qo.le)(),[,a]=(0,qo.DV)(),l=(0,K.rI)(),{extraKey:c,page:d,alertNamesKey:u,period:h}=Fi[e]||Fi.events,x={defaultValue:[],key:t,extraKey:c,flavour:"arr",merge:!1},g=(0,K.rI)("alertContexts",x),m=(0,K.rI)(u,x),p=(0,K.rI)("chart_names",x),j=(0,r.useCallback)((e=>{let{name:t}=e;s(1),a({alertName:t,nodeId:null}),n(`/spaces/${o}/rooms/${i}/alerts`,{replace:!0})}),[n,o,i,s,a]),b=(0,r.useCallback)((e=>{let{context:t,name:r,instance:s}=e;h&&l((e=>({...e,...h}))),t&&g([t]),r&&m([r]),s&&p([s]),n(`/spaces/${o}/rooms/${i}/${d}`)}),[n,d,h,o,i,l,g,m,p]);return{goToAlerts:b,goToAlertConfigurations:j}},Mi=(0,qe.A)((0,Bt.A)(oe.Button)),Li=e=>{let{loaded:t,contexts:n=[],close:o}=e;const i=(0,gi.useChart)(),s=i.getId(),a=n?.[0],l=(0,gi.useAttributeValue)("nodes"),{setState:c}=(0,Zt.$h)(),{setSelectedTab:d}=(0,yi.A)(),[u,h]=(0,mr.Ay)(),{goToAlerts:x}=Ni({flavour:"alerts"}),{value:g}=(0,Zt.wd)({node:{value:Object.keys(l)[0]},path:ki.$7}),m=Ti(),p=(0,H.u7)({extraKey:ki.q4}),j=(0,f.Zp)(),b=(0,r.useMemo)((()=>a?`View the active alerts for ${a} context`:"View the active alerts for this context"),[a]),v=(0,r.useCallback)((()=>{a&&(d(0),o(),x({context:a}))}),[a,x,d,u,h,o]),y=(0,r.useCallback)((()=>{if(t&&a){const{tree:e}=g||{},t=e?.[ki.$7]?.[ki.Sd],{nodes:n,selectedNodes:r,aggregationMethod:s,groupingMethod:l,selectedDimensions:d,selectedLabels:h,selectedInstances:x,viewUpdateEvery:f,selectedNodeLabelsFilter:b,after:v,before:y,title:w}=i.getAttributes(),C=r.length?r:Object.values(n).map((e=>{let{nd:t}=e;return t}));c({isAlert:!0}),m({entityProps:t,context:a,aggregationMethod:s,groupingMethod:l,selectedDimensions:d,selectedLabels:h,selectedInstances:x,viewUpdateEvery:f,selectedNodeLabelsFilter:b,after:v,before:y,title:w}),j(`/spaces/${u}/settings/configurations`,{replace:!0}),p(C),o()}}),[t,m,p,c,a,l,g,j,u,o]);return(0,ae.jsxs)(oe.Flex,{gap:2,padding:[2],border:{side:"top"},justifyContent:"center",children:[(0,ae.jsx)(Mi,{feature:"MetricsChartManageAlerts",label:"Go to alerts",small:!0,flavour:"hollow",icon:"goToNode",onClick:v,tooltip:b,tooltipProps:{align:"bottom"},payload:{chartId:s},disabled:!a||!t}),(0,ae.jsx)(Mi,{feature:"MetricsChartManageAlerts",label:"Add alert",small:!0,icon:"plus",onClick:y,tooltip:`Start adding a new alert on ${a} context`,tooltipProps:{align:"bottom"},payload:{chartId:s},disabled:!a||!t})]})},$i=e=>{let{disabled:t}=e;const n=(0,gi.useChart)(),{loaded:o,items:i,status:s}=(e=>{const[t,n]=(0,r.useState)(),[o,i]=(0,r.useState)([]),[s,a]=(0,r.useState)([]),[l,c]=(0,r.useState)();return(0,r.useEffect)((()=>{const t=()=>{const t=e.getAttribute("alerts"),r=Object.values(t||{}),o=Object.keys(e.getAttribute("nodes")||{});n(!0),i(r),a(o);for(let e=0;e<=r.length;e++){const{wr:t=0,cr:n=0}=r[e]||{};if(n>0){c("error");break}if(t>0){c("warning");break}}};return e&&e.on("successFetch",t),()=>{e&&e.off("successFetch",t)}}),[e,n,i,a,c]),{loaded:t,items:(0,r.useMemo)((()=>[...o.map((e=>{let{nm:t,cl:n,wr:r,cr:o}=e;return{value:t,label:t,alerts:{cl:n,wr:r,cr:o},nodes:s}}))]),[o,s]),status:l}})(n),a=n.getAttribute("contextScope");return n?(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(oe.Menu,{dropProps:{align:{top:"bottom",right:"right"},"data-toolbox":n.getId()},dropdownProps:{width:"360px"},Item:vi,items:i,Footer:e=>{let{close:t}=e;return(0,ae.jsx)(Li,{loaded:o,contexts:a,close:t})},children:(0,ae.jsxs)(oe.Flex,{alignItems:"center",position:"relative",children:[s?(0,ae.jsx)(pi,{name:"dot",color:s}):null,(0,ae.jsx)(xi.Button,{icon:(0,ae.jsx)(xi.default,{svg:mi.A,size:"16px"}),title:"Manage alerts",disabled:t,"data-testid":"chartHeaderToolbox-manageAlerts"})]})})}):null},Di=(e,t,n)=>{let{width:o,host:i}=n;if(!i)throw"No host provided";const s=(0,Ot.eg)(),a=(0,r.useRef)(),l=(0,Ae.aZ)(e,"error"),[{correlation:c},d]=(0,K.N9)(),{state:u,pathname:h}=(0,f.zy)(),x=(0,W.Xr)(fo),g=(0,Ae.jI)(e),m=(0,Ae.DQ)(e);(0,r.useLayoutEffect)((()=>{if(!e||!s||l)return;let n=s.getRoot().getChildren().find((e=>e.match({id:h})));if(!n)return n=s.makeContainer({attributes:{id:h,roomId:e,host:i,navigation:c?"highlight":"pan",overlays:{proceeded:{type:"proceeded"}},composite:!0,nodesScope:t,hasCorrelation:!0,versions:g,containerWidth:o,toolboxElements:[...L.Dm?[$i]:[],di.default,li.default,si.default,ai.default,ci.default,hi.A,ui.A]}}),s.appendChild(n),x(h),a.current=n,(0,uo.unregister)(s.on("correlation",((e,t)=>{if(!Array.isArray(t))return;const[n,r]=t;d((e=>({...e,highlight:{after:1e3*n,before:1e3*r},correlation:!0})))})),n.onAttributeChange("versions",m));x(h)}),[e,l,h,i]),(0,r.useMemo)((()=>{a.current&&(a.current.setAttribute("containerWidth",o),a.current.getNodes().forEach((e=>e.updateAttribute("containerWidth",o))))}),[a.current,o]),(0,kr.A)((()=>{a.current&&a.current.setAttribute("host",i)}),[a.current,i]),(0,kr.A)((()=>{a.current&&a.current.getNodes().forEach((e=>{e.updateAttribute("nodesScope",t);e.getAttribute("active")&&"chart"===e.type&&e.fetch()}))}),[a.current,t]),(0,r.useEffect)((()=>{a.current&&a.current.getApplicableNodes({syncHighlight:!0}).forEach((e=>{e.updateAttribute("navigation",c?"highlight":"pan")}))}),[a.current,c]),(0,r.useEffect)((()=>()=>a.current&&a.current.destroy()),[]),(0,r.useEffect)((()=>{if(!a.current)return;if(!u||!u.context)return;const{context:e,chartId:t,nodeId:n}=u,r=a.current.getNode({id:e});r&&r.updateAttributes({selectedInstances:[`${t}@${n}`],selectedNodes:[n]});const o=t&&n&&a.current.on("chartLoaded",(r=>{const i=r.getAttribute("id");e===i&&(r.updateAttributes({selectedInstances:[`${t}@${n}`],selectedNodes:[n]}),o())}));return()=>u&&(0,uo.unregister)(o)}),[a.current,u])};var Bi=n(43116);const Ri={default:{shouldHide:()=>!1},k8s:{shouldHide:e=>{let{context:t}=e;return!t.includes("k8s")}}},Pi=[],Vi="ErrNoPreferredNodeRequested",_i=e=>(0,r.memo)((t=>{let{flavour:n="overview",nodeIds:o=Pi,nodeId:i,...s}=t;const a=(0,b.vt)(),l=(0,v.ID)(),c=(0,v.XA)("nodeId");i=i||c;let d=(0,H.w7)({extraKey:n,merge:!1,scoped:!0});d=o.length?o:d;const{isNodeRestricted:u,loaded:h}=(0,en.A)();d=(0,r.useMemo)((()=>d.filter((e=>!u(e).restricted))),[d,h]);const x=(0,B.nj)(),g=(0,Ae._0)(l),{state:m}=(0,f.zy)(),p=(0,Ae.R7)(l),j=(0,E.TG)(d),y=(0,ke.A)(l,d,{spaceId:a}),{contexts:w,metadata:C,loaded:I,dimensionsCount:k}=(0,Ar.Yy)({nodeIds:d,flavour:n},a,l),[,A]=(()=>{const{state:e={}}=(0,f.zy)(),{alertId:t=null}=e||{},[n,o]=(0,qo.KB)(),i=t||n?.id,s=(0,qo.JL)(i);(0,qo.yk)(s.id),(0,r.useEffect)((()=>{(s.fullyLoaded||s.id)&&o({...s,formattedLastStatusChangeValue:(0,ii.m3)(s.lastStatusChangeValue,s.units),linkToGo:(0,Xe.A)(s.context)})}),[s.id,s.fullyLoaded]);const a=n?.id?(0,Xe.A)(n.context):null;return[s.id,a]})(),S=o?o.join():n,T=(0,te.K)({spaceId:a,roomId:l}),[F,{width:N}]=(0,V.A)();Di(l,d,{host:T,width:N});const M=(0,Ae.OL)(l),L=(0,Ae.rx)(l),$=I?C:p,D=Ri[n]||Ri.default,R=(0,Ae.bo)(l),P=(0,ho.A)(R),_=(0,xr.rq)(M,p,l,{...D,shouldHide:I?e=>{let{context:t}=e;return!w.includes(t)}:D.shouldHide,force:I||R!==P,cacheKey:`${n}-${k}-${S}`}),O=(0,Ae.yO)(l,C),z=(0,ho.A)(y,!0),W=_<1,[G,q]=(0,K.N9)("chartName",{key:l,extraKey:S,flavour:"val"});(0,r.useEffect)((()=>{l&&q(A||m?.chartName||G)}),[l,A]);const U=jo(),J=Object.keys($).length<1&&g||d.length&&!j.length,Y=(0,B.CK)(),Z=L?.errorMsgKey==Vi;if(!J&&!1!==z&&y&&"No data for this period"!==y&&y!==Vi&&!Object.keys($).length)return(0,ae.jsx)(Bi.A,{error:y});const Q=!!l&&x&&(!!U||Z),{restricted:X}=u(i);return(0,ae.jsx)(e,{nodeIds:j,loaded:Q,getChart:O,areChartsIdsEmpty:W,showNoNodesView:x&&!Y.length,showNoChartsView:J,initializing:y&&(0,ri.O)(y),chartName:G,setChartName:q,chartsLoaded:g&&!!N,invalidationKey:l,flavour:n,chartIds:I?w:M,widthRef:F,containerWidth:N,nodesKey:S,noPreferredNodesError:Z,blurred:X,blurProps:{value:"12px"},BlurredContent:()=>(0,ae.jsx)(oi.A,{flavour:c?"room":"node"}),...s})}));var Oi=n(21785),Ei=n(39870),Hi=n(7761);const zi=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,Hi.N3)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Yn.hn)(e,t),onReceive:e=>{let{data:t}=e;return n({...Ei.jf,loaded:!0,...t})},onFail:e=>n({...Ei.jf,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t])};var Ki=n(75669);const Wi=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,H.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,Hi.kf)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Yn.TM)(e,t,n),onReceive:e=>{let{data:t}=e;return r({...Ei.ul,loaded:!0,...t})},onFail:e=>r({...Ei.ul,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t])},Gi=()=>{const e=(0,b.vt)(),t=(0,v.ID)(),n=(0,H.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,Hi.xs)();(0,j.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Yn.jt)(e,t,n),onReceive:e=>{let{data:t}=e;return r({...Ei.ve,loaded:!0,...t})},onFail:e=>r({...Ei.ve,loaded:!0,error:e}),pollingOptions:{pollingInterval:588e3}})),[e,t,n])};var qi=n(56171);const Ui="onboarding",Ji="home",Yi="/state",Zi={quickWins:{},dismissedBanners:{}},Qi=()=>{const e=(0,_e._)({params:{type:Ui,entity:Ji,path:Yi}}),t=e[0]?.id,n=(0,po.ti)(t),o=(0,r.useRef)(!1),i=(0,r.useMemo)((()=>({...Zi,...n?.value})),[n?.value]),s=(0,Et.yK)({onSuccess:()=>{o.current=!1},onResolve:()=>{o.current=!1}}),a=(0,Et.xS)(),l=(0,r.useCallback)((e=>{const t={type:Ui,entity:Ji,path:Yi,value:{...i,...e}};n?.id?a({id:n.id,...t}):o.current||(o.current=!0,s(t))}),[i,n,s,a]),c=(0,r.useCallback)((e=>{l({quickWins:{...i.quickWins,[e]:!0}})}),[i,l]),d=(0,r.useCallback)((e=>{l({dismissedBanners:{...i.dismissedBanners,[e]:!0}})}),[i,l]);return{quickWins:i.quickWins,dismissedBanners:i.dismissedBanners,markQuickWinCompleted:c,dismissBanner:d}},Xi=[{id:"ai-insights",icon:"ai",background:"secondaryHighlightAI",text:"Ready to unlock AI-powered analysis? Netdata has collected enough data to generate Intelligent Insights. Try your first AI report for detailed recommendations and forecasts.",linkText:"Explore Insights.",route:"insights"}],es=e=>{let{item:t,onNavigate:n}=e;return(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,ae.jsx)(oe.Icon,{name:t.icon,color:"main"}),(0,ae.jsxs)(oe.Text,{color:"main",children:[t.text," ",(0,ae.jsx)(ge.A,{color:"main",onClick:n,style:{textDecoration:"underline"},children:t.linkText})]})]})},ts=()=>{const e=(0,f.Zp)(),t=(0,b.bq)(),n=(0,v.QW)(),{dismissedBanners:o,dismissBanner:i}=Qi(),s=(0,r.useMemo)((()=>Xi.find((e=>!o[e.id]))),[o]),a=(0,r.useCallback)((()=>{s&&i(s.id)}),[s,i]),l=(0,r.useCallback)((()=>{s?.route&&e(`/spaces/${t}/rooms/${n}/${s.route}`)}),[e,t,n,s]);return s?(0,ae.jsx)(qi.A,{background:s.background,onClose:a,children:(0,ae.jsx)(es,{item:s,onNavigate:l})}):null};var ns=n(58618),rs=n(42964),os=n(82507);const is={Live:"live",Stale:"stale",Offline:"offline",Unseen:"unseen"},ss=(0,dn.default)(oe.Flex).withConfig({displayName:"nodeHero__Container",componentId:"sc-t1z79b-0"})(["position:relative;width:320px;height:320px;"]),as=(0,dn.default)(oe.Flex).withConfig({displayName:"nodeHero__ContentContainer",componentId:"sc-t1z79b-1"})(["position:absolute;inset:0;z-index:2;"]),ls=e=>{let{nodeId:t}=e;const n=(0,f.Zp)(),r=(0,E.xY)(t),{loaded:o,metricsCollected:i=0}=(0,Hi.P9)(),s=(0,b.bq)(),a=(0,v.QW)(),l=(0,it.GM)(r.state),c=is[l]||"offline";return(0,ae.jsxs)(ss,{children:[(0,ae.jsx)(rs.A,{withOuties:!1}),(0,ae.jsx)(os.A,{withOuties:!1}),(0,ae.jsxs)(as,{column:!0,justifyContent:"center",alignItems:"center",gap:3,children:[(0,ae.jsx)(oe.TextBig,{color:"primary",children:r.nm}),(0,ae.jsxs)(oe.Flex,{gap:1,alignItems:"center",children:[(0,ae.jsx)(oe.Box,{width:"8px",height:"8px",round:"50%",background:c}),(0,ae.jsx)(oe.TextBig,{color:c,children:l})]})]}),(0,ae.jsxs)(oe.Flex,{column:!0,alignItems:"center",gap:2,position:"absolute",width:"100%",style:{bottom:"-60px"},children:[(0,ae.jsxs)(oe.TextBig,{children:[o?(0,ns.$t)(i):"..."," metrics collected"]}),(0,ae.jsx)(oe.Button,{label:"View your metrics",icon:(0,ae.jsx)(oe.Icon,{name:"arrow_right"}),iconSide:"right",onClick:()=>{n(`/spaces/${s}/rooms/${a}/overview`)}})]})]})},cs=(0,Bt.A)(oe.Icon),ds=e=>{let{title:t,icon:n,iconColor:r,...o}=e;return(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:2,...o,children:[n&&(0,ae.jsx)(oe.Icon,{name:n,...r?{color:r}:{}}),(0,ae.jsx)(oe.TextBig,{children:t})]})},us={ErrNoEligibleNodeRequested:"There are no eligible nodes.",default:"Something went wrong."},hs=e=>{let{titleProps:t,loading:n,error:r,children:o,...i}=e;const s={padding:[4],gap:4,background:"panelBg",...t?{column:!0}:{}},a=r?us[r.errorMsgKey]||us.default:null;return(0,ae.jsxs)(oe.Flex,{...s,...i,children:[t?(0,ae.jsx)(ds,{...t}):null,n?(0,ae.jsx)(oe.Text,{textAlign:"center",children:"Loading..."}):r?null:(0,ae.jsx)(ae.Fragment,{children:o}),a?(0,ae.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ae.jsx)(cs,{name:"warning_triangle",size:"large",color:"text",tooltip:a})}):null]})};var xs=n(56473);const gs=e=>{let{title:t,value:n,loading:r}=e;return(0,ae.jsxs)(hs,{column:!0,alignItems:"center",justifyContent:"center",gap:2,padding:[4],width:"180px",children:[(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:t}),(0,ae.jsx)(oe.TextHuge,{strong:!0,children:r?"...":(0,ns.$t)(n)})]})},ms=()=>{const e=(0,v.ID)(),t=(0,Ae._0)(e),n=(0,Ae.R7)(e),r=Object.keys(n||{}).length;return(0,ae.jsx)(gs,{title:"Charts Visualised",value:r,loading:!t})},ps=()=>(0,ae.jsx)(oe.Flex,{column:!0,gap:4,children:(0,ae.jsx)(ms,{})}),fs=()=>{const e=(0,xs.PP)({extraKey:"runningAlerts"});return(0,ae.jsx)(gs,{title:"Running Alerts",value:e.length,loading:!1})},js=()=>(0,ae.jsx)(oe.Flex,{column:!0,gap:4,children:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(gs,{title:"Running Alerts",value:"...",loading:!0}),children:(0,ae.jsx)(fs,{})})}),bs=e=>{let{position:t}=e;return"left"===t?(0,ae.jsx)(ps,{}):(0,ae.jsx)(js,{})},vs=(0,dn.default)(oe.Flex).withConfig({displayName:"quickWins__Container",componentId:"sc-tnj55a-0"})(["max-width:800px;margin:0 auto;width:100%;"]),ys=(0,dn.default)(oe.Flex).withConfig({displayName:"quickWins__ChecklistItem",componentId:"sc-tnj55a-1"})(["background:",";padding:16px;cursor:pointer;border:1px solid ",";border-radius:4px;transition:border-color 0.2s,background 0.2s;&:hover{border-color:",";background:",";}"],(e=>{let{completed:t}=e;return(0,oe.getColor)(t?"mainBackground":"panelBg")}),(0,oe.getColor)("border"),(0,oe.getColor)("primary"),(0,oe.getColor)("mainBackground")),ws=(0,dn.default)(oe.Flex).withConfig({displayName:"quickWins__CheckIcon",componentId:"sc-tnj55a-2"})(["width:24px;height:24px;border-radius:50%;border:2px solid ",";background:",";align-items:center;justify-content:center;flex-shrink:0;"],(e=>{let{completed:t}=e;return(0,oe.getColor)(t?"success":"borderSecondary")}),(e=>{let{completed:t}=e;return t?(0,oe.getColor)("success"):"transparent"})),Cs=[{id:"explore-metrics",title:"Explore your infrastructure metrics",description:"View real-time performance charts across CPU, memory, network, and storage",route:"overview"},{id:"review-alerts",title:"Review your auto-configured alerts",description:"alerts are already monitoring your system. Review and customize them to fit your needs",route:"alerts",dynamicDescription:!0},{id:"connect-nodes",title:"See your entire system in one place",description:"Connect additional nodes for complete infrastructure visibility",route:"integrate-anything"},{id:"invite-team",title:"Invite a team member",description:"Need help setting up nodes? Invite a colleague to collaborate on your infrastructure",route:"settings/users",isSpaceRoute:!0}],Is=e=>{let{item:t,completed:n,onClick:r,children:o}=e;return(0,ae.jsxs)(ys,{completed:n,gap:3,alignItems:"flex-start",onClick:r,children:[(0,ae.jsx)(ws,{completed:n,children:n&&(0,ae.jsx)(oe.Icon,{name:"checkmark_s",color:"mainBackgroundDisabled",size:"small"})}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.Text,{strong:!0,children:t.title}),(0,ae.jsx)(oe.TextSmall,{color:"textLite",children:o})]})]})},ks=e=>{let{description:t}=e;return`${(0,xs.PP)({extraKey:"runningAlerts"}).length} ${t}`},As=()=>{const e=(0,f.Zp)(),t=(0,b.bq)(),n=(0,v.QW)(),{quickWins:o,markQuickWinCompleted:i}=Qi(),s=(0,r.useMemo)((()=>Cs.filter((e=>o[e.id])).length),[o]),a=(0,r.useCallback)((r=>{i(r.id);const o=r.isSpaceRoute?`/spaces/${t}`:`/spaces/${t}/rooms/${n}`;e(`${o}/${r.route}`)}),[e,t,n,i]);return(0,ae.jsxs)(vs,{column:!0,gap:4,padding:[8,0,0,0],children:[(0,ae.jsx)(oe.Text,{color:"textLite",children:"Quick wins to boost your monitoring:"}),(0,ae.jsx)(oe.Flex,{column:!0,gap:2,children:Cs.map((e=>(0,ae.jsx)(Is,{item:e,completed:o[e.id],onClick:()=>a(e),children:e.dynamicDescription?(0,ae.jsx)(r.Suspense,{fallback:e.description,children:(0,ae.jsx)(ks,{description:e.description})}):e.description},e.id)))}),(0,ae.jsxs)(oe.Flex,{justifyContent:"center",children:[(0,ae.jsxs)(oe.Text,{color:"success",children:[s," of ",Cs.length]}),(0,ae.jsx)(oe.Text,{color:"textLite",children:"\xa0completed"})]})]})},Ss=()=>((0,Oi.A)(),zi(),(0,Ki.A)(),Wi(),Gi(),null),Ts=e=>{let{nodeId:t}=e;return(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Ss,{}),(0,ae.jsx)(ts,{}),(0,ae.jsxs)(_.A,{gap:4,padding:[4],overflow:"auto",children:[(0,ae.jsxs)(oe.Flex,{gap:4,justifyContent:"center",alignItems:"center",children:[(0,ae.jsx)(bs,{position:"left"}),(0,ae.jsx)(ls,{nodeId:t}),(0,ae.jsx)(bs,{position:"right"})]}),(0,ae.jsx)(As,{})]})]})},Fs=e=>function(){let{title:t="",headerInfo:n,containerProps:r={},TitleComponent:o=oe.TextBigger,...i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ae.jsxs)(oe.Flex,{column:!0,gap:2,alignItems:"center",justifyContent:"center",...r,children:[t&&(0,ae.jsxs)(oe.Flex,{gap:2,alignItems:"center",children:[(0,ae.jsx)(o,{children:t}),n]}),(0,ae.jsx)(e,{...i})]})},Ns=Fs((e=>{let{number:t=0,NumberComponent:n=oe.TextHuge}=e;return(0,ae.jsx)(n,{strong:!0,children:t})})),Ms=e=>{const t=e.reduce(((e,t)=>{let{value:n}=t;return e+n}),0);return e.map((e=>({...e,width:`${Math.floor(e.value/t*100)}%`})))},Ls=function(){let{data:e=[],testId:t="",numberIndicatorProps:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,children:[(0,ae.jsx)(oe.Flex,{justifyContent:"around",children:e.map((e=>{let{label:t,value:r}=e;return(0,ae.jsx)(Ns,{title:t,number:r,...n},`${t}-${r}`)}))}),(0,ae.jsx)(oe.ProgressBar,{background:"borderSecondary",border:"none",containerWidth:"100%","data-testid":t,height:2,value:Ms(e.filter((e=>{let{omit:t}=e;return!t})))})]})},$s=Fs((e=>{let{nodesLoaded:t,total:n,count:o,live:i,offline:s,stale:a,unseen:l,...c}=e;const d=(0,r.useMemo)((()=>[...[{label:"Live",value:i,color:"success"},{label:"Offline",value:s,color:"offline"},{label:"Stale",value:a,color:"stale"}],...l?[{label:"Unseen",value:l,color:"unseen"}]:[]]),[i,s,a,l]);return(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,alignItems:"center",gap:4,children:[(0,ae.jsxs)(oe.Flex,{gap:2,alignItems:"baseline",children:[t?(0,ae.jsx)(oe.TextHuge,{strong:!0,...c,children:o}):(0,ae.jsx)(oe.Text,{children:"Loading..."}),t&&n!==o&&(0,ae.jsxs)(oe.Text,{children:["of ",n]})]}),(0,ae.jsx)(Ls,{data:d,numberIndicatorProps:{TitleComponent:oe.TextBig,NumberComponent:oe.TextBigger}})]})})),Ds=e=>{const t=(0,B.nj)(),n=(0,B.CK)(),o=n.length,i=(0,H.eO)({keepAll:!1}),s=(0,r.useMemo)((()=>i.reduce(((e,t)=>{let{isLive:n,isOffline:r,isUnseen:o,state:i}=t;return{live:n?e.live+1:e.live,offline:r?e.offline+1:e.offline,stale:"stale"===i?e.stale+1:e.stale,unseen:o?e.unseen+1:e.unseen}}),{live:0,offline:0,stale:0,unseen:0})),[i]),a=(0,r.useMemo)((()=>{const e=i?.length||"-";return{nodesLoaded:t,total:o,count:e,title:t&&i&&o!==e?"Selected nodes":"Total nodes",...s}}),[t,n,i,o,s]);return(0,ae.jsx)($s,{...a,...e})};var Bs=n(9708);const Rs=(0,dn.default)(oe.TextSmall).withConfig({displayName:"pieChartLabels__StyledText",componentId:"sc-3919ls-0"})(["display:flex;align-items:center;cursor:",";&:hover{opacity:",";}"],(e=>{let{onClick:t}=e;return t?"pointer":"auto"}),(e=>{let{onClick:t}=e;return t?"0.7":"1"})),Ps=(0,r.memo)((e=>{let{title:t,value:n,color:r,onClick:o=null}=e;return(0,ae.jsxs)(oe.Flex,{alignItems:"center",justifyContent:"between",width:"100%",gap:4,flex:{grow:1,shrink:0},children:[(0,ae.jsxs)(oe.Flex,{gap:1,children:[(0,ae.jsx)(oe.Flex,{width:"4px",height:"16px",background:r}),(0,ae.jsxs)(Rs,{whiteSpace:"nowrap",onClick:o,children:[t,o&&(0,ae.jsx)(oe.Icon,{color:"textLite",margin:[0,0,0,1],name:"nav_arrow_goto",height:"10px",width:"10px"})]})]}),(0,ae.jsx)(oe.Text,{strong:!0,children:n??"-"})]})})),Vs=e=>{let{data:t}=e;return(0,ae.jsx)(oe.Flex,{column:!0,alignItems:"start",justifyContent:"center",gap:5,children:t.map(((e,t)=>{let{title:n,value:r,color:o,onClick:i}=e;return(0,ae.jsx)(Ps,{title:n,value:r,color:o,onClick:i},`${n}-${r}-${t}`)}))})},_s=e=>{let{data:t,theme:n}=e;return t.map((e=>({...e,color:(0,oe.getColor)(e.color)({theme:n})})))},Os=e=>{let{chartData:t=[],lineWidth:n=15,animate:o=!0,label:i,hasData:s}=e;const a=(0,r.useContext)(dn.ThemeContext);return(0,ae.jsxs)(oe.Flex,{gap:4,margin:[0,4],height:{min:"70px",max:"130px"},alignItems:"center",children:[(0,ae.jsx)(oe.Flex,{height:"70px",flex:{grow:1,shrink:1},children:s?(0,ae.jsx)(Bs.r,{label:()=>i,labelStyle:{fontSize:"34px",fontWeight:700,lineHeight:"38px",fill:(0,oe.getColor)("textDescription")({theme:a})},labelPosition:0,data:_s({data:t,theme:a}),lineWidth:n,animate:o}):(0,ae.jsx)(oe.Icon,{color:"border",name:"pie_chart_skeleton",width:"70px",height:"70px",alignSelf:"center"})}),(0,ae.jsx)(Vs,{data:t})]})},Es=Fs((e=>(0,ae.jsx)(oe.Flex,{gap:2,justifyContent:"between",padding:[2,0,0,0],children:(0,ae.jsx)(Os,{...e})}))),Hs=e=>{const t=(0,xs.QD)({extraKey:"alerts"}),{critical:n,warning:o}=(t||[]).reduce(((e,t)=>{let{status:n}=t;return{...e,[n]:e[n]+1}}),{critical:0,warning:0}),i=(0,ii.x7)(),s=(0,r.useMemo)((()=>({chartData:[{title:"Critical",value:n,color:"errorText",onClick:()=>i("critical")},{title:"Warning",value:o,color:"warningText",onClick:()=>i("warning")}],hasData:!!t?.length,label:t?.length})),[n,o,i]);return(0,ae.jsx)(Es,{title:"Active alerts",...s,...e})},zs=()=>(0,ae.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-left-section",column:!0,gap:4,basis:"205px",children:[(0,ae.jsx)(Ds,{}),(0,ae.jsx)(lr.A,{}),(0,ae.jsx)(Hs,{})]});var Ks=n(63950),Ws=n.n(Ks),Gs=n(31522);const qs=e=>{let{label:t,color:n}=e;return(0,ae.jsxs)(oe.Flex,{height:"24px",gap:1,alignItems:"center",children:[(0,ae.jsx)(oe.Flex,{width:"12px",height:"12px",background:n}),(0,ae.jsx)(oe.Text,{children:(0,Ci.Zr)(t)})]})},Us=e=>{let{colorBy:t}=e;const n=Object.entries(Gs.Cc[t?.value]||{}),r=Gs.Ug[t?.value]||{};return n.length?(0,ae.jsx)(oe.Flex,{"data-testid":"home-nodes-overview-main-section-header-colors-legend",gap:2,children:n.map((e=>{let[t,n]=e;return(0,ae.jsx)(qs,{label:r[t]||t,color:n},t)}))}):null},Js=(0,Bt.A)(oe.Icon),Ys=e=>{let{nodes:t=[],groupBy:n,setGroupBy:o=Ws(),colorBy:i,setColorBy:s=Ws(),onAddNode:a}=e;const l=(0,r.useMemo)((()=>function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>{const{labels:n}=t||{};return Object.entries(n||{}).forEach((t=>{let[n,r]=t;e[n]?e[n]=Array.from(new Set([...e[n],r])):e[n]=[r]})),e}),{})}(t)),[t]),c=(0,r.useMemo)((()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).map((e=>({label:`label:${e}`,value:`label:${e}`})))}(l).sort(((e,t)=>e.value.localeCompare(t.value,void 0,{sensitivity:"accent",ignorePunctuation:!0})))),[l]),d=(0,r.useMemo)((()=>[...Gs.XJ,...c]),[c]);return(0,ae.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-main-section-header",alignItems:"end",justifyContent:"between",children:[(0,ae.jsxs)(oe.Flex,{gap:3,alignItems:"end",children:[(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",gap:1,children:[(0,ae.jsx)(oe.Text,{color:"menuItem",children:"Group by"}),(0,ae.jsx)(Js,{name:"information",color:"menuItem",tooltip:{title:"Group nodes",description:"Group nodes by attributes like status, OS, or custom host labels. You can select multiple for multi-level grouping."},tooltipProps:{align:"bottom"},noWrapper:!0})]}),(0,ae.jsx)(oe.Select,{isMulti:!0,options:d,value:n,onChange:o,...c?.length>0?{styles:{minWidth:"250px"}}:{}})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.Text,{color:"menuItem",children:"Color by"}),(0,ae.jsx)(oe.Select,{options:Gs.Hn,value:i,onChange:s})]}),(0,ae.jsx)(Us,{colorBy:i})]}),(0,ae.jsx)(je.A,{flavour:"borderless",icon:"add_node",iconColor:"text",onClick:a})]})},Zs=(0,dn.default)(oe.Box).withConfig({displayName:"styled__PolygonContainer",componentId:"sc-9bx1cv-0"})(["width:22px;position:relative;aspect-ratio:1;background-color:",";cursor:",";opacity:",";clip-path:polygon( 93.56% 74.55%,50.52% 100%,6.96% 75.45%,6.44% 25.45%,49.48% 0%,93.04% 24.55%,93.56% 74.55% );"],(e=>{let{background:t}=e;return(0,oe.getColor)(t||"offline")}),(e=>{let{onClick:t}=e;return t?"pointer":"default"}),(e=>{let{isDisabled:t}=e;return t?"0.5":"1"})),Qs=(0,dn.default)(oe.Box).withConfig({displayName:"styled__PolygonInner",componentId:"sc-9bx1cv-1"})(["width:18px;position:absolute;top:2px;left:2px;aspect-ratio:1;background-color:",";opacity:",";clip-path:polygon( 93.56% 74.55%,50.52% 100%,6.96% 75.45%,6.44% 25.45%,49.48% 0%,93.04% 24.55%,93.56% 74.55% );"],(e=>{let{background:t}=e;return(0,oe.getColor)(t||"offline")}),(e=>{let{isDisabled:t}=e;return t?"0.5":"1"})),Xs=(0,dn.default)(oe.Icon).withConfig({displayName:"styled__AddNodeIcon",componentId:"sc-9bx1cv-2"})(["position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);"]),ea=(0,dn.default)(oe.Box).withConfig({displayName:"styled__Groups",componentId:"sc-9bx1cv-3"})(["width:100%;display:grid;grid-template-columns:repeat(2,1fr);gap:16px;"]),ta=(0,dn.default)(oe.Flex).withConfig({displayName:"styled__NodeContainer",componentId:"sc-9bx1cv-4"})(["opacity:",";"],(e=>{let{isActive:t}=e;return t?"1":".3"})),na=(0,Bt.A)((e=>{let{children:t,innerProps:n={},containerProps:r={},...o}=e;return(0,ae.jsx)(ta,{margin:[0,0,.5,0],...o,children:(0,ae.jsx)(Zs,{...r,children:(0,ae.jsx)(Qs,{...n,children:t})})})})),ra=e=>{let{type:t,onClick:n}=e;const o=(0,v.XA)(),i=(0,b.dg)(),s=(0,g.JT)("node:Create"),a=(0,r.useMemo)((()=>({background:"success",isDisabled:!s,...s?{onClick:()=>n({type:t})}:{}})),[s]),l=s?"Add node":i?"You are viewing your local node, connect to cloud and connect multiple nodes to view at once":`Only admin users can add nodes to ${o.name}`;return(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(na,{containerProps:a,innerProps:{background:"panelBg"},tooltip:l,isActive:!0,children:(0,ae.jsx)(Xs,{name:"plus",color:"success"})})})},oa=na;var ia=n(89284),sa=n(91100);const aa=e=>{let{architecture:t,cpuFrequency:n,cpus:r,diskSpace:o,memory:i,os:s,osName:a}=e;const l=[(0,it.O)(n),(0,it.ws)(r,1===r?"Core":"Cores"),(0,it.ws)(t),(0,it.ws)((0,it.RI)(i),"RAM"),(0,it.ws)((0,it.RI)(o),"HD")];return(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsxs)(oe.Flex,{gap:1,children:[(0,ae.jsx)(oe.Icon,{"data-testid":"node-system-info-icon",name:et.u[a]?.iconName||et.U[s]?.iconName||"os",width:"16px",height:"16px",color:"text"}),(0,ae.jsx)(oe.Flex,{children:(0,it.ws)(a)})]}),l.map(((e,t)=>(0,ae.jsxs)(oe.Text,{children:["\u2022 ",e]},t)))]})};var la=n(23208);const ca=e=>{let{isStable:t}=e;const n=t?{icon:"checkmark_s",color:"primary",borderColor:"primary"}:{icon:"warning_triangle",color:"stale",borderColor:"stale"};return(0,ae.jsx)(oe.Pill,{hollow:!0,...n,children:t?"Stable":"Unstable"})},da=function(){let{id:e,name:t,state:n,hw:o,os:i,isStable:s,setActiveNodes:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=(0,Hi.c8)(),{nodes:c}=l||{},d=c?.[e];return(0,r.useEffect)((()=>{if("function"===typeof a){const{children:t,parents:n}=d||{},r=d?[...[...n,...t].map((e=>{let{id:t}=e;return t}))||[],e]:[e];a({isHover:!0,nodes:r})}return()=>{"function"===typeof a&&a(Gs.vd)}}),[e,d]),(0,ae.jsxs)(oe.Flex,{column:!0,gap:3,width:{min:40},background:"mainBackground",padding:[2,4],children:[(0,ae.jsx)(oe.TextBig,{strong:!0,children:t}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.Text,{children:"Status"}),(0,ae.jsx)(oe.Flex,{children:(0,ae.jsx)(ia.A,{state:n})})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.Text,{children:"Connection"}),(0,ae.jsx)(oe.Flex,{children:(0,ae.jsx)(ca,{isStable:s})})]}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,children:[(0,ae.jsx)(oe.Text,{children:"Alerts"}),(0,ae.jsx)(sa.A,{id:e})]}),(0,ae.jsx)(lr.A,{color:"textLite"}),(0,ae.jsx)(aa,{architecture:o.architecture,cpuFrequency:o.cpuFrequency,cpus:o.cpus,"data-testid":"nodeRow-system-info",diskSpace:o.diskSpace,memory:o.memory,name:t,osName:i.nm,os:i.id}),(0,ae.jsx)(lr.A,{color:"textLite"}),(0,ae.jsx)(la.A,{id:e})]})},ua=function(){let{colorBy:e={},node:t={},isStable:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{value:o}=e,i=Gs.AZ[o],s=(0,er.Xt)(t.id),{critical:a,warning:l}=(0,qo.AO)(s),c=Gs.Cc[o];let d=c[i?.(t)?.group?.toLowerCase()];if(o==Gs.w9.stability.value){d=c[n?"stable":"unstable"]}return{borderColor:(0,r.useMemo)((()=>(e=>{let{critical:t,warning:n}=e;return t?"error":n?"warning":null})({critical:a,warning:l})||d),[d,a,l]),background:d}},ha=e=>{let{colorBy:t,stability:n={},setActiveNodes:o,...i}=e;const{isStable:s}=n[i.id]||{},{borderColor:a,background:l}=ua({colorBy:t,node:i,isStable:s}),[,c]=(0,Hi.A$)(),d=(0,r.useCallback)((()=>c(i.id)),[i.id,c]);return(0,ae.jsx)(oa,{containerProps:{background:a,onClick:d},innerProps:{background:l},tooltip:(0,ae.jsx)(da,{isStable:s,setActiveNodes:o,...i}),...i})};var xa=n(67462);const ga=e=>t=>{let{title:n,...o}=t;const i=(0,r.useMemo)((()=>"nolabel"===n?`${o.groupBy} (No value)`:`${o.groupBy}=${n}`),[n,o.groupBy]);return n?(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,children:[(0,ae.jsxs)(oe.Flex,{justifyContent:"between",border:{side:"bottom",color:"border"},children:[(0,ae.jsx)(oe.Text,{strong:!0,color:"menuItem",children:i}),o.nodes?.length?(0,ae.jsx)(oe.Text,{color:"menuItem",children:`${o.nodes.length} ${(0,xa.su)(o.nodes.length)}`}):null]}),(0,ae.jsx)(e,{...o})]}):(0,ae.jsx)(e,{...o})},ma=(0,r.memo)((e=>{let{nodes:t=[],type:n,stability:o={},groupBy:i,colorBy:s,onAddNode:a,...l}=e;const[c,d]=(0,r.useState)(Gs.vd),{isHover:u,nodes:h}=c,x=i?.canAddNodes;return(0,ae.jsxs)(oe.Flex,{flexWrap:!0,...l,children:[t.map((e=>(0,ae.jsx)(ha,{colorBy:s,stability:o,isActive:!u||h.includes(e.id),setActiveNodes:d,...e},e.id))),x?(0,ae.jsx)(ra,{type:n,onClick:a}):null]})})),pa=ga((e=>t=>{const{stability:n}=(0,Hi.SW)();return(0,ae.jsx)(e,{stability:n,...t})})(ma)),fa=e=>t=>{const n=Gs.AZ[e],r=(0,Gs.Hl)(e);return t.reduce(((e,t)=>{const{group:o="unknown",type:i}=n(t);return e[o]?e[o].nodes=[...e[o].nodes,t]:e[o]={title:r(o)||"unknown",type:i,nodes:[t]},e}),{})},ja={os:fa("os"),version:fa("version"),status:fa("status"),technology:fa("technology"),replication:fa("replication"),cloudProvider:fa("cloudProvider"),cloudRegion:fa("cloudRegion"),instanceType:fa("instanceType"),none:e=>({none:{nodes:e}})},ba=e=>{let{value:t,nodes:n}=e;return t.startsWith("label:")?(r=t.replace(/^label:/,""),e=>{const t=function(){let e=arguments.length>1?arguments[1]:void 0;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((t,n)=>{const{labels:r}=n||{},o=r[e]||"nolabel";return o&&(t[o]?t[o]=[...t[o],n]:t[o]=[n]),t}),{})}(e,r);return Object.entries(t).reduce(((e,t)=>{let[n,r]=t;return{...e,[n]:{title:n,nodes:r}}}),{})})?.(n):ja[t]?.(n);var r},va=()=>(0,ae.jsx)(oe.Flex,{children:(0,ae.jsx)(oe.TextBig,{color:"menuItem",children:"No nodes found"})}),ya=e=>{let{nodes:t,groupBy:n,title:o,groupByValue:i,children:s}=e;const{value:a}=Array.isArray(n)&&n.length>0?n[0]:Gs.nv,l=ba({value:a,nodes:t}),c=(0,r.useMemo)((()=>Object.keys(l).length),[l]);return(0,ae.jsxs)(oe.Flex,{"data-testid":`nodes-group-${i}-${o}`,column:!0,gap:2,padding:[2,4],round:2,border:{side:"all",color:"border"},children:[(0,ae.jsxs)(oe.Flex,{alignItems:"center",justifyContent:"between",children:[(0,ae.jsxs)(oe.Text,{strong:!0,color:"menuItem",children:[i,": ",o]}),c>1?(0,ae.jsxs)(oe.Text,{color:"menuItem",children:[t.length," ",(0,xa.su)(t.length)]}):null]}),s]},o)},wa=e=>{let{nodes:t,groupBy:n,colorBy:o,onAddNode:i}=e;const{value:s}=Array.isArray(n)&&n.length>0?n[0]:Gs.nv,a=ba({value:s,nodes:t}),l=(0,r.useMemo)((()=>Object.values(a)),[a]);if(!a)return(0,ae.jsx)(va,{});if(!l.length)return(0,ae.jsx)(va,{});if(n?.value===Gs.nv.value){const{nodes:e}=l[0];return(0,ae.jsx)(pa,{nodes:e,groupBy:n,colorBy:o,onAddNode:i})}if(n.length>1)return(0,ae.jsx)(oe.Flex,{column:!0,gap:4,children:l.map((e=>{let{title:t,nodes:r}=e;return(0,ae.jsx)(ya,{groupBy:n.slice(1),nodes:r,title:t,groupByValue:s,children:(0,ae.jsx)(wa,{nodes:r,groupBy:n.slice(1),colorBy:o,onAddNode:i})},t)}))});const c=1===l.length||n.length>1?oe.Flex:ea;return(0,ae.jsx)(c,{children:l.map(((e,t)=>{let{title:n,type:r,nodes:a}=e;return(0,ae.jsx)(pa,{title:n,type:r,nodes:a,groupBy:s,colorBy:o,onAddNode:i,margin:[0,0,2,0]},n||t)}))})},Ca=wa,Ia=()=>(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ae.jsxs)(oe.Flex,{gap:2,children:[(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2})]}),(0,ae.jsxs)(oe.Flex,{gap:2,children:[(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2}),(0,ae.jsx)(un.A,{width:"22px",height:"22px",round:2})]})]}),ka=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)(Gs.jZ),[i,s]=(0,r.useState)(),a=(0,v.ID)(),l=(0,B.gr)(a,"loaded"),c=(0,H.eO)({keepAll:!1}),d=(0,r.useCallback)((e=>{s(e)}),[s]),u=(0,r.useCallback)((()=>s()),[s]);return(0,ae.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-main-section",column:!0,gap:4,basis:"calc(100% - 410px)",children:[(0,ae.jsx)(Ys,{nodes:c,groupBy:e,setGroupBy:t,colorBy:n,setColorBy:o,onAddNode:d}),(0,ae.jsx)(oe.Flex,{height:{max:150},overflow:{vertical:"auto"},children:l?(0,ae.jsx)(Ca,{nodes:c,groupBy:e,colorBy:n,onAddNode:d}):(0,ae.jsx)(Ia,{})}),i&&(0,ae.jsx)(be.A,{nodeType:i?.type,onClose:u})]})},Aa=()=>(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ae.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ae.jsx)(un.A,{width:"30%"}),(0,ae.jsx)(un.A,{width:"30%"}),(0,ae.jsx)(un.A,{width:"30%"})]}),(0,ae.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ae.jsx)(un.A,{width:"30%"}),(0,ae.jsx)(un.A,{width:"30%"}),(0,ae.jsx)(un.A,{width:"30%"})]}),(0,ae.jsx)(un.A,{})]}),Sa=()=>{const{loaded:e,totalChildren:t,totalParents:n,totalStandalone:o}=(0,Hi.c8)(),i=(0,r.useMemo)((()=>[{label:"Parents",value:n,color:["blue","indigo"]},{label:"Children",value:t,color:["purple","lilac"]},{label:"Standalone",value:o,color:["yellow","yellow120"]}]),[t,n]);return e?(0,ae.jsx)(Ls,{numberIndicatorProps:{TitleComponent:oe.Text},data:i}):(0,ae.jsx)(Aa,{height:"58px"})},Ta=()=>(0,ae.jsxs)(oe.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,ae.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ae.jsx)(un.A,{width:"30%"}),(0,ae.jsx)(un.A,{width:"30%"}),(0,ae.jsx)(un.A,{width:"30%"})]}),(0,ae.jsxs)(oe.Flex,{justifyContent:"between",children:[(0,ae.jsx)(un.A,{width:"30%"}),(0,ae.jsx)(un.A,{width:"30%"}),(0,ae.jsx)(un.A,{width:"30%"})]}),(0,ae.jsx)(un.A,{})]}),Fa=()=>(0,ae.jsxs)(oe.Flex,{column:!0,gap:1,alignItems:"center",width:"220px","data-testid":"nodesByDataReplication-information-text",overflow:"hidden",children:[(0,ae.jsxs)(oe.TextMicro,{children:[(0,ae.jsx)(oe.TextMicro,{strong:!0,children:"None:"})," The node's data are only on the node itself. Lose the node, lose the data!"]}),(0,ae.jsxs)(oe.TextMicro,{children:[(0,ae.jsx)(oe.TextMicro,{strong:!0,children:"Single:"})," The node's metrics are replicated to one parent. The parent can trigger alerts for the child."]}),(0,ae.jsxs)(oe.TextMicro,{children:[(0,ae.jsx)(oe.TextMicro,{strong:!0,children:"Multi:"})," Same as dual replication, but with the metrics replicated to more than one parent. Each parent in the hierarchy can trigger alerts for its children."]}),(0,ae.jsx)(oe.TextMicro,{margin:[2,0],children:"Aim to have most of your nodes with at least a dual replication and your critical ones with a multiple one."})]}),Na=()=>(0,ae.jsx)(Oe.A,{isBasic:!0,plain:!0,content:Fa,align:"bottom",children:(0,ae.jsx)(oe.Icon,{name:"information",color:"textDescription",size:"small"})}),Ma=Fs((()=>{const e=(0,Hi.c8)(),{loaded:t,replicationFactor:n}=e||{},o=(0,r.useMemo)((()=>[{label:"None",value:n?.r_1||0,color:Gs.q5.r_1},{label:"Single",value:n?.r_2||0,color:Gs.q5.r_2},{label:"Multi",value:n?.["r_*"]||0,color:Gs.q5["r_*"]}]),[n]);return t?(0,ae.jsx)(Ls,{data:o}):(0,ae.jsx)(Ta,{})})),La=()=>(0,ae.jsx)(Ma,{title:"Data Replication",headerInfo:(0,ae.jsx)(Na,{})}),$a=()=>(0,ae.jsxs)(oe.Flex,{"data-testid":"home-nodes-overview-right-section",column:!0,gap:4,basis:"205px",children:[(0,ae.jsx)(Sa,{}),(0,ae.jsx)(lr.A,{}),(0,ae.jsx)(La,{})]}),Da=()=>(0,ae.jsxs)(hs,{children:[(0,ae.jsx)(zs,{}),(0,ae.jsx)(lr.A,{vertical:!0}),(0,ae.jsx)(ka,{}),(0,ae.jsx)(lr.A,{vertical:!0}),(0,ae.jsx)($a,{})]});var Ba=n(66118),Ra=n(44731);Ba.t1.register(Ba.PP,Ba.kc,Ba.A6,Ba.E8,Ba.m_,Ba.s$);const Pa={borderWidth:0,maxBarThickness:15,minBarLength:0},Va=function(){let{alertsStats:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.useContext)(dn.ThemeContext),{hosts:n}=e?.nodes||{},o={animation:!1,maintainAspectRatio:!1,plugins:{legend:{display:!1}},responsive:!0,scales:{x:{stacked:!0,grid:{color:(0,oe.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxHeight=50},ticks:{precision:0,callback:(e,t)=>{let n=i.labels[t];if(!n)return;let r=0;for(;n?.length>20;)n=(0,Ci.P3)(n,r),r+=1;return n}}},y:{stacked:!0,grid:{color:(0,oe.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxWidth=50}}}},i=(0,r.useMemo)((()=>{if(!n)return{datasets:[],labels:[]};const[e,t]=Object.entries(n).sort(((e,t)=>t[1].total-e[1].total)).reduce(((e,t)=>{let[n,{critical:r,warning:o}]=t;return e[0].push(n),e[1].critical?e[1].critical=[...e[1].critical,r]:e[1].critical=[r],e[1].warning?e[1].warning=[...e[1].warning,o]:e[1].warning=[o],e}),[[],{}]);return{datasets:Object.entries(t).map((e=>{let[t,n]=e;return{...Pa,backgroundColor:"critical"===t?"#DB162F":"#FF9700",data:n,label:t}})),labels:e}}),[n]);return i.datasets?(0,ae.jsx)(oe.Flex,{width:"100%",height:40,children:(0,ae.jsx)(Ra.yP,{data:i,options:o})}):null},_a=e=>{let{alertsStats:t}=e;const{nodes:n}=t||{},{critical:o,warning:i,total:s}=n||{},a=(0,r.useMemo)((()=>[{label:"Warning",value:i,color:["yellow","yellow80"]},{label:"Critical",value:o,color:["red","red100"]},{label:"Total",value:s,color:["purple","lilacFocus"],omit:!0}]),[o,i,s]);return n?(0,ae.jsx)(Ls,{data:a}):null},Oa=[{id:"name",accessorKey:"name",header:"Alert name",fullWidth:!0,cell:e=>{let{getValue:t,row:n}=e;const o=t(),{goToAlerts:i}=Ni(),s=(0,r.useCallback)((e=>{e.preventDefault(),i({name:o,instance:n?.original?.chart})}),[i]);return(0,ae.jsx)(Oe.A,{content:"Go to events tab. Timeframe will be set to the last 24 hours.",isBasic:!0,children:(0,ae.jsx)(oe.Box,{children:(0,ae.jsx)(ge.A,{onClick:s,children:o})})})}},{id:"chart",name:"chart",fullWidth:!0,header:"Instance"},{id:"occurrences",name:"occurrences",header:"Occurrences"},{id:"duration",name:"duration",header:"Duration (seconds)"}],Ea=function(){let{data:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.length?(0,ae.jsx)(oe.Flex,{height:{max:50},overflow:{vertical:"auto"},children:(0,ae.jsx)(oe.Table,{data:e,dataColumns:Oa,sortBy:[{id:"occurrences",desc:!0}],enableResizing:!0})}):null},Ha={title:"Nodes with the most alerts in the last 24h"},za=e=>{const t=(0,Hi.jg)();return t.loaded?(0,ae.jsxs)(hs,{"data-testid":"home-alert-nodes",titleProps:Ha,...e,children:[(0,ae.jsx)(Va,{alertsStats:t}),(0,ae.jsx)(_a,{alertsStats:t}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:4,children:[(0,ae.jsx)(oe.TextBig,{children:"Top alerts in the last 24 h"}),(0,ae.jsx)(Ea,{data:t?.alerts})]})]}):(0,ae.jsx)(d.nl,{})},Ka={title:"Metrics available",justifyContent:"center"},Wa=e=>{const{loaded:t,metricsCollected:n=0,error:r}=(0,Hi.P9)();return t?(0,ae.jsx)(hs,{"data-testid":"home-metrics",titleProps:Ka,error:r?.response?.data,...e,children:(0,ae.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ae.jsx)(oe.TextHuge,{strong:!0,children:(0,ns.$t)(n)})})}):(0,ae.jsx)(d.Tr,{title:"Metrics available",...e})},Ga={title:"Charts visualized",justifyContent:"center"},qa=e=>{const t=(0,v.ID)(),n=(0,Ae._0)(t),r=(0,Ae.rx)(t),o=(0,Ae.R7)(t),i=Object.keys(o||{}).length;return n||r?(0,ae.jsx)(hs,{"data-testid":"home-charts-data",titleProps:Ga,error:r,...e,children:(0,ae.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ae.jsx)(oe.TextHuge,{strong:!0,children:(0,ns.$t)(i)})})}):(0,ae.jsx)(d.Tr,{...e})},Ua={title:"Alerts configured",justifyContent:"center"},Ja=e=>{const{loaded:t,value:n}=(0,qo.oU)();return t?(0,ae.jsx)(hs,{"data-testid":"home-alerts-data",titleProps:Ua,...e,children:(0,ae.jsx)(oe.Flex,{width:"100%",justifyContent:"center",children:(0,ae.jsx)(oe.TextHuge,{strong:!0,children:(0,ns.$t)(n?.length||0)})})}):(0,ae.jsx)(d.Tr,{...e})};Ba.t1.register(Ba.PP,Ba.kc,Ba.A6,Ba.E8,Ba.m_,Ba.s$);const Ya=function(){let{dataRetention:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.useContext)(dn.ThemeContext),n={animation:!1,maintainAspectRatio:!1,plugins:{legend:{display:!1}},responsive:!0,scales:{x:{stacked:!0,grid:{color:(0,oe.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxHeight=50},ticks:{precision:0,callback:(e,t)=>{let n=o.labels[t];if(!n)return;let r=0;for(;n?.length>20;)n=(0,Ci.P3)(n,r),r+=1;return n}}},y:{stacked:!0,grid:{color:(0,oe.getColor)("borderSecondary")({theme:t})},afterSetDimensions:e=>{e.maxWidth=50}}}},o=(0,r.useMemo)((()=>{if(!e?.length)return{datasets:[],labels:[]};const{values:t,labels:n}=e.reduce(((e,t)=>{let{label:n,value:r}=t;return e.labels.push(n),e.values.push(r),e}),{values:[],labels:[]});return{datasets:[{borderWidth:0,maxBarThickness:10,backgroundColor:"#0A81AB",minBarLength:0,data:t,label:"Nodes"}],labels:n}}),[e]);return o.datasets?(0,ae.jsx)(oe.Flex,{width:"100%",height:"100%",children:(0,ae.jsx)(Ra.yP,{data:o,options:n})}):null},Za={title:"Data retention per Nodes"},Qa=e=>{const{dataRetention:t}=(0,Hi.P9)();return(0,ae.jsx)(hs,{"data-testid":"home-data-retention",titleProps:Za,...e,children:(0,ae.jsx)(Ya,{dataRetention:t})})},Xa=()=>((0,Oi.A)(),zi(),(0,Ki.A)(),Wi(),Gi(),null),el=()=>{const e=(0,B.CK)();return(0,B.nj)()?e.length?1===e.length?(0,ae.jsx)(P.Ay,{feature:"Home",mode:"SingleNodeHome",children:(0,ae.jsx)(Ts,{nodeId:e[0]})}):(0,ae.jsxs)(P.Ay,{feature:"Home",children:[(0,ae.jsx)(Xa,{}),(0,ae.jsxs)(_.A,{gap:4,padding:[4],overflow:"auto",children:[(0,ae.jsx)(Da,{}),(0,ae.jsxs)(oe.Flex,{gap:4,children:[(0,ae.jsx)(za,{width:"60%"}),(0,ae.jsxs)(oe.Flex,{column:!0,gap:4,height:"100%",width:"calc(40% - 16px)",children:[(0,ae.jsxs)(oe.Flex,{gap:4,children:[(0,ae.jsx)(Wa,{flex:{grow:"1",shrink:"0"}}),(0,ae.jsx)(qa,{flex:{grow:"1",shrink:"0"}}),(0,ae.jsx)(Ja,{flex:{grow:"1",shrink:"0"}})]}),(0,ae.jsx)(Qa,{flex:"grow"})]})]})]})]}):(0,ae.jsx)(P.Ay,{feature:"Home",mode:"NoNodesView",children:(0,ae.jsx)(R.A,{})}):(0,ae.jsx)(d.WV,{})};var tl=n(89711);var nl=n(84060),rl=n(31035),ol=n(2863),il=n(49916);var sl=n(46587);const al=()=>{const e=(0,b.vt)(),t=(0,E.nl)(),n=(0,o.ES)(e),r=(0,sl.uW)("isAnonymous"),{value:i}=(0,E.BQ)(t),s=i?.agents?.[0]||{},a="windows"==(s.application?.os?.kernel||"").toLowerCase();return{hasAccess:!(n&&r&&a),reason:"windowsAgent"}};var ll=n(14457),cl=n(93933),dl=n(81811),ul=n(15524);const hl=dn.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-1fhfk7c-0"})(["background:",";height:20px;width:1px;"],(0,oe.getColor)("border")),xl=e=>{let{flavour:t,...n}=e;const o=(0,E.nl)(),i=(0,er.Xt)(o),{critical:s,warning:a}=(0,qo.AO)(i),l=(0,K.Fw)("sidebarTab",{flavour:"val",extraKey:t}),c=(0,K.Fw)("sidebarOpen",{flavour:"bool"}),d=(0,r.useCallback)((e=>{c(!0),l(e)}),[c,l]),{id:u,hw:h={},cpus:x,isLive:g,name:m,os:p={},state:f,updateSeverity:j,labels:b,version:v,health:y,capabilities:w}=(0,E.xY)(o),{silencingState:C}=y?.alerts||{},I={dataTestId:"singleNode",isLive:g},k=(0,it.t3)({count:s,type:"critical",...I}),A=(0,it.t3)({count:a,type:"warning",...I}),S=(0,it.GM)(f),T=(0,it.Pg)(h.container,h.virtualization),F=(0,co.A)("(min-width: 1760px)"),N=(0,E.TC)();return(0,ae.jsxs)(oe.Flex,{alignItems:"center",background:"panelBg",border:{side:"all",color:"border"},"data-testid":"singleNode-badges-container",flex:!1,gap:1,padding:[1,2],round:1,...n,children:[(0,ae.jsx)(oe.TextSmall,{"data-testid":`singleNode-${m}`,strong:!0,children:m}),(0,ae.jsx)(ft.A,{badge:"info","data-testid":"singleNode-nodeInfo-cta",children:(0,ae.jsx)(oe.IconButton,{flavour:"borderless",cursor:"pointer",onClick:()=>{N(u),d("info")},icon:"information",iconColor:"nodeBadgeColor",width:"18px",height:"18px"})}),(0,ae.jsx)(hl,{"data-testid":"singleNode-separator"}),(0,ae.jsx)(ft.A,{badge:"alerts",nodeName:m,children:(0,ae.jsx)(oe.AlertMasterCard,{onClick:k.text||A.text?()=>N(u,{},"/alerts"):null,pillLeft:k,pillRight:A})}),(0,ae.jsx)(hl,{"data-testid":"singleNode-separator"}),(0,ae.jsx)(Xt,{node:{id:u,name:m,isLive:g,capabilities:w},padding:[0,1]}),j&&(0,ae.jsx)(Vt.A,{"data-testid":"singleNode-update-cta",name:m,os:p.id,container:h.container,warningLevel:j,labels:b,version:v,text:j}),(0,ae.jsx)(hl,{"data-testid":"singleNode-separator"}),(0,ae.jsx)(ft.A,{badge:"connectivity",connectivityState:S,"data-testid":"singleNode-connectivityStateInfo",nodeName:m,children:(0,ae.jsx)(oe.Pill,{flavour:"neutral",hollow:!0,children:S})}),(0,ae.jsx)(ft.A,{badge:"type","data-testid":"singleNode-nodeTypeInfo",nodeName:m,nodeType:T.label,children:(0,ae.jsx)(oe.Pill,{flavour:"neutral",hollow:!0,icon:T.icon,children:T.label})}),F&&(0,ae.jsx)(ft.A,{badge:"systemInfo","data-testid":"singleNode-systemInfo",nodeName:m,children:(0,ae.jsxs)(oe.Pill,{flavour:"neutral",hollow:!0,icon:et.u[p.nm]?.iconName||et.U[p.id]?.iconName||"os",children:[(0,it.O)(h.cpuFrequency)," (",x," ",1===h.cpus?"Core":"Cores",") -"," ",(0,it.RI)(h.memory)," RAM - ",(0,it.RI)(h.diskSpace)]})}),(0,ae.jsx)($t.A,{flavour:"node",silencing:C})]})},gl=()=>{const e=(0,E.aH)(),t=(e=>(0,r.useMemo)((()=>({overview:{id:"overview",title:"Metrics",icon:"room_overview",path:`${e}`,dataGa:"view-picker::click-view-overview::node-view",testId:"viewPicker-singleNode-overview",tooltip:{title:"Node Metrics",description:"View real-time and historical metrics for system resources, containers, VMs, and applications on this node"}},top:{id:"top",title:"Top",icon:"top",path:`${e}/top`,dataGa:"view-picker::click-view-fn::global-overview",testId:"viewPicker-singleNode-fn",tooltip:{title:"Node Top Consumers",description:"Monitor resource-heavy processes, containers, VMs, services, queries, and system components in real-time"}},logs:{id:"logs",title:"Logs",icon:"logs",path:`${e}/logs`,dataGa:"view-picker::click-view-logs::global-overview",testId:"viewPicker-singleNode-logs",tooltip:{title:"Node Logs",description:"Browse and search through system logs, application logs, and service logs from this node"}},alerts:{id:"alerts",title:"Alerts",icon:"alarm",path:`${e}/alerts`,dataGa:"view-picker::click-view-alerts::node-view",testId:"viewPicker-singleNode-alerts",tooltip:{title:"Node Alerts",description:"View active alerts, alert history, and alert configurations for this specific node"}},ar:{id:"ar",title:"Anomalies",icon:"anomaliesLens",path:`${e}/anomalies`,dataGa:"view-picker::click-view-anomalies::node-view",testId:"viewPicker-singleNode-anomalies",tooltip:{title:"Node Anomaly Advisor",description:"AI-powered anomaly detection showing unusual patterns and deviations in node metrics"}},events:{id:"events",title:"Events",icon:"feed",path:`${e}/events`,dataGa:"view-picker::click-view-feed::node-view",testId:"viewPicker-singleNode-feed",tooltip:{title:"Node Events",description:"Track configuration changes, deployments, restarts, and other significant events on this node"}}})),[e]))(e);return(0,r.useMemo)((()=>[t.overview,t.top,t.logs,t.alerts,t.ar,t.events].filter(Boolean)),[e])};var ml=n(10444);const pl=(0,dn.default)(oe.Box).attrs((e=>({width:"6px",height:"6px",round:"50%",...e}))).withConfig({displayName:"withNotification__NotificationDot",componentId:"sc-ka7a4g-0"})([""]),fl=e=>t=>{let{notificationBg:n,...r}=t;return n?(0,ae.jsxs)(oe.Flex,{position:"relative",gap:1,padding:[0,0,0,1.5],children:[(0,ae.jsx)(pl,{background:n,position:"absolute",top:-2,left:0}),(0,ae.jsx)(e,{...r})]}):(0,ae.jsx)(e,{...r})},jl=(0,dn.keyframes)(["0%{transform:translateY(-5px) scale(1);}25%{transform:translateY(-10px) scale(0.7);}50%{transform:translateY(-5px) scale(1);}75%{transform:translateY(0) scale(1.3);}100%{transform:translateY(-5px) scale(1);}"]),bl=(0,dn.default)(oe.Icon).attrs({name:"long_arrow_up",color:"successText"}).withConfig({displayName:"tabLink__DropHereIcon",componentId:"sc-1h4dha1-0"})(["animation:"," 1s ease-in infinite;"],jl),vl=e=>{let{active:t,highlight:n,iconColor:r}=e;return r||(n||t?"primary":"textDescription")},yl=fl(oe.Icon),wl=e=>{let{id:t,to:n,params:o,exact:i,icon:s,iconColor:a,title:l,fixed:c,dataGa:d,testId:u,children:h,type:x,tooltip:g,showBorderLeft:m,droppable:p,droppableProps:j={},ref:b,isDynamic:v,highlight:y,...w}=e;const{sendLog:C}=(0,Qt.A)(),{setNodeRef:I,active:k}=(0,Ee.zM)({id:`droppable-tab-${t}`,disabled:!p,data:j}),A=(0,f.RQ)(i?n:`${n}/*`),S=(0,f.Zp)(),F=(0,ml.J)(),N=!!A,M="nodes"!==x||N,L=(0,r.useCallback)((()=>{if(N)return;const e=`${n}${o?`/${o}`:""}`;S(e),C({feature:"Navigation",description:"Single page navigation using static tabs",tab:t,path:e})}),[t,n,N,o,C]),$=p&&k&&k.data.current?.dashboardable,D=(0,r.useRef)(),[B]=(0,T.m0)({tabId:t}),R=(0,r.useCallback)((e=>{let{button:t}=e;v&&1===t&&"function"===typeof w.onRemove&&w.onRemove(w.index,N)}),[v,w.index,N,w.onRemove]);return(0,ae.jsx)(Oe.A,{content:g||l,align:g?"bottom":"top",isBasic:"string"===typeof(g||l),...y?{color:"primary"}:{},children:(0,ae.jsxs)(oe.NavigationTab,{ref:(0,oe.mergeRefs)(I,b,D),fixed:c,active:N,showBorderLeft:m,icon:(0,ae.jsx)(yl,{name:s,size:"small",color:vl({active:N,highlight:y,iconColor:a}),notificationBg:B?.color}),onActivate:L,"data-ga":d,"data-testid":u,"aria-selected":N,...$&&{rootProps:{background:"successSemi",cursor:"alias"}},onMouseUp:R,...w,children:[!F&&!!l&&(0,ae.jsx)(oe.Text,{alignSelf:"center",strong:y,color:vl({active:N,highlight:y,iconColor:a}),whiteSpace:"nowrap",children:l}),D.current&&$&&(0,ae.jsx)(oe.Drop,{target:D.current,align:{top:"bottom"},stretch:!1,hideShadow:!0,zIndex:1,children:(0,ae.jsx)(bl,{})}),M&&h]})})},Cl={singleNode:"singleNode",logs:"logs",top:"fn",feed:"feed",anomalies:"anomalies",default:"singleNode",alerts:"alerts"},Il=(0,r.memo)((()=>{const e=gl(),t=(0,f.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/:path"),n=t&&Cl[t.params.path]||Cl.default;return(0,ae.jsxs)(oe.Flex,{justifyContent:"start",alignSelf:"start",alignItems:"end",width:"100%",height:"100%",overflow:"auto",background:"mainBackground",children:[(0,ae.jsx)(xl,{flavour:n,background:"mainBackground",border:void 0}),(0,ae.jsx)(oe.TabSeparator,{}),e.map(((e,t)=>{let{id:n,icon:r,title:o,path:i,...s}=e;return(0,ae.jsx)(wl,{exact:!0,fixed:!0,to:i,icon:r,title:o,id:n,rootProps:{background:"mainBackground"},showBorderLeft:0===t,...s},`${n}-${t}`)}))]})})),kl=Il;var Al=n(47413),Sl=n(17178),Tl=n(5722);const Fl=()=>{const{active:e}=(0,Ee.fF)(),t=(0,g.JT)("dashboard:Create"),n=(0,b.dg)();return t&&e&&!n?(0,ae.jsx)(wl,{to:"",id:"plus",icon:"plus",fixed:!0,droppable:!0,droppableProps:{dropArea:!0,dashboardId:"new"},testid:"roomDropdownMenu-roomOptions",disabled:!t||n}):null},Nl=e=>{let{title:t,path:n,children:o,index:i,ref:s,tooltip:a,type:l,id:c,...d}=e;const u=(0,qo.JL)("alerts"===l?c:null,"name"),h=(0,qo.JL)("alerts"===l?c:null,"instanceName"),x=(0,qo.JL)("alerts"===l?c:null,"nodeId"),g=(0,E.xY)("alerts"===l?x:null,"name"),m=(0,E.xY)("nodes"===l?c:null,"name"),p=(0,r.useMemo)((()=>{if("alerts"===l){const e=[];return h&&e.push(`Instance: ${h}`),g&&e.push(`Node: ${g}`),{title:`Alert: ${u||t||"Unknown"}`,description:e.length>0?e.join(" \u2022 "):"View detailed information about this alert"}}return"nodes"===l?{title:`Node: ${m||t||"Unknown"}`,description:"View node metrics, logs, top consumers, anomalies, and more."}:"dashboards"===l?{title:`Dashboard: ${t||"Unknown"}`,description:"View custom dashboard"}:a}),[l,a,t,u,h,g,m]);return(0,ae.jsx)(wl,{ref:s,isDynamic:!0,showBorderLeft:0===i,to:n,title:t,tooltip:p,"data-testid":`navigation-dynamicTab-${t}`,index:i,type:l,id:c,...d,children:o})},Ml=e=>{let{staticPaths:t,...n}=e;const[r,o,i]=(0,Al.A)(t),s=(0,ul.A)("horizontal");return(0,ae.jsx)(oe.BaseDraggableTabs,{onDragEnd:o,onTabClose:i,items:r,Item:Nl,...n,ref:s})},Ll=()=>(0,ae.jsx)(f.BV,{children:(0,ae.jsx)(f.qh,{path:"/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/*",element:(0,ae.jsx)(kl,{})})}),$l=(0,r.memo)((()=>{const[e,t]=(0,Sl.A)();return(0,Tl.A)()?(0,ae.jsxs)(oe.NavigationTabs,{subTabs:(0,ae.jsx)(Ll,{}),children:[e.map(((e,t)=>{let{id:n,icon:r,title:o,path:i,...s}=e;return(0,ae.jsx)(wl,{fixed:!0,to:i,icon:r,title:o,id:n,...s},`${n}-${t}`)})),(0,ae.jsx)(oe.TabSeparator,{}),(0,ae.jsx)(Ml,{staticPaths:t}),(0,ae.jsx)(Fl,{})]}):null})),Dl=$l,Bl=()=>{const e=(0,Ot.eg)(),t=`/spaces/${(0,b.bq)()}/rooms/${(0,v.QW)()}/overview`,n=(0,f.Zp)();(0,r.useEffect)((()=>{if(e)return(0,uo.unregister)(e.on("goToLink",((e,r)=>{let o=location.pathname;return e&&e.getParent().getAttribute("roomId")&&(o=e.getParent().getId(),o=/^\/spaces/.test(o)?o:t),n(o,r?{state:{chartName:r},replace:!0}:{state:{contextToGo:e?.getAttribute("contextScope")?.[0]},replace:!0})})))}),[e,t])},Rl=()=>(Bl(),null);var Pl=n(73937),Vl=n(65637),_l=n(8886),Ol=n(73980),El=n(45026);const Hl=`dyncfg-edit-alet-warning-dismiss-${window.envSettings?.visitor}`,zl={lineHeight:1.6},Kl=e=>{let{alertName:t,nodeIds:n=[]}=e;const i="true"===localStorage.getItem(Hl),[s,,,a]=(0,fe.A)(!i),[l,c]=(0,r.useState)(),d=(0,E.xY)(n[0],"name"),u=n.length-1,h=u>0?` and ${u} other nodes`:"",x=(0,r.useCallback)((e=>{c(e)}),[c]),g=(0,r.useCallback)((()=>{l&&localStorage.setItem(Hl,!0),a()}),[l,a]);return s?(0,ae.jsx)(oe.Modal,{backdropContainerProps:{zIndex:"60"},backdropProps:{backdropBlur:!0},children:(0,ae.jsxs)(oe.ModalContent,{children:[(0,ae.jsx)(oe.ModalHeader,{children:(0,ae.jsx)(oe.H4,{children:"Editing Alerts"})}),(0,ae.jsx)(oe.ModalBody,{children:(0,ae.jsxs)(oe.Flex,{column:!0,gap:2,width:{max:120},children:[(0,ae.jsxs)(oe.TextBig,{...zl,children:["You are about to edit the alert ",(0,ae.jsx)(oe.TextBig,{color:"primary",children:t}),d?(0,ae.jsxs)(ae.Fragment,{children:[" ","on node ",(0,ae.jsx)(oe.TextBig,{color:"primary",children:d}),h]}):null,"."]}),(0,ae.jsx)(oe.TextBig,{...zl,children:'Keep in mind that alerts in Netdata are templates that are applied to all instances of the same kind (e.g. editing a disk alert, means you are changing the alerts for all disks on that node). If you want to overwrite the rules for a single instance, do not change the current rules. Instead add a new rule and select "Apply to a specific instance" for that rule, matching the instance you want to overwrite.'}),o.Ay?(0,ae.jsx)(oe.TextBig,{...zl,children:'To apply an alert on all your currently connected nodes, edit it and select "Submit to Multiple Nodes".'}):(0,ae.jsx)(oe.TextBig,{...zl,children:'When having parents and you have connected both parents and children to Netdata Cloud, the alert needs to be altered on both Netdata parents and children, otherwise one of the two will be using the old version. To apply an alert on multiple nodes, edit it and select "Submit to Multiple Nodes".'})]})}),(0,ae.jsxs)(oe.ModalFooter,{justifyContent:"between",children:[(0,ae.jsxs)(oe.Flex,{gap:2,alignItems:"center",children:[(0,ae.jsx)(oe.Checkbox,{checked:l,onChange:x}),(0,ae.jsx)(oe.TextBig,{children:"Don't show this again"})]}),(0,ae.jsx)(oe.Button,{type:"button",flavour:"hollow",label:"OK",textTransform:"uppercase",onClick:g})]})]})}):null},Wl=(0,r.memo)((()=>{const{node:e}=(0,Pl.Z)(),{alertName:t,nodeIds:n,title:o}=(0,El.A)(),{loaded:i,tree:s}=(0,Vl.A)(n?{value:n?.[0]}:e),a=(0,r.useMemo)((()=>s?.[ki.$7]?.[o]||{}),[s,o]),l=(0,r.useMemo)((()=>!!Object.keys(a||{}).length),[a]);return i&&t?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Ol.A,{flavour:"entity",title:o,entityProps:a,isOpen:l,isEditFromState:!0,renderChildren:e=>(0,ae.jsx)(_l.A,{id:o,...a,...e})},JSON.stringify({loaded:i,alertName:t,alertItemExists:l})),a?(0,ae.jsx)(Kl,{alertName:t,nodeIds:n}):null]}):null})),Gl=Wl,ql=(0,r.memo)((()=>{const{node:e}=(0,Pl.Z)(),{path:t}=(0,Vl.A)(e),n=(0,Zt.sh)({node:e,path:t}),{entityProps:r,...o}=n||{};return n?(0,ae.jsx)(Ol.A,{id:n.template,flavour:"entity",title:`${n.template}:placeholder`,entityProps:{...r,...o},isNewItem:!0,formData:n.formData,renderChildren:e=>(0,ae.jsx)(_l.A,{...r,...e,id:n.template,isNewItem:!0})}):null})),Ul=ql,Jl=(0,i.A)((()=>Promise.all([n.e(3961),n.e(3864),n.e(3457)]).then(n.bind(n,93457))),"ManageSpaceRoute"),Yl=(0,i.A)((()=>n.e(2201).then(n.bind(n,52201))),"Trial"),Zl=(0,i.A)((()=>n.e(5302).then(n.bind(n,5302))),"PreferredNodesModal"),Ql=(0,i.A)((()=>Promise.resolve().then(n.bind(n,61314))),"JoinSpace"),Xl=(0,i.A)((()=>n.e(7530).then(n.bind(n,17530))),"NoSpaceAccess"),ec=(0,i.A)((()=>n.e(6333).then(n.bind(n,96333))),"EmptyRoom"),tc=(0,i.A)((()=>n.e(1910).then(n.bind(n,11910))),"AlertView"),nc=(0,i.A)((()=>n.e(2177).then(n.bind(n,32177))),"Anomalies"),rc=(0,i.A)((()=>Promise.resolve().then(n.bind(n,5))),"AlertsSmartboard"),oc=(0,i.A)((()=>n.e(7214).then(n.bind(n,27214))),"DashboardsOverview"),ic=(0,i.A)((()=>Promise.all([n.e(180),n.e(4424),n.e(5297)]).then(n.bind(n,95297))),"DashboardView"),sc=(0,i.A)((()=>Promise.all([n.e(3961),n.e(6238),n.e(9341),n.e(7791)]).then(n.bind(n,47791))),"FunctionsView"),ac=(0,i.A)((()=>Promise.all([n.e(4606),n.e(3864),n.e(9341),n.e(3545),n.e(2439),n.e(4142),n.e(1646)]).then(n.bind(n,11646))),"Insights"),lc=(0,i.A)((()=>Promise.all([n.e(4606),n.e(3864),n.e(9341),n.e(3545),n.e(2439),n.e(3808)]).then(n.bind(n,43808))),"InsightsReport"),cc=(0,i.A)((()=>n.e(2792).then(n.bind(n,32792))),"Onboarding"),dc=(0,i.A)((()=>Promise.all([n.e(3864),n.e(8791),n.e(3185),n.e(5187)]).then(n.bind(n,53185))),"Integrations"),uc=(0,i.A)((()=>Promise.all([n.e(180),n.e(2003)]).then(n.bind(n,92003))),"DropInDashboard"),hc=(0,i.A)((()=>n.e(5566).then(n.bind(n,73185))),"Marketplace"),xc=(0,i.A)((()=>n.e(2904).then(n.bind(n,82904)).then((e=>({default:e.AssistantAlerts})))),"AssistantAlerts"),gc=(0,i.A)((()=>n.e(2904).then(n.bind(n,82904)).then((e=>({default:e.AssistantChat})))),"AssistantChat"),{demoSlug:mc,demoDefaultRoomViews:pc,defaultRoomView:fc,onboardingView:jc,integrationsView:bc}=x.A,vc=ni(_i(ti)),yc=_i(ti),wc=(0,r.memo)((()=>{const[e,t]=(0,mr.Ay)(),n=mc===e?pc[t]||pc.default:o.Ay&&t===o.Iy?o.kG:fc;return(0,ae.jsxs)(r.Suspense,{fallback:(0,ae.jsx)(d.zj,{}),children:[(0,ae.jsx)(r.Suspense,{fallback:"",children:(0,ae.jsx)(uc,{})}),(0,ae.jsx)(f.BV,{children:(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/*",element:(0,ae.jsx)(Jn,{})})}),(0,ae.jsxs)(f.BV,{children:[(0,ae.jsx)(f.qh,{path:"nodes/:nodeId",element:(0,ae.jsx)(vc,{})}),(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/alerts",element:(0,ae.jsx)(rc,{})}),(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/anomalies",element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.Bm,{}),children:(0,ae.jsx)(nc,{})})}),(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/top",element:(0,ae.jsx)(sc,{flavour:"fn"},"fn")}),(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/logs",element:(0,ae.jsx)(sc,{flavour:"logs"},"logs")}),(0,ae.jsx)(f.qh,{path:"nodes/:nodeId/events",element:(0,ae.jsx)(sc,{flavour:"feed"},"feed")}),(0,ae.jsx)(f.qh,{path:"nodes",element:(0,ae.jsx)(Un,{})}),(0,ae.jsx)(f.qh,{path:"home",element:(0,ae.jsx)(el,{})}),(0,ae.jsx)(f.qh,{path:"overview",element:(0,ae.jsx)(yc,{})}),(0,ae.jsx)(f.qh,{path:"alerts/:alertId",element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.xh,{}),children:(0,ae.jsx)(tc,{})})}),(0,ae.jsx)(f.qh,{path:"alerts",element:(0,ae.jsx)(rc,{})}),(0,ae.jsx)(f.qh,{path:"alarms/:alertId",element:(0,ae.jsx)(tc,{})}),(0,ae.jsx)(f.qh,{path:"alarms",element:(0,ae.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/alerts`})}),(0,ae.jsx)(f.qh,{path:"functions",element:(0,ae.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/top`})}),(0,ae.jsx)(f.qh,{path:"dashboard",element:(0,ae.jsx)(ic,{customDashboardId:o.LA})}),(0,ae.jsx)(f.qh,{path:"dashboards/:dashboardSlug",element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(c.O2,{}),children:(0,ae.jsx)(ic,{})})}),(0,ae.jsx)(f.qh,{path:"dashboards",element:(0,ae.jsx)(oc,{})}),(0,ae.jsx)(f.qh,{path:"kubernetes",element:(0,ae.jsx)(yc,{flavour:"k8s"})}),(0,ae.jsx)(f.qh,{path:"anomalies",element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.Bm,{}),children:(0,ae.jsx)(nc,{})})}),(0,ae.jsx)(f.qh,{path:"top",element:(0,ae.jsx)(sc,{flavour:"fn"},"fn")}),(0,ae.jsx)(f.qh,{path:"logs",element:(0,ae.jsx)(sc,{flavour:"logs"},"logs")}),(0,ae.jsx)(f.qh,{path:"events",element:(0,ae.jsx)(sc,{flavour:"feed"},"feed")}),(0,ae.jsx)(f.qh,{path:`${m.p9}/:reportId`,element:(0,ae.jsx)(lc,{})}),(0,ae.jsx)(f.qh,{path:"insights/*",element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.BJ,{}),children:(0,ae.jsx)(ac,{})})}),(0,ae.jsx)(f.qh,{path:"/",element:(0,ae.jsx)(f.C5,{replace:!0,to:`/spaces/${e}/rooms/${t}/${n}`})})]})]})})),Cc=()=>{const{isOnboardingPath:e,path:t}=(0,u.A)(),{isIntegrationsPath:n}=(0,ll.Q)(),[i,a]=(0,ll.A)(),l=(0,b.vt)(),c=(0,v.ID)(),h=(0,s.I)(),x=(0,B.gr)(c,"ids"),g=(0,B.gr)(c,"loaded"),m=(0,b.bE)(l,"isEmpty"),y=(0,r.useMemo)((()=>!0===g&&!x.length),[g,x]),w=(0,o.Az)(l),{isOpen:C,modal:I}=(0,dl.A)();return((e,t)=>{const n=(0,p.yF)((0,r.useCallback)((async(n,r)=>{await n((0,v.LS)({id:t,key:"fullyLoaded"}))||(0,Yn.K8)(e,t).then((t=>{let{data:n}=t;return r((0,v.If)(n.id),{...n,spaceId:e,fullyLoaded:!0,loaded:!0})}))}),[e,t]));(0,r.useEffect)((()=>{e&&t&&n()}),[e,t])})(l,c),(0,Zn.A)({spaceId:l,id:c,pollingInterval:63e3}),function(e,t){let{polling:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=(0,p.yF)((0,r.useCallback)((function(e,n){let{data:r=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n((0,tr.t)({id:t,key:"ids"}),r.map((e=>e.id))),n((0,tr.t)({id:t,key:"loaded"}),!0),n((0,tr.t)({id:t,key:"updatedAt"}),(new Date).toISOString()),n((0,tr.t)({id:t,key:"error"}),null),n(Qn.Ay,(e=>r.reduce(((e,t)=>(e[t.id]={...e[t.id],loaded:!0,...t},e)),e)));const o=r.reduce(((e,t)=>{let{id:n,nodeId:r}=t;return e[r]=[...e[r]||[],n],e}),{});n(er.l3,o)}),[e,t])),i=(0,p.yF)((0,r.useCallback)(((e,n,r)=>{n((0,tr.t)({id:t,key:"error"}),(0,nr.A)(r))}),[]));(0,j.A)((()=>({enabled:!!e&&!!t,polling:n,pollingOptions:{checkPauseCondition:M},fetch:()=>(0,Xn.l1)(e,t),onFail:i,onReceive:o,force:!0})),[e,t])}(l,c),(0,rr.A)(l,c),function(e,t){let{types:n,entities:o,paths:i,names:s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(0,p.yF)(((r,a)=>{(0,tl.Uc)(e,t,{types:n,entities:o,paths:i,names:s}).then((n=>{let{data:r}=n;a((0,po.Mg)({spaceId:e,roomId:t}),r),a((0,Ie.n_)({spaceId:e,roomId:t}))}))}));(0,r.useEffect)((()=>{e&&t&&a()}),[e,t,n,o,i,s])}(l,c),D(),(0,r.useEffect)((()=>{w||a||h||m(i)}),[w,i,h,a,m]),h?(0,ae.jsx)(r.Suspense,{fallback:"",children:(0,ae.jsx)(hc,{subCallback:h})}):a?(0,ae.jsx)(d.Qk,{}):w||!i||!t||e||n?y?(0,ae.jsx)(ec,{}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(wc,{}),C&&I]}):(0,ae.jsx)(f.C5,{to:t,replace:!0})},Ic=(0,l.Xc)((0,r.memo)((()=>{const e=(0,g.JT)("space:Read"),t=(0,g.JT)("room:Read"),{hasAccess:n,reason:o}=al();return e?n?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(Dl,{}),(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.Qk,{}),children:(0,ae.jsxs)(f.BV,{children:[(0,ae.jsx)(f.qh,{path:"spaces/:spaceSlug/join-space",element:(0,ae.jsx)(Ql,{})}),(0,ae.jsx)(f.qh,{path:"spaces/:spaceSlug/no-rooms",element:(0,ae.jsx)(Xl,{reason:"noRooms"})}),(0,ae.jsx)(f.qh,{path:"spaces/:spaceSlug/settings/*",element:(0,ae.jsx)(kc,{})}),(0,ae.jsx)(f.qh,{path:`spaces/:spaceSlug/rooms/:roomSlug/${jc}`,element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.NP,{}),children:(0,ae.jsx)(cc,{})})}),(0,ae.jsx)(f.qh,{path:`spaces/:spaceSlug/rooms/:roomSlug/${bc}`,element:(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.H$,{}),children:(0,ae.jsx)(dc,{flavour:"settingsPage"})})}),(0,ae.jsx)(f.qh,{path:"spaces/:spaceSlug/rooms/:roomSlug/*",element:t?(0,ae.jsx)(Cc,{}):(0,ae.jsx)(Xl,{reason:"noRoomPermission"})})]})})]}):(0,ae.jsx)(Xl,{reason:o}):(0,ae.jsx)(Xl,{reason:"noSpacePermission"})}))),kc=()=>((0,mr.KI)(),(0,ae.jsx)(Jl,{})),Ac=()=>{const e=(0,b.vt)();return(0,nl.A)(e),(0,rl.A)(e),(e=>{const t=(0,p.yF)((0,r.useCallback)((function(t,n){let{data:{results:r}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n((0,ol.S)({id:e}),r)}),[e])),n=(0,p.yF)((0,r.useCallback)(((t,n,r)=>{n((0,ol.S)({id:e,key:"error"}),r)}),[e])),o=(0,il.sC)(e,"loaded"),i=(0,g.JT)("alert:ReadAll");(0,j.A)((()=>({enabled:i&&!!e&&o,fetch:()=>(0,Xn.C2)(e),onFail:n,onReceive:t,pollingOptions:{pollingInterval:15e4}})),[e,!!o,i])})(e),null},Sc=(0,l.Xc)((()=>{const e=(0,b.vt)();return(0,cl.Ay)(),(0,r.useEffect)((()=>{const e=(0,a.A)(new URL(window.location.href).searchParams.get("join_callback"));e&&(window.location.href=e)}),[]),e?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(xc,{}),(0,ae.jsx)(gc,{}),(0,ae.jsx)(Ac,{}),(0,ae.jsx)(h.A,{permission:"space:Read",children:t=>t?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(f.BV,{children:(0,ae.jsx)(f.qh,{path:"/*",element:(0,ae.jsx)(Rl,{})})}),(0,ae.jsx)(r.Suspense,{fallback:(0,ae.jsx)(d.Qk,{}),children:(0,ae.jsx)(Ic,{})})]}):(0,ae.jsx)(Xl,{reason:"noSpacePermission"},e)}),(0,ae.jsx)(r.Suspense,{fallback:"",children:(0,ae.jsx)(Yl,{})}),(0,ae.jsxs)(r.Suspense,{fallback:"",children:[(0,ae.jsx)(Zl,{}),(0,ae.jsx)(Ul,{}),(0,ae.jsx)(Gl,{})]})]}):(0,ae.jsx)(d.Qk,{})}))},80744:(e,t,n)=>{n.d(t,{Ay:()=>g,NA:()=>x});n(98992),n(72577),n(81454);var r=n(96540),o=n(40961),i=n(43375),s=n(67012),a=n(43305),l=n(71123),c=n(61710),d=n(45427),u=n(74848);const h={sideEffects(e){let{active:t}=e;t.node.animate([{opacity:0},{opacity:1}],{easing:"ease-in",duration:250})}},x=40,g=e=>{let{cacheId:t,rootId:n,items:g,onRemove:m,Item:p,containerWidth:f=800,rowHeight:j=x,gridTracks:b=12,gutter:v=4,allowOverlap:y=!1,compactType:w="vertical",maxRows:C=3e5,Container:I=a.A,onDragEnd:k,onDragCancel:A,containerId:S,itemProps:T,rearrangeable:F=!0,...N}=e;const M=(0,r.useRef)(),[L,$]=(0,r.useState)((()=>(0,l.oE)((0,l.Su)(g),w,b)));(0,s.A)((()=>{$((0,l.oE)((0,l.Su)(g),w,b))}),[b,t]);const[D,B]=(0,r.useState)(null),[R,P]=(0,r.useState)(null),V=(0,r.useRef)(null),{active:_}=(0,i.fF)();(0,i.E5)((0,r.useMemo)((()=>({onDragStart:e=>{let{active:t}=e;const{itemContainerId:n}=t.data.current||{};n===S&&(B((0,l.Su)(L)),P(L))},onDragMove:e=>{let{active:t,over:n}=e;P((e=>{const{isResizer:r,isContainer:o,itemId:i,itemContainerId:s}=t.data.current||{};if(o||s!==S)return e;const{initial:a,translated:d}=t.rect.current;let u=e;const h=(0,l.GN)(u,i);if(!h)return e;const x=n?.id;if(r){if(!x)return e;if(!d||!a)return e;const t=n.rect.width+(0,c.sd)(d.right-a.right),r=n.rect.height+(0,c.sd)(d.bottom-a.bottom);let{width:o,height:i}=(0,c.tr)({gutter:v,maxRows:C,gridTracks:b,rowHeight:j,containerWidth:f},t,r,h);return h.width===o&&h.height===i?e:(h.width=o,h.height=i,u=u.map((e=>e.id===h.id?{...h,width:o,height:i}:e)),u=(0,l.oE)(u,w,b),V.current=h,u)}if(!F)return e;const g=M.current.getBoundingClientRect();let{left:m,top:p}=(0,c.zA)({gutter:v,maxRows:C,gridTracks:b,rowHeight:j,containerWidth:f},d.top-g.top,d.left-g.left,h);return h.top===p&&h.left===m?e:(u=(0,l.Pe)(u,h,m,p,!0,!1,w,b,y),u=(0,l.oE)(u,w,b),V.current=h,u)}))},onDragEnd:e=>{let{active:t,over:n}=e;const{isResizer:r,isContainer:o,itemContainerId:i}=t.data.current;if(o||i!==S)return void P(null);const s=n?.id;return r?(R&&$(R),P(null),void k(R,V.current)):null===s||n?.data?.current?.itemContainerId!==S?(D&&$(D),void P(null)):(R&&$(R),P(null),void k(R,V.current))},onDragCancel:()=>{D&&$(D),V.current=null,B(null),P(null),A&&A()}})),[L,R]));const O=(0,l.Hp)(R||L),E=O*j+(O-1)*v+"px";return(0,u.jsxs)(I,{ref:M,style:{width:f,height:E},...N,children:[(R||L).map(((e,t)=>(0,u.jsx)(d.A,{...e,index:t,containerId:S,Item:p,onRemove:m,draggable:!0,containerWidth:f,rowHeight:j,gridTracks:b,gutter:v,transformed:null!==R?R[t]:null,draggableProps:e,itemProps:T,rootId:n},e.id))),(0,o.createPortal)((0,u.jsx)(i.Hd,{adjustScale:!1,dropAnimation:h,zIndex:9999,children:_&&_.data.current.rootId===n&&_.data.current.isItem?(e=>{const t=R||L;if(!t)return null;const r=t.find((t=>t.id===e.itemId));return r?(0,u.jsx)(d.A,{rootId:n,...r,containerId:e.itemContainerId,Item:p,onRemove:m,draggable:!0,containerWidth:f,rowHeight:j,gridTracks:b,gutter:v,dragOverlay:!0,itemProps:T}):null})(_.data.current):null}),document.body)]})}},82507:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(33185),o=n(74848);const i=r.default.div.withConfig({displayName:"circuitLines__CircuitLinesContainer",componentId:"sc-18gzenn-0"})(["position:absolute;inset:0;z-index:1;opacity:0.8;& > svg{position:absolute;margin:auto;left:50%;transform:translateX(-50%);top:0;bottom:0;}"]),s=e=>{let{withOuties:t=!0}=e;return(0,o.jsx)(i,{children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"187",height:"202",viewBox:"0 0 187 202",fill:"none",children:[(0,o.jsxs)("defs",{children:[(0,o.jsxs)("linearGradient",{id:"flowGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,o.jsx)("stop",{offset:"0%",stopColor:"#005622",stopOpacity:"0.3",children:t&&(0,o.jsx)("animate",{attributeName:"stop-opacity",values:"0.3;0.8;0.3",dur:"3s",repeatCount:"indefinite"})}),(0,o.jsx)("stop",{offset:"50%",stopColor:"#00cd51",stopOpacity:t?"0.6":"0.3",children:t&&(0,o.jsx)("animate",{attributeName:"stop-opacity",values:"0.6;1;0.6",dur:"2.5s",repeatCount:"indefinite"})}),(0,o.jsx)("stop",{offset:"100%",stopColor:"#005622",stopOpacity:"0.3",children:t&&(0,o.jsx)("animate",{attributeName:"stop-opacity",values:"0.3;0.8;0.3",dur:"3.2s",repeatCount:"indefinite"})})]}),(0,o.jsxs)("filter",{id:"pulse",children:[(0,o.jsx)("feGaussianBlur",{stdDeviation:"1",result:"coloredBlur"}),(0,o.jsxs)("feMerge",{children:[(0,o.jsx)("feMergeNode",{in:"coloredBlur"}),(0,o.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,o.jsx)("g",{filter:"url(#filter0_f_847_10449)",children:(0,o.jsx)("path",{d:"M57 22.0207L91.5 2.10214M100.5 3.90192L137.043 25M148.5 30L175.347 45.5M91.5 10L67.6235 23.7851C66.5333 24.4145 66.2887 25.8826 67.116 26.8315L72.5 33.007M13.5 55.5L51 33.007L55.5147 30.7444C56.3757 30.3129 57.422 30.5563 58.0042 31.3237L68 44.5M9 48L48 26M4 55.5V87C4 88.1046 4.89543 89 6 89H23.5M13 64.5V82.5M23.5 61.5L52.4294 43.0042C53.3141 42.4385 54.4856 42.6534 55.112 43.4962L64.9195 56.693C65.2968 57.2007 65.8921 57.5 66.5247 57.5H92M51 55.5L24.471 71.4174C23.8686 71.7788 23.5 72.4299 23.5 73.1324V77.5C23.5 78.6046 24.3954 79.5 25.5 79.5H33C34.1046 79.5 35 80.3954 35 81.5V87C35 88.1046 35.8954 89 37 89H63.4914C64.6067 89 65.5066 89.9124 65.4912 91.0277L65 126.5M4 97.5H55C56.1046 97.5 57 98.3954 57 99.5V110.5M46 109H23.5M4 108H11.5C12.6046 108 13.5 108.895 13.5 110V120.5C13.5 121.605 12.6046 122.5 11.5 122.5H6C4.89543 122.5 4 123.395 4 124.5V142M100.5 13.5L114.488 21.4458C115.113 21.8012 115.5 22.4652 115.5 23.1848V37V50.5C115.5 51.6046 114.605 52.5 113.5 52.5H82.5M79 26L93.4828 18.9922C94.1141 18.6867 94.8591 18.7342 95.4465 19.1173L105.093 25.4082C105.659 25.7774 106 26.4075 106 27.0834V42M79 42H96C97.1046 42 98 41.1046 98 40V30M23.5 115.5H45C45.5523 115.5 46 115.948 46 116.5V116.5C46 117.052 46.4477 117.5 47 117.5H55C56.1046 117.5 57 118.395 57 119.5V124.5M19.5 122.5H40.5M9 126.5V135C9 136.105 9.89543 137 11 137H34M19.5 130.5H48M57 130.5V140C57 141.105 56.1046 142 55 142H40.5M4 152.5H11.5C12.6046 152.5 13.5 151.605 13.5 150.5V147C13.5 145.895 14.3954 145 15.5 145H29.5M23.5 152.5V157.5C23.5 158.605 22.6046 159.5 21.5 159.5H15C13.8954 159.5 13 160.395 13 161.5V161.905C13 162.587 13.3475 163.222 13.9219 163.59L38 179M29.5 152.5H63C64.1046 152.5 65 151.605 65 150.5V137M40.5 72L54 64.5M44.5 82V78.7227C44.5 77.9721 44.9202 77.2848 45.5882 76.9426L62.0882 68.4914C63.4191 67.8097 65 68.7762 65 70.2715V79.5M73 66.5H96C97.1046 66.5 98 65.6046 98 64.5V61.5M106 61.5H123C124.105 61.5 125 60.6046 125 59.5V37M125 26L146.5 40M134 42V55.5C134 56.6046 134.895 57.5 136 57.5H148.5M142 48H156M157 57.5H174.498C175.04 57.5 175.56 57.7205 175.937 58.111L184.439 66.9188C184.799 67.2916 185 67.7896 185 68.3078V89M76 77.5V87C76 88.1046 76.8954 89 78 89H89.5C90.6046 89 91.5 88.1046 91.5 87V79.5C91.5 78.3954 92.3954 77.5 93.5 77.5H106M106 70H119H128C129.105 70 130 69.1046 130 68V66.5C130 65.3954 130.895 64.5 132 64.5H148.5M113.5 77.5H130M135 87.5V70M175.347 81L162 90.5M142 70H153M72.5 95.5H82C83.1046 95.5 84 96.3954 84 97.5V103C84 104.105 83.1046 105 82 105H74.5816C73.4457 105 72.5378 105.945 72.5832 107.08L73 117.5M77.5 110.5H94.5M89.5 95.5H98C99.1046 95.5 100 96.3954 100 97.5V108M98 84.5H122.5M106.5 91.5H119M142 79.5H156M162 64.5H169.597C170.171 64.5 170.718 64.7469 171.097 65.1777L174.847 69.4332C175.169 69.7985 175.347 70.2686 175.347 70.7555V74.2906C175.347 75.0342 174.934 75.7164 174.276 76.0617L162 82.5M162 73.5L170.5 72M106.5 97.5H125.5C126.605 97.5 127.5 96.6046 127.5 95.5V89M142 87.5H152.5C153.605 87.5 154.5 88.3954 154.5 89.5V92.4296C154.5 93.0983 154.834 93.7228 155.391 94.0937L160.5 97.5M167.5 95.5L177.5 89M185 97.5V115.5M73 126.5H80.5C81.6046 126.5 82.5 125.605 82.5 124.5V119.5C82.5 118.395 83.3954 117.5 84.5 117.5H103M109.5 108H122.5M135 95.5V106C135 107.105 135.895 108 137 108H148.576C150.297 108 151.214 105.971 150.077 104.679L148.424 102.8C146.988 101.168 148.82 98.7394 150.784 99.6722L162 105M170.5 105V120.5C170.5 121.605 171.395 122.5 172.5 122.5H179.298C179.753 122.5 180.193 122.655 180.548 122.938L185 126.5M113.5 115.5H137.043M148.5 115.5H158.5C159.605 115.5 160.5 116.395 160.5 117.5V131C160.5 132.105 161.395 133 162.5 133H170.5M72.5 137H83.2539C83.7351 137 84.2002 136.827 84.5638 136.511L90.9362 130.989C91.2998 130.673 91.7649 130.5 92.2461 130.5H104C105.105 130.5 106 129.605 106 128.5V122.5M113.5 122.5H128C129.105 122.5 130 123.395 130 124.5V128.5C130 129.605 130.895 130.5 132 130.5H146.5M182.5 137V143C182.5 144.105 181.605 145 180.5 145H157M153 137H125M113.5 130.5V143C113.5 144.105 114.395 145 115.5 145H135M76 145H91.4689C91.8169 145 92.159 144.909 92.4611 144.736L106 137M34 159.5V165.012C34 165.635 34.2903 166.222 34.7851 166.6L51 179M46 159.5H73M51 166L64.6912 175.901C65.2113 176.277 65.5192 176.88 65.5192 177.522V184C65.5192 185.105 64.6238 186 63.5192 186H48M73 170V196M79 155H97.3333C97.7661 155 98.1871 154.86 98.5333 154.6L108 147.5M115.5 152.5H142M153 152.5L166.369 158.954C167.061 159.288 167.5 159.988 167.5 160.755V164.945C167.5 165.605 167.174 166.223 166.629 166.596L148.5 179M84 166H105.715C106.219 166 106.706 165.809 107.076 165.466L112.924 160.034C113.294 159.691 113.781 159.5 114.285 159.5H130M142 163V171.796C142 172.537 141.591 173.217 140.936 173.563L125 182M84 176.5H105.484C105.823 176.5 106.155 176.414 106.452 176.25L125 166M84 186H92.5C93.6046 186 94.5 186.895 94.5 188V199.5M103 186V195.795C103 197.386 104.767 198.34 106.097 197.467L119 189M112 182L135 168.721M151 159.5L157.498 162.533C158.122 162.823 158.552 163.414 158.637 164.097L158.833 165.667C158.934 166.473 158.537 167.26 157.829 167.658L151 171.5M169.5 151H183C184.105 151 185 151.895 185 153V153.982C185 154.621 184.694 155.223 184.176 155.599L174 163",stroke:"url(#flowGradient)",strokeLinecap:"round",children:(0,o.jsx)("animate",{attributeName:"stroke-opacity",values:"0.8;1;0.8",dur:"4s",repeatCount:"indefinite"})})}),(0,o.jsx)("defs",{children:(0,o.jsxs)("filter",{id:"filter0_f_847_10449",x:"3",y:"1.10205",width:"183",height:"199.398",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,o.jsx)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,o.jsx)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,o.jsx)("feGaussianBlur",{stdDeviation:"0.25",result:"effect1_foregroundBlur_847_10449"})]})}),(0,o.jsxs)("g",{className:"nodes",children:[(0,o.jsxs)("circle",{cx:"8",cy:"48.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"3s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"3s",repeatCount:"indefinite"})]}),(0,o.jsxs)("circle",{cx:"92",cy:"2.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"2.5s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"2.5s",repeatCount:"indefinite"})]}),(0,o.jsxs)("circle",{cx:"185",cy:"90.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"3.5s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"3.5s",repeatCount:"indefinite"})]}),(0,o.jsxs)("circle",{cx:"73",cy:"196.5",r:"2",fill:"#005622",filter:"url(#pulse)",children:[(0,o.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"2.8s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.8;1;0.8",dur:"2.8s",repeatCount:"indefinite"})]}),(0,o.jsx)("circle",{cx:"13",cy:"55.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"4s",repeatCount:"indefinite",begin:"0.5s"})}),(0,o.jsx)("circle",{cx:"4",cy:"55.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"3.8s",repeatCount:"indefinite",begin:"1s"})}),(0,o.jsx)("circle",{cx:"13",cy:"62.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"4.2s",repeatCount:"indefinite",begin:"1.5s"})}),(0,o.jsx)("circle",{cx:"23",cy:"62.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.9;0.6",dur:"3.6s",repeatCount:"indefinite",begin:"2s"})}),(0,o.jsx)("circle",{cx:"92",cy:"57.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.7;1;0.7",dur:"3.2s",repeatCount:"indefinite",begin:"0.8s"})}),(0,o.jsx)("circle",{cx:"106",cy:"77.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"r",values:"2;2.5;2",dur:"3.8s",repeatCount:"indefinite",begin:"1.2s"})}),(0,o.jsx)("circle",{cx:"162",cy:"90.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.6;0.95;0.6",dur:"4.5s",repeatCount:"indefinite",begin:"1.8s"})}),(0,o.jsx)("circle",{cx:"125",cy:"36.5",r:"2",fill:"#005622",children:(0,o.jsx)("animate",{attributeName:"fill-opacity",values:"0.7;1;0.7",dur:"3.4s",repeatCount:"indefinite",begin:"2.2s"})}),(0,o.jsx)("circle",{cx:"98",cy:"60.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"72",cy:"66.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"76",cy:"76.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"95.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"116.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"79",cy:"110.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"95",cy:"110.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"91",cy:"95.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"100",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"99",cy:"84.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"84.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"118",cy:"91.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"108",cy:"91.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"108",cy:"97.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"128",cy:"90.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"113",cy:"77.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"130",cy:"77.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"61.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"134",cy:"40.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"149",cy:"57.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"156",cy:"57.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"156",cy:"47.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"141",cy:"47.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"147",cy:"40.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"125",cy:"26.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"141",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"154",cy:"69.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"150",cy:"64.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"176",cy:"80.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"87.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"82",cy:"52.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"80",cy:"41.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"98",cy:"28.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"42.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"79",cy:"26.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"99",cy:"12.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"99",cy:"3.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"138",cy:"25.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"148",cy:"29.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"177",cy:"46.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"53",cy:"54.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"53",cy:"64.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"40",cy:"72.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"44",cy:"82.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"65",cy:"81.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"65",cy:"127.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"13",cy:"82.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"88.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"3",cy:"97.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"57",cy:"110.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"47",cy:"108.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"57",cy:"124.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"57",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"47",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"17",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"9",cy:"127.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"34",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"41",cy:"141.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"31",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"2",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"39",cy:"179.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"30",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"34",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"51",cy:"179.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"48",cy:"185.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"50",cy:"165.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"47",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"74",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"169.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"83",cy:"185.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"94",cy:"199.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"103",cy:"186.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"120",cy:"187.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"125",cy:"181.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"142",cy:"162.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"152",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"148",cy:"178.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"157",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"170",cy:"150.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"173",cy:"163.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"183",cy:"137.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"185",cy:"126.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"170",cy:"104.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"160",cy:"104.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"94.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"109",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"104",cy:"117.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"74",cy:"126.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"74",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"123.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"106",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"76",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"79",cy:"154.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"109",cy:"146.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"122.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"137",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"146",cy:"130.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"147",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"170",cy:"132.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"153",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"136.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"134",cy:"144.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"144",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"150",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"150",cy:"171.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"152.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"129",cy:"159.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"83",cy:"165.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"83",cy:"176.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"113",cy:"181.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"135",cy:"168.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"124",cy:"166.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"114",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"65",cy:"137.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"18",cy:"122.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"41",cy:"122.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"108.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"23",cy:"115.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"3",cy:"107.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"4",cy:"141.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"48",cy:"25.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"56",cy:"22.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"68",cy:"44.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"73",cy:"33.5",r:"2",fill:"#005622"}),(0,o.jsx)("circle",{cx:"92",cy:"9.5",r:"2",fill:"#005622"})]})]})})}},90901:(e,t,n)=>{n.d(t,{I:()=>c,q:()=>l});n(98992),n(8872);var r=n(96540),o=n(88934),i=n(24013),s=n(19186);const a=(e,t)=>t?e[t]:e,l=e=>{const t=(0,i.BU)(),n=(0,i.Gt)(t);return(0,r.useMemo)((()=>n.reduce(((t,n)=>{const{capabilities:{ml:r}}=n;return r?.enabled?t.predicting=[...t.predicting,a(n,e)]:t.incapable=[...t.incapable,a(n,e)],t}),{predicting:[],incapable:[]})),[t.length,e])},c=e=>{const t=(0,o.Zp)(),n=(()=>{const e=(0,s.r9)();return e&&`${e}/anomalies`})();return(0,r.useCallback)((function(){t(n,{state:{nodeId:arguments.length>0&&void 0!==arguments[0]?arguments[0]:e}})}),[n,t])}},91100:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(63766),o=n(9962),i=n(19075),s=n(2626),a=n(74848);const l=e=>{let{critical:t,warning:n,error:i,testPrefix:s,...l}=e;const c=(0,o.I)({error:i,testPrefix:s,flavour:t?"error":"disabledError",value:t}),d=(0,o.I)({error:i,testPrefix:s,flavour:n?"warning":"disabledWarning",value:n});return(0,a.jsx)(r.Flex,{...l,children:(0,a.jsx)(r.MasterCard,{"data-testid":"alertsMastercard",pillLeft:c,pillRight:d,size:"small"})})},c=e=>{let{id:t,testPrefix:n,...r}=e;const o=(0,s.Xt)(t),{critical:c,warning:d}=(0,i.AO)(o);return(0,a.jsx)(l,{"data-testid":"alerts",testPrefix:n,critical:c,warning:d,...r})}},93335:(e,t,n)=>{n.d(t,{N:()=>d,W:()=>u});var r=n(19075),o=n(2626),i=n(87083),s=n(41716),a=n(91100),l=n(74848);const c=e=>{let{critical:t,warning:n,error:r}=e;return(0,l.jsx)(a.A,{critical:t,"data-testid":"tabAlerts",error:r,testPrefix:"tabAlerts-alert",warning:n,margin:[0,0,0,1]})},d=e=>{let{nodeId:t}=e;const n=(0,o.Xt)(t),{critical:i,warning:s}=(0,r.AO)(n);return(0,l.jsx)(c,{critical:i,warning:s})},u=()=>{const e=(0,i.w7)({emptyIfAll:!1}),t=(0,o.YS)(e),n=(0,s.s)("error"),{critical:a,warning:d}=(0,r.AO)(t);return(0,l.jsx)(c,{critical:a,warning:d,error:n})}},95836:(e,t,n)=>{n.d(t,{$:()=>u});var r=n(63766),o=n(45087),i=n(4719),s=n(549),a=n(27496),l=n(74848);const c=e=>{let{name:t,tiny:n,...o}=e;const i=n?r.Text:r.H3;return"string"===typeof t?(0,l.jsx)(i,{strong:!0,...o,children:t}):t||null},d=(0,s.A)((e=>{let{hasTooltip:t,hasInfo:n,...r}=e;return t&&n?(0,l.jsx)(o.A,{content:(0,l.jsx)(a.n,{id:r.id}),isBasic:!0,children:(0,l.jsx)(c,{...r})}):(0,l.jsx)(c,{...r})})),u=(0,i.aV)(d,(e=>{let{name:t,info:n,...r}=e;return{name:t,hasInfo:!!n,...r}}))},96026:(e,t,n)=>{n.d(t,{l:()=>h,q:()=>u});n(25509),n(65223),n(60321),n(41927),n(11632),n(64377),n(66771),n(12516),n(68931),n(52514),n(35694),n(52774),n(49536),n(21926),n(94483),n(16215);var r=n(96540),o=n(88934),i=n(42790),s=n(61841),a=n(24609),l=n(24013),c=n(19075),d=n(91421);const u=e=>{let{alertId:t,alertName:n,nodeIds:i=[]}=e;const a=(0,o.Zp)(),{setState:u}=(0,d.$h)(),[h]=(0,s.Ay)(),{name:x}=(0,c.JL)(t),g=n||x,{isParent:m}=(0,l.xY)(i[0]),{loaded:p,value:f,hasError:j,error:b}=(0,d.wd)({node:{value:i[0],isParent:m},path:"/health"}),v=!!f?.tree?.["/health/alerts/prototypes"]?.[`health:alert:prototype:${g}`],[,y]=(0,d.PJ)();return{canEdit:p&&!j&&v,goToEdit:(0,r.useCallback)((e=>{i=e?Array.from(new Set([e,...i])):i,u({alertName:g,isAlert:!0}),y(!0,{nodeId:i[0]})}),[g,i,h,u,a]),error:b?.errorMessage||b}},h=()=>{const e=(0,o.Zp)(),{slug:t}=(0,a.ap)(),n=(0,i.rI)();return(0,r.useCallback)((r=>{r&&(n((e=>({...e,dyncfgSearchTerm:r}))),e(`/spaces/${t}/settings/configurations`,{replace:!0}))}),[e,n,t])}}}]);