diff options
Diffstat (limited to 'web/gui/v2/5100.70bf09de4a0223d97932.chunk.js')
-rw-r--r-- | web/gui/v2/5100.70bf09de4a0223d97932.chunk.js | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/web/gui/v2/5100.70bf09de4a0223d97932.chunk.js b/web/gui/v2/5100.70bf09de4a0223d97932.chunk.js deleted file mode 100644 index b56dde442..000000000 --- a/web/gui/v2/5100.70bf09de4a0223d97932.chunk.js +++ /dev/null @@ -1 +0,0 @@ -!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e073a29c-fd8e-4724-8d9c-9c0d3b9bac7c",e._sentryDebugIdIdentifier="sentry-dbid-e073a29c-fd8e-4724-8d9c-9c0d3b9bac7c")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"8b7b01b6c705cf50f8050ce0fb8fc6b58fe68567"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[5100],{95665:function(e,t,n){n.d(t,{Z:function(){return Be}});var r=n(87462),o=n(29439),a=n(45987),i=(n(66992),n(41539),n(33948),n(92222),n(67294)),l=n(65565),c=n(28789),u=n(69119),s=n(83894),d=n(93416),m=n(92432),f=n(46667),p=n(23109),g=(n(21249),n(57640),n(9924),n(47941),n(82526),n(57327),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(4942)),v=n(71893);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var b=(0,v.default)(d.Flex).attrs((function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,g.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({position:"relative",width:{min:200},height:{min:45},column:!0,background:"dropdown",color:"text",zIndex:60,round:!0,alignItems:"end"},e)})).withConfig({displayName:"styled__PickerBox",componentId:"sc-gwjt9o-0"})([""]),y=v.default.span.withConfig({displayName:"styled__StyledTimePeriod",componentId:"sc-gwjt9o-1"})(["margin-bottom:",";cursor:pointer;width:187px;height:",";&:last-of-type{margin-bottom:0;}& > span:hover{color:",";}"],(0,d.getSizeBy)(1.5),(0,d.getSizeBy)(2),(0,d.getColor)("textLite")),w=(0,v.default)(d.Flex).attrs((function(e){return{color:e.isSelected?"primary":"text",margin:[2,6,0]}})).withConfig({displayName:"styled__StyledCustomTimePeriod",componentId:"sc-gwjt9o-2"})(["cursor:pointer;&:first-of-type{margin-top:0;}&:hover{color:",";}"],(0,d.getColor)("textLite")),E=(0,v.default)(d.Flex).attrs({alignItems:"center",border:{side:"all",color:"border"},color:"text",flexWrap:!1,height:8,justifyContent:"center",padding:[2,0],round:1,width:22}).withConfig({displayName:"styled__TimePeriodDropdownButton",componentId:"sc-gwjt9o-3"})([""]),C=(0,v.default)(d.Drop).attrs({background:"mainBackground",column:!0,overflow:{vertical:"auto"},margin:[.5,0,0],padding:[2,0],round:1}).withConfig({displayName:"styled__TimePeriodDrop",componentId:"sc-gwjt9o-4"})([""]),x=(0,v.default)(d.Icon).withConfig({displayName:"styled__DropdownIcon",componentId:"sc-gwjt9o-5"})(["fill:",";width:12px;height:12px;"],(0,d.getColor)("text")),O=v.default.input.withConfig({displayName:"styled__CustomInput",componentId:"sc-gwjt9o-6"})(["border:1px solid ",";background:",";box-sizing:border-box;border-radius:4px;color:",";height:32px;margin-left:10px;margin-right:10px;outline:none;padding:4px;width:32px;&:focus{border:1px solid ",";}"],(0,d.getColor)("border"),(0,d.getColor)("mainBackground"),(0,d.getColor)("text"),(0,d.getColor)("primary")),k=(0,v.default)(d.Drop).attrs({background:"dropdown",round:2,margin:[.5,0,0],border:{side:"all",color:"borderSecondary"},animation:!0}).withConfig({displayName:"styled__StyledDrop",componentId:"sc-gwjt9o-7"})([""]),Z=(0,v.default)(d.TextInput).withConfig({displayName:"styled__StyledDateInput",componentId:"sc-gwjt9o-8"})(["width:100%;"]),S=v.default.div.withConfig({displayName:"styled__StyledCalendar",componentId:"sc-gwjt9o-9"})(["background:",";border:0;&.react-datepicker{background:",";border:0;}.react-datepicker{&__navigation{top:8px;&-icon::before{border-color:",";}}&__month-container{height:260px;}&__header{background:",";border:0;.react-datepicker__current-month{color:",";font-weight:normal;}.react-datepicker__day-name{color:",";}}&__day{color:",";&:hover{background:",";}&--disabled{color:",";&:hover{background:inherit;}}&--keyboard-selected,&--keyboard-selected:hover{color:",";background:inherit;border-radius:inherit;}&--selected,&--selected:hover{color:",";background:",";border-radius:8px;}&--in-selecting-range,&--in-range{color:",";background:",";border-radius:0;}&--selecting-range-start,&--range-start{color:",";background:",";border-top-left-radius:8px;border-bottom-left-radius:8px;&:hover{color:",";background:",";border-radius:0;border-top-left-radius:8px;border-bottom-left-radius:8px;}}&--selecting-range-end,&--range-end{color:",";background:",";border-top-right-radius:8px;border-bottom-right-radius:8px;&:hover{color:",";background:",";border-top-right-radius:8px;border-bottom-right-radius:8px;}}}}"],(0,d.getColor)("dropdown"),(0,d.getColor)("dropdown"),(0,d.getColor)("text"),(0,d.getColor)("dropdown"),(0,d.getColor)("main"),(0,d.getColor)("textLite"),(0,d.getColor)("main"),(0,d.getColor)("elementBackground"),(0,d.getColor)("textLite"),(0,d.getColor)("main"),(0,d.getColor)("bright"),(0,d.getColor)("primary"),(0,d.getColor)("primary"),(0,d.getColor)("elementBackground"),(0,d.getColor)("bright"),(0,d.getColor)("primary"),(0,d.getColor)("bright"),(0,d.getRgbColor)(["green","netdata"],.8),(0,d.getColor)("bright"),(0,d.getColor)("primary"),(0,d.getColor)("bright"),(0,d.getRgbColor)(["green","netdata"],.8)),P=function(e){var t=e.value,n=e.period,r=e.resolution,o=e.isSelected,a=e.setTimeRange,l=e.tagging,c=(0,i.useCallback)((function(){return a(t,r)}),[t,r]);return i.createElement(y,{key:t,onClick:c,"data-ga":"date-picker::click-quick-selector::".concat(l,"::").concat(-t),"data-testid":"timePeriod-value"},i.createElement(d.Text,{color:o?"primary":"text"},n))},I=(0,i.memo)(P),j=(n(39714),n(83112),n(66528),n(29422)),D=n(99982),N=n(49546),T=n(38431),F=n(76417),M=n(12195),_=60,L=3600,A=86400,B=["minutes","hours","days","months"],R={minutes:_,hours:L,days:A,months:2592e3},V=function(e,t){return Math.round(e/R[t])},U=function(e,t){var n=(0,j.Z)(new Date(0),(0,g.Z)({},t,e));return-(0,D.Z)(n)},z={startDate:"start",endDate:"finish"},H=[{period:"Last 5 minutes",value:-300,resolution:"minutes"},{period:"Last 10 minutes",value:-600,resolution:"minutes"},{period:"Last 15 minutes",value:-900,resolution:"minutes"},{period:"Last 30 minutes",value:-1800,resolution:"minutes"},{period:"Last hour",value:-3600,resolution:"hours"},{period:"Last 2 hours",value:-7200,resolution:"hours"},{period:"Last 6 hours",value:-21600,resolution:"hours"},{period:"Last 12 hours",value:-43200,resolution:"hours"},{period:"Last day",value:-A,resolution:"days"},{period:"Last 2 days",value:-2*A,resolution:"days"},{period:"Last 7 days",value:-7*A,resolution:"days"}],W=function(e,t){var n=(0,T.Z)(e,"MMMM d yyyy, H:mm")?e:(0,F.default)(e,"MMMM d yyyy, H:mm",Date.now());return(0,F.default)("".concat(n," ").concat(function(e){if(!e)return"+00:00";var t=e.toString().split("."),n=t[0]>0?"+":"-",r=Math.abs(t[0]).toString(),o="".concat(n).concat(r.padStart(2,0));return t.length>1?"".concat(o,":").concat(String(.6*t[1]).padEnd(2,0)):"".concat(o,":00")}(t)),"MMMM d yyyy, H:mm xxx",Date.now())},G=function(e){var t=e.handleTimePeriodChange,n=e.selectedDate,r=e.tagging;return i.createElement(d.Flex,{column:!0,justifyContent:"start",alignItems:"start",height:{max:"260px"},overflow:{vertical:"auto"},"data-testid":"timePeriods"},H.map((function(e){var o=e.period,a=e.value,l=e.resolution;return i.createElement(I,{key:a,value:a,period:o,resolution:l,setTimeRange:t,isSelected:n===a,tagging:r})})))},K=(n(9653),n(33161),n(12274)),J=function(e){var t=e.customTimePeriodRef,n=e.handleTimePeriodChange,r=e.value,a=e.resolution,l=e.tagging,c=function(){return r<=0?V(-r,a):0},u=(0,i.useState)(c),s=(0,o.Z)(u,2),m=s[0],p=s[1],v=(0,f.Z)(),h=(0,o.Z)(v,4),b=h[0],y=h[1],k=h[3],Z=(0,i.useRef)();(0,i.useEffect)((function(){return p(c())}),[r]);var S=(0,i.useCallback)((function(e){return p(e.target.value)}),[]),P=(0,i.useCallback)((function(e){var t=Number(e.currentTarget.value),o=!Number.isNaN(t)&&Number.isInteger(t)&&t>0,i=(0,j.Z)(new Date(0),(0,g.Z)({},a,t));return o&&(0,K.default)(i)&&(0,D.Z)(i)<=94694400?n(U(t,a),a):p(r<=0?V(-r,a):0)}),[a,m]),I=(0,i.useCallback)((function(e){return function(){n(U(m,e),e),k()}}),[m]);return i.createElement(d.Flex,{justifyContent:"start",alignItems:"center",height:8,"data-ga":"date-picker::click-last-integer::".concat(l),"data-testid":"customTimePeriod"},i.createElement(d.Text,{"data-testid":"customTimePeriod-label"},"Last"),i.createElement(O,{value:m,onChange:S,onBlur:P,"data-ga":"date-picker::click-last-integer::".concat(l,"::").concat(m),"data-testid":"timePeriod-timeInput"}),i.createElement(E,{"data-testid":"timePeriodDropdown-button",onClick:y,ref:Z},i.createElement(d.Text,{"data-testid":"timePeriodDropdown-buttonLabel",padding:[0,4,0,0]},a),i.createElement(x,{"data-testid":"timePeriodDropdown-buttonIcon",name:"triangle_down"})),Z.current&&b&&i.createElement(C,{align:{top:"bottom",left:"left"},animation:!0,close:k,"data-testid":"timePeriodDropdown",onClickOutside:k,onEsc:k,ref:t,target:Z.current},B.map((function(e){return i.createElement(w,{key:e,onClick:I(e),"data-ga":"date-picker::click-last-time-".concat(e,"::").concat(l),"data-testid":"timePeriod-option"},e)}))))},Y=n(313),q=n(89405),Q=n(9198),$=n.n(Q),X=(n(59061),function(e){var t=e.selected,n=e.selectsStart,r=void 0!==n&&n,o=e.selectsEnd,a=void 0!==o&&o,l=e.startDate,c=e.endDate,u=e.onChange,s=e.minDate,d=e.maxDate,m=e.dateFormat,f=void 0===m?"MM/dd/yyyy":m,p=e.open,g=void 0!==p&&p,v=e.startOpen,h=void 0!==v&&v,b=e.inline,y=void 0!==b&&b,w=e.selectsRange,E=void 0!==w&&w,C=e.monthsShown,x=void 0===C?1:C,O=e.showPopperArrow,k=void 0===O||O,Z=e.calendarContainer,S=void 0===Z?null:Z;return i.createElement($(),{selected:t,onChange:u,selectsStart:r,selectsEnd:a,startDate:l,endDate:c,minDate:s,maxDate:d,dateFormat:f,open:g,startOpen:h,inline:y,selectsRange:E,monthsShown:x,showPopperArrow:k,calendarContainer:S})}),ee=function(e){var t=e.name,n=void 0===t?"":t,r=e.value,a=void 0===r?"":r,l=e.onDatesChange,u=e.onFocus,s=e.placeholderText,d=void 0===s?"":s,m=(0,q.rA)().utcOffset,f=(0,i.useState)(""),p=(0,o.Z)(f,2),g=p[0],v=p[1],h=(0,i.useCallback)((function(e){var t=e.target.value;v(t)}),[]),b=(0,i.useCallback)((function(e){if((0,K.default)(e)){var t=(0,N.default)(e,"MMMM d yyyy, H:mm");v(t)}}),[]),y=(0,i.useCallback)((function(e){var t=W(e.target.value,m);if((0,K.default)(t)&&(0,c.default)(t)>0){var n=(0,c.default)(t);l(n,(function(){return b(a)}))}else b(a)}),[a,m]);return(0,i.useEffect)((function(){return b(a)}),[a]),i.createElement(Z,{type:"text",name:n,value:a?g:d,onChange:h,onBlur:y,onFocus:u,placeholder:d,"data-testid":"datePicker-input"})},te=n(19013),ne=function(){var e=(0,q.rA)(),t=e.localeTimeString,n=e.localeDateString;return(0,i.useCallback)((function(e){return"".concat(n(e,{locale:"en-us",long:!1})," ").concat(t(e,{locale:"en-us",secs:!1}))}),[t,n])},re=function(e,t){return e>0?(0,te.default)(new Date(t(e))):e||0===e?(0,te.default)(new Date(t((new Date).valueOf()+1e3*e))):null},oe=function(e){var t=ne();return(0,i.useMemo)((function(){return re(e,t)}),[e])},ae=function(e,t){return[oe(e),oe(t)]};function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var le=function(e){var t=e.startDate,n=e.setStartDate,a=e.endDate,l=e.setEndDate,u=e.singleDate,s=e.onDatesChange,m=e.onInputFocus,f=e.onlyDates,p=e.maxDate,v=void 0===p?new Date:p,h=e.minDate,b=void 0===h?new Date("1/1/2018"):h,y=e.isSinglePicker,w=ae(t,a),E=(0,o.Z)(w,2),C=E[0],x=E[1],O=oe(u),k=(0,q.rA)().utcOffset,Z=ne(),P=(0,i.useCallback)((function(e,t){return(0,Y.default)(re(e,Z),x)?n(e):t()}),[a,Z]),I=(0,i.useCallback)((function(e,t){return(0,Y.default)(C,re(e,Z))?l(e):t()}),[t,Z]),j=(0,i.useCallback)((function(e){var t=Array.isArray(e)?e[0]:e,n=Array.isArray(e)?e[1]:null,r=t?W((0,N.default)(t,"MMMM d yyyy, H:mm"),k):t,o=n?W((0,N.default)(n,"MMMM d yyyy, H:mm"),k):n,a=(0,c.default)(r)||null,i=(0,c.default)(o)||null;s(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach((function(t){(0,g.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},y?{singleDate:a}:{startDate:a,endDate:i}))}),[k]);return i.createElement(d.Flex,{column:!0,justifyContent:"center",alignItems:"center",flex:!0,gap:3,"data-testid":"datePicker-wrapper"},i.createElement(X,(0,r.Z)({selected:y?O:C,onChange:j},y?{}:{startDate:C,endDate:x},{maxDate:v,minDate:b,inline:!0,selectsRange:!0,monthsShown:y?1:2,dateFormat:"MMMM d yyyy, H:mm",showPopperArrow:!1,calendarContainer:S})),!f&&(y?i.createElement(ee,{name:"date",value:O,onDatesChange:j,placeholderText:"Select a date"}):i.createElement(d.Flex,{justifyContent:"around",alignItems:"center",width:"100%",gap:2,padding:[0,10]},i.createElement(ee,{name:"startDate",value:C,onDatesChange:P,onFocus:m,placeholderText:"Select a start date"}),i.createElement(ee,{name:"endDate",value:x,onDatesChange:I,onFocus:m,placeholderText:"Select an end date"}))))},ce=function(e){var t=e.startDate,n=e.endDate,r=e.onlyDates,a=ae(t,n),l=(0,o.Z)(a,2),u=l[0],s=l[1],m=(0,i.useMemo)((function(){return function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).onlyDates?"MMMM d yyyy":"MMMM d yyyy, H:mm:ss";return{formattedStartDate:(0,N.default)(e,n),formattedEndDate:(0,N.default)(t,n)}}(u,s,{onlyDates:r})}),[u,s]),f=m.formattedStartDate,p=m.formattedEndDate,g=(0,i.useMemo)((function(){return function(e,t){return(0,M.Z)((0,c.default)(e),(0,c.default)(t))}(u,s)}),[u,s]);return i.createElement(d.Flex,{alignItems:"center",gap:2},i.createElement(d.Flex,{alignItems:"center",justifyContent:"center",gap:1.5},i.createElement(d.TextSmall,{strong:!0,whiteSpace:"nowrap"},"From"),i.createElement(d.TextSmall,{whiteSpace:"nowrap","data-testid":"periodIndication-from"},f)),i.createElement(d.Icon,{name:"arrow_left",size:"small",color:"textLite",rotate:2}),i.createElement(d.Flex,{alignItems:"center",justifyContent:"center",gap:1.5},i.createElement(d.TextSmall,{strong:!0,whiteSpace:"nowrap"},"To"),i.createElement(d.TextSmall,{whiteSpace:"nowrap","data-testid":"periodIndication-to"},p)),i.createElement(d.Flex,{alignItems:"center",justifyContent:"center",gap:2},i.createElement(d.TextSmall,{whiteSpace:"nowrap"},"/"),i.createElement(d.TextSmall,{color:"textLite",whiteSpace:"nowrap","data-testid":"periodIndication-period"},g)))},ue=n(2379),se=(n(85827),n(26699),n(3151)),de=n(33926),me=36e5,fe=864e5,pe=2592e6,ge=[{key:"years",value:31104e6,unit:"y"},{key:"months",value:pe,unit:"m"},{key:"days",value:fe,unit:"d"},{key:"hours",value:me,unit:"h"},{key:"minutes",value:6e4,unit:"min"},{key:"seconds",value:1e3,unit:"s"}],ve=["hours","minutes","seconds"],he=function(e){var t=e.placeholder,n=void 0===t?"No date":t;return i.createElement(d.TextSmall,null,n)},be=function(e){var t=e.isPlaying,n=e.startDate,r=e.endDate,o=e.isSameDate,a=e.color,l=e.onlyDates,c=e.isSinglePicker,u=(0,q.rA)(),s=u.localeTimeString,m=u.localeDateString,f=a||(t?"accent":"textFocus");return i.createElement(d.Flex,{gap:1},i.createElement(d.TextSmall,{color:a,whiteSpace:"nowrap"},m(n,{long:!1}),!l&&i.createElement(i.Fragment,null," ","\u2022"," ",i.createElement(d.TextSmall,{color:f,whiteSpace:"nowrap"},s(n,{secs:!1})))),!c&&i.createElement(i.Fragment,null,(!l||!o)&&i.createElement(d.Icon,{name:"arrow_left",color:f,size:"small",rotate:2}),i.createElement(d.TextSmall,{color:a,whiteSpace:"nowrap"},!o&&i.createElement(i.Fragment,null,m(r,{long:!1})," \u2022 "),!l&&i.createElement(d.TextSmall,{color:f,whiteSpace:"nowrap"},s(r,{secs:!1})))))},ye=function(e){var t=e.isPlaying,n=e.duration,r=e.color,o=e.fluid,a=void 0!==o&&o,l=e.isSmall,c=void 0!==l&&l;return i.createElement(d.Flex,{gap:c?.2:1,align:"center"},!c&&i.createElement(d.TextSmall,{color:r},"\u2022"),i.createElement(d.Flex,{width:a?"auto":5},t&&i.createElement(d.TextSmall,{color:r},"last")),i.createElement(d.TextSmall,{color:r},n))},we=n(82351),Ee=(0,v.default)(d.Flex).withConfig({displayName:"styled__Container",componentId:"sc-1s7311w-0"})(["cursor:pointer;&:hover *{color:",";fill:",";}"],(0,d.getColor)("textLite"),(0,d.getColor)("textLite")),Ce=(0,v.default)(we.Z).withConfig({displayName:"styled__StyledTooltip",componentId:"sc-1s7311w-1"})(["pointer-events:",";"],(function(e){return e.isDisabled?"none":"auto"})),xe=["onClick","start","end","isPlaying","isPickerOpen","tagging","color","fluid","onlyDates","tooltipContent","isSinglePicker","noDateSelected","isSmall"],Oe=(0,i.forwardRef)((function(e,t){var n=e.onClick,l=e.start,c=e.end,u=e.isPlaying,s=e.isPickerOpen,d=e.tagging,m=e.color,f=e.fluid,p=e.onlyDates,g=e.tooltipContent,v=e.isSinglePicker,h=e.noDateSelected,b=e.isSmall,y=(0,a.Z)(e,xe),w=(0,ue.IX)(),E=(0,i.useMemo)((function(){if(h)return[];var e=function(e){return e<0?(0,j.Z)(new Date,{seconds:e}):new Date(e)}(l),t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e?new Date(e):new Date}(c),n=function(e,t){return(0,se.default)(e,t)}(e,t);return[e,t,n]}),[l,c,h]),C=(0,o.Z)(E,3),x=C[0],O=C[1],k=C[2],Z=(0,i.useMemo)((function(){return h?0:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.withSeconds,r=void 0!==n&&n,o=t.withTime,a=void 0===o||o,i=r||!!e.seconds;return ge.reduce((function(t,n){var r=n.key,o=n.unit;return"seconds"!==r||i?!a&&ve.includes(r)?t:e[r]?t?"".concat(t," ").concat(e[r]).concat(o):"".concat(e[r]).concat(o):t:t}),"")}(function(e,t){return(0,de.Z)({start:e,end:t})}(x,O),{withTime:!p})}),[u,x,O,h]);return i.createElement(Ce,{content:s?function(){}:g||"Select a predefined or a custom timeframe",align:"bottom",isDisabled:!n||w,plain:!0},i.createElement(Ee,(0,r.Z)({alignItems:"center",justifyContent:"center",gap:1,height:"100%",onClick:n,padding:[0,1],ref:t,"data-ga":"date-picker::click-time::".concat(d),"data-testid":"datePicker-accessorElement"},y),b?null:v&&h?i.createElement(he,null):i.createElement(be,{isPlaying:u,endDate:O,startDate:x,isSameDate:k,color:m,onlyDates:p,isSinglePicker:v}),!p&&!v&&!h&&i.createElement(ye,{isPlaying:u,duration:Z,color:m,fluid:b||f,isSmall:b})))})),ke=Oe,Ze=n(4822),Se=(n(32023),n(67622)),Pe=n(92517),Ie=(0,v.default)(d.Drop).attrs({align:{top:"bottom",left:"left"},animation:!0,background:"dropdown",column:!0,margin:[.5,0,0],overflow:{vertical:"auto"},padding:[2,0],round:1,width:80}).withConfig({displayName:"dropdown__Dropdown",componentId:"sc-pg99kg-0"})([""]),je=(0,v.default)(d.Flex).attrs({column:!0,padding:[2,0,0],overflow:{vertical:"auto"},height:{max:"320px"}}).withConfig({displayName:"container__Container",componentId:"sc-1gtygg6-0"})([""]),De=(0,v.default)(d.Flex).attrs({justifyContent:"between",alignItems:"center",width:"100%",gap:2}).withConfig({displayName:"wrapper__Wrapper",componentId:"sc-1ehauu1-0"})([""]),Ne=function(e){var t=e.name,n=e.offset,r=e.utc,o=e.onSelect,a=(0,i.useCallback)((function(){return o(r,n,t)}),[r,t]);return i.createElement(Se.Z,{round:1,onClick:a,Wrapper:De,"data-ga":"timezone-picker::click-timezone::global-view::".concat(t)},i.createElement(d.Text,{color:"text"},t),i.createElement(d.Text,{color:"textLite",whiteSpace:"nowrap"},"UTC ",n))},Te=n(14600),Fe=function(e){var t=e.value,n=e.onChange,r=e.timezoneRef,a=e.timezoneName,l=(0,i.useState)(""),c=(0,o.Z)(l,2),u=c[0],s=c[1],m=(0,f.Z)(),p=(0,o.Z)(m,2),g=p[0],v=p[1],h=(0,i.useRef)(),b=(0,i.useRef)();(0,i.useEffect)((function(){b.current&&g&&b.current.focus()}),[g]);var y=(0,i.useMemo)((function(){return u?Te.K.filter((function(e){var t=e.text,n=e.offset;return t.toUpperCase().includes(u.toUpperCase())||n.includes(u)})):Te.K}),[u]),w=function(){v(!1),s("")},E=(0,i.useCallback)((function(e,t,r){n(e,t,r),w()}),[]);return i.createElement(Pe.Z,{hasBorder:!1,testId:"timezone-picker"},i.createElement(Se.Z,{round:1,onClick:v,ref:h,Wrapper:De,padding:[2],"data-ga":"timezone-picker::click-picker::global-view",selected:!0},i.createElement(d.Flex,{gap:1},i.createElement(d.Text,{color:"text",whiteSpace:"nowrap"},a," UTC ",t)),i.createElement(d.Icon,{name:"chevron_down",color:"text",width:"12px",height:"12px"})),h.current&&g&&i.createElement(Ie,{onClickOutside:w,onEsc:w,ref:r,target:h.current},i.createElement(d.Box,{padding:[0,2]},i.createElement(d.SearchInput,{value:u,onChange:s,ref:b,"data-ga":"timezone-picker::click-search::global-view"})),i.createElement(je,null,y.map((function(e){var t=e.text,n=e.offset,r=e.utc;return i.createElement(Ne,{key:t,name:t,offset:n,utc:r[0],onSelect:E})})))))},Me=function(e){var t=e.timezoneRef,n=(0,Ze.I0)(),r=(0,o.Z)(n,2),a=r[0],l=a.offset,c=a.timezoneName,u=r[1],s=(0,i.useCallback)((function(e,t,n){return u({utc:e,offset:t,timezoneName:n})}),[]);return i.createElement(Fe,{timezoneRef:t,timezoneName:c,value:l,onChange:s})},_e=(n(68216),n(79433),["mousedown","touchstart"]),Le=n(91128),Ae=["onChange","isSinglePicker","values","defaultValue","tagging","isPlaying","onlyDates","accessorProps","maxDate","minDate","accessorTooltipContent","isSmall"],Be=function(e){var t=e.onChange,n=e.isSinglePicker,g=e.values,v=void 0===g?{}:g,h=v.start,y=v.end,w=v.singleDate,E=e.defaultValue,C=void 0===E?-900:E,x=e.tagging,O=void 0===x?"":x,Z=e.isPlaying,S=e.onlyDates,P=e.accessorProps,I=void 0===P?{}:P,j=e.maxDate,D=e.minDate,N=e.accessorTooltipContent,T=e.isSmall,F=(0,a.Z)(e,Ae),M=(0,i.useState)(w),_=(0,o.Z)(M,2),L=_[0],A=_[1],B=(0,i.useState)(h),R=(0,o.Z)(B,2),V=R[0],U=R[1],H=(0,i.useState)(h),W=(0,o.Z)(H,2),K=W[0],Y=W[1],q=(0,p.Z)("resolution","minutes"),Q=(0,o.Z)(q,2),$=Q[0],X=Q[1],ee=(0,i.useState)("startDate"),te=(0,o.Z)(ee,2),ne=te[0],re=te[1],oe=(0,f.Z)(),ae=(0,o.Z)(oe,4),ie=ae[0],ue=ae[1],se=ae[3],de=(0,i.useRef)(),me=(0,i.useState)(null),fe=(0,o.Z)(me,2),pe=fe[0],ge=fe[1],ve=(0,i.useState)(null),he=(0,o.Z)(ve,2),be=he[0],ye=he[1],we=(0,i.useState)(null),Ee=(0,o.Z)(we,2),Ce=Ee[0],xe=Ee[1],Oe=(0,Le.Z)();!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_e,n=arguments.length>2?arguments[2]:void 0,r=(0,i.useRef)();(0,i.useEffect)((function(){var o=function(t){Array.isArray(n)?n.every((function(e){return!e||!e.contains(t.target)}))&&e():r.current&&!r.current.contains(t.target)&&e()};return t.forEach((function(e){return document.addEventListener(e,o)})),function(){t.forEach((function(e){return document.removeEventListener(e,o)}))}}),[r,e,n])}(se,["mouseup","touchend"],[pe,be,Ce,de.current]),(0,l.Z)((function(){Oe(!!ie)}),[ie]);var Ze=(0,i.useCallback)((function(e){var t=e.startDate,n=e.endDate;U(t),Y(n)}),[]);(0,i.useEffect)((function(){Ze({startDate:h,endDate:y})}),[h,y]);var Se=(0,i.useCallback)((function(){n?(A(w),se()):Ze({startDate:C,endDate:0})}),[n]),Pe=(0,i.useCallback)((function(e){e.target.name&&re(e.target.name)}),[]),Ie=(0,i.useCallback)((function(e){e.stopPropagation(),ue()}),[ue]),je=function(){n?t(L):(t({start:V,end:K}),Oe(!1)),se()},De=(0,i.useMemo)((function(){return function(e){return z[e]}(ne)}),[ne]),Ne=!!n||null!==V&&null!==K&&V!==K,Te=!n&&(V===h&&K===y),Fe=(0,i.useMemo)((function(){return C}),[]),Be=V===Fe,Re=(0,i.useCallback)((function(e,t){X(t),Ze({startDate:e,endDate:0})}),[]),Ve=function(e){var r=e.startDate,o=e.endDate,a=e.singleDate;if(n)A(a),t(a),(0,m.L)("date-picker","click-date-picker",O,String(a));else{Ze(S?{startDate:r?(0,c.default)((0,u.default)(new Date(r))):r,endDate:o?(0,c.default)((0,s.default)(new Date(o))):o}:{startDate:r,endDate:o});var i="finish"===De?o||r:r||o;(0,m.L)("date-picker","click-date-picker",O,String(i))}},Ue=(0,i.useMemo)((function(){return de.current&&ie?i.createElement(k,{backdrop:!0,target:de.current,canHideTarget:!1,align:{top:"bottom",left:"left"},onEsc:se},i.createElement(b,(0,r.Z)({ref:ye,"data-testid":"datePicker"},F),i.createElement(d.Flex,{alignItems:"center",width:"100%",padding:S?[4]:[0,6]},!S&&!n&&i.createElement(d.Flex,{column:!0,gap:3,margin:[0,4,0,0],padding:[6,0],border:{side:"right",color:"borderSecondary"}},i.createElement(G,{handleTimePeriodChange:Re,selectedDate:V,tagging:O}),i.createElement(J,{handleTimePeriodChange:Re,customTimePeriodRef:ge,resolution:$,tagging:O,value:V})),i.createElement(le,{startDate:V,endDate:K,singleDate:L,setStartDate:U,setEndDate:Y,onDatesChange:Ve,onInputFocus:Pe,onlyDates:S,maxDate:j,minDate:D,isSinglePicker:n})),i.createElement(d.Flex,{column:!0,padding:[4,6,2],width:"100%",border:{side:"top",color:"borderSecondary"}},!S&&!n&&i.createElement(Me,{timezoneRef:xe}),i.createElement(d.Flex,{gap:1,justifyContent:n?"end":S?"center":Ne?"between":"end",width:"100%"},!S&&!n&&Ne&&i.createElement(ce,{startDate:V,endDate:K,onlyDates:S}),i.createElement(d.Flex,{alignItems:"center",justifyContent:"center",gap:1},i.createElement(d.Button,{label:"Clear",flavour:"hollow",onClick:Se,disabled:Be,"data-ga":"date-picker::click-clear::".concat(O,"-").concat(De),"data-testid":"datePicker-clear",small:!0}),i.createElement(d.Button,{label:"Apply",onClick:je,disabled:!Ne||Te,"data-ga":"date-picker::click-apply::".concat(O,"-").concat(De),"data-testid":"datePicker-apply",small:!0})))))):null}),[V,O,$,K,Ne,Be,De,Te,L,ie]);return i.createElement(i.Fragment,null,i.createElement(ke,(0,r.Z)({onClick:Ie,tagging:O,isPickerOpen:ie,isPlaying:Z,setRangeValues:t,start:n?L:h,end:n?L:y,ref:de,onlyDates:S,tooltipContent:N,isSinglePicker:n,noDateSelected:n&&!L,isSmall:T},I)),Ue)}},2379:function(e,t,n){n.d(t,{Cd:function(){return s},IX:function(){return l},RT:function(){return c},o8:function(){return u}});var r=n(89250),o=n(3322),a=n(54576),i={},l=function(){var e=(0,r.bS)("/spaces/:spaceSlug/rooms/:roomSlug/alerts"),t=(0,r.bS)("/spaces/:spaceSlug/rooms/:roomSlug/alerts/:alertId"),n=(0,r.bS)("/spaces/:spaceSlug/rooms/:roomSlug/home");return e||t||n},c=function(){var e=(0,r.bS)("/spaces/:spaceSlug/rooms/:roomSlug/functions"),t=((0,o.ZQ)({extraKey:"fn"})||i).hasHistory;return e&&!t},u=function(){return(0,r.bS)("/spaces/:spaceSlug/rooms/:roomSlug/events")},s=function(){var e=u(),t=(0,a.useAttributeValue)("autofetch");return!(0,a.useAttributeValue)("paused")&&t&&!e}},92432:function(e,t,n){n.d(t,{L:function(){return r}});var r=function(e,t,n,r,o){var a,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"gaCustomEvent";if(window.envSettings.tracking){if(window.dataLayer){var l={event:i,eventCategory:e,eventAction:t,eventLabel:n,eventValue:r,eventResults:o};window.dataLayer.push(l)}window.gtag&&window.gtag("event","gaCustomEvent",{eventCategory:e,eventAction:t,eventLabel:n,eventValue:r,eventResults:o}),null!==(a=window.posthog)&&void 0!==a&&a.__loaded&&window.posthog.capture(i,{eventCategory:e,eventAction:t,eventLabel:n,eventValue:r})}}},39979:function(e,t,n){n.d(t,{Z:function(){return v}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(87462),o=n(4942),a=n(45987),i=n(67294),l=n(54005),c=["callback","feature","isStart","isSuccess","isFailure","eventReason","payload"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=function(e){return(0,i.forwardRef)((function(t,n){var u=t.callback,d=t.feature,m=t.isStart,f=t.isSuccess,p=t.isFailure,g=t.eventReason,v=t.payload,h=void 0===v?{}:v,b=(0,a.Z)(t,c),y=(0,l.Z)(),w=y.sendLog,E=y.isReady,C=(0,i.useCallback)((function(){var e=b[u],t=s(s(s(s(s({feature:d,isStart:m,isSuccess:f,isFailure:p,eventReason:g},h),b["data-ga"]?{dataGa:b["data-ga"]}:{}),b.dataGa?{dataGa:b.dataGa}:{}),b["data-track"]?{dataTrack:b["data-track"]}:{}),b.label?{label:b.label}:{});"function"==typeof e&&e(),w(t,!0)}),[u,w,E,h,b]),x=(0,i.useMemo)((function(){return s(s({},b),{},(0,o.Z)({},u,C))}),[b,u,C]);return i.createElement(e,(0,r.Z)({ref:n},x))}))},m=n(16294),f=["payload"];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 g(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,o.Z)(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}var v=function(e){return(0,i.forwardRef)((function(t,n){var o=t.payload,l=void 0===o?{}:o,c=(0,a.Z)(t,f),u=d(e);return i.createElement(u,(0,r.Z)({},c,{ref:n,callback:"onClick",payload:g(g({},l),{},{action:m.Nw.buttonClicked})}))}))}},71752:function(e,t,n){n.d(t,{T:function(){return r}});var r=function(e){return e.messages&&e.messages.length>0?e.messages[0]:void 0}},30688:function(e,t,n){n.d(t,{A:function(){return a},f:function(){return o}});var r=n(93433),o=(n(92222),n(85827),n(41539),n(25387),n(2490),n(72608),function(e,t){return{isValid:e,message:t}});function a(e){return Array.isArray(e)?function(t){return e.reduce((n=t,function(e,t){var o=t(n),a=o.isValid,i=o.message;if(a)return e;var l=e.messages,c=void 0===l?[]:l;return{isValid:a,messages:[].concat((0,r.Z)(c),[i])}}),{isValid:!0});var n}:(t=e,function(e){var n=t(e),r=n.isValid,o=n.message;return o?{isValid:r,messages:[o]}:{isValid:r}});var t}},31203:function(e,t,n){var r=n(87462),o=n(45987),a=n(66007),i=n(67294),l=n(70982),c=n(93416),u=["onClick","src","title","width","height"],s=(0,i.forwardRef)((function(e,t){var n=e.onClick,s=e.src,d=e.title,m=void 0===d?"User avatar":d,f=e.width,p=void 0===f?8:f,g=e.height,v=void 0===g?8:g,h=(0,o.Z)(e,u);return i.createElement(c.Flex,(0,r.Z)({cursor:"pointer",round:"50%","data-testid":"userAvatar",title:m,alt:m,onClick:function(e){return n&&n(e)},width:p,height:v},h,{ref:t,alignItems:"center",justifyContent:"center",background:"spaceIdle",color:"textLite",overflow:"hidden"}),s?i.createElement(c.Flex,{as:"img",src:s,alt:m,width:p,height:v}):i.createElement(l.G,{icon:a.KC,size:"lg",alt:m}))}));t.Z=s},45916:function(e,t,n){var r=n(87462),o=n(45987),a=n(67294),i=n(93416),l=n(82351),c=["children","background","testId","onClose","tooltipProps"];t.Z=function(e){var t=e.children,n=e.background,u=e.testId,s=e.onClose,d=e.tooltipProps,m=(0,o.Z)(e,c),f=u||"header-banner";return a.createElement(i.Flex,(0,r.Z)({background:n,"data-testid":f,height:{min:10},padding:[2,10,2,2],position:"sticky",zIndex:5},m),t,a.createElement(l.Z,(0,r.Z)({align:"bottom",content:"Dismiss message",isBasic:!0,plain:!0,stretch:"align"},d),s&&a.createElement(i.Box,{"data-testid":"".concat(f,"-close-button"),as:i.Icon,color:"text",cursor:"pointer",name:"x",position:"absolute",right:"8px",onClick:function(e){s&&(e.stopPropagation(),s())}})))}},59946:function(e,t,n){n.d(t,{vD:function(){return c}});var r=n(45987),o=n(67294),a=n(71893),i=n(93416),l=["children"],c=(0,a.default)(i.Box).withConfig({displayName:"blur__BlurredBox",componentId:"sc-12emg8l-0"})(["position:absolute;top:0;bottom:0;left:0;right:0;backdrop-filter:blur(",");z-index:80;"],(function(e){return e.value||"7px"}));t.ZP=function(e){var t=e.children,n=(0,r.Z)(e,l);return o.createElement(i.Box,{position:"relative"},t,o.createElement(c,n))}},70842:function(e,t,n){n.d(t,{Z:function(){return q}});var r=n(87462),o=n(29439),a=n(67294),i=n(93416),l=n(61152),c=n(82351),u=n(24533),s=n(71893),d=n(57387),m=n(78266),f=n(45987),p=(n(57327),n(41539),n(88449),n(2490),n(59849),n(21249),n(57640),n(9924),n(78710)),g=n(46667),v=n(36065),h=n(74059),b=n(77872),y=n(97346),w=n(14428),E=["selectedSpace","setSelectedSpace","column","showFullname"],C=s.default.div.withConfig({displayName:"spaces__Separator",componentId:"sc-19p9rsp-0"})(["height:1px;width:",";background:",";"],(0,i.getSizeBy)(3),(0,i.getColor)("border")),x=function(e){var t=e.selectedSpace,n=e.setSelectedSpace,l=e.column,u=e.showFullname,s=(0,f.Z)(e,E),d=(0,h.Iw)(),m=(0,a.useMemo)((function(){return d.filter((function(e){return!(0,p.Ly)(e)}))}),[d]),x=(0,g.Z)(),O=(0,o.Z)(x,4),k=O[0],Z=O[2],S=O[3];return a.createElement(i.Flex,(0,r.Z)({"data-testid":"workspaceBar",padding:[3,2],column:l,alignItems:"center",justifyContent:"center"},s),a.createElement(i.Flex,{column:!0,"data-testid":"workspaceBar-spaces-list",gap:4,alignItems:"center",overflow:"hidden"},a.createElement(i.Flex,{column:l,"data-testid":"workspaceBar-spacesList",gap:l?4:2,overflow:{vertical:"auto"},flexWrap:!l},m.map((function(e){return a.createElement(b.Z,{testIdPrefix:"workspaceBar-space",key:e,spaceId:e,onClick:n,active:e===(null===t||void 0===t?void 0:t.id),background:"selected",showFullname:u})}))),a.createElement(y.Z,{permission:"user:CreateSpace"},a.createElement(C,{"data-testid":"workspaceBar-separator"}),a.createElement(c.Z,{content:"Create a new Space",align:"right"},a.createElement(w.Z,{permission:"user:CreateSpace",ifForbidden:"hide",icon:"plus",onClick:Z,"data-testid":"workspaceBar-addSpace-button"})))),k&&a.createElement(v.Z,{onClose:S,onDone:n}))},O=n(56662),k=n(61458),Z=n(33335),S=n(23383),P=n(95383),I=n(73398),j=function(e){var t=e.selectedSpace,n=e.selectedRoom,r=e.setSelectedRoom,l=t.id;(0,S.Z)(l);var u=(0,Z.gI)("room:Create",l),s=(0,Z.gI)("room:Read",l),d=(0,g.Z)(!1),m=(0,o.Z)(d,4),f=m[0],p=m[2],v=m[3],h=(0,a.useCallback)((function(e){e.stopPropagation(),u&&p()}),[u]),b=(0,P.WY)(l),y=(0,a.useMemo)((function(){return b.filter((function(e){return e.isMember}))}),[b]);return(0,a.useEffect)((function(){null!==y&&void 0!==y&&y.length&&(n||r(y[0]))}),[y,n]),a.createElement(a.Fragment,null,a.createElement(k.Z,{"data-testid":"workspaceRooms-menuList",disabled:!s,headerTestId:"workspaceRooms-warRooms",isOpen:!0,label:a.createElement(i.Flex,{padding:[1,0],margin:[0,0,1],flex:!0,justifyContent:"between",alignItems:"center",height:"24px"},a.createElement(i.Flex,{alignItems:"center",gap:2},a.createElement(i.Icon,{name:"space_new",color:"textNoFocus",width:"14px",height:"14px"}),a.createElement(i.TextSmall,{color:"textNoFocus"},"Select a room")),a.createElement(i.Flex,{alignItems:"center",gap:2},a.createElement(c.Z,{content:"Create a new room",align:"right"},a.createElement(w.Z,{permission:"room:Create",tiny:!0,icon:"plus",onClick:h,"data-testid":"workspaceRooms-addWarRoom-button",spaceId:l}))))},a.createElement(i.Flex,{column:!0,"data-testid":"workspaceRooms-warRoomsList",padding:[0,0,1]},y.map((function(e){var t=e.id;return a.createElement(I.Z,{key:t,id:t,hideAlerts:!0,Wrapper:i.TextSmall,isSidebar:!0,selectedId:null===n||void 0===n?void 0:n.id,onClick:function(){return r(e)}})})))),f&&a.createElement(O.U,{onClose:v,isSubmodal:!1}))},D=n(4942),N=(n(92222),n(47941),n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(33582)),T=n(13477),F=n(93017),M=n(28234),_=n(94221),L=n(49254),A=n(39469),B=n(54005);function R(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?R(Object(n),!0).forEach((function(t){(0,D.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var U=n(39979),z=n(63346),H=(0,s.default)(i.ModalContent).attrs({width:{base:"80vw"},height:{base:"80vh",min:"80vh"}}).withConfig({displayName:"modal__ModalContent",componentId:"sc-4dwymj-0"})(["box-shadow:0 18px 28px rgba(0,0,0,0.5);"]),W=(0,U.Z)(i.Button),G=function(e){var t=e.claim,n=e.loading,r=(e.error,e.privateKey),o=e.setPrivateKey,l=e.selectedSpace,c=e.setSelectedSpace,u=e.selectedRoom,s=e.keyFilename;return l?u?a.createElement(a.Fragment,null,a.createElement(m.H,null),a.createElement(i.H3,{textAlign:"center"},'You are ready to connect your agent in "',u.name,'" of "',l.name,'"'),a.createElement(i.Text,{textAlign:"center"},"Last step is to ensure you're the admin of this agent ;)"),a.createElement(i.TextSmall,{textAlign:"center"},"We've created a file with a random key. Can you read it?"),a.createElement(d.ZP,{"data-testid":"key-filename-command",commandText:"sudo cat ".concat(s),width:"60%"},"$ sudo cat ",s),a.createElement(i.Flex,{column:!0,round:!0,background:"accent",border:"primary",padding:[2],width:"60%"},a.createElement(i.TextSmall,{color:"tooltip"},a.createElement(i.TextSmall,{strong:!0,color:"tooltip"},"Tip:")," ","Run the command and paste here the key it will give you. If the command doesn't work out of the box, locate the ",s," file, open it in your favorite text editor, and copy it to your clipboard.")),a.createElement(i.TextInput,{value:r,placeholder:"Paste private key here",onChange:function(e){return o(e.target.value)},containerStyles:{width:"60%"}}),a.createElement(W,{label:"Claim your agent",onClick:t,disabled:!r||n,isLoading:n,"data-ga":"claiming::claim-agent::modal",payload:{space:null===l||void 0===l?void 0:l.id,room:null===u||void 0===u?void 0:u.id,privateKey:r}})):a.createElement(a.Fragment,null,a.createElement(m.H,null),a.createElement(i.H3,{textAlign:"center"},'Select a room in "',l.name,'" for this agent'),a.createElement(i.TextBig,{color:"textDescription",textAlign:"center"},"or create a new one by hitting the [+] button.")):a.createElement(a.Fragment,null,a.createElement(m.H,null),a.createElement(i.H3,{textAlign:"center"},"Let's connect your agent"),a.createElement(i.TextBig,{color:"textDescription",textAlign:"center"},"Select the space you want this agent to join"),a.createElement(i.TextBig,{color:"textDescription",textAlign:"center"},"or create a new one by hitting the [+] button."),a.createElement(x,{column:!!l,selectedSpace:l,setSelectedSpace:c,showFullname:!0,width:"80%"}))},K=function(e){var t=e.onClose,n=e.keyFilename,r=function(e){var t,n=(0,a.useState)(),r=(0,o.Z)(n,2),i=r[0],l=r[1],c=(0,a.useState)(),s=(0,o.Z)(c,2),d=s[0],m=s[1],f=(0,a.useState)(""),p=(0,o.Z)(f,2),g=p[0],v=p[1],b=(0,N.Z)(null===i||void 0===i?void 0:i.id),y=(0,h.Q6)(),w=null===(t=window.localNetdataRegistry)||void 0===t?void 0:t.mg,E=(0,u.Lz)(w),C=(0,o.Z)(E,2),x=C[0],O=x.claiming,k=x.claimingError,Z=C[1],S=(0,T.Iy)("isAnonymous"),P=(0,F.Z)(),I=(0,o.Z)(P,2),j=I[0],D=I[1],R=(0,u.Hu)(),U=(0,L.Hu)(),z=(0,A.Hu)(),H=(0,B.Z)(),W=H.sendLog,G=H.isReady;return{claim:(0,a.useCallback)((function(){var t;g&&!O&&b&&w&&y&&!S&&d&&(Z({claiming:!0}),(0,_.c)({key:g,token:null===b||void 0===b||null===(t=b[0])||void 0===t?void 0:t.token,rooms:[d.id],url:window.envSettings.apiUrl}).then((function(t){var n=t.data;if(!n.success)return Z({claiming:!1,claimingError:n.message,claimId:null}),D({message:n.message}),void W({feature:"claim-node",isFailure:!0,message:n.message});R(),U(),z(),Z(V(V({claiming:!1},n),{},{claimingError:""})),e(),j({header:"Your agent got connected to Netdata",text:"You can see your agent in the room ".concat(d.name," of ").concat(i.name," space.")}),W({feature:"claim-node",isSuccess:!0})})).catch((function(e){var t,n=null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.data,r=(0,M.r)(null===n||void 0===n?void 0:n.errorMsgKey)||(null===n||void 0===n?void 0:n.errorMessage)||"Something went wrong";Z({claiming:!1,claimingError:r,claimId:null}),D({message:r}),W({feature:"claim-node",isFailure:!0,message:r})})))}),[b,g,w,y,S,O,W,G]),selectedSpace:i,setSelectedSpace:l,selectedRoom:d,setSelectedRoom:m,loading:O,error:k,privateKey:g,setPrivateKey:v}}(t),l=r.claim,c=r.selectedSpace,s=r.setSelectedSpace,d=r.selectedRoom,m=r.setSelectedRoom,f=r.loading,p=r.error,g=r.privateKey,v=r.setPrivateKey;return a.createElement(i.Modal,{zIndex:80,backdropProps:{backdropBlur:!0}},a.createElement(z.ZP,{feature:"ClaimModal"},a.createElement(i.Flex,{column:!0,alignItems:"end",gap:3},a.createElement(H,{tabIndex:0},a.createElement(i.ModalHeader,{justifyContent:"between"},a.createElement(i.Flex,{gap:2,alignItems:"center"},"Connect your agent to Netdata"),a.createElement(i.ModalCloseButton,{onClose:t,testId:"claim-modal-close-button","data-ga":"claiming::close-claim-modal::local"})),a.createElement(i.ModalBody,{overflow:{vertical:"auto"},padding:[0],height:"100%",column:!1},a.createElement(i.Collapsible,{background:"sideBar",open:!!c,direction:"horizontal"},a.createElement(x,{column:!0,selectedSpace:c,setSelectedSpace:s,background:"sideBarMini",height:"100%"})),a.createElement(i.Collapsible,{background:"sideBar",open:!!c,direction:"horizontal"},a.createElement(i.Flex,{flex:!0,width:56,column:!0,overflow:{vertical:"auto"},padding:[2,0]},!!c&&a.createElement(j,{selectedSpace:c,selectedRoom:d,setSelectedRoom:m}))),a.createElement(i.Flex,{alignItems:"center",column:!0,"data-testid":"claim-modal-body",flex:!0,gap:3,justifyContent:"center",padding:[4]},a.createElement(G,{selectedSpace:c,selectedRoom:d,setSelectedSpace:s,keyFilename:n,claim:l,loading:f,error:p,privateKey:g,setPrivateKey:v})))))))},J={unavailable:"Netdata is not available for this agent.",available:"Netdata is available. Click to claim it and gain the full benefits of Netdata!",disabled:"Netdata is available, but it is disabled, you can change the agent configuration to enable it.",banned:"The agent has been banned from cloud.",offline:"The agent tries to connect to Netdata, but it fails to do so.",online:"The agent is already connected to Netdata :)"},Y=(0,U.Z)(i.Button),q=function(e){var t=(0,l.Z)("claimModal"),n=(0,o.Z)(t,4),i=n[0],s=n[2],d=n[3],m=(0,u.Lz)(),f=(0,o.Z)(m,1)[0],p=f.canBeClaimed,g=f.cloudStatus,v=f.keyFilename;return a.createElement(a.Fragment,null,a.createElement(c.Z,{plain:!0,content:J[g],isBasic:!0},a.createElement("div",null,a.createElement(Y,(0,r.Z)({label:"Connect to Netdata",onClick:s},e,{disabled:!p,"data-ga":"claiming::open-claim-modal::local"})))),i&&a.createElement(K,{onClose:d,keyFilename:v}))}},35253:function(e,t,n){n.d(t,{J:function(){return o},N:function(){return r}});var r={Community:"nightly",default:"stable",EarlyBird:"nightly"},o={nightly:{description:"Released at most once every 24 hours with fully-tested code that fixes bugs or security flaws, or introduces new features to Netdata. Every nightly release is a candidate for then becoming a stable release.",title:"Nightly"},stable:{description:"Released when a major milestone is reached. Stable releases might be a better choice for those who run Netdata in mission-critical production systems, as updates will come more infrequently.",title:"Stable"}}},16931:function(e,t,n){n.d(t,{Sn:function(){return c},U8:function(){return i},m7:function(){return l}});var r=n(67294),o=n(71893),a=n(93416),i=(0,o.default)(a.Box).attrs({border:{side:"all",color:"border"},padding:[1.75,7,1.75,3],round:!0}).withConfig({displayName:"styled__InfoBlock",componentId:"sc-1lice8m-0"})(["color:",";font-family:Courier New,monospace;font-size:14px;letter-spacing:0.09px;line-height:18px;max-height:34px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;"],(0,a.getColor)("textLite")),l=function(e){var t=e.children;return r.createElement(a.Flex,{column:!0,gap:4},t)},c=(0,o.default)(a.Button).withConfig({displayName:"styled__StyledButton",componentId:"sc-1lice8m-1"})(["&&{width:auto;min-width:auto;height:22px;background:",";border:1px solid ",";border-radius:4px;padding:0;&:hover{background:",";& > span{span{color:",";}svg{fill:",";}}}& > span{display:flex;align-items:center;gap:6px;margin:2px 8px 2px 4px;span{color:",";}svg{fill:",";}}}"],(function(e){var t=e.active,n=e.theme;return(0,a.getColor)(t?"primary":"modalBackground")({theme:n})}),(0,a.getColor)("primary"),(0,a.getColor)("primary"),(0,a.getColor)("modalBackground"),(0,a.getColor)("modalBackground"),(function(e){var t=e.active,n=e.theme;return(0,a.getColor)(t?"modalBackground":"primary")({theme:n})}),(function(e){var t=e.active,n=e.theme;return(0,a.getColor)(t?"modalBackground":"primary")({theme:n})}))},70459:function(e,t,n){var r=n(29439),o=(n(41539),n(15581),n(2490),n(34514),n(54747),n(67294)),a=n(54576),i=n(4822);t.Z=function(){var e=(0,a.useChart)(),t=(0,i.I0)(),n=(0,r.Z)(t,2),l=n[0],c=l.after,u=l.before,s=l.forcePlay,d=n[1],m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autofetchOnWindowBlur:!1};return function(){e.getNodes().forEach((function(e){return e.updateAttributes(t)}));var n=c<0?c:-Math.floor((u-c)/1e3);d({after:n,before:0,forcePlay:!!t.autofetchOnWindowBlur})}};return{play:(0,o.useCallback)(m(),[u,c,s]),forcePlay:(0,o.useCallback)(m({autofetchOnWindowBlur:!0}),[u,c,s]),pause:(0,o.useCallback)((function(){if(!(c>0)){var e=Date.now();d({after:1e3*Math.floor(e/1e3+c),before:1e3*Math.floor(e/1e3),forcePlay:!1})}}),[c,u,s])}}},92517:function(e,t,n){var r=n(87462),o=n(45987),a=n(71893),i=n(67294),l=n(93416),c=["background","children","cursor","hasBorder","hasHoverBackground","onClick","padding","testId","borderColor","round","hoverBackground"],u=(0,a.default)(l.Flex).withConfig({displayName:"item__StyledFlex",componentId:"sc-1gby0f1-0"})(["&:hover{background:",";}"],(function(e){var t=e.hasHoverBackground,n=e.theme,r=e.hoverBackground,o=void 0===r?"borderSecondary":r;return t?(0,l.getColor)(o)({theme:n}):null})),s=(0,i.forwardRef)((function(e,t){var n=e.background,a=e.children,s=e.cursor,d=e.hasBorder,m=e.hasHoverBackground,f=e.onClick,p=e.padding,g=e.testId,v=e.borderColor,h=void 0===v?"selected":v,b=e.round,y=e.hoverBackground,w=(0,o.Z)(e,c);return i.createElement(l.Flex,(0,r.Z)({alignItems:"center",border:d&&{side:"right",color:h},cursor:s,"data-testid":g,onClick:f,ref:t},w),i.createElement(u,{round:b,alignItems:"center",background:n,hasHoverBackground:m,margin:d?[0,3,0,0]:void 0,padding:p,hoverBackground:y},a))}));t.Z=s},27261:function(e,t,n){n(92222);var r=n(93416),o=n(67294),a="node-status-indicator";t.Z=function(e){var t=e.statusText,n=e.selected,i=e.total,l=e.statusColor,c=e.isScreenSmall,u=l.statusTextColor,s=l.indicatorWrapperColor,d=l.counterColor;return o.createElement(r.Flex,{alignItems:"center",gap:2},!c&&o.createElement(r.TextSmall,{"data-testid":"".concat(a,"-text-").concat(t),color:u},t),o.createElement(r.Flex,{justifyContent:"center",alignItems:"center",padding:[0,1],width:{min:7.5},height:5,background:s,round:!0,gap:c?.2:1},n===i?o.createElement(r.TextSmall,{"data-testid":"".concat(a,"-total-").concat(t),color:d},i):o.createElement(o.Fragment,null,o.createElement(r.TextSmall,{strong:!0,"data-testid":"".concat(a,"-selected-").concat(t),color:d},n),o.createElement(r.TextSmall,{color:d},c?"/":"of"),o.createElement(r.TextSmall,{"data-testid":"".concat(a,"-total-").concat(t),color:d},i))))}},6973:function(e,t,n){n.d(t,{B:function(){return r}});var r={live:{statusTextColor:"live",indicatorWrapperColor:"live",counterColor:"bright"},stale:{statusTextColor:"stale",indicatorWrapperColor:"stale",counterColor:"bright"},offline:{statusTextColor:"textLite",indicatorWrapperColor:"offline",counterColor:"bright"},unseen:{statusTextColor:"unseen",indicatorWrapperColor:"unseen",counterColor:"bright"}}},4514:function(e,t,n){n.d(t,{c:function(){return s}});n(21249),n(57640),n(9924),n(47941);var r=n(67294),o=n(71893),a=n(93416),i=n(27261),l=n(6973),c=(0,o.default)(a.Flex).withConfig({displayName:"wrapper__NodesIndicatorWrapper",componentId:"sc-gy5ftg-0"})(["pointer-events:",";cursor:",";opacity:",";"],(function(e){return e.disabled?"none":"auto"}),(function(e){return e.disabled?"default":"pointer"}),(function(e){return e.disabled?"0.7":"1"})),u={live:{counter:0,statusText:"Live"},stale:{counter:0,statusText:"Stale"},offline:{counter:0,statusText:"Offline"},unseen:{counter:0,statusText:"Unseen"}},s=function(e){return r.createElement(c,e,Object.keys(u).map((function(e){return r.createElement(i.Z,{key:e,statusText:u[e].statusText,counter:u[e].counter,statusColor:l.B[e]})})))};t.Z=c},64599:function(e,t,n){var r=n(87462),o=n(67294),a=n(93416),i=n(13477),l=n(83356),c=(0,n(39979).Z)(a.Button);t.Z=function(e){var t=(0,i.Iy)("isAnonymous"),n=(0,l.Z)();return t?o.createElement(c,(0,r.Z)({label:"Sign In",isStart:!0,onClick:n,"data-ga":"click-sign-in::header",feature:"SignIn"},e)):null}},80697:function(e,t,n){var r=n(87462),o=n(29439),a=n(45987),i=n(67294),l=n(93416),c=n(13477),u=n(33335),s=n(82351),d=n(39979),m=n(36285),f=n(38314),p=n(80413),g=["tooltipProps"],v=(0,d.Z)(l.Button);t.Z=function(e){var t=e.tooltipProps,n=void 0===t?{}:t,l=(0,a.Z)(e,g),d=(0,c.Iy)("isAnonymous"),h=((0,m.RP)().value||{}).slug,b=(0,f.BT)(h),y=(0,u.gI)("billing:Manage"),w=(0,p.Z)(),E=(0,i.useState)(),C=(0,o.Z)(E,2),x=C[0],O=C[1];return(0,i.useEffect)((function(){O(!d&&b&&y)}),[d,b,y]),x?i.createElement(s.Z,(0,r.Z)({plain:!0,content:"Upgrade to business plan and experience the full power of Netdata!",isBasic:!0},n),i.createElement("div",null,i.createElement(v,(0,r.Z)({label:"Upgrade Now!",isStart:!0,onClick:w,feature:"UpgradeToBusiness","data-testid":"upgradeToBusiness-header"},l)))):null}},5100:function(e,t,n){n.r(t),n.d(t,{default:function(){return lt}});var r=n(29439),o=(n(66992),n(41539),n(88674),n(78783),n(33948),n(67294)),a=n(2145),i=n(93416),l=n(13477),c=(n(15581),n(2490),n(34514),n(54747),n(68035)),u=n(4480),s=n(30266),d=n(74059),m=n(33335),f=n(94979),p=n(78266),g=n(46667),v=n(59636),h=n(67622),b=n(61458),y=n(37518),w=n(71893),E=(0,w.default)(i.Drop).attrs({align:{top:"bottom",left:"left"},animation:!0,background:"dropdown",column:!0,margin:[2,0,0],overflow:{vertical:"auto"},padding:[2,0],round:1,width:64}).withConfig({displayName:"styled__Dropdown",componentId:"sc-1vwntsm-0"})([""]),C=(0,w.default)(i.H6).attrs({color:"text",padding:[2,4]}).withConfig({displayName:"styled__OtherRoomsHeader",componentId:"sc-1vwntsm-1"})([""]),x=n(82351),O=n(92517),k=n(93033),Z=n(14428),S=n(22648),P=function(){var e=(0,S.m)(),t=(0,g.Z)(),n=(0,r.Z)(t,4),a=n[0],l=n[1],c=n[3],u=(0,o.useRef)(),s=(0,y.Hm)(),f=s.slug,p=(0,d.OS)("name"),w=(0,k.Z)({roomSlug:f}),P=(0,m.gI)("room:Read"),I=(0,d.Q6)();return o.createElement(o.Fragment,null,o.createElement(i.Flex,{alignItems:"center",gap:1,"data-testid":"header-roomOptions"},o.createElement(h.Z,{ref:u,testid:"roomDropdownMenu-roomOptions",icon:"space_new",onClick:l,padding:[2],round:1,width:"auto",disabled:!P||I,selected:a},!e&&s.name&&o.createElement(i.Flex,{alignItems:"center",gap:4},o.createElement(i.Text,null,s.name),o.createElement(i.Icon,{name:"chevron_down",size:"small",color:"text"}))),o.createElement(O.Z,{borderColor:"borderSecondary",hasHoverBackground:!0},o.createElement(x.Z,{align:"bottom",content:"Room settings"},o.createElement(Z.Z,{Component:i.IconButton,permission:"room:Leave","data-ga":"header::click-war-room-settings::global-view","data-testid":"header-manageWarRoom",onClick:w,icon:"gear"})))),u.current&&a&&o.createElement(E,{target:u.current,onEsc:c,onClickOutside:c},o.createElement(b.Z,{isOpen:!0,label:"ROOMS IN ".concat(p.toUpperCase()),headerTestId:"roomDropdownMenu-otherRooms",Header:C},o.createElement(i.Flex,{onClick:c,column:!0,height:{max:100},overflow:{vertical:"auto"}},o.createElement(v.Z,null)))))},I=(n(92222),n(97945)),j=n(82902),D=(n(82526),n(41817),function(e){var t=e.description,n=e.title,r=e.testId,a=e.children;return o.createElement(i.Flex,{"data-testid":r,column:!0,gap:2},o.createElement(i.H4,{color:"textDescription"},n),o.createElement(i.Flex,{column:!0,"data-testid":r,gap:2},o.createElement(i.Text,{color:"textDescription"},t),a))}),N=function(e){var t=e.children,n=e.testId,r=e.icon,a=void 0===r?"nodes_update":r;return o.createElement(i.Flex,{"data-testid":n,padding:[6],round:1,width:"100%",background:"modalInfoBackground",gap:2},o.createElement(i.Box,{as:i.Icon,width:10,height:10,name:a}),t)},T=function(e){var t=e.title,n=e.desciription;return o.createElement(i.Flex,{column:!0,gap:3},o.createElement(i.Flex,{alignItems:"center",gap:2},o.createElement(i.Icon,{color:"main",name:"warning_triangle_hollow"}),o.createElement(i.H3,null,t)),o.createElement(i.Box,null,n))},F=n(91008),M=n(89250),_=(n(64211),n(41874),n(11389)),L=n(22965),A=n(86711),B=n(83925);var R=[{id:"name",accessor:"name",header:"Name",cell:function(e){var t=e.getValue,n=e.row;return o.createElement(F.Z,{disabled:!n.original.isLive&&"stale"!==n.original.state,color:"text",hoverColor:"primary",visitedColor:"accent",Component:i.TextSmall},t())},minSize:60},{id:"version",accessor:"version",header:"Version",cell:function(e){var t=e.getValue;return o.createElement(i.Pill,{color:"neutralPillColor",flavour:"neutral"},t())}},{id:"state",accessor:"state",header:"Status",cell:function(e){var t=e.getValue;return o.createElement(_.Z,{state:t()})},sortingFn:function(e,t){return n=(0,L.Q5)(e.original.state),r=(0,L.Q5)(t.original.state),n===r?0:n>r?1:-1;var n,r},enableColumnFilter:!0,filterFn:function(e,t,n){var r=e.original;return n.length<1||n.some((function(e){var t=e.value;return"all"===t||t===(0,L.Q5)(r.state)}))},meta:{tooltip:o.createElement(A.Z,null),filter:{component:"select",isMulti:!0,options:[{value:"Offline",label:"Offline"},{value:"Live",label:"Live"},{value:"Stale",label:"Stale"}]}}},{id:"updateSeverity",accessor:"updateSeverity",header:"Severity",cell:function(e){var t=e.getValue,n=e.row.original;return o.createElement(B.Z,{name:n.name,os:n.os.id,container:n.hw.container,warningLevel:n.updateSeverity,labels:n.labels||{},version:n.version,text:t()})}}],V=(0,u.cn)({key:"notificationModal",default:!1}),U=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).resetOnUnmount,t=void 0!==e&&e,n=(0,u.rb)(V),a=(0,u.FV)(V),i=(0,r.Z)(a,2),l=i[0],c=i[1],s=(0,o.useCallback)((function(){return c(!0)}),[]),d=(0,o.useCallback)((function(){return c(!1)}),[]);return(0,o.useEffect)((function(){return function(){t&&n()}}),[]),{isModalVisible:l,openModal:s,closeModal:d,resetState:n}},z=[{id:"updateSeverity",desc:!1}],H=function(){var e=U().closeModal,t=(0,o.useMemo)((function(){return{goto:{handleAction:function(e){var t=((null===e||void 0===e?void 0:e.labels)||{})._install_type,n=void 0===t?null:t,r=e.hw.container,o=e.os.id,a=e.version,i=(0,j.Ly)({container:r,os:o,_install_type:n,version:a});window.open(i,"_blank","noopener,noreferrer")},tooltipText:"Go to documentation"}}}),[]),n=(0,M.s0)(),r=(0,I.Hg)();return{onClickRow:(0,o.useCallback)((function(t){var o=t.data;if(o.isLive||"stale"===o.state){var a=r(o.id);n(a),e()}}),[]),sortBy:z,rowActions:t,columns:R,disableClickRow:function(e){var t=e.data;return!t.isLive&&"stale"!==t.state}}},W=n(60730),G={updateSeverity:!0,connectionToCloud:!1},K=function(e){var t=e.data,n=H(),r=n.rowActions,a=n.onClickRow,i=n.disableClickRow,l=n.sortBy;return o.createElement(W.Z,{"data-testid":"nodesTable-layout",customSortBy:l,customNodes:t,showdDefaultRowActions:!1,showDefaultBulkActions:!1,columnVisibility:G,customRowActions:r,enableSelection:!1,onClickRow:a,disableClickRow:i})},J=function(e){var t=e.onClose,n=(0,I.Ng)(),r=(0,I.Ne)(n),a=n.length,l="Need update (".concat(n.length," ").concat((0,j.V6)(n.length),")");return o.createElement(i.Modal,{backdropProps:{backdropBlur:!0}},o.createElement(i.ModalContent,{width:{min:200,base:270},height:200},o.createElement(i.ModalHeader,null,o.createElement(T,{title:"Nodes that need Attention",desciription:o.createElement(i.Text,null,"You have ",o.createElement(i.Text,{strong:!0},a)," ",(0,j.V6)(a)," that should be upgraded to ensure experience using Netdata")}),o.createElement(i.ModalCloseButton,{onClose:t,testId:"close-button"})),o.createElement(i.ModalBody,{overflow:"hidden"},o.createElement(N,null,o.createElement(D,{title:l},o.createElement(i.Text,null,o.createElement(i.Flex,{column:!0},o.createElement(i.Text,null,"Please upgrade to ensure you get the latest security and bug fixes.")," ",o.createElement(i.Box,null,"To update your nodes to the latest version"," ",o.createElement(F.Z,{href:j.XY.default,rel:"noopener noreferrer",strong:!0,target:"_blank"},"please read our documentation"," "),"and find direct links for each node depending on where it is running and/or how it was installed."))))),o.createElement(K,{data:r}))))},Y=n(65565),q=n(91128),Q=n(2379),$=n(54576),X=n(95665),ee=n(4822),te=function(e){var t=e.tagging,n=e.isPlaying,a=(0,S.m)(),i=(0,ee.I0)(),l=(0,r.Z)(i,2),c=l[0],u=c.offset,s=c.after,d=c.before,m=l[1],f=(0,o.useCallback)((function(e){var t=e.start,n=void 0===t?-900:t,r=e.end;m({after:n,before:n<0?0:void 0===r?0:r})}),[]),p=(0,o.useMemo)((function(){return{start:s<0?s:Math.floor(s),end:s<0?0:Math.ceil(d)}}),[s,d]);return o.createElement(X.Z,{values:p,utc:u,onChange:f,tagging:t,isPlaying:n,isSmall:a})},ne=(0,w.default)(i.Flex).withConfig({displayName:"container__Container",componentId:"sc-qc13l0-0"})(["background:",";"],(function(e){var t=e.theme,n=e.isPlaying;return("Dark"===t.name?(0,i.getRgbColor)(n?["green","green40"]:["neutral","grey70"]):(0,i.getRgbColor)(n?["green","green190"]:["neutral","grey185"]))({theme:t})})),re=n(70459),oe=(0,w.default)(x.Z).withConfig({displayName:"playPausePill__StyledTooltip",componentId:"sc-1umryvu-0"})(["pointer-events:",";"],(function(e){return e.isDisabled?"none":"auto"})),ae=function(e){var t=e.isPlaying,n=e.isForcePlaying,r=e.isDisabled,a=(0,S.m)(),l=(0,re.Z)(),c=l.play,u=l.pause,s=(0,o.useMemo)((function(){return function(e,t){return e?t?"forcePlay":"playSolid":"pauseSolid"}(t,n)}),[t,n]);return o.createElement(oe,{content:t?"Click to pause":"Click to play",align:"bottom",isDisabled:r},o.createElement(i.Box,{as:i.Pill,icon:s,onClick:t?u:c,isPlaying:t,"data-testid":"playPause-button",flavour:t?"success":"neutral",_hover:{background:t?"accent":"neutralPillColor"}},a?null:t?"Playing":"Paused"))},ie=(0,w.default)(i.Flex).attrs({padding:[1],role:"button"}).withConfig({displayName:"styled__MenuButton",componentId:"sc-3h0zgs-0"})(["cursor:pointer;"]),le=(0,w.default)(i.Drop).attrs({align:{top:"bottom",left:"left"},animation:!0,backdrop:!0,column:!0,padding:[2,0],background:"dropdown",round:1,overflow:{vertical:"auto"},margin:[.5,0,0],width:40}).withConfig({displayName:"styled__Dropdown",componentId:"sc-3h0zgs-1"})([""]),ce=(0,w.default)(x.Z).withConfig({displayName:"styled__StyledTooltip",componentId:"sc-3h0zgs-2"})(["pointer-events:",";"],(function(e){return e.isDisabled?"none":"auto"})),ue=function(e){var t=e.target,n=e.isDisabled,a=(0,g.Z)(),l=(0,r.Z)(a,4),c=l[0],u=l[1],s=l[3],d=(0,re.Z)(),m=d.play,f=d.pause,p=d.forcePlay;return o.createElement(o.Fragment,null,c?o.createElement(ie,{onClick:u,width:"auto","data-testid":"playOptions-picker"},o.createElement(i.Icon,{name:"chevron_down",color:"text",width:"12px",height:"12px"})):o.createElement(ce,{content:"Play to refresh and have live content, pause to see historical, or force play to keep refreshing even when the tab loses focus at the expense of some system performance.",align:{bottom:"bottom",right:"right"},isDisabled:n,plain:!0},o.createElement(ie,{onClick:u,width:"auto","data-testid":"playOptions-picker"},o.createElement(i.Icon,{name:"chevron_down",color:"text",width:"12px",height:"12px"}))),t.current&&c&&!n&&o.createElement(le,{target:t.current,onEsc:s,onClickOutside:s},o.createElement(h.Z,{icon:"playOutline",onClick:function(){m(),s()},testid:"playOptions-play"},"Play"),o.createElement(h.Z,{icon:"pauseOutline",onClick:function(){f(),s()},testid:"playOptions-pause"},"Pause"),o.createElement(h.Z,{icon:"forcePlayOutline",onClick:function(){p(),s()},testid:"playOptions-forcePlay"},"Force Play")))},se=(0,o.memo)(ue),de=function(){var e=(0,S.m)(),t=(0,Q.IX)(),n=(0,Q.o8)(),r=(0,Q.RT)(),a=(0,o.useRef)(),i=(0,Q.Cd)(),l=(0,$.useAttributeValue)("autofetchOnWindowBlur"),c=(0,q.Z)();return(0,Y.Z)((function(){c(!!t||!!n)}),[t,n]),o.createElement(O.Z,{hasBorder:!0,borderColor:"border",testId:"global-controls"},o.createElement(ne,{isPlaying:i,padding:e?[1]:[1,2],round:!0,height:"100%",alignItems:"center",gap:e?.2:1,isDisabled:t,ref:a},o.createElement(ae,{isPlaying:i,isForcePlaying:l,isDisabled:t||n}),o.createElement(se,{target:a,isDisabled:t||n}),!r&&o.createElement(te,{isPlaying:i,tagging:"global-view"})))},me=n(96929),fe=n(78710),pe=function(e){var t=e.toggle,n=e.upToDate,r=e.hasBorder;return o.createElement(O.Z,{borderColor:"borderSecondary",hasHoverBackground:!0,hasBorder:r,"data-testid":"cloud-app-news"},o.createElement(x.Z,{content:"News & Announcements",align:"bottom"},o.createElement(i.IconButton,{icon:"insights",iconColor:n?"text":"attention",onClick:t,"data-ga":"news::click-news::global-view"})))},ge=function(){var e=(0,me.zN)().length>0;return o.createElement(i.News,{app:fe.ZP?(0,fe.iM)()?"agent":["cloud","agent"]:"cloud"},(function(t){var n=t.toggle,r=t.upToDate;return o.createElement(pe,{toggle:n,upToDate:r,hasBorder:!e})}))},ve=n(4514),he=n(45916),be=n(62200),ye={warning:{background:"warningBackground",isDissmissable:!0,icon:"warning_triangle_hollow",iconColor:"warning"},critical:{background:"errorBackground",isDissmissable:!1,icon:"warning_triangle_hollow",iconColor:"error"}},we=function(e){var t=e.iconColor,n=e.icon,r=e.warningLevel,a=e.numberOfNodesWithCriticalSeverity,l=e.onClickUpdate;return o.createElement(i.Flex,{justifyContent:"center",alignItems:"center",width:"100%",gap:2},o.createElement(i.Icon,{"data-testid":"icon-banner-agent-outdated-".concat(r),color:t,name:n})," ",o.createElement(i.Text,{"data-testid":"text-agent-outdated-critical",color:"main"},a," ",(0,j.V6)(a)," ",a>1?"are":"is"," below recommend agent version"," ",be._b,"."," ",o.createElement(i.Box,{"data-testid":"open-add-node",onClick:l,as:i.Text,cursor:"pointer",textDecoration:"underline",color:"main"},"Please update them")," ","to ensure you get the latest security bug fixes."))},Ee=function(e){var t=e.warningLevel,n=e.numberOfNodesWithCriticalSeverity,r=e.onClose,a=e.onClickUpdate,i=ye[t],l=i.background,c=i.isDissmissable,u=i.icon,s=i.iconColor;return o.createElement(he.Z,{background:l,onClose:c?r:null},o.createElement(we,{iconColor:s,icon:u,warningLevel:t,numberOfNodesWithCriticalSeverity:n,onClickUpdate:a}))},Ce=function(){var e=U().openModal,t=(0,I.Ng)({severity:"critical"}).length;return t?o.createElement(Ee,{numberOfNodesWithCriticalSeverity:t,warningLevel:"critical",onClickUpdate:e}):o.createElement(o.Fragment,null)},xe=function(e){var t=e.onOpenModalClick,n=(0,I.Ng)({severity:"critical"}).length,r=(0,I.Ng)().length;return r?o.createElement(O.Z,{borderColor:"borderSecondary",cursor:"pointer",testId:"update-netdata-version-menu-item",hasBorder:!1,padding:[2,0]},o.createElement(i.Pill,{"data-testid":"update-netdata-version-badge",flavour:n?"error":"warning",icon:"warning_triangle_hollow",hollow:!0,onClick:t},r)):null},Oe=n(24533),ke=n(70842),Ze=n(64599),Se=n(80697),Pe={offline:{icon:"switch_off",color:"attention",text:"Offline"},online:{icon:"checkmark_s",color:"primary",text:"Online"}},Ie=function(){var e=(0,d.Q6)(),t=(0,l.Iy)("isAnonymous"),n=(0,Oe.Lz)(),a=(0,r.Z)(n,1)[0],c=a.canBeClaimed,u=a.cloudStatus;if(t)return o.createElement(Ze.Z,null);if(!e)return o.createElement(Se.Z,null);if(Pe[u]){var s=Pe[u],m=s.icon,f=s.color,p=s.text;return o.createElement(i.Flex,{alignItems:"center",gap:1},o.createElement(i.Icon,{name:m,color:f,width:"14px",height:"14px"}),o.createElement(i.TextSmall,{color:f},p))}return c?o.createElement(ke.Z,null):null},je=(0,a.Z)((function(){return Promise.all([n.e(1277),n.e(7068),n.e(90),n.e(2773),n.e(6848)]).then(n.bind(n,39766))}),"NodesIndicator"),De=function(){var e=(0,S.m)(),t=U(),n=t.isModalVisible,r=t.closeModal,a=t.openModal;return o.createElement(o.Fragment,null,o.createElement(Ce,null),o.createElement(i.Flex,{as:"header","data-testid":"header",padding:e?[1]:[2],justifyContent:"between",alignItems:"center",height:12,position:"sticky",background:"topBarBg",zIndex:5,overflow:{horizontal:"auto"}},n&&o.createElement(J,{onClose:r}),o.createElement(P,null),o.createElement(i.Flex,{alignItems:"center","data-testid":"header-features",gap:e?1:3},!window.envSettings.onprem&&o.createElement(ge,null),o.createElement(de,null),o.createElement(o.Suspense,{fallback:o.createElement(ve.c,{disabled:!0})},o.createElement(je,null)),o.createElement(Ie,{margin:[0,1,0,0],padding:[2,4]}),o.createElement(xe,{onOpenModalClick:a}))))},Ne=n(15257),Te=(0,w.default)(i.Flex).withConfig({displayName:"layout__UserControlContainer",componentId:"sc-18en99b-0"})(["bottom:0;left:0;"]),Fe=function(e){var t=e.children;return o.createElement(i.Flex,{width:"100vw",height:"100vh",column:!0,justifyContent:"center",alignItems:"center",background:"mainBackground",position:"relative"},t,o.createElement(Te,{position:"absolute",padding:[4]},o.createElement(Ne.Z,null)))},Me=(0,w.keyframes)(["from{opacity:0.4;}to{opacity:1;}"]),_e=(0,w.default)(i.Icon).withConfig({displayName:"loading__StyledIcon",componentId:"sc-11p1wp-0"})(["width:208px;height:177px;animation:"," 1.6s ease-in infinite;"],Me),Le=function(){return o.createElement(o.Fragment,null,o.createElement(_e,{name:"netdata",color:"primary",title:"Loading","data-testid":"spaceCreationLoading-logo"}),o.createElement(i.H3,{color:"text",margin:[1,0,0]},"We are attempting to create your space but the system is currently busy."),o.createElement(i.Text,{color:"text",margin:[4.5,0,0]},"Thank you for your patience!"))},Ae=n(83732),Be=function(){var e=(0,l.jr)(),t=(0,l.Iy)("email"),n=(0,o.useState)(!1),a=(0,r.Z)(n,2),c=a[0],u=a[1],s=(0,o.useCallback)((function(){return u(!1)}),[]),d=(0,Ae.Z)({onSuccess:s,onError:s,isDefault:!0}),m=(0,o.useCallback)((function(){u(!0),d({userId:e,email:t})}),[e,t]);return o.createElement(i.Flex,{column:!0,gap:6,alignItems:"center"},o.createElement(i.Flex,{column:!0,gap:2,alignItems:"center"},o.createElement(i.H3,{color:"text"},"There was a problem with automatically creating your space"),o.createElement(i.Text,{color:"text"},"Please try again below")),o.createElement(i.Button,{label:"Continue",isLoading:c,onClick:m}))},Re=function(){var e=(0,o.useState)(!0),t=(0,r.Z)(e,2),n=t[0],a=t[1];return(0,o.useEffect)((function(){var e=setTimeout((function(){return a(!1)}),1e4);return function(){return clearTimeout(e)}}),[]),o.createElement(Fe,null,n?o.createElement(Le,null):o.createElement(Be,null))},Ve=n(27622),Ue=function(){return o.createElement(i.Flex,{background:"sideBarMini","data-testid":"workspaceBar",padding:[3,2],column:!0,alignItems:"center",gap:6,height:"100vh",justifyContent:"between"},o.createElement(Ve.Z,{"data-testid":"workspaceBar-netdataLogo"}))},ze=n(6308),He=n(65840),We=n(5312),Ge=n(12008),Ke=n(88387),Je=(0,a.Z)((function(){return Promise.all([n.e(1277),n.e(3253)]).then(n.bind(n,77625))}),"Content"),Ye=(0,w.default)(i.ModalContent).attrs({width:{base:"90vw"},height:{base:"90vh",min:"90vh",max:"90vh"},padding:[0,0,4,0]}).withConfig({displayName:"configurationManagement__ModalContent",componentId:"sc-56l9v5-0"})(["box-shadow:0 18px 28px rgba(0,0,0,0.5);"]),qe=function(){return o.createElement(p.Z,{title:"Loading configuration manager"})},Qe=function(){var e=(0,We.rJ)(),t=(0,r.Z)(e,2),n=t[0],a=t[1],l=(0,We.Jx)(),c=(0,r.Z)(l,2)[1],u=(0,We.yL)(),s=(0,o.useState)(!(null!==n&&void 0!==n&&n.alertId)),d=(0,r.Z)(s,2),m=d[0],f=d[1];(0,Ge.yx)(null===n||void 0===n?void 0:n.alertId);var p=(0,Ge.E5)(null===n||void 0===n?void 0:n.alertId);(0,o.useEffect)((function(){if(!m&&null!==p&&void 0!==p&&p.fullyLoaded){var e=(0,Ke.jx)(p);c(e),f(!0)}}),[m,p]);return o.createElement(i.Modal,null,o.createElement(Ye,null,o.createElement(i.ModalHeader,{justifyContent:"between",padding:[4]},o.createElement(i.Flex,{gap:2,alignItems:"center"},o.createElement(i.Icon,{name:"alarm_bell",color:"text",size:"small"}),o.createElement(i.H4,null,"Generate Alert Configuration")),o.createElement(i.Flex,{gap:2,alignItems:"baseline"},o.createElement(x.Z,{align:"bottom",content:"Close window",zIndex:7050},o.createElement(i.Flex,null,o.createElement(i.ModalCloseButton,{onClose:function(){a(null),u()},testId:"assistant-modal-close-button"}))))),o.createElement(i.ModalBody,{height:"100%",padding:[0,4],overflow:"hidden"},m?o.createElement(o.Suspense,{fallback:o.createElement(qe,null)},o.createElement(Je,null)):o.createElement(qe,null))))},$e=n(14808),Xe=(0,a.Z)((function(){return n.e(3017).then(n.bind(n,23017)).then((function(e){return{default:e.TrialWarning}}))}),"TrialWarning"),et=(0,a.Z)((function(){return n.e(88).then(n.bind(n,10088))}),"OnPremWarning"),tt=(0,a.Z)((function(){return n.e(2713).then(n.bind(n,12713))}),"SpaceSidebar"),nt=(0,a.Z)((function(){return Promise.all([n.e(8663),n.e(5969)]).then(n.bind(n,65969))}),"Modals"),rt=(0,a.Z)((function(){return n.e(8102).then(n.bind(n,48102))}),"AcceptTermsDialog"),ot=(0,a.Z)((function(){return Promise.all([n.e(1277),n.e(7068),n.e(285),n.e(923),n.e(90),n.e(2773),n.e(5756),n.e(3981),n.e(281),n.e(3283)]).then(n.bind(n,4781))}),"SpacePages"),at=(0,a.Z)((function(){return n.e(1729).then(n.bind(n,91729))}),"AgentBanner"),it=(0,o.memo)((function(){var e=(0,ze.c)().isIntegrationsPath,t=(0,He.x4)(),n=(0,We.rJ)(),a=(0,r.Z)(n,1)[0];return o.createElement(i.Flex,{overflow:"hidden",height:"100vh",width:"100vw"},o.createElement(o.Suspense,{fallback:o.createElement(Ue,null)},o.createElement(tt,null)),o.createElement(i.Flex,{column:!0,position:"relative",overflow:"hidden",flex:!0},o.createElement(o.Suspense,{fallback:""},o.createElement(Xe,null),o.createElement(at,null)),!t&&!e&&o.createElement(De,null),o.createElement(i.Flex,{column:!0,as:"main",background:"mainBackground",flex:!0,basis:"100%",height:"100%",overflow:"hidden"},o.createElement(o.Suspense,{fallback:o.createElement(p.Z,{title:"Loading your space..."})},o.createElement(ot,null))),o.createElement(o.Suspense,{fallback:""},o.createElement(et,null))),o.createElement(o.Suspense,{fallback:""},o.createElement(nt,null),o.createElement(rt,null)),$e.h2&&a&&o.createElement(Qe,null))})),lt=function(e){var t=e.isUserLoaded;!function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).isUserLoaded,t=(0,u._8)((function(e){var t=e.set;return function(e){var n=e.results;t((0,d.YH)(),n),n.forEach((function(e){var n=e.id,r=e.permissions;t((0,m.SX)(n),r)}))}}),[]);(0,c.Z)((function(){return{key:"spaces",cache:!1,autorun:!!e,fetch:s.oq,association:{getIds:function(){return(0,d.st)("ids")},getError:function(){return(0,d.st)("error")},getLoaded:function(){return(0,d.st)("loaded")},getUpdatedAt:function(){return(0,d.st)("updatedAt")}},getResource:function(e){return(0,d.U7)({id:e})},onReceive:t,pollingOptions:{pollingInterval:412e3}}}),[!!e])}({isUserLoaded:t}),(0,f.Z)();var n=(0,d.Iw)(),r=(0,d.GM)("loaded"),a=(0,d.GM)("error"),i=(0,l.Iy)("isAnonymous");if(!t||!a&&!i&&!r)return o.createElement(p.Z,{title:"Loading your space..."});var g=n.length;if(a&&!g)throw a;return fe.ZP||i||g?o.createElement(it,null):o.createElement(Re,null)}},27622:function(e,t,n){var r=n(87462),o=n(67294),a=n(93416);t.Z=function(e){return o.createElement(a.Icon,(0,r.Z)({name:"netdataPress",color:"success",height:"32px",width:"32px"},e))}},34885:function(e,t,n){n.d(t,{Z:function(){return m}});var r=n(87462),o=n(45987),a=n(67294),i=n(4211),l=n(93416),c=function(){return a.createElement(l.Text,null,"Something went wrong during document parsing")},u=["transformConfiguration","validationConfig","validate","errorComponent","children"],s=function(e){return function(t){var n=t.transformConfiguration,l=void 0===n?{}:n,s=t.validationConfig,d=void 0===s?{}:s,m=t.validate,f=t.errorComponent,p=t.children,g=(0,o.Z)(t,u),v=function(e){var t=e.markdocContent,n=e.validate,r=e.validationConfig,o=e.transformConfiguration;return(0,a.useMemo)((function(){var e=i.ZP.parse("string"===typeof t?t:""),a=[];return n&&(a=i.ZP.validate(e,r)),{tree:a.length?null:i.ZP.transform(e,o),errors:a}}),[t,n,r,o])}({markdocContent:p,validate:m,validationConfig:d,transformConfiguration:l}),h=v.tree,b=v.errors,y=f&&"function"==typeof f?f:c;return b.length?a.createElement(y,{errors:b}):a.createElement(e,(0,r.Z)({tree:h},g))}},d=(0,a.memo)(s((function(e){var t=e.tree,n=e.renderConfiguration;return i.ZP.renderers.react(t,a,n)}))),m=(s((function(e){var t=e.tree;return i.ZP.renderers.html(t)})),d)},67622:function(e,t,n){n.d(t,{z:function(){return d}});var r=n(87462),o=n(45987),a=n(67294),i=n(71893),l=n(93416),c=n(89250),u=["disabled","children","Wrapper","textProps","to","onClick","testid","icon","iconHeight","iconWidth","iconColor","textColor","padding","margin","round","gap","actions","selected","loading","width","isSidebar","isSecondary"],s=function(e){return e?"selected":"modalBackground"},d=(0,i.default)(l.Flex).withConfig({displayName:"item__PanelRowContainer",componentId:"sc-lf007z-0"})(["cursor:pointer;&:hover{background:",";}",""],(function(e){return(0,l.getColor)(s(e.isSidebar))(e)}),(function(e){return e.selected&&"background: ".concat((0,l.getColor)(s(e.isSidebar))(e),";")})),m=(0,i.default)(l.Icon).withConfig({displayName:"item__StyledIcon",componentId:"sc-lf007z-1"})(["flex:0 0 auto;"]),f=(0,i.default)(l.IconComponents.LoaderIcon).withConfig({displayName:"item__StyledLoaderIcon",componentId:"sc-lf007z-2"})(["flex:0 0 auto;height:16px;width:16px;"]),p=(0,a.forwardRef)((function(e,t){var n=e.disabled,i=e.children,s=e.Wrapper,p=void 0===s?l.Text:s,g=e.textProps,v=e.to,h=void 0===v?"":v,b=e.onClick,y=e.testid,w=e.icon,E=e.iconHeight,C=void 0===E?"16px":E,x=e.iconWidth,O=void 0===x?"16px":x,k=e.iconColor,Z=void 0===k?"textLite":k,S=e.textColor,P=void 0===S?"textLite":S,I=e.padding,j=void 0===I?[2,4]:I,D=e.margin,N=void 0===D?[0]:D,T=e.round,F=void 0===T?0:T,M=e.gap,_=void 0===M?3:M,L=e.actions,A=e.selected,B=e.loading,R=e.width,V=void 0===R?"100%":R,U=e.isSidebar,z=void 0!==U&&U,H=e.isSecondary,W=(0,o.Z)(e,u),G=(0,c.s0)(),K=(0,a.useCallback)((function(){n||(b&&b(),h&&G(h))}),[b,n,h]),J=W["data-ga"]||"";return a.createElement(d,(0,r.Z)({ref:t,flexWrap:!1,justifyContent:"between",alignItems:"center",padding:j,margin:N,round:F,onClick:K,"data-testid":y,width:V,selected:A,disabled:n,isSidebar:z},J&&{"data-ga":J}),a.createElement(l.Flex,{alignItems:"center",gap:_,flex:!0,basis:""},B?a.createElement(f,null):"string"===typeof w?a.createElement(m,{name:w,disabled:n,color:Z,height:C,width:O}):w,!!i&&a.createElement(p,(0,r.Z)({opacity:n?"medium":void 0,width:"150px",color:P,italic:H},g),i)),L)}));t.Z=p},61458:function(e,t,n){n.d(t,{g:function(){return u}});var r=n(87462),o=n(45987),a=n(67294),i=n(71893),l=n(93416),c=["disabled","isOpen","toggleOpen","label","children","headerTestId","Header"],u=(0,i.default)(l.H4).attrs({padding:[0,2],background:"error"}).withConfig({displayName:"list__DefaultListHeader",componentId:"sc-5df7lw-0"})(["cursor:pointer;pointer-events:",";"],(function(e){return e.disabled?"none":"auto"})),s=function(e){var t=e.disabled,n=e.toggleOpen,r=e.label,o=e.testid,i=e.Header,l=void 0===i?u:i;return a.createElement(l,{"data-testid":o,onClick:n,opacity:t?"medium":void 0,disabled:t},r)};t.Z=function(e){var t=e.disabled,n=e.isOpen,i=void 0!==n&&n,u=e.toggleOpen,d=e.label,m=e.children,f=e.headerTestId,p=e.Header,g=(0,o.Z)(e,c);return a.createElement(l.Flex,(0,r.Z)({column:!0},g),a.createElement(s,{disabled:t,Header:p,toggleOpen:u,label:d,testid:f}),a.createElement(l.Collapsible,{open:i},m))}},83925:function(e,t,n){var r=n(87462),o=n(4942),a=n(45987),i=(n(92222),n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(67294)),l=n(93416),c=n(62200),u=n(82902),s=n(64637),d=["warningLevel","text","container","os","name","labels","version"];function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var f={warning:{icon:"warning_triangle_hollow",flavour:"warning",reccomendedVersion:c.I3,warningText:"is below the latest stable agent version"},critical:{icon:"warning_triangle_hollow",flavour:"error",reccomendedVersion:c._b,warningText:"is below the recommend agent version"}},p=function(e){var t=e.icon,n=e.iconColor,r=e.warningLevel,o=e.handeleNavigateToDocs,a=e.message;return i.createElement(l.Flex,{column:!0,width:{max:"200px"},gap:2},i.createElement(l.Flex,{alignItems:"center",gap:2},i.createElement(l.Icon,{name:t,color:n}),i.createElement(l.TextMicro,{color:"white"},(0,s.fm)(r))),i.createElement(l.Flex,{column:!0,gap:2},i.createElement(l.TextMicro,{color:"white"},a),i.createElement(l.TextMicro,{"data-testid":"text-agent-outdated-critical",color:"white"},i.createElement(l.Box,{"data-testid":"open-add-node",onClick:o,as:l.TextMicro,cursor:"pointer",textDecoration:"underline",color:"white"}," ","Please update them"," "),"to ensure you get the latest security bug fixes.")))};t.Z=function(e){var t=e.warningLevel,n=e.text,c=void 0===n?"Needs Update":n,g=e.container,v=e.os,h=e.name,b=e.labels,y=e.version,w=(0,a.Z)(e,d),E=f[t],C=E.icon,x=E.flavour,O=E.hollow,k=E.reccomendedVersion,Z=E.iconColor,S=E.warningText,P=(0,i.useCallback)((function(){var e=(0,u.Ly)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({container:g,os:v,version:y},b));window.open(e,"_blank","noopener,noreferrer")}),[g,v]),I="".concat(h," ").concat(S," ").concat(k);return i.createElement(l.Tooltip,{allowHoverOnTooltip:!0,content:i.createElement(p,{message:I,icon:C,iconColor:Z,warningLevel:t,handeleNavigateToDocs:P})},i.createElement(l.Pill,(0,r.Z)({icon:C,flavour:x,hollow:O},w),(0,s.fm)(c)))}},11389:function(e,t,n){var r=n(67294),o=n(22965),a=n(62200),i=n(93416);t.Z=function(e){var t=e.state,n=e.rawState,l=n||(0,o.Q5)(t),c=a.WV[l.toLocaleLowerCase()].flavour;return r.createElement(i.Pill,{flavour:c},l)}},86711:function(e,t,n){var r=n(67294),o=n(93416);t.Z=function(){return r.createElement(o.Flex,{column:!0,width:{max:"200px"},gap:2},r.createElement(o.TextMicro,{color:"white"},r.createElement(o.TextMicro,{color:"white",strong:!0},"Live:")," ","Node is actual collecting and streaming metrics to Netdata"),r.createElement(o.TextMicro,{color:"white"},r.createElement(o.TextMicro,{color:"white",strong:!0},"Stale:")," ","Node is currently offline and not streaming metrics to Netdata. It can show historical data from a parent node"),r.createElement(o.TextMicro,{color:"white"},r.createElement(o.TextMicro,{color:"white",strong:!0},"Offline:")," ","Node is currently offline, not streaming metrics to Netdata and not available in any parent node"),r.createElement(o.TextMicro,{color:"white"},r.createElement(o.TextMicro,{color:"white",strong:!0},"Unseen:")," ","Nodes have never been connected to Netdata, they are claimed but no successful connection was established"))}},91268:function(e,t,n){var r=n(87462),o=n(45987),a=n(67294),i=n(93416),l=n(59946),c=["children","sidebar","blurred","blurProps","BlurredContent","widthAuto"],u=(0,a.forwardRef)((function(e,t){var n=e.children,u=e.sidebar,s=void 0===u?null:u,d=e.blurred,m=e.blurProps,f=e.BlurredContent,p=e.widthAuto,g=void 0!==p&&p,v=(0,o.Z)(e,c);return a.createElement(i.Flex,{id:"main",height:"100%",width:g?"auto":"100%",position:"relative"},a.createElement(i.Flex,(0,r.Z)({column:!0,overflow:"hidden",width:g?"auto":"100%"},v,{ref:t}),n),s,d&&a.createElement(l.vD,m,f?a.createElement(f,null):null))}));t.Z=u},97346:function(e,t,n){var r=n(33335);t.Z=function(e){var t=e.permission,n=e.spaceId,o=e.children;return(0,r.gI)(t,n)?o:null}},14428:function(e,t,n){var r=n(87462),o=n(45987),a=n(67294),i=n(93416),l=n(33335),c=["ifForbidden","permission","spaceId","Component"],u=(0,a.forwardRef)((function(e,t){var n=e.ifForbidden,u=void 0===n?"disabled":n,s=e.permission,d=e.spaceId,m=e.Component,f=void 0===m?i.Button:m,p=(0,o.Z)(e,c),g=(0,l.gI)(s,d);return"hide"!==u||g?a.createElement(f,(0,r.Z)({ref:t,disabled:"disabled"===u&&!g||p.disabled},p)):null}));t.Z=u},15418:function(e,t,n){var r=n(87462),o=n(45987),a=n(67294),i=n(33335),l=["Component","ifForbidden","permission","children","spaceId"];t.Z=function(e){var t=e.Component,n=e.ifForbidden,c=void 0===n?"disabled":n,u=e.permission,s=e.children,d=e.spaceId,m=(0,o.Z)(e,l),f=(0,i.gI)(u,d);return"hide"!==c||f?"function"===typeof s?s(f):t?a.createElement(t,(0,r.Z)({},m,{disabled:"disabled"===c&&!f||m.disabled})):s:null}},7693:function(e,t,n){n.d(t,{x:function(){return c}});var r=n(87462),o=n(45987),a=n(67294),i=n(93416),l=["children","isSubmodal","onClose","title"],c=function(e){var t=e.children,n=e.isSubmodal,c=e.onClose,u=e.title,s=(0,o.Z)(e,l);return a.createElement(i.Flex,{justifyContent:"between",background:"modalHeaderBackground",alignItems:"center",padding:[3]},a.createElement(i.Flex,{alignItems:"center"},a.createElement(i.Button,{neutral:!0,flavour:"borderless",icon:n?"chevron_left":"x",onClick:c,"data-testid":"sidebarModalHeader_".concat(n?"chevron_left":"close_button")}),a.createElement(i.H4,(0,r.Z)({color:"text"},s),u)),t)}},16645:function(e,t,n){n.d(t,{TZ:function(){return p},ZW:function(){return g},u6:function(){return f}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(87462),a=n(29439),i=n(45987),l=n(67294),c=n(71893),u=n(46667),s=n(93416),d=["onClose","defaultIsOpen","closeOnClickOutside","closeOnEsc","full","backdrop"];function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var f=function(e){var t=e.onClose,n=e.defaultIsOpen,r=void 0===n||n,c=e.closeOnClickOutside,m=void 0===c||c,f=e.closeOnEsc,p=void 0===f||f,g=e.full,v=void 0===g?"vertical":g,h=e.backdrop,b=void 0===h||h,y=(0,i.Z)(e,d),w=(0,u.Z)(r),E=(0,a.Z)(w,2),C=E[0],x=E[1];return(0,l.useEffect)((function(){C||t&&t()}),[C]),C?l.createElement(s.Layer,{position:"right",full:v,backdrop:b,shadow:!0,onClickOutside:m?x:void 0,onEsc:p?x:void 0},l.createElement(s.Flex,(0,o.Z)({column:!0,background:"mainBackground",width:{max:"50vw",base:150}},y))):null},p=(0,c.default)(s.Flex).attrs((function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({column:!0,background:"mainBackground",padding:[3,3,0],flex:"1",gap:3},e)})).withConfig({displayName:"sidebar__SidebarContent",componentId:"sc-tmwerm-0"})([""]),g=(0,c.default)(s.Flex).attrs({justifyContent:"end",alignItems:"center",padding:[3],background:"mainBackground",border:{side:"top",color:"borderSecondary"}}).withConfig({displayName:"sidebar__SidebarFooter",componentId:"sc-tmwerm-1"})([""])},73256:function(e,t,n){n.d(t,{G:function(){return l}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(71893),a=n(93416);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var l=(0,o.default)(a.Flex).attrs((function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({padding:[3,3,0],width:"100%",background:"modalTabsBackground"},e)})).withConfig({displayName:"tabs__TabHeader",componentId:"sc-1ramyo4-0"})([""])},92903:function(e,t,n){n.d(t,{B:function(){return c}});var r=n(87462),o=n(45987),a=n(67294),i=n(93416),l=["children"],c=function(e){var t=e.children,n=(0,o.Z)(e,l);return a.createElement(i.Flex,(0,r.Z)({justifyContent:"between",background:"mainBackground",alignItems:"center",padding:[3,3,0]},n),a.createElement(i.H3,null,t))}},81488:function(e,t,n){var r=n(29439),o=n(67294),a=n(58504),i=n(93416),l=n(15794),c=n(20709);t.Z=function(e){var t=e.text,n=e.updatedAt,u=e.error,s=(0,o.useState)(),d=(0,r.Z)(s,2)[1],m=function(e){if(!e)return"";var t=new Date(e);return t.getTime()?(0,c.Z)(t,new Date):""}(n);return(0,a.Z)((function(){return d(Math.random())}),1e3),o.createElement(l.Z,{theme:"dark"},o.createElement(i.Flex,{column:!0,gap:3},o.createElement(i.TextSmall,{color:"key"},t),u&&o.createElement(i.Flex,{alignItems:"center",gap:2},o.createElement(i.Icon,{width:14,height:12,color:"text",name:"warning_triangle"}),o.createElement(i.TextSmall,null,"Error: ",m?"Data not updated":"No data")),m&&o.createElement(i.TextMicro,null,o.createElement(i.TextMicro,{color:"key"},"Last updated: "),m)))}},90025:function(e,t,n){var r=n(87462),o=n(4942),a=(n(21249),n(57640),n(9924),n(57327),n(41539),n(88449),n(2490),n(59849),n(26699),n(32023),n(47941),n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(67294)),i=n(93416),l=n(95383);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}var u={closeMenuOnSelect:!1,backspaceRemovesValue:!1,isClearable:!1,blurInputOnSelect:!0,captureMenuScroll:!0,isMulti:!0};t.Z=function(e){var t=e.selectedValue,n=e.onChange,s=e.formatOptions,d=e.filterValues,m=e.placeholder,f=void 0===m?"search...":m,p=(0,l.J7)(),g=(0,a.useMemo)((function(){return p.map((function(e){var t=e.id,n=e.name;return function(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,o.Z)(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}({label:n,value:t},s&&s({id:t,name:n}))}))}),[p,s]),v=(0,a.useMemo)((function(){return g.filter((function(e){var n=e.label,r=e.value;return t.includes(r)||d&&d({label:n,value:r})}))}),[g,t,d]),h=(0,a.useCallback)((function(e){var t=e.map((function(e){return e.value}));n(t)}),[n]);return a.createElement(i.Select,(0,r.Z)({placeholder:f},u,{options:g,value:v,onChange:h}))}},88866:function(e,t,n){n.d(t,{V:function(){return l},_:function(){return c}});var r=n(4942);n(85827),n(41539),n(25387),n(2490),n(72608),n(47941),n(82526),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);function o(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var i=[{iconName:"osAlpineLinux",logoFilename:"alpine.svg",name:"alpine",osNames:["Alpine Linux"],title:"Alpine Linux"},{iconName:"osAmazonLinux",logoFilename:"linux.svg",name:"linux",osNames:["Amazon Linux","Amazon Linux AMI"],title:"Amazon Linux"},{iconName:"osArchLinux",logoFilename:"arch.svg",name:"archarm",osNames:["Archcraft","Arch Linux","Arch Linux 32","Arch Linux ARM","ArchLabs","ArchLinux"],title:"Arch Linux"},{iconName:"osCentos",logoFilename:"centos.svg",name:"centos",osNames:["CentOS","CentOS Linux","CentOS Stream"],title:"CentOS"},{iconName:"osCoreOS",logoFilename:"coreos.svg",name:"coreos",osNames:["Container Linux by CoreOS"],title:"CoreOS"},{iconName:"osDebian",logoFilename:"debian.svg",name:"debian",osNames:["Debian GNU/Linux"],title:"Debian"},{iconName:"osFedora",logoFilename:"fedora.svg",name:"fedora",osNames:["Fedora","Fedora Linux","Fedora Remix for WSL"],title:"Fedora"},{iconName:"osFreeBSD",logoFilename:"freebsd.svg",name:"freebsd",osNames:["FreeBSD"],title:"FreeBSD"},{iconName:"serviceFreeNAS",logoFilename:"freenas.svg",name:"freenas",osNames:[],title:"FreeNAS"},{iconName:"osGentoo",logoFilename:"gentoo.svg",name:"gentoo",osNames:["Gentoo"],title:"Gentoo"},{iconName:"serviceKubernetes",logoFilename:"kubernetes.svg",name:"kubernetes",osNames:[],title:"Kubernetes"},{iconName:"osLinux",logoFilename:"linux.svg",name:"linux",osNames:[],title:"Linux"},{iconName:"osMacOSX",logoFilename:"macos.svg",name:"macos",osNames:["mac"],title:"MacOS"},{iconName:"osMacOSX",logoFilename:"macos.svg",name:"mac",osNames:["mac"],title:"MacOS"},{iconName:"osLinuxManjaro",logoFilename:"manjaro.svg",name:"manjaro",osNames:["Manjaro Linux","Manjaro-ARM"],title:"Manjaro"},{iconName:"serviceOpenStack",logoFilename:"openstack.svg",name:"openstack",osNames:[],title:"OpenStack"},{iconName:"osSuseLinux",logoFilename:"opensuse.svg",name:"opensuse",osNames:["openSUSE","openSUSE Leap","openSUSE Leap Micro","openSUSE MicroOS","openSUSE Tumbleweed"],title:"Open Suse"},{iconName:"serviceOpenWrt",logoFilename:"openwrt.svg",name:"openwrt",osNames:["OpenWrt"],title:"OpenWRT"},{iconName:"osOracle",logoFilename:"oracle.svg",name:"oracle",osNames:["Oracle Linux Server"],title:"Oracle Linux"},{iconName:"servicePfSense",logoFilename:"pfsense.svg",name:"pfsense",osNames:[],title:"PFSense"},{logoFilename:"raspberry-pi.svg",name:"raspberry-pi",osNames:[],title:"Raspberry PI"},{iconName:"osRaspbian",name:"raspbian",osNames:["Raspbian","Raspbian GNU/Linux"],title:"Raspbian"},{iconName:"osRedHat",logoFilename:"redhat.svg",name:"redhat",osNames:["Red Hat Enterprise Linux","Red Hat Enterprise Linux Server","Red Hat Enterprise Linux Workstation","RedHatEnterpriseServer"],title:"Red Hat Enterprise Linux"},{iconName:"osSuseLinux",logoFilename:"suse.svg",name:"suse",osNames:[],title:"Suse"},{iconName:"osUbuntu",logoFilename:"ubuntu.svg",name:"ubuntu",osNames:["Ubuntu","Ubuntu Core"],title:"Ubuntu"}],l=i.reduce((function(e,t){return a(a({},e),{},(0,r.Z)({},t.name,t))}),{}),c=i.reduce((function(e,t){return a(a({},e),t.osNames.reduce((function(e,n){return a(a({},e),{},(0,r.Z)({},n,t))}),{}))}),{})},15257:function(e,t,n){n.d(t,{Z:function(){return T}});var r=n(87462),o=n(45987),a=n(29439),i=(n(57327),n(41539),n(88449),n(2490),n(59849),n(21249),n(57640),n(9924),n(71893)),l=n(67294),c=n(93416),u=n(15794),s=n(67622),d=i.default.div.withConfig({displayName:"styled__Divider",componentId:"sc-14bbmjw-0"})(["background:",";height:1px;width:auto;margin:"," ",";"],(0,c.getColor)("disabled"),(0,c.getSizeBy)(1),(0,c.getSizeBy)(2)),m=n(31203),f=n(46667),p=n(13477),g=n(1043),v=n(83356),h=(n(88674),n(17727),n(16645)),b=n(7693),y=n(73256),w=n(21960),E=n(63346),C={flex:"grow",height:"100%",overflow:"auto"},x={flex:"1",height:"100%",overflow:"auto"},O=function(e){var t=e.onClose,n=(0,l.useState)(!1),o=(0,a.Z)(n,2),i=o[0],u=o[1],s=(0,l.useState)(!1),d=(0,a.Z)(s,2),m=d[0],f=d[1],g=(0,l.useState)({}),v=(0,a.Z)(g,2),O=v[0],k=v[1],Z=(0,w.Z)(),S=Z.handleChangeTab,P=Z.activeTabIndex,I=Z.tabsByName,j=Z.tabs,D=(0,p.oH)(void 0,{shouldPersist:!0,onSuccess:t}),N=(0,l.useCallback)((function(){u(!0),D(O).finally((function(){return u(!1)}))}),[O]),T=(0,l.useMemo)((function(){return j.map((function(e){var n=I[e],o=n.label,a=n.testId,i=n.Component;return l.createElement(c.Tab,{key:e,label:o,"data-testid":"userProfileModal-".concat(a)},l.createElement(E.ZP,{tab:e},l.createElement(i,(0,r.Z)({},"profile"===e&&{setFormState:k,setFormValid:f},{onClose:t}))))}))}),[j]);return l.createElement(h.u6,{onClose:t},l.createElement(E.ZP,{feature:"UserSettings"},l.createElement(b.x,{onClose:t,title:"Settings"},"profile"===j[P]&&l.createElement(c.Button,{disabled:!m,label:"Save",onClick:N,isLoading:i,loadingLabel:"saving..."})),l.createElement(c.Tabs,{flex:"1",height:"100%",overflow:"hidden",selected:P,onChange:S,TabContent:h.TZ,TabsHeader:y.G,tabsProps:C,tabContentProps:x},T)))},k=n(82351),Z=(0,i.default)(c.Flex).attrs({column:!0,round:1}).withConfig({displayName:"dropdown__Dropdown",componentId:"sc-w0ej6i-0"})(["box-shadow:0 4px 4px rgba(0,0,0,0.25);"]),S=n(78710),P=n(39979),I=["hasSeparator","name"],j=(0,P.Z)(s.Z),D={"Operational Status":function(){return!0},"Sign In":function(e){return e.isAnonymous},Settings:function(e){var t=e.isAgent,n=e.isAnonymous;return t||!n},"Sign Out":function(e){return!e.isAnonymous}},N=(0,i.default)(c.Button).withConfig({displayName:"userControl__SignInButton",componentId:"sc-n4ebn8-0"})(["&&{> .button-icon{width:24px;height:24px;}}"]),T=function(e){var t=e.dropdownBackground,n=void 0===t?"dropdown":t,i=(0,p.Iy)("avatarURL"),s=(0,p.Iy)("name"),h=(0,p.Iy)("isAnonymous"),b=(0,f.Z)(),y=(0,a.Z)(b,4),E=y[0],C=y[2],x=y[3],P=(0,l.useCallback)((function(){window.open("https://status.netdata.cloud","_blank")}),[]),T=(0,g.UQ)(),F=(0,v.Z)(),M=(0,w.Z)(),_=M.handleOpenProfileModal,L=M.handleCloseProfileModal,A=M.isProfileModalOpen,B=(0,l.useMemo)((function(){return[{name:"Settings",onClick:function(){x(),_()},hasSeparator:!1,testid:"userControl-settings"},{name:"Operational Status",onClick:function(){x(),P()},hasSeparator:!1,testid:"userControl-operationalStatus"},{name:"Sign In",onClick:function(){x(),F()},hasSeparator:!0,testid:"userControl-signOut"},{name:"Sign Out",onClick:function(){x(),T()},hasSeparator:!0,testid:"userControl-signOut"}].filter((function(e){return D[e.name]({isAgent:S.ZP,isAnonymous:h})}))}),[h,S.ZP]);return l.createElement(u.Z,null,l.createElement(k.Z,!h&&{content:"Edit your account settings and manage your notifications",align:"right"},!S.ZP&&h?l.createElement(k.Z,{content:"Sign In",align:"right"},l.createElement(N,{small:!0,icon:"sign_in",onClick:C,"data-ga":"sidebar-sign-in::click-dropdown::global-view","data-testid":"sign-in-dropdown",iconSize:"medium",margin:[0,0,2]})):l.createElement(m.Z,{src:i||"","data-testid":"userControl-userAvatar",onClick:C,title:s})),E&&l.createElement(c.Layer,{margin:[5,17],position:"bottom-left",onClickOutside:x,onEsc:x},l.createElement(Z,{background:n,padding:[2]},B.map((function(e){var t=e.hasSeparator,n=e.name,a=(0,o.Z)(e,I);return l.createElement(l.Fragment,{key:n},t&&l.createElement(d,{key:"".concat(n,"-itemSeparator")}),l.createElement(j,(0,r.Z)({key:n,round:1,payload:{description:"User menu - Click ".concat(n)}},a),n))})))),A&&l.createElement(O,{onClose:L}))}},16772:function(e,t,n){var r=n(87462),o=n(45987),a=n(67294),i=n(93416),l=["onChange","value","onKeyDown","label"];t.Z=function(e){var t=e.onChange,n=e.value,c=e.onKeyDown,u=e.label,s=(0,o.Z)(e,l);return a.createElement(i.TextInput,(0,r.Z)({label:u,name:"userEmail",placeholder:"Enter an email address",value:n,onChange:t,onKeyDown:c},s))}},21960:function(e,t,n){n.d(t,{Z:function(){return Xe}});var r=n(29439),o=(n(57327),n(41539),n(88449),n(2490),n(59849),n(47941),n(26699),n(32023),n(67294)),a=n(65351),i=n(13477),l=n(93416),c=n(30688),u=n(31203),s=n(1043),d=n(46667),m=n(87462),f=n(93433),p=n(45987),g=(n(92222),n(71752)),v=["value","isValid","setIsValid","onChange","label","validators","hint"],h="User name cannot exceed ".concat(40," characters"),b=function(e){var t=e.length<=40;return(0,c.f)(t,h)},y=function(e){var t=e.value,n=e.isValid,a=e.setIsValid,i=e.onChange,u=e.label,s=e.validators,d=void 0===s?[]:s,h=e.hint,y=(0,p.Z)(e,v),w=(0,c.A)([b].concat((0,f.Z)(d))),E=(0,o.useState)(""),C=(0,r.Z)(E,2),x=C[0],O=C[1];return(0,o.useEffect)((function(){var e=w(t),r=e.isValid,o=(0,g.T)(e);!n&&r?a(!0):n&&!r&&a(!1),O(o||"")}),[n,t]),o.createElement(l.TextInput,(0,m.Z)({label:u||" ",name:"userName",placeholder:"Enter the user's name",value:t,onChange:i,hint:h,error:!n&&x},y))},w=n(16772),E=n(36285),C=n(74059),x=n(94666),O=n(72671),k=[function(e){return(0,c.f)(!!e,"Name should not be empty")}],Z=function(){},S=(0,O.F)((function(e){var t=e.isLastMember,n=e.spaceName,r=e.children;return o.createElement(l.Flex,{column:!0,gap:2},o.createElement(l.Text,null,"You are about to delete your account at ",o.createElement("strong",null,"Netdata"),". All data related to your account will be deleted."),t&&o.createElement(o.Fragment,null,o.createElement(l.Text,null,o.createElement(l.Text,{strong:!0},n)," space will be deleted since you are the last member."),r),o.createElement(l.Text,null,"This cannot be undone. Are you sure you want to continue?"))})),P=function(e){var t=e.setFormValid,n=e.setFormState,a=(0,i.Iy)("name"),c=(0,l.useInputValue)({value:a,maxChars:40}),m=(0,r.Z)(c,4),f=m[0],p=m[1],g=m[2],v=m[3],h=(0,o.useState)(!1),b=(0,r.Z)(h,2),O=b[0],P=b[1],I=(0,d.Z)(),j=(0,r.Z)(I,4),D=j[0],N=j[2],T=j[3],F=(0,d.Z)(),M=(0,r.Z)(F,2),_=M[0],L=M[1],A=(0,E.RP)().value,B=(0,C.OS)(),R=1===(0,x.H4)().length,V=(0,i.Iy)("email"),U=(0,i.Iy)("avatarURL");(0,o.useEffect)((function(){v&&t(O)}),[v,O]),(0,o.useEffect)((function(){n({name:f})}),[f]);var z=(0,s.R2)();return o.createElement(l.Flex,{column:!0,justifyContent:"between",flex:"grow"},o.createElement(l.Flex,{column:!0,gap:3},o.createElement(l.Text,{strong:!0,"data-testid":"userProfile-label"},"Photo"),o.createElement(u.Z,{src:U||"","data-testid":"userProfile-avatar",width:16,height:16}),o.createElement(y,{"data-testid":"userProfile-username",value:f,label:"Name",onChange:p,isValid:O,setIsValid:P,validators:k,fieldIndicator:g,instantFeedback:"positiveFirst",isDirty:v}),o.createElement(w.Z,{"data-testid":"userProfile-email",label:"Email",disabled:!0,value:V,onChange:Z})),o.createElement(l.Flex,{alignSelf:"end"},o.createElement(l.Button,{flavour:"borderless",danger:!0,onClick:N,label:"Delete account","data-ga":"user-profile-settings::click-delete::global-view","data-testid":"userProfile-deleteAccount-button"})),D&&o.createElement(l.ConfirmationDialog,{confirmLabel:_?"Deleting...":"Yes, delete","data-ga":"delete-account-dialog","data-testid":"deleteAccountDialog",handleConfirm:function(){L(),z()},handleDecline:T,message:o.createElement(S,{isLastMember:R,spaceName:B.name,currentPlan:A}),title:"Delete Account",isConfirmDisabled:_,isConfirmLoading:_,isDeclineDisabled:_}))},I=(n(57830),n(33937)),j=function(){var e=(0,I.kq)("theme"),t=(0,r.Z)(e,2),n=t[0],a=t[1],i=(0,o.useCallback)((function(e){return a(e.target.value)}),[]);return o.createElement(l.Flex,{column:!0,gap:3,justifyContent:"between"},o.createElement(l.Flex,{column:!0,gap:2},o.createElement(l.Text,{strong:!0},"Netdata Theme"),o.createElement(l.RadioButton,{label:"Light Theme",checked:"light"===n,onChange:i,value:"light"}),o.createElement(l.RadioButton,{label:"Dark Theme",checked:"dark"===n||!n||"unspecified"===n,onChange:i,value:"dark"})))},D=n(92432),N=n(82351),T=n(93017),F=n(15861),M=n(64687),_=n.n(M),L=(n(73210),(0,n(39979).Z)(l.Button)),A=function(e){var t=e.onCloseModal,n=e.onCreate,a=(0,o.useState)(""),i=(0,r.Z)(a,2),c=i[0],u=i[1];return o.createElement(l.ModalContent,null,o.createElement(l.ModalHeader,null,"Create New Token",o.createElement(l.ModalCloseButton,{testId:"close-button",onClose:t})),o.createElement(l.ModalBody,null,o.createElement(l.Flex,{height:10,width:80},o.createElement(l.TextInput,{"data-testid":"description",placeholder:"Enter Description",onChange:function(e){var t=e.target;return u(t.value)},value:c}))),o.createElement(l.ModalFooter,null,o.createElement(L,{disabled:""===c.trim(),label:"Create",onClick:function(){return n(c)},"data-testid":"btn-create",payload:{description:"Modal - Create Token"}})))},B=n(71893),R=B.default.div.withConfig({displayName:"styled__TokenContainer",componentId:"sc-s1axew-0"})(["display:flex;flex-direction:column;align-items:center;color:",";background:",";border:1px solid ",";border-radius:2px;overflow-wrap:anywhere;white-space:pre-wrap;padding:23px 27px 14px;width:100%;font-family:Courier New,monospace;letter-spacing:0.09px;line-height:18px;font-size:14px;word-break:break-word;"],(0,l.getColor)("textDescription"),(0,l.getColor)("modalTabsBackground"),(0,l.getColor)("borderSecondary")),V=function(e){return o.createElement(l.Box,(0,m.Z)({},e,{as:l.Icon,sx:{borderRadius:"50%",overflow:"hidden",background:(0,l.getColor)(["neutral","white"])}}))},U=function(e){return o.createElement(l.Text,(0,m.Z)({},e,{color:["neutral","grey35"]}))},z=function(e){return o.createElement(l.Flex,(0,m.Z)({},e,{as:l.Icon,sx:{alignSelf:"flex-end",cursor:"pointer"}}))},H=(n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(4942)),W=n(58206),G=n(55678),K=n(74855);function J(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach((function(t){(0,H.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(){(0,W.Z)(e);var n=(0,K.sc)(Y(Y({},Y({header:"Copied",text:"Token copied to your clipboard!",icon:"gear"},t)),{},{success:!0}));G.Am.success(n,{context:"copy"})}},Q=n(63346),$=function(e){var t=e.onCloseModal,n=e.token;return o.createElement(l.ModalContent,null,o.createElement(Q.Xe,{feature:"TokenCreated"},o.createElement(l.ModalHeader,null,"Token Generated",o.createElement(l.ModalCloseButton,{testId:"close-button",onClose:t})),o.createElement(l.ModalBody,null,o.createElement(l.Flex,{column:!0,gap:4},o.createElement(R,null,o.createElement("span",{"data-testid":"token"},n),o.createElement(z,{name:"copy",size:"small",color:"primary",onClick:q(n),"data-ga":"profile::click-copytoken::all-pages::api-token"})),o.createElement(l.Flex,{alignItems:"center",background:"warningBackground",gap:4,padding:[3,3],round:!0},o.createElement(V,{"data-testid":"noNodesView-warningBannerIcon",name:"exclamation",color:"warning"}),o.createElement(U,{"data-testid":"warning-message"},"Make sure to copy or store this token and add it where you need it. Once you close this modal you will not be able to retrieve it again.")))),o.createElement(l.ModalFooter,null,o.createElement(l.Button,{label:"Close",onClick:t}))))},X=(n(41817),n(26398)),ee=function(e){var t=e.description,n=e.scopes;return X.Z.post("/api/v1/auth/account/api-token",{description:t,scopes:n})},te=function(e){return X.Z.delete("/api/v1/auth/account/api-token/".concat(e))},ne=function(e){var t=e.onCloseModal,n=e.onTokenCreated,a=e.view,i=e.token,c=(0,o.useState)(a),u=(0,r.Z)(c,2),s=u[0],d=u[1],m=(0,o.useState)(i),f=(0,r.Z)(m,2),p=f[0],g=f[1],v=function(){var e=(0,F.Z)(_().mark((function e(t){var r;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ee({description:t});case 2:r=e.sent,(0,D.L)("api-token","create-token","profile",t),g(r.data.token),d("CopyTokenView"),n();case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return o.createElement(l.Modal,{onClickOutside:t,onEsc:t},"CreateView"===s&&o.createElement(A,{"data-testid":"create-view",onCloseModal:t,onCreate:v}),"CopyTokenView"===s&&p&&o.createElement($,{onCloseModal:t,token:p}))},re=(n(21249),n(57640),n(9924),n(49546));function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){(0,H.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ie=function(){var e=(0,o.useState)([]),t=(0,r.Z)(e,2),n=t[0],a=t[1],i=(0,d.Z)(!0),l=(0,r.Z)(i,4),c=l[0],u=l[2],s=l[3],m=function(){var e=(0,F.Z)(_().mark((function e(){var t;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(),e.next=3,X.Z.get("/api/v1/auth/account/api-token");case 3:t=e.sent,s(),a(t.data.map((function(e){return ae(ae({},e),{},{created_at:e.created_at?(0,re.default)(new Date(e.created_at),"dd/MM/yyyy"):null,last_used_at:e.last_used_at?(0,re.default)(new Date(e.last_used_at),"dd/MM/yyyy"):null})})));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,o.useEffect)((function(){m()}),[]),{isLoading:c,data:n,setData:a,fetchData:m}},le=n(54005),ce={right:["actions"]},ue=[{id:"description",header:"Description",fullWidth:!0,size:200,meta:{cellStyles:{sx:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}}},cell:function(e){var t=e.getValue;return o.createElement(N.Z,{plain:!0,content:t()||"",isBasic:!0},o.createElement(l.Text,{whiteSpace:"nowrap",truncate:!0},t()||""))}},{id:"created_at",header:"Created at",cell:function(e){return(0,e.getValue)()||"-"}},{id:"last_used_at",header:"Used at",cell:function(e){return(0,e.getValue)()||"-"}},{id:"ends_with",header:"Token",cell:function(e){var t=e.getValue;return o.createElement(o.Fragment,null,o.createElement(l.Text,{style:{verticalAlign:"sub"}},"******"),t())}}],se=function(){var e=(0,o.useState)(!1),t=(0,r.Z)(e,2),n=t[0],a=t[1],i=(0,o.useState)(!1),c=(0,r.Z)(i,2),u=c[0],s=c[1],d=(0,o.useState)(null),m=(0,r.Z)(d,2),f=m[0],p=m[1],g=ie(),v=g.data,h=g.setData,b=g.fetchData,y=(0,le.Z)().sendButtonClickedLog,w=(0,o.useMemo)((function(){return{addEntry:{handleAction:function(){a(!0),y({label:"Create new token"},!0)},tooltipText:"Create new token"}}}),[y]),E=(0,T.Z)(),C=(0,r.Z)(E,2)[1],x=(0,o.useMemo)((function(){return{delete:{handleAction:function(e){var t=e.id;te(t).then((function(){h((function(e){return e.filter((function(e){return e.id!==t}))})),(0,D.L)("api-token","delete-token","profile"),y({label:"Delete token"},!0)})).catch(C)},confirmationTitle:"Delete API Token",confirmationMessage:"You are about to delete API Token, are you sure you want to continue?"}}}),[v]);return o.createElement(o.Fragment,null,o.createElement(l.Table,{dataColumns:ue,data:v,bulkActions:w,rowActions:x,enableResizing:!0,enableSorting:!0,columnPinning:ce,enableColumnPinning:!0}),n&&o.createElement(ne,{view:"CreateView",onCloseModal:function(){return a(!1)},onTokenCreated:b}),u&&o.createElement(ne,{view:"CopyTokenView",onCloseModal:function(){s(!1),p(null)},token:f}))},de=n(3528),me=n(14808),fe=n(50308),pe=n.n(fe),ge=["disabledInfo"],ve=["title","description","label","checked","onChange"],he=function(e){var t,n=e.title,r=void 0===n?"":n,a=e.description,i=void 0===a?"":a,c=e.label,u=void 0===c?"":c,s=e.checked,d=e.onChange,f=void 0===d?pe():d,g=(0,p.Z)(e,ve),v=(t=l.Toggle,function(e){var n=e.disabledInfo,r=void 0===n?"This setting is disabled":n,a=(0,p.Z)(e,ge);return(a||{}).disabled?o.createElement(N.Z,{content:r},o.createElement(l.Box,null,o.createElement(t,a))):o.createElement(t,a)});return o.createElement(l.Flex,{justifyContent:"between",alignItems:"center"},o.createElement(l.Box,null,o.createElement(l.H5,null,r),o.createElement(l.TextSmall,null,i)),o.createElement(v,(0,m.Z)({colored:!0,onChange:f,checked:s,"data-testid":"profileNotifications-".concat(u,"NotificationsToggle"),"data-ga":"profile-ntab::click-toggle::global-view::".concat(s?"enabled":"disabled")},g)))},be=n(1653),ye=(n(66992),n(88674),n(78783),n(33948),function(e){var t=e.value;return o.createElement(l.Box,{width:"232px",height:"232px",background:"white",padding:[4],round:3},o.createElement(be.ZP,{size:200,value:t}))}),we=function(e){var t=e.onClose,n=void 0===t?pe():t,a=function(){var e=ie(),t=e.isLoading,n=e.data,a=(0,o.useState)(),i=(0,r.Z)(a,2),l=i[0],c=i[1],u=(0,T.Z)(),s=(0,r.Z)(u,2)[1],d=function(){var e=(0,F.Z)(_().mark((function e(){var t,r;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null===n||void 0===n?void 0:n.length)>0)){e.next=3;break}return e.next=3,Promise.all(n.map((function(e){var t=e.id;return te(t)}))).catch(s);case 3:return e.next=5,ee({description:"Mobile App",scopes:["scope:mobile-app"]});case 5:t=e.sent,null!==(r=t.data)&&void 0!==r&&r.token&&c(r.token);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,o.useEffect)((function(){t||d()}),[t]),{token:l}}(),i=a.token;return o.createElement(l.Modal,null,o.createElement(l.ModalContent,{width:{min:100,base:140}},o.createElement(l.ModalHeader,null,o.createElement(l.Text,null,"Scan QR Code"),o.createElement(l.ModalCloseButton,{onClose:n,testId:"close-button"})),o.createElement(l.ModalBody,null,o.createElement(l.Flex,{alignItems:"center",justifyContent:"center",height:100},i?o.createElement(ye,{value:i}):o.createElement(l.Flex,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",padding:[4]},o.createElement(l.H3,null,"Generating token")))),o.createElement(l.ModalFooter,null,o.createElement(l.Flex,{justifyContent:"end",padding:[1,2]},o.createElement(l.Button,{label:"Done",onClick:n})))))},Ee=function(){var e=(0,de.MJ)("email"),t=(0,r.Z)(e,2),n=t[0],a=t[1],i=(0,o.useCallback)((function(){return a(!n)}),[n,a]),c=(0,de.MJ)("mobileApp"),u=(0,r.Z)(c,2),s=u[0],m=u[1],f=(0,o.useCallback)((function(){m(!(null!==s&&void 0!==s&&s.enabled))}),[s,m]),p=(0,d.Z)(),g=(0,r.Z)(p,4),v=g[0],h=g[2],b=g[3];return o.createElement(l.Flex,{column:!0,gap:2},o.createElement(he,{title:"E-mail",description:"Netdata will send you health notifications via e-mails",label:"email",checked:n,onChange:i}),me.xy&&o.createElement(l.Flex,{column:!0},o.createElement(he,{title:"Mobile App Notifications",description:"Netdata will send you health notifications via mobile app notifications",label:"mobileApp",checked:null===s||void 0===s?void 0:s.enabled,onChange:f,disabled:!(null!==s&&void 0!==s&&s.linked),disabledInfo:"You have to link a device first and then enable notifications"}),o.createElement(l.Flex,{justifyContent:"end"},o.createElement(l.Button,{flavour:"borderless",icon:"qrCode",iconColor:"primary",iconSize:"small",onClick:h},o.createElement(l.Text,{color:"primary"},"Show QR code"))),v&&o.createElement(we,{onClose:b})))},Ce=(n(85827),n(25387),n(72608),n(78266)),xe=n(33335),Oe=(n(69826),n(31672),n(59461),n(45736)),ke=n(23383),Ze=n(95383),Se=(n(26833),n(3689)),Pe=n(8018),Ie=n(37518),je=B.default.div.withConfig({displayName:"styled__Row",componentId:"sc-lpc291-0"})(["width:100%;height:",";display:flex;flex-flow:row nowrap;align-items:center;padding-left:",";margin-bottom:",";"],(0,l.getSizeBy)(5),(0,l.getSizeBy)(3),(0,l.getSizeBy)(2)),De=(0,B.default)(l.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-lpc291-1"})(["width:20px;height:20px;margin-right:",";"],(0,l.getSizeBy)()),Ne=(0,B.css)(["&&{width:200px;}margin-left:auto;"]),Te=(0,B.default)(l.Select).withConfig({displayName:"styled__StyledSelect",componentId:"sc-lpc291-2"})(["",""],Ne),Fe=(0,B.default)(l.Button).withConfig({displayName:"styled__SettingsLoader",componentId:"sc-lpc291-3"})([""," color:",";border:1px solid ",";.path{stroke:",";}"],Ne,(0,l.getColor)("text"),(0,l.getColor)("border"),(0,l.getColor)("text")),Me=function(e){var t=e.roomId,n=e.spaceId,a=(0,de.dR)({roomId:t,spaceId:n,key:"alarms"}),i=(0,r.Z)(a,2),l=i[0],c=i[1],u=(0,o.useCallback)((function(e){c(e.value)}),[c]);return o.createElement(Te,{options:Object.values(Se.YM),value:Se.YM[l],onChange:u})},_e=function(e){var t=e.roomId,n=e.spaceId,a=(0,o.useState)(),i=(0,r.Z)(a,2),c=i[0],u=i[1],s=(0,Pe.qn)(n,t,{onFail:function(){u(!1)},onSuccess:function(){u(!1)}}),d=(0,o.useCallback)((function(){u(!0),s()}),[s,t]);return o.createElement(l.Box,{margin:[0,2,0,"auto"]},o.createElement(N.Z,{content:"Join this room to activate notifications for it",isBasic:!0},o.createElement(l.Button,{isLoading:c,label:"Join",onClick:d,flavour:"hollow"})))},Le=function(e){var t=e.isMember,n=e.roomId,r=e.spaceId,a=(0,Ie.tE)(n,"name");return o.createElement(je,{"data-testid":"roomSettings-room-".concat(a),"data-ga":"profile-ntab::click-join-room-".concat(a,"::global-view")},o.createElement(De,{name:"room",color:"text"}),o.createElement(l.Text,null,a),t?o.createElement(o.Suspense,{fallback:o.createElement(Fe,{isLoading:!0,flavour:"hollow",label:"Loading settings.."})},o.createElement(Me,{roomId:n,spaceId:r})):o.createElement(_e,{roomId:n,spaceId:r}))},Ae=B.default.div.withConfig({displayName:"styled__CollapsibleRoot",componentId:"sc-1p8t8zr-0"})(["width:100%;height:",";display:flex;flex-flow:row nowrap;align-items:center;cursor:pointer;margin-bottom:",";"],(0,l.getSizeBy)(5),(0,l.getSizeBy)(2)),Be=(0,B.default)(l.Icon).withConfig({displayName:"styled__OpenerIcon",componentId:"sc-1p8t8zr-1"})(["height:5px;width:6px;margin-right:",";",";"],(0,l.getSizeBy)(2),(function(e){return e.expanded&&"transform: rotate(90deg)"})),Re=(0,B.default)(l.Icon).withConfig({displayName:"styled__SpaceIcon",componentId:"sc-1p8t8zr-2"})(["width:20px;height:20px;margin-right:",";"],(0,l.getSizeBy)()),Ve=(0,B.default)(l.Text).withConfig({displayName:"styled__SpaceLabel",componentId:"sc-1p8t8zr-3"})(["font-weight:bold;"]),Ue=(0,B.default)(l.TextSmall).withConfig({displayName:"styled__SettingsInfo",componentId:"sc-1p8t8zr-4"})(["margin-left:auto;opacity:0.8;"]),ze=n(26913),He=function(e){var t=e.expanded,n=e.onExpand,r=e.label,a=e.spaceId;(0,ze.Z)(a);var i=(0,Oe.pV)(a,"channels").find((function(e){return"Email"===e.integration}))||{};return o.createElement(Ae,{onClick:n,"data-testid":"spaceRoot-space-".concat(r)},o.createElement(Be,{name:"chevron_right_s",expanded:t,color:"text"}),o.createElement(Re,{name:"space",color:"text"}),o.createElement(Ve,null,r),!i.enabled&&o.createElement(Ue,null,"E-mail notifications for this space has been disabled by admin"))},We={width:"108px",height:"77px"},Ge=function(e){var t=e.spaceId,n=e.isCurrent,a=e.showAllRooms,i=(0,d.Z)(n),c=(0,r.Z)(i,2),u=c[0],s=c[1],m=(0,ke.Z)(t,{autorun:!1,polling:!1}),f=(0,Ze.y3)(t,"loaded");(0,o.useEffect)((function(){t&&u&&!f&&m()}),[u,f,t,m]);var p=(0,C.vu)(t,"name"),g=(0,Ze.WY)(t),v=(0,o.useMemo)((function(){return a?g:g.filter((function(e){return e.isMember}))}),[g,a]),h=(0,o.useRef)();return(0,o.useEffect)((function(){u&&h.current&&h.current.scrollIntoView({behavior:"smooth",block:"start"})}),[u]),o.createElement(l.Flex,{column:!0,ref:h},o.createElement(He,{expanded:u,onExpand:s,label:p,spaceId:t}),o.createElement(l.Collapsible,{open:u},(function(){return f?o.createElement(o.Fragment,null,v.map((function(e){var n=e.id,r=e.isMember;return o.createElement(Le,{isMember:r,key:n,roomId:n,spaceId:t})}))):o.createElement(Ce.Z,{iconProps:We,title:"Loading..."})})))},Ke=n(22613),Je={width:"108px",height:"77px"},Ye=function(){var e=(0,C.th)(),t=function(e){var t=(0,C.GM)("ids");return(0,o.useMemo)((function(){return t.reduce((function(t,n){return n===e?[n].concat((0,f.Z)(t)):[].concat((0,f.Z)(t),[n])}),[])}),[e,t])}(e),n=(0,xe.gI)("room:ReadAll"),a=(0,o.useState)(!1),i=(0,r.Z)(a,2),c=i[0],u=i[1];return o.createElement(o.Fragment,null,o.createElement(l.H4,null,"Notifications for all your Netdata Spaces and all the Rooms you are in"),n&&o.createElement(Ke.Z,{onFilterClick:function(e){return function(t){t.stopPropagation(),u(e)}},showAllRooms:c,padding:[1,0]}),o.createElement(l.Flex,{overflow:{vertical:"auto"},column:!0,"data-testid":"spaceRoomNotifications-spacesContainer",padding:[3,0,3]},o.createElement(o.Suspense,{fallback:o.createElement(Ce.Z,{iconProps:Je,title:"Loading notification settings..."})},t.map((function(t){return o.createElement(Ge,{key:t,isCurrent:t===e,showAllRooms:c,spaceId:t})})))))},qe={offline:["theme"],online:["profile","theme","notifications","apiTokens"]},Qe={profile:{Component:P,label:"Profile",order:0,testId:"profileTab"},theme:{Component:j,label:"Theme",order:1,testId:"themeTab"},notifications:{Component:(0,o.memo)((function(){return o.createElement(l.Flex,{overflow:{vertical:"hidden"},column:!0,gap:2},o.createElement(l.H4,null,"Notification Methods"),o.createElement(o.Suspense,{fallback:"..."},o.createElement(Ee,null)),o.createElement(l.Flex,{height:"1px",background:"border"}),o.createElement(Ye,null))})),label:"Notifications",order:2,testId:"notificationsTab"},apiTokens:{Component:se,label:"API tokens",order:3,testId:"apiTokensTab"}},$e=function(e){return(Qe[e]||Qe.profile).order},Xe=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).modalName,t=void 0===e?"profile":e,n=(0,i.Iy)("isAnonymous"),l=(0,o.useMemo)((function(){return Object.keys(Qe).filter((function(e){return qe[n?"offline":"online"].includes(e)}))}),[n]),c=(0,a.Z)(t),u=c.isModalOpen,s=c.currentModalTab,d=c.handleOpenModal,m=c.handleCloseModal,f=c.handleChangeModalTab,p=(0,o.useState)($e(s)),g=(0,r.Z)(p,2),v=g[0],h=g[1],b=function(e){f(e)};return(0,o.useEffect)((function(){h($e(s))}),[s]),{handleOpenProfileModal:function(){d(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"profile")},handleCloseProfileModal:function(){m()},getPreselectedTab:$e,setCurrentTab:b,handleChangeTab:function(e){var t=l[e];h(e),b(t)},tabs:l,tabsByName:Qe,activeTabIndex:v,isProfileModalOpen:u}}},60593:function(e,t,n){n.d(t,{Gx:function(){return v},Iu:function(){return l},KW:function(){return c},Vt:function(){return x},YC:function(){return k},Z2:function(){return E},_L:function(){return a},bo:function(){return Z},hl:function(){return S},hq:function(){return d},nb:function(){return f},pt:function(){return w},rT:function(){return P},w6:function(){return y},yA:function(){return b},yi:function(){return h}});var r=n(93433),o=(n(26833),n(47941),n(92222),{threshold:{label:"Threshold",value:"threshold"},variance:{label:"Variance",value:"variance"},anomalies:{label:"Anomalies",value:"anomalies"}}),a=Object.values(o),i=o.threshold.value,l={thresholds:{above:{label:"above",value:"above",symbol:">"},below:{label:"below",value:"below",symbol:"<"}}},c=Object.values(l.thresholds),u=l.thresholds.above,s={seconds:{label:"seconds",value:"seconds",symbol:"s"},minutes:{label:"minutes",value:"minutes",symbol:"m"},hours:{label:"hours",value:"hours",symbol:"h"},days:{label:"days",value:"days",symbol:"d"}},d=Object.values(s),m={"5_min":{label:"5 mins",value:"5_min",after:"-5m"},"10_min":{label:"10 mins",value:"10_min",after:"-10m"},"15_min":{label:"15 mins",value:"15_min",after:"-15m"},"30_min":{label:"30 mins",value:"30_min",after:"-30m"},"1_hour":{label:"1 hour",value:"1_hour",after:"-1h"},"2_hours":{label:"2 hours",value:"2_hours",after:"-2h"},"6_hours":{label:"6 hours",value:"6_hours",after:"-6h"},"12_hours":{label:"12 hours",value:"12_hours",after:"-12h"},"1_day":{label:"1 day",value:"1_day",after:"-1d"},"2_days":{label:"2 days",value:"2_days",after:"-2d"},"7_days":{label:"7 days",value:"7_days",after:"-7d"}},f=Object.values(m),p=m["5_min"],g={linux:{label:"Linux",value:"linux"},freeBSD:{label:"FreeBSD",value:"freeBSD"},windows:{label:"Windows",value:"windows"}},v={label:"".concat(Object.keys(g).length," OS"),value:""},h=[v].concat((0,r.Z)(Object.values(g))),b={avg:{label:"AVG()",value:"average"},sum:{label:"SUM()",value:"sum"},min:{label:"MIN()",value:"min"},max:{label:"MAX()",value:"max"},stddev:{label:"STDDEV()",value:"stddev"},cv:{label:"CV()",value:"cv"}},y=Object.values(b),w=b.stddev,E=b.avg,C={sum:{label:"SUM",value:"of"},each:{label:"EACH",value:"foreach"}},x=Object.values(C),O=C.sum,k={unaligned:{label:"unaligned",value:"unaligned"},percentage:{label:"percentage",value:"percentage"},absolute:{label:"absolute",value:"absolute"},min2max:{label:"min2max",value:"min2max"}},Z=Object.values(k),S={label:"&this",value:"$this"},P={alertId:null,detection:{method:i},metrics:{on:"",hosts:[],os:[],charts:[],chartLabels:[],lookup:{aggregation:E,denoter:O,dimensions:[],timePeriod:p,options:[]},calc:{active:!1,value:""},units:""},alertingConditions:{denoter:u,critical:{denoter:u,value:85,recovery:null},warning:{denoter:u,value:75,recovery:null},interval:{value:60,unit:s.seconds},delayNotification:{active:!1,up:{value:0,unit:s.seconds},down:{value:0,unit:s.seconds},multiplier:1,max:{value:0,unit:s.hours}},agentOptions:{active:!1,off:!1,warningAlertsDuration:{value:15,unit:s.minutes},criticalAlertsDuration:{value:5,unit:s.minutes},sendTo:{value:"",clearNotifications:!1},execScript:{active:!0,path:""}}},description:{templateName:"",templateDescription:""}}},5312:function(e,t,n){n.d(t,{rJ:function(){return m},Lb:function(){return d},Jx:function(){return p},zk:function(){return y},PK:function(){return w},qS:function(){return v},Bf:function(){return b},yL:function(){return g}});var r=n(29439),o=n(4942),a=(n(57327),n(41539),n(88449),n(2490),n(59849),n(82526),n(41817),n(47941),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(4480)),i=n(60593),l=(0,a.cn)({key:"alertConfiguration",default:i.rT}),c=(0,a.cn)({key:"alertConfigurationChart",default:null});function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=function(){return(0,a.sJ)(c)},m=function(){return(0,a.FV)(c)},f=(0,a.nZ)({key:"alertConfigurationSelector",get:function(e){return(0,e.get)(l)},set:function(e,t){(0,e.set)(l,(function(e){return s(s({},e),t)}))}}),p=function(){return(0,a.FV)(f)},g=function(){return(0,a.rb)(l)},v=function(){var e=p(),t=(0,r.Z)(e,2),n=t[0],o=t[1],a=n.detection.method,l=n.metrics;return{detectionMethod:a,setDetectionMethod:function(e){return o({detection:{method:e},metrics:s(s({},l),{},{lookup:s(s({},l.lookup),{},{aggregation:"variance"==e?i.pt:i.Z2})})})}}},h=function(e){var t=e.scope,n=e.setConfiguration,r=e.metrics;return function(e){var a=null!==e&&void 0!==e&&e.length?e.filter((function(e){return e.value})):e;n({metrics:s(s({},r),{},(0,o.Z)({},t,Array.isArray(a)?a:a.value?[a]:[]))})}},b=function(){var e=p(),t=(0,r.Z)(e,2),n=t[0],o=t[1],a=n.metrics,i=h({scope:"hosts",setConfiguration:o,metrics:a}),l=h({scope:"charts",setConfiguration:o,metrics:a}),c=h({scope:"chartLabels",setConfiguration:o,metrics:a}),u=h({scope:"os",setConfiguration:o,metrics:a});return{metrics:a,setLookup:function(e){var t=e.aggregation,n=e.denoter,r=e.dimensions,i=e.timePeriod,l=e.options;o({metrics:s(s({},a),{},{lookup:s(s(s(s(s(s({},a.lookup),t?{aggregation:t}:{}),n?{denoter:n}:{}),r?{dimensions:r}:{}),i?{timePeriod:i}:{}),l?{options:l}:{})})})},setOn:function(e){return o({metrics:s(s({},a),{},{on:e})})},setHosts:i,setCharts:l,setChartLabels:c,setOs:u,setCalcActive:function(e){return o({metrics:s(s({},a),{},{calc:s(s({},a.calc),{},{active:e},e?{}:{value:""})})})},setCalcValue:function(e){return o({metrics:s(s({},a),{},{calc:s(s({},a.calc),{},{value:e})})})},setUnitsValue:function(e){return o({metrics:s(s({},a),{},{units:e})})}}},y=function(){var e=p(),t=(0,r.Z)(e,2),n=t[0],a=t[1],i=n.alertId,l=n.alertingConditions,c=!!i,u=function(e,t){return function(n){return a({alertingConditions:s(s({},l),{},(0,o.Z)({},e,s(s({},l[e]),{},(0,o.Z)({},t,n))))})}},d=u("critical","denoter"),m=u("critical","value"),f=u("critical","recovery"),g=u("warning","denoter"),v=u("warning","value"),h=u("warning","recovery"),b=function(e,t){return function(n){return a({alertingConditions:s(s({},l),{},(0,o.Z)({},e,s(s({},l[e]),{},{recovery:s(s({},l[e].recovery),{},(0,o.Z)({},t,n))})))})}},y=b("critical","denoter"),w=b("critical","value"),E=b("warning","denoter"),C=b("warning","value"),x=function(e){return function(t){return a({alertingConditions:s(s({},l),{},{interval:s(s({},l.interval),{},(0,o.Z)({},e,t))})})}},O=x("value"),k=x("unit"),Z=function(e){return function(t){return a({alertingConditions:s(s({},l),{},(0,o.Z)({},e,s(s({},l[e]),{},{active:t})))})}},S=Z("delayNotification"),P=function(e){return function(t){return function(n){return function(r){return a({alertingConditions:s(s({},l),{},(0,o.Z)({},e,s(s({},l[e]),{},(0,o.Z)({},t,s(s({},l[e][t]),{},(0,o.Z)({},n,r))))))})}}}},I=P("delayNotification"),j=I("up"),D=j("value"),N=j("unit"),T=I("down"),F=T("value"),M=T("unit"),_=I("max"),L=_("value"),A=_("unit"),B=Z("agentOptions"),R=P("agentOptions"),V=R("warningAlertsDuration"),U=V("value"),z=V("unit"),H=R("criticalAlertsDuration"),W=H("value"),G=H("unit"),K=function(e){return function(t){return a({alertingConditions:s(s({},l),{},{agentOptions:s(s({},l.agentOptions),{},{sendTo:s(s({},l.agentOptions.sendTo),{},(0,o.Z)({},e,t))})})})}},J=K("value"),Y=K("clearNotifications"),q=function(e){return function(t){return a({alertingConditions:s(s({},l),{},{agentOptions:s(s({},l.agentOptions),{},{execScript:s(s({},l.agentOptions.execScript),{},(0,o.Z)({},e,t))})})})}},Q=q("active"),$=q("path");return{isEdit:c,alertingConditions:l,setMainDenoter:function(e){return a({alertingConditions:s(s({},l),{},{denoter:e,critical:s(s({},l.critical),{},{denoter:e}),warning:s(s({},l.warning),{},{denoter:e})})})},setIntervalValue:O,setIntervalUnit:k,setCriticalThresholdDenoter:d,setCriticalThresholdValue:m,setCriticalRecoveryThreshold:f,setWarningThresholdDenoter:g,setWarningThresholdValue:v,setWarningRecoveryThreshold:h,setCriticalRecoveryThresholdDenoter:y,setCriticalRecoveryThresholdValue:w,setWarningRecoveryThresholdDenoter:E,setWarningRecoveryThresholdValue:C,setDelayNotificationActive:S,setDelayNotificationUpValue:D,setDelayNotificationUpUnit:N,setDelayNotificationDownValue:F,setDelayNotificationDownUnit:M,setDelayNotificationMaxDelayValue:L,setDelayNotificationMaxDelayUnit:A,setDelayNotificationMultiplier:function(e){return a({alertingConditions:s(s({},l),{},{delayNotification:s(s({},l.delayNotification),{},{multiplier:e})})})},setAgentOptionsActive:B,setAgentOptionsRepeatNotification:function(e){return a({alertingConditions:s(s({},l),{},{agentOptions:s(s({},l.agentOptions),{},{off:e})})})},setAgentOptionsWarningAlertsDurationValue:U,setAgentOptionsWarningAlertsDurationUnit:z,setAgentOptionsCriticalAlertsDurationValue:W,setAgentOptionsCriticalAlertsDurationUnit:G,setAgentOptionsSendToValue:J,setAgentOptionsSendToClearNotifications:Y,setAgentOptionsExecScriptActive:Q,setAgentOptionsExecScriptPath:$}},w=function(){var e=p(),t=(0,r.Z)(e,2),n=t[0],o=t[1],a=n.description;return{templateName:a.templateName,templateDescription:a.templateDescription,setTemplateName:function(e){return o({description:s(s({},n.description),{},{templateName:e})})},setTemplateDescription:function(e){return o({description:s(s({},n.description),{},{templateDescription:e})})}}}},88387:function(e,t,n){n.d(t,{An:function(){return s},RW:function(){return g},jx:function(){return v},t7:function(){return u}});n(47941),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(29439),o=n(93433),a=n(4942),i=(n(92222),n(57327),n(41539),n(88449),n(2490),n(59849),n(21249),n(57640),n(9924),n(91058),n(54678),n(82526),n(41817),n(85827),n(25387),n(72608),n(69720),n(69826),n(31672),n(59461),n(26833),n(26699),n(32023),n(60593));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 c(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,a.Z)(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}var u=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){var r=n.target.checked;return e(t?!r:r)}},s=function(e){return function(t){var n=t.target.value;return e(n)}},d=function(e){var t,n=e.formula,r=void 0===n?i.hl.value:n,o=e.denoter,a=e.value,l=e.recovery,c=null!==l&&void 0!==l&&l.value&&null!==l&&void 0!==l&&null!==(t=l.denoter)&&void 0!==t&&t.symbol?"and ".concat(r," ").concat(l.denoter.symbol," (").concat(l.value,")"):"";return["".concat(r," ").concat(null===o||void 0===o?void 0:o.symbol," (").concat(a,")"),c].filter(Boolean).join(" ")},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.value,n=e.unit;return"".concat(t).concat(null===n||void 0===n?void 0:n.symbol)},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"value";return function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return t[e]})).join(" ")}}(),p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.detection,n=e.metrics,r=void 0===n?{}:n,a=e.description,l=void 0===a?{}:a,u=e.alertingConditions,s=void 0===u?{}:u,p=r.on,g=r.hosts,v=r.os,h=r.charts,b=r.chartLabels,y=r.lookup,w=r.calc,E=r.units,C=l.templateName,x=l.templateDescription,O=s.agentOptions,k=void 0===O?{}:O,Z=s.interval,S=void 0===Z?{}:Z,P=s.delayNotification,I=void 0===P?{}:P,j=k.execScript,D=void 0===j?{}:j,N=k.sendTo,T=void 0===N?{}:N;return c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c({},C?{template:C}:{}),p?{on:p}:{}),null!==g&&void 0!==g&&g.length?{hosts:f(g)}:{}),null!==v&&void 0!==v&&v.length?{os:f(v)}:{}),null!==h&&void 0!==h&&h.length?{charts:f(h)}:{}),null!==b&&void 0!==b&&b.length?{"chart labels":f(b)}:{}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.aggregation,n=e.denoter,r=e.dimensions,o=void 0===r?[]:r,a=e.timePeriod,i=e.options,l=arguments.length>1?arguments[1]:void 0,c=(void 0===i?[]:i).map((function(e){return e.value})).join(" "),u=o.map((function(e){return e.value})).filter(Boolean),s=u.length?"".concat((null===n||void 0===n?void 0:n.value)||"of"," ").concat(u.join(",")):null,d="anomalies"==l?"anomaly-rate":"";return{lookup:[null===t||void 0===t?void 0:t.value,null===a||void 0===a?void 0:a.after,c,s,d].filter(Boolean).join(" ")}}(y,null===t||void 0===t?void 0:t.method)),null!==w&&void 0!==w&&w.value?{calc:w.value}:{}),E&&null!==w&&void 0!==w&&w.value?{units:E}:{}),S.value?{every:m(S)}:{}),function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.alertId,o=n.alertingConditions,a=void 0===o?{}:o,l=a.critical,u=a.warning;return r?c(c({},null!==l&&void 0!==l&&l.value?{crit:l.value}:{}),null!==u&&void 0!==u&&u.value?{warn:u.value}:{}):l&&u&&null!==(e=l.denoter)&&void 0!==e&&e.value&&void 0!==l.value&&null!==(t=u.denoter)&&void 0!==t&&t.value&&void 0!==u.value?{crit:d({formula:i.hl.value,denoter:l.denoter,value:l.value,recovery:l.recovery}),warn:d({formula:i.hl.value,denoter:u.denoter,value:u.value,recovery:u.recovery})}:{}}(e)),k.active&&D.active&&D.path?{exec:D.path}:{}),x?{info:x}:{}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.active,n=e.up,r=e.down,a=e.multiplier,i=e.max;if(!t||0==parseInt(null===n||void 0===n?void 0:n.value,10)&&0==parseInt(null===r||void 0===r?void 0:r.value,10))return{};var l=[].concat((0,o.Z)(parseInt(null===n||void 0===n?void 0:n.value,10)>0?["up ".concat(m(n))]:[]),(0,o.Z)(parseInt(null===r||void 0===r?void 0:r.value,10)>0?["down ".concat(m(r))]:[]),(0,o.Z)(parseFloat(a)>0?["multiplier ".concat(a)]:[]),(0,o.Z)(parseInt(null===i||void 0===i?void 0:i.value,10)>0?["max ".concat(m(i))]:[]));return l.length?{delay:l.join(" ")}:{}}(I)),k.active?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.off,n=e.warningAlertsDuration,r=e.criticalAlertsDuration,a=[].concat((0,o.Z)(t?["off"]:[]),(0,o.Z)(!t&&null!==n&&void 0!==n&&n.value?["warning ".concat(m(n))]:[]),(0,o.Z)(!t&&null!==r&&void 0!==r&&r.value?["critical ".concat(m(r))]:[]));return a.length?{repeat:a.join(" ")}:{}}(k):{}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.value;return e.clearNotifications&&t?{to:t}:{}}(T))},g=function(){var e=p(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return Object.entries(e).reduce((function(e,t){var n=(0,r.Z)(t,2),a=n[0],i=n[1];return[].concat((0,o.Z)(e),["".concat(a,": ").concat(i)])}),[]).join("\n")},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.id,n=e.context,r=void 0===n?"":n,o=(e.calculation,e.displayName),a=void 0===o?"":o,l=e.configInfo,u=void 0===l?"":l,s=e.critical,d=void 0===s?"":s,m=e.warning,f=void 0===m?"":m,p=e.lookupMethod,g=void 0===p?"":p,v=e.lookupOptions,h=void 0===v?[]:v,b=(e.lookupAfter,e.lookupBefore,e.lookupDimensions),y=void 0===b?"":b;return c(c(c({},i.rT),t?{alertId:t}:{}),{},{metrics:c(c({},i.rT.metrics),{},{on:r,lookup:c(c({},i.rT.metrics.lookup),{},{aggregation:Object.values(i.yA).find((function(e){return e.value==g})),dimensions:y.split(" ").map((function(e){return{label:e,value:e}})),options:Object.values(i.YC).filter((function(e){var t=e.value;return h.includes(t)}))})}),alertingConditions:c(c({},i.rT.alertingConditions),{},{critical:{value:d},warning:{value:f}}),description:{templateName:a,templateDescription:u}})}},83356:function(e,t,n){n(74916),n(15306),n(92222);var r=n(67294),o=n(89250),a=n(64637),i=n(78710),l=n(73012);t.Z=function(){var e=(0,o.s0)();return(0,r.useCallback)((function(){if(i.ZP){var t=window.location.origin+window.location.pathname.replace(i.tj,""),n=(0,l.MQ)();window.location.href=(0,a.h2)("".concat(window.envSettings.cloudUrl,"/trust?redirect_uri=").concat(encodeURIComponent(window.location.href),"&agent_uri=").concat(encodeURIComponent(t||window.envSettings.agentApiUrl),"&telemetry_session_id=").concat(n))}else e("/sign-in")}),[])}},4808:function(e,t,n){n.d(t,{HZ:function(){return w},Ru:function(){return y},bj:function(){return S},g3:function(){return P},oU:function(){return v}});var r=n(4942),o=n(29439),a=n(45987),i=(n(21249),n(57640),n(9924),n(85827),n(41539),n(25387),n(2490),n(72608),n(92222),n(74916),n(23123),n(47941),n(26699),n(32023),n(77601),n(2707),n(39714),n(66992),n(78783),n(33948),n(41637),n(82526),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(26398)),l=n(66152),c=n(39840),u=n(55436),s=n(78710),d=["spaceId","cloudNodeIds","nodeIds","fn","acceptedParams","merge","filters"],m=["nodeIds","spaceId","roomId","roomSlug","anchor","merge","after","before","filters","anchorOffset","cloudNodeIds"];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 p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.functions,n=void 0===t?[]:t,r=e.nodes;return n.map((function(e){return{name:e.name,nodes:e.ni.reduce((function(e,t){return r[t]?(e[r[t].nd||r[t].mg]=!0,e):e}),{})}}))},v=function(e,t){return(0,s.Ly)(e)?i.Z.get("/api/v2/functions",{baseURL:window.envSettings.agentApiUrl,transform:g}):i.Z.post("/api/v3/spaces/".concat(e,"/rooms/").concat(t,"/functions"),{scope:{nodes:[]},selectors:{nodes:["*"]}},{transform:g})},h=function(e,t){var n=t.merge,r=t.direction,o=t.dataOnly,a=void 0!==o&&o,i=t.tail,c=void 0!==i&&i;return function(t){return(t=(0,l.Tg)(t,{omit:["histogram"]})).defaultCharts||"processes"!==e||(t.defaultCharts=[["CPU","Category"],["Memory","Category"]]),t.defaultCharts=t.defaultCharts||[],a||(t.aggregations=t.facets),t.merge=n,t.direction=r,t.dataOnly=a,t.tail=c,t}},b=function(e,t){return"after"===e||"before"===e?Math.floor(t/1e3):t},y=function(e){var t=e.spaceId,n=e.cloudNodeIds,r=e.nodeIds,l=e.fn,c=e.acceptedParams,u=void 0===c?[]:c,m=e.merge,f=void 0!==m&&m,p=e.filters,g=void 0===p?{}:p,v=(0,a.Z)(e,d),y=u.reduce((function(e,t){var n=b(t,v[t]);return(n="undefined"===typeof n||null===n?null:"".concat(n))?e?"".concat(e," ").concat(t,":").concat(n):"".concat(t,":").concat(n):e}),"");null!==u&&void 0!==u&&u.length&&(y=Object.keys(g).reduce((function(e,t){var n=b(t,g[t]);return n=function(e,t){return"query"===e&&t?t.split(/\s+/).join("|"):t}(t,n),(n="undefined"===typeof n||null===n?null:"".concat(n))?e?"".concat(e," ").concat(t,":").concat(n):"".concat(t,":").concat(n):e}),y));var w,E=(0,s.Ly)(t);if(y=y?"".concat(E?"%20":" ").concat(y):"",E){var C=(0,o.Z)(r,1)[0];w=i.Z.get("/host/".concat(C,"/api/v1/function?function=").concat(l).concat(y),{baseURL:window.envSettings.agentApiUrl,transform:h(l,{merge:f,direction:v.direction,dataOnly:v.data_only&&u.includes("data_only"),tail:v.tail})})}else{var x=(0,o.Z)(n,1)[0];w=i.Z.get("/api/v2/nodes/".concat(x,"/function"),{params:{function:"".concat(l).concat(y),timeout:12e4},transform:h(l,{merge:f,direction:v.direction,dataOnly:v.data_only&&u.includes("data_only"),tail:v.tail})})}return w.catch((function(e){throw e.merge=f,e.direction=v.direction,e.dataOnly=v.data_only&&u.includes("data_only"),e.tail=v.tail,e})),w},w=function(e){var t=e.spaceId,n=e.cloudNodeIds,r=e.nodeIds,a=e.fn,c=e.after,u=e.before,d=(0,s.Ly)(t),m="".concat(d?"%20":" ","info after:").concat(b("after",c)," before:").concat(b("before",u));if(d){var f=(0,o.Z)(r,1)[0];return i.Z.get("/host/".concat(f,"/api/v1/function?function=").concat(a).concat(m),{baseURL:window.envSettings.agentApiUrl,transform:l.Tg})}var p=(0,o.Z)(n,1)[0];return i.Z.get("/api/v2/nodes/".concat(p,"/function"),{params:{function:"".concat(a).concat(m),timeout:12e4},transform:l.Tg})},E={filter:!1,index:1,name:"Unknown",sort:"ascending",sortable:!1,sticky:!1,summary:"",type:"string",uniqueKey:!1,visible:!0,dummy:!1},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.Z)({},e,p(p({},E),{},{name:t.name||e},t))},x=p(p(p(p(p({},C("Timestamp",{type:"datetime",index:0})),C("Tags",{type:"pill",index:1,wrap:!0})),C("Description",{type:"feedTemplate",index:2})),C("source",{type:"feedTemplate",index:3,dummy:!0})),C("json",{type:"feedTemplate",index:4,dummy:!0})),O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,o.Z)(e,1)[0];return"retention"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).type?/exceeds the maximum data retention/.test(t)?"You've exceeded your plan's retention limit":"":t},k=function(e,t){return function(n){var r,o,a,i=n.errors,l=void 0===i?[]:i,c=n.page_size,u=n.results,s=u.hits,d=u.aggregations,m=(null===s||void 0===s?void 0:s.hits)||[];return{columns:p({},x),data:m.map((function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n._source,o=void 0===r?{}:r,a=n._source,i=a.event,l=a.host,c=void 0===l?[]:l,u=a.agent,s=void 0===u?{}:u,d=a.Netdata,m=a.tags,f=Array.isArray(c)?c:[c];return d=p(p({},d),d.alert?{alert:p(p(p({},d.alert),{},{id:null===(e=d.alert.transition)||void 0===e?void 0:e.id},d.alert.name?{name:Array.isArray(d.alert.name)?d.alert.name:[d.alert.name]}:{}),d.alert.current?{current:p(p({},d.alert.current),{},{status:d.alert.current.status?Array.isArray(d.alert.current.status)?d.alert.current.status:[d.alert.current.status]:[]})}:{})}:{}),[o["@timestamp"],m||[],i.id,p(p(p(p({},o),i),d),{},{hosts:f,agentId:s.id,roomId:t}),o]})),default_sort_column:null,type:"table",update_every:5,pageSize:c,totalSize:(null===(r=s.total)||void 0===r?void 0:r.value)||0,anchorBefore:null===(o=m[m.length-1])||void 0===o||null===(o=o.sort)||void 0===o?void 0:o[0],anchorAfter:null===(a=m[0])||void 0===a||null===(a=a.sort)||void 0===a?void 0:a[0],aggregations:d,merge:e,retentionWarning:O(l,{type:"retention"}),warning:O(l)}}},Z=function(e,t,n,r){return function(n){var o,a=n.facets,i=void 0===a?[]:a,l=n.items,u=void 0===l?{}:l,s=n.transitions,d=void 0===s?[]:s,m=d.map((function(n){var r=n.machine_guid,o=n.transition_id,a=n.node_id,i=n.hostname,l=n.alert,u=n.new,s=u.status,d=u.value,m=n.when,f=n.old.status,p=n.instance,g=n.units,v={action:"alert-node-transition",space:{id:e},roomId:t,alert:{id:o,current:{status:[s],value_string:(0,c.m9)(d,g)},previous:{status:f},name:[l]},chart:{name:p},hosts:[{id:a||r,name:i}]};return[1e3*m,["alert","node_instance"],o,v,v,s,name,p]}));return{columns:p(p(p(p({},x),C("Status",{type:"value",index:5,dummy:!0,filter:"multiselect"})),C("Alert Name",{type:"value",index:6,dummy:!0,filter:"multiselect"})),C("Instance",{type:"value",index:7,dummy:!0,filter:"multiselect"})),data:m,default_sort_column:null,type:"table",update_every:5,pageSize:100,totalSize:(null===u||void 0===u?void 0:u.matched)||m.length,anchorBefore:null===(o=d[d.length-1])||void 0===o?void 0:o.gi,aggregations:i,merge:r,retentionWarning:null,warning:null}}},S=function(e){var t,n=e.nodeIds,r=void 0===n?[]:n,o=e.spaceId,l=e.roomId,c=e.roomSlug,d=e.anchor,f=void 0===d?"":d,g=e.merge,v=void 0!==g&&g,h=e.after,b=e.before,y=e.filters,w=(e.anchorOffset,e.cloudNodeIds),E=(0,a.Z)(e,m);if((0,s.Ly)(o)){var C=new URLSearchParams(p(p(p({after:h?Math.floor(h/1e3):h,before:b?Math.ceil(b/1e3):b,last:200,anchor_gi:f,options:"minify"},y),E),{},{scope_nodes:r.join("|")||"*"})).toString();return i.Z.get("/api/v2/alert_transitions?".concat(C),{baseURL:window.envSettings.agentApiUrl,transform:Z(o,l,0,v)})}return i.Z.post("/api/v1/feed/search",p(p(p({},y),E),{},{histogram_seconds:(null===(t=(0,u.BZ)(h,b))||void 0===t?void 0:t.secs)||1,node_ids:w,page_size:200,space_id:o,room_ids:"all-nodes"!==c?[l]:[],search_before:f||Date.now(),from_timestamp:h,to_timestamp:b}),{transform:k(v,l)})},P=function(){return i.Z.get("/api/v1/feed/static/facets")}},81732:function(e,t,n){n.d(t,{GQ:function(){return d},Zn:function(){return f},eX:function(){return c},p6:function(){return u}});var r=n(4942),o=(n(41539),n(88674),n(47941),n(82526),n(57327),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(4480)),a=n(4808);function i(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?i(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var c=(0,o.cn)({key:"fnIndexHoverAtom",default:null}),u=(0,o.cn)({key:"fnClickPointAtom",default:null}),s=(0,o.xu)({key:"checkAgainFnsAtom",default:function(){return 1}}),d=(0,o.CG)({key:"availableFunctionsSelector",get:function(e){var t=e.spaceId,n=e.roomId,r=e.extraKey;return function(e){return(0,e.get)(s(t)),function(e){var t=e.spaceId,n=e.roomId;return"feed"===e.extraKey?Promise.resolve({data:[{name:"feed"}]}):(0,a.oU)(t,n)}({spaceId:t,roomId:n,extraKey:r})}}}),m={id:null,loading:!0,loaded:!1,loadingMore:!1,infoLoaded:!1,data:null,error:"",type:"",updateEvery:1,availableFilters:{},missingRequired:!1,lastModified:null,anchorAfter:null,offset:0,defaultCharts:[],acceptedParams:[],requiredParams:[]},f={table:l(l({},m),{},{sortColumn:"",sortDirection:"descending",columns:{},columnVisibility:{},sortedColumns:[],pinnedColumns:[],groupByColumns:null}),default:m};t.ZP=(0,o.xu)({key:"function",default:function(e){return l(l({},m),{},{id:e})}})},85672:function(e,t,n){n.d(t,{Ih:function(){return i},Kl:function(){return a},vK:function(){return r}});var r=["#19C89E","#14A6C7","#F3D63D","#E05296","#FF7448","#C082FF"],o=3600,a=86400,i=[{minLimit:350*a,secs:7*a,unit:"week"},{minLimit:50*a,secs:a,unit:"day"},{minLimit:13*a,secs:21600,unit:"hour"},{minLimit:5*a,secs:10800,unit:"hour"},{minLimit:136800,secs:o,unit:"hour"},{minLimit:61200,secs:1800,unit:"minute"},{minLimit:28800,secs:600,unit:"minute"},{minLimit:10800,secs:300,unit:"minute"},{minLimit:2280,secs:60,unit:"minute"},{minLimit:780,secs:30,unit:"second"},{minLimit:420,secs:10,unit:"second"},{minLimit:300,secs:5,unit:"second"},{minLimit:1,secs:1,unit:"second"}]},3322:function(e,t,n){n.d(t,{$0:function(){return M},CE:function(){return O},Cf:function(){return T},Eq:function(){return D},Hv:function(){return k},I_:function(){return S},KO:function(){return w},MT:function(){return _},ZQ:function(){return Z},fg:function(){return I},hx:function(){return F},kU:function(){return j},mO:function(){return P},tD:function(){return C}});n(82526),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(45987),o=n(29439),a=n(4942),i=n(93433),l=(n(2707),n(41539),n(88674),n(85827),n(25387),n(2490),n(72608),n(47941),n(21249),n(57640),n(9924),n(67294)),c=n(89250),u=n(4480),s=n(4822),d=n(74059),m=n(37518),f=n(78710),p=n(81732),g=n(4808),v=["key","flavour"],h=["key","flavour"];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 y(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,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w=function(e){var t=(0,d.th)(),n=(0,m.UL)(),r=(0,u.$P)((0,p.GQ)({spaceId:t,roomId:n,extraKey:e})),o=(0,u._8)((function(r){var o=r.refresh;return function(){return o((0,p.GQ)({spaceId:t,roomId:n,extraKey:e}))}}),[t,n,e]),a=(0,l.useMemo)((function(){var e;if(null===(e=r.contents)||void 0===e||!e.data)return[];var t=(0,i.Z)(r.contents.data);return t.sort((function(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"accent",ignorePunctuation:!0})})),t}),[r.contents]);return{loaded:"loading"!==r.state,value:a,hasError:"hasError"===r.state,refresh:o}},E=[],C=(0,u.CG)({key:"fnState",get:function(e){var t=e.id,n=e.key;return function(e){var r=(0,e.get)((0,p.ZP)(t));return n?r[n]:r}},set:function(e){var t=e.id,n=e.key;return function(e,r){var o=e.set,i=e.reset;r||n?o((0,p.ZP)(t),(function(e){return n?y(y({},e),{},(0,a.Z)({},n,r)):y(y({},e),r)})):i((0,p.ZP)(t))}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),x={extraKey:"fn"},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x,t=(0,s.tk)("selectedFn",y({defaultValue:E,flavour:"arr"},e));return(0,o.Z)(t,1)[0]},k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;return(0,s.D0)("selectedFn",y({defaultValue:E,flavour:"arr"},e))},Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;return function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:x).key;return(0,u.sJ)(C({id:e,key:t}))}(O(e),e)},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;return function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:x).key;return(0,u.Zl)(C({id:e,key:t}))}(O(e),e)},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x;return[Z(e),S(e)]},I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x,t=e.key,n=e.flavour,o=(0,r.Z)(e,v),a=O(o);return(0,s.D0)(t,{extraKey:"".concat(a||o.extraKey,"Settings"),flavour:n})},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x,t=e.key,n=e.flavour,o=(0,r.Z)(e,h),a=O(o);return(0,s.D0)(t,{extraKey:"".concat(a||o.extraKey,"Filters"),flavour:n})},D=function(e){var t=(0,c.s0)(),n=function(){var e=(0,m.A3)();return e&&"".concat(e,"/functions")}();return(0,l.useCallback)((function(){t(n,{state:{nodeId:arguments.length>0&&void 0!==arguments[0]?arguments[0]:e}})}),[n,t])},N=(0,u.CG)({key:"feedFacetsSelector",get:function(e){return function(){return e?(0,g.g3)():Promise.resolve({data:{}})}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),T=function(e){var t=(0,d.th)(),n=(0,f.Ly)(t),r=Z({extraKey:e}),o=r.loading,a=r.loaded,c=r.aggregations,s=(0,u.$P)(N(!n&&"feed"===e));return(0,l.useMemo)((function(){var e;if("hasValue"!==s.state||!a)return[];if(!c)return[];if(Array.isArray(c))return c.reduce((function(e,t){return e.push(y(y({},t),{},{options:(0,i.Z)(t.options).sort((function(e,t){return e.order-t.order||(e.name?e.name.localeCompare(t.name,void 0,{sensitivity:"accent",ignorePunctuation:!0}):t.count-e.count)}))})),e}),[]).sort((function(e,t){return e.order-t.order}));var t=(null===s||void 0===s||null===(e=s.contents)||void 0===e||null===(e=e.data)||void 0===e?void 0:e.facets)||{};return Object.keys(t).sort((function(e,n){return t[e].order-t[n].order})).reduce((function(e,n){var r,o=t[n],a=o.display_name,i=o.field;return null!==(r=c[n])&&void 0!==r&&r.buckets?(e.push({id:n,name:a,options:c[n].buckets.map((function(e){var t,n;return{id:e.key,name:(null===(t=s.contents.data.fields)||void 0===t||null===(t=t[i])||void 0===t?void 0:t[e.key])||e.key,count:(null===(n=e.hits)||void 0===n?void 0:n.doc_count)||0}}))}),e):e}),[])}),[e,n,s.state,a,o])},F=function(){return(0,u.sJ)(p.eX)},M=function(){return(0,u.Zl)(p.eX)},_=function(){return(0,u.FV)(p.p6)}},55436:function(e,t,n){n.d(t,{BZ:function(){return u},Jw:function(){return i},Ol:function(){return c},kl:function(){return l}});n(54678),n(92222),n(69826),n(41539),n(31672),n(2490),n(59461);var r=n(67294),o=n(89405),a=n(85672),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.decimalPoints,r=t.defaultValue;return null===e?void 0===r?"":r:isNaN(n)?e:parseFloat(e).toFixed(n)},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.defaultValue,r=void 0===n?"":n,o=t.usec;if(void 0!==o&&o&&(e=e?Math.floor(e/1e3):e),null===e)return r;var a=Math.floor(e/86400);e-=24*a*3600;var i=Math.floor(e/3600);e-=3600*i;var l=Math.floor(e/60);return"".concat(a,"d ").concat(i,"h ").concat(l,"m")},c=function(){var e=(0,o.rA)(),t=e.localeTimeString,n=e.localeDateString;return(0,r.useCallback)((function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.defaultValue,a=void 0===o?"":o,i=r.usec;void 0!==i&&i&&(e=e?Math.floor(e/1e3):e);var l=new Date(e);return isNaN(l.valueOf())?a:"".concat(n(l,{long:!1})," ").concat(t(l,{secs:!0}))}),[])},u=function(e,t){return a.Ih.find((function(n){var r=n.minLimit;return function(e,t){return e<0?Math.abs(t-e):(t-e)/1e3}(e,t)>=r}))}},57610:function(e,t,n){n.d(t,{Z:function(){return ee}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r,o=n(4942),a=n(67294),i=n(34885),l=n(87462),c=n(45987),u=(n(9653),n(71893)),s=n(93416),d=n(91008),m=n(57387),f=n(668),p=n(46189),g=["level"],v=["children","href"],h=["content"],b=["ordered","children"],y=["children"],w=u.default.article.withConfig({displayName:"nodes__StyledArticle",componentId:"sc-z8xzec-0"})(["padding-right:8px;padding-bottom:16px;"]),E=u.default.p.withConfig({displayName:"nodes__StyledParagraph",componentId:"sc-z8xzec-1"})(["margin-top:14px;line-height:1.5;"]),C=(0,u.default)(m.ZP).withConfig({displayName:"nodes__StyledCommand",componentId:"sc-z8xzec-2"})(["padding:8px;padding-right:32px;margin-top:8px;"]),x=u.default.ol.withConfig({displayName:"nodes__OrderedList",componentId:"sc-z8xzec-3"})(["list-style:roman;padding-left:16px;line-height:2;"]),O=u.default.ul.withConfig({displayName:"nodes__UnorderedList",componentId:"sc-z8xzec-4"})(['list-style-image:url("','/img/list-style-image.svg");padding-left:16px;line-height:2;'],p.Z.assetsBaseURL),k={document:{render:w},heading:{render:function(e){var t=e.level,n=void 0===t?1:t,r=(0,c.Z)(e,g),o={1:s.H1,2:s.H2,3:s.H3,4:s.H4,5:s.H5,6:s.H6}[n]||s.H1,i=n<=3?6-n:2;return a.createElement(o,(0,l.Z)({margin:[i,0,2,0]},r))},attributes:{id:{type:String},level:{type:Number}}},paragraph:{render:E},link:{render:function(e){var t=e.children,n=e.href,r=(0,c.Z)(e,v);return a.createElement(d.Z,(0,l.Z)({href:n,rel:"noopener noreferrer",target:"_blank"},r),t)},attributes:{href:{type:String}}},code:{render:function(e){var t=e.content,n=(0,c.Z)(e,h);return a.createElement(m.ZM,(0,l.Z)({as:"span"},n),t)},attributes:{content:{type:String}}},fence:{render:C,attributes:{content:{type:String}}},list:{render:function(e){var t=e.ordered,n=e.children,r=(0,c.Z)(e,b),o=t?x:O;return a.createElement(o,r,n)},attributes:{ordered:{type:Boolean}}},table:{render:function(e){var t=e.children,n=(0,c.Z)(e,y);return a.createElement(f.AB,n,t)}}},Z=function(e){var t=e.summary,n=void 0===t?"":t,r=e.open,o=void 0!==r&&r,i=e.children;return a.createElement(s.Flex,{margin:[2,0,0,0]},a.createElement("details",{open:o},a.createElement("summary",null,a.createElement(s.Text,{strong:!0},n)),i))},S=n(29439),P=(n(21249),n(57640),n(9924),n(88674),n(66342),n(62962),n(23748),(0,u.default)(s.Flex).attrs({column:!0}).withConfig({displayName:"styled__StyledTerminalCommand",componentId:"sc-3zs5xg-0"})(["position:relative;top:-1px;color:",";background:",";border:1px solid ",";cursor:pointer;overflow-wrap:anywhere;white-space:pre-wrap;padding:8px 16px 16px 8px;width:100%;font-family:Courier New,monospace;font-weight:bold;letter-spacing:0.09px;line-height:16px;font-size:14px;word-break:break-word;overflow-y:auto;margin-top:",";"],(0,s.getColor)("primary"),(0,s.getColor)("terminalGreen"),(0,s.getColor)("terminalGreenBorder"),(function(e){return e.noMargin?"0":"16px"}))),I=(0,u.default)(s.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-3zs5xg-1"})(["display:flex;align-self:flex-end;cursor:pointer;position:absolute;bottom:8px;right:8px;"]),j=n(59946),D=["blurred","blurProps"],N=n(19480),T=n(52428),F=n(54005),M=["children"],_=(r=function(e){var t=e.children,n=(0,c.Z)(e,M),r=(0,a.useMemo)((function(){return(0,N.$O)(t)}),[t]),o=(0,F.Z)(),i=o.sendLog,u=o.isReady,s=(0,a.useCallback)((function(){(0,T.J)(r,{text:"Config copied to your clipboard."})(),i({feature:"ConnectNode",isStart:!0,copyString:r})}),[u,r]);return a.createElement(P,(0,l.Z)({onClick:s},n),t,a.createElement(I,{name:"copy",size:"small",color:"textLite"}))},function(e){var t=e.blurred,n=e.blurProps,o=(0,c.Z)(e,D);return t?a.createElement(j.ZP,n,a.createElement(r,o)):a.createElement(r,o)}),L=function(e){var t=e.children,n=(0,a.useState)(0),r=(0,S.Z)(n,2),o=r[0],i=r[1],l=a.Children.toArray(t).map((function(e){return e.props}));return a.createElement(s.Flex,{column:!0,width:"100%",margin:[4,0,0,0]},a.createElement(s.Flex,{border:{side:"bottom",size:"1px",color:"borderSecondary"},padding:[0,4]},a.createElement(s.Tabs,{selected:o,onChange:i},l.map((function(e){var t=e.label;return a.createElement(s.Tab,{key:t,label:a.createElement(s.Text,null,t),minWidth:"auto",maxWidth:"auto",padding:[1,4],background:"mainBackground",small:!0})})))),a.createElement(s.Flex,{flex:!0},a.createElement(_,{noMargin:!0},l[o].children)))},A=n(4822),B=n(89250),R=n(74059),V=n(8641),U=n(67034),z=function(e){var t=e.children,n=e.onClick;return a.createElement(s.Box,{as:"a",cursor:"pointer",onClick:n},t)},H=function(e){var t=e.categoryId,n=e.navigateToSettings,r=e.children,o=(0,B.s0)(),i=(0,A.I0)("selectedIntegrationCategory"),l=(0,S.Z)(i,2)[1],c=(0,R.uk)(),u=(0,V.wC)().pushCategory,s=(0,U.Z)(),d=(0,a.useCallback)((function(){n?(l("deploy.docker-kubernetes"),o({pathname:"/spaces/".concat(c,"/settings/integrations"),replace:!0})):u(s(t))}),[u,t,s,n]);return a.createElement(z,{onClick:d},r)},W=(0,a.memo)(H),G=(n(74916),n(15306),n(68757),n(69826),n(31672),n(59461),n(13477)),K=n(33335),J=function(e){var t=e.showClaimingOptions,n=e.command,r=void 0===n?"":n,o=e.claimToken,a=void 0===o?"":o,i=e.claimUrl,l=void 0===i?"":i,c=e.claimRooms,u=void 0===c?"":c;if(t)return r.replaceAll(/{% if \$showClaimingOptions %}\n?/gi,"").replaceAll(/{% \/if %}\n?/gi,"").replaceAll(/{% claim_token %}/gi,a).replaceAll(/{% claim_url %}/gi,l).replaceAll(/{% \$claim_rooms %}/gi,u);return r.replaceAll(/\{%\s*if\s*\$showClaimingOptions\s*%\}[\s\S]*?\{%\s*\/if\s*%\}\n?/g,"")},Y=function(e){var t,n=e.methods,r=e.isNightly,o=e.claimToken,i=void 0===o?"":o,l=e.claimUrl,c=void 0===l?"":l,u=e.claimRooms,d=void 0===u?"":u,m=r?"nightly":"stable",f=function(){var e=(0,G.Iy)("isAnonymous"),t=(0,K.gI)("node:Create");return{showClaimingOptions:!e&&t}}().showClaimingOptions;return n.length?f&&!i?a.createElement(s.Flex,{padding:[8,0]},a.createElement(s.Text,null,"Loading token...")):n.length>1?a.createElement(L,null,n.map((function(e){var t=e.method,n=(e.commands.find((function(e){return e.channel==m}))||{}).command;return a.createElement(s.Tab,{key:t,label:t},J({showClaimingOptions:f,command:n,claimToken:i,claimUrl:c,claimRooms:d}))}))):a.createElement(_,null,J({showClaimingOptions:f,command:((null===(t=n[0])||void 0===t?void 0:t.commands.find((function(e){return e.channel==m})))||{}).command||"",claimToken:i,claimUrl:c,claimRooms:d})):null},q={nodes:k,tags:{details:{render:Z,attributes:{summary:{type:String,default:""},open:{type:Boolean,default:!1}}},tabs:{render:L},tab:{render:s.Tab,attributes:{label:{type:String,default:""}}},terminal:{render:_},goToCategory:{render:W,attributes:{categoryId:{type:String,default:""},navigateToSettings:{type:Boolean,default:!1}}},command:{render:Y,attributes:{methods:{type:Array,default:[]},isNightly:{type:Boolean,default:!1},claimToken:{type:String,default:""},claimUrl:{type:String,default:""},claimRooms:{type:String,default:""}}}}};function Q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var X=function(e){var t=e.config,n=void 0===t?{}:t,r=e.children;return a.createElement(i.Z,{transformConfiguration:$($({},q),n)},r)},ee=(0,a.memo)(X)},58257:function(e,t,n){n.d(t,{Z:function(){return p}});var r=n(67294),o=n(93416),a=n(37503),i=n(5710),l=n(34735),c=n(63346),u=function(){var e=(0,l.Z)(),t=e.loaded,n=e.hasLimitations,u=e.maxNodes,s=e.preferredNodes;return n&&t&&s.length==u?r.createElement(c.ZP,{feature:"ActiveNodesLimitWarning"},r.createElement(o.Flex,{gap:2},r.createElement(o.Icon,{size:"medium",color:"warning",name:"warning_triangle"}),r.createElement(o.TextBig,null,"If you connect a new node you'll"," ",r.createElement(o.TextBig,{strong:!0},"exceed the limit of ",u," active Nodes"),". To unblock the new node, either"," ",r.createElement(a.Z,null,r.createElement(o.TextBig,{color:"primary"},"upgrade to the Business plan"))," ","for unlimited access or"," ",r.createElement(i.Z,null,r.createElement(o.TextBig,{color:"primary"},"review your Space active Nodes on the Setting page")),"."))):null},s=n(57610),d=n(74059),m=n(33582),f=n(37518),p=function(e){var t=e.integration,n=void 0===t?{}:t,a=e.isNightly,i=e.rooms,l=void 0===i?[]:i,c=e.navigateToSettings,p=n.deployContent,g=n.methods,v=(0,d.th)(),h=(0,f.Jb)(),b=(0,f.Hm)(),y=null!==b&&void 0!==b&&b.loaded?b:h,w=null===y||void 0===y?void 0:y.id,E=(0,m.Z)(v),C=window.envSettings.apiUrl,x=l.length?l.join(","):w,O=(0,r.useMemo)((function(){var e;return{variables:{methods:g,isNightly:a,claimToken:null===E||void 0===E||null===(e=E[0])||void 0===e?void 0:e.token,claimUrl:C,claimRooms:x,navigateToSettings:c}}}),[g,a,E,C,x,c]);return r.createElement(o.Flex,{width:"100%",column:!0,padding:[4,0,0,0]},r.createElement(u,null),r.createElement(s.Z,{config:O},p))}},35819:function(e,t,n){n(82526),n(41817);var r=n(67294),o=n(93416),a=n(91008),i=n(82351),l=n(50308),c=n.n(l),u=n(35253),s={left:"stable",right:"nightly"},d=function(e){var t=e.right,n=u.J[s[t?"right":"left"]]||{},a=n.title,l=n.description;return r.createElement(i.Z,{content:l,align:"bottom"},r.createElement(o.Text,{padding:t?[0,0,0,1]:[0,1,0,0]},a))};t.Z=function(e){var t=e.isNightly,n=e.toggleNightly,i=void 0===n?c():n;return r.createElement(o.Flex,{column:!0,gap:1},r.createElement(a.Z,{href:"https://learn.netdata.cloud/docs/getting-started/install-netdata#nightly-vs-stable-releases",rel:"noopener noreferrer",target:"_blank"},r.createElement(o.Flex,{alignItems:"center",gap:1},r.createElement(o.Text,{color:"primary"},"Updates channel"),r.createElement(o.Icon,{color:"primary",name:"goToNode",width:"18px",height:"18px"}))),r.createElement(o.Toggle,{labelLeft:"Stable",labelRight:"Nightly",Label:d,colored:!1,checked:t,disabled:!1,onChange:i}))}},41898:function(e,t,n){n.d(t,{vE:function(){return V},n5:function(){return J},xN:function(){return Y},Kl:function(){return U},p1:function(){return K},O_:function(){return z},RV:function(){return G},DW:function(){return R},ON:function(){return W},JZ:function(){return H}});var r=n(29439),o=n(87462),a=n(67294),i=n(50308),l=n.n(i),c=n(93416),u=n(27622),s=(n(26699),n(71893)),d=n(74059),m=n(20428),f=n(46667),p=n(54131),g=function(e){var t=e.name,n=e.onEdit,r=void 0===n?l():n;return a.createElement(c.Flex,{alignItems:"center",gap:2},a.createElement(c.TextBig,null,t),a.createElement(c.Button,{icon:"pencilOutline",flavour:"borderless",iconColor:"text",iconSize:"small",padding:[0],onClick:r}))},v=(0,s.default)(c.Flex).withConfig({displayName:"spaceInfo__StyledWrapper",componentId:"sc-166ce7m-0"})(["margin-top:-3px !important;margin-bottom:-3px !important;"]),h=function(e){var t=e.name,n=e.setName,o=void 0===n?l():n,i=e.onSave,u=void 0===i?l():i,s=e.onCancel,d=void 0===s?l():s,m=e.isLoading,f=(0,a.useState)(),g=(0,r.Z)(f,2),h=g[0],b=g[1],y=(0,a.useMemo)((function(){return(0,p.x3)(t)}),[t]);return a.createElement(v,{gap:2},a.createElement(c.TextInput,{value:t,onChange:function(e){b(!0),o(e.target.value)},onKeyDown:function(e){var t=e.code;["Enter","NumpadEnter"].includes(t)&&u()},disabled:m,size:"tiny",error:p.Qj[y],isDirty:h,instantFeedback:"all"}),a.createElement(c.Button,{label:"Save",flavour:"borderless",iconColor:"text",iconSize:"small",padding:[0],onClick:u,disabled:m||!!y}),a.createElement(c.Button,{label:"Cancel",flavour:"borderless",iconColor:"text",iconSize:"small",padding:[0],onClick:d,disabled:m}))},b=function(){var e=(0,d.OS)(),t=e.id,n=e.name,o=(0,m.Z)(t),i=(0,f.Z)(),l=(0,r.Z)(i,4),c=l[0],u=l[2],s=l[3],p=(0,f.Z)(),v=(0,r.Z)(p,4),b=v[0],y=v[2],w=v[3],E=(0,a.useState)(n),C=(0,r.Z)(E,2),x=C[0],O=C[1],k=(0,a.useCallback)((function(){s(),w()}),[]),Z=(0,a.useCallback)((function(){u(),o({name:x},{onSuccess:k,onFail:s})}),[x]);return b?a.createElement(h,{name:x,setName:O,onSave:Z,onCancel:w,isLoading:c}):a.createElement(g,{name:n,onEdit:y})},y=n(82351),w=n(89149),E=n(91008),C=n(37518),x=n(41379),O=n(53338),k=n(33937),Z=n(33335),S=(n(74916),n(15306),n(92222),n(46189)),P=(0,n(39979).Z)(c.Button),I={light:"primary",dark:"white",unspecified:"primary"},j=function(e){var t={icon:"add_user",flavour:"borderless",onClick:e.onClick,label:"Invite your team","data-ga":"integrations::click-invite-team::header"};return(0,Z.gI)("space:InviteUser")?a.createElement(P,t):a.createElement(y.Z,{content:"You can't invite a user with your current permissions"},a.createElement(c.Flex,null,a.createElement(P,(0,o.Z)({},t,{disabled:!0}))))},D=function(e){var t=e.nodesCount,n=e.onClick,r=void 0===n?l():n,o=(0,Z.gI)("node:Create"),i=(0,a.useMemo)((function(){return{onClick:r,disabled:!o}}),[o]),u=t>0?"Connect more!":"Connect a node";return o?a.createElement(E.Z,i,u):a.createElement(y.Z,{content:"You don't have permission to connect new nodes. Please contact an administrator to do it"},a.createElement(c.Box,null,a.createElement(E.Z,i,u)))},N=function(e){var t=e.nodesCount,n=e.onConnectClick,r=void 0===n?l():n;return a.createElement(c.Flex,{gap:2},a.createElement(D,{nodesCount:t,onClick:r}),a.createElement(c.Text,null,"to get started"))},T=function(e){var t=e.nodesCount,n=e.onConnectClick,r=void 0===n?l():n;return a.createElement(c.Flex,{gap:2},a.createElement(c.Text,null,"You have connected ",t," node",1===t?"":"s","."),a.createElement(D,{nodesCount:t,onClick:r}))},F=(0,a.memo)((function(e){var t=e.nodesCount,n=e.onConnectClick,r=void 0===n?l():n;return a.createElement(c.Flex,{gap:2},a.createElement(c.Text,null,"This is your new space"),t>0?a.createElement(T,{nodesCount:t,onConnectClick:r}):a.createElement(N,{nodesCount:t,onConnectClick:r}))})),M=function(e){var t=e.onInvite,n=void 0===t?l():t,o=(0,k.Ro)("theme"),i=(0,d.th)(),s=(0,C.UL)(),m=(0,C.HM)(i,O.i_),p=(0,f.Z)(),g=(0,r.Z)(p,4),v=g[0],h=g[2],y=g[3],E=function(){var e=(0,d.uk)(),t=(0,C.vf)(),n=S.Z.defaultRoomView;return(0,a.useCallback)((function(){window.location.replace("/spaces/".concat(e,"/rooms/").concat(t,"/").concat(n))}),[])}(),Z=(0,a.useState)([]),D=(0,r.Z)(Z,2),N=D[0],T=D[1];(0,x.Z)({spaceId:i,id:s||m,pollingInterval:3e3,keepPolling:!0,onNodeIdsChange:function(e){var t=e.nodeIds;return T((null===t||void 0===t?void 0:t.length)||0)}});var M=N>0;return a.createElement(a.Fragment,null,a.createElement(u.Z,{height:"66px",width:"66px",color:I[o]}),a.createElement(c.H1,{strong:!1},"Welcome to Netdata!"),a.createElement(F,{nodesCount:N,onConnectClick:function(e){e.preventDefault,h()}}),a.createElement(b,null),a.createElement(c.Flex,{gap:4},a.createElement(j,{onClick:n}),a.createElement(P,{icon:"rocket",flavour:M?"default":"borderless",onClick:E,label:M?"Launch space":"Node Required for Launch",disabled:!M,fetaure:"LaunchSpace"})),v&&a.createElement(w.Z,{onClose:y,room:s}))},_=function(){return a.createElement(a.Fragment,null,a.createElement(c.H1,{strong:!1},"Integrations Made Easy!"),a.createElement(c.Text,null,"Unleash the Power of Connected Systems"))},L=n(58257),A=n(57610),B=function(e){var t=e.integration,n=void 0===t?{}:t;return a.createElement(c.Flex,{width:"100%",column:!0,gap:2,padding:[4,0,0,0]},a.createElement(A.Z,null,n.alerts))},R="deploy.operating-systems",V=34,U="data-collection",z="deploy-kubernetes",H={deploy:"rocket","data-collection":"collect",notify:"alarmFilled",export:"importExport"},W={deploy:L.Z,"alert-notifications":B},G={homePage:"homePage",settingsPage:"settingsPage",addNodesModal:"addNodesModal"},K=G.homePage,J={homePage:{headerContent:M},settingsPage:{headerContent:_},addNodesModal:{headerContent:null}},Y={homePage:{header:{height:284,wrapperProps:{padding:[4,0]}},search:{wrapperProps:{width:"500px",margin:[0]},inputProps:{containerStyles:{width:"100%"}}},cncf:{height:80},categoryCharacterWidth:9},settingsPage:{header:{height:210,wrapperProps:{padding:[4,0]}},search:{wrapperProps:{width:"500px",margin:[0]},inputProps:{containerStyles:{width:"100%"}}},cncf:{height:0},categoryCharacterWidth:9},addNodesModal:{header:{height:126,wrapperProps:{width:"100%",padding:[4]}},search:{wrapperProps:{width:"100%",margin:[0],flex:!0},inputProps:{containerStyles:{width:"500px"},size:"small"}},cncf:{height:16},categoryCharacterWidth:9}}},67034:function(e,t,n){n(69826),n(41539),n(31672),n(2490),n(59461);var r=n(8641);t.Z=function(){var e=(0,r.pZ)();return function(t){return e.find((function(e){return e.id==t}))}}},8641:function(e,t,n){n.d(t,{pZ:function(){return N},xh:function(){return j},mk:function(){return I},Oi:function(){return V},wC:function(){return D},RG:function(){return _},dG:function(){return A},lX:function(){return L},NE:function(){return M},P0:function(){return R},Si:function(){return B},Zc:function(){return F},BN:function(){return T}});var r=n(45987),o=n(4942),a=n(93433),i=n(29439),l=(n(57327),n(41539),n(88449),n(2490),n(59849),n(21249),n(57640),n(9924),n(92222),n(47042),n(69826),n(31672),n(59461),n(47941),n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(67294)),c=n(4480),u=n(4822),s=(n(26699),n(32023),n(12934)),d=n(86348),m=n(85373),f=n(58591),p=n(41898);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 v(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,o.Z)(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}var h=(0,c.cn)({key:"integrationsCategoriesAtom",default:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).hideEmptyCategories,t=void 0===e||e,n=(0,d.bu)(s.b),r=(0,m.tE)(s.l),o=[];if(t){var a=(0,d.GP)(r,(function(e){return n.find((function(t){return t.id==e}))}),n);o=n.filter((function(e){var t=e.id;return a.includes(t)}))}else o=n;return o}()}),b=(0,c.cn)({key:"topLevelIntegrationsCategoriesAtom",default:(0,c.nZ)({key:"topLevelIntegrationsCategoriesState",get:function(e){var t=e.get;return(0,d.gP)(t(h))}})}),y=(0,c.cn)({key:"integrationsNavigationHistoryAtom",default:(0,c.nZ)({key:"integrationsNavigationHistoryState",get:function(e){var t=e.get;return function(e){var t,n=e.categories,r=e.integrations,o=(0,f.m$)(),a=o.selectedIntegrationCategory,i=o.selectedIntegration,l=n.find((function(e){return e.id==(a||p.DW)})),c=(0,d.QQ)({category:l,getCategoryById:function(e){return n.find((function(t){return t.id==e}))}}).tree,u=null===(t=r.filter((function(e){return e.id==i})))||void 0===t?void 0:t[0],s=c.filter(Boolean).map((function(e,t){return v(v({},e),{},{type:"category",level:t+1})}));return u&&s.push(v(v({},u),{},{type:"integration"})),s}({categories:t(h),integrations:t(w)})}})}),w=(0,c.cn)({key:"integrationsNormalized",default:(0,c.nZ)({key:"integrationsNormalizedState",get:function(e){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,m.tE)(s.l,e)}((0,e.get)(h))}})}),E=(0,c.cn)({key:"integrationsSearchTerm",default:""}),C=(0,c.cn)({key:"integrationsHistoryBeforeSearch",default:null}),x=(0,c.cn)({key:"integrationsModalOpenAtom",default:"true"==(0,f.m$)().integrationsModalOpen}),O=n(67034),k=["flattenedCategory"];function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=(0,c.nZ)({key:"integrationsQuickStart",get:function(e){var t=(0,e.get)(w).filter((function(e){return e.quickStart>=0}));return(0,m.mi)(t)}}),I=function(){return(0,c.sJ)(C)},j=function(){return(0,c.FV)(C)},D=function(){var e=N(),t=(0,O.Z)(),n=(0,c.FV)(y),o=(0,i.Z)(n,2),s=o[0],m=o[1],f=(0,c.rb)(C),g=(0,u.I0)("selectedIntegrationCategory"),v=(0,i.Z)(g,2)[1],h=(0,u.I0)("selectedIntegration"),b=(0,i.Z)(h,2)[1],w=(0,u.I0)("selectedIntegrationTab"),E=(0,i.Z)(w,2)[1],x=(0,l.useCallback)((function(e){var n=(0,d.QQ)({category:e,getCategoryById:t}).parents,r=[].concat((0,a.Z)(n),[e]).map((function(e,t){return S(S({},e),{},{type:"category",level:t+1})}));m(r),b(""),E(""),f()}),[e,m]),Z=(0,l.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.flattenedCategory,o=(0,r.Z)(e,k),i=n||(o.categories||[])[0],l=i.categoryId||i.id,c=t(l),u=(0,d.QQ)({category:c,getCategoryById:t}).parents,s=[].concat((0,a.Z)(u),[c]).map((function(e,t){return S(S({},e),{},{type:"category",level:t+1})}));m([].concat((0,a.Z)(s),[S(S({},o),{},{type:"integration"})])),E(""),f()}),[]),P=(0,l.useCallback)((function(){s.length>0&&(m(s.slice(0,s.length-1)),f())}),[s,m]),I=(0,l.useMemo)((function(){var e=s[s.length-1];return"integration"==(null===e||void 0===e?void 0:e.type)?e:null}),[s]),j=(0,l.useMemo)((function(){var e=s.filter((function(e){return"category"==e.type}))||[];return e.length?e[e.length-1]:null}),[s]),D=(0,l.useCallback)((function(){var t=e.find((function(e){return e.id==p.DW})),n=[e.find((function(e){return e.id==t.parentId})),t].filter(Boolean).map((function(e,t){return S(S({},e),{},{type:"category",level:t+1})}));m(n),f()}),[e,m]),T=(0,l.useMemo)((function(){return null===j||void 0===j?void 0:j.level}),[j]);return(0,l.useEffect)((function(){null!==j&&void 0!==j&&j.id&&v(j.id)}),[j]),(0,l.useEffect)((function(){null!==I&&void 0!==I&&I.id&&b(I.id)}),[I]),{history:s,level:T,selectedCategory:j,selectedIntegration:I,pushCategory:x,pushIntegration:Z,pop:P,reset:D,setHistory:m}},N=function(){return(0,c.sJ)(h)},T=function(){return(0,c.sJ)(b)},F=function(){var e=D().selectedCategory,t=N(),n=M();return(0,d.KU)({category:e,integrations:n,categories:t})},M=function(){return(0,c.sJ)(w)},_=function(){return(0,c.sJ)(P)},L=function(){return(0,c.sJ)(E)},A=function(){return(0,c.FV)(E)},B=function(){return(0,c.rb)(E)},R=function(){var e=B(),t=D().reset;return function(){e(),t()}},V=function(){return(0,c.FV)(x)}},668:function(e,t,n){n.d(t,{AB:function(){return m},DF:function(){return l},J3:function(){return i},MJ:function(){return c},SZ:function(){return d},Zb:function(){return u},_K:function(){return s},pV:function(){return p},u6:function(){return f}});var r=n(71893),o=n(93416),a=n(19480),i=r.default.div.withConfig({displayName:"styled__LayoutGrid",componentId:"sc-1kju9s3-0"})(["display:grid;grid-template-columns:"," auto;column-gap:32px;padding:0 24px;height:calc( 100vh - ","px - ","px );@media screen and ","{grid-template-columns:"," auto;}@media screen and ","{grid-template-columns:"," auto;}"],(function(e){return e.isSidebarCollapsed?"".concat(60,"px"):"35%"}),(function(e){return(0,a.CF)(e.flavour)}),(function(e){return(0,a.CY)(e.flavour)}),o.breakpoints.laptop,(function(e){return e.isSidebarCollapsed?"".concat(60,"px"):"30%"}),o.breakpoints.desktop,(function(e){return e.isSidebarCollapsed?"".concat(60,"px"):"25%"})),l=r.default.div.withConfig({displayName:"styled__StyledVirtualRow",componentId:"sc-1kju9s3-1"})(["display:grid;grid-template-columns:repeat(",",1fr);grid-auto-rows:","px;column-gap:16px;row-gap:16px;padding-bottom:16px;"],(function(e){return e.itemsPerRow}),(function(e){var t=e.rowHeight;return t>16?t-16:t})),c=(0,r.default)(o.Flex).withConfig({displayName:"styled__CategoryWrapper",componentId:"sc-1kju9s3-2"})(["cursor:pointer;&:hover{background-color:",";}"],(0,o.getColor)("integrationMenuItemHover")),u=(0,r.default)(o.Flex).withConfig({displayName:"styled__Card",componentId:"sc-1kju9s3-3"})(["background:",";img{transition:all 200ms ease-in-out;}&:hover{img{transform:scale(1.2);}}"],(0,o.getColor)("panelBg")),s=(r.default.div.withConfig({displayName:"styled__CardOverlay",componentId:"sc-1kju9s3-4"})(["position:absolute;width:100%;top:0;bottom:0;filter:blur(70px);opacity:0.2;&& img{width:100%;height:100%;}"]),(0,r.default)(o.Icon).withConfig({displayName:"styled__CardIcon",componentId:"sc-1kju9s3-5"})(["position:absolute;top:-20px;left:-35px;transform:rotate(40deg);opacity:0.1;"])),d=(0,r.default)(o.Flex).withConfig({displayName:"styled__CardDescription",componentId:"sc-1kju9s3-6"})(["position:absolute;bottom:0;left:0;transform:translateY(100%);transition:all 200ms ease-in-out;&&.hover{transform:translateY(0);}"]),m=r.default.table.withConfig({displayName:"styled__ContentTable",componentId:"sc-1kju9s3-7"})(["width:100%;border:1px solid ",";margin-top:16px;tr:nth-child(even){background:",";}th{padding:8px 16px;background:",";}td{padding:6px;}"],(0,o.getColor)("borderSecondary"),(0,o.getColor)("mainBackground"),(0,o.getColor)("mainBackground")),f=(0,r.default)(o.PortalSidebar).withConfig({displayName:"styled__SidebarModal",componentId:"sc-1kju9s3-8"})(["width:calc(100vw - 54px);z-index:35;background:",";overflow:",";"],(0,o.getColor)("mainBackground"),(function(e){var t=e.overflow;return void 0===t?"hidden":t})),p=(0,r.default)(o.Icon).withConfig({displayName:"styled__CategoryArrow",componentId:"sc-1kju9s3-9"})(["opacity:",";"],(function(e){return e.disabled?"0":"1"}))},86348:function(e,t,n){n.d(t,{GP:function(){return O},KT:function(){return b},KU:function(){return w},Ov:function(){return v},QQ:function(){return C},XB:function(){return k},bu:function(){return g},gP:function(){return h},tu:function(){return E}});n(47941),n(82526),n(38880),n(49337),n(33321),n(69070);var r=n(29439),o=n(93433),a=n(4942),i=n(45987),l=(n(85827),n(41539),n(25387),n(2490),n(72608),n(92222),n(15581),n(34514),n(54747),n(2707),n(57327),n(88449),n(59849),n(21249),n(57640),n(9924),n(26699),n(32023),n(69826),n(31672),n(59461),n(47042),n(66992),n(70189),n(78783),n(88921),n(96248),n(13599),n(11477),n(64362),n(15389),n(90401),n(45164),n(91238),n(54837),n(87485),n(56767),n(76651),n(61437),n(35285),n(39865),n(33948),n(91038),n(69720),n(50308)),c=n.n(l),u=n(41898),s=n(64637),d=n(19480),m=["children","most_popular"];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 p(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,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g=function e(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(n,r){n.push(function(e){e.children;var t=e.most_popular,n=(0,i.Z)(e,m),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return p(p({},n),{},{name:(0,s.fm)(n.name),mostPopular:t,parentId:r})}(r,t));var a=r.children||[];return n=[].concat((0,o.Z)(n),(0,o.Z)(e(a,r.id)))}),[])},v=function(){var e=[],t=[];(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(n){void 0!==n.priority&&n.priority>=0?e.push(n):t.push(n)}));var n=[],r=[];t.forEach((function(e){e.mostPopular?n.push(e):r.push(e)}));var a=(0,d.BO)("priority"),i=(0,d.Of)("name"),l=[].concat((0,o.Z)(e.sort(a)),(0,o.Z)(n.sort(i)));return{categories:[].concat((0,o.Z)(l),(0,o.Z)(r.sort(i))),popular:l,rest:r}},h=function(){return((arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])||[]).filter((function(e){return null==e.parentId}))},b=function(e){var t=e.category;return e.categories.filter((function(e){var n=e.parentId;return t.id==n}))},y=function e(t){var n=t.category,r=t.categories,o=t.allSubcategories,a=void 0===o?[]:o;return(b({category:n,categories:r})||[]).forEach((function(t){a.push(t),e({category:t,categories:r,allSubcategories:a})})),a},w=function(e){var t=e.category,n=void 0===t?{}:t,r=e.integrations,a=void 0===r?[]:r,i=e.categories;if(null==n)return[];var l=y({category:n,categories:void 0===i?[]:i}),c=[n.id].concat((0,o.Z)(l.map((function(e){return e.id}))));return a.filter((function(e){for(var t=e.categories.map((function(e){return e.categoryId})),n=0;n<t.length;n++)if(c.includes(t[n]))return!0;return!1}))},E=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=n.find((function(e){return e.id==t}));return r?null===r.parentId?u.JZ[r.id]:e(r.parentId,n):null},C=function(e){var t=e.category,n=e.getCategoryById,r=void 0===n?c():n,o=function(e){return((null===e||void 0===e?void 0:e.id)||"").split(".").reduce((function(e,t){return e.length?e.push([e[e.length-1],t].join(".")):e.push(t),e}),[])}(t).map((function(e){return r(e)}));return{tree:o,parents:o.length>1?o.slice(0,o.length-1):[],topLevelCategory:o[0]}},x=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c(),o=arguments.length>3?arguments[3]:void 0;if(t){var a=r(t);if(a){n(a);var i=o.find((function(e){return e.id==(null===a||void 0===a?void 0:a.parentId)}));i&&e(i.id,n,r,o)}}},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c(),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=new Set,o=function(e){return r.add(e.id)};return e.forEach((function(e){e.categories.forEach((function(e){var r=e.categoryId;x(r,o,t,n)}))})),Array.from(r)},k=function(e){var t=e.height,n=e.topLevelCategories,o=void 0===n?[]:n,a=e.categories,i=void 0===a?[]:a,l=e.setState,s=void 0===l?c():l,d={};if(!t||!o.length||!i.length)return d;var m=Math.floor((t/o.length-u.vE)/u.vE);o.forEach((function(e){var t=b({category:e,categories:i});d[e.id]={subcategories:t.length,limit:t.length>m?m:0}})),Object.entries(d).forEach((function(e){var t=(0,r.Z)(e,2),n=t[0],o=t[1],a=o.subcategories,i=o.limit;n!=u.Kl&&i<m&&(d[u.Kl]=p(p({},d[u.Kl]),{},{limit:d[u.Kl].limit+(m-a)}))})),s(d)}},19480:function(e,t,n){n.d(t,{$O:function(){return c},BO:function(){return a},CF:function(){return i},CY:function(){return l},Of:function(){return o}});n(21249),n(57640),n(9924);var r=n(41898),o=function(e){return function(t,n){return t[e]<n[e]?-1:t[e]>n[e]?1:0}},a=function(e){return function(t,n){return t[e]-n[e]}},i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.p1;return(null===(e=r.xN[t])||void 0===e||null===(e=e.header)||void 0===e?void 0:e.height)||0},l=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.p1;return(null===(e=r.xN[t])||void 0===e||null===(e=e.cncf)||void 0===e?void 0:e.height)||0},c=function e(t){var n;return"string"===typeof t?t:Array.isArray(t)?t.map(e).join(""):null!==t&&void 0!==t&&null!==(n=t.props)&&void 0!==n&&n.children?e(t.props.children):""}},85373:function(e,t,n){n.d(t,{QJ:function(){return b},_x:function(){return h},cW:function(){return v},mi:function(){return g},tE:function(){return p}});var r=n(93433),o=n(4942),a=n(45987),i=(n(21249),n(57640),n(9924),n(69826),n(41539),n(31672),n(2490),n(59461),n(15581),n(34514),n(54747),n(92222),n(2707),n(57327),n(88449),n(59849),n(26699),n(32023),n(85827),n(25387),n(72608),n(47941),n(82526),n(38880),n(49337),n(33321),n(69070),n(50308)),l=n.n(i),c=n(66152),u=n(19480),s=["meta"];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 m(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,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[e.installDescription,"{% command methods=$methods isNightly=$isNightly claimToken=$claimToken claimUrl=$claimUrl claimRooms=$claimRooms /%}",e.additionalInfo,e.platformInfo].join("\n\n")},p=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.meta,n=void 0===t?{}:t,r=(0,a.Z)(e,s),o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=n.monitored_instance,l=n.keywords,u=void 0===l?[]:l,d=n.most_popular,p=n.community,g=i||n,v=g.name,h=g.categories,b=void 0===h?[]:h,y=g.icon_filename,w="deploy"==r.integration_type;return(0,c.k5)(m(m({name:v,categories:b.map((function(e){var t=o.find((function(t){return t.id==e}));return{categoryId:e,name:null===t||void 0===t?void 0:t.name}})),icon:"https://www.netdata.cloud/img/"+y,keywords:u,mostPopular:d,community:p},r),w?{deployContent:f({installDescription:r.install_description,methods:r.methods,additionalInfo:r.additional_info,platformInfo:r.platform_info})}:{}))}(t,e)}))},g=function(){var e=[],t=[];(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(n){void 0!==n.quickStart&&n.quickStart>=0?e.push(n):t.push(n)}));var n=[],o=[];t.forEach((function(e){e.mostPopular?n.push(e):o.push(e)}));var a=[],i=[];o.forEach((function(e){e.community?i.push(e):a.push(e)}));var l=(0,u.BO)("quickStart"),c=(0,u.Of)("name");return[].concat((0,r.Z)(e.sort(l)),(0,r.Z)(n.sort(c)),(0,r.Z)(a.sort(c)),(0,r.Z)(i.sort(c)))},v=function(e){var t=e.searchTerm,n=void 0===t?"":t,o=e.integrations,a=void 0===o?[]:o;if(!n)return a;var i=n.toLocaleLowerCase();return a.filter((function(e){var t=e.name,n=e.keywords,o=e.categories,a=void 0===o?[]:o;if(t.toLocaleLowerCase().includes(i))return!0;var l=a.map((function(e){return e.name})).filter(Boolean);return[].concat((0,r.Z)(n),(0,r.Z)(l)).join(",").toLocaleLowerCase().includes(i)}))},h=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(n){t.find((function(t){return t[e]==n[e]}))||t.push(n)})),t},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l();return e.reduce((function(e,n){return n.categories.forEach((function(r){e.push(function(e,t,n){return m(m({},e),{},{flattenedKey:"".concat(e.id,"-").concat(t.categoryId),flattenedCategory:n(t.categoryId)})}(n,r,t))})),e}),[])}},6585:function(e,t,n){n.d(t,{IC:function(){return g},Sq:function(){return f},cA:function(){return h},l9:function(){return p}});var r=n(87462),o=n(15861),a=n(64687),i=n.n(a),l=(n(92222),n(67294)),c=n(93416),u=n(55899),s="delete-node-dialog",d="deleteNodeDialog",m=function(e){var t=1===e;return"Delete ".concat(e," ").concat(t?"node":"nodes")},f=function(e){return"Delete ".concat(e," node")},p=function(e){var t=e.name,n=e.nodesLength;return n?1===n&&t?f(t):m(n):""},g=function(e){var t=e.name;return l.createElement(l.Fragment,null,"You are about to delete offline node ",l.createElement("strong",null,t),".",l.createElement("br",null),"Node will be removed from all rooms and will no longer be accessible. Plus all metadata will be removed.",l.createElement("br",null),"Are you sure you want to continue?")},v=function(e){var t=e.nodesLength,n=1===t;return l.createElement(l.Fragment,null,"You are about to delete ",n?"this":"these"," ",l.createElement("strong",null,t," offline ",n?"node":"nodes"),".",l.createElement("br",null),n?"Node":"Nodes"," will be removed from all rooms and will no longer be accessible. Plus all metadata will be removed.",l.createElement("br",null),"Are you sure you want to continue?")},h=function(e){var t=e.name,n=e.nodesLength;return n?1===n&&t?l.createElement(g,{name:t}):l.createElement(v,{nodesLength:n}):""};t.ZP=function(e){var t=e.ids,n=void 0===t?[]:t,a=e.name,p=e.onClose,h=(0,u.Z)(),b=function(){var e=(0,o.Z)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h(n);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=a?{"data-ga":"".concat(s,"-with-name"),"data-testid":"".concat(d,"WithName"),message:l.createElement(g,{name:a}),title:f(a)}:{"data-ga":"".concat(s,"Bulk"),"data-testid":"".concat(d,"Bulk"),message:l.createElement(v,{nodesLength:n.length}),title:m(n.length)};return l.createElement(c.ConfirmationDialog,(0,r.Z)({confirmLabel:"Yes, delete",handleConfirm:b,handleDecline:p},y))}},75691:function(e,t,n){n.d(t,{V:function(){return p}});var r,o=n(87462),a=n(45987),i=n(67294),l=n(79655),c=n(93416),u=n(97945),s=n(66917),d=n(82351),m=["id","state","isLive","name","isPreferred"],f=function(e){var t=e.isLive,n=e.name;return i.createElement(i.Fragment,null,i.createElement(s.tJ,{"data-testid":"node-name-text",isLive:t},n),i.createElement(c.Icon,{color:"placeholder","data-testid":"node-name-icon",name:"goToNode",width:"18px",height:"18px"}))},p=function(e){var t=e.name;return i.createElement(c.Flex,{width:"300px",column:!0,gap:1},i.createElement(c.Text,{strong:!0},"Locked!"),i.createElement(c.Text,null,"The node ",i.createElement(c.Text,{strong:!0},t)," is locked."),i.createElement(c.Text,null,"Your plan is limited to 5 nodes. Upgrade your plan for no limitations."))};t.Z=(r=function(e){var t=e.id,n=e.state,r=e.isLive,c=e.name,d=e.isPreferred,p=(0,a.Z)(e,m),g=(0,u.m3)(t);return("stale"===n||r)&&d?i.createElement(l.rU,(0,o.Z)({"data-testid":"node-name-link",to:g},p),i.createElement(s.Ou,{"data-testid":"node-name-container"},i.createElement(f,{isLive:r,name:c}))):i.createElement(f,{isLive:r,name:c})},function(e){return e.isPreferred?i.createElement(r,e):i.createElement(d.Z,{plain:!0,content:i.createElement(p,{name:e.name}),isBasic:!0},i.createElement(c.Flex,{gap:1},i.createElement(c.Icon,{name:"padlock",width:"18px",height:"18px",color:"placeholder"}),i.createElement(r,e)))})},97279:function(e,t,n){n.d(t,{Br:function(){return f},O3:function(){return v},ar:function(){return b},d1:function(){return g}});var r=n(87462),o=n(15861),a=n(64687),i=n.n(a),l=(n(92222),n(67294)),c=n(93416),u=n(27624),s=n(37518),d="remove-node-dialog",m="removeNodeDialog",f=function(e){return"Remove ".concat(e," node")},p=function(e){var t=1===e;return"Remove ".concat(e," ").concat(t?"node":"nodes")},g=function(e){var t=e.name,n=e.nodesLength;return n?1===n&&t?f(t):p(n):""},v=function(e){var t=e.name,n=e.roomName;return l.createElement(l.Fragment,null,"You are about to remove ",l.createElement("strong",null,t)," from room ",l.createElement("strong",null,n),".",l.createElement("br",null),"Are you sure you want to continue?")},h=function(e){var t=e.nodesLength,n=e.roomName,r=1===t;return l.createElement(l.Fragment,null,"You are about to remove"," ",l.createElement("strong",null,t," ",r?"node":"nodes")," ","from room ",l.createElement("strong",null,n),".",l.createElement("br",null),"Are you sure you want to continue?")},b=function(e){var t=e.name,n=e.nodesLength,r=e.roomName;return n?1===n&&t?l.createElement(v,{name:t,roomName:r}):l.createElement(h,{nodesLength:n,roomName:r}):""};t.ZP=function(e){var t=e.ids,n=void 0===t?[]:t,a=e.name,g=e.onClose,b=(0,u.Z)(),y=n.length,w=(0,s.Hm)("name"),E=function(){var e=(0,o.Z)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b(n);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=a?{"data-ga":"".concat(d,"WithName"),"data-testid":"".concat(m,"WithName"),message:l.createElement(v,{name:a,roomName:w}),title:f(a)}:{"data-ga":"".concat(d,"Bulk"),"data-testid":"".concat(m,"Bulk"),message:l.createElement(h,{nodesLength:y,roomName:w}),title:p(y)};return l.createElement(c.ConfirmationDialog,(0,r.Z)({handleConfirm:E,handleDecline:g},C))}},66917:function(e,t,n){n.d(t,{Ou:function(){return s},dl:function(){return i},st:function(){return u},tJ:function(){return d},uh:function(){return c},xZ:function(){return l}});n(92222);var r=n(71893),o=n(93416),a=(0,r.default)(o.Button).attrs({flavour:"hollow",neutral:!0,tiny:!0}).withConfig({displayName:"styled__ActionButton",componentId:"sc-31e37b-0"})(["&&&{border-color:",";&:hover{background-color:",";}.button-icon{"," fill:",";}}"],(0,o.getColor)("nodeBadgeBorder"),(0,o.getColor)("nodeBadgeBackground"),(function(e){var t=e.iconSize;return t&&"\n height: ".concat(t,";\n width: ").concat(t,";\n ")}),(0,o.getColor)("textDescription")),i=(0,r.default)(a).attrs({icon:"trashcan",iconSize:"15px"}).withConfig({displayName:"styled__ObsoleteButton",componentId:"sc-31e37b-1"})([""]),l=(0,r.default)(a).attrs({icon:"removeNode"}).withConfig({displayName:"styled__RemoveButton",componentId:"sc-31e37b-2"})([""]),c=(0,r.default)(o.Box).attrs({background:"placeholder",height:4,width:.25}).withConfig({displayName:"styled__InfoSeparator",componentId:"sc-31e37b-3"})([""]),u=(0,r.default)(o.Flex).withConfig({displayName:"styled__NodeActions",componentId:"sc-31e37b-4"})(["display:none;"]),s=(0,r.default)(o.Flex).attrs({alignItems:"center",gap:1}).withConfig({displayName:"styled__NodeNameContainer",componentId:"sc-31e37b-5"})(["&:hover{h5{color:#00ab44;text-decoration:underline;text-decoration-color:#00ab44;}svg{fill:#00ab44;}}"]),d=(0,r.default)(o.H5).attrs((function(e){var t=e.isLive;return{cursor:t?"pointer":"auto",color:t?"text":"textDescription"}})).withConfig({displayName:"styled__NodeName",componentId:"sc-31e37b-6"})([""])},60730:function(e,t,n){n.d(t,{Z:function(){return fe}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r,o=n(4942),a=n(67294),i=n(93416),l=n(96929),c=n(89149),u=n(33335),s=n(29439),d=(n(26699),n(32023),n(21249),n(57640),n(9924),n(89250)),m=n(37518),f=n(97945),p=n(46322),g=n(93433),v=(n(92222),n(64211),n(41874),n(11389)),h=n(62200),b=n(64637),y=n(22965),w=function(e){var t=e.icon,n=e.status,r=e.handleNavigateToDocs,o=e.message;return a.createElement(i.Flex,{column:!0,width:{max:"200px"},gap:2},a.createElement(i.Flex,{alignItems:"center",gap:2},a.createElement(i.Icon,{name:t,color:"bright",size:"small"}),a.createElement(i.TextMicro,{color:"white"},(0,b.fm)(n))),a.createElement(i.Flex,{column:!0,gap:2},a.createElement(i.TextMicro,{color:"white"},o),r&&a.createElement(i.TextMicro,{"data-testid":"text-agent-outdated-critical",color:"white"},a.createElement(i.Box,{"data-testid":"open-add-node",onClick:r,as:i.TextMicro,cursor:"pointer",textDecoration:"underline",color:"white"}," ","Check here"," "),"for troubleshooting")))},E=function(e){var t=e.state,n=e.name,r=(0,y.Lt)(t),o=h.R7[r.toLocaleLowerCase()],l=o.icon,c=o.text,u=o.textColor,s=o.indicatorWrapperColor,d=o.tooltip,m=(0,a.useCallback)((function(){window.open("https://learn.netdata.cloud/guides/troubleshoot/troubleshooting-agent-with-cloud-connection","_blank","noopener,noreferrer")}),[]),f="".concat(n," ").concat(d);return a.createElement(i.Tooltip,{allowHoverOnTooltip:!0,content:a.createElement(w,{message:f,icon:l,status:c,handleNavigateToDocs:"Pending"===r?m:void 0})},a.createElement(i.Flex,{margin:[0,"auto",0,"auto"],height:"20px",padding:[.5,0],border:{side:"all",color:s},background:"nodeBadgeBackground",justifyContent:"center",width:30,round:4,gap:2,alignItems:"center"},a.createElement(i.Icon,{name:l,size:"small",color:u}),a.createElement(i.TextMicro,{strong:!0,color:u},c)))},C=n(86711),x=n(83925),O=(n(88674),n(17727),n(82351)),k=n(46667),Z=n(34735),S=n(93017),P=function(){var e=(0,Z.Z)(),t=e.loaded,n=e.maxNodes;return a.createElement(O.Z,{align:"bottom",content:t?"Your current plan allows you to enable up to ".concat(n," nodes"):""},a.createElement(i.Flex,{gap:2},a.createElement(i.Text,null,"Enabled"),t?a.createElement(i.Icon,{name:"informationPress",size:"small",color:"text"}):null))},I=function(){return a.createElement(O.Z,{content:"For some reason we couldn't load preferred nodes",align:"bottom"},a.createElement(i.Icon,{name:"warning_triangle",color:"warning",size:"small"}))},j=function(e){var t,n=null===(t=e.row.original)||void 0===t?void 0:t.id,r=(0,Z.Z)(),o=r.loaded,l=r.maxNodes,c=r.preferredNodes,u=r.refreshPreferredNodes,d=r.hasError,m=(0,f.dJ)(),p=c.includes(n),v=(0,a.useState)(!1),h=(0,s.Z)(v,2),b=h[0],y=h[1],w=(0,k.Z)(),E=(0,s.Z)(w,4),C=E[0],x=E[2],O=E[3],P=C||!p&&o&&c.length>=l,j=(0,S.Z)(),D=(0,s.Z)(j,2)[1];(0,a.useEffect)((function(){o&&!d&&y(p)}),[o,c,d]);var N=(0,a.useCallback)((function(e){x(),y((function(e){return!e}));var t=e.target.checked?[].concat((0,g.Z)(c),[n]):c.filter((function(e){return e!=n}));m(t).then((function(){u()})).catch((function(e){y((function(e){return!e})),D(e)})).finally((function(){O()}))}),[c,n]);return d?a.createElement(I,null):a.createElement(i.Toggle,{colored:!0,onChange:N,checked:b,disabled:P})},D=n(45987),N=n(75691),T=["nodeId","showLockedNodes","preferredNodes"],F=(r=function(e){var t=e.name;return a.createElement(i.TextSmall,null,t)},function(e){var t=e.nodeId,n=e.showLockedNodes,o=e.preferredNodes,l=void 0===o?[]:o,c=(0,D.Z)(e,T);return n&&!l.includes(t)?a.createElement(O.Z,{plain:!0,content:a.createElement(N.V,{name:c.name}),isBasic:!0},a.createElement(i.Flex,{gap:1},a.createElement(i.Icon,{name:"padlock",width:"18px",height:"18px",color:"placeholder"}),a.createElement(r,c))):a.createElement(r,c)}),M=n(6308);function _(e,t){return e===t?0:e>t?1:-1}var L=function(e){var t=e.isSpace,n=(0,M.Z)(),r=(0,s.Z)(n,3)[2],o=(0,Z.Z)(),l=o.hasLimitations,c=o.maxNodes,u=o.preferredNodes,d=l&&r>c;return(0,a.useMemo)((function(){return[].concat((0,g.Z)(t&&d?[{id:"enabled",header:P,cell:j,sortingFn:function(e,t){var n,r;return(null!==(n=e.original)&&void 0!==n&&n.isPreferred?1:0)-(null!==(r=t.original)&&void 0!==r&&r.isPreferred?1:0)}}]:[]),[{id:"agent",accessorKey:"name",enableColumnFilter:!1,filterFn:function(e,t,n){var r,o=(null===(r=e.original)||void 0===r?void 0:r.name)||"";return null===o||void 0===o?void 0:o.toLowerCase().includes(n)},header:"Name",cell:function(e){var t=e.getValue,n=e.row;return a.createElement(F,{nodeId:n.original.id,name:t(),showLockedNodes:d,preferredNodes:u})}},{id:"version",accessorKey:"version",header:"Version",cell:function(e){var t,n,r=e.getValue,o=e.row;return a.createElement(i.Flex,{gap:1,flexWrap:!0},a.createElement(i.Pill,{flavour:"neutral",hollow:!0},r()),o.original.updateSeverity&&a.createElement(x.Z,{name:o.original.name,os:null===(t=o.original.os)||void 0===t?void 0:t.id,container:null===(n=o.original.hw)||void 0===n?void 0:n.container,warningLevel:"critical"===o.original.updateSeverity?"critical":"warning",labels:o.original.labels,version:r(),margin:[1,0]}))}},{id:"state",accessorKey:"state",header:"Status",cell:function(e){var t=e.getValue;return a.createElement(v.Z,{state:t()})},sortingFn:function(e,t){return _((0,y.Q5)(e.original.state),(0,y.Q5)(t.original.state))},enableColumnFilter:!0,filterFn:function(e,t,n){var r=e.original.state;return n.length<1||n.some((function(e){var t=e.value;return"all"===t||t===(0,y.Q5)(r)}))},meta:{filter:{component:"select",isMulti:!0,options:[{value:"Offline",label:"Offline"},{value:"Live",label:"Live"},{value:"Stale",label:"Stale"},{value:"Unseen",label:"Unseen"}]},tooltip:a.createElement(C.Z,null)}},{id:"connectionToCloud",accessorKey:"state",header:"Connection To Cloud",cell:function(e){var t=e.getValue,n=e.row.original;return a.createElement(E,{state:t(),name:n.name})},sortingFn:function(e,t){return _((0,y.Lt)(e.original.state),(0,y.Lt)(t.original.state))},enableColumnFilter:!0,filterFn:function(e,t,n){var r=e.original.state;return n.length<1||n.some((function(e){var t=e.value;return"all"===t||("created"===r&&"created"===t||("created"!==r&&"completed"===t||void 0))}))},meta:{filter:{component:"select",isMulti:!0,options:[{value:"created",label:"Pending"},{value:"completed",label:"Completed"}]}}},{id:"updateSeverity",accessorKey:"updateSeverity",header:"Severity",cell:function(e){var t,n,r=e.getValue,o=e.row.original;return a.createElement(x.Z,{name:o.name,os:null===(t=o.os)||void 0===t?void 0:t.id,container:null===(n=o.hw)||void 0===n?void 0:n.container,warningLevel:o.updateSeverity,labels:o.labels||{},version:o.version,text:r()})}}])}),[l,u])},A=n(15861),B=n(64687),R=n.n(B),V=n(6585),U=n(97279),z=n(55899),H=n(27624);function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var G=function(e){return Array.isArray(e)?e.filter((function(e){return!e.hasAccessibleData})):e.hasAccessibleData?[]:[{id:e.id}]},K=function(e){return Array.isArray(e)?e:[{id:e.id}]},J=function(e){var t=e.openClaimNodeModal,n=e.roomUntouchable,r=e.isSpace,i=(0,z.Z)(),l=(0,H.Z)(),c=(0,m.Hm)("name"),s=(0,u.gI)("node:Delete"),d=(0,u.gI)("room:RemoveNode"),f=(0,u.gI)("node:Create"),p=(0,u.gI)("room:AddNode"),g=function(){var e=(0,A.Z)(R().mark((function e(t,n){var r,o;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return r=G(t),o=r.map((function(e){return e.id})),e.next=6,i(o,{onSuccess:n.resetRowSelection});case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),v=function(){var e=(0,A.Z)(R().mark((function e(t,n){var r,o;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return r=K(t),o=r.map((function(e){return e.id})),e.next=6,l(o,{onSuccess:n.resetRowSelection});case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),h=(0,a.useMemo)((function(){return{delete:{confirmLabel:"Yes, delete",confirmationMessage:function(e){return a.createElement(V.IC,{name:e.name})},confirmationTitle:function(e){return(0,V.Sq)(e.name)},declineLabel:"Cancel",disabledTooltipText:s?"Delete is disabled":"Only admins can delete",handleAction:g,isVisible:!!r,isDisabled:function(e){return e.disabled||!s},tooltipText:"Delete node from space"},remove:{confirmLabel:"Yes, remove",confirmationMessage:function(e){return a.createElement(U.O3,{name:e.name,roomName:c})},confirmationTitle:function(e){return(0,U.Br)(e.name)},declineLabel:"Cancel",handleAction:v,tooltipText:"Remove node from room",isVisible:!r,isDisabled:function(e){return e.disabled||n||!d},disabledTooltipText:n?"Remove is disabled":"Only admins can remove"}}}),[V.IC,V.Sq,U.Br,g,v,U.O3,n,r,s,d]),b=(0,a.useMemo)((function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({addEntry:{disabledTooltipText:r?"Only admins can connect new nodes":"Only admins can add nodes to the room",handleAction:t,isDisabled:r?!f:!(f||p&&!n),tooltipText:r?"Connect new nodes to space":"Add nodes to room"}},r?{delete:{confirmLabel:"Yes, delete",confirmationMessage:function(e,t){return a.createElement(V.cA,{name:t[0].name,nodesLength:t.length})},confirmationTitle:function(e,t){return(0,V.l9)({name:t[0].name,nodesLength:t.length})},disabledTooltipText:s?"Delete is disabled":"Only admins can delete",declineLabel:"Cancel",handleAction:g,isDisabled:!s,tooltipText:"Delete nodes from space"}}:{remove:{confirmLabel:"Yes, remove",confirmationMessage:function(e,t){return a.createElement(U.ar,{name:t[0].name,nodesLength:t.length,roomName:c})},confirmationTitle:function(e,t){return(0,U.d1)({name:t[0].name,nodesLength:t.length})},declineLabel:"Cancel",disabledTooltipText:n?"Remove is disabled":"Only admins can remove",handleAction:v,isDisabled:n||!d,tooltipText:"Remove nodes from room"}})}),[V.cA,V.l9,U.d1,g,v,f,s,d,U.ar,n,r]);return{rowActions:h,bulkActions:b,hasPermissionToDelete:s,hasPermissionToRemove:d}};function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Q={name:!1,updateSeverity:!1,connectionToCloud:!1},$=[{id:"state",desc:!1}],X=function(e){var t=e.flavour,n=e.roomUntouchable,r=e.customNodes,o=e.alwaysEnableNodeSelection,i=e.isSpace,c=(0,d.UO)().roomSlug,u=(0,m.UL)(c),g=(0,l.X7)(u,"ids"),v=(0,f.Ne)(g),h=L({isSpace:i}),b=(0,a.useMemo)((function(){return(0,p.C)(r||v)}),[r,g]),w=(0,a.useState)(""),E=(0,s.Z)(w,2)[1],C=(0,k.Z)(),x=(0,s.Z)(C,4),O=x[0],Z=x[2],S=x[3],P=J({openClaimNodeModal:Z,roomUntouchable:n,isSpace:i}),I=P.rowActions,j=P.bulkActions,D=P.hasPermissionToDelete,N=P.hasPermissionToRemove,T=(0,a.useCallback)((function(e,t,n){var r=n.toLowerCase(),o=e.getValue("agent").toLowerCase(),a=(0,y.Q5)(e.getValue("state")).toLocaleLowerCase(),i=(0,y.Lt)(e.getValue("connectionToCloud")).toLocaleLowerCase(),l=(e.getValue("updateSeverity")||"").toLocaleLowerCase(),c=e.getValue("version").toLowerCase();return o.includes(r)||a.includes(r)||c.includes(r)||i.includes(r)||l.includes(r)}),[]);return{nodes:b.map((function(e){var n=i?!D||!o&&e.hasAccessibleData:!N;return q(q({},e),{},{disabled:n||"availableNodes"==t&&!e.isPreferred})}))||[],nodeIds:g,columns:h,rowActions:I,bulkActions:j,isClaimNodeModalOpen:O,sortBy:$,columnVisibility:Q,setGlobalFilter:E,openClaimNodeModal:Z,closeClaimNodeModal:S,globalFilterFn:T}},ee=n(90025),te=n(74059),ne=n(33582),re=n(16645),oe=n(7693),ae=n(8741),ie=function(e){var t=e.onClose,n=(0,te.th)(),r=(0,m.UL)(),o=(0,a.useState)((function(){return r?[r]:[]})),l=(0,s.Z)(o,2),c=l[0],u=l[1];return(0,ne.Z)(n),a.createElement(re.u6,{onClose:t,"data-testid":"addNodes"},a.createElement(oe.x,{"data-testid":"addNodes-header",title:"Add Nodes",onClose:t}),a.createElement(re.TZ,{hasModalTitle:!1},a.createElement(i.Flex,{column:!0,"data-testid":"manageClaimedNodes-controls",gap:3},a.createElement(ee.Z,{placeholder:"Select Rooms",selectedValue:c,onChange:u}),a.createElement(ae.Z,{rooms:c}))))},le=n(71893),ce=n(14808),ue=(0,le.default)(i.Box).withConfig({displayName:"activeNodesIndicatior__ProgressBar",componentId:"sc-sq1772-0"})(["position:absolute;left:0;height:4px;"]),se=function(e){var t=e.isSpace,n=(0,M.Z)(),r=(0,s.Z)(n,3)[2],o=(0,Z.Z)(),l=o.hasLimitations,c=o.maxNodes,u=o.preferredNodes,d=ce.Z3&&t&&l&&r>c,m=(0,a.useMemo)((function(){return c>0?"".concat(u.length/c*100,"%"):"0%"}),[u,c]);return d?a.createElement(i.Flex,{width:"140px",column:!0,gap:1,margin:[0,0,0,2]},a.createElement(i.Text,null,"Active nodes: ",u.length,a.createElement(i.Text,{color:"primary"},"/",c)),a.createElement(i.Box,{width:"100%",height:"4px",round:!0,overflow:"hidden",position:"relative",background:"border"},a.createElement(ue,{width:m,background:"primary"}))):null};function de(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 me(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?de(Object(n),!0).forEach((function(t){(0,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fe=function(e){var t=e.flavour,n=e.roomUntouchable,r=e.showClaimNodeOnEmptySpace,o=void 0!==r&&r,s=e.customNodes,d=void 0===s?[]:s,m=e.customBulkActions,f=e.customRowActions,p=e.enableSelection,g=void 0===p||p,v=e.showdDefaultRowActions,h=void 0===v||v,b=e.showDefaultBulkActions,y=void 0===b||b,w=e.onRowSelected,E=e.onClickRow,C=e.disableClickRow,x=e.columnVisibility,O=e.customSortBy,k=e.showClaimModalWithRoomSelection,Z=void 0!==k&&k,S=e.alwaysEnableNodeSelection,P=void 0!==S&&S,I=e.isSpace,j=X({flavour:t,roomUntouchable:n,customNodes:d,alwaysEnableNodeSelection:P,isSpace:I,showClaimModalWithRoomSelection:Z}),D=j.nodes,N=j.columns,T=j.rowActions,F=j.bulkActions,M=j.sortBy,_=j.isClaimNodeModalOpen,L=j.openClaimNodeModal,A=j.closeClaimNodeModal,B=j.columnVisibility,R=j.setGlobalFilter,V=j.globalFilterFn,U=(0,u.gI)("node:Create"),z=(0,l.fD)();(0,a.useEffect)((function(){z&&o&&U&&0===D.length&&L()}),[z]);var H=(0,a.useMemo)((function(){return me(me({},B),x)}),[B,x]);return N.length?a.createElement(a.Fragment,null,a.createElement(i.Table,{headerChildren:a.createElement(se,{isSpace:I}),onRowSelected:w,globalFilterFn:V,columnVisibility:H,enableSelection:g,enableSorting:!0,dataColumns:N,data:D,rowActions:h&&T||f,bulkActions:y&&F||m,sortBy:O||M,onSearch:R,testPrefixCallback:function(e){return e.hostname||e.name},onClickRow:E,disableClickRow:C}),_&&!Z&&a.createElement(c.Z,{onClose:A,isSubmodal:!0}),_&&Z&&a.createElement(ie,{onClose:A})):null}},22965:function(e,t,n){n.d(t,{Br:function(){return T},Dy:function(){return y},Lt:function(){return b},MC:function(){return C},O2:function(){return w},Q5:function(){return h},cB:function(){return E},hC:function(){return f},jG:function(){return F},jo:function(){return N},kR:function(){return g},yK:function(){return S},yo:function(){return Z},ys:function(){return O}});n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(15861),o=n(4942),a=n(64687),i=n.n(a),l=(n(92222),n(69826),n(41539),n(31672),n(2490),n(59461),n(47941),n(57327),n(88449),n(59849),n(26699),n(32023),n(21249),n(57640),n(9924),n(67294)),c=n(41379),u=n(71172);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,o.Z)(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}var m="N/A",f=function(e){var t,n,r=e.isLive,o=e.health,a=void 0===o?{}:o;return r?null!==(t=a.alerts)&&void 0!==t&&t.critical?"critical":null!==(n=a.alerts)&&void 0!==n&&n.warning?"warning":"clear":"unreachable"},p=function(e){return e>9?"9+":"".concat(e)},g=function(e){var t=e.count,n=e.dataTestId,r=e.isLive,o=e.onAlertClick,a=e.type,i=n?"".concat(n,"-alertIndicator"):"alertIndicator",l={"data-testid":"".concat(i,"-").concat(a)};return r?d(d(d(d({},l),t&&{flavour:"critical"===a?"error":"warning"}),t&&o&&{onClick:function(){return o(a)}}),{},{text:p(t)}):l},v={created:"Unseen",reachable:"Live",stale:"Stale",unreachable:"Offline"},h=function(e){return v[e]||v.stale},b=function(e){return"created"===e?"Pending":"Completed"},y=function(e){return e?{flavour:"success",label:"ON",status:"ON"}:{flavour:"warning",label:"OFF",status:"OFF"}},w=function(e){return!e||"unknown"===e},E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" \u2022 ";return w(e)?m:"".concat(e).concat(n).concat(t)},C=function(e,t){return w(e)?m:t?"".concat(e," ").concat(t):e},x={HZ:1,KHz:1e3,MHz:1e6,GHz:1e9,THz:1e12,PHz:1e15,EHz:1e18},O=function(e){if(w(e))return m;var t=Object.keys(x).find((function(t){return 1e3>e/x[t]}));return"".concat((e/=x[t]).toFixed(2)," ").concat(t||"")},k={B:1,KiB:1024,MiB:1048576,GiB:1073741824,TiB:1099511627776,PiB:0x4000000000000,EiB:0x1000000000000000},Z=function(e){if(w(e))return m;var t=Object.keys(k).find((function(t){return 1024>e/k[t]}));return"".concat((e/=k[t]).toFixed(2)," ").concat(t||"")},S=function(e,t,n,r,o){var a={Live:l.createElement(l.Fragment,null,"is currently connected"),Offline:l.createElement(l.Fragment,null,"is currently not connected"),Stale:l.createElement(l.Fragment,null,"is currently not connected and has only historical data")},i={actionObsolete:l.createElement(l.Fragment,null,"Delete Node"),actionRemove:l.createElement(l.Fragment,null,"Remove Node from room"),alerts:l.createElement(l.Fragment,null,"The current Critical and Warning alerts for ",r),cloudInfo:l.createElement(l.Fragment,null,r," cloud information:",l.createElement("br",null),"Cloud Provider \u2022 Instance Type"),connectivity:t in a?l.createElement(l.Fragment,null,r," ",a[t]):null,info:l.createElement(l.Fragment,null,"View node information"),k8s:l.createElement(l.Fragment,null,r," runs on Kubernetes cluster"),kernel:l.createElement(l.Fragment,null,"Kernel information of ",r),ml:l.createElement(l.Fragment,null,"Machine Learning status of ",r," is: ",n),fn:l.createElement(l.Fragment,null,"Functions capability of ",r," is: ",n),functions:l.createElement(l.Fragment,null,r," functions"),systemInfo:l.createElement(l.Fragment,null,r," hardware information:",l.createElement("br",null),"O/S \u2022 CPU Frequency \u2022 CPU Cores \u2022 Architecture \u2022 Memory \u2022 Hard Disk Space"),type:l.createElement(l.Fragment,null,"The type of ",r," is: ",o)};return e in i?i[e]:""},P={none:!0,null:!0,unknown:!0},I=function(e){return!!e&&!P[e]},j={container:"container","container-other":"container",other:"container"},D={"$(systemd-detect-virt -v)":"vm","$(systemd-detect-virt -v) docker-compose up":"vm","${VIRTUALIZATION}":"vm","(systemd-detect-virt -v)":"vm","detect-virt -v":"vm",lxc:"vm","none #vmware":"vmware",other:"vm","systemd-detect-virt -v":"vm",unknown:"vm","vm-other":"vm","VMware Virtual Platform":"vmware"},N=function(e,t){return I(e)?{icon:"container",label:j[e]||e}:I(t)?{icon:"cluster",label:D[t]||t}:{icon:"ram",label:"Bare Metal"}},T=function(){var e=(0,r.Z)(i().mark((function e(t){var n,r,o,a,l,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.cacheKeyPrefix,r=t.nodeIds,o=t.roomId,a=t.spaceId,l=function(e){return e.results.filter((function(e){return!r.includes(e.id)}))},s="".concat(n).concat((0,c.A)({id:o,spaceId:a})),e.next=5,(0,u.c)({key:s,handleResults:l});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),F=function(){var e=(0,r.Z)(i().mark((function e(t){var n,o,a,l,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.cacheKeyPrefix,o=t.nodeIds,a=t.roomIds,l=t.spaceId,s=function(e){return e.results.filter((function(e){return!o.includes(e.id)}))},a.map(function(){var e=(0,r.Z)(i().mark((function e(t){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="".concat(n).concat((0,c.A)({id:t,spaceId:l})),e.next=3,(0,u.c)({key:r,handleResults:s});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},77184:function(e,t,n){n.d(t,{$3:function(){return h},G1:function(){return y},IU:function(){return g},JV:function(){return p},Y0:function(){return f},eZ:function(){return w},h3:function(){return m}});var r=n(4942),o=(n(85827),n(41539),n(25387),n(2490),n(72608),n(92222),n(21249),n(57640),n(9924),n(47941),n(82526),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(26398)),a=n(64637),i=n(66152),l=n(3689),c=n(31790);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=function(e){var t=e.integrations;return t.reduce((function(e,t){var n,r=(0,i.k5)(t),o=r.available?"available":"unavailable";return r.kindLabel=(0,a.fm)(r.kind,!0),r.docsLink=null===(n=t.schema)||void 0===n||null===(n=n.annotations)||void 0===n?void 0:n.docsUrl,r.internal||(r.fields=(0,c.sY)(r.schema),r.required=r.schema.required),e[o].push(r),e}),{available:[],unavailable:[],original:t})},m=function(e){return o.Z.get("/api/v2/spaces/".concat(e,"/integrations"),{transform:d})},f=function(e,t){return o.Z.post("/api/v2/spaces/".concat(e,"/channel"),t)},p=function(e,t){return o.Z.delete("/api/v2/spaces/".concat(e,"/channel/").concat(t))},g=function(e,t,n){return o.Z.put("/api/v2/spaces/".concat(e,"/channel/").concat(t),n)},v=function(e){var t,n=(0,i.k5)(e);return n.docsLink=null===(t=n.schema)||void 0===t?void 0:t.annotations.docsUrl,n.internal||(n.fields=(0,c.sY)(n.schema),n.required=n.schema.required),n},h=function(e,t){return o.Z.get("/api/v2/spaces/".concat(e,"/channel/").concat(t),{transform:v})},b=function(e){return{channels:e.map((function(e){return s(s({},(0,i.k5)(e)),{},{notificationLabel:l.uK[e.alarms].label,kindLabel:(0,a.fm)(e.kind,!0)})})),original:e}},y=function(e){return o.Z.get("/api/v2/spaces/".concat(e,"/channel"),{transform:b})},w=function(e,t,n){return o.Z.patch("/api/v2/spaces/".concat(e,"/channel/").concat(t),{enabled:n})}},45939:function(e,t,n){n.d(t,{C:function(){return l}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(4480);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l={additionalProperties:!1,alerts:"ALARMS_SETTING_ALL",description:"",enabled:!0,error:"",fields:[],icon:"",internal:!0,id:"",integration:"",integrationId:"",kind:"",loading:!0,loaded:!1,name:"",rooms:null,roomSelections:[n(3689).k_],secrets:{}},c=(0,o.xu)({key:"spaceChannel",default:function(e){return function(e){return i(i({},l),{},{id:e})}(e)}});t.Z=c},15635:function(e,t,n){n.d(t,{g:function(){return l}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(4480);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l={currentChannelId:"",channels:[],error:"",id:null,loading:!0,loaded:!1,original:[]},c=(0,o.xu)({key:"spaceChannels",default:function(e){return function(e){return i(i({},l),{},{id:e})}(e)}});t.Z=c},26913:function(e,t,n){n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(77184),a=n(45736),i=n(15635),l=n(5429);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 u(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.Z)(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}t.Z=function(e){var t=(0,a.rz)(e);(0,l.Z)((function(){return{enabled:!!e,fetch:function(){return(0,o.G1)(e)},onFail:function(e){return t(u(u({},i.g),{},{error:e.message}))},onSettle:function(){return t({loading:!1,loaded:!0})},onSuccess:function(e){return t(u(u({},i.g),e))}}}),[e])}},69414:function(e,t,n){n.d(t,{E:function(){return l}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(4480);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l={available:[],error:"",id:null,loading:!0,loaded:!1,original:[],unavailable:[]};t.Z=(0,o.xu)({key:"spaceIntegrations",default:function(e){return function(e){return i(i({},l),{},{id:e})}(e)}})},3528:function(e,t,n){n.d(t,{dR:function(){return j},hd:function(){return P},MJ:function(){return I}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(15861),o=n(29439),a=n(4942),i=n(71002),l=n(45987),c=n(64687),u=n.n(c),s=n(4480),d=n(93017),m=(n(92222),n(26398)),f=["domain"];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 g(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,a.Z)(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}var v={email:null,browser:null,mobile:null},h={alerts:null},b={me:function(){return"/api/v2/accounts/me/notifications/settings"},room:function(e){var t=e.spaceId,n=e.roomId;return"/api/v2/spaces/".concat(t,"/rooms/").concat(n,"/notifications/settings")}},y=function(e){var t=e.domain,n=(0,l.Z)(e,f);return(0,b[t])(n)},w=(0,s.xu)({key:"notificationsSettings",default:function(e){var t=function(e){var t=e.domain;return{me:v,room:h}[t]}(e),n=y(e);return m.Z.get(n).then((function(e){return g(g(g({},t),e.data),{},{isLoaded:!0})})).catch((function(){return g(g({},t),{},{isLoaded:!0})}))}}),E=n(68008),C=["prop"];function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var k=(0,s.CG)({key:"notificationsSettings",get:function(e){return function(t){return(0,t.get)(w(e))}},set:function(e){return function(t,n){var r=t.set,o=e.prop,c=(0,l.Z)(e,C);r(w(c),(function(e){var t="object"==(0,i.Z)(e[o])?O(O({},e[o]),{},{enabled:n}):n;return o?O(O({},e),{},(0,a.Z)({},o,t)):t}))}}}),Z=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).shouldPersist,n=void 0===t||t,i=(0,s.Zl)(k(e)),l=function(e){return(0,E.Z)((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return m.Z.patch(y(e),t)}),[e.domain,e.spaceId,e.roomId])}(e),c=(0,d.Z)(),f=(0,o.Z)(c,2)[1];return(0,s._8)((function(t){var o=t.snapshot;return function(){var t=(0,r.Z)(u().mark((function t(r){var c,s;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i(r),n){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,o.getPromise(k(e));case 5:return c=t.sent,s=e.prop,t.prev=7,t.next=10,l(O({},s?(0,a.Z)({},s,r):r));case 10:t.next=16;break;case 12:t.prev=12,t.t0=t.catch(7),f(t.t0),i(s?c[s]:c);case 16:case"end":return t.stop()}}),t,null,[[7,12]])})));return function(e){return t.apply(this,arguments)}}()}),[e])},S=function(e){return(0,s.$P)(k(e))},P=function(){return(0,s.$P)(w({domain:"me"}))},I=function(e){var t={domain:"me"},n=S(t),r="hasValue"!==n.state?v:n.contents,o=Z(O(O({},t),{},{prop:e}));return[e?r[e]:r,o]},j=function(e){var t=e.roomId,n=e.spaceId,r=e.key,o={domain:"room",roomId:t,spaceId:n},a=S(o),i="hasValue"!==a.state?h:a.contents,l=Z(O(O({},o),{},{prop:r}));return[r?i[r]:i,l]}},45736:function(e,t,n){n.d(t,{Cz:function(){return v},R1:function(){return w},h3:function(){return f},pV:function(){return g},ry:function(){return y},rz:function(){return h},su:function(){return m}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(4480),a=n(45939),i=n(15635),l=n(69414),c=n(31790);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=(0,o.CG)({key:"spaceChannelState",get:function(e){var t=e.id,n=e.key;return function(e){var r=(0,e.get)((0,a.Z)(t));return n?r[n]:r}},set:function(e){var t=e.id,n=e.key;return function(e,o){(0,e.set)((0,a.Z)(t),(function(e){return n?s(s({},e),{},(0,r.Z)({},n,o)):s(s({},e),o)}))}}}),m=function(e,t){return(0,o.sJ)(d({id:e,key:t}))},f=function(e){return(0,o.rb)(d(e))},p=(0,o.CG)({key:"spaceChannelsState",get:function(e){var t=e.id,n=e.key;return function(e){var r=(0,e.get)((0,i.Z)(t));return r=s(s({},r),{},{channels:(0,c.SM)(r.channels)}),n?r[n]:r}},set:function(e){var t=e.id,n=e.key;return function(e,o){(0,e.set)((0,i.Z)(t),(function(e){return n?s(s({},e),{},(0,r.Z)({},n,o)):s(s({},e),o)}))}}}),g=function(e,t){return(0,o.sJ)(p({id:e,key:t}))},v=function(e,t){return(0,o.Zl)(d({id:e,key:t}))},h=function(e,t){return(0,o.Zl)(p({id:e,key:t}))},b=(0,o.CG)({key:"spaceIntegrationsState",get:function(e){var t=e.id,n=e.key;return function(e){var r=(0,e.get)((0,l.Z)(t));return r=s(s({},r),{},{available:(0,c.SM)(r.available),unavailable:(0,c.SM)(r.unavailable)}),n?r[n]:r}},set:function(e){var t=e.id,n=e.key;return function(e,o){(0,e.set)((0,l.Z)(t),(function(e){return n?s(s({},e),{},(0,r.Z)({},n,o)):s(s({},e),o)}))}}}),y=function(e,t){return(0,o.sJ)(b({id:e,key:t}))},w=function(e,t){return(0,o.Zl)(b({id:e,key:t}))}},31790:function(e,t,n){n.d(t,{SM:function(){return O},uf:function(){return h},xW:function(){return b},D4:function(){return y},sY:function(){return w},XM:function(){return E},ae:function(){return C},A_:function(){return x}});var r=n(29439),o=n(4942),a=(n(26699),n(32023),n(57327),n(41539),n(88449),n(2490),n(59849),n(82526),n(41817),n(85827),n(25387),n(72608),n(47941),n(92222),n(69826),n(31672),n(59461),n(26833),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(93433)),i=n(45987),l=(n(74916),n(4723),n(21249),n(57640),n(9924),n(69720),n(57557)),c=n.n(l),u=n(3689),s=["description","placeholder","title","type"];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 m(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,o.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=function(e,t,n){var l=t.description,d=t.placeholder,f=t.title,p=t.type,g=(0,i.Z)(t,s),v=n.includes(e),h={description:l,id:e,isRequired:v,placeholder:d||"",title:f||e};if("string"===p&&"selection"!==e){var b=g.format,y=g.maxLength,E=g.minLength;return m(m(m({component:"input",getValue:function(e){var t=e.id,n=e.secrets,r=e.subsetId;return(r?n[t][r]:n[t])||""},isValid:function(e){return!!("uri"!==b||null!==e&&void 0!==e&&e.match(u.yV))&&(!(E&&e.length<E)&&!(y&&e.length>y))}},y?{maxlength:y}:{}),E?{minlength:E}:{}),{},{onChange:function(e){var t=e.id,n=e.setSecrets,r=e.subsetId;return function(e){return n((function(n){return m(m({},n),{},r?(0,o.Z)({},t,m(m({},n[t]),{},(0,o.Z)({},r,e))):(0,o.Z)({},t,e))}))}},type:"uri"===b?"url":b||"text"},h)}if("object"===p){var C=g.oneOf,x=g.patternProperties;if(C)return m(m({component:"select",getValue:function(e){var t,n,r=e.id,o=e.secrets;return{label:(null===(t=C.find((function(e){var t;return e.properties.selection.const===(null===(t=o[r])||void 0===t?void 0:t.selection)})))||void 0===t?void 0:t.title)||(v?C[0].title:"None"),value:(null===(n=o[r])||void 0===n?void 0:n.selection)||(v?C[0].properties.selection.const:"")}},onChange:function(e){var t=e.id,n=e.setRequiredSubsets,r=e.setSecrets;return function(e){var a=e.label,i=e.value;if(!i)return n((function(e){return c()(e,t)})),void r((function(e){return c()(e,t)}));var l=C.find((function(e){return e.title===a}));null!==l&&void 0!==l&&l.required&&n((function(e){return m(m({},e),{},(0,o.Z)({},t,C.find((function(e){return e.title===a})).required))})),r((function(e){return m(m({},e),{},(0,o.Z)({},t,{selection:i}))}))}}},C.reduce((function(e,t){return{fields:m(m({},e.fields),{},(0,o.Z)({},t.properties.selection.const,w(t))),options:[].concat((0,a.Z)(e.options),[{label:t.title,value:t.properties.selection.const}]),required:m(m({},e.required),{},(0,o.Z)({},t.properties.selection.const,t.required))}}),{fields:{},options:v?[]:[{label:"None",value:""}],required:{}})),h);if(x)return m({component:"pairs",componentPairs:Object.entries(x).map((function(e){var t=(0,r.Z)(e,2),n=t[0],o=t[1].type;return[u.zK[n],u.q7[o]]}))},h)}return null},p=n(14808);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 v(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,o.Z)(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}var h=function(e,t){var n=function(e){return e.toLowerCase().includes(t.toLowerCase()||"")};return e.filter((function(e){var t=e.description,r=e.kind,o=e.title;return n(t)||n(r)||n(o)}))},b=function(e,t,n){return!!t&&("selection"===e||("select"===n.component||n.isValid(t)))},y=function(e){return"Delete ".concat(e," channel")},w=function(e){var t=e.properties,n=e.required;return Object.keys(t).reduce((function(e,r){var a=f(r,t[r],n);return v(v({},e),a?(0,o.Z)({},r,a):{})}),{})},E=function(e){var t=(0,r.Z)(e,2),n=t[0],o=t[1];return n===o?"".concat(n,"s"):"".concat(n,"/").concat(o)},C=function(e){var t=e.roomIds,n=e.roomOptions;return t.reduce((function(e,t){var r=n.find((function(e){return e.value===t}));return r&&e.push(r.label),e}),[]).join(", ")},x=function(e,t){return Object.values(e).reduce((function(e,n){return"select"===n.component&&t.includes(n.id)?v(v({},e),{},(0,o.Z)({},n.id,{selection:n.options[0].value})):e}),{})},O=function(e){return p.xy?e:e.filter((function(e){return e.id!==u.XH}))}},28350:function(e,t,n){n.d(t,{Z:function(){return E}});var r=n(87462),o=n(45987),a=n(67294),i=n(93416),l=n(91268),c=n(74059),u=n(37518),s=n(60730),d=n(46189),m=n(15418),f=function(e){var t=e.spaceName;return a.createElement(i.Text,{textAlign:"center"},"Please ask your administrator to claim more nodes to\xa0",a.createElement(i.Text,{strong:!0},t)," and you will be able to add them to this room")},p=function(){return a.createElement(i.Text,{textAlign:"center"},"To add nodes to this room, you first need to claim them to its space.")},g=function(e){var t=e.spaceName,n="".concat(d.Z.assetsBaseURL,"/img/rack.png");return a.createElement(i.Flex,{column:!0,padding:[4,8,0],alignItems:"center",gap:4},a.createElement("img",{src:n,alt:"server-rack",width:"188px",height:"188px"}),a.createElement(i.H4,{textAlign:"center"},"No claimed nodes available in this Space: ",t),a.createElement(m.Z,{permission:"node:Create"},(function(e){return e?a.createElement(p,null):a.createElement(f,{spaceName:t})})))},v=n(93433),h=n(29439),b=(n(21249),n(57640),n(9924),n(85827),n(41539),n(25387),n(2490),n(72608),n(57327),n(88449),n(59849),n(26699),n(32023),n(92222),function(e){var t=e.setNodes,n=(0,a.useState)(""),r=(0,h.Z)(n,2),o=r[0],i=r[1],l=(0,a.useState)(!0),c=(0,h.Z)(l,2),u=c[0],s=c[1],d=(0,a.useState)([]),m=(0,h.Z)(d,2),f=m[0],p=m[1];return(0,a.useEffect)((function(){var e=f.map((function(e){return e.id}));e.length||!o||u||t((function(e){return o.split(",").reduce((function(e,t){return e.filter((function(e){return e.id!==t}))}),e)})),e.length&&e.join()!==o&&(t((function(t){var n=t.map((function(e){return e.id}));return e.reduce((function(e,t,r){return n.includes(t)?e:[].concat((0,v.Z)(e),[f[r]])}),t)})),s(!1)),i(e.join())}),[f]),{onRowSelected:p}}),y=["claimedNodeIds","data","roomId","setNodes","showHeader","onAddNodes","canAddNodes","addNodesGA"],w={connectionToCloud:!1},E=function(e){var t=e.claimedNodeIds,n=e.data,d=e.roomId,m=e.setNodes,f=e.showHeader,p=e.onAddNodes,v=e.canAddNodes,h=e.addNodesGA,E=(0,o.Z)(e,y),C=b({setNodes:m}).onRowSelected,x=(0,c.OS)(),O=(0,u.tE)(d),k=(0,a.useMemo)((function(){return{addEntry:{handleAction:p,tooltipText:"Add the selected nodes to the room",isDisabled:!v,disabledTooltipText:"Select some nodes to add to the room","data-ga":h}}}),[p,v]);return a.createElement(i.Flex,(0,r.Z)({column:!0,gap:3,padding:[2,0,0],flex:"grow",width:"100%",height:"100%"},E),f&&a.createElement(i.Flex,{margin:[0,0,5]},a.createElement(i.H3,null,"Available Nodes (",t.length,")")),f&&a.createElement(i.Flex,null,a.createElement(i.Text,{color:"textDescription"},"Nodes in ",x.name," that can be added to ",O.name)),t.length>0?a.createElement(l.Z,{"data-testid":"nodesTable-layout",overflow:"hidden",height:"100%"},a.createElement(s.Z,{flavour:"availableNodes",enableSelection:!0,customNodes:n,showdDefaultRowActions:!1,showDefaultBulkActions:!1,customBulkActions:k,onRowSelected:C,columnVisibility:w,alwaysEnableNodeSelection:!0})):a.createElement(g,{spaceName:x.name}))}},86242:function(e,t,n){n.d(t,{Z:function(){return p}});var r=n(29439),o=(n(57327),n(41539),n(88449),n(2490),n(59849),n(21249),n(57640),n(9924),n(26699),n(32023),n(67294)),a=n(54624),i=n(74059),l=n(37518),c=n(53338),u=n(25819),s=n(96929),d=n(46322),m=n(5429),f=n(93017),p=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).addNodesCallback,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=(0,o.useState)(e),n=(0,r.Z)(t,2),i=n[0],l=n[1],c=(0,o.useState)([]),u=(0,r.Z)(c,2),s=u[0],d=u[1];(0,a.Z)((function(){d([i])}),300,[i]);var m=(0,o.useCallback)((function(e){return l(e.currentTarget.value)}),[l]);return[i,m,s]}(),p=(0,r.Z)(n,3),g=p[0],v=p[1],h=p[2],b=(0,o.useState)([]),y=(0,r.Z)(b,2),w=y[0],E=y[1],C=(0,i.th)(),x=(0,l.HM)(C,c.i_),O=(0,f.Z)(),k=(0,r.Z)(O,2)[1],Z=(0,m.Z)((function(){return{enabled:!!x,fetch:function(){return(0,u.Fz)({roomId:x,spaceId:C})},initialValue:[],onFail:function(e){k(e)}}}),[x,C]),S=(0,r.Z)(Z,1)[0],P=(0,s.X7)(e,"ids"),I=(0,o.useMemo)((function(){return S.map((function(e){return e.id})).filter((function(e){return!P.includes(e)}))}),[P,S]),j=(0,o.useMemo)((function(){return(0,d.C)(S)}),[S]),D=(0,s.iB)(C,e,{onSuccess:t});return[{claimedNodeIds:I,data:j,filter:g,setFilter:v,debouncedFilter:h,setNodes:E},{onAddNodes:(0,o.useCallback)((function(){return D(w.map((function(e){return e.id})))}),[D,w]),onAddNode:(0,o.useCallback)((function(e){D([e],{makeCallback:!1})}),[D]),selectedNodes:w}]}},89149:function(e,t,n){n.d(t,{Z:function(){return _}});var r=n(87462),o=n(29439),a=(n(66992),n(41539),n(88674),n(78783),n(33948),n(67294)),i=n(2145),l=n(93416),c=n(37518),u=n(74059),s=n(16645),d=n(7693),m=n(92903),f=n(668),p=n(97346),g=n(8741),v=n(28350),h=n(86242),b=n(78266),y=n(45987),w=n(33582),E=n(50308),C=n.n(E),x=(n(92222),n(71893)),O=n(16931),k=n(52428),Z=(0,x.default)(l.Icon).withConfig({displayName:"copyInfo__StyledIcon",componentId:"sc-fgr5qt-0"})(["display:flex;align-self:center;cursor:pointer;position:absolute;right:16px;"]),S=function(e){var t=e.gaPrefix,n=void 0===t?"claim-nodes":t,r=e.info,o=e.title,i=void 0===o?"Claim token":o,c=e.type,u=void 0===c?"token":c,s=e.copyDisabled,d=void 0!==s&&s;return a.createElement(l.Flex,{cursor:"pointer","data-testid":"".concat(u,"Copy"),gap:2,onClick:(0,k.J)(r,{text:"".concat(i," copied to clipboard")}),position:"relative"},a.createElement(O.U8,{"data-testid":"".concat(u,"TextBlock")},r),!d&&a.createElement(Z,{"data-testid":"".concat(u,"CopyButton"),"data-ga":"".concat(n,"::click-copy-").concat(u,"::allpages"),name:"copy",size:"small",color:"primary",onClick:(0,k.J)(r,{text:"".concat(i," copied to clipboard")})}))},P=function(e){var t=e.title,n=void 0===t?"":t,r=e.info,o=void 0===r?"Loading...":r,i=e.copyDisabled,c=void 0!==i&&i,u=e.onClose,s=void 0===u?C():u;return a.createElement(l.Modal,null,a.createElement(l.ModalContent,{width:{min:80,base:150},height:30},a.createElement(l.ModalHeader,null,a.createElement(l.H3,null,n),a.createElement(l.ModalCloseButton,{onClose:s})),a.createElement(l.ModalBody,null,a.createElement(S,{info:o,copyDisabled:c}))))},I=["spaceId"],j=function(e){var t,n,o=e.spaceId,i=(0,y.Z)(e,I),l=(0,w.Z)(o);return a.createElement(P,(0,r.Z)({title:"Claim Token",info:null===(t=l[0])||void 0===t?void 0:t.token,copyDisabled:!(null!==(n=l[0])&&void 0!==n&&n.token)},i))},D=n(41898),N=n(46667),T=n(63346),F=(0,i.Z)((function(){return Promise.all([n.e(6502),n.e(8663),n.e(6129),n.e(2337)]).then(n.bind(n,66129))})),M={default:{modal:{"data-testid":"addWarRoomModal"},sidebarModalHeader:{"data-testid":"addWarRoomModal-header"},sidebarContent:{"data-testid":"addWarRoomModal-content",overflow:"auto",hasFooter:!1}},integrations:{modal:{"data-testid":"addIntegrationModal"},sidebarModalHeader:{"data-testid":"addIntegration-header"},sidebarContent:{"data-testid":"addIntegration-content",overflow:"hidden",hasFooter:!1,padding:[0],hasModalTitle:!1}}},_=function(e){var t=e.title,n=void 0===t?"Add Nodes":t,i=e.onClose,y=e.isSubmodal,w=e.flavour,E=void 0===w?"default":w,C=(0,u.th)(),x=(0,c.Hm)(),O=(0,c.Jb)(),k=null!==x&&void 0!==x&&x.loaded?x:O,Z=null===k||void 0===k?void 0:k.id,S=(0,a.useMemo)((function(){return M[E]}),[E]),I="integrations"==E,_=I?f.u6:s.u6,L=(0,h.Z)(Z,{addNodesCallback:i}),A=(0,o.Z)(L,2),B=A[0],R=A[1],V=R.onAddNodes,U=R.selectedNodes,z=(0,N.Z)(),H=(0,o.Z)(z,4),W=H[0],G=H[2],K=H[3],J=(0,N.Z)(),Y=(0,o.Z)(J,4),q=Y[0],Q=Y[2],$=Y[3];return a.createElement(T.ZP,{feature:"AddNodes"},a.createElement(_,(0,r.Z)({right:!0,closeOnEsc:!0,closeOnOverlayClick:!0,onClose:i},S.modal),a.createElement(d.x,(0,r.Z)({title:I?a.createElement(l.TextBig,{color:"textLite"},n):a.createElement(a.Fragment,null,"Manage room",a.createElement(l.TextBig,{color:"textLite"},"\xa0/ Add Nodes")),isSubmodal:y,onClose:i},S.sidebarModalHeader||{}),!I&&a.createElement(p.Z,{permission:"node:Create"},a.createElement(l.Flex,{gap:2},a.createElement(l.Button,{flavour:"borderless",onClick:G},"Claim Token"),a.createElement(l.Button,{flavour:"borderless",onClick:Q},"Room ID")))),!I&&a.createElement(m.B,{"data-testid":"addWarRoomModal-title"},"Add nodes to\xa0",null===k||void 0===k?void 0:k.name),a.createElement(s.TZ,S.sidebarContent||{},I?a.createElement(a.Suspense,{fallback:a.createElement(b.Z,{title:"Loading integrations..."})},a.createElement(F,{flavour:D.RV.addNodesModal})):a.createElement(p.Z,{permission:"node:Create"},a.createElement(a.Fragment,null,a.createElement(g.Z,{rooms:[Z]}),!k.untouchable&&a.createElement(v.Z,(0,r.Z)({"data-testid":"addWarRoomModal-availableNodes"},B,{onAddNodes:V,canAddNodes:!!U.length,addNodesGA:"add-war-room-modal::click-add-node::global-view"})))))),!I&&W&&a.createElement(T.ZP,{subModal:"ClaimTokenModal"},a.createElement(j,{spaceId:C,onClose:K})),!I&&q&&a.createElement(T.ZP,{subModal:"RoomIdModal"},a.createElement(P,{title:"Room ID",info:Z,copyDisabled:!Z,onClose:$})))}},8741:function(e,t,n){n.d(t,{Z:function(){return p}});var r=n(29439),o=(n(21249),n(57640),n(9924),n(67294)),a=n(93416),i=n(74059),l=n(8641),c=n(35819),u=n(58257),s=n(35253),d=function(e){var t=e.label;return t?o.createElement(o.Fragment,null,o.createElement(a.Icon,{name:"code",size:"small"}),o.createElement(a.TextNano,{strong:!0,textTransform:"uppercase"},t)):null},m=(0,o.memo)(d),f=n(16931),p=(n(69826),n(41539),n(31672),n(2490),n(59461),function(e){var t=e.integrationId,n=e.rooms,d=void 0===n?[]:n,p=(0,l.RG)(),g=(0,i.OS)("plan"),v=function(){var e=(0,l.NE)();return function(t){return e.find((function(e){return e.id==t}))}}(),h=v(t),b=(0,o.useState)(0),y=(0,r.Z)(b,2),w=y[0],E=y[1],C=(0,o.useState)(s.N[g]||s.N.default),x=(0,r.Z)(C,2),O=x[0],k=x[1];return o.createElement(a.Flex,{column:!0,gap:4,width:"100%"},o.createElement(a.Flex,{justifyContent:"end"},o.createElement(c.Z,{isNightly:"nightly"==O,toggleNightly:function(e){var t=e.target.checked?"nightly":"stable";k(t)}})),h?o.createElement(u.Z,{integration:h,isNightly:"nightly"==O,rooms:d,navigateToSettings:!0}):o.createElement(a.Tabs,{selected:w,onChange:E,TabContent:f.m7,tabsProps:{gap:1,margin:[0,0,4,0]}},p.map((function(e){return o.createElement(a.Tab,{as:f.Sn,key:e.name,label:o.createElement(m,{label:e.name})},o.createElement(u.Z,{integration:e,isNightly:"nightly"==O,rooms:d,navigateToSettings:!0}))}))))})},56662:function(e,t,n){n.d(t,{U:function(){return f}});var r=n(29439),o=n(67294),a=n(89250),i=n(12599),l=n(93416),c=n(97323),u=n(74059),s=n(37518),d=n(16645),m=n(7693),f=function(e){var t=e.onClose,n=e.onDone,f=e.isSubmodal,p=void 0===f||f,g=(0,u.th)(),v=(0,o.useState)(""),h=(0,r.Z)(v,2),b=h[0],y=h[1],w=(0,l.useInputValue)({maxChars:255,value:""}),E=(0,r.Z)(w,3),C=E[0],x=E[1],O=E[2],k=function(e){var t=(0,a.s0)(),n=(0,u.uk)();return(0,o.useMemo)((function(){return function(r){var o=r.slug,a=(0,i.Gn)("/spaces/:spaceSlug/rooms/:roomSlug",{spaceSlug:n,roomSlug:o});e(),t(a)}}),[n])}(t),Z=(0,s.Dq)(g,{onSuccess:n||k}),S=(0,o.useCallback)((function(){Z({name:b,description:C})}),[b,C]);return o.createElement(d.u6,{onClose:t},o.createElement(m.x,{onClose:t,isSubmodal:p,title:"Create a new room"},o.createElement(l.Button,{label:"Add",onClick:S,disabled:!b})),o.createElement(d.TZ,null,o.createElement(c.Q,{roomName:b,setRoomName:y,roomDescription:C,charsDescIndicator:O,setRoomDescription:x,isCreateForm:!0})))}},7724:function(e,t,n){n.d(t,{CE:function(){return s},M5:function(){return m},R4:function(){return d}});var r=n(29439),o=(n(92222),n(67294)),a=n(93416),i=n(74059),l=n(46667),c=n(37518),u=n(33335),s=function(e){var t=1===e;return"Delete ".concat(e," ").concat(t?"room":"rooms")},d=function(e){return"Delete ".concat(e," room")},m=function(e){var t=e.name,n=e.roomsLength,r=e.spaceName,a=t||"".concat(n,1===n?" room":" rooms");return o.createElement(o.Fragment,null,"You are about to delete ",o.createElement("strong",null,a)," from ",o.createElement("strong",null,r)," space.",o.createElement("br",null),"This cannot be undone. Are you sure you want to continue?")};t.ZP=function(e){var t=e.id,n=e.name,s=e.navigateToParent,f=(0,i.OS)("name"),p=(0,c.tE)(t,"untouchable"),g=(0,u.gI)("room:Delete")&&!p,v=(0,c.IX)(t,{onSuccess:s}),h=(0,l.Z)(),b=(0,r.Z)(h,4),y=b[0],w=b[2],E=b[3];return g?o.createElement(o.Fragment,null,o.createElement(a.Button,{"data-testid":"manageWarRoom-delete",flavour:"hollow",onClick:w,label:"Delete room",danger:!0}),y&&o.createElement(a.ConfirmationDialog,{confirmLabel:"Yes, delete","data-ga":"delete-war-room-dialog","data-testid":"deleteWarRoomDialog",handleConfirm:v,handleDecline:E,message:o.createElement(m,{name:n,spaceName:f}),title:d(n)})):null}},97323:function(e,t,n){n.d(t,{Q:function(){return k}});var r=n(87462),o=n(29439),a=n(45987),i=(n(24603),n(74916),n(88386),n(39714),n(82526),n(41817),n(77601),n(67294)),l=n(93416),c=n(62200),u=n(95383),s=n(37518),d=n(33335),m=n(1229),f=n(46667),p="leave-war-room-dialog",g="leaveWarRoomDialog",v=function(e){var t=e.id,n=e.name,a=e.navigateToParent,c=(0,m.IT)(t,"ids"),u=(0,s.iC)(t,{onSuccess:a}),d=(0,s.tE)(t,"untouchable"),v=(0,f.Z)(),h=(0,o.Z)(v,4),b=h[0],y=h[2],w=h[3],E=1===c.length&&!d?{"data-ga":"".concat(p,"-last-member"),"data-testid":"".concat(g,"LastMember"),message:i.createElement(i.Fragment,null,"If you leave, ",i.createElement("strong",null,n)," room will be deleted immediately.",i.createElement("br",null),"Are you sure you want to continue?"),title:"Leave and delete ".concat(n," room")}:{"data-ga":p,"data-testid":g,message:i.createElement(i.Fragment,null,"You are about to leave ",i.createElement("strong",null,n)," room.",i.createElement("br",null),"Are you sure you want to continue?"),title:"Leave ".concat(n," room")};return i.createElement(i.Fragment,null,i.createElement(l.Button,{"data-ga":"manage-war-room-tab::click-leave-war-room::manage-war-room-modal","data-testid":"manageWarRoom-leave",icon:"switch_off",flavour:"borderless",label:"Leave room",neutral:!0,padding:[0],width:"fit-content",onClick:y}),b&&i.createElement(l.ConfirmationDialog,(0,r.Z)({confirmLabel:"Yes, leave",handleConfirm:u,handleDecline:w},E)))},h=n(7724),b=n(30688),y=["charsIndicator","isDisabled","isValid","handleChange","setIsValid","setValidationMessage","validationMessage","value"],w=(0,b.A)([function(e){var t=e.length>=1;return(0,b.f)(t,"Give your room a name that's at least one character.")},function(e){var t=e.length<=20;return(0,b.f)(t,"A room's name can't exceed 20 characters.")}]),E=function(e){var t=e.charsIndicator,n=e.isDisabled,c=e.isValid,u=e.handleChange,s=e.setIsValid,d=e.setValidationMessage,m=e.validationMessage,f=e.value,p=(0,a.Z)(e,y),g=(0,l.useTouchedState)({}),v=(0,o.Z)(g,2),h=v[0],b=v[1];return(0,i.useEffect)((function(){var e=w(f),t=e.isValid,n=e.messages&&e.messages.length?e.messages[0]:void 0;!c&&t?s(!0):c&&!t&&s(!1),n&&d(n)}),[c,s,f,h,d]),i.createElement(l.TextInput,(0,r.Z)({"data-testid":"warRoomOptions-warRoomNameInput",label:"Room name",name:"createRoom",placeholder:"Enter your room's name",hint:"Tip: Use rooms to group your Nodes by their service, purpose, or location.",fieldIndicator:t,value:f,touched:h,onBlur:b,onChange:u,success:c,error:!c&&m,instantFeedback:"all",disabled:n,autoFocus:!0},p))},C=n(63346),x=["id","navigateToParent","isCreateForm","roomName","setRoomName","roomDescription","setRoomDescription","charsDescIndicator","onSaveClick"],O=new RegExp(/^[\w\s\d]*?$/),k=function(e){var t=e.id,n=e.navigateToParent,m=e.isCreateForm,f=e.roomName,p=e.setRoomName,g=e.roomDescription,b=e.setRoomDescription,y=e.charsDescIndicator,w=e.onSaveClick,k=(0,a.Z)(e,x),Z=(0,s.tE)(t),S=(0,u.J7)(),P=(0,i.useState)(!1),I=(0,o.Z)(P,2),j=I[0],D=I[1],N=(0,i.useState)(""),T=(0,o.Z)(N,2),F=T[0],M=T[1],_=(0,i.useState)(""),L=(0,o.Z)(_,2),A=L[0],B=L[1],R=(0,l.useInputValue)({maxChars:c.v$}),V=(0,o.Z)(R,1)[0],U=(0,i.useCallback)((function(e){return p(e.target.value)}),[p]),z=!!t,H=((0,d.gI)("room:LeaveAllNodes")||!Z.untouchable)&&S.length>1&&Z.isMember,W=(0,l.useTouchedState)({defaultState:!0}),G=(0,o.Z)(W,2),K=G[0],J=G[1],Y=!Z.name||f===Z.name&&g===Z.description;return(0,i.useEffect)((function(){B(O.test(g)&&K?"":"The description can only contain digits, letters, and spaces.")}),[K,g]),i.createElement(C.ZP,{tab:"Room::RoomForm"},i.createElement(l.Flex,(0,r.Z)({column:!0,"data-testid":"manageWarRoom",flex:"grow",justifyContent:"between",height:"100%",gap:3},k),i.createElement(l.Flex,{column:!0,"data-testid":"manageWarRoom-settings",gap:2},i.createElement(E,{"data-testid":"manageWarRoom-createRoomInput",value:f,handleChange:U,charsIndicator:V,validationMessage:F,setValidationMessage:M,isValid:j,setIsValid:D,isDisabled:z&&Z.untouchable}),i.createElement(l.TextInput,{"data-testid":"manageWarRoom-descriptionInput",label:"Description",name:"roomDescription",placeholder:"A room description...",instantFeedback:"positiveFirst",touched:K,onBlur:J,fieldIndicator:y,error:""!==A&&A,success:""===A,value:g,onChange:b})),i.createElement(l.Flex,{"data-testid":"manageWarRoom-actions"},i.createElement(l.Flex,{"data-testid":"manageWarRoom-deleteLeaveActions",gap:4},z&&H&&i.createElement(v,{id:t,name:Z.name,navigateToParent:n}),z&&i.createElement(h.ZP,{id:t,name:f,navigateToParent:n})),!m&&i.createElement(l.Button,{"data-ga":"manage-war-room-tab::click-save::manage-war-room-modal","data-testid":"manageRoom-saveButton",label:"Save",onClick:w,disabled:Y,margin:[0,0,0,"auto"]}))))}},46322:function(e,t,n){n.d(t,{C:function(){return c},k:function(){return l}});var r=n(4942),o=(n(85827),n(41539),n(25387),n(2490),n(72608),n(92222),n(47941),n(82526),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(46189)),a=n(88866);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var l=function(e){var t=e.data,n=e.untouchable,r=e.currentUserId,o=e.canRemoveUser;return t.reduce((function(e,t){var a=r===(null===t||void 0===t?void 0:t.id);return e.push({name:t.name,email:t.email,user:{avatarURL:t.avatarURL,name:t.name,email:t.email,id:t.id},type:t.role,disabled:!o||a||n}),e}),[])},c=function(e){return e.reduce((function(e,t){var n;return e.push(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({name:t.name||"",os:t.os.id||"",node:{id:t.id,name:t.name||"",os:t.os?"".concat(o.Z.assetsBaseURL,"/img/logos/os/").concat((null===(n=a.V[t.os.id])||void 0===n?void 0:n.logoFilename)||"placeholder.svg"):"".concat(o.Z.assetsBaseURL,"/img/logos/os/placeholder.svg")}},t)),e}),[])}},20031:function(e,t,n){var r=n(87462),o=n(67294),a=n(93416),i=n(82351);t.Z=function(e){return o.createElement(i.Z,{content:"Room you're a member of. You're able to receive notifications related to nodes in this room"},o.createElement(a.Icon,(0,r.Z)({name:"checkmark",width:"12px",height:"12px","data-testid":"svg"},e)))}},41379:function(e,t,n){n.d(t,{A:function(){return g}});var r=n(29439),o=(n(92222),n(67294)),a=n(50308),i=n.n(a),l=n(92432),c=n(78710),u=n(68035),s=n(97945),d=n(48854),m=n(33335),f=n(25819),p=n(96929),g=c.ZP?function(e){var t=e.id;return"rooms.".concat(t,".nodes")}:function(e){var t=e.id,n=e.spaceId;return"spaces.".concat(n,".rooms.").concat(t,".nodes")};t.Z=function(e){var t=e.id,n=e.spaceId,a=e.pollingInterval,c=void 0===a?63e3:a,v=e.polling,h=void 0===v||v,b=e.keepPolling,y=e.onNodeIdsChange,w=void 0===y?i():y,E=(0,p.X7)(t,"ids"),C=(0,o.useState)((function(){return(null===E||void 0===E?void 0:E.length)||0})),x=(0,r.Z)(C,2),O=x[0],k=x[1],Z=(0,p.X7)(t,"loaded"),S=(0,m.gI)("room:Read");(0,o.useEffect)((function(){Z&&w({nodeIds:E})}),[E,Z]),(0,o.useEffect)((function(){Z&&O!==E.length&&((0,l.L)("node-count","node-count-changed-from-".concat(O,"-to-").concat(E.length),"","","","node-count-change"),k(E.length))}),[E.length,O,Z]),(0,u.Z)((function(){return{key:g({id:t,spaceId:n}),autorun:!!S&&!!n&&!!t,fetch:function(){return(0,f.Fz)({roomId:t,spaceId:n})},polling:h,association:{getError:function(){return(0,p.kY)({id:t,key:"error"})},getIds:function(){return(0,p.kY)({id:t,key:"ids"})},getLoaded:function(){return(0,p.kY)({id:t,key:"loaded"})},getUpdatedAt:function(){return(0,p.kY)({id:t,key:"updatedAt"})}},sort:function(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"accent",ignorePunctuation:!0})},getResource:function(e){return(0,s.zP)({id:e})},getResourcesInitializer:function(){return s.Jz},getResourceInitialState:d.G,pollingOptions:{pollingInterval:c},maxCacheAge:900,force:!0,keepPolling:b}}),[n,t,c])}},45781:function(e,t,n){n.d(t,{e:function(){return m},M:function(){return f}});var r=n(4942),o=(n(66992),n(41539),n(33948),n(47941),n(82526),n(57327),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(4480)),a=n(18446),i=n.n(a),l=n(74059),c={loaded:!1,entries:[],error:null,updatedAt:""},u=(0,o.xu)({key:"spaceAlerts",default:c});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.Z)(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}var m=(0,o.CG)({key:"spaceAlertState",get:function(e){var t=e.id,n=e.key;return function(e){return(0,e.get)(u(t))[n]}},set:function(e){var t=e.id,n=e.key;return function(e,r){var o=e.set;o(u(t),"error"!==n?function(e){return{loaded:!0,entries:i()(r,e.entries)?e.entries:r,updatedAt:(new Date).toISOString()}}:d(d({},c),{},{error:r}))}}}),f=function(e){return function(e,t){return(0,o.sJ)(m({id:e,key:t}))}((0,l.th)(),e)}},33582:function(e,t,n){n.d(t,{Z:function(){return f}});var r=n(15861),o=n(64687),a=n.n(o),i=n(67294),l=n(4480),c=n(33335),u=n(26398),s=function(e){return u.Z.post("/api/v1/spaces/".concat(e,"/tokens"),void 0,{allow401:!0})},d=(0,l.xu)({key:"spaceClaimingTokens",default:[]}),m=(0,l.CG)({key:"claimingTokensState",get:function(e){return function(t){return(0,t.get)(d(e))}},set:function(e){return function(t,n){(0,t.set)(d(e),[n])}}}),f=function(e){var t=(0,l.sJ)(m(e)),n=(0,c.gI)("node:Create",e),o=(0,l._8)((function(e){var t=e.snapshot,n=e.set;return function(){var e=(0,r.Z)(a().mark((function e(r){var o,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getPromise(m(r));case 2:if(e.sent.length){e.next=9;break}return e.next=6,s(r);case 6:o=e.sent,i=o.data,n(m(r),i);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}),[]);return(0,i.useEffect)((function(){n&&e&&o(e)}),[n,e]),t}},80413:function(e,t,n){var r=n(67294),o=n(89250),a=n(99826);t.Z=function(){var e=(0,o.s0)(),t=(0,a.Z)("business").url;return(0,r.useCallback)((function(){e(t,{replace:!0})}),[t])}},38314:function(e,t,n){n.d(t,{$s:function(){return c},BT:function(){return o},G2:function(){return g},GA:function(){return l},Gj:function(){return p},J3:function(){return i},NU:function(){return s},WT:function(){return d},c1:function(){return a},rQ:function(){return u}});var r=n(29439),o=(n(26699),n(57327),n(41539),n(88449),n(2490),n(59849),n(85827),n(25387),n(72608),n(69720),n(47941),function(e){return["free","earlyBird"].includes(e)}),a=function(e,t){return e.amountPerNode?e.amountPerNode/12:t.amountPerNode},i=function(e){var t=e.amountFlat||0;if(e.monthlyDiscountPercentagePerNode&&e.amountFlat){var n=e.amountFlat/12;t=f(n,e.monthlyDiscountPercentagePerNode)}return t},l=function(e){if(!e)return null;var t=e.city,n=e.country,r=e.line_1,o=e.line_2,a=e.postalCode,i=e.state;return[[r,o].filter(Boolean).join(" "),t,a,i,n].filter(Boolean).join(", ")},c=function(e){var t=e.currentPlan,n=e.slug,r=e.version,a=e.onTrial,i=t.slug,l=t.version,c=t.interval;return i===n&&l===r?o(n)?"Current plan":a?"Upgrade":"year"===c?"Update plan options":"Change billing frequency":o(i)&&!o(n)||"pro"===i&&"business"===n?"Upgrade":"Select"},u=function(e,t){return o(t)?"hollow":"business"===t||"pro"===t&&o(e)?"default":"hollow"},s=function(){var e=m.apply(void 0,arguments);return e<0?0:e},d=function(e,t,n,r,o){if(!r)return r;var a=m(o,e,t,n);return r-a<0?r:a},m=function(e,t,n,r,o){return((t||0)-e)*(n||0)+(r||0)-(o||0)},f=function(e,t){return e*(1/(1-t))},p=function(e){var t=e.currentPlan,n=e.plans;return Object.entries(n).reduce((function(e,n){var o=(0,r.Z)(n,2),a=o[0],i=o[1];return"pro"==a&&"pro"!=(null===t||void 0===t?void 0:t.slug)||"earlyBird"==a||"free"==a?e:e+Object.keys(i).length}),0)+2},g=function(e,t){var n=e.split("."),r=new Date(n[0],n[1]-1),o=t.split(".");return new Date(o[0],o[1]-1)-r}},36065:function(e,t,n){n.d(t,{Z:function(){return b}});var r=n(29439),o=n(67294),a=n(93416),i=n(83732),l=n(62200),c=n(16645),u=n(7693),s=n(92903),d=(n(24603),n(74916),n(88386),n(39714),n(77601),n(46585)),m=n(30688),f=new RegExp(/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]|[!@#$%^&*()_+=\-])/),p=(0,m.A)([function(e){var t=e.length>=d.Pf;return(0,m.f)(t,"Please enter a name for the Space that is at least 5 characters.")},function(e){var t=e.length<=d.Qy;return(0,m.f)(t,"A Space's name can't exceed 20 characters.")},function(e){return f.test(e)?{isValid:!1,message:"There's an unexpected character in the Space's name. Use only alphanumberic characters (A-Z, a-z, 0-9) and spaces."}:{isValid:!0}}]),g=function(e){var t=e.value,n=e.isValid,i=e.setIsValid,l=e.charsIndicator,c=e.isDirty,u=e.handleChange,s=e.validationMessage,d=e.setValidationMessage,m=e.onKeyDown,f=(0,a.useTouchedState)({}),g=(0,r.Z)(f,2),v=g[0],h=g[1];return(0,o.useEffect)((function(){var e=p(t),r=e.isValid,o=e.messages&&e.messages.length?e.messages[0]:void 0;!n&&r?i(!0):n&&!r&&i(!1),o&&d(o)}),[n,t,v,i,d]),o.createElement(a.TextInput,{label:"Space name",name:"createWorkspace",placeholder:"Enter your Space's name",hint:"Give your Space a name that's between 5-20 characters. This cannot change.",fieldIndicator:l,value:t,touched:v,onBlur:h,onChange:u,success:n,error:!n&&s,instantFeedback:"positiveFirst",isDirty:c,onKeyDown:m})},v=n(54005),h=n(63346),b=function(e){var t=e.onClose,n=e.onDone,m=(0,o.useState)(!1),f=(0,r.Z)(m,2),p=f[0],b=f[1],y=(0,o.useState)(!1),w=(0,r.Z)(y,2),E=w[0],C=w[1],x=(0,a.useInputValue)({maxChars:d.Qy}),O=(0,r.Z)(x,4),k=O[0],Z=O[1],S=O[2],P=O[3],I=(0,o.useState)(""),j=(0,r.Z)(I,2),D=j[0],N=j[1],T=(0,v.Z)(),F=T.sendLog,M=T.isReady,_=(0,o.useCallback)((function(e){C(!1),t(),null===n||void 0===n||n(e),F({feature:"CreateSpace",isSuccess:!0})}),[t,F,M]),L=(0,o.useCallback)((function(){C(!1),F({feature:"CreateSpace",isFailure:!0})}),[F,M]),A=(0,i.Z)({onSuccess:_,onError:L}),B=(0,o.useCallback)((function(){p&&(C(!0),A({name:k}))}),[k,p]);return o.createElement(c.u6,{onClose:t},o.createElement(h.ZP,{feature:"CreateSpace"},o.createElement(u.x,{onClose:t,title:"Create Space"},o.createElement(a.Button,{disabled:!p,isLoading:E,loadingLabel:"Creating",label:"Save",onClick:B})),o.createElement(s.B,null,"Create a new Space"),o.createElement(c.TZ,null,o.createElement(g,{isDirty:P,isValid:p,setIsValid:b,value:k,handleChange:Z,charsIndicator:S,validationMessage:D,setValidationMessage:N,onKeyDown:function(e){e.keyCode===l.DV&&p&&B()}}))))}},2509:function(e,t,n){n.d(t,{Q$:function(){return s},Sr:function(){return v},bK:function(){return u},dH:function(){return f},eq:function(){return i},fM:function(){return d},fV:function(){return p},m3:function(){return a},xN:function(){return h},z2:function(){return g}});var r,o=n(4942),a="info",i="rooms",l="nodes",c="users",u="notifications",s="integrations",d="billing",m="integrations",f=[a,i,l,c,u,d,m],p=(r={},(0,o.Z)(r,a,"Info"),(0,o.Z)(r,i,"Rooms"),(0,o.Z)(r,l,"Nodes"),(0,o.Z)(r,c,"Users"),(0,o.Z)(r,u,"Alerts & Notifications"),(0,o.Z)(r,s,"Services"),(0,o.Z)(r,d,"Plan & Billing"),(0,o.Z)(r,m,"Integrations"),r),g=f[0],v="/spaces/:spaceSlug/settings/:settingsTab/*",h="/spaces/:spaceSlug/settings/:settingsTab/:settingsSubTab/*"},72671:function(e,t,n){n.d(t,{F:function(){return C}});var r=n(87462),o=n(29439),a=n(45987),i=(n(92222),n(26699),n(41539),n(88674),n(17727),n(67294)),l=n(89250),c=n(93416),u=n(97346),s=n(91008),d=n(82351),m=n(53606),f=n(46585),p=n(13477),g=n(46667),v=n(36285),h=n(39979),b=n(54005),y=["currentPlan"],w=["id","isLastSpace","name","onClose"],E=(0,h.Z)(c.Button),C=function(e){return function(t){var n=t.currentPlan,r=(0,a.Z)(t,y),o=n.class,l=n.interval,u=n.billingEmail,d="year"===l?"yearly":"monthy",m="".concat(o," ").concat(d),f=!["Community","EarlyBird"].includes(o),p=!!u&&!f;return i.createElement(e,r,f&&i.createElement(i.Fragment,null,i.createElement(c.Text,null,"You are currently on ",i.createElement(c.Text,{strong:!0},m)," subscription, which will be cancelled automatically and any due credit from unused period will be given to your credit balance."),i.createElement(c.Text,null,"Any available credit with us won't be automatically lost. If you want to use it in the future, within the defined period on our"," ",i.createElement(s.Z,{href:"https://www.netdata.cloud/service-terms/",rel:"noopener noreferrer",target:"_blank"},"Terms of Service"),", or have any requests about previous invoices you can reach out to"," ",i.createElement(c.Text,{strong:!0},"support@netdata.cloud"))),p&&i.createElement(c.Text,null,"You will lose direct access to you invoices and billing information. If you want to retrieve this information in the future, you'll have to contact"," ",i.createElement(c.Text,{strong:!0},"support@netdata.cloud")))}},x=C((function(e){var t=e.spaceName,n=e.children;return i.createElement(c.Flex,{column:!0,gap:2},i.createElement(c.Text,null,"You are about to delete ",i.createElement("strong",null,t)," space."),n,i.createElement(c.Text,null,"Are you sure you want to continue?"))}));t.Z=function(e){var t=e.id,n=e.isLastSpace,s=e.name,h=e.onClose,y=(0,a.Z)(e,w),C=(0,l.s0)(),O=(0,m.Z)(t),k=(0,p.jr)(),Z=(0,v.RP)().value,S=(0,g.Z)(),P=(0,o.Z)(S,4),I=P[0],j=P[2],D=P[3],N=(0,g.Z)(),T=(0,o.Z)(N,2),F=T[0],M=T[1],_=(0,b.Z)(),L=_.sendLog,A=_.sendButtonClickedLog,B=_.isReady,R=(0,i.useCallback)((function(e){h(),L({feature:"DeleteSpace",isSuccess:!0}).finally((function(){return C("/spaces/".concat(e))}))}),[L,B]),V=(0,i.useCallback)((function(){M(),O({onSuccess:R}),A({feature:"DeleteSpace",label:"Confirm Delete"})}),[A,B]),U=(0,i.useCallback)((function(){D(),L({feature:"DeleteSpace",isFailure:!0,eventReason:"User canceled"})}),[L,B]);return k&&i.createElement(u.Z,{permission:"space:Delete"},i.createElement(d.Z,{align:"top",content:n&&f.T$.delete,isBasic:!0,stretch:"align"},i.createElement(c.Box,null,i.createElement(E,(0,r.Z)({danger:!0,"data-ga":"manage-space-tab::click-delete-space::manage-space-modal","data-testid":"deleteSpace-button",disabled:n,flavour:"hollow",label:"DELETE SPACE",onClick:j,isStart:!0,feature:"DeleteSpace"},y)))),I&&i.createElement(c.ConfirmationDialog,{confirmLabel:F?"Deleting...":"Yes, delete","data-ga":"delete-space","data-testid":"deleteSpaceDialog",handleConfirm:V,handleDecline:U,message:i.createElement(x,{spaceName:s,currentPlan:Z}),title:"Delete ".concat(s," space"),isConfirmDisabled:F,isConfirmLoading:F,isDeclineDisabled:F}))}},54131:function(e,t,n){n.d(t,{Qj:function(){return o},uB:function(){return i},x3:function(){return a}});n(74916),n(77601);var r=/^[a-zA-Z0-9@_.-\s!]*$/,o={minLength:"Space name should be more than 4 characters",allowedChars:"Please use alphanumberic characters (A-Z, a-z, 0-9), spaces, periods and supported special characters @, -, _,."},a=function(e){return e.length<5?"minLength":!r.test(e)&&"allowedChars"},i=function(e){return!r.test(e)&&"allowedChars"}},73398:function(e,t,n){n.d(t,{Z:function(){return C}});var r=n(87462),o=n(45987),a=(n(92222),n(67294)),i=n(93416),l=n(45781),c=(n(69826),n(41539),n(31672),n(2490),n(59461),n(4480)),u=n(74059),s={alertCounter:{warning:0,critical:0},unreachableCount:0},d=(0,c.CG)({key:"roomAlertSummaryState",get:function(e){var t=e.id,n=e.key;return function(e){var r=e.get,o=r(u.BN),a=r((0,l.e)({id:o,key:"entries"})).find((function(e){return e.id===t}))||s;return n?a[n]:a}}}),m=n(37518),f=n(67622),p=n(82351),g=n(71893),v=(0,g.default)(i.Flex).attrs({flex:{grow:0,shrink:0},width:2,height:2,margin:[0,1,0,0],round:1,background:"error",justifyContent:"center",alignItems:"center"}).withConfig({displayName:"indicators__ErrorIndicator",componentId:"sc-19hg3ay-0"})([""]),h=(0,g.default)(v).attrs({background:"warning"}).withConfig({displayName:"indicators__WarningIndicator",componentId:"sc-19hg3ay-1"})([""]),b=(0,g.default)(v).attrs({background:"textLite"}).withConfig({displayName:"indicators__UnreachableIndicator",componentId:"sc-19hg3ay-2"})([""]),y=n(81488),w=n(20031),E=["id","selectedId","spaceSlug","isSidebar","hideAlerts","differentiateIsMember"],C=function(e){var t=e.id,n=e.selectedId,u=e.spaceSlug,s=e.isSidebar,g=e.hideAlerts,C=e.differentiateIsMember,x=(0,o.Z)(e,E),O=function(e,t){return(0,c.sJ)(d({id:e,key:t}))}(t),k=O.alertCounter,Z=k.critical,S=k.warning,P=O.unreachableCount,I=(0,m.tE)(t,"slug"),j=(0,m.tE)(t,"name"),D=(0,m.tE)(t,"isMember"),N=(0,l.M)("error"),T=(0,l.M)("updatedAt");return a.createElement(f.Z,(0,r.Z)({},!!u&&{to:"/spaces/".concat(u,"/rooms/").concat(I)},{testid:"roomLabel-warRoom-".concat(j),actions:g?null:a.createElement(p.Z,{content:a.createElement(y.Z,{error:N,text:"Room alerts",updatedAt:T}),isBasic:!0,align:"right"},a.createElement(i.Flex,{flex:!1,flexWrap:!1,justifyContent:"end",width:{min:6},height:{min:2}},Z>0&&a.createElement(v,null),S>0&&a.createElement(h,null),P>0&&a.createElement(b,null))),icon:C&&D&&a.createElement(w.Z,null),iconColor:"successLite",iconHeight:"12px",iconWidth:"12px",gap:1,textProps:C&&!D&&{padding:[0,0,0,4]},selected:t===n,isSidebar:s,isSecondary:!D},x),j)}},22613:function(e,t,n){var r=n(87462),o=n(45987),a=n(67294),i=n(93416),l=n(55917),c=["onFilterClick","showAllRooms"];t.Z=function(e){var t=e.onFilterClick,n=e.showAllRooms,u=(0,o.Z)(e,c);return a.createElement(i.Flex,(0,r.Z)({gap:2,padding:[1,2],"data-testid":"roomFilterPills"},u),a.createElement(l.S,{flavour:n?"hollow":"default",onClick:t(!1),label:"My Rooms","data-ga":"roomFilterPills::click-my::global-view","data-testid":"roomFilterPills-showMy"}),a.createElement(l.S,{flavour:n?"default":"hollow",onClick:t(!0),label:"All Rooms","data-ga":"roomFilterPills::click-show-all::global-view","data-testid":"roomFilterPills-showAll"}))}},59636:function(e,t,n){var r=n(87462),o=n(29439),a=n(45987),i=(n(57327),n(41539),n(88449),n(2490),n(59849),n(21249),n(57640),n(9924),n(67294)),l=n(65565),c=n(93416),u=n(95383),s=n(74059),d=n(37518),m=n(33335),f=n(73398),p=n(22613),g=["isSidebar"];t.Z=function(e){var t=e.isSidebar,n=(0,a.Z)(e,g),v=(0,u.J7)(),h=(0,i.useState)(!1),b=(0,o.Z)(h,2),y=b[0],w=b[1],E=(0,s.th)(),C=(0,s.uk)();(0,l.Z)((function(){w(!1)}),[E]);var x=(0,m.gI)("room:ReadAll"),O=(0,i.useMemo)((function(){return v.filter((function(e){return e.isMember}))}),[v]),k=x&&O.length>0,Z=k&&!y?O:v,S=(0,d.UL)();return i.createElement(i.Fragment,null,k&&i.createElement(p.Z,{onFilterClick:function(e){return function(t){t.stopPropagation(),w(e)}},showAllRooms:y}),Z.map((function(e,o){var a=e.id,l=e.untouchable;return i.createElement(i.Fragment,{key:a},i.createElement(f.Z,(0,r.Z)({id:a,hideAlerts:!t,Wrapper:c.Text,isSidebar:t,differentiateIsMember:y,spaceSlug:C,selectedId:S},n)),l&&o!==Z.length-1&&i.createElement(c.Flex,{border:{side:"top",color:"border"},margin:[1.5,0],"data-testid":"roomLabel-warRoomSeparator"}))})))}},55917:function(e,t,n){n.d(t,{S:function(){return i},x:function(){return a}});var r=n(71893),o=n(93416),a=(0,r.default)(o.Icon).withConfig({displayName:"styled__StyledIcon",componentId:"sc-i0gfkp-0"})(["transform:",";"],(function(e){return e.right?"rotate(0)":"rotate(180deg)"})),i=(0,r.default)(o.Button).withConfig({displayName:"styled__StyledButton",componentId:"sc-i0gfkp-1"})(["&&{padding:2px 16px;font-size:12px;height:auto;width:auto;min-width:96px;}"])},77872:function(e,t,n){var r=n(87462),o=n(4942),a=n(45987),i=n(29439),l=(n(92222),n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(67294)),c=n(71893),u=n(89250),s=n(93416),d=n(82351),m=n(74059),f=["active","background","showFullname"],p=["active","spaceId","testIdPrefix","local","onClick","showFullname","color"];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}var v,h=[],b=(0,c.default)(s.Flex).attrs((function(e){var t=e.active,n=(e.background,e.showFullname);return function(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,o.Z)(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}({width:n?"auto":7,height:7,background:t?"spaceSelected":"spaceIdle",justifyContent:"center",alignItems:"center",round:.5,padding:n?[0,1]:[0],margin:n?[0,0,1]:[0]},(0,a.Z)(e,f))})).withConfig({displayName:"spaceLabel__SpaceBox",componentId:"sc-1e67mnq-0"})(["cursor:pointer;&:hover{background:",";}"],(function(e){return e.active?(0,s.getColor)("spaceSelected"):(0,s.getColor)("spaceHovered")}));t.Z=(v=function(e){var t=e.active,n=e.spaceId,o=e.testIdPrefix,c=e.local,d=void 0!==c&&c,f=e.onClick,g=e.showFullname,v=e.color,y=(0,a.Z)(e,p),w=(0,u.s0)(),E=(0,m.vu)(n),C=function(e){if(!e)return h;var t=e.split(" "),n=(0,i.Z)(t,2),r=n[0],o=n[1];return[r[0],o?o[0]:""]}(E.name),x=(0,i.Z)(C,2),O=x[0],k=x[1],Z=(0,l.useCallback)((function(){return f?f(E):w(d?"/overview":"/spaces/".concat(E.slug))}),[E.slug,d,f]);return l.createElement(b,(0,r.Z)({active:t,"data-testid":"".concat(o||"spaceLabel-space","-").concat(E.slug),onClick:Z},y,{showFullname:g}),d?l.createElement(s.Icon,{name:"node",color:t?"textFocus":"textLite"}):g?l.createElement(s.TextSmall,{strong:!0,color:t?"textFocus":v||"textNoFocus"},E.name):l.createElement(l.Fragment,null,l.createElement(s.TextSmall,{strong:!0,color:t?"key":v||"text"},O),l.createElement(s.TextSmall,{strong:!0,color:t?"textLite":v||"textNoFocus"},k)))},function(e){var t=(0,m.vu)(e.spaceId);return e.showFullname?l.createElement(v,e):l.createElement(d.Z,{content:null===t||void 0===t?void 0:t.name,align:"right",isBasic:!0},l.createElement(s.Box,null,l.createElement(v,e)))})},94666:function(e,t,n){n.d(t,{zm:function(){return f},ZN:function(){return p},WA:function(){return m},J9:function(){return g},Wy:function(){return b},nP:function(){return C},H4:function(){return v},kf:function(){return h},Qk:function(){return w}});n(47941),n(82526),n(38880),n(49337),n(33321),n(69070);var r=n(4942),o=(n(41539),n(15581),n(2490),n(34514),n(54747),n(26833),n(21249),n(57640),n(9924),n(57327),n(88449),n(59849),n(4480)),a=n(34912),i=n(13477),l=n(74059),c={ids:(0,o.xu)({key:"spaceMemberIds",default:[]}),updatedAt:(0,o.xu)({key:"spaceMembersUpdatedAt",default:""}),loaded:(0,o.xu)({key:"spaceMembersLoaded",default:!1})},u=(0,o.xu)({key:"spaceMemberRole",default:""});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.Z)(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}var m=(0,o.CG)({key:"spaceMemberState",get:function(e){var t=e.id,n=e.key;return function(e){return(0,e.get)(c[n](t))}},set:function(e){var t=e.id,n=e.key;return function(e,r){(0,e.set)(c[n](t),r)}}}),f=function(e,t){Object.values(c).forEach((function(n){return e(n(t))}))},p=(0,o.CG)({key:"spaceMemberRoleState",get:function(e){var t=e.id,n=e.spaceId;return function(e){return(0,e.get)(u({id:t,spaceId:n}))}},set:function(e){var t=e.id,n=e.spaceId;return function(e,r){(0,e.set)(u({id:t,spaceId:n}),r)}}}),g=(0,o.CG)({key:"spaceMembersRoleState",set:function(e){return function(t,n){var r=t.set;n.forEach((function(t){var n=t.id,o=t.role;r(p({id:n,spaceId:e}),o)}))}},get:function(e){var t=e.ids,n=e.spaceId;return function(e){var r=e.get;return t.map((function(e){return r(p({id:e,spaceId:n}))}))}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),v=function(){var e,t,n=(0,l.th)();return e=n,t="ids",(0,o.sJ)(m({id:e,key:t}))},h=function(e){var t=(0,l.th)();return(0,o.sJ)(g({ids:e,spaceId:t}))},b=function(){return"admin"===function(e){var t=(0,l.th)();return(0,o.sJ)(p({id:e,spaceId:t}))}((0,i.Iy)("id"))},y=(0,o.CG)({key:"currentSpaceMembersState",get:function(e){var t=e.ids,n=e.spaceId;return function(e){var r=e.get;return t.map((function(e){var t=r((0,a.mX)({id:e})),o=r(p({id:e,spaceId:n}));return d(d({},t),{},{role:o})}))}},cachePolicy_UNSTABLE:{eviction:"most-recent"}}),w=function(){var e=(0,l.th)(),t=v();return(0,o.sJ)(y({ids:t,spaceId:e}))},E=(0,o.CG)({key:"spaceAdminsState",get:function(e){var t=e.memberIds,n=e.spaceId;return function(e){return(0,e.get)(y({ids:t,spaceId:n})).filter((function(e){return"admin"===e.role}))}}}),C=function(){var e=(0,l.th)(),t=v();return(0,o.sJ)(E({memberIds:t,spaceId:e}))}},83732:function(e,t,n){var r=n(93433),o=n(15861),a=n(64687),i=n.n(a),l=(n(66992),n(41539),n(70189),n(78783),n(88921),n(96248),n(13599),n(11477),n(64362),n(15389),n(90401),n(45164),n(91238),n(54837),n(87485),n(56767),n(76651),n(61437),n(35285),n(39865),n(33948),n(92222),n(4480)),c=n(30266),u=n(74059),s=n(58502);t.Z=function(e){var t=e.onSuccess,n=e.onError,a=e.isDefault,d=void 0!==a&&a;return(0,l._8)((function(e){var a=e.set;return function(){var e=(0,o.Z)(i().mark((function e(o){var l,m,f,p,g,v,h,b;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=o.name,m=o.userId,f=o.email,e.prev=1,!d){e.next=8;break}return e.next=5,(0,c.A6)(m,f);case 5:e.t0=e.sent,e.next=11;break;case 8:return e.next=10,(0,c.wh)(l);case 10:e.t0=e.sent;case 11:p=e.t0,g=p.data,v=g.id,h=g.slug,b=g.name,a((0,s.ZP)(v),{id:v,slug:h,name:d?b:l,loaded:!0}),a((0,s.bo)(h),v),a((0,u.st)("ids"),(function(e){return e=(0,r.Z)(new Set([].concat((0,r.Z)(e),[v])))})),a((0,u.st)("loaded"),!0),t&&t(g),e.next=24;break;case 21:e.prev=21,e.t1=e.catch(1),n&&n();case 24:case"end":return e.stop()}}),e,null,[[1,21]])})));return function(t){return e.apply(this,arguments)}}()}),[t,n])}},53606:function(e,t,n){var r=n(15861),o=n(29439),a=n(64687),i=n.n(a),l=(n(57327),n(41539),n(88449),n(2490),n(59849),n(4480)),c=n(93017),u=n(30266),s=n(46585),d=n(74059),m=n(58502),f=n(57079),p=n(94666),g=n(95383);t.Z=function(e){var t=(0,c.Z)(),n=(0,o.Z)(t,2)[1];return(0,l._8)((function(t){var a=t.snapshot,l=t.set,c=t.reset;return function(){var t=(0,r.Z)(i().mark((function t(r){var v,h,b,y,w,E,C,x;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v=r.onSuccess,h=r.onError,t.next=3,a.getPromise((0,d.st)("ids"));case 3:if(b=t.sent,y=b.filter((function(t){return e!==t})),w=(0,o.Z)(y,1),E=w[0]){t.next=9;break}return n({header:"Spaces",text:s.T$.delete}),t.abrupt("return");case 9:if(t.t0=E,!t.t0){t.next=14;break}return t.next=13,a.getPromise((0,m.ZP)(E));case 13:t.t0=t.sent;case 14:return C=t.t0,x=C.slug,l((0,d.st)("ids"),y),l(f.Z,(function(t){return t.filter((function(t){return t!==e}))})),t.prev=18,t.next=21,(0,u.Ns)(e);case 21:v&&v(x),(0,p.zm)(c,e),(0,g.r1)(c,e),c((0,m.ZP)(e)),t.next=32;break;case 27:t.prev=27,t.t1=t.catch(18),l((0,d.st)("ids"),b),n(t.t1),h&&h();case 32:case"end":return t.stop()}}),t,null,[[18,27]])})));return function(e){return t.apply(this,arguments)}}()}),[e])}},20428:function(e,t,n){n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var r=n(4942),o=n(15861),a=n(29439),i=n(64687),l=n.n(i),c=n(4480),u=n(74059),s=n(30266),d=n(93017);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(e){var t=(0,d.Z)(),n=(0,a.Z)(t,2),r=n[0],i=n[1];return(0,c._8)((function(t){var n=t.snapshot,a=t.set;return function(){var t=(0,o.Z)(l().mark((function t(o,c){var d,m,p;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d=c.onSuccess,m=c.onFail,t.next=3,n.getPromise((0,u.U7)({id:e}));case 3:return p=t.sent,a((0,u.U7)({id:e}),(function(e){return f(f({},e),o)})),t.prev=5,t.next=8,(0,s.$F)(e,o);case 8:r({header:"Space successfully updated!"}),d&&d(),t.next=17;break;case 12:t.prev=12,t.t0=t.catch(5),a((0,u.U7)({id:e}),p),i(t.t0),m&&m();case 17:case"end":return t.stop()}}),t,null,[[5,12]])})));return function(e,n){return t.apply(this,arguments)}}()}),[e])}},54624:function(e,t,n){var r=n(93433),o=(n(92222),n(67294));t.Z=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=(0,o.useRef)(e);(0,o.useLayoutEffect)((function(){a.current=e}),n),(0,o.useEffect)((function(){var e=setTimeout((function(){return a.current()}),t);return function(){return clearTimeout(e)}}),[t].concat((0,r.Z)(n)))}},58504:function(e,t,n){var r=n(67294);t.Z=function(e,t){var n=(0,r.useRef)(e);(0,r.useLayoutEffect)((function(){n.current=e}),[e]),(0,r.useEffect)((function(){if(t||0===t){var e=setInterval((function(){return n.current()}),t);return function(){return clearInterval(e)}}}),[t])}},65351:function(e,t,n){var r=n(29439),o=n(67294),a=n(4822);t.Z=function(e,t,n,i){var l=(0,a.I0)("modal"),c=(0,r.Z)(l,2),u=c[0],s=c[1],d=(0,a.I0)("modalTab"),m=(0,r.Z)(d,2),f=m[0],p=m[1],g=(0,a.I0)("modalParams"),v=(0,r.Z)(g,2),h=v[0],b=v[1],y=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;"string"===typeof t&&p(t),s(e),n&&b(n)};return(0,o.useEffect)((function(){t&&y(n,i)}),[]),{isModalOpen:e===u,currentModalTab:f,handleChangeModalTab:p,handleOpenModal:y,handleCloseModal:function(){p(""),s(""),b()},params:h}}},55899:function(e,t,n){var r=n(15861),o=n(64687),a=n.n(o),i=n(67294),l=n(7335),c=n(22965),u=n(96929),s=n(74059),d=n(95383),m=n(19368);t.Z=function(){var e=(0,m.P)(),t=(0,d.yE)(),n=(0,s.th)(),o=(0,l.XU)(),f=(0,u.Ww)(n,t);return(0,i.useCallback)(function(){var i=(0,r.Z)(a().mark((function r(i){var l,u,s,d=arguments;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return u=(l=d.length>1&&void 0!==d[1]?d[1]:{}).onSuccess,s=l.onFail,r.next=3,f(i,{onSuccess:function(r){(0,c.jG)({cacheKeyPrefix:e,nodeIds:r,roomIds:t,spaceId:n}),null===u||void 0===u||u()},onFail:s});case 3:return r.next=5,o(i);case 5:case"end":return r.stop()}}),r)})));return function(e){return i.apply(this,arguments)}}(),[f,o])}},93033:function(e,t,n){var r=n(89250),o=n(67294),a=n(12599),i=n(74059),l=n(2509);t.Z=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).roomSlug,t=(0,i.uk)(),n=(0,r.s0)(),c=(0,r.TH)().pathname,u="".concat(c);return(0,o.useCallback)((function(){var r=e?(0,a.Gn)(l.xN,{spaceSlug:t,settingsTab:l.eq,settingsSubTab:e}):"/spaces/".concat(t,"/settings");n(r,{state:{previousUrlPath:u}})}),[u,n,e,t])}},27624:function(e,t,n){var r=n(37518),o=n(96929),a=n(22965),i=n(19368);t.Z=function(e){var t=(0,i.P)(),n=(0,r.UL)(),l=(0,r.tE)(e||n,"spaceId");return(0,o.nI)(l,e||n,{onSuccess:function(r){return(0,a.Br)({cacheKeyPrefix:t,nodeIds:r,roomId:e||n,spaceId:l})}})}},61152:function(e,t,n){var r=n(65351);t.Z=function(e,t){var n=(0,r.Z)(e,t),o=n.isModalOpen,a=n.handleOpenModal,i=n.handleCloseModal;return[o,o?i:a,a,i,n.params]}}}]);
\ No newline at end of file |