File: //opt/netdata/usr/share/netdata/web/v3/7742.3c44fea9b4f0e49e7405.chunk.js
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"9170653e16c97eceaa1ad9e3f6f38e5725ee9d53"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="81dc7d0f-6077-4451-8758-42b429f281fb",e._sentryDebugIdIdentifier="sentry-dbid-81dc7d0f-6077-4451-8758-42b429f281fb")}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[6026,7742],{72060(e,t,n){n.d(t,{A:()=>r});n(27495),n(62953),n(3296),n(27208),n(48408);const r=e=>{try{if(!e)return null;const t=document.createElement("a");return t.href=e,/https?/.test(t.protocol)?new URL(t.protocol+"//"+t.host+t.pathname+t.search+t.hash).toString():null}catch(t){return null}}},82507(e,t,n){n.d(t,{A:()=>s});var r=n(51510),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"})]})]})})}},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"})]})]})}},73090(e,t,n){n.r(t),n.d(t,{SettingsContainer:()=>Fh,default:()=>Lh});n(62953),n(3296),n(27208),n(48408);var r=n(96540),o=n(39175),i=n(78152),s=n(7960),a=n(19707),l=n(72060),c=n(55164),d=n(63474),u=n(62718),p=n(37617),h=n(1174),g=n(92318),f=n(99728),x=n(99094),m=n(64467),b=(n(98992),n(54520),n(72577),n(3949),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)),j=n(41344),y=n(91539),v=n(24609),O=n(19186),w=n(18739),C=n(58247),P=n(16922),I=n(81685),A=n(22068),k=n(55048),S=n(63872),D=n(44245),M=n(77234),T=n(54264),N=n(4204);function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const L=()=>{const e=(0,v.vt)(),t=(0,O.ID)(),{refresh:n}=(0,w.JN)(),o=(0,f.JT)("insights:ReadReport"),[i,s]=(0,A.A)(),[a,l]=(0,k.A)(),[c,d]=(0,S.A)(),{pathname:u}=(0,j.zy)(),p=u.includes(M.x.insights)&&!u.includes(x.p9),[,,,h]=(0,I.W5)(),[,g]=(0,D.m0)({tabId:M.x.insights}),[m]=(0,I.ly)(),[F]=(0,I.uN)(),L=(0,b.yF)((0,r.useCallback)(((r,o,u)=>{let{data:f}=u;const m=(null===f||void 0===f?void 0:f.reports)||[],b=i(),j=a(),y=m.filter((e=>{let{status:t,isScheduled:n}=e;return!n&&!x.bs.includes(t)})).map((e=>{let{id:t}=e;return t})),v=b.filter((e=>y.includes(e))),O=v.filter((e=>!j.includes(e))),{COMPLETED:w,FAILED:C}=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?E(E({},t),{},{[r.status]:[...t[r.status]||[],r.id]}):t}),{COMPLETED:[],FAILED:[]})}(O,m);if(O.length&&(w.length&&c({header:"New report",text:"A new report has been generated!"}),C.length&&(s(b.filter((e=>!C.includes(e)))),d({header:"Error",text:"Failed to generate report."})),l(Array.from(new Set([...j,...O.filter((e=>!C.includes(e)))]))),(w.length||C.length)&&(h(),n()),!p&&w.length+C.length>0)){const e=w.length>0?"success":"error";g({color:e})}o((0,P.Tj)({spaceId:e,roomId:t}),(e=>E(E({},e),{},{loaded:!0,reports:m.map((e=>E(E({},e),{},{isUnread:v.includes(e.id)})))})))}),[e,t,i,s,a,l,h,n,c,d,p,g])),R=(0,b.yF)((0,r.useCallback)(((n,r,o)=>{r((0,P.Tj)({spaceId:e,roomId:t}),(e=>{var t;return E(E({},e),{},{loaded:!0,error:(null===o||void 0===o||null===(t=o.response)||void 0===t?void 0:t.data)||"Something went wrong"})}))}),[e,t]));return(0,y.A)((()=>({enabled:F&&!N.ei&&o&&!!e&&!!t,force:!0,polling:F&&!!m.length,fetch:()=>(e=>{let{spaceId:t,roomId:n}=e;const r=(0,C.eF)({spaceId:t,roomId:n}),o=(0,C.XN)({spaceId:t,roomId:n});return Promise.all([r,o]).then((e=>{var t;let[n,r]=e;const o=[...(null===n||void 0===n||null===(t=n.data)||void 0===t?void 0:t.reports)||[],...((null===r||void 0===r?void 0:r.data)||[]).map((e=>E(E({},e),{},{isScheduled:!0})))];return Promise.resolve({data:{reports:o}})}))})({spaceId:e,roomId:t}),onFail:R,onReceive:L,pollingOptions:{pollingInterval:p?5e3:15e3,checkPauseCondition:T.$}})),[e,t,p,o,F,m.length])};var R=n(10602),B=n(37479),V=n(60908),H=n(85660),_=n(88255),z=n(50271),K=n(24013),G=n(87083),W=n(80045),U=(n(42762),n(49435)),q=n(42790),J=n(34843),$=n(52035),Y=n(18790);const Z={filteredNodesIds:[],filteredNodesCount:0,nodesCount:0},X=(0,Y.I)((()=>(0,$.eU)(Z))),Q=["name"],ee=()=>{const e=(0,O.ID)();return(0,J.md)(X(e))},te=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView";const t=(0,O.ID)();return(0,q.rW)("tocSearch",{key:t,extraKey:e,defaultValue:"",flavour:"val"})},ne=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=ne(r,t);e>n&&(n=e)}return n}if("object"===typeof e){let n=0;for(const r in e){const o=ne(e[r],t);o>n&&(n=o)}return n}return 0},re=["version","labels","hw","os","state","nodeStatus","health","replicationFactor","replication","technology"],oe=function(e,t){let{shouldHide:n=()=>!1,cacheKey:o,extraKey:i="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=(0,K.Gt)(e),a=function(){const e=te(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}=t,i=(0,W.A)(t,Q);r=t.name?(0,U.pe)(e,a):0,o=ne(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return re.reduce(((t,n)=>(void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]),t)),{})}(i),(e=>(0,U.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,n]),u=(()=>{const e=(0,O.ID)();return(0,J.Xr)(X(e))})(),p=(0,r.useMemo)((()=>l.map((e=>{let{id:t}=e;return t}))),[l]),h=(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:p,filteredNodesCount:d,nodesCount:c})}),[p,c,d,t]),[p,h,c]};var ie=n(23565),se=n(87733),ae=n(83330),le=n(97572),ce=n(42358),de=n(41514),ue=n(68531),pe=n(74848);const he=e=>{let{extraKey:t}=e;const[n,o]=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nodesView";const t=(0,O.ID)();return(0,q.N9)("tocSearch",{key:t,extraKey:e,defaultValue:"",flavour:"val"})}(t),[i,s]=(0,r.useState)(n||"");return(0,ue.A)((()=>{o(i),(0,de.H)("toc-search","search-automatic-trigger","nodes-view",i)}),300,[i]),(0,r.useEffect)((()=>{n!==i&&s(n)}),[n]),(0,pe.jsx)(ce.TextInput,{iconLeft:(0,pe.jsx)(ce.Icon,{name:"search",color:i?"textFocus":"textLite",width:"14px",height:"14px"}),iconRight:!!i&&(0,pe.jsx)(ce.IconButton,{icon:"x",iconColor:i?"textFocus":"textLite",width:"14px",height:"14px",onClick:()=>{s(""),(0,de.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 ge=n(73700);const fe=(0,ge.s)(300,((e,t)=>(0,de.H)("toc-search","search-results","nodes-view",e,"".concat(t," -- nodes")))),xe=()=>{const e=te(),{filteredNodesCount:t,nodesCount:n}=ee();return(0,r.useEffect)((()=>{e&&fe(e,t)}),[e,t]),(0,pe.jsx)(pe.Fragment,{children:(0,pe.jsxs)(ce.TextMicro,{alignSelf:"end",color:"textLite",margin:[1,0,0],"data-testid":"numberOfNodesIndication",children:["Showing"," ",(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-filteredNodesCount",children:t})," ","of total"," ",(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfNodesIndication-nodesCount",children:n})," ","nodes"]})})},me=()=>{const{filteredNodesCount:e}=ee();return e?null:(0,pe.jsxs)(ce.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription"}),(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})},be=e=>{let{extraKey:t}=e;return(0,pe.jsxs)(ce.Flex,{column:!0,alignItems:"center",children:[(0,pe.jsx)(he,{extraKey:t}),(0,pe.jsx)(xe,{}),(0,pe.jsx)(me,{})]})};var je=n(79748);const ye=()=>(0,pe.jsxs)(ce.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,pe.jsx)(ce.Box,{margin:[0,4,0,0],children:(0,pe.jsx)(ce.Box,{as:ce.Icon,width:10,height:10,name:"nodes_update"})}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:2,children:[(0,pe.jsx)(ce.Text,{strong:!0,children:"Couldn't find the node you were looking for? "}),(0,pe.jsxs)(ce.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,pe.jsx)(je.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."]})]})]}),ve=e=>{let{children:t}=e;return(0,pe.jsxs)(ce.Flex,{column:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",gap:4,children:[(0,pe.jsxs)(ce.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,pe.jsx)(ce.H3,{margin:[0,0,4],children:"No nodes to display"}),(0,pe.jsx)(ce.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),t,(0,pe.jsx)(ye,{})]})};var Oe=n(50694),we=n(41061),Ce=n(6304),Pe=n(63589),Ie=n(89590),Ae=n(51571),ke=n(32788),Se=n(29263),De=n(47410),Me=n(32052),Te=n(22871),Ne=n(25291),Fe=n(24582);const Ee=["title","help","link","disclaimer","children"];function Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Be=e=>{let{link:t,children:n}=e;return(0,pe.jsxs)(ce.Flex,{as:"a",target:"_blank",href:t,gap:1,alignItems:"end",children:[(0,pe.jsx)(ce.TextNano,{textDecoration:"undeline",children:n}),(0,pe.jsx)(ce.Icon,{color:"text",name:"question",width:"16px",height:"16px"})]})},Ve=e=>{let{title:t,help:n,link:r,disclaimer:o,children:i}=e,s=(0,W.A)(e,Ee);return(0,pe.jsxs)(ce.Flex,Re(Re({gap:1,column:!0},s),{},{children:[(0,pe.jsxs)(ce.Flex,{justifyContent:"between",alignItems:"baseline",children:[(0,pe.jsx)(ce.Text,{as:"label",margin:[0],children:t}),n&&(0,pe.jsx)(Be,{link:r,children:n})]}),i,o&&(0,pe.jsx)(ce.TextSmall,{children:o})]}))};var He=n(91130),_e=n(16866);const ze=e=>{let{dimensions:t}=e;return{dimensions:t.map((e=>{let{name:t}=e;return{value:t,label:t}}))}};n(26910),n(53921);const Ke=[{value:"version",label:"Netdata Version"},{value:"nodeStatus",label:"Node Status"},{value:"os.nm",label:"OS Name"},{value:"os.v",label:"OS Version"},{value:"os.kernel.nm",label:"Kernel"},{value:"os.kernel.v",label:"Kernel Version"},{value:"hw.architecture",label:"Architecture"},{value:"hw.cpuFrequency",label:"CPU Frequency"},{value:"hw.cpus",label:"CPU Cores"},{value:"hw.memory",label:"Memory"},{value:"hw.diskSpace",label:"Disk Space"}],Ge=Object.fromEntries(Ke.map((e=>{let{value:t,label:n}=e;return[t,n]}))),We=()=>{const e=(0,K.Gt)();return(0,r.useMemo)((()=>{const t=new Set;e.forEach((e=>{e.labels&&Object.keys(e.labels).forEach((e=>t.add(e)))}));const n=Array.from(t).sort().map((e=>({value:"labels.".concat(e),label:e})));return[...Ke,...n]}),[e])},Ue=["spaceId","roomId","id","onClose","tabId"];function qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const $e=e=>{let{isNew:t}=e;return(0,pe.jsxs)(ce.Flex,{as:"span",gap:1,children:["Manage room",(0,pe.jsx)(ce.TextBig,{color:"textLite",children:"/"}),(0,pe.jsxs)(ce.TextBig,{color:"textLite",children:[t?"Add":"Edit"," Column"]})]})},Ye=[{value:"value",label:"Value"},{value:"progressBar",label:"Progress Bar"}],Ze=[{value:"sum",label:"Sum"},{value:"avg",label:"Average"},{value:"min",label:"Minimum"},{value:"max",label:"Maximum"}],Xe=[{value:"left",label:"Left"},{value:"center",label:"Center"},{value:"right",label:"Right"}],Qe=e=>{let{spaceId:t,roomId:n,id:o,onClose:i,tabId:s}=e,a=(0,W.A)(e,Ue);const l="new"===o,c=(0,Te.uB)(n,o),d=(0,Te.e6)(n,o),[u,p]=(0,r.useState)(d),{title:h,context:g,dimensions:f=[],totalDimensions:x=[],calculateTotal:m=!1,columnFlavour:b="value",aggregation:j="sum",fractionDigits:y=1,hideUnits:v=!1,align:O="center",category:w="Metrics",accessorKey:C="",fallbackKeys:P=[]}=u;(0,r.useEffect)((()=>{l&&c()}),[]);const I=(0,G.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),A=(0,Ne.A)(n,I,{spaceId:t});if(A)throw A;const k=(0,Fe.OL)(n),S=(0,r.useMemo)((()=>k.map((e=>({value:e,label:e})))),[k]),D=(0,Fe._0)(n),M=We(),T="Labels"===w,N=(0,r.useMemo)((()=>g&&{value:g,label:g}),[g]),[{dimensions:F},E]=(0,Me.A)((()=>({enabled:!!g,fetch:()=>((e,t,n)=>He.A.get("".concat(_e.P8,"/spaces/").concat(e,"/rooms/").concat(t,"/contexts/").concat(encodeURIComponent(n)),{transform:ze}))(t,n,g),initialValue:{dimensions:[]}})),[t,n,g]),L=(0,r.useCallback)((e=>{let{value:t}=e;p((e=>Je(Je({},e),{},{context:t,dimensions:[],title:t})))}),[]),R=(0,r.useMemo)((()=>F?0===f.length?[]:f.map((e=>({value:e,label:e}))):[]),[f,F]),B=(0,r.useMemo)((()=>F?0===x.length?[]:x.map((e=>({value:e,label:e}))):[]),[x,F]),V=(0,r.useMemo)((()=>Ze.find((e=>e.value===(j||"sum")))),[j]),H=(0,r.useMemo)((()=>{var e;return{value:O,label:null===(e=Xe.find((e=>e.value===O)))||void 0===e?void 0:e.label}}),[O]),_=(0,r.useMemo)((()=>P.map((e=>M.find((t=>t.value===e))||{value:e,label:e}))),[P,M]),z=(0,r.useMemo)((()=>C?M.find((e=>e.value===C))||{value:C,label:C}:null),[C,M]),K=(0,r.useMemo)((()=>M.filter((e=>e.value!==C))),[M,C]),U=(0,r.useCallback)((e=>{E||p((t=>Je(Je({},t),{},{dimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[E]),q=(0,Te.tQ)(n),J=(0,r.useCallback)((()=>q(Je(Je({},u),{},{id:o,type:s})).then(i)),[u,o,s,i,q]),$=(0,r.useCallback)((e=>{let{target:{value:t}}=e;t.length<=30&&p((e=>Je(Je({},e),{},{title:t,header:t,headerString:t})))}),[]),Y=(0,r.useCallback)((e=>{E||p((t=>Je(Je({},t),{},{totalDimensions:e.map((e=>{let{label:t}=e;return t}))})))}),[E]),Z=(0,r.useCallback)((e=>{let{value:t}=e;p((e=>Je(Je({},e),{},{columnFlavour:t,calculateTotal:"value"!==t&&e.calculateTotal})))}),[]),X=(0,r.useCallback)((e=>{let{value:t}=e;p((e=>Je(Je({},e),{},{aggregation:t})))}),[]),Q=(0,r.useCallback)((e=>{let{value:t}=e;p((e=>Je(Je({},e),{},{align:t})))}),[]),ee=(0,r.useCallback)((e=>{let{target:{value:t}}=e;const n=parseInt(t,10);!isNaN(n)&&n>=0&&n<=3&&p((e=>Je(Je({},e),{},{fractionDigits:n})))}),[]),te=(0,r.useCallback)((e=>{let{target:{checked:t}}=e;p((e=>Je(Je({},e),{},{hideUnits:t})))}),[]),ne=(0,r.useCallback)((e=>{let{target:{checked:t}}=e;p((e=>Je(Je({},e),{},{calculateTotal:t,totalDimensions:t?e.totalDimensions:[]})))}),[]),re=(0,r.useCallback)((e=>{const t=e.target.value;p((e=>Je(Je({},e),{},{category:t,columnFlavour:"Labels"===t?"metadata":"metadata"===e.columnFlavour?"value":e.columnFlavour,align:"Labels"===t?"left":e.align,accessorKey:"Labels"===t?e.accessorKey:"",fallbackKeys:"Labels"===t?e.fallbackKeys:[],context:"Metrics"===t?e.context:"",dimensions:"Metrics"===t?e.dimensions:[]})))}),[]),oe=(0,r.useCallback)((e=>{let{value:t,label:n}=e;p((e=>Je(Je({},e),{},{accessorKey:t,title:e.title||n,header:e.title||n,headerString:e.title||n})))}),[]),ie=(0,r.useCallback)((e=>{p((t=>Je(Je({},t),{},{fallbackKeys:e.map((e=>{let{value:t}=e;return t}))})))}),[]),se=!h||(T?!C:!g);return(0,pe.jsxs)(ke.GO,Je(Je({onClose:i},a),{},{children:[(0,pe.jsx)(Se.z,{onClose:i,title:(0,pe.jsx)($e,{isNew:l}),children:(0,pe.jsx)(ce.Button,{label:"Save",onClick:J,disabled:se})}),(0,pe.jsx)(De.U,{children:l?"Add a new column":"Edit ".concat(T?"attribute":"metric")}),(0,pe.jsx)(ke.Yv,{children:(0,pe.jsxs)(ce.Flex,{gap:6,column:!0,children:[(0,pe.jsx)(Ve,{title:"Column Type","data-testid":"manageMetrics-category",children:(0,pe.jsxs)(ce.Flex,{gap:4,children:[(0,pe.jsx)(ce.RadioButton,{label:"Metrics",checked:"Metrics"===w,onChange:re,value:"Metrics","data-testid":"manageMetrics-categoryMetrics"}),(0,pe.jsx)(ce.RadioButton,{label:"Labels",checked:"Labels"===w,onChange:re,value:"Labels","data-testid":"manageMetrics-categoryLabels"})]})}),T?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ve,{title:"Attribute","data-testid":"manageMetrics-accessorKey",children:(0,pe.jsx)(ce.Select,{options:M,value:z,onChange:oe,"data-testid":"manageMetrics-accessorKeySelect"})}),(0,pe.jsx)(Ve,{title:"Column Title","data-testid":"manageMetrics-title",children:(0,pe.jsx)(ce.TextInput,{name:"title",placeholder:"Type name",value:h,onChange:$})}),(0,pe.jsx)(Ve,{title:"Fallback Keys",disclaimer:"Alternative attribute paths to check if the primary attribute is empty.","data-testid":"manageMetrics-fallbackKeys",children:(0,pe.jsx)(ce.Select,{isMulti:!0,options:K,value:_,onChange:ie,"data-testid":"manageMetrics-fallbackKeysSelect"})}),(0,pe.jsx)(Ve,{title:"Text Alignment","data-testid":"manageMetrics-align",children:(0,pe.jsx)(ce.Select,{options:Xe,value:H,onChange:Q,"data-testid":"manageMetrics-alignSelect"})})]}):(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ve,{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,pe.jsx)(ce.Select,{options:S,value:N,onChange:L,isLoading:!D,"data-testid":"manageMetrics-contextSelect"})}),(0,pe.jsx)(Ve,{title:"Column Title","data-testid":"manageMetrics-title",children:(0,pe.jsx)(ce.TextInput,{name:"title",placeholder:"Type name",value:h,onChange:$})}),(0,pe.jsx)(Ve,{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,pe.jsx)(ce.Select,{isMulti:!0,options:F,value:R,onChange:U,isLoading:E,isDisabled:!N,"data-testid":"manageMetrics-dimensionSelect"})}),(0,pe.jsx)(Ve,{title:"Display Type","data-testid":"manageMetrics-columnFlavour",children:(0,pe.jsx)(ce.Select,{options:Ye,value:{value:b,label:"value"===b?"Value":"Progress Bar"},onChange:Z,"data-testid":"manageMetrics-columnFlavourSelect"})}),(0,pe.jsx)(ce.Toggle,{labelRight:"Calculate as percentage of total",checked:m,onChange:ne,"data-testid":"manageMetrics-calculateTotalToggle",colored:!0}),m&&(0,pe.jsx)(Ve,{title:"Total Dimensions",disclaimer:"Dimensions to use for total calculation. Leave blank to use all available dimensions.","data-testid":"manageMetrics-totalDimensions",children:(0,pe.jsx)(ce.Select,{isMulti:!0,options:F,value:B,onChange:Y,isLoading:E,isDisabled:!N,"data-testid":"manageMetrics-totalDimensionSelect"})}),(0,pe.jsx)(Ve,{title:"Aggregation","data-testid":"manageMetrics-aggregation",children:(0,pe.jsx)(ce.Select,{options:Ze,value:V,onChange:X,"data-testid":"manageMetrics-aggregationSelect"})}),(0,pe.jsx)(Ve,{title:"Decimal Places","data-testid":"manageMetrics-fractionDigits",children:(0,pe.jsx)(ce.TextInput,{type:"number",name:"fractionDigits",min:"0",max:"3",value:y,onChange:ee})}),(0,pe.jsx)(Ve,{title:"Hide Units","data-testid":"manageMetrics-hideUnits",children:(0,pe.jsx)(ce.Toggle,{checked:v,onChange:te,"data-testid":"manageMetrics-hideUnitsToggle"})}),(0,pe.jsx)(Ve,{title:"Text Alignment","data-testid":"manageMetrics-align",children:(0,pe.jsx)(ce.Select,{options:Xe,value:H,onChange:Q,"data-testid":"manageMetrics-alignSelect"})})]})]})})]}))};var et=n(49163),tt=n(45087),nt=n(43375),rt=n(43627),ot=n(74979);const it=e=>{let{onConfirm:t,children:n}=e;const[o,i]=(0,r.useState)(!1),s=(0,r.useCallback)((()=>{i(!1),t()}),[t]),a=(0,r.useCallback)((()=>{i(!1)}),[]);return o?(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Text,{color:"textLite",whiteSpace:"nowrap",children:"Delete?"}),(0,pe.jsx)(ce.IconButton,{icon:"checkmark_s",flavour:"borderless",padding:[0],onClick:s,width:"12px",height:"12px",title:"Confirm delete"}),(0,pe.jsx)(ce.IconButton,{icon:"x",flavour:"borderless",padding:[0],onClick:a,width:"12px",height:"12px",title:"Cancel"})]}):n((()=>i(!0)))};function st(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?st(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):st(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const lt={sum:"sum",avg:"average",min:"minimum",max:"maximum"},ct=e=>Ge[e]?Ge[e]:e.startsWith("labels.")?e.slice(7):e,dt=e=>{if("Labels"===e.category){var t;const n=["Node attribute column."];if(e.accessorKey&&n.push("Shows the ".concat(ct(e.accessorKey)," attribute.")),null!==(t=e.fallbackKeys)&&void 0!==t&&t.length){const t=e.fallbackKeys.map(ct).join(", ");n.push("Falls back to ".concat(t," when not available."))}return n.join(" ")}const n=["Metric column."];if(e.context){var r;const t=null!==(r=e.dimensions)&&void 0!==r&&r.length?e.dimensions.join(", "):"all available dimensions",o=lt[e.aggregation]||"sum";n.push("Shows ".concat(o," of ").concat(t," from ").concat(e.context,"."))}return"progressBar"===e.columnFlavour&&n.push("Displayed as a progress bar."),e.calculateTotal&&n.push("Calculated as percentage of total."),n.join(" ")},ut=e=>{let{metric:t,onToggle:n,onEdit:r,onDelete:o,disabled:i}=e;const{attributes:s,listeners:a,setNodeRef:l,transform:c,transition:d}=(0,rt.gl)({id:t.id}),u={transform:ot.Ks.Transform.toString(c),transition:d};return(0,pe.jsx)("div",at(at({ref:l,style:u},s),{},{children:(0,pe.jsxs)(ce.Flex,{"data-testid":"metricsMenu-metric-".concat(t.title),justifyContent:"between",alignItems:"center",padding:[1,0],gap:2,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,flex:!1,children:[!i&&(0,pe.jsx)(ce.Icon,at({name:"nav_dots",color:"textLite",cursor:"grab",size:"small"},a)),(0,pe.jsx)(tt.A,{content:dt(t),children:(0,pe.jsx)(ce.Icon,{name:"Labels"===t.category?"node_hollow":"room_overview",color:"textLite",size:"small"})})]}),(0,pe.jsx)(ce.Checkbox,{checked:!t.hidden,"data-testid":"metricsMenu-metricCheckbox",label:t.title,onChange:n,labelProps:{wordBreak:"break-word"}})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.IconButton,{"data-testid":"metricsMenu-editMetric",flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:r,width:"10px",height:"10px"}),(0,pe.jsx)(it,{onConfirm:o,children:e=>(0,pe.jsx)(ce.IconButton,{"data-testid":"metricsMenu-deleteMetric",flavour:"borderless",icon:"trashcan",padding:[0],onClick:e,width:"10px",height:"10px"})})]})]})}))};function pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ht(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const gt=e=>{let{isOpen:t,onClose:n,onEdit:o,roomId:i,targetRef:s,tabId:a,metricsType:l}=e;const[c,d]=(0,Te.tY)(i),u=l||a,p=(0,r.useMemo)((()=>{const e=c.filter((e=>e.type===a));return e.length>0?e:c.filter((e=>e.type===u))}),[a,u,c]),[h,g]=(0,r.useState)(p.map((e=>e.id)));(0,r.useEffect)((()=>{g(p.map((e=>e.id)))}),[p]);const f=(0,nt.FR)((0,nt.MS)(nt.AN),(0,nt.MS)(nt.uN,{coordinateGetter:rt.JR})),x=(0,Te._E)(i,a),m=(0,Te.gV)(i),b=(0,r.useCallback)((e=>{const{active:t,over:n}=e;if(null!==t&&void 0!==t&&t.id&&null!==n&&void 0!==n&&n.id&&t.id!==n.id){const e=h.indexOf(t.id),r=h.indexOf(n.id),o=(0,rt.be)(h,e,r);g(o),x(o)}}),[h,x]),j=(0,et._)({roomId:i,params:{type:"roomMetrics",entity:"metrics",path:"/nodes"}})[0],y=(0,Te.Ul)(i,a,l);if(!s.current||!t)return null;const v=e=>{o(e),n()};return(0,pe.jsxs)(ce.Drop,{align:{top:"bottom",right:"right"},animation:!0,background:"dropdown",column:!0,margin:[.5,0,0],overflow:"hidden",padding:[2],round:!0,width:80,close:n,"data-testid":"metricsMenu",onClickOutside:n,onEsc:n,target:s.current,gap:1,children:[(0,pe.jsx)(nt.Mp,{sensors:f,collisionDetection:nt.fp,onDragEnd:b,children:(0,pe.jsx)(rt.gB,{items:h,strategy:rt._G,children:(0,pe.jsx)(ce.Flex,{column:!0,width:"100%",children:h.map((e=>{const t=p.find((t=>t.id===e));return t?(0,pe.jsx)(ut,{metric:t,onToggle:()=>d(t.id,(e=>ht(ht({},e),{},{hidden:!e.hidden,type:a}))),onEdit:()=>v(t.id),onDelete:()=>{return e=t.id,void m(e);var e},disabled:!1},t.id):null}))})})}),(0,pe.jsx)(ce.Button,{"data-testid":"metricsMenu-addMetricButton",label:"Add new column",icon:"plus",onClick:()=>v("new"),small:!0,alignSelf:"end"}),j&&(0,pe.jsx)(tt.A,{content:"All columns will be reset to defaults",children:(0,pe.jsx)(ce.Button,{padding:[0],"data-testid":"metricsMenu-resetButton",label:"Reset to default columns",flavour:"borderless",onClick:y,small:!0,danger:!0,alignSelf:"end"})})]})},ft=e=>{let{spaceId:t,roomId:n,tabId:o,metricsType:i}=e;const[s,,a,l]=(0,Ce.A)(),[c,d]=(0,r.useState)(null),u=(0,r.useRef)();return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ae.A,{permission:"space:UpdateSettings",ifForbidden:"hide","data-ga":"metric-setting::click-metric-setting::hm-nodes","data-testid":"metricSettings-button",flavour:"hollow",icon:"gear",neutral:!0,onClick:a,ref:u,label:"Columns",small:!0}),(0,pe.jsx)(gt,{isOpen:s,onClose:l,onEdit:d,roomId:n,tabId:o,metricsType:i,targetRef:u}),c&&(0,pe.jsx)(Qe,{"data-testid":"metricsManagement",spaceId:t,roomId:n,tabId:o,metricsType:i,id:c,onClose:()=>d(null)})]})};var xt=n(94404);const mt=()=>(0,de.H)("grouping","click-grouping","hm-nodes"),bt=(0,xt.A)(Pe.A),jt=[{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"}],yt=()=>{const e=(0,v.vt)(),t=(0,O.ID)(),[n,,o,i]=(0,Ce.A)(),[s,a]=(0,z.TS)(t,"groupMode"),l=(0,r.useMemo)((()=>jt.find((e=>e.value===s))||jt[0]),[s]),c=(0,r.useCallback)((e=>{let{value:t}=e;return a(t)}),[a]);return(0,pe.jsxs)(ce.Flex,{alignItems:"center","data-testid":"agentsHead-actions",flexWrap:!1,gap:3,children:[(0,pe.jsx)(ce.Select,{label:"Group by",onChange:c,onMenuOpen:mt,options:jt,value:l}),(0,pe.jsx)(ft,{roomId:t,spaceId:e}),n&&(0,pe.jsx)(Ie.A,{onClose:i}),(0,pe.jsx)(bt,{"data-ga":"add-nodes::click-add-nodes::hm-nodes","data-testid":"agentsHead-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:o,small:!0})]})},vt=()=>(0,pe.jsx)(ce.Flex,{width:"100%",justifyContent:"end",background:"mainBackground",padding:[2],children:(0,pe.jsx)(yt,{})});var Ot=n(85163),wt=n(84535);function Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ct(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const It=function(e,t){let{getGrouping:n,extraKey:r,searchScores:o,groupMode:s}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={},l={};((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]=Pt(Pt({},t),{},{groupId:i,subMenuId:e,priority:s,groupIcon:a})})),[...e].sort(((e,t)=>{var n,r,i,a,l,c;const d=(null===s||void 0===s?void 0:s[e])||0,u=(null===s||void 0===s?void 0:s[t])||0;if(u!==d)return u-d;const p=((null===(n=o[e])||void 0===n?void 0:n.priority)||0)-((null===(r=o[t])||void 0===r?void 0:r.priority)||0);if(0!==p)return p;const h=((null===(i=o[e])||void 0===i?void 0:i.groupId)||"").localeCompare((null===(a=o[t])||void 0===a?void 0:a.groupId)||"",void 0,{sensitivity:"accent",ignorePunctuation:!0});return 0!==h?h:((null===(l=o[e])||void 0===l?void 0:l.name)||"").localeCompare((null===(c=o[t])||void 0===c?void 0:c.name)||"",void 0,{sensitivity:"accent",ignorePunctuation:!0})})).forEach((e=>{const t=o[e];if(!t)return;const n="".concat(t.groupId,"|").concat(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:a,menusById:l,searchScores:o});const c=Object.keys(l).reduce(((e,t)=>{const{nodeIds:n}=l[t],o=a[n[0]];return e[t]={level:0,name:o.groupId,id:t,childrenIds:n,link:"".concat((0,Ot.A)("menu_".concat(t))),size:24,forceVisibility:!0,icon:o.groupIcon,extraKey:r,styleProps:{important:!1,grouping:!0}},n.forEach((n=>{var o,i,s,l;const c=a[n],d=wt.u[(null===(o=c.os)||void 0===o?void 0:o.nm)||(null===(i=c.labels)||void 0===i?void 0:i.os_name)]||wt.U[null===(s=c.os)||void 0===s?void 0:s.id]||wt.u[null===(l=c.labels)||void 0===l?void 0:l.vendor];e[n]=Pt(Pt({},c),{},{level:1,id:n,menuId:t,link:"".concat((0,Ot.A)("menu_".concat(t,"_submenu_").concat(n))),size:24,forceVisibility:!0,icon:(null===d||void 0===d?void 0:d.iconName)||(null===d||void 0===d?void 0:d.logoFilename)&&"".concat(g.A.assetsBaseURL,"/img/logos/os/").concat(d.logoFilename)||"os",extraKey:r})})),e}),{}),d=Object.keys(l);let u=-1;const p=d.reduce(((e,t)=>{if(u+=1,!i.f9){const n=Pt(Pt({},c[t]),{},{sticky:!0});return[...e,n,...c[t].childrenIds.reduce(((e,t)=>{u+=1;return[...e,c[t]]}),[])]}return s?[...e,Pt(Pt({},c[t]),{},{isGroup:!0,children:c[t].childrenIds.reduce(((e,t)=>{u+=1;return[...e,c[t]]}),[])})]:[...e,...c[t].childrenIds.reduce(((e,t)=>{u+=1;return[...e,c[t]]}),[])]}),[]);return a=null,l=null,{stickyIds:{},allElements:p,menuIds:d,menuById:c}},At="clear",kt="warning",St="critical",Dt="unreachable";var Mt=n(58243),Tt=n(49181);const Nt={alertStatus:{[St]:1,[kt]:2,[At]:3,[Dt]:4},nodeStatus:{Live:1,Stale:2,Offline:3}},Ft={nodeStatus:e=>(0,Tt.GM)(e.state),alertStatus:e=>(0,Tt.vt)(e),vendor:e=>{var t;return(null===(t=e.labels)||void 0===t?void 0:t.vendor)||"Unknown"},type:e=>{var t;return(null===(t=e.labels)||void 0===t?void 0:t.type)||"Unknown"},location:e=>{var t,n;return(null===(t=e.labels)||void 0===t?void 0:t.sysLocation)||(null===(n=e.labels)||void 0===n?void 0:n.location)||"Unknown"},"":()=>"Nodes"},Et=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=(0,O.ID)(),o=(0,z.Cq)(n,e),i=Ft[o];return(0,r.useCallback)((e=>{var n;if("customGroups"===o){const n=((e,t)=>{for(const n of t)if((0,Mt.BW)(e,n.filters,n.selectedNodeIds))return n.name;return"Other"})(e,t),r=t.findIndex((e=>e.name===n));return{name:n,priority:"Other"===n?999:r>=0?r:998,icon:null}}const r=null===i||void 0===i?void 0:i(e);return{name:r,priority:null===(n=Nt[o])||void 0===n?void 0:n[r],icon:"nodeStatus"===o?"connectivityStatus".concat(r):null}}),[o,i,t])};var Lt=n(56876),Rt=n(30863),Bt=n(69001),Vt=n(95836),Ht=n(27496);const _t=["id"];function zt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zt(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Gt=e=>{let{id:t}=e,n=(0,W.A)(e,_t);return(0,pe.jsxs)(Bt.h,Kt(Kt({id:t},n),{},{children:[(0,pe.jsx)(Vt.$,{id:t}),(0,pe.jsx)(Ht.n,{id:t})]}))},Wt=(0,r.memo)(Gt);var Ut=n(16373),qt=n(90901),Jt=n(82103),$t=n(55759),Yt=n(77186),Zt=n(59400);const Xt=["connectivity","id","name"];function Qt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function en(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qt(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const tn=e=>{let{connectivity:t,id:n,name:r}=e,o=(0,W.A)(e,Xt);const i=(0,f.JT)("node:Delete"),s=!(0,O.XA)().untouchable,[a,,l,c]=(0,Ce.A)(),[d,,u,p]=(0,Ce.A)();return(0,pe.jsxs)(Zt.SS,en(en({alignSelf:"end",gap:1,"data-testid":"node-actions"},o),{},{children:[s&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Jt.A,{badge:"actionRemove","data-testid":"remove-node-action",children:(0,pe.jsx)(Zt.d0,{"data-ga":"nodes-table-row::click-remove-node::nodes-view",onClick:u})}),d&&(0,pe.jsx)(Yt.Ay,{ids:[n],name:r,onClose:p})]}),i&&"Offline"===t&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Jt.A,{badge:"actionObsolete","data-testid":"obsolete-node-action",children:(0,pe.jsx)(Zt.AS,{"data-ga":"nodes-table-row::click-obsolete-node::nodes-view",onClick:l})}),a&&(0,pe.jsx)($t.Ay,{ids:[n],name:r,onClose:c})]})]}))};var nn=n(97336);const rn=["instanceType","name","providerType"];function on(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?on(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):on(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const an=e=>{let{instanceType:t,name:n,providerType:r}=e,o=(0,W.A)(e,rn);return(0,pe.jsx)(Jt.A,sn(sn({badge:"cloudInfo","data-testid":"node-cloud-info",nodeName:n},o),{},{children:(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{color:"textDescription","data-testid":"node-cloud-info-icon",name:"ipNetworking",width:"18px",height:"18px"}),(0,pe.jsxs)(ce.TextSmall,{color:"textDescription","data-testid":"node-cloud-info-text",children:[(0,Tt.ws)(r)," \u2022 ",(0,Tt.ws)(t)]})]})}))},ln=["connectivity","name"];function cn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cn(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const un=e=>{let{connectivity:t,name:n}=e,r=(0,W.A)(e,ln);return(0,pe.jsx)(Jt.A,dn(dn({badge:"connectivity",connectivityState:t,"data-testid":"node-connectivity",nodeName:n},r),{},{children:(0,pe.jsx)(ce.Icon,{name:"connectivityStatus".concat(t),width:"18px",height:"18px"})}))},pn=["onClick"];function hn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const fn=e=>{let{onClick:t}=e,n=(0,W.A)(e,pn);return(0,pe.jsx)(Jt.A,gn(gn({badge:"info","data-testid":"node-info-cta"},n),{},{children:(0,pe.jsx)(ce.Icon,{color:"textDescription",cursor:"pointer",height:"18px",width:"18px",name:"information",onClick:t})}))},xn=["name"];function mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mn(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const jn=e=>{let{name:t}=e,n=(0,W.A)(e,xn);return(0,pe.jsx)(Jt.A,bn(bn({badge:"k8s","data-testid":"node-kubernetes",nodeName:t},n),{},{children:(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{color:"textDescription","data-testid":"node-kubernetes-icon",name:"serviceKubernetes",width:"18px",height:"18px"}),(0,pe.jsx)(ce.TextSmall,{color:"textDescription","data-testid":"node-kubernetes-text",children:"k8s"})]})}))},yn=["kernelName","kernelVersion","name"];function vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function On(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vn(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const wn=e=>{let{kernelName:t,kernelVersion:n,name:r}=e,o=(0,W.A)(e,yn);return(0,pe.jsx)(Jt.A,On(On({badge:"kernel","data-testid":"node-kernel",nodeName:r},o),{},{children:(0,pe.jsx)(ce.TextSmall,{color:"textDescription",children:(0,Tt.Ud)(t,n)})}))};var Cn=n(52253),Pn=n(41708),In=n(92834);const An=["architecture","cpuFrequency","cpus","diskSpace","memory","name","os","osName","timezone"];function kn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kn(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Dn=e=>{var t,n;let{architecture:r,cpuFrequency:o,cpus:i,diskSpace:s,memory:a,name:l,os:c,osName:d,timezone:u}=e,p=(0,W.A)(e,An);return(0,pe.jsx)(Jt.A,Sn(Sn({badge:"systemInfo","data-testid":"node-system-info",nodeName:l},p),{},{children:(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{color:"textDescription","data-testid":"node-system-info-icon",name:(null===(t=wt.u[d])||void 0===t?void 0:t.iconName)||(null===(n=wt.U[c])||void 0===n?void 0:n.iconName)||"os",width:"16px",height:"16px"}),(0,pe.jsxs)(ce.TextSmall,{color:"textDescription","data-testid":"node-system-info-text",children:[(0,Tt.ws)(d)," \u2022 ",(0,Tt.O)(o)," \u2022"," ",(0,Tt.ws)(i,1===i?"Core":"Cores")," \u2022"," ",(0,Tt.ws)(r)," \u2022"," ",(0,Tt.ws)((0,Tt.RI)(a),"RAM")," \u2022"," ",(0,Tt.ws)((0,Tt.RI)(s),"HD"),!!u&&(0,pe.jsxs)(pe.Fragment,{children:[" ","\u2022 ",(0,pe.jsx)(In.A,{timezone:u})]})]})]})}))},Mn=["container","name","virtualization"];function Tn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tn(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Fn=e=>{let{container:t,name:n,virtualization:r}=e,o=(0,W.A)(e,Mn);const i=(0,Tt.Pg)(t,r);return(0,pe.jsx)(Jt.A,Nn(Nn({badge:"type","data-testid":"node-type",nodeName:n,nodeType:i.label},o),{},{children:(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{color:"textDescription","data-testid":"node-type-icon",name:i.icon,height:i.iconSize,width:i.iconSize}),(0,pe.jsx)(ce.TextSmall,{color:"textDescription","data-testid":"node-type-text",children:i.label})]})}))};var En=n(71236);const Ln=e=>{let{health:t={}}=e;const{silencingState:n}=t.alerts||{},{state:r}=n||{};return"NONE"!=r?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(ce.Flex,{children:(0,pe.jsx)(En.A,{flavour:"node",silencing:n})})]}):null};n(33110);var Rn=n(74891);const Bn=(0,Rn.A)((0,xt.A)(ce.Button)),Vn=e=>{let{id:t}=e;const n=(0,j.Zp)(),o=(0,v.bq)(),i=(0,r.useCallback)((()=>{const e={nodeId:t};n("/spaces/".concat(o,"/settings/notifications#notificationsActiveTab=1&silencingRulePrefill=").concat(JSON.stringify(e)))}),[]);return(0,pe.jsx)(Bn,{feature:"SilencingNode",payload:{nodeId:""},tooltip:"Create a new silencing rule for this node",flavour:"hollow",icon:"alarm_off",iconWidth:"12px",onClick:i})};var Hn=n(36504),_n=n(92942),zn=n(87398),Kn=(n(27495),n(63928));function Gn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gn(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Un=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,et._)({params:{type:["favourites"],path:["/".concat(e,"/").concat(t)]}}),o=(0,r.useMemo)((()=>n.filter((e=>{let{value:t}=e;return null===t||void 0===t?void 0: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)=>{var n;return Wn(Wn({},e),null!==(n=t.value)&&void 0!==n&&n.nodeId?{[t.value.nodeId]:t}:{})}),{})),[n]),s=(0,Kn.xS)(),a=(0,r.useCallback)((async e=>{const t=e.map(((e,t)=>{const n=i[e];if(n)return s(Wn(Wn({},n),{},{value:Wn(Wn({},n.value),{},{sortOrder:t})}))}));await Promise.all(t.filter(Boolean))}),[i,s]);return{favoriteNodeIds:o,settingsByNodeId:i,handleOrderChange:a}},qn=(e,t)=>e&&e.getRoot().getChildren().find((e=>e.match({id:"nodes-".concat(t)}))),Jn=(e,t)=>"table-metrics-".concat(e,"-").concat(t),$n=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"sum";const o=qn(e,t);if(!o)return null;const i=Jn(n,r);return o.getNode({id:i})};var Yn=n(28657);const Zn=e=>{let{id:t,roomId:n,nodeId:o,context:i,dimensions:s}=e;const a=(0,zn.eg)(),l=(0,r.useMemo)((()=>{const e=qn(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,pe.jsx)(Yn.A,{chart:l,hasHeader:!1,hasFooter:!1,hasFilters:!1,height:100}):null},Xn=(0,r.memo)(Zn);var Qn=n(74518);const er=e=>{let{id:t,context:n,nodeId:r,isLive:o,hidden:i,title:s,dimensions:a}=e;const l=(0,O.ID)();return i||!o?null:(0,pe.jsxs)(ce.Flex,{column:!0,"data-testid":"metrics-chart-".concat(n),flex:"grow",basis:"174px",children:[(0,pe.jsx)(Qn.A,{text:s||n,TextComponent:ce.TextSmall,color:"textDescription",margin:[1,0,1,2],as:"div"}),(0,pe.jsx)(Xn,{id:t,context:n,nodeId:r,roomId:l,dimensions:a})]})};var tr=n(91421),nr=n(3319);const rr=["node"];function or(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?or(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):or(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const sr=e=>{var t;let{node:n}=e,o=(0,W.A)(e,rr);const[,i]=(0,tr.PJ)(),{sendButtonClickedLog:s}=(0,nr.A)(),a=null===(t=n.capabilities)||void 0===t||null===(t=t.dyncfg)||void 0===t?void 0:t.enabled,l=n.isLive&&a,c=l?"Configure this node":n.isLive?"Node cannot be configured":"Cannot configure a non live node",d=(0,r.useCallback)((()=>{l&&(i(!0,{nodeId:n.id}),s({feature:"DyncfgNode",description:"Configure node",nodeId:null===n||void 0===n?void 0:n.id,nodeName:null===n||void 0===n?void 0:n.name}))}),[l,n,i,s]),u=(0,r.useMemo)((()=>({name:"gear",size:"small",color:l?"text":"disabled",cursor:l?"pointer":"auto",onClick:d})),[l,d]);return(0,pe.jsx)(Jt.A,{content:c,children:(0,pe.jsx)(ce.Flex,ir(ir({},o),{},{children:(0,pe.jsx)(ce.Icon,ir({},u))}))})};var ar=n(51262);function lr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lr(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const dr=(ur=sr,e=>(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(ur,ir({},e))]}));var ur;const pr=e=>{var t,n;let{id:o,name:i,hw:s,os:a,ni:l,capabilities:c,container:d,updateSeverity:u,bugs:p,labels:h,isLive:g,state:f,version:x,extraKey:m,health:b,menuId:j,eligibility:y}=e;const w=(0,v.dg)(),C=(0,O.ID)(),P=null===(t=c.funcs)||void 0===t?void 0:t.enabled,I=null===(n=c.ml)||void 0===n?void 0:n.enabled,A=(0,Tt.GM)(f),{isNodeRestricted:k}=(0,ar.A)(),{restricted:S}=k(o),{_cloud_instance_type:D,_cloud_provider_type:M,_timezone:T}=h||{},N="true"===(null===h||void 0===h?void 0:h._is_k8s_node),F=!(0,Tt.Po)(D)||!(0,Tt.Po)(M),E=(0,q.Fw)("sidebarTab",{flavour:"val",extraKey:m}),L=(0,q.Fw)("sidebarOpen",{flavour:"bool"}),R=(0,q.Fw)("sidebarNodeId",{flavour:"val",extraKey:m}),B=(0,r.useCallback)((e=>{L(!0),E(e),R(o)}),[o,R,L,E]),V=(0,r.useCallback)((()=>B("alerts")),[B]),H=(0,r.useCallback)((()=>B("info")),[B]),_=(0,Ut.Id)(),z=(0,qt.I)(),K=(0,Te.Vw)(C);return(0,pe.jsxs)(ce.Flex,{"data-testid":"nodeRow-".concat(i),"data-menuid":j||o,padding:[1],column:!0,gap:1,round:!0,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center","data-testid":"nodeRow-basic-info",gap:2,height:{min:6},children:[(0,pe.jsx)(un,{connectivity:A,"data-testid":"nodeRow-connectivity-".concat(A.toLowerCase()),name:i}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(Pn.A,{"data-testid":"nodeRow-name",id:o,name:i,isLive:g,state:f,eligibility:y}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(fn,{onClick:H,"data-testid":"nodeRow-more-info-cta"}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(nn.A,{id:o,isLive:g,"data-testid":"nodeRow-alerts",name:i,onClick:V}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(Cn.A,{badge:"ml","data-testid":"nodeRow-machine-learning-status",enabled:I,name:i,onClick:()=>z(o),children:(0,pe.jsx)(ce.Icon,{name:"anomaliesLens",size:"small",color:"text"})}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(Cn.A,{badge:"fn","data-testid":"nodeRow-fn-status",enabled:P,name:i,onClick:()=>_(o),children:(0,pe.jsx)(ce.Icon,{name:"functions",size:"small",color:"text"})}),u&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(Hn.A,{name:i,os:a.id,container:d,warningLevel:u,labels:h,version:x,text:u,"data-testid":"nodeRow-needs-update"})]}),!!(p||[]).length&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(_n.A,{bugs:p,"data-testid":"nodeRow-bugs"})]}),(0,pe.jsx)(dr,{node:{id:o,name:i,isLive:g,ni:l,capabilities:c}}),(0,pe.jsx)(tn,{"data-testid":"nodeRow-node-actions",id:o,name:i,connectivity:A}),w?null:(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ln,{health:b}),(0,pe.jsx)(Vn,{id:o})]})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center","data-testid":"nodeRow-detailed-info",gap:2,children:[(0,pe.jsx)(Dn,{architecture:s.architecture,cpuFrequency:s.cpuFrequency,cpus:s.cpus,"data-testid":"nodeRow-system-info",diskSpace:s.diskSpace,memory:s.memory,name:i,osName:a.nm,os:a.id,timezone:T}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),!(null===a||void 0===a||!a.kernel)&&(0,pe.jsx)(wn,{"data-testid":"nodeRow-kernel",kernelName:a.kernel.nm,kernelVersion:a.kernel.v,name:i}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),N&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(jn,{"data-testid":"nodeRow-kubernetes",name:i}),(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"})]}),(0,pe.jsx)(Fn,{container:s.container,"data-testid":"nodeRow-type",name:i,virtualization:s.virtualization}),F&&(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Zt.K,{"data-testid":"nodeRow-separator"}),(0,pe.jsx)(an,{"data-testid":"nodeRow-cloud-info",instanceType:D,name:i,providerType:M})]})]}),!S&&!(null===K||void 0===K||!K.length)&&(0,pe.jsx)(ce.Flex,{"data-testid":"nodeRow-charts",gap:1,children:K.map((e=>(0,pe.jsx)(er,cr(cr({},e),{},{nodeId:o,isLive:g}),e.id)))})]})},hr=e=>{switch(e.level){case 0:return Wt;case 1:return pr;default:return null}},gr=["onChartNameChange","initialChartName","dashboardOptions","linkToGo","contextToGo"];function fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fr(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const mr=e=>{let{onChartNameChange:t,initialChartName:n,dashboardOptions:r,linkToGo:o,contextToGo:i}=e,s=(0,W.A)(e,gr);const{setActiveMenuId:a}=(0,Lt.A)({onChartNameChange:t,initialChartName:n,linkToGo:o,contextToGo:i});return(0,pe.jsx)(ae.H,xr(xr({},s),{},{children:(0,pe.jsx)(Rt.A,{flavour:"nodes",onActiveMenuId:a,getComponent:hr,dashboardOptions:r,initialChartName:n,checkVisibility:()=>!0})}))};var br=n(69457),jr=n(20871),yr=n(48106),vr=n(51510),Or=n(24155);function wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const Cr=(0,vr.default)(ce.Box).attrs((e=>function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wr(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e))).withConfig({displayName:"loader__Grid",componentId:"sc-yd9b7n-0"})(["display:grid;grid-template-columns:1fr 6fr 1fr;gap:8px;"]),Pr=()=>(0,pe.jsxs)(ce.Flex,{column:!0,gap:2,children:[(0,pe.jsx)(Or.A,{height:"38px"}),(0,pe.jsx)(Cr,{children:Array.from(Array(15).keys()).map((e=>(0,pe.jsxs)(r.Fragment,{children:[(0,pe.jsx)(Or.A,{height:"32px"}),(0,pe.jsx)(Or.A,{height:"32px"}),(0,pe.jsx)(Or.A,{height:"32px"})]},e)))})]});var Ir=n(9962),Ar=n(19075),kr=n(2626),Sr=(n(46449),n(78350),n(93514),n(30237),n(30670),n(36310)),Dr=n(39483);function Mr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const Tr=e=>{var t;let{children:n,contextName:r,dimensions:o,aggregationMethod:i="sum",fractionDigits:s,totalDimensions:a,calculateTotal:l}=e;const{chart:c,state:d}=(0,Sr.useHeadlessChart)(),{contextGroups:u}=(0,Dr.useTableMatrix)();if(!u)return n({data:null,loading:!d.loaded&&d.loading,error:d.error});if(d.empty)return n({data:null,loading:!d.loaded&&d.loading,error:"No data available"});const p=u[r];if(!p)return n({data:null,loading:!d.loaded&&d.loading,error:"Context not found"});const h=(null===(t=c.getPayload())||void 0===t||null===(t=t.data)||void 0===t?void 0:t.length)-1||0;if(l){const e=o&&o.length>0?(Array.isArray(o)?o:[o]).map((e=>{var t;return null===(t=p[e])||void 0===t?void 0:t[0]})).filter(Boolean):Object.values(p).flat().filter(Boolean),t=a&&a.length>0?a.map((e=>{var t;return null===(t=p[e])||void 0===t?void 0:t[0]})).filter(Boolean):Object.values(p).flat().filter(Boolean);if(0===e.length||0===t.length)return n({data:null,loading:!d.loaded&&d.loading,error:"Required dimensions not found"});const r=e.reduce(((e,t)=>e+(c.getDimensionValue(t,h)||0)),0),i=t.reduce(((e,t)=>e+(c.getDimensionValue(t,h)||0)),0),l=i>0?r/i*100:0,u=e[0];return n({data:{value:r,convertedValue:c.getConvertedValue(r,{fractionDigits:s,dimensionId:u}),total:c.getConvertedValue(i,{fractionDigits:s,dimensionId:u}),percentage:l,units:c.getUnitSign({dimensionId:u}),dimensionId:u},loading:!d.loaded&&d.loading,error:null})}let g,f,x,b,j;if(!o||Array.isArray(o)&&0===o.length){if(b=Object.values(p).flat(),j=b[0],0===b.length)return n({data:null,loading:!d.loaded&&d.loading,error:"No dimensions found"});g=c.getAggregatedDimensionValue(b,h,{aggregationMethod:i}),f=c.getConvertedValue(g,{dimensionId:j,fractionDigits:s})}else if("string"===typeof o){var y;if(b=p[o],j=b[0],null===(y=b)||void 0===y||!y.length)return n({data:null,loading:!d.loaded&&d.loading,error:"Dimension not found"});g=c.getAggregatedDimensionValue(b,h,{aggregationMethod:i}),f=c.getConvertedValue(g,{dimensionId:j,fractionDigits:s}),x=c.selectDimensionColor(b[0])}else if(Array.isArray(o)){if(b=o.flatMap((e=>p[e])).filter(Boolean),j=b[0],0===b.length)return n({data:null,loading:!d.loaded&&d.loading,error:"No valid dimensions found"});g=c.getAggregatedDimensionValue(b,h,{aggregationMethod:i}),f=c.getConvertedValue(g,{dimensionId:j,fractionDigits:s})}const v=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mr(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({value:parseFloat(g)||0,convertedValue:f||"0",dimensionId:j,units:j?c.getUnitSign({dimensionId:j}):""},x&&{color:x});return n({data:v,loading:!d.loaded&&d.loading,error:null})},Nr=e=>{let{nodeId:t,contextName:n,dimensions:o,aggregationMethod:i="sum",fractionDigits:s,totalDimensions:a,calculateTotal:l,children:c}=e;const d=(0,zn.eg)(),u=(0,O.ID)(),[p,h]=(0,r.useState)((()=>$n(d,u,t,i)));return(0,r.useEffect)((()=>{if(p)return;const e=(e,n)=>{n.getId()!==Jn(t,i)&&n.getId()!==(null===p||void 0===p?void 0:p.getId())&&h(n)},n=()=>h($n(d,u,t,i));return d.on("nodeAdded",e),d.on("nodesContainerUpdated",n),n(),()=>{d.off("nodeAdded",e),d.off("nodesContainerUpdated",n)}}),[d,p]),p?(0,pe.jsx)(Sr.default,{chart:p,children:(0,pe.jsx)(Tr,{contextName:n,dimensions:o,aggregationMethod:i,fractionDigits:s,totalDimensions:a,calculateTotal:l,children:c})}):c({data:null,loading:!0,error:"Chart not found"})};function Fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Er(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fr(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Lr=()=>(0,pe.jsx)(Or.A,{width:"80%",height:"8px"}),Rr={value:e=>Er(Er({id:e.columnId,header:(0,pe.jsx)(ce.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,pe.jsx)(Nr,{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,pe.jsx)(ce.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,pe.jsx)(Lr,{})});if(!n)return(0,pe.jsx)(ce.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,pe.jsx)(ce.Text,{children:"-"})});const o=n.convertedValue&&n.total;return(0,pe.jsxs)(ce.Flex,{alignItems:"end",justifyContent:"end",width:"100%",gap:.5,children:[(0,pe.jsx)(ce.Text,{textAlign:"right",children:o?(0,pe.jsxs)(pe.Fragment,{children:[n.convertedValue,"/",n.total]}):n.convertedValue}),!e.hideUnits&&n.units&&(0,pe.jsx)(ce.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:n.units})]})}})},renderString:t=>{const n=t.original[e.columnId];return(0,Tt.Po)(n)?"":"".concat(n.convertedValue," ").concat(e.hideUnits?"":n.units)},sortingFn:(t,n)=>{var r,o;return((null===(r=t.original[e.columnId])||void 0===r?void 0:r.value)||0)-((null===(o=n.original[e.columnId])||void 0===o?void 0:o.value)||0)}}),progressBar:e=>Er(Er({id:e.columnId,header:(0,pe.jsx)(ce.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,pe.jsx)(Nr,{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,pe.jsx)(ce.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,pe.jsx)(Lr,{})});if(!n)return(0,pe.jsx)(ce.Flex,{alignItems:"end",justifyContent:"end",width:"100%",children:(0,pe.jsx)(ce.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,pe.jsxs)(ce.Flex,{column:!0,width:"100%",alignItems:o?"center":"end",gap:2,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"end",justifyContent:o?"between":"end",width:"100%",children:[o&&(0,pe.jsxs)(ce.Flex,{alignItems:"end",gap:.5,children:[(0,pe.jsxs)(ce.Text,{children:[n.convertedValue,"/",n.total]}),!e.hideUnits&&n.units&&(0,pe.jsx)(ce.TextMicro,{color:"textLite",strong:!0,textAlign:"right",children:n.units})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"end",children:[(0,pe.jsx)(ce.Text,{children:Math.round(i)}),(0,pe.jsx)(ce.TextMicro,{color:"textLite",strong:!0,children:"%"})]})]}),(0,pe.jsx)(ce.ProgressBar,{background:"panelBg",color:"textLite",height:.5,width:"".concat(s,"%"),containerWidth:"100%",border:"none",overflow:"hidden"})]})}})},renderString:t=>{const n=t.original[e.columnId];return(0,Tt.Po)(n)?"":"".concat(n.convertedValue," / ").concat(n.total," (").concat(n.percentage.toFixed(1),"%)")},sortingFn:(t,n)=>{var r,o,i,s;return((null===(r=t.original[e.columnId])||void 0===r?void 0:r.percentage)||(null===(o=t.original[e.columnId])||void 0===o?void 0:o.value)||0)-((null===(i=n.original[e.columnId])||void 0===i?void 0:i.percentage)||(null===(s=n.original[e.columnId])||void 0===s?void 0:s.value)||0)}}),metadata:e=>({id:e.columnId,header:(0,pe.jsx)(ce.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){var s;if(i=null===(s=i)||void 0===s?void 0:s[e],void 0===i)break}if(e.fallbackKeys)for(const l of e.fallbackKeys){if(!(0,Tt.Po)(i))break;const e=l.split(".");let t=r;for(const n of e){var a;if(t=null===(a=t)||void 0===a?void 0:a[n],void 0===t)break}i=t}return(0,Tt.Po)(i)?(0,pe.jsx)(ce.Flex,{alignItems:"end",width:"100%",children:(0,pe.jsx)(ce.Text,{children:"-"})}):(0,pe.jsx)(ce.Flex,{alignItems:"center",width:"100%",children:(0,pe.jsx)(ce.Text,{children:i})})},renderString:t=>{const n=t.original,r=e.accessorKey.split(".");let o=n;for(const e of r){var i;if(o=null===(i=o)||void 0===i?void 0:i[e],void 0===o)break}if(e.fallbackKeys)for(const a of e.fallbackKeys){if(!(0,Tt.Po)(o))break;const e=a.split(".");let t=n;for(const n of e){var s;if(t=null===(s=t)||void 0===s?void 0:s[n],void 0===t)break}o=t}return(0,Tt.Po)(o)?"-":o},sortingFn:"basic"})};var Br=n(71341);const Vr=e=>{let{osEntry:t}=e;if(!t)return(0,pe.jsx)(ce.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"});if(t.iconName)return(0,pe.jsx)(ce.Icon,{name:t.iconName,width:"18px",height:"18px",color:"textDescription",viewBox:"0 0 100 100"});if(t.logoFilename){const e="".concat(g.A.assetsBaseURL,"/img/logos/os/").concat(t.logoFilename);return(0,pe.jsx)("img",{src:e,width:"18px",height:"18px",alt:t.title})}return(0,pe.jsx)(ce.Icon,{name:"os",width:"18px",height:"18px",color:"textDescription"})},Hr=e=>{let{headerText:t="Server"}=e;return{id:"server",header:(0,pe.jsx)(ce.Text,{strong:!0,children:t}),headerString:t,accessorKey:"name",size:200,minSize:60,maxSize:400,align:"center",category:"Device",enableHiding:!1,cell:e=>{var t,n,r,o;let{row:i}=e;const s=i.original,a=(0,Tt.GM)(s.state),l=(null===(t=s.os)||void 0===t?void 0:t.nm)||(null===(n=s.labels)||void 0===n?void 0:n.os_name),c=null===(r=s.os)||void 0===r?void 0:r.id,d=null===(o=s.labels)||void 0===o?void 0:o.vendor,u=wt.u[l]||wt.U[c]||wt.u[d],p="Live"===a?Br.P.live.indicatorWrapperColor:"Stale"===a?Br.P.stale.indicatorWrapperColor:Br.P.offline.indicatorWrapperColor;return(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:p,flex:!1}),(0,pe.jsx)(ce.Flex,{width:5,height:5,flex:!1,alignItems:"center",justifyContent:"center",children:(0,pe.jsx)(Vr,{osEntry:u})}),(0,pe.jsx)(Pn.A,{id:s.id||s.nd,name:s.nm||s.name,state:s.state,isLive:s.isLive})]})},renderString:e=>e.original.name||e.original.nm,sortingFn:"basic"}},_r=e=>({id:"alerts",header:(0,pe.jsx)(ce.Text,{strong:!0,children:"Alerts"}),headerString:"Alerts",accessorFn:e=>{var t;const{warning:n=0,critical:r=0}=(null===(t=e.health)||void 0===t?void 0:t.alerts)||{};return 3*r+2*n},size:80,minSize:60,maxSize:400,align:"center",category:"Device",cell:t=>{let{row:n}=t;const o=n.original,i=(0,kr.Xt)(o.id),{critical:s,warning:a}=(0,Ar.AO)(i),l=a+s>0,c=(0,q.Fw)("sidebarTab",{flavour:"val",extraKey:e}),d=(0,q.Fw)("sidebarOpen",{flavour:"bool"}),u=(0,q.Fw)("sidebarNodeId",{flavour:"val",extraKey:e}),p=(0,r.useCallback)((e=>{e.stopPropagation(),d(!0),c("alerts"),u(o.id)}),[o.id,u,d,c]),h=(0,Ir.I)({flavour:s>0?"error":"disabledError",value:s||" "}),g=(0,Ir.I)({flavour:a>0?"warning":"disabledWarning",value:a||" "});return(0,pe.jsx)(ce.Flex,{alignItems:"center",justifyContent:"center",opacity:l?1:.3,children:(0,pe.jsx)(ce.MasterCard,{"data-testid":"alertsMastercard",onClick:l?p:null,pillLeft:h,pillRight:g,size:"small",height:"20px"})})},renderString:e=>{var t;const{warning:n=0,critical:r=0}=(null===(t=e.original.health)||void 0===t?void 0:t.alerts)||{};return n+r},sortingFn:"basic"}),zr=(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=Rr[e.columnFlavour];return t?t(e):(console.warn("Unknown column flavour: ".concat(e.columnFlavour)),Rr.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:[Hr({headerText:t}),_r(n)],notFlex:!0},...Object.entries(i).map((e=>{let[t,n]=e;return{id:t,header:"",columns:n,notFlex:!0}}))]}),[e,n,o])};var Kr=n(1444),Gr=n(95565);const Wr={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,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsx)(ce.Text,{children:"Favourites can be saved only on a paid plan."}),(0,pe.jsx)(Gr.A,{children:(0,pe.jsx)(ce.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},Ur=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,Ce.A)(),s=(0,Kn.yK)({onResolve:i}),a=(0,Kn.z2)(null,{onResolve:i}),{disabled:l,reason:c}=(0,Kr.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:"/".concat(c,"/").concat(i),value:{nodeId:n,sortOrder:Date.now()}}))}),[l,s,a,o,e,t]);return{isLoading:n,disabled:l,reason:Wr[c]||Wr.default,toggleFavorite:d}};var qr=n(85720),Jr=n(78804);const $r=["data","onCreateGroupWithNode","icon","name"];function Yr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yr(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Xr=(0,vr.default)(ce.Drop).attrs({align:{top:"bottom",right:"right"},animation:!0,column:!0,padding:[2,0],background:"dropdown",round:1,overflow:{vertical:"auto"},margin:[.5,0,0],width:{min:40,max:60},height:{max:60}}).withConfig({displayName:"addToGroupAction__Dropdown",componentId:"sc-5vhb1z-0"})([""]),Qr=(0,r.memo)((e=>{let{data:t,onCreateGroupWithNode:n,icon:o,name:i}=e,s=(0,W.A)(e,$r);const a=(0,r.useRef)(),[l,c,,d]=(0,Ce.A)(!1),u=(0,O.ID)(),p=(0,Oe.Jk)(u),h=(0,Oe.TV)(u),g=(0,r.useCallback)((async e=>{await h({groupId:e,nodeId:t.id}),d()}),[h,t.id,d]),f=(0,r.useCallback)((()=>{n(t.id),d()}),[n,t.id,d]);return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(ce.IconButton,Zr(Zr({},s),{},{ref:a,icon:o,name:i,onClick:c})),l&&a.current&&(0,pe.jsxs)(Xr,{target:a.current,onEsc:d,onClickOutside:d,children:[p.map((e=>(0,pe.jsx)(qr.A,{onClick:()=>g(e.id),testid:"addToGroup-".concat(e.id),children:e.name},e.id))),p.length>0&&(0,pe.jsx)(Jr.c,{}),(0,pe.jsx)(qr.A,{icon:"plus",onClick:f,testid:"addToGroup-createNew",children:"Create new group"})]})]})})),eo=Qr;function to(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function no(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?to(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):to(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ro=["row","name","groupMode"];function oo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function io(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oo(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const so={[St]:"error",[kt]:"warning",[At]:"success",[Dt]:"textLite"},ao={Live:"live",Stale:"stale",Offline:"offline",critical:"live",warning:"live",clear:"live"},lo={nodeStatus:!0,critical:!0,warning:!0,clear:!0},co=e=>{let{rows:t,name:n,groupMode:r}=e;const o=lo[r]||lo[n],i=t.map((e=>e.original.id)),s=(0,K.BU)(i).length,a=(0,K.Ig)(i).length,l=(0,K.GE)(i).length;return(0,pe.jsx)(tt.A,{content:(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:4,background:"dropdown",round:!0,padding:[2,3],children:[(!o||ao[n]===ao.Live)&&(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Br.P.live.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Live: ",s]})]}),(!o||ao[n]===ao.Stale)&&(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Br.P.stale.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Stale: ",a]})]}),(!o||ao[n]===ao.Offline)&&(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Br.P.offline.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Offline: ",l]})]})]}),align:"right",children:(0,pe.jsxs)(ce.Text,{color:"textLite",children:["(",(!o||ao[n]===ao.Live)&&(0,pe.jsx)(ce.Text,{color:Br.P.live.statusTextColor,children:s}),!o&&"/",(!o||ao[n]===ao.Stale)&&(0,pe.jsx)(ce.Text,{color:Br.P.stale.statusTextColor,children:a}),!o&&"/",(!o||ao[n]===ao.Offline)&&(0,pe.jsx)(ce.Text,{color:Br.P.offline.statusTextColor,children:l}),")"]})})},uo=e=>{let{row:t,name:n,groupMode:r}=e,o=(0,W.A)(e,ro);const i=t.getIsExpanded(),s=(e=>{var t,n;return"Other"===e?"textLite":(null===(t=Br.P[null===e||void 0===e||null===(n=e.toLowerCase)||void 0===n?void 0:n.call(e)])||void 0===t?void 0:t.statusTextColor)||so[e]||"text"})(n);return(0,pe.jsx)(ce.Flex,io(io({height:"44px",alignItems:"center",flex:!0,width:"100%",background:"tableRowBg2",_hover:{background:"tableRowBg2Hover"}},o),{},{children:(0,pe.jsxs)(ce.Flex,{position:"sticky",left:"0px",width:"auto",padding:[2,3],gap:2,children:[(0,pe.jsx)(ce.Icon,{name:"chevron_left",size:"small",color:"textLite",rotate:i?1:3}),(0,pe.jsx)(ce.Text,{color:s,strong:!0,children:n}),(0,pe.jsx)(co,{rows:t.subRows,groupMode:r,name:n})]})}))},po=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:p}=Un(n,t),[h,g]=(0,Ce.A)(!0),f=(0,K.Gt)(p),x={getIsExpanded:()=>h,subRows:f.map((e=>({original:e})))};return f.length?(0,pe.jsx)(pe.Fragment,{children:(0,pe.jsxs)("div",{children:[(0,pe.jsx)(uo,{row:x,name:"Favourites",onClick:g}),(0,pe.jsx)(ce.Collapsible,{open:h,children:(0,pe.jsx)(ce.Table,{data:f,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 ho=n(37356),go=n(71581);const fo=["nodeIdsLoaded"];function xo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xo(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const bo={right:["actions"],left:["server"]},jo={nodeStatus:{Live:!0},default:!0},yo=e=>{let{id:t}=e;return t},vo=(e=>t=>{let{nodeIdsLoaded:n}=t,r=(0,W.A)(t,fo);return(0,O.XA)("fullyLoaded")&&!!n?(0,pe.jsx)(e,mo({},r)):(0,pe.jsx)(Pr,{})})((e=>{let{nodeIds:t,tabNodeIds:n,onChartNameChange:o,initialChartName:s,tabId:a="servers",flavour:l="nodesView",onCreateGroup:c,onCreateGroupWithNode:d,matchingGroups:u}=e;const p=(0,br.qR)(),h=(0,O.ID)(),g=(0,v.vt)(),x=(0,f.JT)("space:UpdateSettings",g),m=(0,z.Cq)(h,a),b=(0,z.A3)(h,a),j=(0,go.rK)(a,h),y=(0,Te.vh)(h,a,j),[w,C]=(0,q.r$)("expanded",{extraKey:"".concat(l,"-").concat(a,"-").concat(m||"ungrouped"),flavour:"obj",defaultValue:jo[m]||jo.default}),[P,I]=(0,r.useState)(null),[A,k]=(0,r.useState)(null),S=(0,r.useCallback)(((e,t)=>{I({ids:[e],name:t})}),[]),D=(0,r.useCallback)(((e,t)=>{k({ids:[e],name:t})}),[]),M=zr(y,{extraKey:l,tabId:a}),T=(0,r.useMemo)((()=>{const e=(e=>{const t={nodeStatus:{name:"Node status",columns:[]},alertStatus:{name:"Alerts",columns:[]}};return"snmp"===e?mo(mo({},t),{},{vendor:{name:"Vendor",columns:[]},type:{name:"Type",columns:[]},location:{name:"Location",columns:[]}}):t})(a);return(0,we.b5)(a)&&(null===u||void 0===u?void 0:u.length)>0?mo(mo({},e),{},{customGroups:{name:"Groups",columns:[]}}):e}),[a,null===u||void 0===u?void 0:u.length]),N=(0,r.useMemo)((()=>y.reduce(((e,t)=>(t.hidden&&(e[t.columnId]=!1),e)),{})),[y]),[F,E]=(0,q.r$)("columnVisibility",{extraKey:"".concat(l,"-").concat(a),flavour:"obj",defaultValue:N}),[L,R]=(0,q.r$)("columnSizing",{extraKey:"".concat(l,"-").concat(a),flavour:"obj",defaultValue:{}}),[B,V]=(0,q.r$)("sortBy",{extraKey:"".concat(l,"-").concat(a),flavour:"arrobj",defaultValue:[]}),H=(0,q.Fw)("sidebarTab",{flavour:"val",extraKey:l}),_=(0,q.Fw)("sidebarOpen",{flavour:"bool"}),K=(0,q.Fw)("sidebarNodeId",{flavour:"val",extraKey:l}),G=(0,r.useCallback)(((e,t)=>{_(!0),H(e),K(t)}),[K,_,H]),W=(0,r.useCallback)((e=>{let{data:t}=e;t.isGroup||G("info",t.id)}),[G]),U=((e,t)=>{let{flavour:n,onRemoveNode:o,onObsoleteNode:s,onClickNode:a,onCreateGroupWithNode:l}=t;const c=(0,f.JT)("node:Delete"),d=(0,v.vt)(),u=(0,f.JT)("space:UpdateSettings",d),p=(0,O.XA)(),h=(0,v.dg)(),g=!p.untouchable,{isLoading:x,toggleFavorite:m,disabled:b,reason:j}=Ur(n,e),{settingsByNodeId:y}=Un(n,e),w=(0,r.useRef)(null);return w.current=t=>{const r=y[t];m(t,r,{flavour:n,tabId:e})},(0,r.useMemo)((()=>no(no(no({},!h&&g&&{remove:{icon:"remove",tooltipText:"Remove node from room",handleAction:e=>o(e.id,e.name),confirmation:!0,confirmationText:e=>"Remove ".concat(e.name," from room?"),isDisabled:()=>!1}}),!h&&!g&&{obsolete:{icon:"delete",tooltipText:"Delete node permanently",handleAction:e=>s(e.id,e.name),confirmation:!0,confirmationText:e=>"Delete ".concat(e.name," permanently?"),isDisabled:e=>{const t=(0,Tt.GM)(e.state);return c&&"Offline"!==t}}}),{},{info:{handleAction:e=>a({data:e})},favorite:{icon:e=>y[e.id]?"heart_broken":"heart",tooltipText:e=>y[e.id]?"Remove from favorites":"Add to favorites",handleAction:e=>w.current(e.id),confirmation:!1,isVisible:()=>!0,isDisabled:x||b,iconColor:"textNoFocus",disabledTooltipText:j||"Saving..."}},i.xH&&u&&l&&{addToGroup:{CustomComponent:eo,icon:"groupCreate",tooltipText:"Add to group",onCreateGroupWithNode:l,confirmation:!1}})),[c,u,h,g,o,s,x,b,y,a,l])})(a,{flavour:l,onRemoveNode:S,onObsoleteNode:D,onClickNode:W,onCreateGroupWithNode:d}),J=(0,r.useMemo)((()=>{if(i.xH&&x&&c)return{createGroup:{handleAction:c,icon:"groupCreate",tooltipText:"Create group",alwaysEnabled:!0,confirmation:!1}}}),[x,c]),{setActiveMenuId:$}=(0,Lt.A)({onChartNameChange:o,initialChartName:s}),Y=(0,r.useRef)(),Z=(0,r.useRef)(),X=(0,r.useMemo)((()=>(Y.current&&Y.current.cancel(),Y.current=(0,jr.A)({elementQueryParam:"[data-id]",dataMenuId:"data-id"}),()=>{var e;return Y.current(null===(e=Z.current)||void 0===e?void 0:e.scrollElement,$)})),[p.length,$]);(0,r.useLayoutEffect)((()=>{p.length&&X()}),[p.length,s]);const Q=(0,r.useRef)(),ee=(0,r.useMemo)((()=>({overscan:30,virtualRef:Z,onScroll:X})),[X]),te=(0,r.useMemo)((()=>p.filter(Boolean)),[p]);(0,yr.A)(Z.current,te);const ne=(0,r.useMemo)((()=>e=>(0,pe.jsx)(uo,mo({groupMode:m},e))),[m]);return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(po,{tabId:a,flavour:l,onRemoveNode:S,onObsoleteNode:D,onClickRow:W,columnPinning:bo,columnVisibility:F,columnSizing:L,onColumnSizingChange:R,sortBy:B,onSortingChange:V,rowActions:U,columns:M}),t.length?(0,pe.jsx)(ce.Table,{title:(0,pe.jsx)(ho.A,{extraKey:"".concat(l,"-").concat(a),nodeIds:n,tabId:a}),data:te,dataColumns:M,rowActions:U,bulkActions:J,onClickRow:W,enableSorting:!0,sortBy:B,onSortingChange:V,enableColumnVisibility:!0,enableColumnPinning:!0,enableResizing:!0,columnPinning:bo,columnVisibility:F,onColumnVisibilityChange:E,columnSizing:L,onColumnSizingChange:R,groupByColumns:T,grouping:m||"",onGroupByChange:b,getSubRows:e=>e.children,enableExpanding:!0,getRowId:yo,expanded:w,onExpandedChange:C,GroupRow:ne,virtualizeOptions:ee,tableRef:Q,background:"tableRowBg2"}):(0,pe.jsx)(ve,{children:(0,pe.jsx)(ce.Flex,{gap:1,alignItems:"center",children:(0,pe.jsx)(ho.A,{extraKey:"".concat(l,"-").concat(a),nodeIds:n,tabId:a})})}),P&&(0,pe.jsx)(Yt.Ay,{ids:P.ids,name:P.name,onClose:()=>I(null)}),A&&(0,pe.jsx)($t.Ay,{ids:A.ids,name:A.name,onClose:()=>k(null)})]})}));n(37550);function Oo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oo(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Co=e=>{let{tab:t,onToggle:n,onEdit:r,onDelete:o}=e;const{attributes:i,listeners:s,setNodeRef:a,transform:l,transition:c}=(0,rt.gl)({id:t.id}),d={transform:ot.Ks.Transform.toString(l),transition:c},u=t.isDefault,p=t.label||t.name;return(0,pe.jsx)("div",wo(wo({ref:a,style:d},i),{},{children:(0,pe.jsxs)(ce.Flex,{"data-testid":"groupsMenu-tab-".concat(t.id),justifyContent:"between",alignItems:"center",padding:[1,0],children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,wo({name:"nav_dots",color:"textLite",cursor:"grab",size:"small"},s)),(0,pe.jsx)(ce.Checkbox,{checked:!t.isHidden,"data-testid":"groupsMenu-tabCheckbox-".concat(t.id),label:p,onChange:n})]}),!u&&(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.IconButton,{"data-testid":"groupsMenu-editTab-".concat(t.id),flavour:"borderless",icon:"pencilSolid",padding:[0],onClick:r,width:"10px",height:"10px"}),(0,pe.jsx)(it,{onConfirm:o,children:e=>(0,pe.jsx)(ce.IconButton,{"data-testid":"groupsMenu-deleteTab-".concat(t.id),flavour:"borderless",icon:"trashcan",padding:[0],onClick:e,width:"10px",height:"10px"})})]})]})}))};function Po(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Io(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Po(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Po(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Ao=e=>{let{isOpen:t,onClose:n,onEdit:o,onCreate:i,allNodes:s,targetRef:a,activeTabId:l,onTabChange:c}=e;const d=(0,O.ID)(),u=(0,Oe.kf)(d,s),p=(0,r.useMemo)((()=>s.some(we.ZH)),[s]),h=(0,r.useMemo)((()=>u.filter((e=>"snmp"!==e.id||p))),[u,p]),g=(0,Oe.vG)(d),f=(0,Oe.Jf)(d),x=(0,Oe.cq)(d),[m,b]=(0,r.useState)((()=>h.map((e=>e.id))));(0,r.useEffect)((()=>{b(h.map((e=>e.id)))}),[h]);const j=(0,nt.FR)((0,nt.MS)(nt.AN),(0,nt.MS)(nt.uN,{coordinateGetter:rt.JR})),y=(0,r.useCallback)((e=>{const{active:t,over:n}=e;if(null!==t&&void 0!==t&&t.id&&null!==n&&void 0!==n&&n.id&&t.id!==n.id){const e=m.indexOf(t.id),r=m.indexOf(n.id),o=(0,rt.be)(m,e,r);b(o),g(o)}}),[m,g]),v=(0,r.useCallback)((e=>{f(e)}),[f]),w=(0,r.useCallback)((e=>{o(e),n()}),[o,n]),C=(0,r.useCallback)((e=>{e===l&&c&&c("servers"),x(e)}),[x,l,c]),P=(0,r.useCallback)((()=>{i(),n()}),[i,n]),I=(0,r.useMemo)((()=>h.reduce(((e,t)=>Io(Io({},e),{},{[t.id]:t})),{})),[h]);return a.current&&t?(0,pe.jsxs)(ce.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":"groupsMenu",onClickOutside:n,onEsc:n,target:a.current,gap:1,children:[(0,pe.jsx)(nt.Mp,{sensors:j,collisionDetection:nt.fp,onDragEnd:y,children:(0,pe.jsx)(rt.gB,{items:m,strategy:rt._G,children:(0,pe.jsx)(ce.Flex,{column:!0,children:m.map((e=>{const t=I[e];return t?(0,pe.jsx)(Co,{tab:t,onToggle:()=>v(t.id),onEdit:()=>w(t.id),onDelete:()=>C(t.id)},t.id):null}))})})}),(0,pe.jsx)(ce.Button,{"data-testid":"groupsMenu-createGroup",label:"Create group",icon:"plus",onClick:P,small:!0,alignSelf:"end"})]}):null},ko=e=>{let{allNodes:t,onCreateGroup:n,onEditGroup:o,activeTabId:i,onTabChange:s}=e;const[a,,l,c]=(0,Ce.A)(),d=(0,r.useRef)();return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ae.A,{permission:"space:UpdateSettings",ifForbidden:"hide","data-ga":"group-setting::click-group-setting::hm-nodes","data-testid":"groupSettings-button","data-onboarding-id":"groups-menu-button",flavour:"hollow",icon:"navVertical_s",neutral:!0,onClick:l,ref:d,label:"Groups",small:!0}),(0,pe.jsx)(Ao,{isOpen:a,onClose:c,onEdit:o,onCreate:n,allNodes:t,targetRef:d,activeTabId:i,onTabChange:s})]})},So=["children","tabId","allNodes","onCreateGroup","onEditGroup","onTabChange"];function Do(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Do(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Do(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const To=(0,xt.A)(Pe.A),No=e=>{let{children:t,tabId:n,allNodes:r,onCreateGroup:o,onEditGroup:s,onTabChange:a}=e,l=(0,W.A)(e,So);const[c,,d,u]=(0,Ce.A)(),p=(0,v.vt)(),h=(0,O.ID)(),g=(0,go.rK)(n,h),x=(0,f.JT)("space:UpdateSettings",p);return(0,pe.jsxs)(ce.Flex,Mo(Mo({alignItems:"end",justifyContent:"between",width:"100%",background:"mainBackground",padding:[0,0,0,4],border:{side:"bottom",size:"1px",type:"solid",color:"borderSecondary"}},l),{},{children:[t,(0,pe.jsxs)(ce.Flex,{justifyContent:"between",alignItems:"end",flex:!0,children:[i.xH&&x?(0,pe.jsx)(ce.IconButton,{icon:"plus",onClick:o,"data-testid":"nodes-create-group-button",tooltip:"Create group",padding:[1],width:"16px",height:"16px"}):(0,pe.jsx)("div",{}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",padding:[0,0,1,2],gap:2,children:[c&&(0,pe.jsx)(Ie.A,{onClose:u}),i.xH&&(0,pe.jsx)(ko,{allNodes:r,onCreateGroup:o,onEditGroup:s,activeTabId:n,onTabChange:a}),(0,pe.jsx)(ft,{spaceId:p,roomId:h,tabId:n,metricsType:g}),(0,pe.jsx)(To,{"data-ga":"add-nodes::click-add-nodes::hm-nodes-table","data-testid":"nodesTable-addNode",icon:"nodes_hollow",label:"Add Nodes",onClick:d,small:!0,flavour:"hollow"})]})]})]}))},Fo=e=>{let{allNodes:t,activeTabId:n,onTabChange:o,onCreateGroup:i,onEditGroup:s,children:a}=e;const l=(0,O.ID)(),c=(0,Oe.yT)(l,t),d=(0,r.useMemo)((()=>{const e=c.findIndex((e=>e.id===n));return e>=0?e:0}),[n,c]),u=(0,r.useCallback)((e=>{const t=c[e];t&&o&&o(t.id)}),[c,o]),p=(0,r.useMemo)((()=>({tabId:n,allNodes:t,onCreateGroup:i,onEditGroup:s,onTabChange:o})),[n,t,i,s,o]);return(0,pe.jsx)(ce.Tabs,{selected:d,onChange:u,height:"100%",padding:[4,4,2],TabsHeader:No,tabHeaderProps:p,gap:4,noDefaultBorder:!0,children:c.map(((e,t)=>(0,pe.jsx)(ce.Tab,{label:(0,pe.jsx)(ce.Text,{color:t===d?"primary":"menuItem",children:e.label||e.name}),"data-testid":"nodes-tab-".concat(e.id),padding:[2,4],maxWidth:"100%",green:!0,children:a},e.id)))})},Eo=e=>{let{tabId:t,filteredIds:n,totalCount:r}=e;const o=(0,we.K3)(t),i=(null===o||void 0===o?void 0:o.label)||"Nodes",s=(0,K.BU)(n).length,a=(0,K.Ig)(n).length,l=(0,K.GE)(n).length;return(0,pe.jsxs)(ce.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,pe.jsxs)(ce.Text,{strong:!0,children:["Total ",i,": ",r]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:4,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Br.P.live.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Live: ",s]})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Br.P.stale.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Stale: ",a]})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,children:[(0,pe.jsx)(ce.Flex,{width:2,height:2,round:"50%",background:Br.P.offline.indicatorWrapperColor}),(0,pe.jsxs)(ce.Text,{children:["Offline: ",l]})]})]})]})};var Lo=n(32215);const Ro=["title","disclaimer","disclaimerColor","children"];function Bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bo(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Ho=e=>{let{title:t,disclaimer:n,disclaimerColor:r="textLite",children:o}=e,i=(0,W.A)(e,Ro);return(0,pe.jsxs)(ce.Flex,Vo(Vo({gap:1,column:!0},i),{},{children:[(0,pe.jsx)(ce.Text,{as:"label",margin:[0],children:t}),o,n&&(0,pe.jsx)(ce.TextSmall,{color:r,children:n})]}))};n(25440),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 _o=n(26848);const zo={nodeStatuses:{name:"Node status",category:"Core",paramKey:"nodeStatus"},nodeVersions:{name:"Node version",category:"Core",paramKey:"version"},nodeCapabilities:{name:"Capabilities",category:"Core",paramKey:"capabilityKeys"},"os.nm":{name:"Operating System",category:"System",paramKey:"os.nm"},"hw.cpuFrequency":{name:"CPU Frequency",category:"Hardware",type:"range"},"hw.cpus":{name:"CPU Cores",category:"Hardware",type:"range"},"hw.memory":{name:"Memory",category:"Hardware",type:"range"},"hw.diskSpace":{name:"Disk Space",category:"Hardware",type:"range"}};function Ko(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function Go(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Go(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Go(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Uo=(0,r.memo)((e=>{let{filters:t,onFiltersChange:n,nodes:o,selectedNodeIds:i,onSelectedNodeIdsChange:s}=e;const[a,l]=(0,r.useState)(""),c=(0,r.useMemo)((()=>{const e=Object.entries(zo).map((e=>{let[t,n]=e;return{id:t,name:n.name,category:n.category}})),t=new Set;o.forEach((e=>{e.labels&&Object.keys(e.labels).forEach((e=>t.add(e)))}));return[...e,{id:"selectedNodeIds",name:"Selected Nodes",category:"Nodes"},...Array.from(t).map((e=>({id:"label.".concat(e),name:e,category:"Labels"})))]}),[o]),d=(0,r.useMemo)((()=>{const e=Object.keys(t||{});return(null===i||void 0===i?void 0:i.length)>0&&e.push("selectedNodeIds"),e}),[t,i]),u=(0,r.useMemo)((()=>{const e={searchAction:null,topFilters:[],groupedValues:{},allFilters:[]},t=a.toLowerCase().trim();t&&(e.searchAction={query:a,text:'Search for "'.concat(a,'"')});const n=new Map,r=[];return c.forEach((e=>{if(!d.includes(e.id)){const n={id:e.id,name:e.name,category:e.category,score:0};if(t){const r=e.name.toLowerCase().includes(t),o=e.id.toLowerCase().includes(t);r&&(n.score+=10),o&&(n.score+=5),e.name.toLowerCase().startsWith(t)&&(n.score+=15)}else n.score=1;(n.score>0||!t)&&r.push(n)}if(o&&o.length>0){const r=[];if("nodeStatuses"===e.id){const e=o.reduce(((e,t)=>{const n=t.nodeStatus;return e[n]||(e[n]={count:0}),e[n].count+=1,e}),{});Object.entries(e).forEach((e=>{let[n,o]=e,i=!t,s=o.count;if(t){n.toLowerCase().includes(t)&&(i=!0,s=100,n.toLowerCase().startsWith(t)&&(s+=50))}i&&r.push({value:n,label:n,count:o.count,score:s})}))}else if("nodeVersions"===e.id){const e=o.reduce(((e,t)=>(t.version&&(e[t.version]||(e[t.version]={count:0}),e[t.version].count+=1),e)),{});Object.entries(e).forEach((e=>{let[n,o]=e,i=!t,s=o.count;if(t){n.toLowerCase().includes(t)&&(i=!0,s=100,n.toLowerCase().startsWith(t)&&(s+=50))}i&&r.push({value:n,label:n,count:o.count,score:s})}))}else if("nodeCapabilities"===e.id){const e=new Set;o.forEach((t=>{t.capabilities&&Object.keys(t.capabilities).forEach((t=>e.add(t)))})),Array.from(e).forEach((e=>{const n=o.filter((t=>t.capabilities&&e in t.capabilities)).length;let i=!t,s=n;if(t){e.toLowerCase().includes(t)&&(i=!0,s=100,e.toLowerCase().startsWith(t)&&(s+=50))}i&&r.push({value:e,label:e,count:n,score:s})}))}else if("os.nm"===e.id){const e=o.reduce(((e,t)=>{var n;return null!==(n=t.os)&&void 0!==n&&n.nm&&(e[t.os.nm]||(e[t.os.nm]={count:0}),e[t.os.nm].count+=1),e}),{});Object.entries(e).forEach((e=>{let[n,o]=e,i=!t,s=o.count;if(t){n.toLowerCase().includes(t)&&(i=!0,s=100,n.toLowerCase().startsWith(t)&&(s+=50))}i&&r.push({value:n,label:n,count:o.count,score:s})}))}else if(e.id.startsWith("label.")){const n=e.id.replace("label.",""),i=o.reduce(((e,t)=>{if(t.labels&&t.labels[n]){const r=t.labels[n];e[r]||(e[r]={count:0}),e[r].count+=1}return e}),{});Object.entries(i).forEach((e=>{let[o,i]=e,s=!t,a=i.count;if(t){o.toLowerCase().includes(t)&&(s=!0,a=100,o.toLowerCase().startsWith(t)&&(a+=50))}s&&r.push({value:"".concat(n,"|").concat(o),label:o,count:i.count,score:a})}))}else"selectedNodeIds"===e.id&&o.forEach((e=>{let n=!t,o=1;const s=null===i||void 0===i?void 0:i.includes(e.id);if(t){const r=e.name&&e.name.toLowerCase().includes(t),i=e.id.toLowerCase().includes(t);(r||i)&&(n=!0,o=r?100:50,e.name&&e.name.toLowerCase().startsWith(t)&&(o+=50))}n&&r.push({value:e.id,label:e.name||e.id,count:s?1:0,score:o+(s?10:0)})}));r.length>0&&(r.sort(((e,t)=>t.score-e.score)),n.set(e.id,{filterName:e.name,values:r.slice(0,t?10:5)}))}})),r.sort(((e,t)=>t.score-e.score)),e.allFilters=r,e.topFilters=t?r.slice(0,5):r,n.forEach(((n,r)=>{(e.topFilters.some((e=>e.id===r))||t)&&(e.groupedValues[r]=n)})),e}),[a,o,t,c,d,i]),p=(0,r.useCallback)((e=>{n((t=>Wo(Wo({},t),{},{[e]:[]})))}),[n]),h=(0,r.useCallback)(((e,t)=>{if("selectedNodeIds"===e){const e=i||[],n=e.includes(t)?e.filter((e=>e!==t)):[...e,t];s(n)}else n((n=>{const r=n[e]||[],o=r.includes(t)?r.filter((e=>e!==t)):[...r,t];if(0===o.length){const{[e]:t}=n;return(0,W.A)(n,[e].map(Ko))}return Wo(Wo({},n),{},{[e]:o})}))}),[n,i,s]),g=(0,r.useCallback)((()=>{}),[]);return(0,pe.jsx)(_o.A,{searchValue:a,setSearchValue:l,setSearchQuery:g,searchResults:u,onAddFilter:p,onAddFilterWithValue:h,placeholder:"Search filters..."})})),qo=Uo;var Jo=n(24798);const $o=e=>{const t=(0,O.ID)(),n="nodesView-".concat(e),o=(0,q.l6)("addedFilters",{extraKey:n,flavour:"arr",defaultValue:[]});return(0,b.yF)((0,r.useCallback)((e=>{const r={},i=[...Jo.RT,...o];[...new Set(i)].forEach((o=>{const i=e((0,q.GA)({key:t,extraKey:n,param:o,flavour:"arr"}));null!==i&&void 0!==i&&i.length&&(r[o]=i)}));const s=e((0,q.GA)({key:t,extraKey:n,param:"selectedNodeIds",flavour:"arr"}));return null!==s&&void 0!==s&&s.length&&(r.selectedNodeIds=s),r}),[t,n,o]))};var Yo=n(90071),Zo=n(5402),Xo=n(68529),Qo=n(21511);const ei=(0,r.memo)((e=>{let{id:t,label:n,value:o,onChange:i,onRemove:s,nodes:a,columnInfo:l}=e;const c=(0,r.useRef)(),d=(0,r.useRef)(),[u,p]=(0,r.useState)(o||[]),h="select"!==(null===l||void 0===l?void 0:l.type);(0,r.useEffect)((()=>{p(o||[])}),[o]);const g=(0,r.useMemo)((()=>(null===a||void 0===a?void 0:a.map((e=>e.id)))||[]),[a]),f=(0,Qo.A)({param:t,paramKey:null===l||void 0===l?void 0:l.paramKey,extraKey:"groupForm",isLabel:null===l||void 0===l?void 0:l.isLabel,labelKey:null===l||void 0===l?void 0:l.labelKey,nodeIds:g,nodes:a}),{isOpen:x,handleToggle:m,handleClose:b,handleCancel:j}=(0,Xo.A)({pendingChangesRef:d}),y=u.length,v=(0,r.useMemo)((()=>{if(0===y)return"No selection";if(1===y){const e=f.find((e=>e.id===u[0]));return e?e.name:u[0]}return"".concat(y," selected")}),[y,u,f]),O=f.length,w=f.filter((e=>e.count>0)).length,C=(0,r.useMemo)((()=>0===O?"":"Labels"===(null===l||void 0===l?void 0:l.category)?"Label: ".concat(l.labelKey," \u2022 ").concat(w," values"):w===O?"".concat(w," values"):"".concat(w," out of ").concat(O," values used")),[O,w,l]),P=(0,r.useCallback)((e=>{p(e),i(e)}),[i]),I=(0,r.useCallback)((e=>{e.stopPropagation(),p([]),i([])}),[i]);return(0,pe.jsx)(Zo.A,{id:t,label:n,triggerRef:c,onToggle:m,isOpen:x,isEnabled:!0,stale:!1,subtitleText:v,isRequired:!1,onRemove:s,onCancel:j,onClose:b,onToggleEnabled:null,isDisabled:!1,selectedCount:y,description:C,onReset:I,resetDisabled:!(null!==u&&void 0!==u&&u.length),canHideZeros:!1,sortAction:null,filteredOptions:f,showActions:!1,children:(0,pe.jsx)(Yo.Ay,{ref:d,param:t,baseKey:"groupForm",collection:f,getValue:e=>e.id,getLabel:e=>e.name||e.id,hasSearch:!0,multi:h,placeholder:"Search ".concat(n.toLowerCase(),"..."),searchInputProps:{autoFocus:!0},noResultsMessage:"No ".concat(n.toLowerCase()," found"),itemProps:{multi:h,actualCountLabel:"nodes",stale:!1},extraKey:"groupForm",height:{max:"100%"},resizeable:!1,debounceDelay:0,batchMode:"event",value:u,onBatchApply:P})})})),ti=ei;var ni=n(25764),ri=n(36893),oi=n(64082),ii=n(75687),si=n(32660);const ai=(0,r.memo)((e=>{let{id:t,label:n,values:r,handleReset:o,min:i,max:s,draftRange:a,currentMin:l,currentMax:c,handleRangeChange:d,step:u,containerWidth:p,unit:h}=e;return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(si.A,{id:t,label:n,isEnabled:!0,handleToggleEnabled:null,isDisabled:!1,description:"Range: ".concat(i).concat(h," - ").concat(s).concat(h),onReset:o,resetDisabled:!r||0===r.length,resetTooltip:"Reset to full range"}),(0,pe.jsx)(ce.MultiRangeInput,{min:i,max:s,onChange:d,initMin:a?a[0]:l,initMax:a?a[1]:c,step:u,disabled:!1,padding:[4]},"".concat(t,"-").concat(p))]})})),li={"hw.cpuFrequency":{getter:e=>{var t;return null===(t=e.hw)||void 0===t?void 0:t.cpuFrequency},unit:" MHz",decimals:2},"hw.cpus":{getter:e=>{var t;return null===(t=e.hw)||void 0===t?void 0:t.cpus},unit:"",decimals:0},"hw.memory":{getter:e=>{var t;return null===(t=e.hw)||void 0===t?void 0:t.memory},unit:" GB",decimals:2},"hw.diskSpace":{getter:e=>{var t;return null===(t=e.hw)||void 0===t?void 0:t.diskSpace},unit:" GB",decimals:2}},ci=(0,r.memo)((e=>{let{id:t,label:n,value:o,onChange:i,onRemove:s,nodes:a}=e;const l=(0,r.useRef)(),c=(0,r.useRef)(),d=(0,r.useRef)(),[u,p]=(0,r.useState)(null),[h,g]=(0,r.useState)(320),f=(0,r.useRef)(null),{min:x,max:m,step:b,decimalPoints:j,unit:y}=(0,r.useMemo)((()=>{const e=li[t];if(!e||!a||0===a.length)return{min:0,max:100,step:1,decimalPoints:0,unit:""};let n=1/0,r=-1/0;if(a.forEach((t=>{const o=e.getter(t);if(void 0!==o&&null!==o){const e=parseFloat(o);isNaN(e)||(n=Math.min(n,e),r=Math.max(r,e))}})),n===1/0||r===-1/0)return{min:0,max:100,step:1,decimalPoints:0,unit:""};const o=0===e.decimals?1:Math.pow(10,-e.decimals);return{min:Math.floor(n),max:Math.ceil(r),step:o,decimalPoints:e.decimals,unit:e.unit}}),[a,t]),v=o||[],O=void 0!==v[0]?1*v[0]:x,w=void 0!==v[1]?1*v[1]:m,{isOpen:C,handleToggle:P,handleClose:I,handleCancel:A}=(0,Xo.A)({pendingChangesRef:c,onOpen:()=>p(v.length>0?[...v]:null)}),k=(0,r.useCallback)((e=>{let{min:t,max:n}=e;p([t,n])}),[]),S=(0,r.useMemo)((()=>{if(!v||0===v.length)return"Full range";const e=1*v[0],t=1*v[1],n=e=>j>0?e.toFixed(j):e.toString();return"".concat(n(e)).concat(y," - ").concat(n(t)).concat(y)}),[v,j,y]),D=(0,r.useCallback)((()=>{i([])}),[i]);return(0,r.useEffect)((()=>{if(!C||!d.current)return;return f.current=new ResizeObserver((e=>{for(const t of e){const e=t.contentRect.width;Math.abs(e-h)>5&&g(e)}})),f.current.observe(d.current),()=>{f.current&&f.current.disconnect()}}),[C,h]),(0,r.useEffect)((()=>{c.current={hasPendingChanges:u&&(u[0]!==O||u[1]!==w),applyChanges:()=>{u&&(u[0]===x&&u[1]===m?i([]):i(u),p(null))},cancelChanges:()=>{p(null)}}}),[u,O,w,x,m,i]),(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsxs)(ni.A,{children:[(0,pe.jsx)(ri.A,{triggerRef:l,onClick:P,testId:"dropdown-filter-".concat(t),isOpen:C,isEnabled:!0,stale:!1,label:n,subtitle:S}),(0,pe.jsx)("div",{className:"remove-button-wrapper",children:(0,pe.jsx)(ii.A,{onRemove:s,tooltip:"Remove ".concat(n," filter")})})]}),(0,pe.jsx)(oi.A,{isOpen:C,targetRef:l.current,onEsc:A,onClickOutside:I,width:{base:"320px",min:"280px",max:"500px"},height:{base:"100px",min:"100px",max:"300px"},wrapperRef:d,children:(0,pe.jsx)(ai,{id:t,label:n,values:v,handleReset:D,min:x,max:m,draftRange:u,currentMin:O,currentMax:w,handleRangeChange:k,step:b,containerWidth:h,unit:y})})]})})),di=ci,ui=(0,r.memo)((e=>{let{nodes:t,value:n=[],onChange:o,onRemove:i}=e;const s=(0,r.useRef)(),a=(0,r.useRef)(),{isOpen:l,handleToggle:c,handleClose:d,handleCancel:u}=(0,Xo.A)({pendingChangesRef:a}),p=(0,r.useMemo)((()=>null!==t&&void 0!==t&&t.length?t.map((e=>({id:e.id,name:e.name||e.id}))):[]),[t]),h=(null===n||void 0===n?void 0:n.length)||0,g=(0,r.useMemo)((()=>{if(0===h)return"No selection";if(1===h){const e=null===t||void 0===t?void 0:t.find((e=>e.id===n[0]));return(null===e||void 0===e?void 0:e.name)||n[0]}return"".concat(h," node").concat(1===h?"":"s"," selected")}),[h,n,t]),f=(0,r.useCallback)((e=>{o(e||[])}),[o]),x=(0,r.useCallback)((e=>{e.stopPropagation(),o([])}),[o]);return null!==n&&void 0!==n&&n.length?(0,pe.jsx)(Zo.A,{id:"selectedNodeIds",label:"Selected Nodes",triggerRef:s,onToggle:c,isOpen:l,isEnabled:!0,stale:!1,subtitleText:g,isRequired:!1,onRemove:i,onCancel:u,onClose:d,onToggleEnabled:null,isDisabled:!1,selectedCount:h,description:"".concat(h||"No"," node").concat(1===h?"":"s"," explicitly selected"),onReset:x,resetDisabled:!(null!==n&&void 0!==n&&n.length),canHideZeros:!1,sortAction:null,filteredOptions:p,showActions:!1,children:(0,pe.jsx)(Yo.Ay,{ref:a,param:"selectedNodeIds",baseKey:"groupForm",collection:p,getValue:e=>e.id,getLabel:e=>e.name,hasSearch:!0,multi:!0,placeholder:"Search nodes...",searchInputProps:{autoFocus:!0},noResultsMessage:"No nodes found",itemProps:{multi:!0,actualCountLabel:"selected",stale:!1},extraKey:"groupForm",height:{max:"100%"},resizeable:!1,debounceDelay:0,batchMode:"event",value:n,onBatchApply:f})}):null})),pi=ui,hi=["id","onClose","allNodes","tabId","preselectedNodeId"],gi=["selectedNodeIds"];function fi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fi(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const mi=e=>{let{isNew:t}=e;return(0,pe.jsxs)(ce.Flex,{as:"span",gap:1,children:["Manage room",(0,pe.jsx)(ce.TextBig,{color:"textLite",children:"/"}),(0,pe.jsxs)(ce.TextBig,{color:"textLite",children:[t?"Create":"Edit"," Group"]})]})},bi=[{value:"servers",label:"Servers"},{value:"snmp",label:"Network Devices"}],ji=e=>{let{id:t,onClose:n,allNodes:o,tabId:i,preselectedNodeId:s}=e,a=(0,W.A)(e,hi);const l=(0,O.ID)(),c="new"===t,d=(0,Oe.oH)(l,c?null:t),u=(0,Oe.oH)(l,(0,we.b5)(i)?null:i),p=(0,Oe.rK)(l),h=(0,Oe.EP)(l),g=$o(i),f=(0,r.useMemo)((()=>o.some(we.ZH)),[o]),[x,m]=(0,r.useState)((()=>{if(c){const e=(0,go.AK)(i,u),t=g(),{selectedNodeIds:n}=t,r=(0,W.A)(t,gi);let o=n||[];return s&&!o.includes(s)&&(o=[s,...o]),xi(xi({},Lo.$e),{},{filters:r,selectedNodeIds:o,metricsType:e})}return xi(xi({},Lo.$e),d)}));(0,r.useEffect)((()=>{!c&&null!==d&&void 0!==d&&d.id&&m(xi(xi({},Lo.$e),d))}),[c,d]);const{name:b,metricsType:j,filters:y,selectedNodeIds:v}=x,w=f||!c&&"snmp"===j,C=(0,r.useMemo)((()=>(0,Mt.KN)(y)||(0,Mt.OS)(v)?o.filter((e=>(0,Mt.BW)(e,y,v))).length:0),[o,y,v]),P=(0,r.useCallback)((e=>{let{target:{value:t}}=e;t.length<=30&&m((e=>xi(xi({},e),{},{name:t})))}),[]),I=(0,r.useCallback)((e=>{m((t=>xi(xi({},t),{},{metricsType:(null===e||void 0===e?void 0:e.value)||"servers"})))}),[]),A=(0,r.useCallback)((e=>{m((t=>{const n=xi({},t.filters);return delete n[e],xi(xi({},t),{},{filters:n})}))}),[]),k=(0,r.useCallback)(((e,t)=>{m((n=>xi(xi({},n),{},{filters:xi(xi({},n.filters),{},{[e]:t})})))}),[]),S=(0,r.useCallback)((e=>{m((t=>xi(xi({},t),{},{filters:"function"===typeof e?e(t.filters):e})))}),[]),D=(0,r.useCallback)((e=>{m((t=>xi(xi({},t),{},{selectedNodeIds:e||[]})))}),[]),M=(0,r.useCallback)((()=>{m((e=>xi(xi({},e),{},{selectedNodeIds:[]})))}),[]),T=(0,r.useCallback)((async()=>{const e=xi(xi({},x),{},{name:x.name.trim()});c?await p(e):await h(xi(xi({},e),{},{id:t})),n()}),[x,c,t,p,h,n]),N=b.trim().length>0&&((0,Mt.KN)(y)||(0,Mt.OS)(v)),F=(0,r.useMemo)((()=>bi.find((e=>e.value===j))||bi[0]),[j]),E=(0,r.useMemo)((()=>Object.entries(y||{})),[y]);return(0,pe.jsxs)(ke.GO,xi(xi({onClose:n},a),{},{children:[(0,pe.jsx)(Se.z,{onClose:n,title:(0,pe.jsx)(mi,{isNew:c}),children:(0,pe.jsx)(ce.Button,{label:"Save",onClick:T,disabled:!N,"data-testid":"groupForm-save"})}),(0,pe.jsx)(De.U,{children:c?"Create a new node group":"Edit node group"}),(0,pe.jsx)(ke.Yv,{children:(0,pe.jsxs)(ce.Flex,{gap:6,column:!0,children:[(0,pe.jsx)(Ho,{title:"Group Name","data-testid":"groupForm-name",children:(0,pe.jsx)(ce.TextInput,{name:"name",placeholder:"Enter group name",value:b,onChange:P})}),w&&(0,pe.jsx)(Ho,{title:"Column Configuration",disclaimer:"Choose which column set to display for nodes in this group","data-testid":"groupForm-metricsType",children:(0,pe.jsx)(ce.Select,{options:bi,value:F,onChange:I,"data-testid":"groupForm-metricsTypeSelect"})}),(0,pe.jsx)(Ho,{title:"Filters",disclaimer:(0,Mt.KN)(y)||(0,Mt.OS)(v)?0===C?"No nodes match the current filters":"".concat(C," node").concat(1===C?"":"s"," will appear in this group"):"Add at least one filter to create a group",disclaimerColor:C>0?"accent":"textLite","data-testid":"groupForm-filters",children:(0,pe.jsxs)(ce.Flex,{gap:2,flexWrap:"wrap",alignItems:"center",children:[E.map((e=>{let[t,n]=e;const r=(e=>{if(e.startsWith("label.")){const t=e.replace("label.","");return{name:t,type:"dropdown",isLabel:!0,labelKey:t}}return zo[e]||{name:e,type:"dropdown"}})(t);return"range"===r.type?(0,pe.jsx)(di,{id:t,label:r.name,value:n,onChange:e=>k(t,e),onRemove:()=>A(t),nodes:o},t):(0,pe.jsx)(ti,{id:t,label:r.name,value:n,onChange:e=>k(t,e),onRemove:()=>A(t),nodes:o,columnInfo:r},t)})),(0,pe.jsx)(pi,{nodes:o,value:v,onChange:D,onRemove:M}),(0,pe.jsx)(qo,{filters:y,onFiltersChange:S,nodes:o,selectedNodeIds:v,onSelectedNodeIdsChange:D})]})})]})})]}))};function yi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yi(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Oi=["config"],wi=()=>{const e=(0,v.vt)(),t=(0,O.ID)(),n=(0,R.nj)(),o=(0,ie.Hn)(),s=(0,K.dG)(),a=(0,Oe.Jk)(t),l=(0,go.rK)(s,t),c=(0,r.useMemo)((()=>(0,we.b5)(s)?a.filter((e=>e.metricsType===l)):[]),[a,l,s]),d=Et(s,c),u=(0,z.Cq)(t,s),p=(0,K.TL)(),h=(0,G.w7)({extraKey:"nodesView-".concat(s),merge:!1,scoped:!0}),g=(0,K.Gt)(),f=(0,go.On)(s,t),x=(0,r.useMemo)((()=>g.reduce(((e,t)=>(f(t)||e.push(t.id),e)),[])),[f,g]),m=(0,K.Y7)(),[b,{width:j}]=(0,H.A)(),y=(0,se.K)({spaceId:e,roomId:t}),[w,C,P]=oe(h,t,{shouldHide:i.f9?f:void 0,cacheKey:s,extraKey:"nodesView-".concat(s)});!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],{host:n,width:o,tabId:s="servers",flavour:a="nodesView"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const l=(0,zn.eg)(),c=(0,r.useMemo)((()=>{if(!l)return;let r=qn(l,e);if(r)return r;o&&(r=l.makeContainer({attributes:{host:n,enabledXAxis:!1,id:"nodes-".concat(e),height:"75px",groupingMethod:"average",groupBy:["dimension"],aggregationMethod:"avg",legend:!1,axisLabelFontSize:7,yAxisLabelWidth:20,hasYlabel:!1,nodesScope:t,containerWidth:o}}),l.appendChild(r))}),[e,s,o]),{favoriteNodeIds:d}=Un(a,s),u=(0,Te.vh)(e,s);(0,r.useMemo)((()=>{if(!i.f9)return;if(!c||(null===t||void 0===t||!t.length)&&(null===d||void 0===d||!d.length))return;const e=u.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,...d].forEach((t=>{Object.entries(e).forEach((e=>{var n;let[r,o]=e;const i="table-metrics-".concat(t,"-").concat(r);let s=c.getNode({id:i});if(s&&(a=new Set(s.getAttribute("contextScope")),d=o,a.size===d.size&&[...a].every((e=>d.has(e)))))return;var a,d;null===(n=s)||void 0===n||n.destroy();const u=Array.from(o);0!==u.length&&(s=l.makeChart({attributes:{id:i,contextScope:u,nodesScope:[t],aggregationMethod:r,groupingMethod:"average",groupBy:["label","dimension","context","node"],groupByLabel:["device"],tableColumns:["context","dimension"],chartLibrary:"table",points:1}}),c.appendChild(s))}))})),l.trigger("nodesContainerUpdated")}),[c,t,d,n,l,s,o,u])}(t,w,{host:y,width:j,tabId:s,flavour:"nodesView"});const[I,A]=(0,q.N9)("nodeIdToGo",{key:t,extraKey:"nodesView",flavour:"val"}),k=(0,r.useCallback)((e=>{p(e)}),[p]),[S,D]=(0,r.useState)(null),[M,T]=(0,r.useState)(null),N=(0,r.useCallback)((()=>{T(null),D("new")}),[]),F=(0,r.useCallback)((e=>{T(e),D("new")}),[]),E=(0,r.useCallback)((e=>{T(null),D(e)}),[]),L=(0,r.useCallback)((()=>{D(null),T(null)}),[]),B=(0,r.useCallback)((function(e,t){return It(e,t,vi(vi({},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),{},{searchScores:C}))}),[C]);return(0,pe.jsx)(ae.A,{getObject:m,ids:w,getMenu:B,getGrouping:d,groupMode:u,deps:[d,C,s,u,c],extraKey:"nodesView",children:(0,pe.jsx)(_.A,{ref:b,position:"relative",sidebar:(0,pe.jsx)(le.Ay,{hiddenTabs:Oi,nodeIds:x,title:"Nodes",initialChartName:I,viewFlavour:"nodesView",flavour:"nodesView-".concat(s),loaded:!0,FilterInputContainer:be,extraKey:"nodesView-".concat(s)}),children:!!j&&(0,pe.jsxs)(pe.Fragment,{children:[!i.f9&&(0,pe.jsx)(vt,{}),!i.f9&&n&&!w.length&&h.length?(0,pe.jsx)(ve,{}):i.f9&&o?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsxs)(Fo,{allNodes:g,activeTabId:s,onTabChange:k,nodesCount:P,onCreateGroup:N,onEditGroup:E,children:[(0,pe.jsx)(Eo,{tabId:s,filteredIds:w,totalCount:P}),(0,pe.jsx)(vo,{nodeIdsLoaded:n,nodeIds:w,tabNodeIds:x,initialChartName:I,onChartNameChange:A,tabId:s,flavour:"nodesView",onCreateGroup:N,onCreateGroupWithNode:F,matchingGroups:c})]}),i.xH&&S&&(0,pe.jsx)(ji,{id:S,onClose:L,allNodes:g,tabId:s,preselectedNodeId:M})]}):(0,pe.jsx)(mr,{initialChartName:I,onChartNameChange:A})]})})})},Ci=()=>{const e=(0,O.ID)(),t=(0,R.CK)();return(0,R.gr)(e,"loaded")&&!t.length?(0,pe.jsx)(V.Ay,{feature:"NodesView",mode:"NoNodesView",children:(0,pe.jsx)(B.A,{})}):(0,pe.jsx)(V.Ay,{feature:"NodesView",children:(0,pe.jsx)(wi,{})})},Pi=()=>{const e=(0,K.nl)(),t=(0,K.xY)(e,"name");return(0,D.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 Ii=n(85354),Ai=n(98545),ki=n(23933),Si=n(17219),Di=n(6387),Mi=n(65380);const Ti=["container"];function Ni(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ni(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ni(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Ei=e=>t=>"histogram::".concat(e.getAttribute("id"),"::").concat(t),Li=e=>{let{container:t}=e,n=(0,W.A)(e,Ti);const o=(0,zn.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:Ei}),t.appendChild(e),e)}),[t]);return(0,r.useEffect)((()=>()=>i&&i.destroy()),[i]),(0,pe.jsx)(ce.Flex,{flex:!1,width:"100%",height:5,position:"sticky",bottom:"0",left:"0",right:"0",children:(0,pe.jsx)(Yn.A,Fi(Fi({"data-chartid":"dummy-chart",chart:i,overflow:"hidden",hasHeader:!1,hasFooter:!1,hasFilters:!1,tile:!1},n),{},{round:0}))})};var Ri=n(55093),Bi=n(77148),Vi=n(38773);const Hi=()=>(0,pe.jsxs)(ce.Flex,{padding:[6],round:1,width:"600px",background:"modalInfoBackground",children:[(0,pe.jsx)(ce.Box,{margin:[0,4,0,0],children:(0,pe.jsx)(ce.Box,{as:ce.Icon,width:10,height:10,name:"nodes_update"})}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:2,children:[(0,pe.jsx)(ce.Text,{strong:!0,children:"Couldn't find the chart you were looking for? "}),(0,pe.jsxs)(ce.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,pe.jsx)(je.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."]})]})]}),_i=()=>(0,pe.jsxs)(ce.Flex,{width:"100%",column:!0,gap:6,margin:[8,0,0,0],children:[(0,pe.jsx)(Bi.A,{}),(0,pe.jsxs)(ce.Flex,{gap:1,alignItems:"center",justifyContent:"center",padding:[2],background:"successSemi",children:[(0,pe.jsx)(Gr.A,{children:(0,pe.jsx)(ce.Text,{color:"primary",children:"Upgrade to Business for unlimited access"})}),(0,pe.jsx)(ce.Text,{children:"or"}),(0,pe.jsx)(Vi.A,{children:(0,pe.jsx)(ce.Text,{color:"primary",children:"review your Space active Nodes"})})]})]}),zi=e=>{let{noPreferredNodesError:t,children:n}=e;return(0,pe.jsxs)(ce.Flex,{column:!0,flex:!0,justifyContent:"center",alignItems:"center",alignSelf:"center",children:[(0,pe.jsxs)(ce.Flex,{column:!0,justifyContent:"center",alignItems:"center",width:"300px",margin:[0,0,6],children:[(0,pe.jsx)(ce.H3,{margin:[0,0,4],children:"No charts to display"}),(0,pe.jsx)(ce.Text,{color:"textDescription",textAlign:"center",children:"Double-check your search or filters and dates and try again with different conditions."})]}),(0,pe.jsx)(Hi,{}),t&&(0,pe.jsx)(_i,{}),n]})};var Ki=n(93997),Gi=n(258);const Wi=()=>{const[e,t]=(0,Ki.sK)(),n=(0,O.ID)(),o=(0,v.vt)(),i=(0,G.w7)(),s=(0,r.useCallback)((0,ge.s)(300,(e=>{const r=e.target.value;t(r),(0,de.H)("toc-search","search-automatic-trigger","charts-view",r),r&&(0,Gi.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,ce.useInputValue)({value:e,onChange:s}),d=(0,r.useCallback)((()=>{t(""),c(),(0,de.H)("toc-search","clear-search-button","charts-view")}),[]);return(0,pe.jsx)(ce.TextInput,{value:a,onChange:l,size:"small",iconRight:a&&(0,pe.jsx)(ce.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 Ui=n(61841);const qi=(0,ge.s)(300,((e,t)=>(0,de.H)("toc-search","search-results","charts-view",e,"".concat(t," -- charts")))),Ji=()=>{const e=(0,j.Zp)(),[t]=(0,Ui.Ay)(),n=(0,Ki.Um)(),{filteredChartsCount:o,chartsCount:i}=(0,Ki.Ad)();(0,r.useEffect)((()=>{n&&qi(n,o)}),[n,o]);const s=(0,r.useCallback)((n=>{n.preventDefault(),e("/spaces/".concat(t,"/settings/configurations"),{replace:!0})}),[t,e]);return(0,pe.jsxs)(ce.Flex,{alignItems:"center",justifyContent:"between",width:"100%",children:[(0,pe.jsxs)(ce.TextMicro,{color:"textLite",margin:[1,0,0],"data-testid":"numberOfChartsIndication",children:["Showing"," ",(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-filteredChartsCount",children:o})," ","of total"," ",(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription","data-testid":"numberOfChartsIndication-chartsCount",children:i})," ","charts"]}),(0,pe.jsx)(je.A,{Component:ce.TextMicro,margin:[1,0,0],"data-ga":"toc-search::click-link-collectors::".concat(name),onClick:s,target:"_blank",rel:"noopener noreferrer",children:"Add more charts"})]})},$i=()=>{const{filteredChartsCount:e}=(0,Ki.Ad)();return e||null===e?null:(0,pe.jsxs)(ce.Flex,{width:"100%",gap:1,margin:[4,0,0],padding:[2],alignItems:"center","data-testid":"noResultsWereFound",children:[(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription"}),(0,pe.jsx)(ce.TextMicro,{strong:!0,color:"textDescription",children:"No results were found"})]})};var Yi=n(14512);const Zi=()=>(0,pe.jsxs)(ce.Flex,{column:!0,alignItems:"center",children:[(0,pe.jsx)(Wi,{}),(0,pe.jsx)(Ji,{}),(0,pe.jsx)(Yi.A,{}),(0,pe.jsx)($i,{})]}),Xi=["width","height","videoId"];function Qi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function es(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qi(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ts=e=>{let{width:t=443,height:n=249,videoId:r}=e,o=(0,W.A)(e,Xi);return(0,pe.jsx)(ce.Flex,es(es({},o),{},{children:(0,pe.jsx)(ce.Box,{className:"video-responsive",children:(0,pe.jsx)("iframe",{width:t,height:n,src:"https://www.youtube.com/embed/".concat(r),frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Embedded youtube"})})}))};var ns=n(58218),rs=n(14815);const os=()=>{const e=(0,O.ID)(),t=(0,f.JT)("node:Create");return(0,pe.jsxs)(_.A,{column:!1,"data-testid":"noNodesViewPage",gap:12,padding:[6],children:[(0,pe.jsxs)(ce.Flex,{column:!0,gap:5,flex:{shrink:0,grow:0},"data-testid":"noKubernetesView-videoSection",children:[(0,pe.jsx)(ts,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:_e.BX[0]}),(0,pe.jsx)(ts,{"data-testid":"noNodesView-onboardingVideo",height:350,width:850,videoId:_e.BX[1]})]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:4,children:[(0,pe.jsxs)(ce.Box,{border:{side:"bottom",color:"borderSecondary"},children:[(0,pe.jsx)(ce.Box,{margin:[0,0,2,0],children:(0,pe.jsx)(je.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,pe.jsx)(ce.TextBig,{color:"primary",children:"Kubernetes monitoring with Netdata: Overview and visualizations"})})}),(0,pe.jsx)(ce.Box,{margin:[0,0,2,0],children:(0,pe.jsx)(je.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,pe.jsx)(ce.TextBig,{color:"primary",children:"Kubernetes visualizations"})})})]}),(0,pe.jsx)(ce.Flex,{column:!0,gap:4,children:t?(0,pe.jsx)(ns.A,{integrationId:rs.v2,rooms:[e]}):(0,pe.jsx)(B.S,{})})]})]})};var is=n(67012),ss=n(77611);const as=vr.default.div.withConfig({displayName:"selections__Separator",componentId:"sc-1cc7y18-0"})(["width:1px;height:",";background:",";"],(0,ce.getSizeBy)(2.5),(0,ce.getColor)("borderSecondary")),ls=[{label:"Volume",value:"volume"},{label:"KS2",value:"ks2"}],cs=[{label:"Average",value:"average"},{label:"Median",value:"median"},{label:"Min",value:"min"},{label:"Max",value:"max"},{label:"Stddev",value:"stddev"}],ds=[{label:"Metrics",value:""},{label:"Anomaly Rate",value:"anomaly-bit"}],us=()=>(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:[(0,pe.jsx)(ce.TextMicro,{children:"Choose the algorithm you want to be used to identify correlations across metrics:"}),(0,pe.jsxs)(ce.TextMicro,{children:[(0,pe.jsx)(ce.TextMicro,{strong:!0,children:"KS2:"})," A statistical test comparing the distribution of the highlighted window to the baseline."]}),(0,pe.jsxs)(ce.TextMicro,{children:[(0,pe.jsx)(ce.TextMicro,{strong:!0,children:"Volume:"})," Percentage change in averages between highlighted window and baseline."]})]}),ps=()=>(0,pe.jsx)(ce.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,pe.jsx)(ce.TextMicro,{children:"What aggregation function do you want to apply when aggregating multiple datapoints for metric correlations."})}),hs=()=>(0,pe.jsx)(ce.Flex,{column:!0,gap:1,alignItems:"center",width:"220px",children:(0,pe.jsx)(ce.TextMicro,{children:"Do you want to find correlations over the metric values or the anomaly rates of each metric."})}),gs=e=>{let{runGetWeights:t,nodeIds:n,flavour:o}=e;const{method:i,options:s,group:a}=(0,ss.G9)({nodeIds:n,flavour:o}),l=null!==s&&void 0!==s&&s.includes(ds[1].value)?ds[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:ls.find((e=>e.value===i)),group:cs.find((e=>e.value===a)),option:ds.find((e=>e.value===l))})),[i,a,l]);return a?(0,pe.jsxs)(ce.Flex,{gap:2,children:[(0,pe.jsxs)(ce.Flex,{gap:1,alignItems:"center",children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Method:"}),(0,pe.jsx)(ce.Select,{options:ls,value:d.method,onChange:c("method")}),(0,pe.jsx)(tt.A,{isBasic:!0,plain:!0,content:us,align:"bottom",children:(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,pe.jsx)(as,{}),(0,pe.jsxs)(ce.Flex,{gap:1,alignItems:"center",children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Aggregation:"}),(0,pe.jsx)(ce.Select,{options:cs,value:d.group,onChange:c("group")}),(0,pe.jsx)(tt.A,{isBasic:!0,plain:!0,content:ps,align:"bottom",children:(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,pe.jsx)(as,{}),(0,pe.jsxs)(ce.Flex,{gap:1,alignItems:"center",children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Data:"}),(0,pe.jsx)(ce.Select,{options:ds,value:d.option,onChange:c("options")}),(0,pe.jsx)(tt.A,{isBasic:!0,plain:!0,content:hs,align:"bottom",children:(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription",size:"small"})})]}),(0,pe.jsx)(as,{})]}):null};var fs=n(64587);const xs=e=>{let{highlightAfter:t,highlightBefore:n,baseline:r}=e;const{localeDateString:o,localeTimeString:i}=(0,fs.$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),p=(0,q.rI)("highlight");return(0,pe.jsxs)(ce.Flex,{gap:4,alignItems:"center",children:[(0,pe.jsxs)(ce.Flex,{gap:2,children:[(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Selected area:"}),(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Reference baseline:"})]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsxs)(ce.TextSmall,{"data-testid":"metricCorrelation-selectedArea",children:[o(s,{long:!1}),","," ",i(s),"\xa0->\xa0",o(a,{long:!1}),","," ",i(a)]}),(0,pe.jsxs)(ce.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline",children:[o(l,{long:!1}),","," ",i(l),"\xa0->\xa0",o(c,{long:!1}),","," ",i(c)]})]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Duration:"}),(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Duration:"})]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsxs)(ce.TextSmall,{"data-testid":"metricCorrelation-selecteArea-duration",children:[d,"\xa0secs"]}),(0,pe.jsxs)(ce.TextSmall,{"data-testid":"metricCorrelation-referenceBaseline-duration",children:[u,"\xa0secs"]})]})]}),(0,pe.jsx)(tt.A,{content:"Clear selection",align:"bottom",isBasic:!0,children:(0,pe.jsx)(ce.Button,{neutral:!0,flavour:"borderless",icon:"trashcan",onClick:()=>{p({after:null,before:null})},"data-ga":"metric-correlation::click-delete::charts-view","data-testid":"metricCorrelation-delete"})})]})};function ms(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const bs=(0,xt.A)(ce.Button),js=(0,vr.default)(ce.Button).withConfig({displayName:"correlation__LogoButton",componentId:"sc-15d72m3-0"})(["&&{pointer-events:none;}"]),ys=(0,vr.default)(ce.Button).withConfig({displayName:"correlation__CloseButton",componentId:"sc-15d72m3-1"})(["position:absolute !important;top:-3px;right:-3px;"]),vs=(0,xt.A)(ys),Os=(0,vr.default)(ce.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;}"]),ws=e=>{let{flavour:t}=e;const n=(0,v.vt)(),o=(0,O.ID)(),i=(0,K.nl)(),s=(0,r.useMemo)((()=>i?[i]:[]),[i]),a=(0,G.w7)({extraKey:"nodesView",merge:!1,scoped:!0}),l="singleNode"===t?s:a,[c,d]=(0,r.useState)(!1),[u,p]=(0,r.useState)(),{threshold:h,totalDimensionsCount:g,dimensionsCount:f,loaded:x,loading:b,getWeights:j,resetWeights:y}=(0,ss.Yy)({nodeIds:l,flavour:t},n,o),{method:w,options:C,group:P}=(0,ss.G9)({nodeIds:l,flavour:t}),{after:I,before:A}=(0,q.rW)("highlight"),k=I-4*(A-I),S=!!I;(0,r.useEffect)((()=>{if(x){let e="default-result";if(P){const t=null!==C&&void 0!==C&&C.includes("anomaly-bit")?"anomaly-bit":"metrics";e="default-result-".concat(w,"-").concat(P,"-").concat(t)}return(0,de.H)("metrics-correlation",e,"charts-view",f.toString())}}),[x]),(0,is.A)((()=>{I&&d(!0)}),[I]);const D=(0,q.rI)("correlation"),M=(0,q.rI)("threshold"),T=(0,q.rI)("highlight"),N=(0,r.useCallback)((()=>{D(!1),T({after:null,before:null}),M(ss.UG),y(),(0,de.H)("metrics-correlation","click-close","charts-view","".concat(x?"finish":"start"))}),[D,T,M,y,x]),F=(0,r.useCallback)((()=>{M(ss.UG),y(),(0,de.H)("metrics-correlation","click-delete","charts-view","".concat(x?"finish":"start"))}),[M,y,x]),E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(!1),p(),j(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ms(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ms(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({highlightAfter:I,highlightBefore:A,baselineAfter:k,baselineBefore:I,method:w,options:C,group:P,nodeIds:l},e)).then((()=>M(ss.UG)))},L=!S||b;return(0,is.A)((()=>{x&&c&&S&&E()}),[x,S,c]),(0,r.useEffect)((()=>()=>y()),[]),(0,pe.jsxs)(ce.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:[S?x?(0,pe.jsx)(V._0,{feature:"MetricCorrelations",totalDimensionsCount:g,dimensionsCount:f,children:(0,pe.jsxs)(ce.Flex,{"data-testid":"metricCorrelation-resultsContainer",column:!0,width:"100%",children:[(0,pe.jsxs)(ce.Flex,{justifyContent:"between",alignItems:"center",gap:1,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{name:"correlation",color:"primary",width:"16px",height:"16px"}),(0,pe.jsxs)(ce.TextSmall,{children:["Analysed"," ",(0,pe.jsx)(ce.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsAnalyzed",children:g})," ","and found"," ",(0,pe.jsx)(ce.TextSmall,{color:"primary","data-testid":"metricCorrelation-resultsFound",children:f})," ","correlated metrics."]}),(0,pe.jsx)(tt.A,{content:"Clear results",children:(0,pe.jsx)(Os,{flavour:"borderless",neutral:!0,disabled:b||!x&&!S,onClick:F,"data-testid":"metricCorrelation-clear",small:!0,icon:"reload"})})]}),(0,pe.jsx)(gs,{runGetWeights:E,nodeIds:l,flavour:t})]}),(0,pe.jsxs)(ce.Flex,{width:"100%",children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:3,margin:[0,2,0,5],width:"100%",children:[(0,pe.jsx)(ce.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show less"}),(0,pe.jsx)(ce.InputRange,{"data-testid":"metricCorrelation-resultsSlider",min:0,max:1,onChange:e=>M(e.target.value.toString()),onClick:()=>(0,de.H)("metric-correlation","click-slider","charts-view"),step:.01,value:h}),(0,pe.jsx)(ce.TextNano,{whiteSpace:"nowrap",color:"textDescription",children:"Show more"})]}),(0,pe.jsx)(pe.Fragment,{children:(0,pe.jsx)(tt.A,{content:"Give us your feedback! Was it useful?",align:"bottom",enterDelay:200,showArrow:!0,activateOn:"hover",children:(0,pe.jsxs)(ce.Flex,{children:[(0,pe.jsx)(ce.Button,{flavour:"+"===u?"hollow":"borderless",disabled:u,icon:"thumb_up",onClick:()=>p("+"),"data-ga":"metric-correlation::click-thumbs-up::charts-view","data-testid":"metricCorrelation-thumbsUp",small:!0}),(0,pe.jsx)(ce.Button,{flavour:"-"===u?"hollow":"borderless",disabled:u,icon:"thumb_down",onClick:()=>p("-"),"data-ga":"metric-correlation::click-thumbs-down::charts-view","data-testid":"metricCorrelation-thumbsDown",small:!0})]})})})]})]})}):(0,pe.jsxs)(ce.Flex,{alignItems:"center","data-testid":"correlationView-timePeriod-container",gap:4,children:[(0,pe.jsx)(js,{icon:"logo_s",isLoading:b}),b?(0,pe.jsx)(ce.H5,{"data-testid":"metricCorrelation-loadingCalculation",children:"Calculating metric correlations..."}):(0,pe.jsx)(xs,{highlightAfter:I,highlightBefore:A,baseline:k})]}):(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Icon,{name:"correlation",color:"primary"}),(0,pe.jsx)(ce.Text,{children:"Select a timeframe on any chart and find correlated metrics. Visit documentation"}),(0,pe.jsx)("a",{href:"https://learn.netdata.cloud/docs/cloud/insights/metric-correlations",target:"_blank",rel:"noreferrer",children:(0,pe.jsx)(ce.Icon,{name:"nav_arrow_goto",color:"primary",width:"12px",height:"12px"})})]}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",children:[(!x||b)&&(0,pe.jsx)(tt.A,{content:L?"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,pe.jsx)(bs,{label:b?"Loading...":"Find correlations",isLoading:!1,onClick:E,disabled:L,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,pe.jsx)(tt.A,{content:"Close",align:"bottom",children:(0,pe.jsx)(vs,{neutral:!0,flavour:"borderless",onClick:N,"data-ga":"metric-correlation::click-close::charts-view","data-testid":"metricCorrelation-close",icon:"x",feature:"MetricCorrelations"})})]})]})},Cs=e=>{let{children:t}=e;return(0,pe.jsxs)(ce.Flex,{"data-testid":"selected-nodes-container",gap:1,alignItems:"center",width:"100%",children:[(0,pe.jsx)(ce.Flex,{alignItems:"center",children:(0,pe.jsx)(ce.TextSmall,{whiteSpace:"nowrap","data-testid":"selected-nodes-container-message",color:"primary",children:"Selected filters:"})}),(0,pe.jsx)(ce.Flex,{height:{max:50},overflow:{vertical:"auto"},padding:[1],gap:1,alignItems:"center",flexWrap:!0,children:t})]})},Ps=(0,r.memo)(Cs),Is=e=>{let{onRemove:t}=e;return(0,pe.jsx)(ce.Box,{"data-testid":"remove-button",as:ce.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"textLite"})},As=e=>{let{removeFilter:t,group:n,id:r,value:o,isAnchorDisabled:i,onClick:s,ref:a}=e;const[l,c]=o.split("|"),d=c?"".concat(l," > ").concat(c):l;return(0,pe.jsx)(ce.Flex,{ref:a,"data-testid":"selected-node-item-".concat(r),children:(0,pe.jsx)(ce.Pill,{flavour:"neutral",hollow:!0,children:(0,pe.jsxs)(ce.Flex,{position:"relative",gap:2,alignItems:"center",children:[s?(0,pe.jsx)(je.A,{Component:ce.TextSmall,disabled:i,onClick:s,cursor:"pointer",color:"text",hoverColor:"primary",visitedColor:"accent",disabledColor:"textLite",children:d}):(0,pe.jsx)(ce.TextSmall,{children:d}),(0,pe.jsx)(Is,{onRemove:()=>t({param:n,removedValue:r}),id:r})]})})})},ks=(0,r.memo)(As),Ss={selectedNodeIds:"Node",nodeStatuses:"Status",nodeLabels:"Host label",nodeCapabilities:"Capability",nodeVersions:"Version"},Ds=e=>{let{group:t,subGroup:n,groupLabel:o,values:i,filtersByLabel:s={},hasUnion:a,union:l="AND",removeFilter:c,Component:d=ks}=e;const u=o||Ss[t];if(!Array.isArray(i)||!i.length)return null;const p="nodeLabels"!==t||n?{}:s,h=Object.entries(p);return h.length?h.map(((e,n)=>{let[r,o]=e;return(0,pe.jsx)(Ds,{group:t,subGroup:r,groupLabel:"".concat(Ss[t]," ").concat(r),values:o,hasUnion:n>0,removeFilter:c},n)})):(0,pe.jsxs)(r.Fragment,{children:[a&&(0,pe.jsx)(ce.TextSmall,{strong:!0,children:l}),(0,pe.jsxs)(ce.Pill,{flavour:"neutral",hollow:!0,gap:1,TextComponent:ce.Flex,textProps:{alignItems:"center",gap:1},flexWrap:!0,children:[(0,pe.jsxs)(ce.TextNano,{strong:!0,children:[u,":"]}),i.map(((e,o)=>(0,pe.jsxs)(r.Fragment,{children:[o>0&&(0,pe.jsx)(ce.TextSmall,{strong:!0,children:"OR"}),(0,pe.jsx)(d,{removeFilter:c,id:n?"".concat(n,"|").concat(e):e,value:e,group:t})]},e)))]})]},"filter")},Ms=e=>{let{removeFilter:t,value:n,ref:r}=e;const o=(0,K.xY)(n,"name"),i=(0,K.xY)(n,"isOffline"),s=(0,K.d3)(n);return(0,pe.jsx)(ks,{ref:r,removeFilter:t,group:"selectedNodeIds",id:n,value:o,isAnchorDisabled:i,onClick:s})},Ts=(0,r.memo)((e=>{let{flavour:t}=e;const[[n,r=[]],o]=(0,G._e)({extraKey:t,merge:!1});if(!n.length&&!r.length)return(0,pe.jsx)("div",{});const i=(0,G.Pt)(n);return(0,pe.jsx)(ce.Flex,{width:"100%",overflow:"hidden",padding:[2,0],children:(0,pe.jsxs)(Ps,{children:[n.map(((e,t)=>{let[n,r]=e;return(0,pe.jsx)(Ds,{group:n,values:r,filtersByLabel:i,hasUnion:t>0,removeFilter:o},n)})),(0,pe.jsx)(Ds,{group:"selectedNodeIds",values:r,hasUnion:!!n.length&&!!r.length,union:"OR",removeFilter:o,Component:Ms})]})})}));var Ns=n(88434);const Fs=["flavour"];function Es(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ls(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Es(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Es(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Rs={overview:Ts,default:null},Bs=(0,r.memo)((e=>{let{flavour:t}=e,n=(0,W.A)(e,Fs);const{showCorrelation:r}=(0,Ns.A)(),o=Rs[t]||Rs.default;return(0,pe.jsx)(ce.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,pe.jsx)(ws,{flavour:t}):!!o&&(0,pe.jsx)(o,Ls(Ls({},n),{},{flavour:t}))})})),Vs=Bs;var Hs=n(27024),_s=n(98591),zs=n(47213);const Ks=["id","contexts","menuId","parentIds"];function Gs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ws(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gs(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Us=e=>{let{id:t,contexts:n,menuId:r,parentIds:o}=e,i=(0,W.A)(e,Ks);const s=(0,Fe.bD)();return(0,zs.q)(s)(n,r||t,o)?(0,pe.jsx)(Bt.h,Ws(Ws({id:t},i),{},{children:(0,pe.jsx)(Vt.$,{id:t,hasTooltip:!0,flavour:i.extraKey,enableFavourites:!0,level:i.level,descendantIds:i.descendantIds,selfChartIds:i.selfChartIds})})):null},qs=(0,r.memo)(Us);var Js=n(5020),$s=n(80744),Ys=n(64156),Zs=n(28973),Xs=n(1817),Qs=n(2404),ea=n.n(Qs),ta=n(52795);const na=(0,$.eU)(null),ra=()=>{const e=(0,zn.eg)(),t=(0,J.md)(na);return e&&e.getRoot().getChildren().find((e=>e.match({id:t})))},oa=e=>t=>"overview-page::".concat(e.getAttribute("id"),"::").concat(t);var ia=n(54251),sa=n(77679);const aa={},la=(e,t,n)=>{const o=(0,O.ID)(),[i,s]=(0,sa.w)(),a=i?s:o,l=(0,q.rW)("contextSearchFilters",{key:a,extraKey:"chartFilters",flavour:"obj",defaultValue:aa});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])},ca=["style","handleProps","attributes","listeners","dragging","dragOverlay","id","resizeHandle","onChangeHeight","onRemove","expanded","ref","menuId","subMenuId","parentIds"],da=["contextScope"];function ua(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ua(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ua(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ha=[],ga=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):ha,selectedInstances:e.instances?Object.keys(e.instances):ha,selectedNodes:e.nodes?Object.keys(e.nodes):ha,weight:e.weight}},fa=e=>{let{style:t,handleProps:n,attributes:o,listeners:i,dragging:s,dragOverlay:a,id:l,resizeHandle:c,onChangeHeight:d,onRemove:u,expanded:p,ref:h,menuId:g,subMenuId:f,parentIds:x}=e;(0,W.A)(e,ca);const m=(0,r.useRef)({}),b=(0,O.ID)(),j=ra(),y=(0,br.aA)(l),{contextScope:v}=y,w=(0,W.A)(y,da),C=(0,zn.eg)(),{sendLog:P,isReady:I}=(0,nr.A)(),A=(0,ie.CS)({type:"chart",entity:v?v.join(","):l,path:"/"}),k=la(v,f||g,x),S=(0,r.useMemo)((()=>{if(!j)return null;let e=j.getNode({id:a?"dragOverlay-".concat(l):l});const t=(0,ta.A)(A,!0);if(e)return m.current=(0,ta.A)(pa(pa(pa({},e.getAttributes()),e.getAttribute("pristine")),{},{pristine:{}})),k&&!ea()(e.getAttribute("prevMatches"),k)&&e.setAttributes({selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...k.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...k.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...k.labels||[]])),prevMatches:k}),e;e=C.makeChart({attributes:pa(pa({id:a?"dragOverlay-".concat(l):l,roomId:b,expandable:!0},w),{},{contextScope:v,expanded:p,toolboxProps:{drag:pa(pa(pa({},n),i),o)}}),makeTrack:oa}),j.appendChild(e),m.current=(0,ta.A)(e.getAttributes());const r=e.getAttribute("chartLibrary");return e.setAttributes(pa(pa(pa({},m.current),t),k&&!ea()(e.getAttribute("prevMatches"),k)&&{selectedDimensions:Array.from(new Set([...t.selectedDimensions||[],...k.dimensions||[]])),selectedInstances:Array.from(new Set([...t.selectedInstances||[],...k.instances||[]])),selectedLabels:Array.from(new Set([...t.selectedLabels||[],...k.labels||[]])),prevMatches:k})),(0,ia.A)(e,r,e.getAttribute("chartLibrary")),e}),[j,b,l,a]);(0,r.useLayoutEffect)((()=>{S&&I&&"function"===typeof P&&S.updateAttribute("logOptions",{sendLog:P,payload:{feature:"Overview"}})}),[S,P,I]);const{weight:D,selectedDimensions:M,selectedInstances:T,selectedNodes:N}=(0,br.uy)(v.join("|"),ga),F=(0,Xs.A)(A),E=(0,Xs.A)(k,!0),L=(0,Xs.A)(M.length),R=(0,Xs.A)(T.length),B=(0,Xs.A)(N.length);return(0,is.A)((()=>{if(!S)return;const e=S.getAttribute("chartLibrary"),t={};if(!D||L===M.length&&R===T.length&&B===N.length?A&&!ea()(F,A)&&Object.assign(t,pa(pa({},m.current),(0,ta.A)(A,!0))):Object.assign(t,{selectedDimensions:M,selectedInstances:T,selectedNodes:N}),k&&!ea()(E,k)){const e=S.getAttributes();Object.assign(t,{selectedDimensions:Array.from(new Set([...e.selectedDimensions||[],...t.selectedDimensions||[],...k.dimensions||[]])),selectedInstances:Array.from(new Set([...e.selectedInstances||[],...t.selectedInstances||[],...k.instances||[]])),selectedLabels:Array.from(new Set([...e.selectedLabels||[],...t.selectedLabels||[],...k.labels||[]])),prevMatches:k})}Object.keys(t).length>0&&(S.updateAttributes(t),(0,ia.A)(S,e,S.getAttribute("chartLibrary")),S.trigger("fetch"))}),[S,b,l,A,k,D,M.length,T.length,N.length]),(0,r.useLayoutEffect)((()=>{S&&t&&(S.updateAttributes({height:t.height,width:t.width}),S.trigger("resize"))}),[S,t.height,t.width]),(0,r.useLayoutEffect)((()=>{if(S)return(0,Zs.unregister)(S.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}=S.getAttributes();d(l,(e?1:-1)*t)})))}),[S]),(0,is.A)((()=>{S&&S.updateAttributes({toolboxProps:{drag:pa(pa(pa(pa({},n),i),o),{},{dragging:s})}})}),[S,s]),S?(0,pe.jsxs)(ce.Box,{ref:h,style:t,children:[(0,pe.jsx)(Yn.A,{chart:S,"data-chartid":a?"dragOverlay-".concat(l):l,"data-track":S.track("container"),height:t.height,width:"100%"}),c]},j&&j.getId()):null},xa=(0,r.memo)(fa,((e,t)=>e.id===t.id&&e.style===t.style)),ma=["id","menuId","subMenuId","parentIds","containerWidth"],ba=["id"];function ja(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ya(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ja(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ja(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const va=function(){let{id:e,layout:t={},contextScope:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,Js.bP)(e,t,ya(ya({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}))},Oa=e=>{let{id:t,menuId:n,subMenuId:o,parentIds:i,containerWidth:s}=e,a=(0,W.A)(e,ma);const l=(0,br.aA)(t,va),c=(0,Fe.bD)(),d=(0,zs.q)(c),[u,p]=(0,r.useState)((()=>[l])),h=(e,t)=>{(0,Js.Q)(t),p(e)},g=(0,r.useRef)(1),f=(e,t)=>{const n=u.findIndex((t=>t.id===e));-1!==n&&(u[n]=ya(ya({},u[n]),{},{height:u[n].height+t/$s.NA,expanded:t>0}),h([...u],u[n]),g.current+=1)},x=(0,Ys.A)("(max-width: 767px)"),m=(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]),b=(0,r.useMemo)((()=>e=>{let{id:t}=e,r=(0,W.A)(e,ba);return(0,pe.jsx)(xa,ya({id:t,role:"graphics-object","aria-roledescription":"chart","data-menuid":o||n,menuId:n,subMenuId:o,onChangeHeight:f,parentIds:i},r),t)}),[o,n,i]);return(0,pe.jsx)($s.Ay,ya(ya({cacheId:g.current,rootId:t,containerId:t,onDragEnd:h,items:m,containerWidth:s-(x?16:26),"data-menuid":o||n},a),{},{Item:b,rearrangeable:!0}))},wa=(0,r.memo)(Oa);var Ca=n(54025),Pa=n(63996);const Ia=e=>{let{id:t,contexts:n,menuId:r,parentIds:o,extraKey:i,descendantIds:s,level:a,selfChartIds:l}=e;const c=(0,Fe.bD)();return(0,zs.q)(c)(n,r||t,o)?(0,pe.jsx)(Ca.t,{gap:0,id:t,testId:"chart-sub-menu-container-overview",children:(0,pe.jsx)(Pa.t,{id:t,margin:[1,0,0],hasTooltip:!0,flavour:i,enableFavourites:!0,level:a,descendantIds:s,selfChartIds:l})}):null},Aa=(0,r.memo)(Ia);var ka=n(4719);const Sa=e=>{let{id:t}=e;const n=(0,O.ID)(),o=(0,zn.eg)(),i=(0,br.Vt)(),{chartIds:s}=(0,ka.b)(t),a=ra(),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-".concat(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:oa}),a.appendChild(r),r}),[t,a]);return(0,pe.jsx)(Yn.A,{margin:[0,0,2],chart:l,"data-chartid":t,"data-track":l.track("container")},a.getId())},Da=["id"];function Ma(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ta(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ma(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ma(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Na=e=>{let{id:t}=e,n=(0,W.A)(e,Da);return(0,pe.jsxs)(Bt.h,{id:t,padding:[6,0,0],children:[(0,pe.jsx)(Vt.$,{id:t}),(0,pe.jsx)(Ht.n,{id:t,padding:[2,0,0]}),(0,pe.jsx)(Sa,Ta({id:t},n))]})},Fa=(0,r.memo)(Na);function Ea(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function La(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ea(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ea(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Ra=[],Ba=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{selectedDimensions:e.dimensions?Object.keys(e.dimensions):Ra,selectedInstances:e.instances?Object.keys(e.instances):Ra,selectedNodes:e.nodes?Object.keys(e.nodes):Ra,weight:e.weight}},Va=(0,br.BK)((e=>{var t;let{style:n,id:o,menuChartAttributes:i,resizeHandle:s,handleProps:a,listeners:l,dragging:c,dragOverlay:d,onChangeHeight:u,expanded:p,ref:h,menuId:g,subMenuId:f,parentIds:x}=e;const m=(0,r.useRef)({}),b=(0,O.ID)(),j=(0,zn.eg)(),y=ra(),v=(0,ie.CS)({type:"chart",entity:o,path:"/"}),w=la(i.contextScope,f||g,x),C=(0,r.useMemo)((()=>{let e=y.getChildren().find((e=>e.match({id:d?"dragOverlay-".concat(o):o})));const t=(0,ta.A)(v,!0);if(e)m.current=(0,ta.A)(La(La({},e.getAttributes()),e.getAttribute("pristine"))),w&&!ea()(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:La(La({expandable:!0},i),{},{roomId:b,id:d?"dragOverlay-".concat(o):o,isHead:!0,expanded:p}),makeTrack:oa,toolboxProps:{drag:La(La({},a),l)}}),m.current=(0,ta.A)(e.getAttributes());const n=e.getAttribute("chartLibrary");e.setAttributes(La(La(La({},m.current),t),w&&ea()(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,ia.A)(e,n,e.getAttribute("chartLibrary")),y.appendChild(e)}return e}),[b,o,y]),{weight:P,selectedDimensions:I,selectedInstances:A,selectedNodes:k}=(0,br.uy)(null===(t=i.contextScope)||void 0===t?void 0:t.join("|"),Ba),S=(0,Xs.A)(v),D=(0,Xs.A)(w,!0,ea()),M=(0,Xs.A)(I.length),T=(0,Xs.A)(A.length),N=(0,Xs.A)(k.length);(0,is.A)((()=>{if(!C)return;const e={},t=C.getAttribute("chartLibrary");if(!P||M===I.length&&T===A.length&&N===k.length?v&&!ea()(S,v)&&Object.assign(e,La(La({},m.current),(0,ta.A)(v,!0))):Object.assign(e,{selectedDimensions:I,selectedInstances:A,selectedNodes:k}),w&&!ea()(D,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,ia.A)(C,t,C.getAttribute("chartLibrary")),C.trigger("fetch"))}),[C,b,o,v,w,P,I.length,A.length,k.length]),(0,r.useLayoutEffect)((()=>{C.updateAttributes({toolboxProps:{drag:La(La(La({},a),l),{},{dragging:c})}})}),[C,c]),(0,r.useLayoutEffect)((()=>{if(C)return(0,Zs.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();u(o,(e?1:-1)*t)})))}),[C]),(0,is.A)((()=>{if(!C)return;const e=parseFloat(n.height);e&&!isNaN(e)&&(C.updateAttribute("height",e),C.trigger("resize"))}),[n.height]);return(0,Fe.Bu)(i.contextScope)?(0,pe.jsxs)("div",{ref:h,style:n,children:[(0,pe.jsx)(Yn.A,{chart:C,"data-track":C.track("container"),"data-chartid":d?"dragOverlay-".concat(o):o,height:n.height,width:"100%"}),s]},y.getId()):null})),Ha=(e,t,n)=>(e.layout||console.warn(t,"has no layout set, default values will be used."),(0,Js.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})),_a=(0,r.memo)((e=>{let{itemIds:t,containerWidth:n,id:o,subMenuId:i,menuId:s,parentIds:a}=e;const l=(0,br.dd)(t,Ha),{filteredChartsCount:c}=(0,Ki.Ad)(),d=(0,Ys.A)("(max-width: 767px)"),u=(0,Fe.bD)(),p=(0,zs.q)(u),[h,g]=(0,r.useState)((()=>l)),f=(e,t)=>{(0,Js.Q)(t),g(e)},x=(0,r.useRef)(1),[m,b]=(0,r.useState)(!1),j=(0,r.useMemo)((()=>t.some((e=>null!==localStorage.getItem("chart_layout/".concat(e))))),[t]),y=(0,r.useCallback)((()=>{t.forEach((e=>{localStorage.removeItem("chart_layout/".concat(e))})),x.current+=1,g(l)}),[t,l]);(0,r.useEffect)((()=>{const e=()=>{x.current+=1,g(l)};return window.addEventListener("resetChartLayout",e),()=>window.removeEventListener("resetChartLayout",e)}),[l,d]);const v=(0,r.useMemo)((()=>(x.current+=1,h.filter((e=>!!e&&(!!e.contextScope&&p(e.contextScope,s,a)))))),[t,h,c,p,s,a]);return v.length?(0,pe.jsxs)(ce.Flex,{position:"relative",width:"100%",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:[m&&j&&(0,pe.jsx)(ce.Flex,{position:"absolute",top:2,right:2,zIndex:10,background:"dropdown",round:1,padding:[1],border:!0,children:(0,pe.jsx)(tt.A,{content:"Reset all charts to default layout",align:"left",children:(0,pe.jsx)(ce.IconButton,{icon:"refresh",onClick:y,flavour:"borderless",padding:[1],"data-testid":"grid-reset-layout-button"})})}),(0,pe.jsx)($s.Ay,{cacheId:x.current,rootId:o,containerId:o,"data-chartid":o,"data-menuid":i||s,onDragEnd:f,items:v,containerWidth:n-(d?16:26),gridTracks:d?1:12,Item:Va,rearrangeable:!0,itemProps:{onChangeHeight:(e,t)=>{const n=h.findIndex((t=>t.id===e));-1!==n&&(h[n]=La(La({},h[n]),{},{height:h[n].height+t/$s.NA,expanded:t>0}),f([...h],h[n]),x.current+=1)},menuId:s,subMenuId:i,parentIds:a},compactType:"vertical"})]}):null}),((e,t)=>e.itemIds===t.itemIds&&e.containerWidth===t.containerWidth)),za={k8s:Fa,root:qs,submenu:Aa,chart:wa,grid:_a},Ka=e=>{if(za[e.flavour])return za[e.flavour];switch(e.level){case 0:return qs;case 1:return Aa;case 2:return wa;default:return null}},Ga=e=>{let{flavour:t,onChartNameChange:n,initialChartName:r,dashboardOptions:o,linkToGo:i,contextToGo:s,containerWidth:a}=e;const[l,,,c]=(0,_s.A)("addToDashboardModal"),{setActiveMenuId:d}=(0,Lt.A)({onChartNameChange:n,initialChartName:r,linkToGo:i,contextToGo:s}),u=(0,Fe.bD)(),p=(0,zs.q)(u);return(0,pe.jsxs)(ae.H,{children:[(0,pe.jsx)(Rt.A,{flavour:t,onActiveMenuId:d,getComponent:Ka,dashboardOptions:o,initialChartName:r,containerWidth:a,checkVisibility:p}),l&&(0,pe.jsx)(Hs.A,{onClose:c})]})};function Wa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const Ua=(0,r.memo)((()=>{const{localeDateString:e,localeTimeString:t}=(0,fs.$j)(),[n,o]=(0,Ar.KB)(),i=(0,zn.eg)(),s=!!n&&!!i&&i.getNode({id:n.context}),a=()=>{if(o(null),null===n||void 0===n||!n.context||!s)return;const e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wa(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},s.getAttribute("overlays"));delete e.alert,s.updateAttribute("overlays",e),history.replaceState({},"")};(0,r.useEffect)((()=>a),[]);const l=(0,O.ID)(),c=(0,Fe.R7)((null===n||void 0===n?void 0:n.context)&&l,null===n||void 0===n?void 0:n.context);if(!n||null===c||void 0===c||!c.loaded)return null;const{firstEntry:d}=c;return(0,pe.jsx)(ce.Layer,{backdrop:!1,position:"top",margin:[26,0,0],padding:[26,0,0],children:(0,pe.jsxs)(ce.Flex,{background:"tooltip",padding:[1,2],gap:2,children:[(0,pe.jsxs)(ce.TextSmall,{children:["Showing alert in ",(0,pe.jsx)(ce.TextSmall,{strong:!0,children:n.instance})," on"," ",(0,pe.jsxs)(ce.TextSmall,{strong:!0,children:[e(new Date(1e3*n.lastStatusChange))," ",t(new Date(1e3*n.lastStatusChange))]}),!d&&" doesn't exist on the node anymore",!!d&&d>n.lastStatusChange&&" exceeds agent data retention settings"]}),(0,pe.jsx)(ce.Flex,{flex:!1,children:(0,pe.jsx)(ce.Icon,{name:"x",color:"tooltipText",onClick:a,size:"small"})})]})})})),qa=Ua;var Ja=n(14070);function $a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ya(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$a(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Za={NoChartsView:zi,NoNodesView:B.A,sidebar:{title:"Filters",hiddenTabs:["info"],Component:le.Ay,props:{}},dashboardOptions:{},loadingMessage:"Loading charts...",Header:Vs},Xa={overview:Ya(Ya({},Za),{},{sidebar:Ya(Ya({},Za.sidebar),{},{title:"Metrics"}),feature:"Overview"}),k8s:Ya(Ya({},Za),{},{NoChartsView:os,NoNodesView:os,sidebar:Ya(Ya({},Za.sidebar),{},{title:"Kubernetes"}),loadingMessage:"Loading k8s charts...",feature:"Kubernetes"}),singleNode:Ya(Ya({},Za),{},{sidebar:Ya(Ya({},Za.sidebar),{},{title:"Single Node",hiddenTabs:["filters"],props:{showCollapsed:!0}}),feature:"SingleNode"})},Qa=()=>((0,Mi.A)(),null),el=(0,r.memo)((e=>{let{flavour:t="overview",invalidationKey:n,nodeIds:r,loaded:o,getChart:i,chartIds:s,areChartsIdsEmpty:a,showNoChartsView:l,showNoNodesView:c,initializing:u,chartName:p,setChartName:h,chartsLoaded:g,widthRef:f,containerWidth:x,nodesKey:m,blurred:b,blurProps:y={},BlurredContent:v,noPreferredNodesError:O}=e;const{dashboardOptions:w,NoChartsView:C,NoNodesView:P,sidebar:I,Header:A,feature:k="Overview"}=Xa[t],{state:S}=(0,j.zy)(),[D,,,M]=(0,Ja.A)(),T=ra();return c?(0,pe.jsx)(V.Ay,{feature:k,mode:"NoNodesView",children:(0,pe.jsx)(P,{})}):u?(0,pe.jsx)(Ri.A,{title:"Please wait while charts are being initialized.",body:"Thank you for your patience!"}):o?(0,pe.jsx)(V.Ay,{feature:k,children:(0,pe.jsxs)(ae.A,{getObject:i,ids:s,linkToGo:null===S||void 0===S?void 0:S.chartName,extraKey:t,deps:[m],children:[(0,pe.jsx)(Qa,{}),(0,pe.jsx)(qa,{}),(0,pe.jsxs)(_.A,{ref:f,sidebar:(0,pe.jsx)(I.Component,Ya({nodeIds:r,title:I.title,initialChartName:p,hiddenTabs:I.hiddenTabs,flavour:t,loaded:g,FilterInputContainer:Zi},I.props)),blurred:b,blurProps:y,BlurredContent:v,children:[(0,pe.jsx)(A,{flavour:t}),g||O?l||a?(0,pe.jsx)(C,{noPreferredNodesError:O}):(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Ga,{flavour:t,dashboardOptions:w,initialChartName:p,onChartNameChange:h,linkToGo:null===S||void 0===S?void 0:S.chartName,contextToGo:null===S||void 0===S?void 0:S.contextToGo,containerWidth:x}),D&&M]}):(0,pe.jsx)(d.O2,{}),(0,pe.jsx)(Li,{container:T})]})]},n)}):(0,pe.jsx)(d.O2,{})})),tl=el;function nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const rl=e=>t=>{const n=(0,K.nl)(),o=(0,r.useMemo)((()=>[n]),[n]);return(0,pe.jsx)(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nl(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({flavour:"singleNode",nodeIds:o,nodeId:n},t),n)};var ol=n(64867),il=n(12407),sl=n(17829);function al(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ll(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?al(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):al(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cl=n(13752),dl=n(92815),ul=n(72582),pl=n(82650),hl=n(78072),gl=n(95980),fl=n(91832),xl=n(6504),ml=n(22332),bl=n(12897),jl=n.n(bl),yl=n(55042),vl=n.n(yl),Ol=new(jl())({id:"alarm_bell",use:"alarm_bell-usage",viewBox:"0 0 12 14",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 14" id="alarm_bell"><path d="M11.45 8.11A2.61 2.61 0 0 1 10 5.77V5c0-1.97-1.44-3.6-3.31-3.93 0-.02.01-.04.01-.07 0-.39-.31-.7-.7-.7s-.7.31-.7.7c0 .02.01.05.01.07C3.44 1.4 2 3.03 2 5v.76c0 1-.55 1.9-1.45 2.34L0 8.38v2.82c0 .99.81 1.8 1.8 1.8H5c0 .55.45 1 1 1s1-.45 1-1h3.2c.99 0 1.8-.81 1.8-1.8V8.38zM11 11.2c0 .44-.36.8-.8.8H1.8c-.44 0-.8-.36-.8-.8V10h5.5c.55 0 1-.45 1-1H1c1.23-.61 2-1.87 2-3.24V5c0-1.66 1.34-3 3-3s3 1.34 3 3v.76c0 1.37.77 2.62 2 3.24z" /></symbol>'});vl().add(Ol);const wl=Ol,Cl=(0,vr.default)(ce.Icon).withConfig({displayName:"styled__StyledAlertDot",componentId:"sc-12w0ym-0"})(["position:absolute;top:0;right:-1px;width:6px;height:6px;"]);var Pl=n(96026);const Il=["alertName","close","tooltip"],Al=["alertName","nodes","close","tooltip"],kl=["value","label","alerts","nodes","onClick"],Sl=["item","index","style","close","onItemClick"];function Dl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ml(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dl(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Tl=(0,Rn.A)((e=>{let{alertName:t,close:n,tooltip:o}=e,i=(0,W.A)(e,Il);const[,s]=(0,Ja.A)(),{sendLog:a}=(0,nr.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,pe.jsx)(ce.IconButton,Ml({icon:"goToNode",iconColor:"textLite",onClick:l,neutral:!0,padding:[0],width:"16px",height:"16px"},i))})),Nl=(0,Rn.A)((e=>{let{alertName:t,nodes:n,close:o,tooltip:i}=e,s=(0,W.A)(e,Al);const{goToEdit:a}=(0,Pl.q)({alertName:t,nodeIds:n}),{sendLog:l}=(0,nr.A)(),c=(0,r.useCallback)((e=>{e.stopPropagation(),l({feature:"MetricsChartManageAlerts",description:"Edit alert",alertName:t}),a(),o()}),[n,o,a,l]);return(0,pe.jsx)(ce.IconButton,Ml({icon:"pencilOutline",iconColor:"textLite",onClick:c,neutral:!0,padding:[0],width:"12px",height:"12px"},s))})),Fl=e=>{let{item:{value:t,label:n,alerts:r={},nodes:o,onClick:i},index:s,style:a,close:l,onItemClick:c}=e,d=(0,W.A)(e.item,kl),u=(0,W.A)(e,Sl);const{cl:p=0,cr:h=0,wr:g=0}=r,f={text:h,flavour:h?"error":"disabledError"},x={text:g,flavour:g?"warning":"disabledWarning"},m={text:p,flavour:p?"clear":"disabledClear"};return(0,pe.jsxs)(ce.MenuItemContainer,Ml(Ml(Ml({"data-index":s,onClick:e=>{i&&i(e)}},d),u),{},{style:a,alignItems:"center",justifyContent:"between",gap:2,padding:[1,2],overflow:"hidden",cursor:"default",children:[(0,pe.jsx)(ce.Flex,{width:{max:"180px"},alignItems:"center",children:(0,pe.jsx)(Qn.A,{text:n,TextComponent:ce.Text})}),(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.MasterCard,{pillLeft:f,pillRight:x,pillEnd:m}),(0,pe.jsx)(Tl,{alertName:t,close:l,tooltip:"Show alert instances",tooltipProps:{align:"bottom"}}),(0,pe.jsx)(Nl,{alertName:t,nodes:o,close:l,disabled:!o.length,tooltip:o.length?"Edit this alert configuration":"This alert is no longer configured in any node",tooltipProps:{align:"bottom"}})]})]}))};var El=n(39423),Ll=n(57869);const Rl=(0,xt.A)((0,Rn.A)(ce.Button)),Bl=e=>{let{loaded:t,contexts:n=[],close:o,onAddAlertClick:i}=e;const s=(0,ml.useChart)().getId(),a=null===n||void 0===n?void 0:n[0],{setSelectedTab:l}=(0,El.A)(),[c,d]=(0,Ui.Ay)(),{goToAlerts:u}=(0,Ll.A)({flavour:"alerts"}),p=(0,r.useMemo)((()=>a?"View the active alerts for ".concat(a," context"):"View the active alerts for this context"),[a]),h=(0,r.useCallback)((()=>{a&&(l(0),o(),u({context:a}))}),[a,u,l,c,d,o]),g=(0,r.useCallback)((()=>{i(),o()}),[i,o]);return(0,pe.jsxs)(ce.Flex,{gap:2,padding:[2],border:{side:"top"},justifyContent:"center",children:[(0,pe.jsx)(Rl,{feature:"MetricsChartManageAlerts",label:"Go to alerts",small:!0,flavour:"hollow",icon:"goToNode",onClick:h,tooltip:p,tooltipProps:{align:"bottom"},payload:{chartId:s},disabled:!a||!t}),(0,pe.jsx)(Rl,{feature:"MetricsChartManageAlerts",label:"Add alert",small:!0,icon:"plus",onClick:g,tooltip:"Start adding a new alert on ".concat(a," context"),tooltipProps:{align:"bottom"},payload:{chartId:s},disabled:!a||!t})]})};var Vl=n(12781);function Hl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hl(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const zl=e=>{let{disabled:t}=e;const n=(0,ml.useChart)(),o=(0,K.ss)(),{loaded:i,items:s,status:a}=(e=>{const[t,n]=(0,r.useState)(),[o,i]=(0,r.useState)([]),[s,a]=(0,r.useState)([]),[l,c]=(0,r.useState)(),d=(0,Ar.SU)();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;const i=(d||[]).filter((e=>e.name===t)).map((e=>{let{nd:t}=e;return t}));return{value:t,label:t,alerts:{cl:n,wr:r,cr:o},nodes:i}}))]),[o,s]),status:l}})(n),l=n.getAttribute("contextScope"),[,c]=(0,Vl.A)(),d=(0,r.useCallback)((()=>{const{selectedNodes:e,selectedInstances:t,labels:r,selectedLabels:o,contextScope:i}=n.getAttributes(),s=n.getUnitSign(),a=o.length?o:Object.entries(r).reduce(((e,t)=>{let[n,r]=t;return r.vl.forEach((t=>{let{id:r}=t;e.push("".concat(n,":").concat(r))})),e}),[]);c(_l(_l(_l({chart:i[0],viewUnits:s},(t||[]).length?{instances:t}:{}),(e||[]).length?{nodes:e}:{}),a?{labels:a}:{}))}),[n,o,c]);return n?(0,pe.jsx)(ce.Menu,{dropProps:{align:{top:"bottom",right:"right"},"data-toolbox":n.getId()},dropdownProps:{width:"360px"},Item:Fl,items:s,Footer:e=>{let{close:t}=e;return(0,pe.jsx)(Bl,{loaded:i,contexts:l,close:t,onAddAlertClick:d})},children:(0,pe.jsxs)(ce.Flex,{alignItems:"center",position:"relative",children:[a?(0,pe.jsx)(Cl,{name:"dot",color:a}):null,(0,pe.jsx)(xl.Button,{icon:(0,pe.jsx)(xl.default,{svg:wl,size:"16px"}),title:"Manage alerts",disabled:t,"data-testid":"chartHeaderToolbox-manageAlerts"})]})}):null};var Kl=n(77879),Gl=n(25147);const Wl=e=>{let{contexts:t=[]}=e;const n=(0,Kl.A)();return(0,r.useCallback)((async()=>{if(!t.length)return null;n({type:Gl.tD.chart,data:{contexts:t}})}),[t,n])};var Ul=n(40573);const ql=(0,vr.default)(ce.Flex).withConfig({displayName:"addToConversation__StyledContainer",componentId:"sc-1nawnhs-0"})(["&& svg{fill:",";}"],(0,ce.getColor)("primaryAI")),Jl=()=>{const e=(0,ml.useChart)(),t=(0,f.JT)("insights:CreateReport"),{isDemo:n}=(0,Ul.A)(),r=e.getAttribute("contextScope"),o=Wl({contexts:r});return N.ei||n||!t?null:(0,pe.jsx)(ql,{children:(0,pe.jsx)(xl.Button,{icon:(0,pe.jsx)(ce.Icon,{name:"conversationSubject",height:"16px"}),title:"Add to conversation",onClick:o,"data-testid":"chartHeaderToolbox-addToConversation"})})};function $l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$l(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Zl=(e,t,n)=>{let{width:o,host:i}=n;if(!i)throw"No host provided";const s=(0,zn.eg)(),a=(0,r.useRef)(),l=(0,Fe.aZ)(e,"error"),[{correlation:c},d]=(0,q.N9)(),{state:u,pathname:p}=(0,j.zy)(),h=(0,J.Xr)(na),g=(0,Fe.jI)(e),f=(0,Fe.DQ)(e);(0,r.useLayoutEffect)((()=>{if(!e||!s||l)return;let n=s.getRoot().getChildren().find((e=>e.match({id:p})));if(!n)return n=s.makeContainer({attributes:{id:p,roomId:e,host:i,navigation:c?"highlight":"pan",overlays:{proceeded:{type:"proceeded"}},composite:!0,nodesScope:t,hasCorrelation:!0,versions:g,containerWidth:o,toolboxElements:[Jl,zl,hl.default,ul.default,cl.default,dl.default,pl.default,fl.A,gl.A]}}),s.appendChild(n),h(p),a.current=n,(0,Zs.unregister)(s.on("correlation",((e,t)=>{if(!Array.isArray(t))return;const[n,r]=t;d((e=>Yl(Yl({},e),{},{highlight:{after:1e3*n,before:1e3*r},correlation:!0})))})),n.onAttributeChange("versions",f));h(p)}),[e,l,p,i]),(0,r.useMemo)((()=>{a.current&&(a.current.setAttribute("containerWidth",o),a.current.getNodes().forEach((e=>e.updateAttribute("containerWidth",o))))}),[a.current,o]),(0,is.A)((()=>{a.current&&a.current.setAttribute("host",i)}),[a.current,i]),(0,is.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:["".concat(t,"@").concat(n)],selectedNodes:[n]});const o=t&&n&&a.current.on("chartLoaded",(r=>{const i=r.getAttribute("id");e===i&&(r.updateAttributes({selectedInstances:["".concat(t,"@").concat(n)],selectedNodes:[n]}),o())}));return()=>u&&(0,Zs.unregister)(o)}),[a.current,u])};var Xl=n(43116);const Ql=["flavour","nodeIds","nodeId"];function ec(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ec(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ec(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const nc={default:{shouldHide:()=>!1},k8s:{shouldHide:e=>{let{context:t}=e;return!t.includes("k8s")}}},rc=[],oc="ErrNoPreferredNodeRequested",ic=e=>(0,r.memo)((t=>{let{flavour:n="overview",nodeIds:o=rc,nodeId:i}=t,s=(0,W.A)(t,Ql);const a=(0,v.vt)(),l=(0,O.ID)(),c=(0,O.XA)("nodeId");i=i||c;let d=(0,G.w7)({extraKey:n,merge:!1,scoped:!0});d=o.length?o:d;const{isNodeRestricted:u,loaded:p}=(0,ar.A)();d=(0,r.useMemo)((()=>d.filter((e=>!u(e).restricted))),[d,p]);const h=(0,R.nj)(),g=(0,Fe._0)(l),{state:f}=(0,j.zy)(),x=(0,Fe.R7)(l),m=(0,K.TG)(d),b=(0,Ne.A)(l,d,{spaceId:a}),{contexts:y,metadata:w,loaded:C,dimensionsCount:P}=(0,ss.Yy)({nodeIds:d,flavour:n},a,l),[,I]=(()=>{const{state:e={}}=(0,j.zy)(),{alertId:t=null}=e||{},[n,o]=(0,Ar.KB)(),i=t||(null===n||void 0===n?void 0:n.id),s=(0,Ar.JL)(i);(0,Ar.yk)(s.id),(0,r.useEffect)((()=>{(s.fullyLoaded||s.id)&&o(ll(ll({},s),{},{formattedLastStatusChangeValue:(0,sl.m3)(s.lastStatusChangeValue,s.units),linkToGo:(0,Ot.A)(s.context)}))}),[s.id,s.fullyLoaded]);const a=null!==n&&void 0!==n&&n.id?(0,Ot.A)(n.context):null;return[s.id,a]})(),A=o?o.join():n,k=(0,se.K)({spaceId:a,roomId:l}),[S,{width:D}]=(0,H.A)();Zl(l,d,{host:k,width:D});const M=(0,Fe.OL)(l),T=(0,Fe.rx)(l),N=C?w:x,F=nc[n]||nc.default,E=(0,Fe.bo)(l),L=(0,Xs.A)(E),B=(0,Ki.rq)(M,x,l,tc(tc({},F),{},{shouldHide:C?e=>{let{context:t}=e;return!y.includes(t)}:F.shouldHide,force:C||E!==L,cacheKey:"".concat(n,"-").concat(P,"-").concat(A)})),V=(0,Fe.yO)(l,w),_=(0,Xs.A)(b,!0),z=B<1,[U,J]=(0,q.N9)("chartName",{key:l,extraKey:A,flavour:"val"});(0,r.useEffect)((()=>{l&&J(I||(null===f||void 0===f?void 0:f.chartName)||U)}),[l,I]);const $=ra(),Y=Object.keys(N).length<1&&g||d.length&&!m.length,Z=(0,R.CK)(),X=(null===T||void 0===T?void 0:T.errorMsgKey)==oc;if(!Y&&!1!==_&&b&&"No data for this period"!==b&&b!==oc&&!Object.keys(N).length)return(0,pe.jsx)(Xl.A,{error:b});const Q=!!l&&h&&(!!$||X),{restricted:ee}=u(i);return(0,pe.jsx)(e,tc({nodeIds:m,loaded:Q,getChart:V,areChartsIdsEmpty:z,showNoNodesView:h&&!Z.length,showNoChartsView:Y,initializing:b&&(0,ol.O)(b),chartName:U,setChartName:J,chartsLoaded:g&&!!D,invalidationKey:l,flavour:n,chartIds:C?y:M,widthRef:S,containerWidth:D,nodesKey:A,noPreferredNodesError:X,blurred:ee,blurProps:{value:"12px"},BlurredContent:()=>(0,pe.jsx)(il.A,{flavour:c?"room":"node"})},s))}));var sc=n(21785),ac=n(72144),lc=n(75669),cc=n(39870),dc=n(7761);function uc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uc(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const hc=()=>{const e=(0,v.vt)(),t=(0,O.ID)(),n=(0,G.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,dc.kf)();(0,y.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Gi.TM)(e,t,n),onReceive:e=>{let{data:t}=e;return r(pc(pc({},cc.ul),{},{loaded:!0},t))},onFail:e=>r(pc(pc({},cc.ul),{},{loaded:!0,error:e})),pollingOptions:{pollingInterval:588e3}})),[e,t])};function gc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gc(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const xc=()=>{const e=(0,v.vt)(),t=(0,O.ID)(),n=(0,G.w7)({extraKey:"home",merge:!1,scoped:!0}),r=(0,dc.xs)();(0,y.A)((()=>({enabled:!(!e||!t),force:!0,fetch:()=>(0,Gi.jt)(e,t,n),onReceive:e=>{let{data:t}=e;return r(fc(fc({},cc.ve),{},{loaded:!0},t))},onFail:e=>r(fc(fc({},cc.ve),{},{loaded:!0,error:e})),pollingOptions:{pollingInterval:588e3}})),[e,t,n])};var mc=n(74290),bc=(n(89463),n(56473)),jc=n(56523),yc=n(24285),vc=n(76571),Oc=n(97926),wc=n(17115),Cc=n(31246);function Pc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ic(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pc(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Ac=()=>{const{milestones:e,settingsLoaded:t}=(0,jc.A)(),{completed:n}=e,o=(0,Oc.A)(),i=(0,wc.Ay)(),s=(0,f.Sk)(),a=(0,wc.Ex)(),l=(0,yc.xd)("isLoaded"),c=(0,yc.xd)("onboardingFormData"),d=(0,v.vt)(),u=(0,v.ap)("loaded"),p=(0,vc.t5)(d,"channels"),h=(0,vc.t5)(d,"loaded"),g=Array.isArray(p)?p.length:0;return(0,r.useMemo)((()=>{if(!t||!h||!u||!l||!o)return[];const e=!(null===c||void 0===c||!c.usageType);return Object.entries(o).filter((e=>{let[,t]=e;return t})).map((e=>{let[t]=e;return t})).filter((e=>{var t,r;return(null===(t=n[e])||void 0===t?void 0:t.completedAt)&&!(null!==(r=n[e])&&void 0!==r&&r.seenAt)})).flatMap((e=>(Cc.a7[e]||[]).map((t=>Ic(Ic({},t),{},{milestoneId:e}))))).filter((t=>{var r;return!(null===(r=n[t.milestoneId])||void 0===r||null===(r=r.tasks)||void 0===r?void 0:r[t.id])&&(e?!!t.segments.includes(i)&&(!(t.permission&&!s[t.permission])&&(!(t.requiresLargeTeam&&!a)&&!(void 0!==t.maxChannels&&g>t.maxChannels))):t.isFeatureAnnouncement)})).slice(0,3).map((e=>e.channelAwareContent&&g>0?Ic(Ic({},e),{},{title:e.channelAwareContent.title,description:e.channelAwareContent.description}):e))}),[n,o,i,s,a,g,t,h,u,l,c])};var kc=n(81187),Sc=n(4703);const Dc=e=>{let{description:t}=e;const n=(0,bc.PP)({extraKey:"runningAlerts"});return"".concat(n.length," ").concat(t)},Mc=e=>{let{onDismiss:t}=e;const{dismissOnboarding:n,resetOnboarding:o,markTaskCompleted:i}=(0,jc.A)(),s=Ac(),a=(0,kc.A)(),l=(0,r.useCallback)((e=>i(e.milestoneId,e.id)),[i]),c=(0,r.useCallback)((()=>{n(),null===t||void 0===t||t()}),[n,t]);return s.length?(0,pe.jsx)(ce.Flex,{column:!0,gap:4,children:(0,pe.jsxs)(ce.Flex,{column:!0,gap:4,background:"panelBg",border:!0,round:2,padding:[6],position:"relative",children:[(0,pe.jsx)(ce.IconButton,{icon:"x",neutral:!0,onClick:c,position:"absolute",top:"8px",right:"8px"}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsxs)(ce.Flex,{gap:2,alignItems:"center",children:[(0,pe.jsx)(ce.Icon,{name:"checkmark_partial_s",color:"success"}),(0,pe.jsx)(ce.Text,{strong:!0,children:"Continue your journey"})]}),(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:"Here's what you can explore next"})]}),(0,pe.jsx)(ce.Flex,{column:!0,gap:2,children:s.map((e=>(0,pe.jsx)(Sc.A,{task:e,onClick:()=>a(e),onSkip:()=>l(e),children:e.dynamicDescription?(0,pe.jsx)(r.Suspense,{fallback:e.description,children:(0,pe.jsx)(Dc,{description:e.description})}):e.description},"".concat(e.milestoneId,"-").concat(e.id))))}),!1]})}):null};var Tc=n(56171);const Nc=[{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"}],Fc=e=>{let{item:t,onNavigate:n}=e;return(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:2,width:"100%",children:[(0,pe.jsx)(ce.Icon,{name:t.icon,color:"main"}),(0,pe.jsxs)(ce.Text,{color:"main",children:[t.text," ",(0,pe.jsx)(je.A,{color:"main",onClick:n,style:{textDecoration:"underline"},children:t.linkText})]})]})},Ec=()=>{const e=(0,j.Zp)(),t=(0,v.bq)(),n=(0,O.QW)(),{dismissedBanners:o,dismissBanner:i}=(0,jc.A)(),s=(0,r.useMemo)((()=>Nc.find((e=>!o[e.id]))),[o]),a=(0,r.useCallback)((()=>{s&&i(s.id)}),[s,i]),l=(0,r.useCallback)((()=>{null!==s&&void 0!==s&&s.route&&e("/spaces/".concat(t,"/rooms/").concat(n,"/").concat(s.route))}),[e,t,n,s]);return s?(0,pe.jsx)(Tc.A,{background:s.background,onClose:a,children:(0,pe.jsx)(Fc,{item:s,onNavigate:l})}):null};var Lc=n(58618),Rc=n(42964),Bc=n(82507);const Vc={Live:"live",Stale:"stale",Offline:"offline",Unseen:"unseen"},Hc=(0,vr.default)(ce.Flex).withConfig({displayName:"nodeHero__Container",componentId:"sc-t1z79b-0"})(["position:relative;width:320px;height:320px;"]),_c=(0,vr.default)(ce.Flex).withConfig({displayName:"nodeHero__ContentContainer",componentId:"sc-t1z79b-1"})(["position:absolute;inset:0;z-index:2;"]),zc=e=>{let{nodeId:t}=e;const n=(0,j.Zp)(),r=(0,K.xY)(t),{loaded:o,metricsCollected:i=0}=(0,dc.P9)(),s=(0,v.bq)(),a=(0,O.QW)(),l=(0,Tt.GM)(r.state),c=Vc[l]||"offline";return(0,pe.jsxs)(Hc,{children:[(0,pe.jsx)(Rc.A,{withOuties:!1}),(0,pe.jsx)(Bc.A,{withOuties:!1}),(0,pe.jsxs)(_c,{column:!0,justifyContent:"center",alignItems:"center",gap:3,children:[(0,pe.jsx)(ce.TextBig,{color:"primary",children:r.nm}),(0,pe.jsxs)(ce.Flex,{gap:1,alignItems:"center",children:[(0,pe.jsx)(ce.Box,{width:"8px",height:"8px",round:"50%",background:c}),(0,pe.jsx)(ce.TextBig,{color:c,children:l})]})]}),(0,pe.jsxs)(ce.Flex,{column:!0,alignItems:"center",gap:2,position:"absolute",width:"100%",style:{bottom:"-60px"},children:[(0,pe.jsxs)(ce.TextBig,{children:[o?(0,Lc.$t)(i):"..."," metrics collected"]}),(0,pe.jsx)(ce.Button,{label:"View your metrics",icon:(0,pe.jsx)(ce.Icon,{name:"arrow_right"}),iconSide:"right",onClick:()=>{n("/spaces/".concat(s,"/rooms/").concat(a,"/overview"))}})]})]})},Kc=["title","icon","iconColor"],Gc=["titleProps","loading","error","children"];function Wc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Uc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wc(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const qc=(0,Rn.A)(ce.Icon),Jc=e=>{let{title:t,icon:n,iconColor:r}=e,o=(0,W.A)(e,Kc);return(0,pe.jsxs)(ce.Flex,Uc(Uc({alignItems:"center",gap:2},o),{},{children:[n&&(0,pe.jsx)(ce.Icon,Uc({name:n},r?{color:r}:{})),(0,pe.jsx)(ce.TextBig,{children:t})]}))},$c={ErrNoEligibleNodeRequested:"There are no eligible nodes.",default:"Something went wrong."},Yc=e=>{let{titleProps:t,loading:n,error:r,children:o}=e,i=(0,W.A)(e,Gc);const s=Uc({padding:[4],gap:4,background:"panelBg"},t?{column:!0}:{}),a=r?$c[r.errorMsgKey]||$c.default:null;return(0,pe.jsxs)(ce.Flex,Uc(Uc(Uc({},s),i),{},{children:[t?(0,pe.jsx)(Jc,Uc({},t)):null,n?(0,pe.jsx)(ce.Text,{textAlign:"center",children:"Loading..."}):r?null:(0,pe.jsx)(pe.Fragment,{children:o}),a?(0,pe.jsx)(ce.Flex,{width:"100%",justifyContent:"center",children:(0,pe.jsx)(qc,{name:"warning_triangle",size:"large",color:"text",tooltip:a})}):null]}))},Zc=e=>{let{title:t,value:n,loading:r}=e;return(0,pe.jsxs)(Yc,{column:!0,alignItems:"center",justifyContent:"center",gap:2,padding:[4],width:"180px",children:[(0,pe.jsx)(ce.TextSmall,{color:"textLite",children:t}),(0,pe.jsx)(ce.TextHuge,{strong:!0,children:r?"...":(0,Lc.$t)(n)})]})},Xc=()=>{const e=(0,O.ID)(),t=(0,Fe._0)(e),n=(0,Fe.R7)(e),r=Object.keys(n||{}).length;return(0,pe.jsx)(Zc,{title:"Charts Visualised",value:r,loading:!t})},Qc=()=>(0,pe.jsx)(ce.Flex,{column:!0,gap:4,children:(0,pe.jsx)(Xc,{})}),ed=()=>{const e=(0,bc.PP)({extraKey:"runningAlerts"});return(0,pe.jsx)(Zc,{title:"Running Alerts",value:e.length,loading:!1})},td=()=>(0,pe.jsx)(ce.Flex,{column:!0,gap:4,children:(0,pe.jsx)(r.Suspense,{fallback:(0,pe.jsx)(Zc,{title:"Running Alerts",value:"...",loading:!0}),children:(0,pe.jsx)(ed,{})})}),nd=e=>{let{position:t}=e;return"left"===t?(0,pe.jsx)(Qc,{}):(0,pe.jsx)(td,{})},rd=()=>((0,sc.A)(),(0,ac.A)(),(0,lc.A)(),hc(),xc(),(0,mc.A)(),null),od=e=>{let{nodeId:t}=e;return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(rd,{}),(0,pe.jsx)(Ec,{}),(0,pe.jsxs)(_.A,{gap:4,padding:[4],overflow:"auto",children:[(0,pe.jsxs)(ce.Flex,{gap:4,justifyContent:"center",alignItems:"center",children:[(0,pe.jsx)(nd,{position:"left"}),(0,pe.jsx)(zc,{nodeId:t}),(0,pe.jsx)(nd,{position:"right"})]}),i.OH&&(0,pe.jsx)(Mc,{})]})]})};var id=n(78953),sd=n(29243);const ad=["nodesLoaded","total","count","live","offline","stale","unseen"];function ld(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ld(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ld(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const dd=(0,sd.A)((e=>{let{nodesLoaded:t,total:n,count:o,live:i,offline:s,stale:a,unseen:l}=e,c=(0,W.A)(e,ad);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,pe.jsxs)(ce.Flex,{width:"100%",column:!0,alignItems:"center",gap:4,children:[(0,pe.jsxs)(ce.Flex,{gap:2,alignItems:"baseline",children:[t?(0,pe.jsx)(ce.TextHuge,cd(cd({strong:!0},c),{},{children:o})):(0,pe.jsx)(ce.Text,{children:"Loading..."}),t&&n!==o&&(0,pe.jsxs)(ce.Text,{children:["of ",n]})]}),(0,pe.jsx)(id.A,{data:d,numberIndicatorProps:{TitleComponent:ce.TextBig,NumberComponent:ce.TextBigger}})]})})),ud=e=>{const t=(0,R.nj)(),n=(0,R.CK)(),o=n.length,i=(0,G.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=(null===i||void 0===i?void 0:i.length)||"-";return cd({nodesLoaded:t,total:o,count:e,title:t&&i&&o!==e?"Selected nodes":"Total nodes"},s)}),[t,n,i,o,s]);return(0,pe.jsx)(dd,cd(cd({},a),e))};var pd=n(50916),hd=n.n(pd);function gd(e){return e*Math.PI/180}function fd(e,t,n){return e>n?n:e<t?t:e}function xd(e,t){return t/100*e}function md(e,t){return e+t/2}function bd(e,t){const n=gd(e);return{dx:t*Math.cos(n),dy:t*Math.sin(n)}}function jd(e){return"number"===typeof e}function yd(e,t){return"function"===typeof e?e(t):e}function vd({renderLabel:e,labelProps:t}){const n=e(t);if("string"===typeof n||"number"===typeof n){const{dataEntry:e,dataIndex:o,...i}=t;return r.createElement("text",{dominantBaseline:"central",...i},n)}return r.isValidElement(n)?n:null}function Od({labelPosition:e,lineWidth:t,labelHorizontalShift:n}){const r=function(e){const t=1e14;return Math.round((e+Number.EPSILON)*t)/t}(n);if(0===r)return"middle";if(e>100)return r>0?"start":"end";return e<100-t?r>0?"end":"start":"middle"}function wd(e,t){const{label:n}=t;if(n)return function(e,t){return e.map(((e,n)=>{const r=yd(t.segmentsShift,n)??0,o=xd(t.radius,t.labelPosition)+r,{dx:i,dy:s}=bd(md(e.startAngle,e.degrees),o);return{x:t.center[0],y:t.center[1],dx:i,dy:s,textAnchor:Od({labelPosition:t.labelPosition,lineWidth:t.lineWidth,labelHorizontalShift:i}),dataEntry:e,dataIndex:n,style:yd(t.labelStyle,n)}}))}(e,t).map(((e,t)=>r.createElement(vd,{key:`label-${e.dataEntry.key||t}`,renderLabel:n,labelProps:e})))}function Cd({cx:e,cy:t,lengthAngle:n,lineWidth:o,radius:i,shift:s=0,reveal:a,rounded:l,startAngle:c,title:d,...u}){const p=i-o/2,{dx:h,dy:g}=bd(md(c,n),s),f=function(e,t,n,r,o){const i=fd(r,-359.999,359.999);return hd()(e,t,o,gd(n),gd(n+i)).map((e=>e.join(" "))).join(" ")}(e+h,t+g,c,n,p);let x,m;if(jd(a)){const e=gd(p)*n;x=Math.abs(e),m=x-xd(x,a)}return r.createElement("path",{d:f,fill:"none",strokeWidth:o,strokeDasharray:x,strokeDashoffset:m,strokeLinecap:l?"round":void 0,...u},d&&r.createElement("title",null,d))}function Pd(e,t,n){let r=`stroke-dashoffset ${e}ms ${t}`;return n&&n.transition&&(r=`${r},${n.transition}`),{transition:r}}function Id(e,t){return e&&(n=>{e(n,t)})}function Ad(e,t,n){const o=n??function({reveal:e,animate:t}){return t&&!jd(e)?100:e}(t),{radius:i,center:[s,a]}=t,l=xd(i,t.lineWidth),c=e.map(((e,n)=>{const c=yd(t.segmentsStyle,n);return r.createElement(Cd,{cx:s,cy:a,key:e.key||n,lengthAngle:e.degrees,lineWidth:l,radius:i,rounded:t.rounded,reveal:o,shift:yd(t.segmentsShift,n),startAngle:e.startAngle,title:e.title,style:Object.assign({},c,t.animate&&Pd(t.animationDuration,t.animationEasing,c)),stroke:e.color,tabIndex:t.segmentsTabIndex,onBlur:Id(t.onBlur,n),onClick:Id(t.onClick,n),onFocus:Id(t.onFocus,n),onKeyDown:Id(t.onKeyDown,n),onMouseOver:Id(t.onMouseOver,n),onMouseOut:Id(t.onMouseOut,n)})}));return t.background&&c.unshift(r.createElement(Cd,{cx:s,cy:a,key:"bg",lengthAngle:t.lengthAngle,lineWidth:l,radius:i,rounded:t.rounded,startAngle:t.startAngle,stroke:t.background})),c}const kd={animationDuration:500,animationEasing:"ease-out",center:[50,50],data:[],labelPosition:50,lengthAngle:360,lineWidth:100,paddingAngle:0,radius:50,startAngle:0,viewBoxSize:[100,100]};function Sd(e){const t=function(e){const t=Object.assign({},kd,e);let n;for(n in kd)void 0===e[n]&&(t[n]=kd[n]);return t}(e),[n,o]=(0,r.useState)(t.animate?0:null);(0,r.useEffect)((()=>{t.animate&&o(null)}),[]);const i=function({data:e,lengthAngle:t,totalValue:n,paddingAngle:r,startAngle:o}){const i=n||function(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].value;return t}(e),s=fd(t,-360,360),a=360===Math.abs(s)?e.length:e.length-1,l=Math.abs(r)*Math.sign(t),c=s-l*a;let d=0;const u=[];for(let p=0;p<e.length;p++){const t=e[p],n=0===i?0:t.value/i*100,r=xd(c,n),s=d+o;d=d+r+l,u.push(Object.assign({percentage:n,startAngle:s,degrees:r},t))}return u}(t);return r.createElement("svg",{viewBox:`0 0 ${t.viewBoxSize[0]} ${t.viewBoxSize[1]}`,width:"100%",height:"100%",className:t.className,style:t.style},Ad(i,t,n),wd(i,t),t.children)}const Dd=(0,vr.default)(ce.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"})),Md=(0,r.memo)((e=>{let{title:t,value:n,color:r,onClick:o=null}=e;return(0,pe.jsxs)(ce.Flex,{alignItems:"center",justifyContent:"between",width:"100%",gap:4,flex:{grow:1,shrink:0},children:[(0,pe.jsxs)(ce.Flex,{gap:1,children:[(0,pe.jsx)(ce.Flex,{width:"4px",height:"16px",background:r}),(0,pe.jsxs)(Dd,{whiteSpace:"nowrap",onClick:o,children:[t,o&&(0,pe.jsx)(ce.Icon,{color:"textLite",margin:[0,0,0,1],name:"nav_arrow_goto",height:"10px",width:"10px"})]})]}),(0,pe.jsx)(ce.Text,{strong:!0,children:null!==n&&void 0!==n?n:"-"})]})})),Td=e=>{let{data:t}=e;return(0,pe.jsx)(ce.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,pe.jsx)(Md,{title:n,value:r,color:o,onClick:i},"".concat(n,"-").concat(r,"-").concat(t))}))})};function Nd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nd(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Ed=e=>{let{data:t,theme:n}=e;return t.map((e=>Fd(Fd({},e),{},{color:(0,ce.getColor)(e.color)({theme:n})})))},Ld=e=>{let{chartData:t=[],lineWidth:n=15,animate:o=!0,label:i,hasData:s}=e;const a=(0,r.useContext)(vr.ThemeContext);return(0,pe.jsxs)(ce.Flex,{gap:4,margin:[0,4],height:{min:"70px",max:"130px"},alignItems:"center",children:[(0,pe.jsx)(ce.Flex,{height:"70px",flex:{grow:1,shrink:1},children:s?(0,pe.jsx)(Sd,{label:()=>i,labelStyle:{fontSize:"34px",fontWeight:700,lineHeight:"38px",fill:(0,ce.getColor)("textDescription")({theme:a})},labelPosition:0,data:Ed({data:t,theme:a}),lineWidth:n,animate:o}):(0,pe.jsx)(ce.Icon,{color:"border",name:"pie_chart_skeleton",width:"70px",height:"70px",alignSelf:"center"})}),(0,pe.jsx)(Td,{data:t})]})};function Rd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rd(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Vd=(0,sd.A)((e=>(0,pe.jsx)(ce.Flex,{gap:2,justifyContent:"between",padding:[2,0,0,0],children:(0,pe.jsx)(Ld,Bd({},e))}))),Hd=e=>{const t=(0,bc.QD)({extraKey:"alerts"}),{critical:n,warning:o}=(t||[]).reduce(((e,t)=>{let{status:n}=t;return Bd(Bd({},e),{},{[n]:e[n]+1})}),{critical:0,warning:0}),i=(0,sl.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:!(null===t||void 0===t||!t.length),label:null===t||void 0===t?void 0:t.length})),[n,o,i]);return(0,pe.jsx)(Vd,Bd(Bd({title:"Active alerts"},s),e))},_d=()=>(0,pe.jsxs)(ce.Flex,{"data-testid":"home-nodes-overview-left-section",column:!0,gap:4,basis:"205px",children:[(0,pe.jsx)(ud,{}),(0,pe.jsx)(Bi.A,{}),(0,pe.jsx)(Hd,{})]});var zd=n(63950),Kd=n.n(zd),Gd=n(31522),Wd=n(41395);const Ud=e=>{let{label:t,color:n}=e;return(0,pe.jsxs)(ce.Flex,{height:"24px",gap:1,alignItems:"center",children:[(0,pe.jsx)(ce.Flex,{width:"12px",height:"12px",background:n}),(0,pe.jsx)(ce.Text,{children:(0,Wd.Zr)(t)})]})},qd=e=>{let{colorBy:t}=e;const n=Object.entries(Gd.Cc[null===t||void 0===t?void 0:t.value]||{}),r=Gd.Ug[null===t||void 0===t?void 0:t.value]||{};return n.length?(0,pe.jsx)(ce.Flex,{"data-testid":"home-nodes-overview-main-section-header-colors-legend",gap:2,children:n.map((e=>{let[t,n]=e;return(0,pe.jsx)(Ud,{label:r[t]||t,color:n},t)}))}):null};var Jd=n(64483);function $d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$d(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Zd=(0,Rn.A)(ce.Icon),Xd=e=>{let{nodes:t=[],groupBy:n,setGroupBy:o=Kd(),colorBy:i,setColorBy:s=Kd(),onAddNode:a}=e;const l=(0,r.useMemo)((()=>(0,Jd.zm)(t)),[t]),c=(0,r.useMemo)((()=>(0,Jd.Sd)(l).sort(((e,t)=>e.value.localeCompare(t.value,void 0,{sensitivity:"accent",ignorePunctuation:!0})))),[l]),d=(0,r.useMemo)((()=>[...Gd.XJ,...c]),[c]);return(0,pe.jsxs)(ce.Flex,{"data-testid":"home-nodes-overview-main-section-header",alignItems:"end",justifyContent:"between",children:[(0,pe.jsxs)(ce.Flex,{gap:3,alignItems:"end",children:[(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsxs)(ce.Flex,{alignItems:"center",gap:1,children:[(0,pe.jsx)(ce.Text,{color:"menuItem",children:"Group by"}),(0,pe.jsx)(Zd,{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,pe.jsx)(ce.Select,Yd({isMulti:!0,options:d,value:n,onChange:o},(null===c||void 0===c?void 0:c.length)>0?{styles:{minWidth:"250px"}}:{}))]}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,children:[(0,pe.jsx)(ce.Text,{color:"menuItem",children:"Color by"}),(0,pe.jsx)(ce.Select,{options:Gd.Hn,value:i,onChange:s})]}),(0,pe.jsx)(qd,{colorBy:i})]}),(0,pe.jsx)(Pe.A,{flavour:"borderless",icon:"add_node",iconColor:"text",onClick:a})]})};var Qd=n(21421);const eu=()=>(0,pe.jsxs)(ce.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,pe.jsxs)(ce.Flex,{gap:2,children:[(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2})]}),(0,pe.jsxs)(ce.Flex,{gap:2,children:[(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2}),(0,pe.jsx)(Or.A,{width:"22px",height:"22px",round:2})]})]}),tu=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)(Gd.jZ),[i,s]=(0,r.useState)(),a=(0,O.ID)(),l=(0,R.gr)(a,"loaded"),c=(0,G.eO)({keepAll:!1}),d=(0,r.useCallback)((e=>{s(e)}),[s]),u=(0,r.useCallback)((()=>s()),[s]);return(0,pe.jsxs)(ce.Flex,{"data-testid":"home-nodes-overview-main-section",column:!0,gap:4,basis:"calc(100% - 410px)",children:[(0,pe.jsx)(Xd,{nodes:c,groupBy:e,setGroupBy:t,colorBy:n,setColorBy:o,onAddNode:d}),(0,pe.jsx)(ce.Flex,{height:{max:150},overflow:{vertical:"auto"},children:l?(0,pe.jsx)(Qd.A,{nodes:c,groupBy:e,colorBy:n,onAddNode:d}):(0,pe.jsx)(eu,{})}),i&&(0,pe.jsx)(Ie.A,{nodeType:null===i||void 0===i?void 0:i.type,onClose:u})]})},nu=()=>(0,pe.jsxs)(ce.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,pe.jsxs)(ce.Flex,{justifyContent:"between",children:[(0,pe.jsx)(Or.A,{width:"30%"}),(0,pe.jsx)(Or.A,{width:"30%"}),(0,pe.jsx)(Or.A,{width:"30%"})]}),(0,pe.jsxs)(ce.Flex,{justifyContent:"between",children:[(0,pe.jsx)(Or.A,{width:"30%"}),(0,pe.jsx)(Or.A,{width:"30%"}),(0,pe.jsx)(Or.A,{width:"30%"})]}),(0,pe.jsx)(Or.A,{})]}),ru=()=>{const{loaded:e,totalChildren:t,totalParents:n,totalStandalone:o}=(0,dc.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,pe.jsx)(id.A,{numberIndicatorProps:{TitleComponent:ce.Text},data:i}):(0,pe.jsx)(nu,{height:"58px"})},ou=()=>(0,pe.jsxs)(ce.Flex,{width:"100%",column:!0,gap:2,padding:[2,0],children:[(0,pe.jsxs)(ce.Flex,{justifyContent:"between",children:[(0,pe.jsx)(Or.A,{width:"30%"}),(0,pe.jsx)(Or.A,{width:"30%"}),(0,pe.jsx)(Or.A,{width:"30%"})]}),(0,pe.jsxs)(ce.Flex,{justifyContent:"between",children:[(0,pe.jsx)(Or.A,{width:"30%"}),(0,pe.jsx)(Or.A,{width:"30%"}),(0,pe.jsx)(Or.A,{width:"30%"})]}),(0,pe.jsx)(Or.A,{})]}),iu=()=>(0,pe.jsxs)(ce.Flex,{column:!0,gap:1,alignItems:"center",width:"220px","data-testid":"nodesByDataReplication-information-text",overflow:"hidden",children:[(0,pe.jsxs)(ce.TextMicro,{children:[(0,pe.jsx)(ce.TextMicro,{strong:!0,children:"None:"})," The node's data are only on the node itself. Lose the node, lose the data!"]}),(0,pe.jsxs)(ce.TextMicro,{children:[(0,pe.jsx)(ce.TextMicro,{strong:!0,children:"Single:"})," The node's metrics are replicated to one parent. The parent can trigger alerts for the child."]}),(0,pe.jsxs)(ce.TextMicro,{children:[(0,pe.jsx)(ce.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,pe.jsx)(ce.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."})]}),su=()=>(0,pe.jsx)(tt.A,{isBasic:!0,plain:!0,content:iu,align:"bottom",children:(0,pe.jsx)(ce.Icon,{name:"information",color:"textDescription",size:"small"})}),au=(0,sd.A)((()=>{const e=(0,dc.c8)(),{loaded:t,replicationFactor:n}=e||{},o=(0,r.useMemo)((()=>[{label:"None",value:(null===n||void 0===n?void 0:n.r_1)||0,color:Gd.q5.r_1},{label:"Single",value:(null===n||void 0===n?void 0:n.r_2)||0,color:Gd.q5.r_2},{label:"Multi",value:(null===n||void 0===n?void 0:n["r_*"])||0,color:Gd.q5["r_*"]}]),[n]);return t?(0,pe.jsx)(id.A,{data:o}):(0,pe.jsx)(ou,{})})),lu=()=>(0,pe.jsx)(au,{title:"Data Replication",headerInfo:(0,pe.jsx)(su,{})}),cu=()=>(0,pe.jsxs)(ce.Flex,{"data-testid":"home-nodes-overview-right-section",column:!0,gap:4,basis:"205px",children:[(0,pe.jsx)(ru,{}),(0,pe.jsx)(Bi.A,{}),(0,pe.jsx)(lu,{})]}),du=()=>(0,pe.jsxs)(Yc,{children:[(0,pe.jsx)(_d,{}),(0,pe.jsx)(Bi.A,{vertical:!0}),(0,pe.jsx)(tu,{}),(0,pe.jsx)(Bi.A,{vertical:!0}),(0,pe.jsx)(cu,{})]});var uu=n(45614),pu=n(29474),hu=n(54248);function gu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gu(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const xu={title:"Nodes with the most alerts in the last 24h"},mu=e=>{const t=(0,dc.jg)();return t.loaded?(0,pe.jsxs)(Yc,fu(fu({"data-testid":"home-alert-nodes",titleProps:xu},e),{},{children:[(0,pe.jsx)(uu.A,{alertsStats:t}),(0,pe.jsx)(pu.A,{alertsStats:t}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:4,children:[(0,pe.jsx)(ce.TextBig,{children:"Top alerts in the last 24 h"}),(0,pe.jsx)(hu.A,{data:null===t||void 0===t?void 0:t.alerts})]})]})):(0,pe.jsx)(u.nl,{})};function bu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ju(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bu(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const yu={title:"Metrics available",justifyContent:"center"},vu=e=>{var t;const{loaded:n,metricsCollected:r=0,error:o}=(0,dc.P9)();return n?(0,pe.jsx)(Yc,ju(ju({"data-testid":"home-metrics",titleProps:yu,error:null===o||void 0===o||null===(t=o.response)||void 0===t?void 0:t.data},e),{},{children:(0,pe.jsx)(ce.Flex,{width:"100%",justifyContent:"center",children:(0,pe.jsx)(ce.TextHuge,{strong:!0,children:(0,Lc.$t)(r)})})})):(0,pe.jsx)(u.Tr,ju({title:"Metrics available"},e))};function Ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ou(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Cu={title:"Charts visualized",justifyContent:"center"},Pu=e=>{const t=(0,O.ID)(),n=(0,Fe._0)(t),r=(0,Fe.rx)(t),o=(0,Fe.R7)(t),i=Object.keys(o||{}).length;return n||r?(0,pe.jsx)(Yc,wu(wu({"data-testid":"home-charts-data",titleProps:Cu,error:r},e),{},{children:(0,pe.jsx)(ce.Flex,{width:"100%",justifyContent:"center",children:(0,pe.jsx)(ce.TextHuge,{strong:!0,children:(0,Lc.$t)(i)})})})):(0,pe.jsx)(u.Tr,wu({},e))};function Iu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Au(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Iu(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ku={title:"Alerts configured",justifyContent:"center"},Su=e=>{const{loaded:t,value:n}=(0,Ar.oU)();return t?(0,pe.jsx)(Yc,Au(Au({"data-testid":"home-alerts-data",titleProps:ku},e),{},{children:(0,pe.jsx)(ce.Flex,{width:"100%",justifyContent:"center",children:(0,pe.jsx)(ce.TextHuge,{strong:!0,children:(0,Lc.$t)((null===n||void 0===n?void 0:n.length)||0)})})})):(0,pe.jsx)(u.Tr,Au({},e))};var Du=n(46025);function Mu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mu(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Nu={title:"Data retention per Nodes"},Fu=e=>{const{dataRetention:t}=(0,dc.P9)();return(0,pe.jsx)(Yc,Tu(Tu({"data-testid":"home-data-retention",titleProps:Nu},e),{},{children:(0,pe.jsx)(Du.A,{dataRetention:t})}))},Eu=()=>((0,sc.A)(),(0,ac.A)(),(0,lc.A)(),hc(),xc(),(0,mc.A)(),null),Lu=new Date("2025-12-01").getTime(),Ru=()=>{const e=(0,R.CK)(),t=(0,R.nj)(),n=(0,v.ap)("createdAt");if(!t)return(0,pe.jsx)(u.WV,{});if(!e.length)return(0,pe.jsx)(V.Ay,{feature:"Home",mode:"NoNodesView",children:(0,pe.jsx)(B.A,{})});const r=new Date(n).getTime()>Lu;return i.OH&&1===e.length&&r?(0,pe.jsx)(V.Ay,{feature:"Home",mode:"SingleNodeHome",children:(0,pe.jsx)(od,{nodeId:e[0]})}):(0,pe.jsxs)(V.Ay,{feature:"Home",children:[(0,pe.jsx)(Eu,{}),(0,pe.jsxs)(_.A,{gap:4,padding:[4],overflow:"auto",children:[i.OH&&(0,pe.jsx)(Mc,{}),(0,pe.jsx)(du,{}),(0,pe.jsxs)(ce.Flex,{gap:4,children:[(0,pe.jsx)(mu,{width:"60%"}),(0,pe.jsxs)(ce.Flex,{column:!0,gap:4,height:"100%",width:"calc(40% - 16px)",children:[(0,pe.jsxs)(ce.Flex,{gap:4,children:[(0,pe.jsx)(vu,{flex:{grow:"1",shrink:"0"}}),(0,pe.jsx)(Pu,{flex:{grow:"1",shrink:"0"}}),(0,pe.jsx)(Su,{flex:{grow:"1",shrink:"0"}})]}),(0,pe.jsx)(Fu,{flex:"grow"})]})]})]})]})};var Bu=n(7234),Vu=n(89711);var Hu=n(84060),_u=n(31035),zu=n(1705),Ku=n(2863),Gu=n(49916);var Wu=n(14457),Uu=n(93933),qu=n(15524);const Ju=vr.default.div.withConfig({displayName:"styled__Separator",componentId:"sc-1fhfk7c-0"})(["background:",";height:20px;width:1px;"],(0,ce.getColor)("border")),$u=["flavour"];function Yu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yu(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Xu=e=>{var t,n;let{flavour:o}=e,i=(0,W.A)(e,$u);const s=(0,K.nl)(),a=(0,kr.Xt)(s),{critical:l,warning:c}=(0,Ar.AO)(a),d=(0,q.Fw)("sidebarTab",{flavour:"val",extraKey:o}),u=(0,q.Fw)("sidebarOpen",{flavour:"bool"}),p=(0,r.useCallback)((e=>{u(!0),d(e)}),[u,d]),{id:h,hw:g={},cpus:f,isLive:x,name:m,os:b={},state:j,updateSeverity:y,labels:v,version:O,health:w,capabilities:C}=(0,K.xY)(s),{silencingState:P}=(null===w||void 0===w?void 0:w.alerts)||{},I={dataTestId:"singleNode",isLive:x},A=(0,Tt.t3)(Zu({count:l,type:"critical"},I)),k=(0,Tt.t3)(Zu({count:c,type:"warning"},I)),S=(0,Tt.GM)(j),D=(0,Tt.Pg)(g.container,g.virtualization),M=(0,Ys.A)("(min-width: 1760px)"),T=(0,K.TC)();return(0,pe.jsxs)(ce.Flex,Zu(Zu({alignItems:"center",background:"panelBg",border:{side:"all",color:"border"},"data-testid":"singleNode-badges-container",flex:!1,gap:1,padding:[1,2],round:1},i),{},{children:[(0,pe.jsx)(ce.TextSmall,{"data-testid":"singleNode-".concat(m),strong:!0,children:m}),(0,pe.jsx)(Jt.A,{badge:"info","data-testid":"singleNode-nodeInfo-cta",children:(0,pe.jsx)(ce.IconButton,{flavour:"borderless",cursor:"pointer",onClick:()=>{T(h),p("info")},icon:"information",iconColor:"nodeBadgeColor",width:"18px",height:"18px"})}),(0,pe.jsx)(Ju,{"data-testid":"singleNode-separator"}),(0,pe.jsx)(Jt.A,{badge:"alerts",nodeName:m,children:(0,pe.jsx)(ce.AlertMasterCard,{onClick:A.text||k.text?()=>T(h,{},"/alerts"):null,pillLeft:A,pillRight:k})}),(0,pe.jsx)(Ju,{"data-testid":"singleNode-separator"}),(0,pe.jsx)(sr,{node:{id:h,name:m,isLive:x,capabilities:C},padding:[0,1]}),y&&(0,pe.jsx)(Hn.A,{"data-testid":"singleNode-update-cta",name:m,os:b.id,container:g.container,warningLevel:y,labels:v,version:O,text:y}),(0,pe.jsx)(Ju,{"data-testid":"singleNode-separator"}),(0,pe.jsx)(Jt.A,{badge:"connectivity",connectivityState:S,"data-testid":"singleNode-connectivityStateInfo",nodeName:m,children:(0,pe.jsx)(ce.Pill,{flavour:"neutral",hollow:!0,children:S})}),(0,pe.jsx)(Jt.A,{badge:"type","data-testid":"singleNode-nodeTypeInfo",nodeName:m,nodeType:D.label,children:(0,pe.jsx)(ce.Pill,{flavour:"neutral",hollow:!0,icon:D.icon,children:D.label})}),M&&(0,pe.jsx)(Jt.A,{badge:"systemInfo","data-testid":"singleNode-systemInfo",nodeName:m,children:(0,pe.jsxs)(ce.Pill,{flavour:"neutral",hollow:!0,icon:(null===(t=wt.u[b.nm])||void 0===t?void 0:t.iconName)||(null===(n=wt.U[b.id])||void 0===n?void 0:n.iconName)||"os",children:[(0,Tt.O)(g.cpuFrequency)," (",f," ",1===g.cpus?"Core":"Cores",") -"," ",(0,Tt.RI)(g.memory)," RAM - ",(0,Tt.RI)(g.diskSpace)]})}),(0,pe.jsx)(En.A,{flavour:"node",silencing:P})]}))},Qu=()=>{const e=(0,K.aH)(),t=(e=>(0,r.useMemo)((()=>({overview:{id:"overview",title:"Metrics",icon:"room_overview",path:"".concat(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:"Live",icon:"live",path:"".concat(e,"/top"),dataGa:"view-picker::click-view-fn::global-overview",testId:"viewPicker-singleNode-fn",tooltip:{title:"Node Live View",description:"Live, on-demand insights including processes, network connections, database queries, topology maps & more"}},logs:{id:"logs",title:"Logs",icon:"logs",path:"".concat(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:"".concat(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:"".concat(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:"".concat(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 ep=n(10444);const tp=["notificationBg"];function np(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?np(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):np(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const op=(0,vr.default)(ce.Box).attrs((e=>rp({width:"6px",height:"6px",round:"50%"},e))).withConfig({displayName:"withNotification__NotificationDot",componentId:"sc-ka7a4g-0"})([""]),ip=e=>t=>{let{notificationBg:n}=t,r=(0,W.A)(t,tp);return n?(0,pe.jsxs)(ce.Flex,{position:"relative",gap:1,padding:[0,0,0,1.5],children:[(0,pe.jsx)(op,{background:n,position:"absolute",top:-2,left:0}),(0,pe.jsx)(e,rp({},r))]}):(0,pe.jsx)(e,rp({},r))};var sp=n(9509);const ap=["id","to","params","exact","icon","iconColor","title","fixed","dataGa","testId","children","type","tooltip","showBorderLeft","droppable","droppableProps","ref","isDynamic","highlight"];function lp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lp(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const dp=(0,Rn.A)(ce.NavigationTab),up=(0,vr.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);}"]),pp=(0,vr.default)(ce.Icon).attrs({name:"long_arrow_up",color:"successText"}).withConfig({displayName:"tabLink__DropHereIcon",componentId:"sc-1h4dha1-0"})(["animation:"," 1s ease-in infinite;"],up),hp=e=>{let{active:t,highlight:n,iconColor:r}=e;return r||(n||t?"primary":"textDescription")},gp=ip(ce.Icon),fp=e=>{var t;let{id:n,to:o,params:i,exact:s,icon:a,iconColor:l,title:c,fixed:d,dataGa:u,testId:p,children:h,type:g,tooltip:f,showBorderLeft:x,droppable:m,droppableProps:b={},ref:y,isDynamic:v,highlight:O}=e,w=(0,W.A)(e,ap);const{sendLog:C}=(0,nr.A)(),{onTabChange:P}=(0,sp.D)(),{setNodeRef:I,active:A}=(0,nt.zM)({id:"droppable-tab-".concat(n),disabled:!m,data:b}),k=(0,j.RQ)(s?o:"".concat(o,"/*")),S=(0,j.Zp)(),M=(0,ep.J)(),T=!!k,N="nodes"!==g||T,F=(0,r.useCallback)((()=>{if(T)return;const e="".concat(o).concat(i?"/".concat(i):"");S(e),P(n),C({feature:"Navigation",description:"Single page navigation using static tabs",tab:n,path:e})}),[n,o,T,i,P,C]),E=m&&A&&(null===(t=A.data.current)||void 0===t?void 0:t.dashboardable),L=(0,r.useRef)(),[R]=(0,D.m0)({tabId:n}),B=(0,r.useCallback)((e=>{let{button:t}=e;v&&1===t&&"function"===typeof w.onRemove&&w.onRemove(w.index,T)}),[v,w.index,T,w.onRemove]);return(0,pe.jsxs)(dp,cp(cp(cp({ref:(0,ce.mergeRefs)(I,y,L),fixed:d,active:T,showBorderLeft:x,icon:(0,pe.jsx)(gp,{name:a,size:"small",color:hp({active:T,highlight:O,iconColor:l}),notificationBg:null===R||void 0===R?void 0:R.color}),onActivate:F,"data-ga":u,"data-testid":p,"aria-selected":T},E&&{rootProps:{background:"successSemi",cursor:"alias"}}),{},{onMouseUp:B,tooltip:f||c,tooltipProps:cp({align:f?"bottom":"top",isBasic:"string"===typeof(f||c)},O?{color:"primary"}:{})},w),{},{children:[!M&&!!c&&(0,pe.jsx)(ce.Text,{alignSelf:"center",strong:O,color:hp({active:T,highlight:O,iconColor:l}),whiteSpace:"nowrap",children:c}),L.current&&E&&(0,pe.jsx)(ce.Drop,{target:L.current,align:{top:"bottom"},stretch:!1,hideShadow:!0,zIndex:1,children:(0,pe.jsx)(pp,{})}),N&&h]}))},xp=["id","icon","title","path"];function mp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const bp={singleNode:"singleNode",logs:"logs",top:"fn",feed:"feed",anomalies:"anomalies",default:"singleNode",alerts:"alerts"},jp=(0,r.memo)((()=>{const e=Qu(),t=(0,j.RQ)("/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/:path"),n=t&&bp[t.params.path]||bp.default;return(0,pe.jsxs)(ce.Flex,{justifyContent:"start",alignSelf:"start",alignItems:"end",width:"100%",height:"100%",overflow:"auto",background:"mainBackground",children:[(0,pe.jsx)(Xu,{flavour:n,background:"mainBackground",border:void 0}),(0,pe.jsx)(ce.TabSeparator,{}),e.map(((e,t)=>{let{id:n,icon:r,title:o,path:i}=e,s=(0,W.A)(e,xp);return(0,pe.jsx)(fp,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mp(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({exact:!0,fixed:!0,to:i,icon:r,title:o,id:n,rootProps:{background:"mainBackground"},showBorderLeft:0===t},s),"".concat(n,"-").concat(t))}))]})})),yp=jp;var vp=n(47413),Op=n(17178),wp=n(5722);const Cp=()=>{const{active:e}=(0,nt.fF)(),t=(0,f.JT)("dashboard:Create"),n=(0,v.dg)();return t&&e&&!n?(0,pe.jsx)(fp,{to:"",id:"plus",icon:"plus",fixed:!0,droppable:!0,droppableProps:{dropArea:!0,dashboardId:"new"},testid:"roomDropdownMenu-roomOptions",disabled:!t||n}):null},Pp=["title","path","children","index","ref","tooltip","type","id"],Ip=["staticPaths"],Ap=["id","icon","title","path"];function kp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kp(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Dp=e=>{let{title:t,path:n,children:o,index:i,ref:s,tooltip:a,type:l,id:c}=e,d=(0,W.A)(e,Pp);const u=(0,Ar.JL)("alerts"===l?c:null,"name"),p=(0,Ar.JL)("alerts"===l?c:null,"instanceName"),h=(0,Ar.JL)("alerts"===l?c:null,"nodeId"),g=(0,K.xY)("alerts"===l?h:null,"name"),f=(0,K.xY)("nodes"===l?c:null,"name"),x=(0,r.useMemo)((()=>{if("alerts"===l){const e=[];return p&&e.push("Instance: ".concat(p)),g&&e.push("Node: ".concat(g)),{title:"Alert: ".concat(u||t||"Unknown"),description:e.length>0?e.join(" \u2022 "):"View detailed information about this alert"}}return"nodes"===l?{title:"Node: ".concat(f||t||"Unknown"),description:"View node metrics, logs, top consumers, anomalies, and more."}:"dashboards"===l?{title:"Dashboard: ".concat(t||"Unknown"),description:"View custom dashboard"}:a}),[l,a,t,u,p,g,f]);return(0,pe.jsx)(fp,Sp(Sp({ref:s,isDynamic:!0,showBorderLeft:0===i,to:n,title:t,tooltip:x,"data-testid":"navigation-dynamicTab-".concat(t),index:i,type:l,id:c},d),{},{children:o}))},Mp=e=>{let{staticPaths:t}=e,n=(0,W.A)(e,Ip);const[r,o,i]=(0,vp.A)(t),s=(0,qu.A)("horizontal");return(0,pe.jsx)(ce.BaseDraggableTabs,Sp(Sp({onDragEnd:o,onTabClose:i,items:r,Item:Dp},n),{},{ref:s}))},Tp=()=>(0,pe.jsx)(j.BV,{children:(0,pe.jsx)(j.qh,{path:"/spaces/:spaceSlug/rooms/:roomSlug/nodes/:nodeId/*",element:(0,pe.jsx)(yp,{})})}),Np=(0,r.memo)((()=>{const[e,t]=(0,Op.A)();return(0,wp.A)()?(0,pe.jsxs)(ce.NavigationTabs,{subTabs:(0,pe.jsx)(Tp,{}),children:[e.map(((e,t)=>{let{id:n,icon:r,title:o,path:i}=e,s=(0,W.A)(e,Ap);return(0,pe.jsx)(fp,Sp({fixed:!0,to:i,icon:r,title:o,id:n},s),"".concat(n,"-").concat(t))})),(0,pe.jsx)(ce.TabSeparator,{}),(0,pe.jsx)(Mp,{staticPaths:t}),(0,pe.jsx)(Cp,{})]}):null})),Fp=Np,Ep=()=>{const e=(0,zn.eg)(),t=(()=>{const e=(0,v.bq)(),t=(0,O.QW)();return"/spaces/".concat(e,"/rooms/").concat(t,"/overview")})(),n=(0,j.Zp)();(0,r.useEffect)((()=>{if(e)return(0,Zs.unregister)(e.on("goToLink",((e,r)=>{var o;let i=location.pathname;return e&&e.getParent().getAttribute("roomId")&&(i=e.getParent().getId(),i=/^\/spaces/.test(i)?i:t),n(i,r?{state:{chartName:r},replace:!0}:{state:{contextToGo:null===e||void 0===e||null===(o=e.getAttribute("contextScope"))||void 0===o?void 0:o[0]},replace:!0})})))}),[e,t])},Lp=()=>(Ep(),null);var Rp,Bp=n(73937),Vp=n(21885),Hp=n(65637),_p=n(88772),zp=n(73980),Kp=n(45026);function Gp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gp(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Up="dyncfg-edit-alet-warning-dismiss-".concat(null===(Rp=window.envSettings)||void 0===Rp?void 0:Rp.visitor),qp={lineHeight:1.6},Jp=e=>{let{alertName:t,nodeIds:n=[]}=e;const i="true"===localStorage.getItem(Up),[s,,,a]=(0,Ce.A)(!i),[l,c]=(0,r.useState)(),d=(0,K.xY)(n[0],"name"),u=n.length-1,p=u>0?" and ".concat(u," other nodes"):"",h=(0,r.useCallback)((e=>{c(e)}),[c]),g=(0,r.useCallback)((()=>{l&&localStorage.setItem(Up,!0),a()}),[l,a]);return s?(0,pe.jsx)(ce.Modal,{backdropContainerProps:{zIndex:"60"},backdropProps:{backdropBlur:!0},children:(0,pe.jsxs)(ce.ModalContent,{children:[(0,pe.jsx)(ce.ModalHeader,{children:(0,pe.jsx)(ce.H4,{children:"Editing Alerts"})}),(0,pe.jsx)(ce.ModalBody,{children:(0,pe.jsxs)(ce.Flex,{column:!0,gap:2,width:{max:120},children:[(0,pe.jsxs)(ce.TextBig,Wp(Wp({},qp),{},{children:["You are about to edit the alert ",(0,pe.jsx)(ce.TextBig,{color:"primary",children:t}),d?(0,pe.jsxs)(pe.Fragment,{children:[" ","on node ",(0,pe.jsx)(ce.TextBig,{color:"primary",children:d}),p]}):null,"."]})),(0,pe.jsx)(ce.TextBig,Wp(Wp({},qp),{},{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,pe.jsx)(ce.TextBig,Wp(Wp({},qp),{},{children:'To apply an alert on all your currently connected nodes, edit it and select "Submit to Multiple Nodes".'})):(0,pe.jsx)(ce.TextBig,Wp(Wp({},qp),{},{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,pe.jsxs)(ce.ModalFooter,{justifyContent:"between",children:[(0,pe.jsxs)(ce.Flex,{gap:2,alignItems:"center",children:[(0,pe.jsx)(ce.Checkbox,{checked:l,onChange:h}),(0,pe.jsx)(ce.TextBig,{children:"Don't show this again"})]}),(0,pe.jsx)(ce.Button,{type:"button",flavour:"hollow",label:"OK",textTransform:"uppercase",onClick:g})]})]})}):null};function $p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$p(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Zp=(0,r.memo)((()=>{const{node:e}=(0,Bp.Z)(),{alertName:t,nodeIds:n,title:o}=(0,Kp.A)(),{loaded:i,tree:s}=(0,Hp.A)(n?{value:null===n||void 0===n?void 0:n[0]}:e),a=(0,r.useMemo)((()=>{var e;return(null===s||void 0===s||null===(e=s[Vp.$7])||void 0===e?void 0:e[o])||{}}),[s,o]),l=(0,r.useMemo)((()=>!!Object.keys(a||{}).length),[a]);return i&&t?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(zp.A,{flavour:"entity",title:o,entityProps:a,isOpen:l,isEditFromState:!0,renderChildren:e=>(0,pe.jsx)(_p.A,Yp(Yp({id:o},a),e))},JSON.stringify({loaded:i,alertName:t,alertItemExists:l})),a?(0,pe.jsx)(Jp,{alertName:t,nodeIds:n}):null]}):null})),Xp=Zp,Qp=["entityProps"];function eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function th(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eh(Object(n),!0).forEach((function(t){(0,m.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const nh=(0,r.memo)((()=>{const{node:e}=(0,Bp.Z)(),{path:t}=(0,Hp.A)(e),n=(0,tr.sh)({node:e,path:t}),r=n||{},{entityProps:o}=r,i=(0,W.A)(r,Qp);return n?(0,pe.jsx)(zp.A,{id:n.template,flavour:"entity",title:"".concat(n.template,":placeholder"),entityProps:th(th({},o),i),isNewItem:!0,formData:n.formData,renderChildren:e=>(0,pe.jsx)(_p.A,th(th(th({},o),e),{},{id:n.template,isNewItem:!0}))}):null})),rh=nh,oh=(0,s.A)((()=>Promise.all([n.e(5638),n.e(2448)]).then(n.bind(n,52448))),"ManageSpaceRoute"),ih=(0,s.A)((()=>n.e(2201).then(n.bind(n,52201))),"Trial"),sh=(0,s.A)((()=>n.e(5302).then(n.bind(n,5302))),"PreferredNodesModal"),ah=(0,s.A)((()=>Promise.resolve().then(n.bind(n,61314))),"JoinSpace"),lh=(0,s.A)((()=>n.e(7530).then(n.bind(n,17530))),"NoSpaceAccess"),ch=(0,s.A)((()=>n.e(6333).then(n.bind(n,96333))),"EmptyRoom"),dh=(0,s.A)((()=>n.e(1910).then(n.bind(n,11910))),"AlertView"),uh=(0,s.A)((()=>n.e(7316).then(n.bind(n,74935))),"Anomalies"),ph=(0,s.A)((()=>Promise.resolve().then(n.bind(n,52047))),"AlertsSmartboard"),hh=(0,s.A)((()=>n.e(2711).then(n.bind(n,82711))),"DashboardsOverview"),gh=(0,s.A)((()=>Promise.all([n.e(5),n.e(5877),n.e(4835),n.e(4306)]).then(n.bind(n,95297))),"DashboardView"),fh=(0,s.A)((()=>Promise.all([n.e(5638),n.e(517),n.e(5),n.e(2755)]).then(n.bind(n,42755))),"FunctionsView"),xh=(0,s.A)((()=>Promise.all([n.e(4090),n.e(7817)]).then(n.bind(n,37817))),"Insights"),mh=(0,s.A)((()=>Promise.all([n.e(4090),n.e(3808)]).then(n.bind(n,43808))),"InsightsReport"),bh=(0,s.A)((()=>n.e(2792).then(n.bind(n,32792))),"Onboarding"),jh=(0,s.A)((()=>Promise.all([n.e(8791),n.e(9462)]).then(n.bind(n,89462))),"Integrations"),yh=(0,s.A)((()=>Promise.all([n.e(5),n.e(5877),n.e(1592)]).then(n.bind(n,92003))),"DropInDashboard"),vh=(0,s.A)((()=>n.e(3185).then(n.bind(n,73185))),"Marketplace"),Oh=(0,s.A)((()=>n.e(677).then(n.bind(n,90677))),"AlertConfigAiModal"),wh=(0,s.A)((()=>n.e(5325).then(n.bind(n,65325))),"GeoMapTab"),{demoSlug:Ch,demoDefaultRoomViews:Ph,defaultRoomView:Ih,onboardingView:Ah,integrationsView:kh}=g.A,Sh=rl(ic(tl)),Dh=ic(tl),Mh=(0,r.memo)((()=>{const[e,t]=(0,Ui.Ay)(),n=Ch===e?Ph[t]||Ph.default:o.Ay&&t===o.Iy?o.kG:Ih;return(0,pe.jsxs)(r.Suspense,{fallback:(0,pe.jsx)(u.zj,{}),children:[(0,pe.jsx)(r.Suspense,{fallback:"",children:(0,pe.jsx)(yh,{})}),(0,pe.jsx)(j.BV,{children:(0,pe.jsx)(j.qh,{path:"nodes/:nodeId/*",element:(0,pe.jsx)(Pi,{})})}),(0,pe.jsxs)(j.BV,{children:[(0,pe.jsx)(j.qh,{path:Ah,element:(0,pe.jsx)(r.Suspense,{fallback:(0,pe.jsx)(u.NP,{}),children:(0,pe.jsx)(bh,{})})}),(0,pe.jsx)(j.qh,{path:kh,element:(0,pe.jsx)(r.Suspense,{fallback:(0,pe.jsx)(u.H$,{}),children:(0,pe.jsx)(jh,{flavour:"settingsPage"})})}),(0,pe.jsx)(j.qh,{path:"nodes/:nodeId",element:(0,pe.jsx)(Sh,{})}),(0,pe.jsx)(j.qh,{path:"nodes/:nodeId/alerts",element:(0,pe.jsx)(ph,{})}),(0,pe.jsx)(j.qh,{path:"nodes/:nodeId/anomalies",element:(0,pe.jsx)(r.Suspense,{fallback:(0,pe.jsx)(u.Bm,{}),children:(0,pe.jsx)(uh,{})})}),(0,pe.jsx)(j.qh,{path:"nodes/:nodeId/top",element:(0,pe.jsx)(fh,{flavour:"fn"},"fn")}),(0,pe.jsx)(j.qh,{path:"nodes/:nodeId/logs",element:(0,pe.jsx)(fh,{flavour:"logs"},"logs")}),(0,pe.jsx)(j.qh,{path:"nodes/:nodeId/events",element:(0,pe.jsx)(fh,{flavour:"feed"},"feed")}),(0,pe.jsx)(j.qh,{path:"nodes",element:(0,pe.jsx)(Ci,{})}),(0,pe.jsx)(j.qh,{path:"home",element:(0,pe.jsx)(Ru,{})}),(0,pe.jsx)(j.qh,{path:"overview",element:(0,pe.jsx)(Dh,{})}),(0,pe.jsx)(j.qh,{path:"alerts/:alertId",element:(0,pe.jsx)(r.Suspense,{fallback:(0,pe.jsx)(u.xh,{}),children:(0,pe.jsx)(dh,{})})}),(0,pe.jsx)(j.qh,{path:"alerts",element:(0,pe.jsx)(ph,{})}),(0,pe.jsx)(j.qh,{path:"alarms/:alertId",element:(0,pe.jsx)(dh,{})}),(0,pe.jsx)(j.qh,{path:"alarms",element:(0,pe.jsx)(j.C5,{replace:!0,to:"/spaces/".concat(e,"/rooms/").concat(t,"/alerts")})}),(0,pe.jsx)(j.qh,{path:"functions",element:(0,pe.jsx)(j.C5,{replace:!0,to:"/spaces/".concat(e,"/rooms/").concat(t,"/top")})}),(0,pe.jsx)(j.qh,{path:"dashboard",element:(0,pe.jsx)(gh,{customDashboardId:o.LA})}),(0,pe.jsx)(j.qh,{path:"dashboards/:dashboardSlug",element:(0,pe.jsx)(r.Suspense,{fallback:(0,pe.jsx)(d.O2,{}),children:(0,pe.jsx)(gh,{})})}),(0,pe.jsx)(j.qh,{path:"dashboards",element:(0,pe.jsx)(hh,{})}),(0,pe.jsx)(j.qh,{path:"kubernetes",element:(0,pe.jsx)(Dh,{flavour:"k8s"})}),(0,pe.jsx)(j.qh,{path:"anomalies",element:(0,pe.jsx)(r.Suspense,{fallback:(0,pe.jsx)(u.Bm,{}),children:(0,pe.jsx)(uh,{})})}),(0,pe.jsx)(j.qh,{path:"top",element:(0,pe.jsx)(fh,{flavour:"fn"},"fn")}),(0,pe.jsx)(j.qh,{path:"logs",element:(0,pe.jsx)(fh,{flavour:"logs"},"logs")}),(0,pe.jsx)(j.qh,{path:"events",element:(0,pe.jsx)(fh,{flavour:"feed"},"feed")}),i.ul&&(0,pe.jsx)(j.qh,{path:"geomap/*",element:(0,pe.jsx)(wh,{})}),(0,pe.jsx)(j.qh,{path:"".concat(x.p9,"/:reportId"),element:(0,pe.jsx)(mh,{})}),(0,pe.jsx)(j.qh,{path:"insights/*",element:(0,pe.jsx)(r.Suspense,{fallback:(0,pe.jsx)(u.BJ,{}),children:(0,pe.jsx)(xh,{})})}),(0,pe.jsx)(j.qh,{path:"/",element:(0,pe.jsx)(j.C5,{replace:!0,to:"/spaces/".concat(e,"/rooms/").concat(t,"/").concat(n)})})]})]})})),Th=()=>{const{isOnboardingPath:e,path:t}=(0,p.A)(),{isIntegrationsPath:n}=(0,Wu.Q)(),[i,s]=(0,Wu.A)(),l=(0,v.vt)(),c=(0,O.ID)(),d=(0,a.I)(),h=(0,R.gr)(c,"ids"),g=(0,R.gr)(c,"loaded"),f=(0,v.bE)(l,"isEmpty"),x=(0,r.useMemo)((()=>!0===g&&!h.length),[g,h]),m=(0,o.Az)(l);return(0,Ii.A)(l,c),(0,Ai.A)({spaceId:l,id:c,pollingInterval:63e3}),(0,ki.A)(l,c),(0,Si.A)(l,c),(0,Di.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,b.yF)(((r,a)=>{(0,Vu.Uc)(e,t,{types:n,entities:o,paths:i,names:s}).then((n=>{let{data:r}=n;a((0,ie.Mg)({spaceId:e,roomId:t}),r),a((0,Te.n_)({spaceId:e,roomId:t})),a((0,Oe.n_)({spaceId:e,roomId:t})),a((0,Bu.w7)({spaceId:e,roomId:t}),!0)}))}));(0,r.useEffect)((()=>{e&&t&&a()}),[e,t,n,o,i,s])}(l,c),L(),(0,r.useEffect)((()=>{m||s||d||f(i)}),[m,i,d,s,f]),d?(0,pe.jsx)(r.Suspense,{fallback:"",children:(0,pe.jsx)(vh,{subCallback:d})}):s?(0,pe.jsx)(u.Qk,{}):m||!i||!t||e||n?!x||e||n?(0,pe.jsx)(Mh,{}):(0,pe.jsx)(ch,{}):(0,pe.jsx)(j.C5,{to:t,replace:!0})},Nh=(0,c.Xc)((0,r.memo)((()=>{const e=(0,f.JT)("space:Read"),t=(0,f.JT)("room:Read");return e?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Fp,{}),(0,pe.jsx)(r.Suspense,{fallback:(0,pe.jsx)(u.Qk,{}),children:(0,pe.jsxs)(j.BV,{children:[(0,pe.jsx)(j.qh,{path:"spaces/:spaceSlug/join-space",element:(0,pe.jsx)(ah,{})}),(0,pe.jsx)(j.qh,{path:"spaces/:spaceSlug/no-rooms",element:(0,pe.jsx)(lh,{reason:"noRooms"})}),(0,pe.jsx)(j.qh,{path:"spaces/:spaceSlug/settings/*",element:(0,pe.jsx)(Fh,{})}),(0,pe.jsx)(j.qh,{path:"spaces/:spaceSlug/rooms/:roomSlug/*",element:t?(0,pe.jsx)(Th,{}):(0,pe.jsx)(lh,{reason:"noRoomPermission"})})]})})]}):(0,pe.jsx)(lh,{reason:"noSpacePermission"})}))),Fh=()=>((0,Ui.KI)(),(0,pe.jsx)(oh,{})),Eh=()=>{const e=(0,v.vt)();return(0,Hu.A)(e),(0,_u.A)(e),(e=>{const t=(0,b.yF)((0,r.useCallback)((function(t,n){let{data:{results:r}}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n((0,Ku.S)({id:e}),r)}),[e])),n=(0,b.yF)((0,r.useCallback)(((t,n,r)=>{n((0,Ku.S)({id:e,key:"error"}),r)}),[e])),o=(0,Gu.sC)(e,"loaded"),i=(0,f.JT)("alert:ReadAll");(0,y.A)((()=>({enabled:i&&!!e&&o,fetch:()=>(0,zu.C2)(e),onFail:n,onReceive:t,pollingOptions:{pollingInterval:15e4}})),[e,!!o,i])})(e),null},Lh=(0,c.Xc)((()=>{const e=(0,v.vt)();return(0,Uu.Ay)(),(0,r.useEffect)((()=>{const e=(0,l.A)(new URL(window.location.href).searchParams.get("join_callback"));e&&(window.location.href=e)}),[]),e?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(Eh,{}),(0,pe.jsx)(h.A,{permission:"space:Read",children:t=>t?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(j.BV,{children:(0,pe.jsx)(j.qh,{path:"/*",element:(0,pe.jsx)(Lp,{})})}),(0,pe.jsx)(r.Suspense,{fallback:(0,pe.jsx)(u.Qk,{}),children:(0,pe.jsx)(Nh,{})})]}):(0,pe.jsx)(lh,{reason:"noSpacePermission"},e)}),(0,pe.jsx)(r.Suspense,{fallback:"",children:(0,pe.jsx)(ih,{})}),(0,pe.jsxs)(r.Suspense,{fallback:"",children:[(0,pe.jsx)(sh,{}),(0,pe.jsx)(rh,{}),(0,pe.jsx)(Xp,{}),(0,pe.jsx)(Oh,{})]})]}):(0,pe.jsx)(u.Qk,{})}))},90901(e,t,n){n.d(t,{I:()=>c,q:()=>l});n(98992),n(8872),n(62953);var r=n(96540),o=n(41344),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 null!==r&&void 0!==r&&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&&"".concat(e,"/anomalies")})();return(0,r.useCallback)((function(){t(n,{state:{nodeId:arguments.length>0&&void 0!==arguments[0]?arguments[0]:e}})}),[n,t])}},27496(e,t,n){n.d(t,{n:()=>l});n(98992),n(54520),n(3949);var r=n(64467),o=n(14963),i=n(4719),s=n(74848);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const l=(0,i.aV)((e=>e.children?(0,s.jsx)(o.A,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({as:"p",role:"document"},e)):null),(e=>{let{info:t}=e;return{children:t}}))},95836(e,t,n){n.d(t,{$:()=>b});n(98992),n(54520),n(3949);var r=n(64467),o=n(80045),i=n(42358),s=n(45087),a=n(4719),l=n(80914),c=n(27496),d=n(74848);const u=["name","tiny"],p=["hasTooltip","hasInfo"],h=["name","info"];function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const x=e=>{let{name:t,tiny:n}=e,r=(0,o.A)(e,u);const s=n?i.Text:i.H3;return"string"===typeof t?(0,d.jsx)(s,f(f({strong:!0},r),{},{children:t})):t||null},m=(0,l.A)((e=>{let{hasTooltip:t,hasInfo:n}=e,r=(0,o.A)(e,p);return t&&n?(0,d.jsx)(s.A,{content:(0,d.jsx)(c.n,{id:r.id}),isBasic:!0,children:(0,d.jsx)(x,f({},r))}):(0,d.jsx)(x,f({},r))})),b=(0,a.aV)(m,(e=>{let{name:t,info:n}=e;return f({name:t,hasInfo:!!n},(0,o.A)(e,h))}))},69001(e,t,n){n.d(t,{h:()=>c});n(98992),n(54520),n(3949);var r=n(64467),o=n(80045),i=n(42358),s=n(74848);const a=["id"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const c=e=>{let{id:t}=e,n=(0,o.A)(e,a);return(0,s.jsx)(i.Flex,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({column:!0,"data-testid":"chart-menu-wrapper","data-menuid":t},n))}},75144(e,t,n){n.d(t,{X:()=>l});n(98992),n(54520),n(3949);var r=n(64467),o=n(4719),i=n(14963),s=n(74848);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const l=(0,o.aV)((e=>e.children?(0,s.jsx)(i.A,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({as:"p",role:"document"},e)):null),(e=>{let{info:t}=e;return{children:t}}))},63996(e,t,n){n.d(t,{t:()=>j});n(98992),n(54520),n(3949);var r=n(64467),o=n(80045),i=n(96540),s=n(42358),a=n(45087),l=n(4719),c=n(80914),d=n(75144),u=n(74848);const p=["name","level","descendantIds","enableFavourites","ref"],h=["hasTooltip","hasInfo"],g=["name","info"];function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const m=e=>{let{name:t,level:n,descendantIds:r,enableFavourites:a,ref:l}=e,c=(0,o.A)(e,p);const d=(0,i.useMemo)((()=>Array.from(Array(n)).fill("-").join("")),[n]),h=(0,i.useMemo)((()=>a?"".concat(d," ").concat(t):t),[a,d,t]),g=(0,i.useMemo)((()=>{var e;return x(x({},a&&(null===r||void 0===r||!r.length||null!==c&&void 0!==c&&null!==(e=c.selfChartIds)&&void 0!==e&&e.length)?{color:"primary"}:{}),c)}),[r,c]);return"string"===typeof t?(0,u.jsx)(s.Text,x(x({strong:!0,ref:l},g),{},{children:h})):t||null},b=(0,c.A)((e=>{let{hasTooltip:t,hasInfo:n}=e,r=(0,o.A)(e,h);return t&&n?(0,u.jsx)(a.A,{content:(0,u.jsx)(d.X,{id:r.id}),isBasic:!0,children:(0,u.jsx)(m,x({},r))}):(0,u.jsx)(m,x({},r))})),j=(0,l.aV)(b,(e=>{let{name:t,info:n}=e;return x({name:t,hasInfo:!!n},(0,o.A)(e,g))}))},54025(e,t,n){n.d(t,{t:()=>c});n(98992),n(54520),n(3949);var r=n(64467),o=n(80045),i=n(42358),s=n(74848);const a=["id","testId"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const c=e=>{let{id:t,testId:n="chart-sub-menu-container"}=e,c=(0,o.A)(e,a);return(0,s.jsx)(i.Flex,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({column:!0,gap:2,id:t,"data-testid":n,"data-menuid":t},c))}},14963(e,t,n){n.d(t,{A:()=>u});n(98992),n(54520),n(3949);var r=n(64467),o=n(80045),i=n(96540),s=n(42358),a=n(50239),l=n(74848);const c=["children","onClick"];function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}const u=e=>{let{children:t,onClick:n}=e,u=(0,o.A)(e,c);const p=(0,a.UH)(),h=(0,i.useCallback)((e=>{const{hash:t=""}=e.target;t.startsWith("#menu")&&(e.preventDefault(),p.goToLink(t.substr(1))),n&&n(e)}),[p]);return"string"===typeof t?(0,l.jsx)(s.TextSmall,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({color:"textDescription",dangerouslySetInnerHTML:{__html:t},onClick:h},u)):t||null}},30863(e,t,n){n.d(t,{A:()=>K});var r=n(64467),o=n(80045),i=(n(98992),n(54520),n(3949),n(81454),n(62953),n(96540)),s=n(42358),a=n(73700),l=n(69457),c=n(51220),d=n(24582),u=n(48106),p=n(20871);n(72577);let h=null;n(94490),n(26910),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 g=n(57530),f=n(43375);n(8872);var x=n(51510),m=n(85088),b=n(33962),j=n(4719),y=n(56876),v=n(80914),O=n(74848);const w=["Component"];function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const I=(0,i.memo)((e=>{let{id:t,name:n,icon:r,isLast:o}=e;const{onMenuClick:a}=(0,y.A)(),l=(0,i.useCallback)((()=>{a({id:t})}),[t,a]),c=(0,i.useMemo)((()=>P({alignItems:"center",gap:1},o?{}:{cursor:"pointer",onClick:l})),[o,l]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(s.Flex,P(P({},c),{},{children:[r?(0,O.jsx)(m.o$,{icon:r,active:!0,containerProps:{width:"auto"}}):null,(0,O.jsx)(s.Text,{color:"primary",strong:!0,children:n})]})),o?null:(0,O.jsx)(s.Text,{color:"primary",strong:!0,children:">"})]})})),A=(0,i.memo)((e=>{let{menu:t}=e;const{id:n,shortName:r,name:o,icon:a,parentMenus:l}=t||{},c=(0,i.useMemo)((()=>[...l||[],{id:n,name:r||o,icon:a}]),[t]);return n?(0,O.jsx)(s.Flex,{alignItems:"center",gap:1,children:c.map(((e,t)=>(0,O.jsx)(I,P({isLast:t===c.length-1},e),e.id)))}):null})),k=(0,x.default)(s.Flex).attrs((e=>P({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);"]),S=["nodes"],D=e=>{let{flavour:t,tools:n=[],hasFilters:r}=e;const a=(0,b.W2)(),l=(0,j.b)(a),c=(0,i.useContext)(x.ThemeContext);return!S.includes(t)&&l?(0,O.jsxs)(k,{background:(0,s.getRgbColor)("mainBackground",.8)({theme:c}),children:[(0,O.jsx)(A,{menu:l}),(0,O.jsx)(v.G,{menuId:a,menuName:l.shortName||l.name,hasFilters:r,flavour:t,parentIds:l.parentIds,hasCharts:!0,children:n.map((e=>{let{Component:t}=e,n=(0,o.A)(e,w);return t?(0,O.jsx)(t,P({},n),n.id):null}))})]}):null},M=(0,i.memo)(D),T=["getComponent","element","index"],N=["flavour","onActiveMenuId","getComponent","dashboardOptions","initialChartName","checkVisibility"];function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const L="8px 2px",R="1px 2px",B={root:R,submenu:R,default:L},V=[{flavour:"root",id:"System-0"}],H=(0,i.memo)((e=>{let{getComponent:t,element:n,index:r}=e,s=(0,o.A)(e,T);const a=(0,i.useMemo)((()=>n&&t(n)),[null===n||void 0===n?void 0:n.id,r]),l=(0,i.useMemo)((()=>!!V.find((e=>{let{id:t,flavour:r}=e;return t===n.id&&r===n.flavour}))),[n]);return!a||l?null:(0,O.jsx)(a,E(E(E({},n),{},{index:r},s),{},{isVisible:!0}),n.id)})),_=(0,i.memo)((e=>{let{flavour:t,elements:n,onScroll:r,dashboardOptions:o,getComponent:l,stickyBg:d="mainBackground",stickyRef:p,nextStickyRef:x,stickyIndexes:m,tmpStickyRef:b,containerWidth:j,headerProps:y={},ref:v}=e;const w=(e=>{const t=(0,i.useRef)(),n=(0,i.useRef)(),r=(0,i.useRef)(0),o=(0,i.useRef)(0);return(0,i.useCallback)((i=>{if(t.current!==e.length&&(o.current=0),n.current&&(o.current<5||t.current!==e.length)){var s;o.current=o.current+1,t.current=e.length;const a=e.findIndex((e=>e.id===n.current.id));if(-1===a)return;const l=null===(s=i.getMeasurements())||void 0===s?void 0:s[a];if(!l)return;const{start:c}=l;return i.scrollToOffset(c+r.current),clearTimeout(h),void(h=setTimeout((()=>o.current=5),200))}t.current=e.length;const a=i.scrollOffset;let l=0;const c=i.getMeasurements().find((e=>(l+=e.size,l>a)));c&&(n.current=e[c.index],r.current=a-c.start)}),[e])})(n),C=(0,i.useRef)(),[P,I]=(0,i.useState)(0),A=((e,t,n)=>{let{stickyRef:r,nextStickyRef:o,tmpStickyRef:s}=n;const a=(0,i.useRef)(),{active:l}=(0,f.fF)(),c=(0,i.useRef)();return c.current=l,(0,i.useCallback)((e=>{if(c.current&&c.current.data.current.isResizer)return a.current;if(!t)return a.current=(0,g.vp)(e),a.current;o.current=Number(Object.keys(t).find((t=>e.startIndex<t))),r.current=Number(Object.keys(t).reverse().find((t=>e.startIndex>=t))),o.current-e.startIndex===1&&(r.current=NaN);let n=(0,g.vp)(e);return null!==s.current&&(n=[...n,s.current]),isNaN(r.current)?a.current=[...new Set(n)].sort(((e,t)=>e-t)):a.current=[...new Set([r.current,...n])].sort(((e,t)=>e-t)),a.current}),[e,t])})(n,m,{stickyRef:p,nextStickyRef:x,tmpStickyRef:b}),k=(0,c.Te)({count:n.length,getScrollElement:()=>v.current,overscan:2,enableSmoothScroll:!1,estimateSize:e=>n[e].size,onChange:w,rangeExtractor:A,scrollPaddingStart:0});C.current=k,(0,u.A)(k,n);const S=(0,i.useCallback)((0,a.n)(100,(function(){r(...arguments),v.current&&I(v.current.scrollTop)})),[r]);return(0,O.jsxs)("div",{ref:v,style:{minHeight:"100%",width:"100%",overflow:"auto"},onScroll:S,children:[(0,O.jsx)(M,E({flavour:t},y)),(0,O.jsxs)("div",{style:{minHeight:"".concat(k.getTotalSize(),"px"),width:"100%",position:"relative"},children:[P>0&&!isNaN(p.current)&&(0,O.jsx)(s.Box,{sx:{top:0,left:0,width:"100%",padding:L,position:"sticky",zIndex:10,boxShadow:"2px 6px 6px -7px rgba(0, 0, 0, 0.4)"},background:d,children:(0,O.jsx)(H,E(E({},o),{},{element:n[p.current],index:p.current,getComponent:l}))},p.current),k.getVirtualItems().map((e=>{const t=B[n[e.index].flavour]||B.default;return(0,O.jsx)(s.Box,{ref:k.measureElement,sx:{top:0,left:0,width:"100%",padding:t,position:"absolute",transform:"translateY(".concat(e.start,"px)")},"data-index":e.index,children:(0,O.jsx)(H,E(E({},o),{},{element:n[e.index],index:e.index,getComponent:l,containerWidth:j}))},e.key)}))]})]})}),((e,t)=>e.elements.length===t.elements.length&&e.containerWidth===t.containerWidth)),z=e=>{let{flavour:t,onActiveMenuId:n,getComponent:r,dashboardOptions:s,initialChartName:a,checkVisibility:c}=e,u=(0,o.A)(e,N);const h=(0,d.bD)(),g=(0,l.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:f,nextStickyRef:x,tmpStickyRef:m},b]=(e=>{const t=(0,l.Tg)(),n=(0,i.useRef)(null),r=(0,i.useMemo)((()=>e.reduce(((e,n,r)=>{let{id:o,sticky:i}=n;return t[o]&&"undefined"!==typeof i&&i&&(e[r]=!0),e}),{})),[e]),o=(0,i.useRef)(),s=(0,i.useRef)(),a=(0,i.useCallback)((e=>!!r[e]),[r]),c=(0,i.useCallback)((e=>o.current===e),[]);return[{stickyRef:o,nextStickyRef:s,isSticky:a,isActiveSticky:c,tmpStickyRef:n},r,t]})(g),j=(0,i.useRef)(),y=(0,i.useRef)(),v=(0,i.useMemo)((()=>(y.current&&y.current.cancel(),y.current=(0,p.A)({stickyRef:f}),()=>y.current(j.current,n))),[g.length,n]);return(0,i.useLayoutEffect)((()=>{g.length&&v()}),[g.length,a]),(0,O.jsx)(_,E({flavour:t,elements:g,onScroll:v,dashboardOptions:s,getComponent:r,ref:j,stickyRef:f,nextStickyRef:x,stickyIndexes:b,tmpStickyRef:m},u))},K=(0,i.memo)(z)},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)(),p=(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(;(null===(i=t[o])||void 0===i?void 0:i.level)<(null!==(s=null===(a=t[o+1])||void 0===a?void 0:a.level)&&void 0!==s?s:999999);){var i,s,a;o+=1}if(-1!==o)return e.scrollToIndex(o,{align:"center"})}),5),!0)},goToLink:function(e){let{leaf:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=Object.values(a.current).find((t=>t.link&&t.link===e));if(n)return p.goToElement(n.id,{leaf:t});if(d.current){const n=Object.values(d.current).find((t=>t.link&&t.link.includes(e)));if(n)return p.goToElement(n.id,{leaf:t})}}})),[n,t]);return(0,r.useLayoutEffect)((()=>{u(p)}),[p]),p}},96026(e,t,n){n.d(t,{l:()=>f,q:()=>g});var r=n(64467),o=(n(98992),n(54520),n(3949),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(62953),n(96540)),i=n(41344),s=n(42790),a=n(61841),l=n(24609),c=n(24013),d=n(19075),u=n(91421);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const g=e=>{var t;let{alertId:n,alertName:r,nodeIds:s=[]}=e;const l=(0,i.Zp)(),{setState:p}=(0,u.$h)(),[h]=(0,a.Ay)(),{name:g}=(0,d.JL)(n),f=r||g,{isParent:x}=(0,c.xY)(s[0]),{loaded:m,value:b,hasError:j,error:y}=(0,u.wd)({node:{value:s[0],isParent:x},path:"/health"}),v=!(null===b||void 0===b||null===(t=b.tree)||void 0===t||null===(t=t["/health/alerts/prototypes"])||void 0===t||!t["health:alert:prototype:".concat(f)]),[,O]=(0,u.PJ)();return{canEdit:m&&!j&&v,goToEdit:(0,o.useCallback)((e=>{s=e?Array.from(new Set([e,...s])):s,p({alertName:f,isAlert:!0}),O(!0,{nodeId:s[0]})}),[f,s,h,p,l]),error:(null===y||void 0===y?void 0:y.errorMessage)||y}},f=()=>{const e=(0,i.Zp)(),{slug:t}=(0,l.ap)(),n=(0,s.rI)();return(0,o.useCallback)((r=>{r&&(n((e=>h(h({},e),{},{dyncfgSearchTerm:r}))),e("/spaces/".concat(t,"/settings/configurations"),{replace:!0}))}),[e,n,t])}},27024(e,t,n){n.d(t,{A:()=>M});var r=n(64467),o=(n(98992),n(54520),n(3949),n(62953),n(96540)),i=n(42358),s=n(31141),a=n(32788),l=n(29263),c=n(47410),d=n(16866),u=n(24609),p=n(87398),h=n(41579),g=n(19186),f=n(67294),x=n(5907),m=n(92726),b=n(62718),j=n(93536),y=n(38757),v=n(6304),O=n(50433),w=n(45706),C=n(28864),P=n(52795),I=n(74848);const A=(0,o.memo)((e=>{let{id:t,spaceId:n,roomId:r,chartId:s,name:a}=e;const[l,,c,d]=(0,v.A)(),{fullyLoaded:h,processing:f}=(0,m.fz)(t),b=(0,C.DH)(t,{onSuccess:()=>{(0,O.jE)("Chart added to ".concat(a)),d()}}),j=l&&h,y=(0,u.ns)(n,"slug"),A=(0,g.wz)(r,"slug"),k=(0,x.nM)(t),S=(0,w.A)(l&&t,{spaceId:n,spaceSlug:y,roomId:r,roomSlug:A}),D=(0,p.eg)();(0,o.useEffect)((()=>{if(S||!j)return;const e=D.getNode({id:s}),t=(0,P.h)(e.getAttributes());k(t.contextScope,t,(()=>setTimeout(b,100)))}),[j,S]);const M=l&&(f||S);return(0,I.jsx)(i.Button,{icon:"plus",onClick:c,isLoading:M,disabled:M,alignSelf:"end"})})),k=e=>{let{spaceId:t,roomId:n,chartId:r}=e;return[{id:"name",accessorKey:"name",header:"Dashboards",cell:e=>{let{getValue:t}=e;return(0,I.jsxs)(i.Flex,{alignItems:"center",gap:3,children:[(0,I.jsx)(i.Icon,{name:"dashboards",size:"small",color:"text"}),(0,I.jsx)(i.Text,{children:t()})]})}},{id:"plusButton",accessorKey:"id",header:"",cell:e=>{let{getValue:o,row:i}=e;return(0,I.jsx)(A,{id:o(),spaceId:t,roomId:n,chartId:r,name:i.original.name})}}]};function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const M=e=>{let{onClose:t}=e;(0,h.A)();const n=(0,g.ID)(),r=(0,g.XA)("name"),v=(0,u.vt)(),{params:O={},params:{chartId:w}}=(0,s.A)("addToDashboardModal"),C=(0,f.q)(),P=(0,m.Sf)(C),[A,S]=(0,o.useState)(""),[M,T]=(0,o.useState)(!1),N=A.length>0,F=(0,x.W6)(v,n,{onSuccess:t}),E=(0,p.eg)().getNode({id:w}),L=(0,o.useMemo)((()=>k({spaceId:v,roomId:n,chartId:w})),[v,n,w]),R=()=>{if(!E)return;const{aggregationMethod:e,selectedDimensions:t,groupBy:n,groupByLabel:r,groupingMethod:o,chartType:i,selectedLabels:s,nodesScope:a,selectedInstances:l,selectedNodes:c,contextScope:d}=E.getAttributes(),[u]=d;F(A,d,D(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}))},B=(0,f.RQ)();return(0,I.jsxs)(a.GO,{onClose:t,children:[(0,I.jsx)(l.z,{onClose:t,title:"Add to Dashboard"}),(0,I.jsx)(c.U,{children:"Select Dashboard"}),(0,I.jsxs)(a.Yv,{gap:3,overflow:"hidden",height:"100%",children:[(0,I.jsxs)(i.H6,{children:["Add chart to one or more dashboards from the ",r]}),B?(0,I.jsx)(i.Table,{dataColumns:L,data:P}):(0,I.jsx)(b.UG,{rows:3}),(0,I.jsxs)(i.Flex,{column:!0,padding:[3,0],gap:1,children:[(0,I.jsxs)(i.H6,{children:["Create a new dashboard and add ",w," to it"]}),(0,I.jsx)(y.A,{value:A,label:"Name",onChange:e=>S(e.target.value),isValid:M,setIsValid:T,isDirty:N,instantFeedback:"all",onKeyDown:e=>e.keyCode===d.I7&&M&&R}),(0,I.jsx)(i.Button,{label:"Create & add",onClick:R,disabled:!E||!A})]})]})]})}},55048(e,t,n){n.d(t,{A:()=>c});n(98992),n(54520),n(62953);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]),p=(0,r.useCallback)((e=>{const t=d();u(t.filter((t=>t!==e)))}),[e,t,n]);return[d,u,p]}},80914(e,t,n){n.d(t,{G:()=>_,A:()=>z});n(98992),n(54520),n(3949);var r=n(64467),o=n(51510),i=n(42358),s=n(78152),a=(n(72577),n(81454),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(62953),n(96540)),l=n(6304),c=n(74891),d=n(83747),u=n(80590),p=n(94404),h=(n(42762),n(37550),n(4719)),g=n(55125),f=n(96175),x=n(14088),m=n(72491),b=n(45087),j=n(74848);const y=(0,o.default)(i.Flex).attrs({background:"modalBackground",backgroundOpacity:.6}).withConfig({displayName:"contextSearch__ModalContainer",componentId:"sc-93w1u0-0"})(["backdrop-filter:blur(8px);"]),v=(0,a.memo)((e=>{let{parentIds:t,allFilters:n,onGoToParent:r}=e;const o=(0,a.useMemo)((()=>(null===t||void 0===t?void 0:t.find((e=>n[e]&&Object.keys(n[e]).length>0)))||null),[t,n]),s=(0,h.b)(o);if(!o||!s)return null;const l=s.shortName||s.name||"parent section";return(0,j.jsx)(b.A,{content:"Go to ".concat(l),align:"bottom",children:(0,j.jsx)(i.IconButton,{icon:"arrowUp",flavour:"borderless",onClick:()=>r(o),padding:[0],small:!0})})})),O=(0,a.memo)((e=>{let{menuId:t,parentIds:n,activeMenuId:r,onMenuChange:o}=e;const s=((e,t)=>{const n=(0,h.b)(e),r=(0,h.yy)(),o=(t||[]).map((e=>r[e])).filter(Boolean);return(0,a.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,j.jsx)(i.Menu,{value:r,items:s,onChange:o,dropProps:{align:{top:"bottom",left:"left"}},dropdownProps:{width:"200px"},caret:!0,padding:[0],small:!0})})),w=(0,a.memo)((e=>{let{menuId:t,onClose:n,flavour:r,parentIds:o,onGoToParent:s}=e;const[l,c]=(0,a.useState)(t),u=(0,h.b)(l),p=(0,g.X)(),{filters:w,addFilter:C,removeFilter:P,clearFilters:I}=(0,g.w)(null===u||void 0===u?void 0:u.contexts,l),{searchValue:A,setSearchValue:k,debouncedSearchValue:S,searchResults:D,isLoading:M,onSelectResult:T}=(0,x.A)(u,C,r),N=(e,t)=>w.some((n=>n.matchType===e&&n.value===t)),F=(e,t)=>{if(N(e,t.value)){const n=w.find((n=>n.matchType===e&&n.value===t.value));P(n)}else T(e,t)};return(0,j.jsx)(i.Layer,{onClickOutside:n,onEsc:n,children:(0,j.jsxs)(y,{column:!0,border:!0,round:1,width:{base:"600px",max:"100%"},overflow:"hidden","data-testid":"context-search-modal",children:[(0,j.jsxs)(i.Flex,{padding:[2,4],border:{side:"bottom"},alignItems:"center",justifyContent:"between",children:[(0,j.jsxs)(i.Flex,{alignItems:"center",gap:2,children:[(0,j.jsx)(i.Text,{color:"textLite",children:"Filter chart in"}),(null===o||void 0===o?void 0:o.length)>0?(0,j.jsx)(O,{menuId:t,parentIds:o,activeMenuId:l,onMenuChange:c}):(0,j.jsx)(i.TextSmall,{children:(null===u||void 0===u?void 0:u.name)||"this section"})]}),(0,j.jsx)(i.Flex,{alignItems:"center",gap:2,children:s&&(0,j.jsx)(v,{parentIds:o,allFilters:p,onGoToParent:s})})]}),(0,j.jsx)(i.Flex,{padding:[3],column:!0,border:{side:"bottom"},children:(0,j.jsx)(i.TextInput,{value:A,onChange:e=>k(e.target.value),placeholder:"Search dimensions, labels...","data-testid":"context-search-input",autoFocus:!0,iconLeft:(0,j.jsx)(i.Icon,{name:M?"loading":"search",color:"textLite",size:"small"}),width:"100%"})}),(0,j.jsxs)(i.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===D?"152px":D&&Object.keys(D).length>0?"400px":"199px",children:[null===D&&(0,j.jsx)(i.Flex,{column:!0,gap:3,padding:[3],flex:!0,children:(0,j.jsxs)(i.Flex,{column:!0,gap:2,children:[(0,j.jsxs)(i.Flex,{alignItems:"center",gap:2,children:[(0,j.jsx)(i.Icon,{name:"search",size:"small",color:"textLite"}),(0,j.jsx)(i.TextSmall,{color:"textLite",children:"Search charts based on dimensions, instances and labels"})]}),(0,j.jsxs)(i.Flex,{alignItems:"center",gap:2,children:[(0,j.jsx)(i.Icon,{name:"filter",size:"small",color:"textLite"}),(0,j.jsxs)(i.TextSmall,{color:"textLite",children:["Results are scoped to ",(null===u||void 0===u?void 0:u.name)||"this section"," charts"]})]})]})}),D&&Object.keys(D).length>0&&(0,j.jsx)(i.Flex,{column:!0,padding:[0,0,8],flex:!0,children:x.v.map((e=>{const t=D[e];return t&&0!==t.length?(0,j.jsxs)(i.Flex,{column:!0,children:[(0,j.jsx)(i.Flex,{padding:[2,4],alignItems:"center",position:"sticky",top:0,zIndex:2,children:(0,j.jsx)(i.TextSmall,{strong:!0,color:"textLite",children:e.charAt(0).toUpperCase()+e.slice(1)})}),"labels"===e?(0,j.jsx)(i.Flex,{column:!0,children:t.map(((t,n)=>(0,j.jsxs)(i.Flex,{column:!0,border:{side:"bottom"},children:[t.labelKey&&(0,j.jsx)(i.Flex,{padding:[1,6],alignItems:"center",position:"sticky",top:"30px",zIndex:1,children:(0,j.jsx)(i.TextMicro,{strong:!0,color:"textLite",children:t.labelKey})}),t.items.map(((t,n)=>{const r=!t.isTruncationNotice&&N(e,t.value);return(0,j.jsx)(i.Flex,{padding:[2,6],cursor:t.isTruncationNotice?"default":"pointer",background:r?"neutralHighlight":void 0,_hover:t.isTruncationNotice?{}:{background:"highlight"},onClick:t.isTruncationNotice?void 0:()=>F(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,j.jsxs)(i.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[(0,j.jsxs)(i.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,j.jsx)(i.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,j.jsx)(j.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,j.jsx)(b.A,{content:(0,j.jsxs)(d.A,{column:!0,gap:1,children:[(0,j.jsxs)(i.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," ","contexts:"]}),(0,j.jsx)(i.Flex,{flexWrap:!0,children:t.allContextTitles.map(((e,n)=>(0,j.jsxs)(i.TextSmall,{children:[e,n<t.allContextTitles.length-1?", ":""]},n)))})]}),plain:!0,children:(0,j.jsx)(i.TextMicro,{color:"textLite",children:t.sublabel})}):(0,j.jsx)(i.TextMicro,{color:"textLite",children:t.sublabel})})]}),r&&(0,j.jsx)(i.Icon,{name:"check",size:"small",color:"primary"})]})},"".concat(e,"-").concat(t.value,"-").concat(n))}))]},n)))}):(0,j.jsx)(i.Flex,{column:!0,children:t.map(((t,n)=>{const r=!t.isTruncationNotice&&N(e,t.value);return(0,j.jsx)(i.Flex,{padding:[2,4],cursor:t.isTruncationNotice?"default":"pointer",background:r?"neutralHighlight":void 0,_hover:t.isTruncationNotice?{}:{background:"highlight"},onClick:t.isTruncationNotice?void 0:()=>F(e,t),opacity:t.isTruncationNotice?.7:1,children:(0,j.jsxs)(i.Flex,{gap:1,alignItems:"center",overflow:"hidden",flex:!0,children:[(0,j.jsxs)(i.Flex,{gap:.5,column:!0,overflow:"hidden",flex:!0,children:[(0,j.jsx)(i.TextSmall,{truncate:!0,children:t.label}),t.sublabel&&(0,j.jsx)(j.Fragment,{children:t.allContextTitles&&t.allContextTitles.length>2?(0,j.jsx)(b.A,{content:(0,j.jsxs)(d.A,{column:!0,gap:1,children:[(0,j.jsxs)(i.TextSmall,{strong:!0,children:["Found in ",t.allContextTitles.length," contexts:"]}),(0,j.jsx)(i.Flex,{flexWrap:!0,children:t.allContextTitles.map(((e,n)=>(0,j.jsxs)(i.TextSmall,{children:[e,n<t.allContextTitles.length-1?", ":""]},n)))})]}),plain:!0,children:(0,j.jsx)(i.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})}):(0,j.jsx)(i.TextMicro,{color:"textLite",truncate:!0,children:t.sublabel})})]}),r&&(0,j.jsx)(i.Icon,{name:"check",size:"small",color:"primary"})]})},"".concat(e,"-").concat(t.value,"-").concat(n))}))})]},e):null}))}),!M&&""!==S.trim()&&null!==D&&0===Object.keys(D).length&&(0,j.jsxs)(i.Flex,{padding:[6,3],justifyContent:"center",alignItems:"center",column:!0,gap:2,flex:!0,children:[(0,j.jsx)(i.Icon,{name:"search",size:"medium",color:"textLite"}),(0,j.jsx)(i.TextSmall,{color:"textLite",children:"No results found"}),(0,j.jsx)(i.TextMicro,{color:"textLite",children:"Try different search terms"})]}),w.length>0&&(0,j.jsxs)(i.Flex,{column:!0,gap:2,padding:[3,3,0],border:{side:"top"},position:"sticky",bottom:0,zIndex:99,children:[(0,j.jsxs)(i.Flex,{justifyContent:"between",alignItems:"center",children:[(0,j.jsxs)(i.TextMicro,{strong:!0,children:["Active Filters (",w.length,")"]}),w.length>0&&(0,j.jsx)(i.Button,{label:"Clear All",flavour:"borderless",onClick:I,"data-testid":"context-search-clear-all",padding:[0],small:!0})]}),(0,j.jsx)(m.A,{gap:2,padding:[0,0,3],children:w.map(((e,t)=>(0,j.jsx)(f.A,{matchType:e.matchType,value:e.label,sublabel:e.sublabel,onRemove:()=>P(e)},"".concat(e.matchType,"-").concat(e.value,"-").concat(t))))})]})]})]})})}));var C=n(33962),P=n(49163),I=n(63928),A=n(95565),k=n(1444);function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const M=(0,u.A)((0,c.A)(i.Flex)),T=(0,p.A)((0,c.A)(i.IconButton)),N=(0,a.memo)((e=>{let{menuId:t,menuName:n,contexts:r}=e;const{filters:o}=(0,g.w)(r,t);return o&&0!==o.length?(0,j.jsxs)(i.Flex,{column:!0,children:[(0,j.jsxs)(i.TextMicro,{color:"textLite",children:["Filters in ",n," (",o.length,")"]}),(0,j.jsx)(i.Flex,{column:!0,children:o.map((e=>(0,j.jsxs)(i.TextSmall,{children:[e.matchType,": ",(0,j.jsx)(i.Text,{strong:!0,children:e.label})]},"".concat(e.matchType,"-").concat(e.label))))})]}):null})),F=(0,a.memo)((e=>{let{parentIds:t}=e;return t&&0!==t.length?(0,j.jsx)(i.Flex,{column:!0,gap:1,children:t.map((e=>{const t=(0,h.b)(e);return t?(0,j.jsx)(N,{menuId:e,menuName:t.shortName||t.name||e,contexts:t.contexts},e):null}))}):null})),E=(0,a.memo)((e=>{let{menuId:t,menuName:n,flavour:r,parentIds:o}=e;const s=(0,h.b)(t),c=(0,g.X)(),u=(0,C.Ud)(),[p,,f,x]=(0,l.A)(),m=new Set;c[t]&&Object.values(c[t]).forEach((e=>{Array.isArray(e)&&e.forEach((e=>{m.add("".concat(e.matchType,"-").concat(e.value))}))}));const b=m.size,y=new Set;o&&o.forEach((e=>{const t=c[e];t&&Object.values(t).forEach((e=>{Array.isArray(e)&&e.forEach((e=>{y.add("".concat(e.matchType,"-").concat(e.value))}))}))}));const v=y.size,O=b>0,P=v>0,I=O||P,A=I?{side:"all",color:O?"primary":"border",width:"1px"}:void 0,k=(0,a.useCallback)((e=>{u(e),x()}),[u,x]),S=(0,a.useMemo)((()=>O||P?(0,j.jsxs)(d.A,{column:!0,gap:2,children:[(0,j.jsx)(N,{menuId:t,menuName:n,contexts:null===s||void 0===s?void 0:s.contexts}),(0,j.jsx)(F,{parentIds:o})]}):"Search in ".concat(n)),[O,P,t,n,null===s||void 0===s?void 0:s.contexts,o]);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(M,{position:"relative",tooltip:S,payload:{menuId:t},children:(0,j.jsx)(i.Flex,{alignItems:"center",gap:.5,children:I?(0,j.jsxs)(i.Flex,{onClick:f,cursor:"pointer",border:A,round:!0,alignItems:"center",padding:[0,.5],children:[(0,j.jsx)(i.IconButton,{icon:"filterList",flavour:"borderless",padding:[0],"data-testid":"context-search-button","data-active":O,"data-indeterminate":P,height:"16px",width:"16px"}),v>0&&(0,j.jsx)(i.TextMicro,{color:"textLite",strong:!0,padding:[0,1],children:v}),b>0&&(0,j.jsx)(i.TextMicro,{color:"primary",strong:!0,padding:[0,1],children:b})]}):(0,j.jsx)(i.Flex,{opacity:0,_hover:{opacity:1},transition:"opacity 0.2s ease",children:(0,j.jsx)(i.IconButton,{icon:"filterList",onClick:f,flavour:"borderless",padding:[0],"data-testid":"context-search-button","data-active":O,"data-indeterminate":P,height:"16px",width:"16px"})})})}),p&&(0,j.jsx)(w,{menuId:t,onClose:x,flavour:r,parentIds:o,onGoToParent:k})]})})),L={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,j.jsxs)(i.Flex,{column:!0,gap:1,children:[(0,j.jsx)(i.Text,{children:"Favourites can be saved only on a paid plan."}),(0,j.jsx)(A.A,{children:(0,j.jsx)(i.Text,{color:"primary",children:"Upgrade for no limitations!"})})]}),default:null},R=(0,a.memo)((e=>{var t;let{menuId:n,menuName:r,flavour:o}=e;const[i,,s,c]=(0,l.A)(),d=null===(t=(0,P._)({params:{type:["favourites"],path:["/".concat(o)],entity:n}}).find((e=>{let{entity:t}=e;return t===n})))||void 0===t?void 0:t.id,u=!!d,p=(0,I.yK)({onResolve:c}),h=(0,I.z2)(d,{onResolve:c}),{disabled:g,reason:f}=(0,k.A)(),x=(0,a.useCallback)((()=>{g||(s(),u?h():p({type:"favourites",entity:n,path:"/".concat(o),value:{menuId:n,sortOrder:Date.now()}}))}),[g,u,h,p,n,o,s]),m=(0,a.useMemo)((()=>D({tooltip:g&&f?L[f]||L.default:u?"Remove ".concat(r," from your favourites"):"Add ".concat(r," to your favourites"),disabled:i||g},"FreePlan"===f?{tooltipProps:{align:"bottom",activateOn:"hover",isBasic:!0,allowHoverOnTooltip:!0}}:{})),[u,i,r,g,f]);return(0,j.jsx)(T,D({icon:u?"heart":"heart_hollow",onClick:x,disabled:i||g,flavour:"borderless",padding:[0],"data-testid":"toggle-favourite-button","data-active":u,payload:{menuId:n},height:"12px",width:"12px"},m))}));function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?B(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const H=(0,o.default)(i.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: ".concat((0,i.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e),";\n fill: ").concat((0,i.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e),";\n\n svg,\n path {\n fill: ").concat((0,i.getColor)(e.hasCharts?"textNoFocus":["transparent","full"])(e),";\n }\n ")),(0,i.getColor)("textLite"),(0,i.getColor)("textLite"),(0,i.getColor)("textLite"),(0,i.getColor)("primary"),(0,i.getColor)("primary"),(0,i.getColor)("primary"),(0,i.getColor)("text"),(0,i.getColor)("text"),(0,i.getColor)("text"),(0,i.getColor)("accent"),(0,i.getColor)("accent"),(0,i.getColor)("accent")),_=e=>{let{children:t,menuId:n,menuName:r,flavour:o,parentIds:a,hasCharts:l,hasFilters:c=s.af}=e;return(0,j.jsxs)(H,{alignItems:"center",justifyContent:"between",hasCharts:l,gap:1,children:[t,(0,j.jsxs)(i.Flex,{alignItems:"center",gap:1,children:[c&&(0,j.jsx)(E,{menuId:n,menuName:r,flavour:o,parentIds:a}),(0,j.jsx)(R,{menuId:n,menuName:r,flavour:o})]})]})},z=e=>t=>{var n,r;return t.enableFavourites&&null!==(n=t.contexts)&&void 0!==n&&n.length?(0,j.jsx)(_,{menuId:t._id,menuName:t.name,flavour:t.flavour,parentIds:t.parentIds,hasCharts:!(null===(r=t.selfChartIds)||void 0===r||!r.length),children:(0,j.jsx)(e,V({},t))}):(0,j.jsx)(e,V({},t))}},41579(e,t,n){n.d(t,{A:()=>u});n(26910),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),null!==r&&void 0!==r&&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}},31035(e,t,n){n.d(t,{$:()=>p,A:()=>h});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 p=e=>"spaces.".concat(e,".members"),h=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])),h=(0,u.JT)("user:ReadAll");(0,i.A)((()=>({key:p(e),autorun:!!e&&h,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,h])}},50916(e){e.exports=(e,t,n,r,o)=>{const i=o-r;if(0===i)return[];const s=n*Math.cos(r)+e,a=n*Math.sin(r)+t,l=n*Math.cos(o)+e,c=n*Math.sin(o)+t;return[["M",s,a],["A",n,n,0,Math.abs(i)<=Math.PI?"0":"1",i<0?"0":"1",l,c]]}},27891(e,t,n){n.d(t,{A:()=>l});var r=n(12897),o=n.n(r),i=n(55042),s=n.n(i),a=new(o())({id:"save",use:"save-usage",viewBox:"0 0 12 12",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" id="save"><path d="M10 0H2v.01C.89.04 0 .94 0 2.06v7.9c0 1.13.92 2.05 2.05 2.05h7.9c1.13 0 2.05-.92 2.05-2.05V2zM3.5 1.5h5v3h-5zm4 9h-3v-2h3zm3-.55c0 .3-.25.55-.55.55H9V7H3v3.5h-.95c-.3 0-.55-.25-.55-.55v-7.9c0-.29.22-.51.5-.54V6h8V2.12l.5.5z" /></symbol>'});s().add(a);const l=a}}]);