summaryrefslogtreecommitdiffstats
path: root/web/gui/v2/8276.cb877f5ee79184a9e0fb.chunk.js
blob: e14e3784fd0605491b6a8e56b96464fa9db458c1 (plain)
1
!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]="48e99b0e-10dd-42e5-9cd5-7a8355cab813",e._sentryDebugIdIdentifier="sentry-dbid-48e99b0e-10dd-42e5-9cd5-7a8355cab813")}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([[8276],{51091:function(e,t,n){"use strict";var a=n(87462),r=n(45987),l=(n(57327),n(41539),n(88449),n(2490),n(59849),n(21249),n(57640),n(9924),n(92222),n(71893)),o=n(10928),i=n.n(o),c=n(67294),s=n(93416),u=["items","isBig","showBackButton","testid"],m=(0,l.default)(s.Box).withConfig({displayName:"breadcrumbs__StyledItemContainer",componentId:"sc-3u39st-0"})([""]),d=(0,l.css)(["&:hover{color:",";}"],(function(e){var t=e.withHover,n=e.theme;return t&&(0,s.getColor)("success")({theme:n})})),p=(0,l.default)(s.Text).withConfig({displayName:"breadcrumbs__StyledText",componentId:"sc-3u39st-1"})(["",""],d),g=(0,l.default)(s.TextSmall).withConfig({displayName:"breadcrumbs__StyledTextSmall",componentId:"sc-3u39st-2"})(["",""],d);t.Z=function(e){var t=e.items,n=e.isBig,l=e.showBackButton,o=void 0===l||l,d=e.testid,f=void 0===d?"":d,b=(0,r.Z)(e,u),h=(0,c.useMemo)((function(){return null!==t&&void 0!==t&&t.length&&o?i()(t.filter((function(e){return!!e.onClick}))).onClick:null}),[t,o]);if(null===t||void 0===t||!t.length)return null;var E=n?p:g;return c.createElement(s.Flex,(0,a.Z)({gap:4},b),o&&c.createElement(s.Button,{onClick:h,icon:"chevron_left",label:"Back",neutral:!0,flavour:"hollow",small:!0,padding:[0,2,0,1],textTransform:"uppercase","data-testid":"".concat(f,"-breadcrumbs-backButton")}),c.createElement(s.Flex,{gap:2,alignItems:"center"},t.map((function(e,t){var n=e.isDisabled,r=e.name,l=e.onClick;return c.createElement(m,(0,a.Z)({key:t,alignItems:"center"},l&&{cursor:"pointer",onClick:l},{"data-testid":"".concat(f,"-breadcrumbs-level-").concat(t)}),c.createElement(E,{color:n&&"textLite","data-testid":"".concat(f,"-breadcrumbs-level-").concat(t),withHover:!!l},0!==t&&" / ",r))}))))}},80959:function(e,t,n){"use strict";var a=n(87462),r=n(45987),l=n(67294),o=n(93416),i=["message","title","footer"];t.Z=function(e){var t=e.message,n=e.title,c=e.footer,s=(0,r.Z)(e,i),u=(null===s||void 0===s?void 0:s["data-testid"])||"functionError";return l.createElement(o.Flex,(0,a.Z)({alignItems:"center",column:!0,"data-testid":u,flex:!0,gap:3,justifyContent:"center",padding:[0,20]},s),l.createElement(o.H3,{"data-testid":"".concat(u,"-title")},n),l.createElement(o.TextBig,{color:"textDescription","data-testid":"".concat(u,"-message")},t),c)}},27308:function(e,t,n){"use strict";var a=n(87462),r=n(67294),l=n(79655),o=n(93416),i=n(91008),c=n(33335),s=n(99826);t.Z=function(e){var t=(0,c.gI)("billing:ReadAll"),n=(0,s.Z)().url;return n?r.createElement(o.Flex,{background:"sideBarMini",border:{side:"all",color:"border"},padding:[1,2],round:!0},r.createElement(i.Z,(0,a.Z)({align:"bottom",as:l.rU,boxProps:{as:o.Flex},color:"text",Component:o.TextMicro,content:"Upgrade your plan in order to use this feature",disabled:!t,hoverColor:"textFocus",showToolTip:!0,strong:!0,to:n},e),"Upgrade now!")):null}},36412:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var a=n(45987),r=n(67294),l=n(87462),o=(n(82526),n(41817),n(93416)),i=n(82351),c=["description","isRequired","title"],s=function(e){var t=e.description,n=e.isRequired,l=e.title,s=(0,a.Z)(e,c),u=s["data-testid"]?"".concat(s["data-testid"],"-label"):"fieldLabel";return r.createElement(o.Flex,{"data-testid":"".concat(u,"-container"),gap:1},r.createElement(o.TextSmall,{color:"textLite","data-testid":u},l,n&&" *"),t&&r.createElement(i.Z,{align:"top",content:t,"data-testid":"".concat(u,"-info"),plain:!0},r.createElement(o.Icon,{color:"textLite",name:"information",size:"small"})))},u=["data-testid","description","isRequired","onChange","title"],m=function(e){var t=e["data-testid"],n=void 0===t?"input":t,i=e.description,c=e.isRequired,m=e.onChange,d=e.title,p=(0,a.Z)(e,u);return r.createElement(o.Flex,{column:!0,"data-testid":n,flex:"grow",gap:1},r.createElement(s,{"data-testid":n,description:i,isRequired:c,title:d}),r.createElement(o.TextInput,(0,l.Z)({"data-testid":"".concat(n,"-field"),size:"tiny",onChange:function(e){var t=e.target;return m(t.value)}},p)))},d=(n(21249),n(57640),n(9924),n(26833),n(92222),["data-testid","description","getDataGa","fields","id","isRequired","onChange","secrets","setSecrets","title"]),p=["getValue","id","onChange"],g=function(e){var t,n=e["data-testid"],i=void 0===n?"select":n,c=e.description,u=e.getDataGa,m=e.fields,g=e.id,f=e.isRequired,b=e.onChange,h=e.secrets,E=e.setSecrets,v=e.title,y=(0,a.Z)(e,d);return r.createElement(o.Flex,{column:!0,"data-testid":i,flex:"grow",gap:1},r.createElement(s,{"data-testid":i,description:c,isRequired:f,title:v}),r.createElement(o.Select,(0,l.Z)({"data-testid":"".concat(i,"-field"),menuPortalTarget:document.body,onChange:function(e){return b(e)},styles:{size:"tiny"},menuPlacement:"auto"},y)),Object.values((null===m||void 0===m?void 0:m[null===(t=y.value)||void 0===t?void 0:t.value])||{}).map((function(e){var t=e.getValue,n=e.id,o=e.onChange,c=(0,a.Z)(e,p);return r.createElement(T,(0,l.Z)({"data-ga":u("".concat(g,"-").concat(n,"-").concat(c.component)),"data-testid":"".concat(i,"-").concat(n),key:n,id:n,onChange:o({id:g,setSecrets:E,subsetId:n}),value:t({id:g,secrets:h,subsetId:n})},c))})))},f=n(4942),b=n(29439),h=(n(85827),n(41539),n(25387),n(2490),n(72608),n(47941),n(69720),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(57557)),E=n.n(h),v=n(73955),y=n.n(v),x=n(31790),w=n(25185);function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function O(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,f.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}var P=["component"],Z={default:function(){return null},pairs:function(e){var t=e.componentPairs,n=e["data-testid"],a=void 0===n?"pairs":n,l=e.description,i=e.getDataGa,c=e.id,u=e.isRequired,m=e.placeholder,d=e.setSecrets,p=e.title,g=(0,r.useState)({}),h=(0,b.Z)(g,2),v=h[0],C=h[1];(0,r.useEffect)((function(){var e=Object.values(v).reduce((function(e,t){var n=t.key,a=t.value;return n?O(O({},e),{},(0,f.Z)({},n,a||"")):e}),{});d((function(t){return Object.keys(e).length?O(O({},t),{},(0,f.Z)({},c,e)):E()(t,c)}))}),[v]);return r.createElement(o.Flex,{column:!0,"data-testid":a,gap:1},r.createElement(o.Flex,{alignItems:"center",justifyContent:"between"},r.createElement(s,{"data-testid":a,description:l,isRequired:u,title:p}),t.map((function(e){var n=(0,x.XM)(e);return r.createElement(w.nO,{"data-ga":i("".concat(c,"-").concat(n,"-add")),"data-testid":"".concat(a,"-").concat(n,"Add"),key:n,label:1===t.length?"Add":"Add ".concat(n),onClick:function(){return function(e){return C((function(t){return O(O({},t),{},(0,f.Z)({},y()("pair_"),{key:"",components:e,value:""}))}))}(e)}})}))),Object.entries(v).map((function(e){var t=(0,b.Z)(e,2),n=t[0],l=t[1],s=l.key,u=l.components,d=l.value,p=(0,b.Z)(u,2),g=p[0],h=p[1],v=(0,x.XM)(u);return r.createElement(o.Flex,{alignItems:"end",key:"".concat(v,"-").concat(n),gap:2},r.createElement(S,{component:g,"data-ga":i("".concat(c,"-").concat(v,"-key")),"data-testid":"".concat(a,"-").concat(v,"Key"),onChange:function(e){return C((function(t){return O(O({},t),{},(0,f.Z)({},n,O(O({},t[n]),{},{key:e})))}))},value:s,placeholder:m,title:"Key"}),r.createElement(S,{component:h,"data-ga":i("".concat(c,"-").concat(v,"-value")),"data-testid":"".concat(a,"-").concat(v,"Value"),onChange:function(e){return C((function(t){return O(O({},t),{},(0,f.Z)({},n,O(O({},t[n]),{},{value:e})))}))},value:d,placeholder:m,title:"Value"}),r.createElement(o.Button,{flavour:"borderless",icon:"trashcan",margin:[0,0,1,0],neutral:!0,onClick:function(){C((function(e){return E()(e,n)}))}}))})))},input:m,select:g},T=function(e){var t=e.component,n=(0,a.Z)(e,P),l=Z[t]||Z.default;return r.createElement(l,n)},S=T},25185:function(e,t,n){"use strict";n.d(t,{A3:function(){return p},Ce:function(){return c},QD:function(){return g},aN:function(){return f},bb:function(){return m},fb:function(){return b},hz:function(){return d},nO:function(){return u},zT:function(){return s}});n(47941),n(82526),n(57327),n(41539),n(88449),n(2490),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);var a=n(4942),r=n(71893),l=n(93416);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(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,a.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 c=(0,r.default)(l.Flex).attrs({alignItems:"center",color:"text",gap:1,hoverColor:"text"}).withConfig({displayName:"styled__AnchorComponent",componentId:"sc-wc4x41-0"})(["&,&:hover{text-decoration:none;}"]),s=(0,r.default)(l.Icon).attrs({height:"130px",width:"130px"}).withConfig({displayName:"styled__BlurredIcon",componentId:"sc-wc4x41-1"})(["filter:blur(70px);position:absolute;left:0;top:0;opacity:0.5;"]),u=(0,r.default)(l.Button).attrs({height:"22px",icon:"plus",padding:[.5,2,.5,1],small:!0,width:"auto"}).withConfig({displayName:"styled__IntegrationAction",componentId:"sc-wc4x41-2"})(["&& > span{font-weight:bold;margin-left:4px;}"]),m=(0,r.default)(l.TextSmall).withConfig({displayName:"styled__LearnMoreTest",componentId:"sc-wc4x41-3"})(["position:relative;"]),d=(0,r.default)(l.ModalContent).attrs({background:"dropdown",height:{base:150,max:150,min:45},overflow:{vertical:"auto"},width:{base:121,max:140,min:70}}).withConfig({displayName:"styled__ModalContent",componentId:"sc-wc4x41-4"})(["box-shadow:0 18px 28px rgb(9 30 66 / 15%),0 0 1px rgb(9 30 66 / 31%);"]),p=(0,r.default)(l.ModalCloseButton).attrs({color:"text",height:"16px",width:"16px"}).withConfig({displayName:"styled__ModalClose",componentId:"sc-wc4x41-5"})(["&:hover{fill:",";}"],(0,l.getColor)("selected")),g=(0,r.default)(l.Flex).attrs((function(e){return i(i({},e.hasBorder?{border:{side:"bottom",color:"disabled"}}:{}),{},{column:!0,padding:[3,4]})})).withConfig({displayName:"styled__ModalSection",componentId:"sc-wc4x41-6"})([""]),f=(0,r.default)(l.Icon).attrs({name:"warning_triangle",height:"18px",width:"18px",color:["yellow","amber"]}).withConfig({displayName:"styled__WarningIcon",componentId:"sc-wc4x41-7"})(["position:absolute;top:0;right:0;z-index:1;"]),b=(0,r.default)(l.Icon).attrs({height:"12px",width:"12px",color:"white"}).withConfig({displayName:"styled__SystemIcon",componentId:"sc-wc4x41-8"})(["position:relative;top:2px;"])},62195:function(e,t,n){"use strict";var a=n(29439),r=(n(41539),n(88674),n(17727),n(67294)),l=n(50308),o=n.n(l),i=n(93416),c=n(36285),s=n(93017),u=n(39979),m=n(54005),d=n(63346),p=n(46667),g=n(23154),f=(0,u.Z)(i.Button);t.Z=function(e){var t=e.onConfirm,n=e.onDecline,l=void 0===n?o():n,u=e.onCancellingEnd,b=void 0===u?o():u,h=(0,c.Zn)(),E=(0,s.Z)(),v=(0,a.Z)(E,2),y=v[0],x=v[1],w=(0,g.Z)().id,C=(0,m.Z)(),O=C.sendLog,P=C.isReady,Z=(0,p.Z)(),T=(0,a.Z)(Z,4),S=T[0],k=T[2],I=T[3],j=(0,r.useCallback)((function(){k(),h({productId:w}).then((function(){y({header:"Successfully canceled subscription",text:"You are now on Community plan"}),O({feature:"TrialOptOut",isSuccess:!0})})).catch((function(){x({header:"Failed to cancel the subscription",text:"Remained on Business plan"}),O({feature:"TrialOptOut",isFailure:!0,error:"Failed to cancel the subscription"})})).finally((function(){b(),I()}))}),[w,P]),F=(0,r.useCallback)((function(){t?t():j()}),[t,j]);return r.createElement(i.Modal,{backdropProps:{backdropBlur:!0}},r.createElement(d.ZP,{feature:"TrialOptOut"},r.createElement(i.ModalContent,{width:{base:140}},r.createElement(i.ModalHeader,null,r.createElement(i.Flex,{gap:2,alignItems:"center"},r.createElement(i.H4,null,"Go to Community plan"))),r.createElement(i.ModalBody,null,S?r.createElement(i.Flex,{height:"100px"},r.createElement(i.TextBig,null,"Changing billing plan...")):r.createElement(i.Flex,{gap:2,column:!0},r.createElement(i.H3,null,"Are You Sure?"),r.createElement(i.TextBig,null,"It looks like you have chosen to opt-out of your free 30-day business trial. Are you sure you do not want to experience all the features Netdata has to offer?"),r.createElement(i.TextBig,null,"By opting out, you will switch to the community plan immediately."))),r.createElement(i.ModalFooter,null,r.createElement(i.Flex,{justifyContent:"end",gap:4,padding:[1,2]},r.createElement(f,{feature:"TrialOptOut",label:"Yes, I am sure!",flavour:"hollow",small:!0,onClick:F,disabled:!w||S,textTransform:""}),r.createElement(f,{feature:"TrialOptOut",label:"No, I want the trial!",small:!0,onClick:l,disabled:S,textTransform:""}))))))}},96009:function(e,t,n){"use strict";n.d(t,{Bk:function(){return o},NY:function(){return r},_j:function(){return l},fe:function(){return i},v8:function(){return a}});var a={default:"successBackground",warning:"warningBackground",critical:"errorBackground"},r={default:{background:"successSemi",border:"success"},warning:{background:"warningSemi",border:"warning"},critical:{background:"errorSemi",border:"error"}},l=[30,15,3,2,1],o="dismissedTrialWelcome",i="dismissedTrialWarningDate"},66987:function(e,t,n){"use strict";var a=n(87462),r=n(67294),l=n(93416),o=n(50308),i=n.n(o),c=n(60511),s={banner:{color:"main"},sidebar:{lineHeight:"1.6",color:"main"},freePlanUpgrade:{lineHeight:"1.6",color:"main"},billing:{color:"textLite"}};t.Z=function(e){var t=e.flavour,n=e.onUpdateClick,o=void 0===n?i():n,u=(0,c.Z)(),m=u.daysRemaining,d=u.canUpgrade,p=u.trialEndsAt,g=(0,r.useMemo)((function(){return{isBanner:"banner"==t,isSidebar:"sidebar"==t,isBilling:"billing"==t,isFreePlanUpgrade:"freePlanUpgrade"==t}}),[t]);return r.createElement(l.Flex,{justifyContent:g.isBilling?"start":"center",alignItems:"center",width:"100%",gap:2},g.isFreePlanUpgrade?r.createElement(l.Text,s[t],"Upgrade your plan for unlimited access and Business features."):r.createElement(l.Text,s[t],"You have ",r.createElement(l.Text,(0,a.Z)({strong:!0},s[t]),"".concat(m," days"))," ","left to explore all the features of Netdata Business."," ",g.isBilling&&r.createElement(r.Fragment,null,"Trial ends at"," ",r.createElement(l.Text,(0,a.Z)({strong:!0},s[t]),p),"."," "),g.isBanner&&d?r.createElement(l.Box,{"data-testid":"upgrade-to-business-banner",onClick:o,as:l.Text,cursor:"pointer",textDecoration:"underline",color:"main"},"Consider upgrading for unlimited access."):r.createElement(r.Fragment,null,"Consider upgrading for unlimited access.")))}},29292:function(e,t,n){"use strict";var a=n(45987),r=n(67294),l=n(50308),o=n.n(l),i=n(93416),c=n(54005),s=["flavour","onOptOutClick"],u={default:"Or you can opt to downgrade immediately",billing:"Or you can opt to downgrade immediately"};t.Z=function(e){var t=e.flavour,n=void 0===t?"default":t,l=e.onOptOutClick,m=void 0===l?o():l,d=(0,a.Z)(e,s),p=(0,c.Z)(),g=p.sendLog,f=p.isReady,b=(0,r.useCallback)((function(){m(),g({feature:"TrialOptOut",isStart:!0})}),[f]);return r.createElement(i.Text,d,"After the trial, you'll automatically switch to the free Community plan."," ",r.createElement(i.Box,{"data-testid":"upgrade-to-business-banner",onClick:b,as:i.Text,cursor:"pointer",textDecoration:"underline",color:"primary"},u[n]),".")}},60511:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var a=n(29439),r=n(67294),l=n(33335),o=n(33937),i=n(13477),c=(n(41539),n(64211),n(2490),n(41874),n(33926)),s=n(36285),u=n(80699),m=n(96009),d=n(38314),p=n(14808),g=function(e){var t=new Date(e||void 0).toLocaleDateString();return"Invalid Date"!==t?t:null},f=function(){var e,t=(0,s.RP)(),n=t.loaded,f=t.value,b=t.refresh,h=(0,u.Z)().isFailure,E=f||{},v=E.slug,y=E.trialEndsAt,x=(0,r.useMemo)((function(){return function(e){if(!e)return null;var t=new Date(e)-new Date;return Math.ceil(t/864e5)}(y)}),[y]),w=n&&!!y,C=(0,l.gI)("billing:Manage"),O=(0,o.pI)("trialModalDismissed"),P=(0,a.Z)(O,1)[0],Z=p.Z3&&C&&(w||h)&&!localStorage.getItem(m.Bk)&&!P,T=(0,r.useState)(localStorage.getItem(m.fe)),S=(0,a.Z)(T,2),k=S[0],I=S[1],j=(0,r.useMemo)((function(){return p.Z3&&w}),[w]),F=(0,r.useState)(),D=(0,a.Z)(F,2),A=D[0],M=D[1],N=(e=x)>15?"default":e>5?"warning":"critical",B=!(0,i.Iy)("isAnonymous")&&C;return(0,r.useEffect)((function(){var e=function(e,t,n,a){if(t<0)return!1;var r=new Date(e||void 0);if("Invalid Date"==r)return!1;var l=new Date(a||void 0);if("Invalid Date"==l)return!0;var o=(0,c.Z)({start:l,end:r}).days;return n.some((function(e){return e>=t&&e<o}))}(y,x,m._j,k);M(p.Z3&&e)}),[y,x,k]),{trialWelcomeVisible:Z,sidebarWarningVisible:j,bannerVisible:A,dismissBanner:function(){var e=(new Date).toISOString();I(e),localStorage.setItem(m.fe,e)},daysRemaining:x,trialEndsAt:g(y),type:N,canUpgrade:B,onTrial:w,refreshPlan:b,planIsFreeOrEarlyBird:(0,d.BT)(v)}}},23154:function(e,t,n){"use strict";n(2707),n(47941);var a=n(36285),r=n(38314);t.Z=function(){var e,t=(0,a.Gl)().value;if(null===t||void 0===t||!t.free)return{};var n=Object.keys(t.free).sort(r.G2)[0];return{id:t.free[n]?null===(e=t.free[n][0])||void 0===e?void 0:e.id:null,version:n}}},88276:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Wl}});n(92222);var a=n(67294),r=n(89250),l=n(4942),o=n(29439),i=n(87462),c=n(45987),s=(n(66992),n(41539),n(88674),n(78783),n(33948),n(82772),n(47042),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(2145)),u=n(12599),m=n(71893),d=n(93416),p=n(73256),g=n(16645),f=n(7693),b=n(56662),h=(n(21249),n(57640),n(9924),n(33335)),E=n(95383),v=n(74059),y=n(46667),x=n(20031),w=[{id:"name",accessor:"name",header:"Name",cell:function(e){var t=e.getValue,n=e.row.original.isMember,r=t(),l=(0,h.gI)("room:ReadAll");return a.createElement(d.Flex,{alignItems:"center"},l&&n&&a.createElement(x.Z,{margin:[0,1,0,0]}),a.createElement(d.Text,{margin:l&&!n&&[0,0,0,4]},r))}},{id:"nodeCount",accessor:"nodeCount",header:"Nodes",cell:function(e){var t=e.getValue;return"".concat(t()||0)}},{id:"memberCount",accessor:"memberCount",header:function(){return"Users"},cell:function(e){var t=e.getValue;return"".concat(t()||0)}}],C=n(15861),O=n(64687),P=n.n(O),Z=(n(26699),n(32023),n(4480)),T=n(33427),S=n(25819),k=n(37518),I=n(91850),j=n(4474),F=function(){var e=(0,C.Z)(P().mark((function e(t,n){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(n.map((function(e){return(0,S.GX)(t,e)}))));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),D=n(7724);function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function M(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,l.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 N=function(e){var t=e.spaceId,n=e.spaceName,l=e.startIsCreating,i=function(e){return(0,Z._8)((function(t){var n=t.snapshot,a=t.set,r=t.reset;return function(){var t=(0,C.Z)(P().mark((function t(l){var i,c,s,u,m,d,p,g,f,b=arguments;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=(i=b.length>1&&void 0!==b[1]?b[1]:{}).onSuccess,s=i.onFail,t.next=3,n.getPromise((0,E.Ad)({id:e,key:"ids"}));case 3:return u=t.sent,m=l.map((function(e){return e.id})),d=u.filter((function(e){return!m.includes(e)})),a((0,E.Ad)({id:e,key:"ids"}),d),t.next=9,Promise.all(d.map((function(e){return n.getPromise((0,k.n2)({id:e}))})));case 9:return p=t.sent,t.prev=10,t.next=13,F(e,m);case 13:a(I.IV,(0,j.rZ)(p)),l.forEach((function(t){var n=t.id,a=t.slug;r((0,k.n2)({id:n})),r((0,I.xh)([e,a]))})),c&&c(),l.length>1?(0,T.$T)("Rooms were successfully deleted from Space!"):(g=(0,o.Z)(l,1),f=g[0],(0,T.$T)("Room ".concat(f.name," was successfully deleted!"))),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(10),a((0,E.Ad)({id:e,key:"ids"}),u),s&&s(t.t0);case 23:case"end":return t.stop()}}),t,null,[[10,19]])})));return function(e){return t.apply(this,arguments)}}()}),[e])}(t),c=(0,h.gI)("space:Delete"),s=(0,h.gI)("room:Create"),u=function(e,t){if(e){var n=Array.isArray(e)?e.map((function(e){return{id:e.id,name:e.name}})):[{id:e.id,name:e.name}];i(n,{onSuccess:t.resetRowSelection})}},m=function(e,t){var n=t.length;return n?1===n?(0,D.CE)(t[0].name):(0,D.CE)(n):""},d=function(e,t){var r=t.length;if(!r)return"";var l=M(M({},1===r?{name:t[0].name}:{roomsLength:r}),{},{spaceName:n});return a.createElement(D.M5,l)},p=(0,r.TH)().pathname,g=(0,r.s0)(),f=(0,a.useCallback)((function(e){return g("".concat(p,"/").concat(e))}),[p,g]),b=(0,a.useMemo)((function(){return{goto:{handleAction:function(e){var t=e.slug;return f(t)},icon:"chevron_right",tooltipText:"Room settings"},delete:{confirmLabel:"Yes, delete",confirmationMessage:function(e){return a.createElement(D.M5,{name:e.name,spaceName:n})},confirmationTitle:function(e){return(0,D.R4)(e.name)},dataGa:function(e){var t=e.slug;return"manage-rooms::click-delete::".concat(t)},declineLabel:"Cancel",handleAction:u,isDisabled:function(e){return e.untouchable||!c},tooltipText:"Delete room"}}}),[c,f]);return{bulkActions:(0,a.useMemo)((function(){return{addEntry:{dataGa:"manage-rooms::click::add-room",handleAction:l,isDisabled:!s,tooltipText:"Create room"},delete:{confirmationMessage:d,confirmationTitle:m,confirmLabel:"Yes, delete",dataGa:"manage-rooms::delete-bulk",declineLabel:"Cancel",handleAction:u,isDisabled:!c,tooltipText:"Delete rooms"}}}),[s,c,d,m]),rowActions:b,onClickRow:f}};function B(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function L(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,l.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 R=function(){var e=(0,E.J7)(),t=(0,h.gI)("room:Delete"),n=e.map((function(e){return L(L({},e),{},{disabled:e.untouchable||!t})})),r=(0,a.useState)(""),l=(0,o.Z)(r,2),i=l[0],c=l[1],s=(0,v.OS)("name"),u=(0,v.OS)("id"),m=(0,y.Z)(),d=(0,o.Z)(m,4),p=d[0],g=d[2],f=d[3],b=(0,a.useState)([]),x=(0,o.Z)(b,2)[1],C=N({startIsCreating:g,spaceId:u,spaceName:s}),O=C.bulkActions;return{roomList:n,globalFilter:i,spaceName:s,spaceId:u,isCreating:p,rowActions:C.rowActions,bulkActions:O,columns:w,startIsCreating:g,stopIsCreating:f,setGlobalFilter:c,onRowSelected:x,dataGa:"manage-rooms"}},_=n(63346),U=function(e){var t=R(),n=t.roomList,r=t.spaceName,l=t.isCreating,o=t.columns,c=t.setGlobalFilter,s=t.stopIsCreating,u=t.onRowSelected,m=t.rowActions,p=t.bulkActions,g=t.dataGa;return a.createElement(_.ZP,{tab:"Rooms"},a.createElement(d.Flex,(0,i.Z)({column:!0,height:"100%",overflow:"hidden",gap:3},e),a.createElement(d.H3,null,"Rooms of ",r),a.createElement(d.Table,{onSearch:c,onRowSelected:u,enableSorting:!0,dataColumns:o,enableSelection:!0,data:n,bulkActions:p,rowActions:m,dataGa:g,testPrefixCallback:function(e){return e.name}})),l&&a.createElement(b.U,{onClose:s}))},V=(n(74916),n(64765),n(41817),n(97323)),H=n(41379),W=n(39904),z=n(2509),G=n(17563),Y=n(96929),q=n(97945);function K(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?K(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var X=function(){var e=(0,Y.zN)();return{nodes:(0,q.Ne)(e).map((function(e){return Q(Q({},e),{},{disabled:e.hasAccessibleData})}))||[],nodeIds:e}},$=n(60730),J=["roomUntouchable"],ee=(0,a.memo)((function(e){var t=e.roomUntouchable,n=(0,c.Z)(e,J),r=X({roomUntouchable:t}),l=r.nodes,o=r.nodeIds;return a.createElement(_.ZP,{tab:"Room::Nodes"},a.createElement(d.Flex,(0,i.Z)({column:!0,height:"100%",overflow:"hidden",gap:3},n),a.createElement(d.H3,null,"Nodes in this room (",o.length,") "),a.createElement($.Z,{showClaimNodeOnEmptySpace:!0,enableSelection:!0,customNodes:l,roomUntouchable:t})))})),te=n(92903),ne=n(1229),ae=n(6557),re=n.n(ae),le=n(91966),oe=n.n(le),ie=n(94666),ce=n(34912),se=n(31203),ue=[{id:"user",accessorKey:"user",header:"Name",cell:function(e){var t=e.cell.row.original,n=t.avatarURL,r=t.name;return a.createElement(d.Flex,{alignItems:"center",gap:2},a.createElement(se.Z,{src:n,title:r}),a.createElement(d.TextSmall,null,r))}},{id:"email",accessorKey:"email",header:"Email",cell:function(e){var t=e.getValue;return a.createElement(d.TextSmall,null,t())}}],me=[{id:"user",desc:!1}],de=function(e){var t=e.setSelected,n=(0,ie.H4)(),r=(0,ne.e1)(),l=(0,a.useMemo)((function(){return oe()(n,r)}),[n,r]),o=(0,a.useCallback)((function(e){t(e.map((function(e){return e.id})))}),[]),i=(0,ce.Vr)(l);return a.createElement(d.Flex,{alignItems:"start",padding:[1],overflow:{horizontal:"hidden",vertical:"auto"}},a.createElement(d.Table,{dataColumns:ue,data:i,autoResetSelectedRows:!0,sortableBy:me,onSearch:re(),onRowSelected:o,enableSelection:!0,enableSorting:!0}))},pe=n(39979),ge=(0,pe.Z)(d.Button),fe=function(e){var t=e.onAdd,n=e.onClose,r=e.selected,l=e.error,o=e.name;return a.createElement(d.Flex,{alignItems:"center",justifyContent:"between"},l?a.createElement(d.Text,{color:"error"},"Select at least 1 user to add to ",o):a.createElement("div",null),a.createElement(d.Flex,{gap:2},a.createElement(d.Button,{neutral:!0,flavour:"hollow",onClick:n,label:"Cancel"}),a.createElement(ge,{disabled:!r.length,label:"Add ".concat(r.length," members"),onClick:t})))},be=n(87181),he=n(86414),Ee=n(36925),ve=n(35838),ye=n(74855),xe=n(52631),we=n(93017),Ce=n(8048),Oe=n(91008),Pe=n(46475),Ze=function(e){var t=e.email;return(0,Ee.vV)(t)},Te={header:"Invitations",text:"Invitations successfully sent!"},Se=function(e){var t=(0,v.OS)(),n=t.id,r=t.slug,l=(0,k.UL)(),c=(0,k.tE)(l,"name"),s=(0,a.useState)([]),u=(0,o.Z)(s,2),m=u[0],p=u[1],g=(0,ve.E)(n),f=(0,o.Z)(g,4),b=f[2],E=f[3],y=(0,we.Z)(),x=(0,o.Z)(y,2)[1],w=(0,a.useState)(),C=(0,o.Z)(w,2),O=C[0],P=C[1],Z=(0,a.useState)(),T=(0,o.Z)(Z,2),S=T[0],I=T[1],j=function(e){var t=e||Te,n=t.header,a=t.text,r=(0,ye.sc)({header:n,text:a,success:!0});xe.Z.success(r,{context:"manageInvitations"}),p([]),P(Math.random())},F=(0,a.useCallback)((function(){var e=m.filter(Ze).map((function(e){return{email:e.email,name:e.name,role:S,roomIDs:[l]}})),t="".concat(window.location.origin,"/spaces/").concat(r,"/join-space");b(e,t,{onSuccess:j,onError:x})}),[m,l,S]),D=(0,h.QB)();return a.createElement(d.Flex,(0,i.Z)({column:!0},e),a.createElement(d.H4,null,"Send invitations to ",c," room"),a.createElement(be.ne,null,"TIP: You can send more invitations at once, separate each with a comma."),a.createElement(he.m,{key:O,invitations:m,setInvitations:p}),a.createElement(d.H5,{margin:[4,0,0]},"Role"),a.createElement(be.ne,null,"Choose a role for invited user."," ",a.createElement(Oe.Z,{href:Pe.R,target:"_blank",rel:"noopener noreferrer",Component:d.TextSmall},"Learn more")),a.createElement(Ce.Z,{availableRoles:D,dataGA:"invite-to-room",dataTestId:"invite-selectRole",onChange:function(e){I(e.target.value)},value:S}),a.createElement(d.Box,{alignSelf:"end",margin:[4,0,0]},a.createElement(d.Button,{label:"Send",onClick:F,disabled:0===m.length||!S,flavour:"hollow",isLoading:E})))},ke=function(e){var t=e.onClose,n=e.room,r=(0,a.useState)([]),l=(0,o.Z)(r,2),i=l[0],c=l[1],s=(0,a.useState)(!1),u=(0,o.Z)(s,2),m=u[0],p=u[1],b=(0,ne.r3)(n.spaceId,n.id),h=(0,a.useCallback)((function(){if(!i.length)return p(!0);p(!1),b(i),t()}),[i,b]);return a.createElement(g.u6,{onClose:t},a.createElement(f.x,{onClose:t,isSubmodal:!0,title:a.createElement(a.Fragment,null,"Manage room",a.createElement(d.TextBig,{color:"textLite"},"\xa0/ Add Users"))}),a.createElement(te.B,null,"Add users to room\xa0",n.name),a.createElement(g.TZ,null,a.createElement(Se,{margin:[0,0,4]}),a.createElement(d.Flex,{column:!0,flex:!0,overflow:"hidden",padding:[0,0,2,0]},a.createElement(de,{setSelected:c})),a.createElement(fe,{onClose:t,onAdd:h,selected:i,error:m,name:n.name})))},Ie=n(46322),je=n(13477),Fe=function(e){return"Remove ".concat(e)},De=function(e){var t,n=e.name,a=e.usersLength;return a?1===a&&n?Fe(n):"Remove ".concat(t=a," ").concat(1===t?"user":"users"):""},Ae=function(e){var t=e.name,n=e.roomName;return a.createElement(a.Fragment,null,"You are about to remove ",a.createElement("strong",null,t)," from room ",a.createElement("strong",null,n),".",a.createElement("br",null),"Are you sure you want to continue?")},Me=function(e){var t=e.roomName,n=e.usersLength,r="".concat(n,1===n?" user":" users");return a.createElement(a.Fragment,null,"You are about to remove ",a.createElement("strong",null,r)," from room ",a.createElement("strong",null,t),".",a.createElement("br",null),"Are you sure you want to continue?")},Ne=function(e){var t=e.name,n=e.roomName,r=e.usersLength;return r?1===r&&t?a.createElement(Ae,{name:t,roomName:n}):a.createElement(Me,{roomName:n,usersLength:r}):""},Be=n(54005),Le=function(e){var t=e.spaceId,n=e.roomId,r=e.startIsInviting,l=(0,ne.GA)(t,n),o=(0,k.Hm)("name"),i=(0,Be.Z)(),c=i.sendButtonClickedLog,s=i.isReady,u=function(e){if(e){var t=Array.isArray(e)?e.map((function(e){return e.user.id})):[null===e||void 0===e?void 0:e.user.id];l(t)}},m=(0,a.useCallback)((function(){r(),s&&c({label:"Invite users"},!0)}),[s,c]);return{rowActions:(0,a.useMemo)((function(){return{remove:{confirmLabel:"Yes, remove",confirmationMessage:function(e){return a.createElement(Ae,{name:e.name,roomName:o})},confirmationTitle:function(e){return Fe(e.name)},declineLabel:"Cancel",disabledTooltipText:"Remove is disabled",handleAction:u,isDisabled:function(e){return e.disabled},tooltipText:"Remove user from room"}}}),[Fe,u,Ae,o]),bulkActions:(0,a.useMemo)((function(){return{addEntry:{handleAction:m,tooltipText:"Invite users"},remove:{confirmLabel:"Yes, remove",confirmationMessage:function(e,t){return a.createElement(Ne,{name:t[0].name,roomName:o,usersLength:t.length})},confirmationTitle:function(e,t){return De({name:t[0].name,usersLength:t.length})},declineLabel:"Cancel",disabledTooltipText:"Remove is disabled",handleAction:u,tooltipText:"Remove users from room"}}}),[u,Ne,o,r,De])}},Re=function(e){var t=e.untouchable,n=(0,a.useMemo)((function(){return[{id:"email",accessor:"email",header:"Email",cell:function(e){var t=e.getValue;return"".concat(t())}},{id:"name",accessor:"name",header:"Name",cell:function(e){var t=e.getValue;return"".concat(t())}},{id:"user",accessor:"user",header:"Users",cell:function(e){var t=(0,e.getValue)(),n=t.name,r=t.avatarURL,l=t.email;return a.createElement(d.Flex,{alignItems:"center",gap:2},a.createElement(se.Z,{src:r,title:"".concat(n," - ").concat(l||"email not set")}),a.createElement(d.TextSmall,null,n))}}]}),[]),r=(0,ne.lA)(),l=(0,je.Iy)("id"),i=(0,h.gI)("space:RemoveUser"),c=(0,a.useState)([]),s=(0,o.Z)(c,2),u=s[0],m=s[1],p=(0,a.useState)(""),g=(0,o.Z)(p,2),f=g[0],b=g[1],E=(0,y.Z)(),x=(0,o.Z)(E,4),w=x[0],C=x[2],O=x[3],P=(0,v.OS)("id"),Z=(0,k.UL)(),T=Le({selectedRows:u,spaceId:P,roomId:Z,startIsInviting:C}),S=T.rowActions,I=T.bulkActions;return{columns:n,data:(0,a.useMemo)((function(){return(0,Ie.k)({data:r,currentUserId:l,canRemoveUser:i,untouchable:t})}),[r]),columnVisibility:{email:!1,name:!1},members:r,rowActions:S,bulkActions:I,isInviting:w,globalFilter:f,stopIsInviting:O,onRowSelected:m,setGlobalFilter:b,canRemoveUser:i}},_e=["room"],Ue=function(e){var t=e.room,n=(0,c.Z)(e,_e),r=t.untouchable,l=Re({untouchable:r}),o=l.columns,s=l.data,u=l.columnVisibility,m=l.members,p=l.rowActions,g=l.bulkActions,f=l.isInviting,b=l.stopIsInviting,h=l.onRowSelected,E=l.setGlobalFilter;l.canRemoveUser;return a.createElement(_.ZP,{tab:"Room::User"},a.createElement(d.Flex,(0,i.Z)({column:!0,height:"100%",overflow:"hidden",gap:3},n),a.createElement(d.H3,null,"Users in this room (",m.length,")"),a.createElement(d.Table,{enableSelection:!0,enableSorting:!0,columnVisibility:u,data:s,dataColumns:o,rowActions:p,bulkActions:g,onRowSelected:h,onSearch:E,testPrefixCallback:function(e){return e.name}}),f&&a.createElement(ke,{onClose:b,room:t})))},Ve={room:0,nodes:1,users:2},He=(0,m.default)(d.Box).attrs({height:"100%",padding:[4,0],flex:"1",overflow:"hidden"}).withConfig({displayName:"manageRoomModal__TabContent",componentId:"sc-lrxs0y-0"})([""]),We=function(){var e=(0,r.s0)(),t=(0,v.th)(),n=(0,r.UO)(),l=n.roomSlug,i=n.spaceSlug,c=n.settingsTab,s=(0,k.HM)(t,l);(0,H.Z)({spaceId:t,id:s,polling:!1}),(0,W.Z)(t,s);var m=(0,h.gI)("room:ReadUsers"),p=(0,k.tE)(s),g=(0,a.useState)(p.name),f=(0,o.Z)(g,2),b=f[0],E=f[1],y=(0,r.TH)().search,x=G.parse(y).tab,w=Ve[void 0===x?"room":x],C=(0,a.useState)(w),O=(0,o.Z)(C,2),P=O[0],Z=O[1],T=(0,d.useInputValue)({maxChars:255,value:p.description}),S=(0,o.Z)(T,3),I=S[0],j=S[1],F=S[2],D=(0,a.useCallback)((function(){e((0,u.Gn)(z.Sr,{spaceSlug:i,settingsTab:c}))}),[i,c]),A=(0,k.s)(p.id,{shouldPersist:!0,onSuccess:D}),M=(0,a.useCallback)((function(){return A({name:b,description:I})}),[b,I,A]);return a.createElement(d.Flex,{column:!0,justifyContent:"between",overflow:"hidden","data-testid":"manageRoom",flex:"1",height:"100%"},a.createElement(d.Tabs,{"data-testid":"manageRoom-tabs",selected:P,onChange:Z,TabContent:He,height:"100%",position:"relative",overflow:"hidden",width:"100%"},a.createElement(d.Tab,{"data-testid":"manageRoom-roomTab",label:a.createElement(d.H5,null,"Room")},a.createElement(V.Q,{roomName:b,setRoomName:E,roomDescription:I,setRoomDescription:j,charsDescIndicator:F,"data-testid":"manageRoom-roomTabContent",id:p.id,navigateToParent:D,onSaveClick:M})),a.createElement(d.Tab,{"data-testid":"manageRoom-nodesTab",label:a.createElement(d.H5,null,"Nodes")},a.createElement(ee,{roomUntouchable:p.untouchable,"data-testid":"manageRoom-nodesTabContent"})),m&&a.createElement(d.Tab,{"data-testid":"manageRoom-usersTab",label:a.createElement(d.H5,null,"Users")},a.createElement(Ue,{"data-testid":"manageRoom-usersTabContent",room:p}))),P===Ve.room&&a.createElement(d.Flex,{justifyContent:"end"}))},ze=n(3975),Ge=function(e){var t=e.children;return(0,ze.QF)(),t},Ye=function(e){var t=e.children;return(0,k.Hm)().loaded?t:null},qe=function(){return a.createElement(r.Z5,null,a.createElement(r.AW,{path:"/",element:a.createElement(U,null)}),a.createElement(r.AW,{path:":roomSlug",element:a.createElement(Ge,null,a.createElement(Ye,null,a.createElement(We,null)))}))},Ke=n(18663),Qe=n(64637),Xe=n(82351),$e=[{id:"email",accessor:"email",header:"Email",cell:function(e){var t=e.getValue;return"".concat(t())}},{id:"name",accessor:"name",header:"Name",cell:function(e){var t=e.getValue;return"".concat(t())}},{id:"user",accessor:"user",width:300,header:"Users",cell:function(e){var t=(0,e.getValue)(),n=t.name,r=t.avatarURL,l=t.email;return a.createElement(d.Flex,{alignItems:"center",gap:2},a.createElement(se.Z,{src:r,title:"".concat(n," - ").concat(l||"email not set")}),a.createElement(d.TextSmall,null,n))}},{id:"type",accessor:"type",width:100,header:"Role",cell:function(e){var t=e.getValue,n=e.row.original.user.deactivated;return a.createElement(d.Flex,{alignItems:"center",gap:1},a.createElement(d.TextSmall,{strong:!0},(0,Qe.fm)(t())),n&&a.createElement(Xe.Z,{content:"This user's role doesn't have permission to access any information on the Space. Please review user's role or space's plan."},a.createElement(d.Icon,{name:"warning_triangle",height:"18px",width:"18px",color:["yellow","amber"]})))}}],Je=(n(85827),n(25387),n(72608),n(274)),et=["role"],tt=["id"];function nt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nt(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var rt=function(){var e=(0,C.Z)(P().mark((function e(t,n,a){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(n.map(function(){var e=(0,C.Z)(P().mark((function e(n){return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Je.lh)(t,n,a);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())));case 1:case"end":return e.stop()}}),e)})));return function(t,n,a){return e.apply(this,arguments)}}(),lt="change-user-role",ot="changeUserRole",it=function(e){var t=e.handleAction,n=e.ids,r=e.onClose,l=(0,ie.kf)(n),i=1===l.length?l[0]:null,c=(0,h.QB)(),s=(0,a.useState)(i),u=(0,o.Z)(s,2),m=u[0],p=u[1];return a.createElement(d.ConfirmationDialog,{confirmLabel:"Save","data-ga":lt,"data-testid":ot,handleConfirm:function(){t(m),r()},handleDecline:r,isConfirmDisabled:!m,isConfirmPositive:!0,message:a.createElement(d.Flex,{gap:2,column:!0},a.createElement(d.TextSmall,null,"Learn more about Netdata role-based access model on"," ",a.createElement(Oe.Z,{href:Pe.R,target:"_blank",rel:"noopener noreferrer",Component:d.TextSmall},"our documentation")),a.createElement(Ce.Z,{availableRoles:c,dataGA:lt,dataTestId:ot,onChange:function(e){p(e.target.value)},value:m})),title:"Change roles"})},ct=n(65840),st=["data"],ut=["data"],mt=function(e){var t=e.spaceId,n=e.startIsInviting,r=function(e){return(0,Z._8)((function(t){var n=t.snapshot,a=t.set;return function(){var t=(0,C.Z)(P().mark((function t(r){var l,o,i,c,s,u=arguments;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=(l=u.length>1&&void 0!==u[1]?u[1]:{}).onSuccess,i=l.onError,t.next=3,n.getPromise((0,ie.WA)({id:e,key:"ids"}));case 3:return c=t.sent,s=c.filter((function(e){return!e.includes(r)})),a((0,ie.WA)({id:e,key:"ids"}),s),t.prev=6,t.next=9,(0,Je.Sz)(e,r);case 9:o&&o(),t.next=16;break;case 12:t.prev=12,t.t0=t.catch(6),a((0,ie.WA)({id:e,key:"ids"}),c),i&&i();case 16:case"end":return t.stop()}}),t,null,[[6,12]])})));return function(e){return t.apply(this,arguments)}}()}),[e])}(t),l=function(e){return(0,Z._8)((function(t){var n=t.snapshot,a=t.set;return function(){var t=(0,C.Z)(P().mark((function t(r,l){var o,i,s,u,m,d,p,g=arguments;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=(o=g.length>2&&void 0!==g[2]?g[2]:{}).onSuccess,s=o.onError,t.next=3,n.getPromise((0,ce.W3)(r));case 3:return u=t.sent,t.next=6,Promise.all(r.map(function(){var t=(0,C.Z)(P().mark((function t(a){var r;return P().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.getPromise((0,ie.ZN)({id:a,spaceId:e}));case 2:return r=t.sent,t.abrupt("return",{mId:a,role:r});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 6:return m=t.sent,d=l.role,p=(0,c.Z)(l,et),r.forEach((function(e){a((0,ce.mX)({id:e}),(function(e){return at(at({},e),p)}))})),d&&r.forEach((function(t){a((0,ie.ZN)({id:t,spaceId:e}),d)})),t.prev=10,t.next=13,rt(e,r,l);case 13:i&&i(),t.next=21;break;case 16:t.prev=16,t.t0=t.catch(10),u.forEach((function(e){var t=e.id,n=(0,c.Z)(e,tt);return a((0,ce.mX)({id:t}),at({id:t},n))})),d&&m.forEach((function(t){var n=t.mId,r=t.role;return a((0,ie.ZN)({id:n,spaceId:e}),r)})),s&&s();case 21:case"end":return t.stop()}}),t,null,[[10,16]])})));return function(e,n){return t.apply(this,arguments)}}()}),[e])}(t),o=(0,h.gI)("space:InviteUser"),s=(0,ct.HK)(),u=(0,a.useCallback)((function(e){var t=e.role,n=e.members;l(n,{role:t},{onSuccess:s})}),[]),m=function(e){return function(t){if(e){var n=Array.isArray(e)?e.map((function(e){return e.user.id})):[null===e||void 0===e?void 0:e.user.id];u({role:t,members:n})}}},d=function(e,t){if(e){var n=Array.isArray(e)?e.map((function(e){return e.user.id})):[null===e||void 0===e?void 0:e.user.id];r(n,{onSuccess:t.resetRowSelection})}},p=(0,a.useCallback)((function(){return"Delete User"}),[]),g=(0,a.useCallback)((function(e){return a.createElement(a.Fragment,null,"You are about to delete ",a.createElement("strong",null,e.name),".",a.createElement("br",null),"Are you sure you want to continue?")}),[]),f=(0,a.useCallback)((function(e,t){var n=t.length;return n?1===n?"Delete User":"Delete Users":""}),[]),b=(0,a.useCallback)((function(e,t){var n=t.length;return n?a.createElement(a.Fragment,null,"You are about to delete"," ",a.createElement("strong",null,1===n?t[0].name:"".concat(t.length," users")),".",a.createElement("br",null),"Are you sure you want to continue?"):""}),[]);return{rowActions:(0,a.useMemo)((function(){return{userSettings:{CustomUIAction:function(e){var t=e.data,n=(0,c.Z)(e,st);return a.createElement(it,(0,i.Z)({ids:[t.user.id]},n))},handleAction:m,tooltipText:"Change Role",isDisabled:function(e){return e.disabled},disabledTooltipText:"Changing roles is disabled"},delete:{handleAction:d,confirmationTitle:p,confirmationMessage:g,isDisabled:function(e){return e.disabled},disabledTooltipText:"Delete is disabled"}}}),[]),bulkActions:(0,a.useMemo)((function(){return{addEntry:{handleAction:n,tooltipText:"Invite user",isDisabled:function(){return!o},disabledTooltipText:"Invitations are disabled"},userSettings:{CustomUIAction:function(e){var t=e.data,n=(0,c.Z)(e,ut);return a.createElement(it,(0,i.Z)({ids:t.map((function(e){return e.user.id}))},n))},handleAction:m,tooltipText:"Change Roles",disabledTooltipText:"Changing roles is disabled"},delete:{handleAction:d,confirmationTitle:f,confirmationMessage:b,disabledTooltipText:"Delete is disabled"}}}),[o,f,b])}},dt=function(){var e=(0,v.th)(),t=(0,v.vu)(e,"name"),n=(0,ie.Qk)(),r=(0,je.Iy)("id"),l=(0,y.Z)(),i=(0,o.Z)(l,4),c=i[0],s=i[2],u=i[3],m=(0,a.useState)(""),d=(0,o.Z)(m,2),p=d[0],g=d[1],f=(0,a.useState)([]),b=(0,o.Z)(f,2),E=b[0],x=b[1],w=mt({selectedRows:E,spaceId:e,startIsInviting:s}),C=w.rowActions,O=w.bulkActions,P=(0,h.gI)("space:RemoveUser"),Z=(0,h.gI)("user:ChangeRoles"),T=(0,h.M2)(),S=P||Z,k=(0,a.useMemo)((function(){return function(e){var t=e.fromRolePermissions,n=e.userList,a=e.canModifyUser,r=e.currentUserId;return n.reduce((function(e,n){var l=r===(null===n||void 0===n?void 0:n.id),o=t.includes(n.role);return e.push({name:n.name,email:n.email,user:{avatarURL:n.avatarURL,deactivated:n.deactivated,name:n.name,email:n.email,id:n.id},type:n.role,disabled:!o||!a||l}),e}),[])}({userList:n,currentUserId:r,canModifyUser:S,fromRolePermissions:T})}),[n]);return{columns:$e,spaceName:t,members:n,currentUserId:r,data:k,isInviting:c,globalFilter:p,rowActions:C,bulkActions:O,columnVisibility:{email:!1,name:!1},onRowSelected:x,setGlobalFilter:g,startIsInviting:s,stopIsInviting:u,canModifyUser:S}},pt=function(e){var t=dt(),n=t.columns,r=t.spaceName,l=t.data,o=t.isInviting,c=t.rowActions,s=t.bulkActions,u=t.columnVisibility,m=t.stopIsInviting,p=t.setGlobalFilter,g=t.onRowSelected;return a.createElement(_.ZP,{tab:"Users"},a.createElement(d.Flex,(0,i.Z)({column:!0,height:"100%",overflow:"hidden"},e),a.createElement(d.H3,null,"Members of ",r),a.createElement(d.TextSmall,{margin:[1,0,3]},"Learn more about Netdata role-based access model on"," ",a.createElement(Oe.Z,{href:Pe.R,target:"_blank",rel:"noopener noreferrer",Component:d.TextSmall},"our documentation")),a.createElement(d.Table,{onSearch:p,data:l,dataColumns:n,enableSorting:!0,enableSelection:!0,onRowSelected:g,bulkActions:s,rowActions:c,columnVisibility:u,testPrefixCallback:function(e){return e.name}})),o&&a.createElement(Ke.l,{onClose:m,isSubmodal:!0}))},gt=n(33582),ft=n(43656),bt=(0,a.memo)((function(e){var t=(0,v.th)(),n=(0,v.OS)("name"),r=(0,ft.Z)().nodes;(0,gt.Z)(t);var l="Connect Nodes to ".concat(n);return a.createElement(_.ZP,{tab:"Nodes"},a.createElement(d.Flex,(0,i.Z)({column:!0,"data-testid":"manageClaimedNodes",height:"100%",overflow:"hidden",gap:3},e),a.createElement(d.H3,{"data-testid":"manageClaimedNodes-header"},l),a.createElement($.Z,{showClaimNodeOnEmptySpace:!0,showClaimModalWithRoomSelection:!0,enableSelection:!0,customNodes:r,isSpace:!0})))})),ht=bt,Et=(n(91058),n(77184)),vt=n(45736),yt=n(3689),xt=function(e){var t=e.name,n=e.spaceName;return a.createElement(a.Fragment,null,"You are about to delete ",a.createElement("strong",null,t)," channel from ",a.createElement("strong",null,n)," space.",a.createElement("br",null),"This cannot be undone. Are you sure you want to continue?")},wt=n(31790),Ct=(n(64211),n(41874),n(26833),n(25185)),Ot=["integration","testId"],Pt=["testId","tooltipContent"],Zt=["data-testid","enabled","id","integration","isAvailable","name","spaceId","tooltipContent"];function Tt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function St(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var kt=function(e){var t=e.integration,n=e.testId,r=(0,c.Z)(e,Ot),l=r.checked?"disable":"enable";return a.createElement(d.Toggle,(0,i.Z)({colored:!0,"data-testid":"".concat(n,"-toggle"),"data-ga":"manage-channels::toggle-".concat(t,"-").concat(l,"::notifications-tab")},r))},It=function(e){var t=e.testId,n=e.tooltipContent,r=void 0===n?"plan":n,l=(0,c.Z)(e,Pt);return l.disabled?a.createElement(Xe.Z,{align:"top",content:yt.rc[r],"data-testid":"".concat(t,"-warning"),plain:!0},a.createElement(d.Flex,{padding:[2,2,0,0],position:"relative"},a.createElement(Ct.aN,{"data-testid":"".concat(t,"-warningIcon")}),a.createElement(kt,(0,i.Z)({testId:t},l)))):a.createElement(kt,(0,i.Z)({testId:t},l))},jt=function(e){var t=e["data-testid"],n=void 0===t?"cellName":t,r=e.enabled,l=e.id,o=e.integration,s=e.isAvailable,u=e.name,m=e.spaceId,p=e.tooltipContent,g=(0,c.Z)(e,Zt),f=(0,vt.pV)(m,"channels"),b=(0,vt.rz)(m,"channels");return a.createElement(d.Flex,(0,i.Z)({alignItems:"center","data-testid":n,gap:4},g),a.createElement(It,{checked:r,disabled:!s,integration:o,onChange:function(e){var t=e.target.checked;b(f.map((function(e){return e.id===l?St(St({},e),{},{enabled:t}):e}))),(0,Et.eZ)(m,l,t)},testId:n,tooltipContent:p}),a.createElement(d.Text,{"data-testid":"".concat(n,"-label")},u))},Ft=["data-testid","integration","kind","kindLabel"],Dt=function(e){var t=e["data-testid"],n=void 0===t?"cellService":t,r=e.integration,l=e.kind,o=e.kindLabel,s=(0,c.Z)(e,Ft),u=yt.aU[yt.Pj[r]||r]||{};return a.createElement(d.Flex,(0,i.Z)({alignItems:"center","data-testid":n,gap:2,justifyContent:"between",width:"100%"},s),a.createElement(d.Flex,{alignItems:"center","data-testid":"".concat(n,"-integration"),gap:2},a.createElement(d.Icon,(0,i.Z)({"data-testid":"".concat(n,"-icon")},u)),a.createElement(d.Text,{"data-testid":"".concat(n,"-label")},r)),a.createElement(Xe.Z,{content:o,"data-testid":"".concat(n,"-kind"),plain:!0},a.createElement(d.Icon,{color:"textLite",height:"16px",name:yt.XK[l].icon,width:"16px"})))},At=function(e){var t=e.canManageChannels,n=e.roomOptions,r=e.spaceId;return[{accessor:"name",cell:function(e){var n=e.getValue,l=e.row;return a.createElement(jt,{enabled:l.original.enabled,id:l.original.id,integration:l.original.integration,isAvailable:t&&l.original.available,name:n(),spaceId:r,tooltipContent:t?"plan":"role"})},header:"Name",id:"name"},{accessor:"integration",cell:function(e){var t=e.getValue,n=e.row;return a.createElement(Dt,{integration:t(),kind:n.original.kind,kindLabel:n.original.kindLabel})},enableColumnFilter:!0,filterFn:function(e,t,n){var a=e.original.integration;return n.length<1||n.some((function(e){var t=e.value;return""===t||t===a}))},header:"Service",id:"integration",meta:{filter:{component:"select",isMulti:!0,options:Object.keys(yt.aU).map((function(e){return{label:e,value:e}})),tiny:!0,"data-ga":"manage-integrations::select-service::notification-integrations-tab"},tooltip:a.createElement(d.Flex,{column:!0,width:{max:"200px"},gap:2},a.createElement(d.TextMicro,{color:"white"},"Services are distinguished in two categories."),a.createElement(d.TextMicro,{color:"white"},a.createElement(Ct.fb,{name:yt.XK.PERSONAL.icon})," ",a.createElement(d.TextMicro,{color:"white",strong:!0},"Personal:")," ",yt.XK.PERSONAL.tooltip),a.createElement(d.TextMicro,{color:"white"},a.createElement(Ct.fb,{name:yt.XK.SYSTEM.icon})," ",a.createElement(d.TextMicro,{color:"white",strong:!0},"System:")," ",yt.XK.SYSTEM.tooltip))}},{accessor:"notificationLabel",cell:function(e){var t=e.getValue;return a.createElement(d.Text,{"data-testid":"channelNotificationsCell"},t())},enableColumnFilter:!0,filterFn:function(e,t,n){var a=e.original.notificationLabel;return n.length<1||n.some((function(e){var t=e.label;return""===t||t===a}))},header:"Notifications",id:"notificationLabel",meta:{filter:{component:"select",isMulti:!0,options:Object.values(yt.uK),tiny:!0,"data-ga":"manage-integrations::select-notification::notification-integrations-tab"}}},{accessor:"rooms",cell:function(e){var t,r=e.getValue,l=e.row,o={"data-testid":"channelRoomsCell"};if(l.original.internal)return a.createElement(d.Text,o,yt.mN.label);if(!(l.original.rooms||null!==(t=l.original.rooms)&&void 0!==t&&t.length))return a.createElement(d.Text,o,yt.k_.label);var i=(0,wt.ae)({roomIds:r(),roomOptions:n});return a.createElement(d.Text,{"data-testid":"channelRoomsCell"},i)},enableColumnFilter:!0,filterFn:function(e,t,n){return n.length<1||n.some((function(t){var n=t.label,a=t.value;if(e.original.internal)return n===yt.mN.label;var r=e.original.rooms||[];return r.length?r.includes(a):n===yt.k_.label}))},header:"Rooms",id:"rooms",meta:{filter:{component:"select",isMulti:!0,options:n,tiny:!0,"data-ga":"manage-integrations::select-room::notification-integrations-tab"}}}]},Mt=n(45939),Nt=n(5429),Bt=n(93742);function Lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Rt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lt(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _t=function(e,t){var n=(0,vt.Cz)(t),a=(0,Bt.Z)({all:!0});(0,Nt.Z)((function(){return{enabled:!!t,fetch:function(){return(0,Et.$3)(e,t)},onFail:function(e){return n(Rt(Rt({},Mt.C),{},{error:e.message}))},onSettle:function(){return n({loading:!1,loaded:!0})},onSuccess:function(e){return n(Rt(Rt(Rt({},Mt.C),e.rooms?{roomSelections:a.filter((function(t){var n=t.value;return e.rooms.includes(n)}))}:{}),e))}}}),[e,t])},Ut=n(26913);function Vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Ht(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vt(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Wt=function(){var e=(0,r.s0)(),t=(0,h.gI)("channel:Manage"),n=(0,v.th)(),l=(0,v.OS)("name"),i=(0,v.uk)(),c=(0,we.Z)(),s=(0,o.Z)(c,2),m=s[0],d=s[1],p=(0,a.useState)(""),g=(0,o.Z)(p,2),f=g[0],b=g[1];(0,Ut.Z)(n);var E=(0,vt.pV)(n,"channels"),y=(0,vt.pV)(n,"currentChannelId"),x=(0,vt.rz)(n,"channels"),w=(0,vt.rz)(n,"currentChannelId"),O=(0,Bt.Z)({all:!0,internal:!0}),Z=(0,vt.su)(y),T=Z.alerts,S=Z.name,k=Z.rooms,I=Z.secrets;_t(n,y);var j=(0,a.useCallback)((function(e){w(e)}),[]),F=(0,a.useCallback)(function(){var e=(0,C.Z)(P().mark((function e(t){var a;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.id,e.prev=1,e.next=4,(0,Et.JV)(n,a);case 4:x(E.filter((function(e){return e.id!==a}))),m({header:"Configuration deleted successfully!"}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),d(e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),[E,n]),D=(0,a.useCallback)((function(){e((0,u.Gn)(z.xN,{spaceSlug:i,settingsTab:z.bK,settingsSubTab:z.Q$}))}),[i]),A=(0,a.useMemo)((function(){return{addEntry:Ht({dataGa:"manage-channels::click-add-channel::notifications-tab",flavour:"hollow",handleAction:D,iconColor:"success",label:t?"Add Configuration":"View configurations",small:!0,strong:!0,width:"auto"},t?{}:{icon:""})}}),[t,D]),M=(0,a.useMemo)((function(){return{edit:{dataGa:function(e){var t=e.slug;return"manage-rooms::click-edit::".concat(t)},disabledTooltipText:"Edit is disabled",handleAction:function(e){var t=e.id;j(t)},isDisabled:function(e){var n=e.available,a=e.internal;return!t||!n||a},TooltipComponent:Xe.Z,tooltipText:"Edit setting"},delete:{confirmLabel:"Yes, delete",confirmationMessage:function(e){var t=e.name;return a.createElement(xt,{name:t,spaceName:l})},confirmationTitle:function(e){var t=e.name;return(0,wt.D4)(t)},dataGa:function(e){var t=e.slug;return"manage-rooms::click-delete::".concat(t)},declineLabel:"Cancel",handleAction:F,isDisabled:function(e){var n=e.internal;return!t||n},TooltipComponent:Xe.Z,tooltipText:"Delete setting"}}}),[t,F,D]);return{bulkActions:A,channelData:E,currentChannelId:y,columns:At({canManageChannels:t,roomOptions:O,spaceId:n}),dataGa:"manage-channels",onFilter:function(e,t,n){var a=e.original,r=n.toLowerCase();if(a.name.toLowerCase().includes(r))return!0;if(a.integration.toLowerCase().includes(r))return!0;if(a.notificationLabel.toLowerCase().includes(r))return!0;if(a.internal)return yt.mN.label.toLowerCase().includes(r);var l=a.rooms||[];return l.length?(0,wt.ae)({roomIds:l,roomOptions:O}).toLowerCase().includes(r):yt.k_.label.toLowerCase().includes(r)},onModalClose:function(){x(E.map((function(e){return e.id===y?Ht(Ht({},e),{},{alerts:T,name:S,rooms:k,secrets:I}):e}))),w("")},rowActions:M,search:f,setSearch:b}},zt=(n(68216),n(79433),n(36412)),Gt=["id","integrationId","onClose"],Yt=["id","getValue","onChange"];function qt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qt="modal",Xt=function(e){var t=e.id,n=void 0===t?"new":t,l=e.integrationId,s=e.onClose,m=(0,c.Z)(e,Gt),p=(0,vt.su)(n),g=p.alarms,f=p.title,b=p.description,h=p.docsLink,y=p.fields,x=p.integration,w=p.loaded,O=p.name,Z=p.required,T=p.rooms,S=p.roomSelections,k=p.secrets,I=(0,ct.HK)(),j=function(e){return"manage-".concat(x,"-channel::").concat(e,"::notification-").concat(l?"integrations":"channels","-tab")},F=(0,r.s0)(),D=(0,we.Z)(),A=(0,o.Z)(D,2),M=A[0],N=A[1],B=(0,Bt.Z)({all:!0}),L=(0,E.J7)(),R=(0,v.th)(),_=(0,v.uk)(),U=(0,vt.Cz)(n,"alarms"),V=(0,vt.Cz)(n,"name"),H=(0,vt.Cz)(n,"roomSelections"),W=(0,vt.Cz)(n,"secrets"),G=(0,vt.Cz)(n,"rooms"),Y=(0,a.useState)({}),q=(0,o.Z)(Y,2),K=q[0],Q=q[1];if(!w)return null;var X=Object.keys(K),$=Z.every((function(e){return(0,wt.xW)(e,k[e],y[e])})),J=!X.length||X.every((function(e){var t=k[e].selection;return K[e].every((function(n){return(0,wt.xW)(n,k[e][n],y[e].fields[t][n])}))})),ee=g&&$&&J,te=(0,u.Gn)(z.Sr,{spaceSlug:_,settingsTab:z.bK}),ne=function(){var e=(0,C.Z)(P().mark((function e(){var t;return P().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=Kt(Kt(Kt({alarms:g,integrationID:l},O?{name:O}:{}),null!==T&&void 0!==T&&T.length?{Rooms:T}:{}),{},{secrets:k}),"new"!==n){e.next=7;break}return e.next=5,(0,Et.Y0)(R,t);case 5:e.next=9;break;case 7:return e.next=9,(0,Et.IU)(R,n,t);case 9:M({header:"new"===n?"Configuration created successfully!":"Configuration updated successfully!"}),I(),s(),F(te),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),N(e.t0);case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(){return e.apply(this,arguments)}}();return a.createElement(d.Modal,{onEsc:s},a.createElement(Ct.hz,{"data-testid":m["data-testid"]||Qt},a.createElement(d.ModalHeader,{border:{side:"bottom",color:"disabled"},column:!0,"data-testid":"".concat(Qt,"-header"),gap:.5,padding:[6,4,3]},a.createElement(d.Flex,{alignItems:"center","data-testid":"".concat(Qt,"-headerMain")},a.createElement(d.Flex,{"data-testid":"".concat(Qt,"-titleContainer"),gap:1},a.createElement(d.Icon,(0,i.Z)({"data-testid":"".concat(Qt,"-titleIcon")},yt.aU[x]||{})),a.createElement(d.H3,{"data-testid":"".concat(Qt,"-title")},f)),s&&a.createElement(Ct.A3,{"data-ga":j("close-modal"),"data-testid":"".concat(Qt,"-close"),onClose:s})),a.createElement(d.TextSmall,{as:d.Box,"data-testid":"".concat(Qt,"-description")},b,"\xa0",a.createElement(Oe.Z,{Component:d.TextSmall,"data-ga":j("click-docs"),"data-testid":"".concat(Qt,"-docsLink"),href:h,target:"_blank",whiteSpace:"nowrap"},"Learn how to configure it."))),a.createElement(d.ModalBody,{"data-testid":"".concat(Qt,"-body"),overflow:{vertical:"auto"},padding:[0]},a.createElement(Ct.QD,{gap:2,"data-testid":"".concat(Qt,"-standardFields"),hasBorder:!0},a.createElement(d.Text,{"data-testid":"".concat(Qt,"-standardFields-header")},"Notification settings"),a.createElement(d.Flex,{column:!0,"data-testid":"".concat(Qt,"-standardFields-body"),gap:3},a.createElement(zt.Z,{component:"input","data-ga":j("configuration-name-input"),"data-testid":"".concat(Qt,"-configurationName"),onChange:V,placeholder:"i.e All alerts from All nodes",title:"Configuration name",value:O}),a.createElement(zt.Z,{component:"select","data-ga":j("rooms-select"),"data-testid":"".concat(Qt,"-rooms"),isMulti:!0,onChange:function(e){var t;if(1!==L.length){if(0===e.length)return G([]),void H([]);if(e.length===L.length||null===(t=e[e.length-1])||void 0===t||!t.value)return G([]),void H([yt.k_]);var n=e.map((function(e){return e.value})).filter(Boolean),a=e.length>1?e.filter((function(e){return e.value})):e;G(n),H(a)}},options:B,placeholder:"Select rooms",title:"Rooms",value:S}),a.createElement(zt.Z,{component:"select","data-ga":j("notification-select"),"data-testid":"".concat(Qt,"-notifications"),isRequired:!0,onChange:function(e){var t=e.value;U(t)},options:Object.values(yt.Nq),placeholder:"Select notifications",title:"Notifications",value:yt.Nq[g]}))),a.createElement(Ct.QD,{gap:2,"data-testid":"".concat(Qt,"-dynamicFields"),hasBorder:!0},a.createElement(d.Text,{"data-testid":"".concat(Qt,"-dynamicFields-header")},"Integration configuration"),a.createElement(d.Flex,{column:!0,"data-testid":"".concat(Qt,"-dynamicFields-body"),gap:3},Object.values(y).map((function(e){var t=e.id,n=e.getValue,r=e.onChange,l=(0,c.Z)(e,Yt);return a.createElement(zt.Z,(0,i.Z)({"data-ga":j("".concat(t,"-").concat(l.component)),"data-testid":"".concat(Qt,"-").concat(t),getDataGa:j,key:t,id:t,onChange:null===r||void 0===r?void 0:r({id:t,setRequiredSubsets:Q,setSecrets:W}),secrets:k,setSecrets:W,value:null===n||void 0===n?void 0:n({id:t,secrets:k})},l))}))))),a.createElement(Ct.QD,{alignItems:"end","data-testid":"".concat(Qt,"-footer"),justifyContent:"center"},a.createElement(d.Button,{"data-ga":j("new"===n?"create-click":"edit-click"),"data-testid":"".concat(Qt,"-confirmButton"),disabled:!ee,label:"OK",onClick:ne,textTransform:"uppercase"}))))},$t=["data-testid"],Jt=function(e){var t=e["data-testid"],n=void 0===t?"channelList":t,r=(0,c.Z)(e,$t),l=Wt(),o=l.bulkActions,s=l.channelData,u=l.currentChannelId,m=l.columns,p=l.dataGa,g=l.onFilter,f=l.onModalClose,b=l.rowActions,h=l.search,E=l.setSearch;return a.createElement(_.ZP,{tab:"Notifications::Channels"},a.createElement(d.Flex,(0,i.Z)({column:!0,"data-testid":n,gap:4,height:"100%",width:"100%",margin:[3,0]},r),a.createElement(d.Table,{bulkActions:o,data:s,dataColumns:m,dataGa:p,globalFilter:h,globalFilterFn:g,onSearch:E,rowActions:b,testPrefix:"channelList",testPrefixCallback:function(e){return e.name}}),!!u&&a.createElement(Xt,{"data-testid":"editChannelModal",id:u,onClose:f})))},en=n(58591);function tn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function nn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tn(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var an=(0,s.Z)((function(){return n.e(597).then(n.bind(n,95384))}),"SilencingRules"),rn={side:"top",type:"solid",size:"1px",color:"border"},ln=function(){var e=(0,en.m$)().notificationsActiveTab,t=void 0===e?0:e,n=(0,a.useCallback)((function(e){var t=(0,en.m$)();(0,en.xs)(nn(nn({},t),{},{notificationsActiveTab:e}))}),[]);return a.createElement(a.Fragment,null,a.createElement(d.Flex,{padding:[0,0,0,4]},a.createElement(d.H3,null,"Alerts & Notifications")),a.createElement(d.Tabs,{selected:parseInt(t,10),onChange:n,height:"calc(100% - 44px)",margin:[4,0,0,0]},a.createElement(d.Tab,{"data-testid":"spaceSettings-notifications-methods-tab","data-ga":"manage-space::click-tab::notifications-methods-tab",label:a.createElement(d.Text,null,"Notification Methods")},a.createElement(d.Flex,{padding:[2,4],border:rn,flex:"grow"},a.createElement(Jt,null))),a.createElement(d.Tab,{"data-testid":"spaceSettings-notifications-silencing-rules-tab","data-ga":"manage-space::click-tab::notifications-silencing-rules-tab",label:a.createElement(d.Text,null,"Notification Silencing Rules")},a.createElement(d.Flex,{border:rn,flex:"grow"},a.createElement(a.Suspense,null,a.createElement(an,null))))))},on=n(79655),cn=n(78266),sn=n(80959),un=n(27308),mn=["available","data-testid","description","docsLink","fields","id","internal","kind","kindLabel","slug","required","title"];function dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var gn=function(e){var t=e.available,n=e["data-testid"],r=void 0===n?"card":n,l=e.description,s=e.docsLink,u=e.fields,m=e.id,p=e.internal,g=e.kind,f=e.kindLabel,b=e.slug,E=e.required,v=e.title,x=(0,c.Z)(e,mn),w=yt.aU[b]||{},C=(0,vt.h3)("new"),O=(0,vt.Cz)("new"),P=(0,h.gI)("channel:Manage"),Z=(0,y.Z)(!1),T=(0,o.Z)(Z,4),S=T[0],k=T[2],I=T[3],j=(0,a.useCallback)((function(){O(pn(pn({},Mt.C),{},{title:v,description:l,docsLink:s,fields:u,integration:b,loading:!1,loaded:!0,required:E,secrets:(0,wt.A_)(u,E)})),k()}),[l,s,u,b,E]);return a.createElement(a.Fragment,null,a.createElement(d.Flex,(0,i.Z)({background:"elementBackground",column:!0,"data-testid":r,justifyContent:"between",flex:!1,height:37,padding:[3,2,2,3],margin:[0,0,4,0],position:"relative",overflow:"hidden",round:.5,width:75},x),a.createElement(Ct.zT,(0,i.Z)({"data-testid":"".concat(r,"-blurredIcon")},w)),a.createElement(d.Flex,{column:!0,"data-testid":"".concat(r,"-details"),gap:3,margin:[0,0,3,0]},a.createElement(d.Flex,{"data-testid":"".concat(r,"-header"),justifyContent:"between"},a.createElement(d.Flex,{alignItems:"center","data-testid":"".concat(r,"-titleContainer"),gap:1},a.createElement(d.Icon,(0,i.Z)({"data-testid":"".concat(r,"-icon")},w)),a.createElement(d.Text,{"data-testid":"".concat(r,"-title")},v)),!p&&t&&a.createElement(Xe.Z,{align:"bottom",content:P?"":yt.Ue,plain:!0},a.createElement(d.Box,null,a.createElement(Ct.nO,{"data-ga":"manage-integration-".concat(b,"::click-add::notification-integrations-tab"),"data-testid":"".concat(r,"-button"),disabled:!P,label:"Add",onClick:j}))),!p&&!t&&a.createElement(un.Z,{"data-ga":"manage-integration-".concat(b,"::click-plan-badge::notification-integrations-tab")})),a.createElement(d.TextSmall,{color:"textDescription","data-testid":"".concat(r,"-description")},l," ",s&&a.createElement(Oe.Z,{Component:Ct.bb,"data-ga":"manage-integration-".concat(b,"::click-docs::notification-integrations-tab"),"data-testid":"".concat(r,"-docsLink"),href:s,target:"_blank",whiteSpace:"nowrap"},"Learn more."))),a.createElement(Xe.Z,{align:"top",content:yt.XK[g].tooltip,"data-testid":"".concat(r,"-kindContainer"),plain:!0},a.createElement(d.Flex,{alignItems:"end",alignSelf:"end","data-testid":"".concat(r,"-kindContainer"),gap:1},a.createElement(d.Icon,{color:"textLite","data-testid":"".concat(r,"-kindIcon"),height:"16px",name:yt.XK[g].icon,width:"16px"}),a.createElement(d.TextSmall,{color:"textLite","data-testid":"".concat(r,"-kind")},f)))),S&&a.createElement(Xt,{"data-testid":"createChannelModal",integrationId:m,onClose:function(){I(),C()}}))},fn=["data-testid","integrations","title"],bn=function(e){var t=e["data-testid"],n=void 0===t?"group":t,r=e.integrations,l=e.title,o=(0,c.Z)(e,fn);return r.length?a.createElement(d.Flex,(0,i.Z)({column:!0,"data-testid":n,gap:2,position:"relative"},o),a.createElement(d.TextBig,{color:"textDescription","data-testid":"".concat(n,"-title")},l),a.createElement(d.Flex,{flexWrap:!0,"data-testid":"".concat(n,"-integrations"),gap:4},r.map((function(e){return a.createElement(gn,(0,i.Z)({"data-testid":"".concat(e.slug,"Card"),key:e.slug},e))})))):null},hn=n(69414);function En(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function vn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?En(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):En(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yn=function(e){var t=(0,vt.R1)(e);(0,Nt.Z)((function(){return{enabled:!!e,fetch:function(){return(0,Et.h3)(e)},onFail:function(e){return t(vn(vn({},hn.E),{},{error:e.message}))},onSettle:function(){return t({loading:!1,loaded:!0})},onSuccess:function(e){t(vn(vn({},hn.E),e))}}}),[e])},xn=["data-testid"],wn=function(e){var t=e["data-testid"],n=void 0===t?"integrations":t,r=(0,c.Z)(e,xn),l=(0,v.th)(),s=(0,v.uk)();yn(l);var m=(0,vt.ry)(l),p=m.available,g=m.error,f=m.loaded,b=m.unavailable,h=(0,a.useState)([]),E=(0,o.Z)(h,2),y=E[0],x=E[1],w=(0,a.useState)([]),C=(0,o.Z)(w,2),O=C[0],P=C[1],Z=(0,a.useState)(""),T=(0,o.Z)(Z,2),S=T[0],k=T[1];if(!f)return a.createElement(cn.Z,{"data-testid":"".concat(n,"-loader"),title:"Loading services..."});if(g)return a.createElement(sn.Z,{"data-testid":"".concat(n,"-error"),message:g,title:"Services of ".concat(s," are currently unavailable")});var I=(0,u.Gn)(z.Sr,{spaceSlug:s,settingsTab:z.bK});return a.createElement(_.ZP,{tab:"Notifications::Integrations"},a.createElement(d.Flex,(0,i.Z)({column:!0,"data-testid":n},r,{padding:[0,4]}),a.createElement(d.Flex,{border:{side:"bottom",color:"placeholder"},"data-testid":"".concat(n,"-header"),margin:[0,0,4,0],padding:[0,0,4,0],width:"100%"},a.createElement(Oe.Z,{as:on.rU,Component:Ct.Ce,"data-ga":"manage-integrations::click-back::notification-integrations-tab","data-testid":"".concat(n,"-backLink"),to:I},a.createElement(d.Icon,{"data-testid":"".concat(n,"-backIcon"),name:"arrow_left"}),a.createElement(d.H3,{"data-testid":"".concat(n,"-title")},z.fV[z.Q$]))),a.createElement(d.Flex,{column:!0,"data-testid":"".concat(n,"-content"),gap:4},a.createElement(d.Box,{as:d.SearchInput,"data-ga":"manage-integrations::search::notification-integrations-tab","data-testid":"".concat(n,"-search"),iconLeft:a.createElement(d.Icon,{name:"magnify",color:"textLite"}),onChange:function(e){k(e),x((0,wt.uf)(p,e)),P((0,wt.uf)(b,e))},placeholder:"Search service",size:"small",width:{max:49.5}}),a.createElement(d.Flex,{column:!0,"data-testid":"".concat(n,"-groups")},a.createElement(bn,{"data-testid":"integrationGroupAvailable",integrations:S?y:p,title:"Available"}),a.createElement(bn,{"data-testid":"integrationGroupUnavailable",integrations:S?O:b,title:"Unavailable"})))))},Cn=function(){return a.createElement(r.Z5,null,a.createElement(r.AW,{path:"/",element:a.createElement(ln,null)}),a.createElement(r.AW,{path:"/".concat(z.Q$),element:a.createElement(wn,null)}))},On=n(46585),Pn=n(78710),Zn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[(0,d.useInputValue)({maxChars:20,value:e.name||""})||{},(0,d.useInputValue)({maxChars:50,value:e.description||""})||{}]},Tn=n(14809),Sn=n(54131),kn=n(15418),In=["nameInput","descriptionInput"],jn=function(e){var t=e.nameInput,n=e.descriptionInput,r=(0,c.Z)(e,In),l=(0,o.Z)(t,4),s=l[0],u=l[1],m=l[2],p=l[3],g=(0,o.Z)(n,4),f=g[0],b=g[1],h=g[2],E=g[3],v=(0,a.useMemo)((function(){return(0,Sn.x3)(s)}),[s]),y=(0,a.useMemo)((function(){return(0,Sn.uB)(f)}),[f]);return a.createElement(d.Flex,(0,i.Z)({column:!0,gap:4},r),a.createElement(kn.Z,{Component:d.TextInput,permission:"space:UpdateMeta",label:"Name",value:s,onChange:u,error:Sn.Qj[v],isDirty:p,instantFeedback:"all",fieldIndicator:m,"data-testid":"textInputs-spaceName",containerStyles:{width:{base:150}}}),a.createElement(kn.Z,{Component:d.TextInput,permission:"space:UpdateMeta",label:"Description",value:f,onChange:b,error:Sn.Qj[y],isDirty:E,instantFeedback:"all",fieldIndicator:h,"data-testid":"textInputs-spaceDescription",containerStyles:{width:{base:150}}}))},Fn=n(57387),Dn=["id"],An=function(e){var t=e.id,n=(0,c.Z)(e,Dn);return a.createElement(d.Flex,(0,i.Z)({column:!0,gap:1},n),a.createElement(d.Text,{strong:!0},"Space Id"),a.createElement(Fn.ZP,{confirmationText:"Space ID copied to your clipboard."},t))},Mn=n(72671),Nn=n(20428),Bn=["nameInput","descriptionInput","onClose"],Ln=function(e){var t=e.nameInput,n=e.descriptionInput,r=e.onClose,l=(0,c.Z)(e,Bn),s=(0,v.OS)(),u=(0,Nn.Z)(s.id),m=(0,a.useState)(!1),p=(0,o.Z)(m,2),g=p[0],f=p[1],b=(0,o.Z)(t,1)[0],h=(0,o.Z)(n,1)[0],E=function(){r(),f(!1)},y=function(){return f(!1)},x=(0,a.useCallback)((function(){f(!0),u({name:b,description:h},{onSuccess:E,onFail:y})}),[b,h]),w=(0,a.useMemo)((function(){var e=(0,Sn.x3)(b),t=(0,Sn.uB)(h);return!!(g||e||t)||s.name===b&&(s.description===h||!s.description&&!h)}),[s,b,h,g]);return a.createElement(d.Button,(0,i.Z)({label:"SAVE",onClick:x,isLoading:g,disabled:w,"data-testid":"saveSpace-button"},l))},Rn=["onClose"],_n=(0,a.memo)((function(e){var t=e.onClose,n=(0,c.Z)(e,Rn),r=(0,v.OS)(),l=(0,v.GM)("ids"),s=(0,y.Z)(),u=(0,o.Z)(s,4),m=u[0],p=u[2],g=u[3],f=Zn({name:r.name,description:r.description}),b=(0,o.Z)(f,2),h=b[0],E=b[1];if(!r.id)return null;var x=1===l.filter((function(e){return!(0,Pn.Ly)(e)})).length;return a.createElement(_.ZP,{tab:"Info"},a.createElement(d.Flex,(0,i.Z)({column:!0,"data-testid":"manageSpace",flex:"grow",justifyContent:"between",padding:[0,0,6,0],width:{max:150}},n),a.createElement(d.Flex,{column:!0,"data-testid":"manageSpace-settings"},a.createElement(d.H3,{margin:[0,0,4,0]},"Info"),a.createElement(d.Flex,{column:!0,gap:4},a.createElement(jn,{"data-testid":"manageSpace-nameInputs",nameInput:h,descriptionInput:E}),a.createElement(An,{"data-testid":"manageSpace-spaceIdInput",id:r.id,width:{base:150}}),a.createElement(d.TextInput,{label:"Your role in space",value:(0,Qe.fm)(r.roleInSpace),disabled:!0,containerStyles:{width:{base:150}}}),a.createElement(d.TextInput,{label:"Plan",value:(0,Qe.db)(r.planName),disabled:!0,containerStyles:{width:{base:150}}}))),a.createElement(d.Flex,{"data-testid":"manageSpace-actions",justifyContent:"between",alignItems:"center"},a.createElement(d.Flex,{"data-testid":"manageSpace-deleteLeaveActions",gap:4},a.createElement(Xe.Z,{align:"top",content:x&&On.T$.leave,isBasic:!0,stretch:"align"},a.createElement(d.Flex,{alignItems:"center"},a.createElement(d.Button,{"data-ga":"manage-space-tab::click-leave-space::manage-space-modal","data-testid":"manageSpace-leave",disabled:x,icon:"switch_off",flavour:"borderless",label:"Leave space",neutral:!0,padding:[0],width:"fit-content",onClick:p}))),a.createElement(Mn.Z,{"data-testid":"manageSpace-delete",id:r.id,isLastSpace:x,name:r.name,onClose:t})),a.createElement(Ln,{"data-testid":"manageSpace-save",nameInput:h,descriptionInput:E,onClose:t}))),m&&a.createElement(Tn.Z,{id:r.id,name:r.name,onClose:g}))}),(function(){return!0})),Un=n(51091);function Vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vn(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Wn=function(){var e=(0,r.s0)(),t=(0,v.th)(),n=(0,r.bS)(z.xN),l=(0,r.bS)(z.Sr),o=(n||l||{}).params,i=o.spaceSlug,c=void 0===i?"":i,s=o.settingsTab,m=void 0===s?"":s,d=o.settingsSubTab,p=void 0===d?"":d,g=(0,v.OS)("name"),f=(0,k.HM)(t,p),b=(0,k.tE)(f,"name"),h=z.fV[m],E=(0,a.useCallback)((function(){e((0,u.Gn)(z.Sr,{spaceSlug:c,settingsTab:m}))}),[c,m]),y=(0,a.useMemo)((function(){var e=[{name:"Manage Space",isDisabled:!0},{name:g,isDisabled:!0},Hn({name:h},!!p&&{onClick:E})];return p&&e.push({name:h===z.fV[z.eq]?b:z.fV[p]||p}),e}),[E,b,g,h,p]);return a.createElement(Un.Z,{isBig:!0,items:y,showBackButton:!1,testid:"manageSpace"})},zn=n(22648),Gn=n(36285),Yn=(n(17727),n(58504)),qn=function(e){return a.createElement(d.Box,(0,i.Z)({as:"hr",height:"100%",sx:{borderWidth:"0px 0px 0px 1px",borderColor:"borderSecondary",borderStyle:"solid"}},e))},Kn=function(){return a.createElement(qn,{height:"1px",width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}})},Qn=n(38314),Xn=function(e){var t=e.currentPlan,n=e.billingEmail,r=e.paymentMethod,l=e.businessName,i=e.vatNo,c=e.billingAddress,s=(0,Gn.SH)(),u=(0,o.Z)(s,2),m=u[0],p=u[1],g=!!t.billingEmail&&!p,f=n||"",b=f?"":"Email is required",h=null!==r&&void 0!==r&&r.id?"**** ".concat(null===r||void 0===r?void 0:r.id):"",E=h?"":"Payment method is required",v=c?"":"Billing address is required";return a.createElement(d.Flex,{column:!0,gap:3},a.createElement(d.Flex,{gap:4},a.createElement(d.TextInput,{value:f,label:"Billing email",placeholder:"Not specified",instantFeedback:"all",isDirty:!!b,error:b,disabled:!0}),a.createElement(d.TextInput,{value:h,label:"Default payment method",placeholder:"Not specified",instantFeedback:"all",isDirty:!!E,error:E,disabled:!0})),i&&a.createElement(d.Flex,{gap:4},a.createElement(d.TextInput,{value:l||"",label:"Business name",placeholder:"Not specified",disabled:!0}),a.createElement(d.TextInput,{value:i,label:"VAT number",placeholder:"Not specified",disabled:!0})),a.createElement(d.Flex,null,a.createElement(d.TextInput,{value:(0,Qn.GA)(c)||"",label:"Billing address",placeholder:"Not specified",isDirty:!!v,error:v,disabled:!0})),a.createElement(Oe.Z,{Component:d.Flex,cursor:g?"pointer":"default",disabled:!g,onClick:m,alignItems:"center",gap:1,"data-ga":"billing-options::click::billing"},a.createElement("span",null,"Change billing information and payment method"),a.createElement(d.Icon,{name:"nav_arrow_goto",width:"12px",height:"12px"})))},$n=function(e){var t=e.onReset;return a.createElement(d.Box,{as:d.Icon,name:"close_circle",onClick:t,cursor:"pointer",width:3,height:3,color:"border",position:"absolute",left:"2px"})},Jn=function(e){var t=e.promotionCode,n=e.onReset;return a.createElement(d.Flex,{width:"100%"},a.createElement(d.Pill,{padding:[0],flavour:"neutral",hollow:!0},a.createElement(d.Flex,{position:"relative",gap:2,alignItems:"center",padding:[1,2,1,5]},a.createElement($n,{onReset:n}),a.createElement(d.Text,null,t))))},ea=function(e){var t=e.promotionCode,n=e.onApply,r=e.error,l=(0,a.useState)(r?t:""),i=(0,o.Z)(l,2),c=i[0],s=i[1],u=function(){s(""),n("")};return a.createElement(d.Flex,{column:!0,gap:1},a.createElement(d.Text,{strong:!0},"Promotion code"),t&&!r?a.createElement(Jn,{promotionCode:t,onReset:u}):a.createElement(d.Flex,{column:!0,gap:1},a.createElement(d.Flex,{gap:3,alignItems:"baseline"},a.createElement(d.TextInput,{value:c,onChange:function(e){return s(e.target.value)},placeholder:"Promotion code"}),r?a.createElement(d.Button,{label:"Clear",flavour:"hollow",onClick:u,padding:[3,4],disabled:!c}):a.createElement(d.Button,{label:"Apply",onClick:function(){return n(c)},padding:[3,4],disabled:!c})),r&&a.createElement(d.Text,{color:"error"},r)))},ta=function(e){var t=e.needsCommitment,n=e.commitment,r=e.handleCommitmentChange;return t&&a.createElement(d.Flex,{column:!0,gap:2},a.createElement(d.Flex,{gap:4,alignItems:"baseline"},a.createElement(d.Text,{strong:!0,style:{whiteSpace:"nowrap"}},"Committed Nodes"),a.createElement(d.TextInput,{onChange:r,value:n,placeholder:"i.e. 14",type:"number",min:1})),a.createElement(d.TextSmall,null,"Nodes that you'll have a discount of 25% on the original cost per node of the plan. This amount will be part of your annual prepayment."))},na=n(50308),aa=n.n(na),ra=n(99826),la=["currentPlan"],oa={earlyBird:function(){return a.createElement(d.Text,null,"You are moving from ",a.createElement(d.Text,{strong:!0},"Early Bird")," plan to another plan, you won't be able to come back to this. The ",a.createElement(d.Text,{strong:!0},"Community")," free plan will be there if you wish to cancel but this doesn't allow you to invite or change users using the Member role.")},communityV1:function(e){var t=e.onCtaClick,n=void 0===t?aa():t,r=(0,ra.Z)().url;return a.createElement(d.Text,null,"You are moving from ",a.createElement(d.Text,{strong:!0},"Community (2023.02)")," plan to another plan, you won't be able to come back to this. The new ",a.createElement(d.Text,{strong:!0},"Community (2023.11)")," free plan will be there if you wish to cancel but this will have new limitation: max of 5 nodes active and max of 1 custom dashboard. See full details on the"," ",a.createElement(Oe.Z,{as:on.rU,onClick:n,to:r,disabled:!r},a.createElement(d.Text,{color:"primary"},"View plans page")),".")},pro:function(){return a.createElement(d.Text,null,"You are moving from ",a.createElement(d.Text,{strong:!0},"Pro")," plan to another plan by yourself, if you proceed we won't be able to migrate you to the Business plan with your current pricing conditions as communicated.")}},ia=function(e){var t=e.currentPlan,n=(0,c.Z)(e,la),r=oa[function(e){return"earlyBird"==e.slug?"earlyBird":"free"==e.slug&&"2023.02"==e.version?"communityV1":"pro"==e.slug?"pro":null}(t)]||null;return r&&a.createElement(a.Fragment,null,a.createElement(qn,{height:"1px",width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}}),a.createElement(d.Flex,{gap:3},a.createElement(d.Icon,{size:"large",color:"warning",name:"warning_triangle"}),a.createElement(r,n)))},ca=function(e){return"earlyBird"===(null===e||void 0===e?void 0:e.slug)?"earlyBird":e&&e.slug&&"free"!==e.slug?"".concat(e.slug,"-").concat(e.interval):"free"},sa=(n(54678),m.default.div.withConfig({displayName:"withTableWrapper__TableWrapper",componentId:"sc-drcfxi-0"})(["margin-top:30px;"])),ua=function(e){return function(t){return a.createElement(sa,null,a.createElement(e,t))}},ma=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function da(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function pa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?da(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):da(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ga={size:50,minSize:50,maxSize:100},fa=function(e){return function(){return a.createElement(d.Flex,{width:"100%",justifyContent:"end"},e)}},ba=function(e){var t=e.getValue;return a.createElement(d.Flex,{width:"100%",justifyContent:"end"},t())},ha=[pa(pa({id:"name",accessor:"name",header:""},ga),{},{fullWidth:!0}),pa({id:"price",accessor:"price",header:fa("Price"),cell:ba},ga),pa({id:"qty",accessor:"qty",header:fa("Qty"),cell:ba},ga),pa({id:"month",accessor:"month",header:fa("Month"),cell:ba},ga),pa({id:"total",accessor:"total",header:fa("Total"),cell:ba},ga)],Ea=function(e){return a.createElement(d.Flex,(0,i.Z)({gap:3},e),a.createElement(d.Icon,{size:"large",color:"warning",name:"warning_triangle"}),a.createElement(d.Text,null,"No immediate charges are applicable to this plan subscription. On-demand usage charges will be applied based on your node period count."))},va=ua(d.Table),ya=function(e){var t=e.needsCommitment,n=e.price,r=e.spaceTotal,l=e.commitment,o=e.currentCommitment,i=e.onlyCommitment,c=e.balance,s=e.nodesTotal,u=e.zeroSubscriptionTotal,m=e.checkoutIsDisabled,p=(0,Qn.WT)(l,n.pricing.primary.amountPerNode,i?0:n.pricing.primary.amountFlat,c.amount,o),g=((null===n||void 0===n?void 0:n.pricing)||{}).primary,f=(null===g||void 0===g?void 0:g.monthlyDiscountPercentagePerNode)||0,b=parseFloat(s+r),h=parseFloat(b*f),E=parseFloat(b-h);return a.createElement(a.Fragment,null,u?m?null:a.createElement(Ea,null):a.createElement(a.Fragment,null,t&&a.createElement(a.Fragment,null,a.createElement(d.Flex,{justifyContent:"between"},a.createElement(d.Text,null,"Subscription Total"),a.createElement(d.Text,null,ma.format(b))),a.createElement(d.Flex,{justifyContent:"between"},a.createElement(d.Text,{color:"primary"},"Discount (",100*f,"%)"),a.createElement(d.Text,{color:"primary"},"- ",ma.format(h)))),a.createElement(d.Flex,{justifyContent:"between"},a.createElement(d.Text,null,"Total"),a.createElement(d.Text,null,ma.format(E))),!!c.amount&&a.createElement(d.Flex,{justifyContent:"between"},a.createElement(d.Text,null,"Credit amount"),a.createElement(d.Text,null,"- ",ma.format(p))),a.createElement(Kn,null),a.createElement(d.Flex,null,a.createElement(d.TextMicro,null,"Additional taxes may be applicable"))),a.createElement(d.Flex,{justifyContent:"between"},a.createElement(d.H0,{strong:!0},"Total payable"),a.createElement(d.H0,{strong:!0,"data-testid":"totalPayableAmountCheckout"},ma.format((0,Qn.NU)(o,l,n.pricing.primary.amountPerNode,i?0:n.pricing.primary.amountFlat,p)))))},xa=function(e){var t=e.price,n=e.needsCommitment,r=e.currentCommitment,l=e.onlyCommitment,o=e.balance,i=e.spaceTotal,c=e.amountPerNodePerMonth,s=e.amountPerSpacePerMonth,u=e.commitment,m=e.nodesTotal,d=e.months,p=e.checkoutIsDisabled,g=(0,a.useMemo)((function(){return 0==parseFloat(m+i)}),[m,i]),f=(0,a.useMemo)((function(){var e=!isNaN(i)&&i>0?{id:"space",name:"Space",price:ma.format(s),qty:1,month:d,total:ma.format(i)}:null;return n?[isNaN(m)?null:{id:"nodes",name:"Nodes",price:ma.format(c),qty:u||0,month:d,total:ma.format(m)},e].filter(Boolean):[e]}),[n,s,i,m,d]);return a.createElement(a.Fragment,null,!g&&a.createElement(a.Fragment,null,a.createElement(va,{dataColumns:ha,data:f}),a.createElement(Kn,null)),a.createElement(ya,{needsCommitment:n,price:t,spaceTotal:i,commitment:u,currentCommitment:r,onlyCommitment:l,balance:o,nodesTotal:m,zeroSubscriptionTotal:g,checkoutIsDisabled:p}))},wa=n(93433);n(23157);function Ca(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Oa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ca(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ca(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pa,Za=ua(d.Table),Ta=function(e){var t=e.lineItems;return a.createElement(a.Fragment,null,t.map((function(e){var t,n,r=(n=e).description?n.description.startsWith("Discount")?{color:"primary"}:n.description.startsWith("VAT")?{color:"textLite"}:{}:{},l=e.isInfo?d.TextSmall:d.Text;return a.createElement(d.Flex,{key:e.description,justifyContent:"between"},a.createElement(l,r,e.description),a.createElement(l,r,ma.format(null===(t=e.total)||void 0===t?void 0:t.amount)))})))},Sa=(Pa=function(e){var t=e.lineItems;return a.createElement(d.Flex,{justifyContent:"between",margin:[4,0,0,0]},a.createElement(d.H0,{strong:!0},"Total payable"),a.createElement(d.H0,{strong:!0,"data-testid":"totalPayableAmountPreview"},ma.format(t.totalPayable.total.amount)))},function(e){var t;return e.lineItems.totalPayable?null!==(t=e.lineItems.info)&&void 0!==t&&t.length?a.createElement(d.Flex,{column:!0,gap:1},a.createElement(Pa,e),a.createElement(Ta,{lineItems:e.lineItems.info})):a.createElement(Pa,e):null}),ka=function(e){var t=e.previewData,n=e.lineItems,r=e.agree,l=e.toggleAgree,o=e.zeroPreviewSubscriptionTotal,i=!(null===t||void 0===t||!t.paymentMethod)&&!(null===t||void 0===t||!t.billingAddress);return a.createElement(a.Fragment,null,a.createElement(Kn,null),o&&a.createElement(Ea,{padding:[0,0,2,0]}),a.createElement(d.Flex,{gap:3},a.createElement(d.Checkbox,{checked:r,onChange:l,disabled:!i}),a.createElement(d.Text,null,"I agree to Netdata Inc's"," ",a.createElement(Oe.Z,{href:"https://www.netdata.cloud/service-terms/",rel:"noopener noreferrer",target:"_blank"},"Terms of Service")," ","and"," ",a.createElement(Oe.Z,{href:"https://netdata.cloud/privacy",rel:"noopener noreferer",target:"_blank"},"Privacy Policy"))),a.createElement(Sa,{lineItems:n}))},Ia=function(e){var t=e.lineItems;return a.createElement(a.Fragment,null,a.createElement(Za,{dataColumns:ha,data:t.table}),a.createElement(Kn,null),a.createElement(Ta,{lineItems:t.footer}))},ja=n(62195),Fa=n(60511),Da=function(e){var t=e.title,n=e.onConfirm,r=e.onClose,l=(0,Be.Z)(),o=l.sendButtonClickedLog,i=l.isReady,c=(0,Fa.Z)().onTrial,s=(0,a.useCallback)((function(){n(),r(),o({description:"confirm-billing-plan-change"},!0)}),[o,i]),u=(0,a.useCallback)((function(){r(),o({description:"close-billing-plan-change-confirmation-dialog"},!0)}),[o,i]),m="Community"==t,p=m?"Cancellation":"Downgrading";return c?a.createElement(ja.Z,{onDecline:u}):a.createElement(d.ConfirmationDialog,{confirmLabel:"Yes","data-ga":"downgrade-dialog","data-testid":"downgradeDialog",handleConfirm:s,handleDecline:u,message:a.createElement(d.Flex,{column:!0,gap:2},a.createElement(d.Text,null,"Are you sure you want to ",a.createElement(d.Text,{strong:!0},"move to the ",t," plan")," and cancel your current plan?"),m&&a.createElement(d.Text,null,"Upon cancellation,"," ",a.createElement(d.Text,{strong:!0},"a credit of the value related to the unused period will be credited to your Netdata account.")," ","The credit will be available for you to use on future plan subscriptions with us."),a.createElement(d.Text,null,"For the next 24 hours, you will be able to use all your current notification method configurations."," ",a.createElement(d.Text,{strong:!0},"After 24 hours, any of the notification method configurations that aren't available on your space's plan will be automatically disabled.")),a.createElement(d.Text,null,p," might affect your Space users. Please check what roles are available on the"," ",a.createElement(Oe.Z,{href:"https://learn.netdata.cloud/docs/nightly/concepts/netdata-plans#areas-impacted-by-plans",rel:"noopener noreferrer",strong:!0,target:"_blank"},t," plan"),"."," ",a.createElement(d.Text,{strong:!0},"Users with unavailable roles on the ",t," plan will immediately have restricted access to the Space.")),a.createElement(d.Text,null,"Do you wish to proceed?")),title:"Go to ".concat(t," plan?")})},Aa=n(49489),Ma=["currentPlan","billingEmail","paymentMethod"],Na=function(e){var t=e.currentPlan,n=void 0===t?{}:t,r=e.billingEmail,l=e.paymentMethod,s=(0,c.Z)(e,Ma),u=(0,Gn.SH)(),m=(0,o.Z)(u,2),p=m[0],g=m[1],f=!!n.billingEmail&&!g;return r&&l?null:a.createElement(d.Flex,(0,i.Z)({gap:3,alignItems:"center"},s),a.createElement(d.Icon,{size:"large",color:"warning",name:"warning_triangle"}),a.createElement(d.Flex,{column:!0,gap:1},a.createElement(d.Text,null,"You can't proceed to checkout without having provided a"," ",a.createElement(d.Text,{strong:!0},"payment method")," and a ",a.createElement(d.Text,{strong:!0},"billing address"),"."),a.createElement(Oe.Z,{cursor:f?"pointer":"default",disabled:!f,onClick:p,gap:1,"data-ga":"billing-options::click::billing"},"Please go to the billing portal and fill a payment method")))},Ba=["title","isDowngrade","showProrations","checkoutOrUpdate"];function La(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Ra(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?La(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):La(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _a=function(e){return e?"::commited-".concat(e):""},Ua=(0,m.default)(d.Flex).withConfig({displayName:"checkoutTotals__CheckoutButtonWrapper",componentId:"sc-1q0h6ca-0"})(["background:",";padding:16px 0;position:sticky;bottom:0;z-index:20;"],(0,d.getColor)("mainBackground")),Va=(0,pe.Z)(d.Button),Ha=function(e){return function(t){var n=t.title,r=t.isDowngrade,l=t.showProrations,s=t.checkoutOrUpdate,u=(0,c.Z)(t,Ba),m=(0,y.Z)(),d=(0,o.Z)(m,4),p=d[0],g=d[2],f=d[3];return l&&r?a.createElement(a.Fragment,null,p&&a.createElement(Da,{title:n,onConfirm:s,onClose:f}),a.createElement(e,(0,i.Z)({onClick:g},u))):a.createElement(e,(0,i.Z)({onClick:s},u))}}((0,m.default)(Va).withConfig({displayName:"checkoutTotals__CheckoutButton",componentId:"sc-1q0h6ca-1"})(["flex:auto;"])),Wa=function(e){var t,n=e.title,r=e.slug,l=e.onClose,i=e.currentPlan,c=e.price,s=e.balance,u=e.commitment,m=e.currentCommitment,p=void 0===m?0:m,g=e.email,f=e.needsCommitment,b=e.onlyCommitment,h=e.previewData,E=e.loadingPreview,v=e.showProrations,x=e.promotionCode,w=function(e,t){var n,a;return((null===(n=Aa.Vc[t])||void 0===n?void 0:n.level)||0)<((null===(a=Aa.Vc[e])||void 0===a?void 0:a.level)||0)}(i.slug,r),C=(0,y.Z)(!1),O=(0,o.Z)(C,2),P=O[0],Z=O[1],T=v&&!P||!v&&!g||f&&(p===u||!u||u<1),S=(0,y.Z)(),k=(0,o.Z)(S,2),I=k[0],j=k[1],F=(0,Gn.eY)(),D=(0,Gn.Zn)(),A=v||i.billingEmail,M=A?D:F,N=(0,Be.Z)(),B=N.sendLog,L=N.isReady,R=(0,a.useCallback)((function(){j(),M(Ra(Ra({productId:c.id,email:(null===h||void 0===h?void 0:h.billingEmail)||g},f&&{commitment:u}),v&&x&&{promotionCode:x})).then((function(){l(),B({isSuccess:!0,details:M==A?"update-billing-plan":"checkout-billing-plan"},!0)})).catch((function(){B({isFailure:!0,details:M==A?"update-billing-plan":"checkout-billing-plan"},!0)})).finally(j)}),[B,L]),_=(null===c||void 0===c?void 0:c.pricing)||{},U=_.primary,V=_.secondary,H="year"===c.interval?12:1,W=(0,Qn.c1)(U,V),z=f?W*H*(u||0):0,G=(0,Qn.J3)(U),Y=G*H,q=(t=null===h||void 0===h?void 0:h.invoiceLineItems,(0,a.useMemo)((function(){if(null===t||void 0===t||!t.length)return null;var e=!1;return t.reduce((function(t,n){var a;return"Total payable"==n.description?(t.totalPayable=n,e=!0,t):(n.unitPrice?t.table=[].concat((0,wa.Z)(t.table),[{id:n.description,name:n.description,price:ma.format(n.unitPrice.amount),qty:n.quantity,month:n.month,total:null===(a=n.total)||void 0===a?void 0:a.amount}]):e?t.info=[].concat((0,wa.Z)(t.info),[Oa(Oa({},n),{},{isInfo:!0})]):t.footer=[].concat((0,wa.Z)(t.footer),[n]),t)}),{table:[],footer:[],info:[]})}),[t])),K=((null===q||void 0===q?void 0:q.footer)||[]).some((function(e){var t=e.description,n=e.total;return"Subscription Total"==t&&0==(null===n||void 0===n?void 0:n.amount)}));return a.createElement(d.Flex,{column:!0,gap:3},v?E||!q||K?null:a.createElement(Ia,{lineItems:q}):a.createElement(xa,{price:c,needsCommitment:f,currentCommitment:p,onlyCommitment:b,balance:s,spaceTotal:Y,amountPerNodePerMonth:W,amountPerSpacePerMonth:G,commitment:u,nodesTotal:z,months:H,checkoutIsDisabled:T}),a.createElement(Ua,{column:!0,gap:2},v&&!E&&q&&a.createElement(ka,{previewData:h,lineItems:q,agree:P,toggleAgree:Z,zeroPreviewSubscriptionTotal:K}),v&&!E&&a.createElement(Na,{currentPlan:i,billingEmail:null===h||void 0===h?void 0:h.billingEmail,paymentMethod:null===h||void 0===h?void 0:h.paymentMethod,padding:[0,0,4,0]}),a.createElement(Ha,{title:n,isDowngrade:w,label:v?"Checkout":"Proceed to checkout",disabled:!!T||I,checkoutOrUpdate:R,isLoading:I,"data-ga":"proceedTocheckoutButton::click-".concat(ca(c)).concat(_a(u),"::billing"),"data-testid":"billingCheckoutTotals-proceedToCheckoutButton",showProrations:v})))},za=function(e){var t=e.prices,n=e.currentPlan,r=(0,a.useState)(0),l=(0,o.Z)(r,2),i=l[0],c=l[1],s=t[i],u=null===s||void 0===s?void 0:s.commitment,m=(0,a.useState)(n.committedNodes||1),d=(0,o.Z)(m,2),p=d[0],g=d[1];return{recurringIndex:i,setRecurringIndex:c,price:s,needsCommitment:u,commitment:p,handleCommitmentChange:function(e){return g(e.target.value?parseInt(e.target.value,10):"")}}},Ga=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).title,t=void 0===e?"Checkout":e;return function(e){return function(n){return a.createElement(g.u6,{onClose:n.onClose},a.createElement(f.x,{onClose:n.onClose,title:t}),a.createElement(d.Flex,{column:!0,padding:[4,4,0,4],justifyContent:"between",height:"calc(100vh - 60px)",overflow:"auto"},a.createElement(e,n)))}}};function Ya(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}var qa=3e5,Ka=Ga({title:"Update plan"})((function(e){var t=e.title,n=e.onClose,r=e.prices,c=e.currentPlan,s=void 0===c?{}:c,u=e.children,m=za({prices:r,currentPlan:s}),p=m.recurringIndex,g=m.setRecurringIndex,f=m.price,b=m.needsCommitment,E=m.commitment,v=m.handleCommitmentChange,y=(0,a.useState)(""),x=(0,o.Z)(y,2),w=x[0],C=x[1],O=(0,a.useState)(0),P=(0,o.Z)(O,2),Z=P[0],T=P[1],S=(0,a.useState)(qa),k=(0,o.Z)(S,2),I=k[0],j=k[1],F=(0,h.gI)("billing:Manage"),D=(0,Gn.fG)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ya(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ya(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({productId:f.id,promotionCode:w},b&&E&&{commitment:E}),Z),A=D.loading,M=D.value,N=D.promoCodeError;return(0,Yn.Z)((function(){A||T((function(e){return e+1}))}),I),(0,a.useEffect)((function(){j(A?null:qa)}),[A]),a.createElement(_.ZP,{feature:"Billing::UpdateModal"},F?a.createElement(a.Fragment,null,a.createElement(d.Flex,{column:!0,gap:4},a.Children.map(u,(function(e){return(0,a.cloneElement)(e,{recurringIndex:p,setRecurringIndex:g})})),a.createElement(ta,{needsCommitment:b,commitment:E,handleCommitmentChange:v}),a.createElement(Kn,null),A?a.createElement(cn.Z,{title:"Loading billing info...",height:"auto"}):M?a.createElement(a.Fragment,null,a.createElement(Xn,(0,i.Z)({currentPlan:s},M)),a.createElement(Kn,null),a.createElement(ea,{promotionCode:w,onApply:C,error:N})):a.createElement("div",null,"No data available"),a.createElement(ia,{currentPlan:s,onCtaClick:n})),a.createElement(Wa,{title:t,slug:f.slug,currentPlan:s,onClose:n,price:f,balance:s.balance,commitment:E,needsCommitment:b,previewData:M,loadingPreview:A,showProrations:!0,promotionCode:w})):a.createElement(d.Flex,null,a.createElement(d.TextBigger,null,"You don't have permissions to change the plan.")))})),Qa=Ga()((function(e){var t=e.onClose,n=e.prices,r=e.currentPlan,l=void 0===r?{}:r,i=e.children,c=za({prices:n,currentPlan:l}),s=c.recurringIndex,u=c.setRecurringIndex,m=c.price,p=c.needsCommitment,g=c.commitment,f=c.handleCommitmentChange,b=(0,je.Iy)("email"),E=(0,a.useState)(l.billingEmail||b||""),v=(0,o.Z)(E,2),y=v[0],x=v[1],w=(0,h.gI)("billing:Manage");return a.createElement(_.ZP,{feature:"Billing::CheckoutModal"},w?a.createElement(a.Fragment,null,a.createElement(d.Flex,{column:!0,gap:4},a.Children.map(i,(function(e){return(0,a.cloneElement)(e,{recurringIndex:s,setRecurringIndex:u})})),a.createElement(ta,{needsCommitment:p,commitment:g,handleCommitmentChange:f}),a.createElement(Kn,null),a.createElement(d.TextInput,{onChange:function(e){return x(e.target.value)},value:y,label:"Billing email",placeholder:"jsmith@example.com"}),a.createElement(ia,{currentPlan:l,onCtaClick:t})),a.createElement(Wa,{currentPlan:l,onClose:t,price:m,balance:l.balance,commitment:g,email:y,needsCommitment:p})):a.createElement(d.Flex,null,a.createElement(d.TextBigger,null,"You don't have permissions to change the plan.")))})),Xa=n(89405),$a=n(37503),Ja=n(82902),er=["inModal","recurringIndex","setRecurringIndex"],tr=function(e){var t=e.recurringIndex,n=e.slug,r=e.primary,l=e.secondary;return a.createElement(d.Flex,{column:!0,gap:2},null!==r&&void 0!==r&&r.amountPerNode||null!==l&&void 0!==l&&l.amountPerNode?a.createElement(a.Fragment,null,a.createElement(Xe.Z,{align:"top",content:r.amountPerNode?"Price per active node per month for committed usage of nodes for a year":"Price per node per month",isBasic:!0,plain:!0,stretch:"align"},a.createElement(d.H0,null,ma.format((0,Qn.c1)(r,l)),a.createElement(d.TextSmall,{color:"textLite"},"/",a.createElement(Oe.Z,{Component:d.TextSmall,href:"https://www.netdata.cloud/pricing/#do-i-have-to-pay-for-nodes-that-are-no-longer-online",rel:"noopener noreferrer",target:"_blank"},"Node"),"/month",0==t&&a.createElement(a.Fragment,null," (billed yearly)"))))):"free"==n?a.createElement(d.H0,null,"Free, Forever"):null,(null===r||void 0===r?void 0:r.monthlyDiscountPercentagePerNode)&&a.createElement(d.Flex,null,a.createElement(d.Text,null,a.createElement(d.Text,{strong:!0},100*r.monthlyDiscountPercentagePerNode,"% discount")," is applied for annual billing.")))},nr=m.default.div.withConfig({displayName:"pricingDetails__OneLine",componentId:"sc-hbslp4-0"})(["white-space:nowrap white-space:nowrap;"]),ar=function(e){var t=e.nodesLastPeriod,n=e.committedNodes,r=t-n,l=r>0;return 0==r?a.createElement(d.TextSmall,null,"You are using all your committed nodes."):l?a.createElement(d.TextSmall,null,"You are using"," ",a.createElement(d.TextSmall,{strong:!0,color:"error"},r," ",(0,Ja.V6)(r).toLowerCase()," more")," ","than your committed nodes."):a.createElement(d.TextSmall,null,"You are using"," ",a.createElement(d.TextSmall,{strong:!0,color:"success"},t," out of ",n)," ","committed ",(0,Ja.V6)(n).toLowerCase(),".")},rr=function(e){var t=e.interval,n=e.currentPeriodTo,r=e.committedNodes,l=e.nodesLastPeriod,o=e.showPromotion,i=e.cancelling,c=e.onCancelPlan,s=(0,Xa.rA)().localeDateString;return a.createElement(d.Flex,{column:!0,gap:1},!!n&&a.createElement(d.TextSmall,null,a.createElement(d.TextSmall,{strong:!0,"data-testid":"billingPricingDetails-interval"},"Billing ".concat(Aa.go[t]))," ","(renews ",s(new Date(n),{long:!1}),")"),o&&"month"===t&&a.createElement(Oe.Z,{onClick:c,disabled:i},a.createElement(nr,null,"Save 25% by changing your billing frequency to yearly")),"year"===t&&a.createElement(a.Fragment,null,a.createElement(d.TextSmall,null,"Committed Nodes:"," ",a.createElement(d.Text,{strong:!0,"data-testid":"billingPricingDetails-committedNodesNumber"},r)),"number"===typeof l&&a.createElement(ar,{nodesLastPeriod:l,committedNodes:r})))},lr=function(e){var t=e.features,n=e.showViewDetails;return a.createElement(d.Flex,{column:!0,gap:1},t.map((function(e){return a.createElement(d.Flex,{gap:2,key:e},a.createElement(d.Box,{width:5},a.createElement(d.Icon,{name:"check",width:"20px",height:"20px",color:"primary"})),a.createElement(d.TextSmall,null,e))})),n&&a.createElement(d.Flex,{gap:2},a.createElement(d.Box,{width:5}),a.createElement(Oe.Z,{Component:d.Flex,as:on.rU,cursor:"pointer",alignItems:"center",gap:1,color:"text",hoverColor:"textFocus",to:"all-plans"},a.createElement(d.Text,{strong:!0},"View full details"),a.createElement(d.Icon,{name:"chevron_right",width:"16px",height:"16px"}))))},or=function(e){return function(t){var n=t.inModal,r=t.recurringIndex,l=t.setRecurringIndex,o=(0,c.Z)(t,er);return n?a.createElement(d.Flex,{width:"100%",justifyContent:"between",alignItems:"center"},a.createElement(e,o),a.createElement(d.Flex,{gap:3,padding:[0,10]},Aa.FC.map((function(e,t){return a.createElement(d.RadioButton,{key:e,checked:r===t,onChange:function(){return l(t)},"data-testid":"billingPaidPlans-".concat(e,"-radioButton")},a.createElement(d.Text,{color:"textDescription"},(0,Qe.fm)(Aa.go[e])))})))):a.createElement(e,o)}}((function(e){var t=e.children;return a.createElement(d.H3,{"data-testid":"billingPricingDetails-activePlanName"},t)})),ir=function(e){var t,n=e.slug,r=e.version,l=e.prices,o=e.recurringIndex,c=void 0===o?0:o,s=e.setRecurringIndex,u=e.currentPlan,m=void 0===u?{}:u,p=e.isActive,g=e.showAllDetails,f=e.showTeaserDetails,b=e.cancelling,h=e.onCancelPlan,E=e.title,v=e.features,y=e.nodesLastPeriod,x=e.inModal,w=(0,Fa.Z)().onTrial,C=p?m.pricing:(null===(t=l[c])||void 0===t?void 0:t.pricing)||{},O=(0,Qn.BT)(n);return a.createElement(d.Flex,{column:!0,gap:2},a.createElement(d.Flex,{column:!0},a.createElement(d.Flex,{alignItems:"center",gap:2},a.createElement(or,{inModal:x,recurringIndex:c,setRecurringIndex:s},E),p&&a.createElement(a.Fragment,null,a.createElement(d.Pill,{flavour:"success","data-testid":"active-plan",icon:"checkmark_s"},w?"Trial":"Active"),w&&!g&&a.createElement($a.Z,null,a.createElement(d.TextBig,{color:"primary"},"Upgrade Now!")))),r&&a.createElement(d.TextBig,null,"(",r,")")),(g||!p||"free"===n)&&a.createElement(tr,(0,i.Z)({recurringIndex:c,slug:n},C)),f&&!(null===v||void 0===v||!v[r])&&a.createElement(lr,{features:v[r],showViewDetails:!O}),p&&!(0,Qn.BT)(n)&&!w&&a.createElement(rr,(0,i.Z)({},m,{showPromotion:!0,cancelling:b,onCancelPlan:h,nodesLastPeriod:y})))},cr=n(16294),sr=n(80697),ur=n(66987),mr=n(29292),dr=n(23154),pr=["slug","version","prices","isSmall","isActive","currentPlan","showAllPlans","showTeaserDetails","allPlansView","nodesLastPeriod"];function gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function fr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gr(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var br=(0,m.default)(d.Flex).withConfig({displayName:"plan__StyledWrapper",componentId:"sc-1rlwyf1-0"})(["width:","};min-width:280px;place-self:",";"],(function(e){return e.showAllPlans?"25vw":"auto"}),(function(e){return e.showAllPlans?"center":"auto"})),hr=function(e){var t=e.slug,n=e.version,r=e.prices,l=void 0===r?[]:r,s=e.isSmall,u=e.isActive,m=e.currentPlan,p=e.showAllPlans,g=e.showTeaserDetails,f=e.allPlansView,b=void 0!==f&&f,E=e.nodesLastPeriod,v=(0,c.Z)(e,pr),x=Aa.Vc[t]||Aa.Vc.free,w=x.title,C=x.features,O=(0,h.gI)("billing:Manage"),P=(0,Be.Z)(),Z=P.sendLog,T=P.sendButtonClickedLog,S=P.isReady,k=(0,Fa.Z)().onTrial,I=(0,Gn.x1)(),j=I.cancelling,F=I.startCancelling,D=I.stopCancelling,A=(0,a.useCallback)((function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).label;T({label:e},!0)}),[T,S]),M=(0,Qn.$s)({currentPlan:m,slug:t,version:n,onTrial:k}),N=j||u&&(0,Qn.BT)(t)||"earlyBird"==m.slug&&"free"==t||"free"==m.slug&&"2023.02"==m.version&&"free"==t&&"2023.11"==n,B=(0,a.useState)({}),L=(0,o.Z)(B,2),R=L[0],_=L[1],U=(0,y.Z)(),V=(0,o.Z)(U,4),H=V[0],W=V[2],z=V[3],G=(0,we.Z)(),Y=(0,o.Z)(G,2),q=Y[0],K=Y[1],Q=(0,Gn.Zn)(),X="cancel"===R.type&&!(0,Qn.BT)(m.slug)&&!H,$="cancel"===R.type&&"free"==t&&"2023.11"==n,J=(0,dr.Z)().id,ee=(0,ct.HK)(),te=(0,a.useCallback)((function(){W(),F(),Q({productId:J}).then((function(){q({header:"Successfully canceled subscription",text:"You are now on Community plan"}),Z({isSuccess:!0,description:"cancel-subscription"})})).catch((function(){K({header:"Failed to cancel the subscription",text:"Remained on ".concat(w," plan")}),Z({isFailure:!0,description:"cancel-subscription",error:"Failed to cancel the subscription"})})).finally((function(){D(),ee()}))}),[Z,S]),ne=(0,a.useCallback)((function(e){if(!j&&!N){if((0,Qn.BT)(t))return _({type:"cancel"}),void Z(e,!0);if((0,Qn.BT)(m.slug))return se("checkout"),void Z(e,!0);se("update"),Z(e,!0)}}),[Z,S]),ae=!!m.billingEmail,re=ae?Ka:Qa,le=(0,en.m$)(),oe=le.billingModalType,ie=le.billingModalSlug,ce=["checkout","update"].includes(oe)&&t==ie,se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=(0,en.m$)();(0,en.xs)(fr(fr({},n),{},{billingModalType:e,billingModalSlug:""==e?e:t}))},ue=(0,y.Z)(),me=(0,o.Z)(ue,4),de=me[0],pe=me[2],ge=me[3];return a.createElement(br,(0,i.Z)({column:!0,height:s?"auto":p?50:75,flex:s,padding:s?[6,10]:[0,10],gap:2,justifyContent:"between",showAllPlans:p},v),a.createElement(ir,{slug:t,prices:l,isActive:u,currentPlan:m,cancelling:j,showAllDetails:p,showTeaserDetails:g,title:w,version:n,features:C,nodesLastPeriod:E,onCancelPlan:function(){return ne({action:cr.Nw.buttonClicked,label:w})}}),!b&&a.createElement(kn.Z,{Component:d.Button,permission:"billing:Manage","data-ga":"upgrade-button::click-".concat(ca({slug:t}),"::current-").concat(ca(m),"::billing"),"data-testid":"billingPlan-".concat(t,"-").concat(u?"currentPlan":"upgradeButton"),label:M,flavour:(0,Qn.rQ)(null===m||void 0===m?void 0:m.slug,t),disabled:N,width:"100%",onClick:function(){return ne({action:cr.Nw.buttonClicked,label:M,dataGa:"upgrade-button::click-".concat(ca({slug:t}),"::current-").concat(ca(m),"::billing")})},isLoading:j&&u,loadingLabel:"Cancelling"}),!p&&a.createElement(a.Fragment,null,k&&a.createElement(ur.Z,{flavour:"billing"}),(k||!(0,Qn.BT)(m.slug))&&a.createElement(d.Flex,{column:!0,gap:4},a.createElement(d.Flex,{gap:6,alignItems:"baseline"},k&&a.createElement(sr.Z,null),!(0,Qn.BT)(m.slug)&&a.createElement(Oe.Z,{Component:d.Flex,as:on.rU,cursor:"pointer",alignItems:"center",gap:1,color:"text",hoverColor:"textFocus",to:"all-plans",padding:[4,0,0],disabled:j,onClick:function(){return A({label:O?"Change plan":"View plans"})},"data-testid":"billingPlan-viewMorePlansLink","data-ga":"change-plan::click::billing"},a.createElement("span",null,O?"Change plan":"View plans"),a.createElement(d.Icon,{name:"chevron_right",width:"16px",height:"16px"}))),k&&a.createElement(a.Fragment,null,a.createElement(mr.Z,{flavour:"billing",color:"textLite",onOptOutClick:pe}),de&&a.createElement(ja.Z,{onDecline:ge,onCancellingEnd:function(){}})))),(X||$)&&a.createElement(Da,{title:w,onConfirm:te,onClose:function(){z(),_({})}}),ce&&a.createElement(re,{title:w,onClose:function(){z(),se()},prices:l,currentPlan:m,showProrations:ae},a.createElement(ir,{slug:t,prices:l,currentPlan:m,title:w,inModal:!0})))},Er=(n(69720),["slug","isSmall","currentPlan","showAllPlans","allPlansView","showTeaserDetails"]),vr=(0,m.default)(d.Flex).withConfig({displayName:"enterprise__StyledWrapper",componentId:"sc-1an0ywv-0"})(["width:","};min-width:280px;place-self:",";"],(function(e){return e.showAllPlans?"25vw":"auto"}),(function(e){return e.showAllPlans?"center":"auto"})),yr=function(e){var t=e.slug,n=e.isSmall,r=e.currentPlan,l=e.showAllPlans,o=e.allPlansView,s=void 0!==o&&o,u=e.showTeaserDetails,m=(0,c.Z)(e,Er),p=(0,Be.Z)().sendButtonClickedLog,g=(0,Gn.x1)().cancelling,f=Aa.Vc.enterprise.features,b=(0,a.useCallback)((function(){window.open("https://www.netdata.cloud/contact-us/?subject=on-prem","_blank","noopener,noreferrer"),p({feature:"OnPremContact"})}),[p]);return a.createElement(vr,(0,i.Z)({column:!0,height:n?"auto":l?50:75,flex:n,padding:n?[6,10]:[0,10],gap:2,justifyContent:"between",showAllPlans:l},m),a.createElement(d.Flex,{column:!0,gap:2},a.createElement(d.Flex,{column:!0},a.createElement(d.Flex,{alignItems:"center",gap:2},a.createElement(d.H3,{"data-testid":"billingPricingDetails-activePlanName"},"Enterprise On-Premise"))),a.createElement(d.H0,null,ma.format(3),a.createElement(d.TextSmall,{color:"textLite"},"/",a.createElement(Oe.Z,{Component:d.TextSmall,href:"https://www.netdata.cloud/pricing/#do-i-have-to-pay-for-nodes-that-are-no-longer-online",rel:"noopener noreferrer",target:"_blank"},"Node"),"/month (billed yearly)")),u&&a.createElement(lr,{features:f[2023.11]||[]})),!s&&a.createElement(kn.Z,{Component:d.Button,permission:"billing:Manage","data-ga":"upgrade-button::click-".concat(ca({slug:t}),"::current-").concat(ca(r),"::billing"),"data-testid":"billingPlan-".concat(t,"-upgradeButton"),label:"Contact us",flavour:"hollow",disabled:g,width:"100%",onClick:b}))},xr=function(e){var t=e.plans,n=e.isSmall,r=e.currentPlan,l=e.showAllPlans,i=e.showTeaserDetails,c=e.isPro;return a.createElement(a.Fragment,null,c&&(Object.entries(t.pro)||[]).map((function(e){var t=(0,o.Z)(e,2),c=t[0],s=t[1];return a.createElement(hr,{key:c,slug:"pro",version:c,prices:s,isActive:"pro"===r.slug&&r.version==c,isSmall:n,currentPlan:r,showAllPlans:l,showTeaserDetails:i})})),(Object.entries(t.business)||[]).map((function(e){var t=(0,o.Z)(e,2),c=t[0],s=t[1];return a.createElement(hr,{key:c,slug:"business",version:c,prices:s,isActive:"business"===r.slug&&r.version==c,isSmall:n,currentPlan:r,showAllPlans:l,showTeaserDetails:i})})),a.createElement(yr,{slug:"enterprise",isSmall:n,currentPlan:r,showAllPlans:l,showTeaserDetails:i}))},wr=(n(43290),m.default.div.withConfig({displayName:"styled__Container",componentId:"sc-1oa2kv1-0"})(["display:grid;",""],(function(e){var t=e.numberOfPlans,n=[e.showAllPlans?"200px":"1fr"].concat((0,wa.Z)(Array(t).fill("1.5fr")));return"grid-template-columns: ".concat(n.join(" "),";")}))),Cr=m.default.div.withConfig({displayName:"styled__Header",componentId:"sc-1oa2kv1-1"})(["display:contents;> *{background:",";border-bottom:1px solid ",";}"],(0,d.getColor)("panelBg"),(0,d.getColor)("placeholder")),Or=(0,m.default)(d.Collapsible).withConfig({displayName:"styled__Content",componentId:"sc-1oa2kv1-2"})(["display:contents;"]),Pr=function(){var e=(0,Gn.Gl)(),t=e.loaded,n=e.value,a=(0,Gn.RP)(),r=a.loaded,l=a.value,o=(0,Qn.Gj)({currentPlan:l,plans:n});return t&&r?o:0},Zr=function(e){var t,n,r,l,o=e.isSmall,i=e.plans,c=e.currentPlan,s=e.showAllPlans,u=void 0!==s&&s,m=e.showTeaserDetails,d=void 0!==m&&m,p=e.children,g="earlyBird"===c.slug,f="pro"===c.slug,b=Pr(),h=(0,dr.Z)().version,E=null===(t=(null===(n=i.free)||void 0===n?void 0:n[null===c||void 0===c?void 0:c.version])||(null===(r=i.free)||void 0===r?void 0:r[h]))||void 0===t?void 0:t[0],v=i.earlyBird?null===(l=Object.values(i.earlyBird)[0])||void 0===l?void 0:l[0]:{};return a.createElement(wr,{numberOfPlans:b,showAllPlans:u},p,g?a.createElement(hr,{slug:"earlyBird",version:null===v||void 0===v?void 0:v.version,prices:null===v||void 0===v?void 0:v.prices,isSmall:o,isActive:"earlyBird"===c.slug,currentPlan:c,showAllPlans:u}):a.createElement(hr,{slug:"free",version:null===E||void 0===E?void 0:E.version,prices:null===E||void 0===E?void 0:E.prices,isSmall:o,isActive:"free"===c.slug&&c.version==(null===E||void 0===E?void 0:E.version),currentPlan:c,showAllPlans:u,showTeaserDetails:d}),a.createElement(xr,{plans:i,isSmall:o,currentPlan:c,showAllPlans:u,showTeaserDetails:d,isPro:f}))},Tr=["children"],Sr=function(e){var t=e.children,n=(0,c.Z)(e,Tr);return a.createElement(d.Flex,(0,i.Z)({alignItems:"center",gap:2},n),t)},kr=function(){return a.createElement(d.Flex,{column:!0,gap:2,width:65},a.createElement(d.TextMicro,{color:"bright"},a.createElement(d.TextMicro,{color:"bright",strong:!0},"Available credit")," ","for you to use on any plan subscriptions with us."),a.createElement(d.TextMicro,{color:"bright"},"It is ok to change your mind, we will give you full flexibility! You can change the plan level, billing frequency or committed nodes, we won't hold you to any choice. When applicable, we'll credit you back on any unused amount."))},Ir=function(e){var t=e.currentPlan,n=(0,Gn.SH)(),r=(0,o.Z)(n,2),l=r[0],i=r[1],c=!!t.billingEmail&&!i,s=(0,h.gI)("billing:ReadAll");return a.createElement(d.Flex,{column:!0,gap:2},a.createElement(d.H3,null,"Plan & Billing"),s&&a.createElement(a.Fragment,null,a.createElement(Sr,null,a.createElement(d.Flex,{gap:1,alignItems:"center"},a.createElement(d.Text,null,"Credit:"),a.createElement(d.Text,{"data-testid":"billingHeader-credits",strong:!0},ma.format(t.balance.amount||0)),a.createElement(Xe.Z,{content:kr,align:"bottom",isBasic:!0},a.createElement(d.Icon,{name:"information",width:"16px",height:"16px",color:"textLite"}))),a.createElement(qn,null),a.createElement(d.Text,null,"Billing email:"," ",a.createElement(d.Text,{strong:!0,"data-testid":"billingHeader-email"},t.billingEmail||"-")),a.createElement(qn,null),a.createElement(Oe.Z,{Component:d.Flex,cursor:c?"pointer":"default",disabled:!c,onClick:l,alignItems:"center",gap:1,"data-ga":"billing-options::click::billing","data-testid":"billingHeader-goToPortal"},a.createElement("span",null,"Billing options and Invoices"),a.createElement(d.Icon,{name:"nav_arrow_goto",width:"12px",height:"12px"}))),a.createElement(qn,{height:1,width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}})))};n(34553),n(2707),n(69810),n(86035);var jr=n(69119),Fr=n(71002),Dr=n(7069),Ar=n(54559),Mr=n(13882),Nr=n(83946);var Br=n(28789),Lr=n(23148),Rr=n(36337),_r=n(26495),Ur=n(95665),Vr=n(92501),Hr=n(4822),Wr=n(69019);function zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Gr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zr(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Yr={nodes:1,p90:2,committed_nodes:3},qr={"Daily count":"The weighted 90th percentile of the live node count during the day, taking time as the weight. If you have 30 live nodes throughout the day, except for a two hour peak of 44 live nodes, the daily value is 31.","Committed nodes":"The number of nodes committed to in the yearly plan. In case the period count is higher than the number of committed nodes, the difference is billed as overage.","Period count":"The 90th percentile of the daily counts for this period up to the date. The last value for the period is used as the number of nodes for the bill for that period."};Lr.kL.register(Lr.f$,Lr.uw,Lr.ZL,Lr.od,Lr.jn,Lr.De,Lr.u,Lr.ST,Lr.vn,Rr.Z),Lr.u.positioners.follow=function(e,t){return null===e||void 0===e||!e.length||t.y>360?(this._resolveAnimations().update(this,{opacity:0}),!1):(0===this.opacity&&this._resolveAnimations().update(this,{opacity:1}),{x:t.x,y:t.y})};var Kr=function(e){return{nodes:{label:"Daily count",type:"bar",color:(0,d.getColor)("text")({theme:e}),backgroundColor:(0,d.getColor)("primary")({theme:e}),borderColor:(0,d.getColor)("primary")({theme:e}),borderWidth:2,pointStyle:"rectangle",usePointStyle:!0},p90:{label:"Period count",type:"line",color:(0,d.getColor)("text")({theme:e}),borderColor:(0,d.getColor)(["purple","lilac"])({theme:e}),borderWidth:2,fill:!1,stepped:!0},committed_nodes:{label:"Committed nodes",type:"line",color:(0,d.getColor)("text")({theme:e}),borderColor:(0,d.getColor)(["blue","aquamarine"])({theme:e}),borderWidth:2,fill:!1,borderDash:[1,2],borderDashOffset:1,pointStyle:!1}}},Qr={border:{side:"all",color:"inputBorder",padding:[3]},round:!0},Xr=function(){var e=new Date,t=e.getFullYear(),n=e.getMonth(),a=e.getDate(),r=new Date(0);return r.setFullYear(t,n,a-1),r.setHours(23,59,59,999),r}(),$r=(0,jr.default)(function(e,t){if((0,Mr.Z)(2,arguments),!t||"object"!==(0,Fr.Z)(t))return new Date(NaN);var n=t.years?(0,Nr.Z)(t.years):0,a=t.months?(0,Nr.Z)(t.months):0,r=t.weeks?(0,Nr.Z)(t.weeks):0,l=t.days?(0,Nr.Z)(t.days):0,o=t.hours?(0,Nr.Z)(t.hours):0,i=t.minutes?(0,Nr.Z)(t.minutes):0,c=t.seconds?(0,Nr.Z)(t.seconds):0,s=(0,Ar.default)(e,a+12*n),u=(0,Dr.default)(s,l+7*r),m=1e3*(c+60*(i+60*o));return new Date(u.getTime()-m)}(Xr,{months:1})),Jr=function(e){var t=e.onNodesLastPeriodFetch,n=(0,Hr.by)("offset"),r=(0,v.th)(),i=(0,a.useState)((function(){return{start:$r,end:Xr}})),c=(0,o.Z)(i,2),s=c[0],u=c[1],p=(0,Nt.Z)((function(){return{enabled:!!r&&!!s.start&&!!s.end,fetch:function(){return(0,Wr.fA)(r,{after:Math.floor((0,Br.default)((0,Xa.tb)(s.start,n))/1e3),before:Math.floor((0,Br.default)((0,Xa.tb)(s.end,n))/1e3)})},initialValue:{labels:[],data:[]},onSuccess:function(e){var n=e.data,a=e.labels;if(n.length){var r=n.at(-1),l=r[a.indexOf("nodes")],o=r[a.indexOf("timestamp")];t((function(e){return e.timestamp>o?e:{timestamp:o,value:l}}))}}}}),[r,s,t]),g=(0,o.Z)(p,3),f=g[0],b=g[1],h=g[2],E=(0,a.useContext)(m.ThemeContext),y=(0,a.useMemo)((function(){var e=f.data.map((function(e){return(0,o.Z)(e,1)[0]})),t=f.labels.reduce((function(t,n,a){return a?[Gr(Gr({},Kr(E)[n]),{},{data:e.map((function(e,t){return f.data[t][a]})),order:Yr[n]})].concat((0,wa.Z)(t)):t}),[]);return{labels:e,datasets:t}}),[f]),x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.data,r=t.annotations,i=void 0===r?[]:r,c=(0,Xa.rA)().localeDateString,s=(0,a.useRef)(!1),u=(0,a.useRef)(),m=(0,a.useMemo)((function(){return{interaction:{axis:"x"},plugins:{legend:{position:"bottom",align:"start",onClick:function(e,t,n){var a=n.legendItems.findIndex((function(e){return e.text===t.text}));n.chart.isDatasetVisible(a)?n.chart.hide(a):n.chart.show(a)},labels:{generateLabels:function(e){return e.data.datasets.map((function(t,n){return{fontColor:t.color,text:t.label,fillStyle:t.backgroundColor,strokeStyle:t.borderColor,pointStyle:"Daily count"===t.label?"rect":"line",hidden:!e.isDatasetVisible(n),order:t.order}})).sort((function(e,t){return e.order-t.order}))},usePointStyle:!0},onHover:function(e,t){!s.current&&u.current&&(s.current=!0,u.current.innerHTML=qr[t.text],u.current.style.left=e.x+"px",u.current.style.top=e.y+"px",u.current.style.visibility="visible",u.current.style.transform="translateY(-100%)")},onLeave:function(){u.current&&(s.current=!1,u.current.innerHTML="",u.current.style.visibility="hidden")}},tooltip:{enabled:!0,mode:"nearest",intersect:!1,yAlign:"bottom",usePointStyle:!0,position:"follow",backgroundColor:(0,d.getColor)("tooltip")({theme:e}),color:(0,d.getColor)("bright")({theme:e}),callbacks:{title:function(e){var t=(0,o.Z)(e,1)[0];return t?c(1e3*t.label,{month:"2-digit",day:"2-digit",year:"numeric",long:!1,dateStyle:void 0}):""},labelPointStyle:function(e){return{pointStyle:"Total Nodes"===e.dataset.label?"rect":"line"}},label:function(e){return"  ".concat(e.formattedValue," ").concat(e.dataset.label||"")}}},annotation:{annotations:i.reduce((function(t,a,r){return Gr(Gr({},t),{},(0,l.Z)({},"annotation".concat(r),{type:"line",value:n.findIndex((function(e){return e[0]===a.timestamp})),borderColor:(0,d.getRgbColor)("attention",.3)({theme:e}),borderDashOffset:0,borderWidth:10,drawTime:"afterDatasetsDraw",label:{drawTime:"afterDatasetsDraw",display:!1,backgroundColor:(0,d.getRgbColor)("attention",.8)({theme:e}),borderWidth:0,color:"white",content:a.name,textAlign:"center"},scaleID:"x",enter:function(e,t){var n=e.chart,a=n.options.plugins.annotation.annotations["annotation".concat(r)];a.label.display=!0,a.label.position=t.y/e.chart.chartArea.height>.5?"start":"end",n.update()},leave:function(e){var t=e.chart;t.options.plugins.annotation.annotations["annotation".concat(r)].label.display=!1,t.update()}}))}),{})}},responsive:!0,maintainAspectRatio:!1,scales:{x:{ticks:{callback:function(e){return c(1e3*this.getLabelForValue(e),{month:"2-digit",day:"2-digit",year:"numeric",long:!1,dateStyle:void 0})},color:(0,d.getColor)("textLite")({theme:e})}},y:{beginAtZero:!0,ticks:{color:(0,d.getColor)("textLite")({theme:e})}}}}}),[e,n]);return[m,u]}(E,f),w=(0,o.Z)(x,2),C=w[0],O=w[1];return a.createElement(d.Flex,{column:!0,gap:4},a.createElement(d.Flex,{alignItems:"center",justifyContent:"between"},a.createElement(d.H3,null,"Usage"),a.createElement(Ur.Z,{values:s,utc:n,onChange:u,tagging:"billing-usage",isPlaying:!1,onlyDates:!0,accessorProps:Qr,padding:[4,0],width:"auto",maxDate:Xr})),a.createElement(d.Flex,{position:"relative",height:90},b?a.createElement(cn.Z,{title:"Loading billing data..."}):h?a.createElement(Vr.NY,{title:"Chart couldn't be loaded"}):a.createElement(_r.kL,{type:"bar",data:y,options:C}),a.createElement(d.Flex,{ref:O,background:"main",color:"generic",position:"absolute",round:!0,padding:[3],width:{max:75},sx:{visibility:"hidden"},onMouseOver:function(){return O.current.style.visibility="hidden"}})))},el=function(e){var t=e.isSmall,n=e.currentPlan,r=e.loaded,l=e.currentLoaded,i=e.plans,c=(0,a.useState)({timestamp:null,value:null}),s=(0,o.Z)(c,2),u=s[0],m=s[1],d=i[n.slug]?i[n.slug][n.version]:[];return a.createElement(a.Fragment,null,a.createElement(Ir,{currentPlan:n}),r&&l?a.createElement(a.Fragment,null,(0,Qn.BT)(n.slug)?a.createElement(Zr,{isSmall:t,plans:i,currentPlan:n,showTeaserDetails:!0}):a.createElement(hr,{slug:n.slug,version:n.version,prices:d,width:t?"auto":120,padding:[0],height:"auto",isSmall:t,isActive:!0,currentPlan:n,allPlansView:!0,nodesLastPeriod:u.value}),a.createElement(qn,{height:1,width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}}),a.createElement(Jr,{onNodesLastPeriodFetch:m})):a.createElement(cn.Z,{title:r?"Loading billing info...":"Loading Netdata plans..."}))},tl=n(92432),nl={year:"Yearly",month:"Monthly"},al=function(e){var t,n=e.currentPlan,r=(0,v.uk)(),l=(0,Gn.SH)(),i=(0,o.Z)(l,2),c=i[0],s=i[1],u=(0,Gn.x1)(),m=u.cancelling,p=u.startCancelling,g=u.stopCancelling,f=!!n.billingEmail&&!s,b=(0,y.Z)(),E=(0,o.Z)(b,2),x=E[0],w=E[1],C=(0,we.Z)(),O=(0,o.Z)(C,2),P=O[0],Z=O[1],T=(0,Gn.Zn)(),S=(Aa.Vc[n.slug]||Aa.Vc.free).title,k=(0,dr.Z)().id,I=(0,h.gI)("billing:Manage"),j=(0,h.gI)("billing:ReadAll"),F=(Aa.Vc[null===n||void 0===n?void 0:n.slug]||Aa.Vc.free).title,D=nl[null===n||void 0===n?void 0:n.interval];return a.createElement(d.Flex,{column:!0,gap:2},a.createElement(d.Flex,{gap:2,alignItems:"center"},a.createElement(Oe.Z,{as:on.rU,to:"/spaces/".concat(r,"/settings/billing"),disabled:m,color:"text",hoverColor:"textLite",showToolTip:!0,content:"Back to Plan & Billing",align:"bottom",isBasic:!0},a.createElement(d.Icon,{name:"arrow_left",width:"20px",height:"20px",margin:[1.5,0,0]})),a.createElement(d.H3,null,"All Plans")),a.createElement(Sr,null,a.createElement(d.Flex,{gap:1,alignItems:"center"},a.createElement(d.Text,null,"Active plan:"),a.createElement(d.Text,{strong:!0},F)),a.createElement(qn,null),D&&a.createElement(a.Fragment,null,a.createElement(d.Flex,{gap:1,alignItems:"center"},a.createElement(d.Text,null,"Billing frequency:"),a.createElement(d.Text,{strong:!0},D)),a.createElement(qn,null)),"Yearly"===D&&a.createElement(d.Flex,{gap:1,alignItems:"center"},a.createElement(d.Text,null,"Committed Nodes:"),a.createElement(d.Text,{strong:!0},(null===n||void 0===n?void 0:n.committedNodes)||0)),a.createElement(qn,null),j&&a.createElement(a.Fragment,null,a.createElement(d.Flex,{gap:1,alignItems:"center"},a.createElement(d.Text,null,"Credit:"),a.createElement(d.Text,{strong:!0},ma.format((null===n||void 0===n||null===(t=n.balance)||void 0===t?void 0:t.amount)||0)),a.createElement(Xe.Z,{content:kr,align:"bottom",isBasic:!0},a.createElement(d.Icon,{name:"information",width:"16px",height:"16px",color:"textLite"}))),a.createElement(qn,null),a.createElement(d.Flex,{gap:1,alignItems:"center"},a.createElement(d.Text,null,"Billing email:"),a.createElement(d.Text,{strong:!0},(null===n||void 0===n?void 0:n.billingEmail)||"-")),a.createElement(qn,null)),a.createElement(Oe.Z,{Component:d.Flex,cursor:f?"pointer":"default",disabled:!f,onClick:c,alignItems:"center",gap:1},a.createElement("span",null,"Billing options and Invoices"),a.createElement(d.Icon,{name:"nav_arrow_goto",width:"12px",height:"12px"})),!(0,Qn.BT)(null===n||void 0===n?void 0:n.slug)&&a.createElement(a.Fragment,null,a.createElement(qn,null),a.createElement(Oe.Z,{Component:d.Flex,cursor:"pointer",onClick:w,alignItems:"center",gap:1,disabled:m||!I,"data-ga":"cancel-plan::click::billing"},a.createElement(d.Text,{textDecoration:"underline"},m?"Canceling plan...":"Cancel plan")))),a.createElement(qn,{height:1,width:"100%",sx:{borderWidth:"1px 0px 0px 0px",borderColor:"borderSecondary",borderStyle:"solid"}}),x&&a.createElement(Da,{title:"Community",onConfirm:function(){p(),T({productId:k}).then((function(){return(0,tl.L)("billing","cancel-plan","global-view",{slug:null===n||void 0===n?void 0:n.slug,interval:null===n||void 0===n?void 0:n.interval,success:!0}),P({header:"Successfully canceled subscription",text:"You are now on Community plan"})})).catch((function(){return(0,tl.L)("billing","cancel-plan","global-view",{slug:null===n||void 0===n?void 0:n.slug,interval:null===n||void 0===n?void 0:n.interval,success:!1}),Z({header:"Failed to cancel the subscription",text:"Remained on ".concat(S," plan")})})).finally((function(){g()}))},onClose:w}))},rl=["center","end"],ll=["children"],ol=function(){return a.createElement(d.Icon,{name:"check",color:"primary"})},il=function(){return a.createElement(d.Icon,{name:"checkmark_partial_s",color:"textLite"})},cl=function(){return a.createElement(d.Icon,{name:"chevron_down_thin",color:"text"})},sl=function(){return a.createElement(d.Icon,{name:"chevron_up_thin",color:"text"})},ul=function(e){var t=e.center,n=e.end,r=(0,c.Z)(e,rl);return a.createElement(d.Flex,{alignItems:"center",justifyContent:t?"center":n?"end":"start",padding:[2]},a.createElement(d.Text,r))},ml=function(e){var t=e.children,n=(0,c.Z)(e,ll);return a.createElement(ul,(0,i.Z)({center:!0},n),t?a.createElement(d.Flex,{alignItems:"center",gap:2},t,a.createElement(ol,null)):a.createElement(ol,null))},dl=function(e){return a.createElement(ul,(0,i.Z)({center:!0},e),"UNLIMITED")},pl=function(e){return a.createElement(ul,(0,i.Z)({center:!0},e),a.createElement(il,null))},gl=function(e){return a.createElement(ul,(0,i.Z)({center:!0},e),"SOON")},fl=(n(91038),function(e){return function(t){var n=t.index,r=t.title,l=void 0===r?"":r,o=t.showAllPlans,i=t.onToggle,c=t.collapsed,s=Pr();return a.createElement(wr,{numberOfPlans:s,showAllPlans:o},a.createElement(Cr,{onClick:function(){return i(n)}},a.createElement(ul,{strong:!0},l),Array.from(Array(s-1).keys()).map((function(e){return a.createElement(ul,{key:e})})),a.createElement(ul,{end:!0},c[n]?a.createElement(sl,null):a.createElement(cl,null))),a.createElement(Or,{open:!c[n]},a.createElement(e,t)))}}),bl=(0,a.memo)(fl((function(e){var t=e.isPro;return a.createElement(a.Fragment,null,a.createElement(ul,null,"Scalability"),a.createElement(ul,{center:!0},"Vertical and Horizontal"),t&&a.createElement(ul,{center:!0},"Vertical and Horizontal"),a.createElement(ul,{center:!0},"Vertical and Horizontal"),a.createElement(ul,{center:!0},"Vertical and Horizontal"),a.createElement(ul,null,"High Availability"),a.createElement(ml,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Data Retention"),a.createElement(dl,null),t&&a.createElement(dl,null),a.createElement(dl,null),a.createElement(dl,null),a.createElement(ul,null,"Data Privacy"),a.createElement(ul,{center:!0},"Data stored On-Prem and visualized on Netdata Cloud"),t&&a.createElement(ul,{center:!0},"Data stored On-Prem and visualized on Netdata Cloud"),a.createElement(ul,{center:!0},"Data stored On-Prem and visualized on Netdata Cloud"),a.createElement(ul,{center:!0},"Data stored and visualized On-Prem"),a.createElement(ul,null,"Configuration"),a.createElement(ul,{center:!0},"Manual, IaC or in App(UI)"),t&&a.createElement(ul,{center:!0},"Manual, IaC or in App(UI)"),a.createElement(ul,{center:!0},"Manual, IaC or in App(UI)"),a.createElement(ul,{center:!0},"Manual, IaC or in App(UI)"))}))),hl=(0,a.memo)(fl((function(e){var t=e.isPro,n=e.freePlanLimitattions;return a.createElement(a.Fragment,null,a.createElement(ul,null,"Customizable charts"),a.createElement(ml,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Infrastructure wide Dashboards"),a.createElement(ml,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Centralized Alerts Management"),a.createElement(ml,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Infrastrucure Organization (Rooms)"),a.createElement(ml,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Custom Dashboards"),a.createElement(ml,null,null!==n&&void 0!==n&&n.maxDashboards?a.createElement(d.Text,null,"(Limited to ",n.maxDashboards," per Room)"):null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Access dashboards from anywhere in the world"),a.createElement(ml,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Role Based Access Control (RBAC)"),a.createElement(ml,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Auditing"),a.createElement(ml,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Invite Team Members"),a.createElement(ml,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Functions"),a.createElement(ml,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Netdata Assistant"),a.createElement(ml,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,"Mobile App"),a.createElement(pl,null),t&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(pl,null),a.createElement(ul,null,"Centralized Management of Integrations"),a.createElement(gl,null),t&&a.createElement(gl,null),a.createElement(gl,null),a.createElement(gl,null))}))),El=(0,a.memo)(fl((function(e){var t=e.isPro,n=e.freePlanLimitattions;return a.createElement(a.Fragment,null,a.createElement(ul,null,"Active Connected Nodes"),null!==n&&void 0!==n&&n.maxNodes?a.createElement(ul,{center:!0},"Max of ",n.maxNodes):a.createElement(dl,null),t&&a.createElement(dl,null),a.createElement(dl,null),a.createElement(dl,null),a.createElement(ul,null,"Active Custom Dashboards"),null!==n&&void 0!==n&&n.maxDashboards?a.createElement(ul,{center:!0},"Max of ",n.maxDashboards," per Room"):a.createElement(dl,null),t&&a.createElement(dl,null),a.createElement(dl,null),a.createElement(dl,null),a.createElement(ul,null,"Infrastructure metrics"),a.createElement(dl,null),t&&a.createElement(dl,null),a.createElement(dl,null),a.createElement(dl,null),a.createElement(ul,null,"APM metrics"),a.createElement(dl,null),t&&a.createElement(dl,null),a.createElement(dl,null),a.createElement(dl,null),a.createElement(ul,null,"Custom metrics"),a.createElement(dl,null),t&&a.createElement(dl,null),a.createElement(dl,null),a.createElement(dl,null),a.createElement(ul,null,"Synthetic checks"),a.createElement(dl,null),t&&a.createElement(dl,null),a.createElement(dl,null),a.createElement(dl,null),a.createElement(ul,null,"Monitor system journal logs"),a.createElement(dl,null),t&&a.createElement(dl,null),a.createElement(dl,null),a.createElement(dl,null),a.createElement(ul,null,"Auditing Events"),a.createElement(ul,{center:!0},"4 hours"),t&&a.createElement(ul,{center:!0},"7 days"),a.createElement(ul,{center:!0},"90 days"),a.createElement(ul,{center:!0},"As required"),a.createElement(ul,null,"Topology Events"),a.createElement(ul,{center:!0},"4 hours"),t&&a.createElement(ul,{center:!0},"7 days"),a.createElement(ul,{center:!0},"14 days"),a.createElement(ul,{center:!0},"As required"),a.createElement(ul,null,"Alert Events"),a.createElement(ul,{center:!0},"4 hours"),t&&a.createElement(ul,{center:!0},"7 days"),a.createElement(ul,{center:!0},"60 days"),a.createElement(ul,{center:!0},"As required"),a.createElement(ul,null,"Alert Notification Integrations"),a.createElement(ul,{center:!0},"Email, Discord"),t&&a.createElement(ul,{center:!0},"Email, Discord, Webhook"),a.createElement(ul,{center:!0},"Email, Discord, Webhook, Mattermost, Opsgenie, PagerDuty, RocketChat, Slack"),a.createElement(ul,{center:!0},a.createElement(d.Text,null,"Same as Business plan"),a.createElement("br",null),a.createElement(d.TextSmall,null,"(Custom requests can be handled)")),a.createElement(ul,null,"User Administration"),a.createElement(ul,{center:!0},"Basic"),t&&a.createElement(ul,{center:!0},"Intermediate"),a.createElement(ul,{center:!0},"Advanced"),a.createElement(ul,{center:!0},"Advanced"))}))),vl=(0,a.memo)(fl((function(e){var t=e.isEarlyBird,n=e.isPro;return a.createElement(a.Fragment,null,a.createElement(ul,null,a.createElement(d.Text,{id:"administrators"},"Administrators"),a.createElement("br",null),a.createElement(d.TextSmall,{color:"textDescription",id:"same-as-managers-but-unable-to-manage-users-or-rooms"},"Users with this role can control Spaces, War Rooms, Nodes, Users and Billing. They can also access any Room in the Space.")),a.createElement(ml,null),n&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,a.createElement(d.Text,{id:"troubleshooters"},"Troubleshooters"),a.createElement("br",null),a.createElement(d.TextSmall,{color:"textDescription"},"Users with this role can use Netdata to troubleshoot, not manage entities. They can access any Room in the Space.")),a.createElement(pl,null),n&&a.createElement(ml,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,a.createElement(d.Text,{id:"managers"},"Managers"),a.createElement("br",null),a.createElement(d.TextSmall,{color:"textDescription"},"Users with this role can manage Rooms and Users. They can access any Room in the Space.")),a.createElement(pl,null),n&&a.createElement(pl,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,a.createElement(d.Text,{id:"observers"},"Observers"),a.createElement("br",null),a.createElement(d.TextSmall,{color:"textDescription"},"Users with this role can only view data in specific Rooms.")),a.createElement(pl,null),n&&a.createElement(pl,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,a.createElement(d.Text,{id:"billing"},"Billing"),a.createElement("br",null),a.createElement(d.TextSmall,{color:"textDescription"},"Users with this role can handle billing options and invoices.")),a.createElement(pl,null),n&&a.createElement(pl,null),a.createElement(ml,null),a.createElement(ml,null),a.createElement(ul,null,a.createElement(d.Text,{id:"billing"},"Member"),a.createElement("br",null),a.createElement(d.TextSmall,{color:"textDescription"},"This role allows users to manage rooms and invite fellow Member teammates. These users cannot see all rooms in the Space but can see all Nodes since they are always on the All Nodes.")),t?a.createElement(ml,null):a.createElement(pl,null),n&&a.createElement(pl,null),a.createElement(pl,null),a.createElement(pl,null))}))),yl=(0,a.memo)(fl((function(e){var t=e.isPro;return a.createElement(a.Fragment,null,a.createElement(ul,null,"Service Availability"),a.createElement(ul,{center:!0},"Best Effort (99.5% in last 12 months)"),t&&a.createElement(ul,{center:!0},"Best Effort (99.5% in last 12 months)"),a.createElement(ul,{center:!0},"99.9% annually (excl. scheduled maintenance)"),a.createElement(ul,{center:!0},"Same as Business plan"),a.createElement(ul,null,"Technical Support"),a.createElement(ul,{center:!0},"Public Forums, Tickets & Chat"),t&&a.createElement(ul,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(ul,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(ul,{center:!0},"Custom Design to Meet Requirements"),a.createElement(ul,null,"Initial Deployment Consulting Services"),a.createElement(ul,{center:!0},"Public Forums, Tickets & Chat"),t&&a.createElement(ul,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(ul,{center:!0},"Public Forums, Tickets & Chat"),a.createElement(ul,{center:!0},"Remote or On Site Consultation and Training During Deployment"))}))),xl=function(e){var t,n=e.plans,r=e.currentPlan,l="free"==(null===r||void 0===r?void 0:r.slug)&&"2023.02"==(null===r||void 0===r?void 0:r.version),c="earlyBird"===(null===r||void 0===r?void 0:r.slug),s="pro"===(null===r||void 0===r?void 0:r.slug),u=null===(t=Object.values((null===n||void 0===n?void 0:n.free)||{}))||void 0===t||null===(t=t[0])||void 0===t||null===(t=t[0])||void 0===t?void 0:t.planLimitations,m=(0,a.useState)((function(){return[!1,!0,!0,!0,!0]})),d=(0,o.Z)(m,2),p=d[0],g=d[1],f={isOldCommunity:l,isEarlyBird:c,isPro:s,freePlanLimitattions:u,showAllPlans:!0,onToggle:function(e){return g((function(t){return t[e]=!t[e],(0,wa.Z)(t)}))},collapsed:p};return a.createElement(a.Fragment,null,a.createElement(bl,(0,i.Z)({title:"General",index:0},f)),a.createElement(hl,(0,i.Z)({title:"Features",index:1},f)),a.createElement(El,(0,i.Z)({title:"Usage Allowances",index:2},f)),a.createElement(vl,(0,i.Z)({title:"User Roles",index:3},f)),a.createElement(yl,(0,i.Z)({title:"Support",index:4},f)))},wl=function(e){var t=e.plans,n=e.loaded,r=e.currentLoaded,l=e.currentPlan;return a.createElement(d.Flex,{column:!0,height:"100%",gap:3},a.createElement(al,{currentPlan:l}),n&&r?a.createElement(d.Flex,{column:!0,gap:5,height:"100%",padding:[0,0,20,0]},a.createElement(Zr,{plans:t,currentPlan:l,showAllPlans:!0},a.createElement(d.Flex,{column:!0,height:50,justifyContent:"center"},a.createElement(d.Text,{strong:!0},"Pricing"))),a.createElement(d.Flex,{column:!0,gap:5,height:"100%",overflow:{vertical:"auto"}},a.createElement(xl,{plans:t,currentPlan:l}))):a.createElement(cn.Z,{title:n?"Loading billing info...":"Loading Netdata plans..."}))},Cl={Community:0,Pro:1,Business:2},Ol={month:"Monthly",year:"Yearly"},Pl=function(e){var t=e.from,n=e.to,a=e.fromNodes,r=e.toNodes,l=e.interval,o=e.success,i=void 0===o||o,c=Ol[l]||l;if(t===n&&a===r)return{header:i?"Successful billing cycle change":"Failed to update billing cycle",text:i?"Subscription billing cycle changed to ".concat(c):"Subscription is still on ".concat(c," billing cycle")};if(t===n)return{header:i?"Successful change of commitment":"Failed to change the commitment",text:i?"Commitment ".concat(a<r?"increased":"decreased"," from ").concat(a," to ").concat(r," nodes"):"Commitment remained the same, ".concat(a," nodes")};var s=Cl[t]>Cl[n];return{header:i?"Successfully ".concat(s?"downgraded":"upgraded"," plan"):"Failed to ".concat(s?"downgrade":"upgrade"," plan"),text:i?"Subsrciprion ".concat(s?"downgraded":"upgraded"," from ").concat(t," to ").concat(n," plan (").concat(c,")"):"Remained on ".concat(t," plan")}},Zl=function(){!function(){var e=(0,on.lr)(),t=(0,o.Z)(e,2),n=t[0],r=t[1],l=(0,we.Z)(),i=(0,o.Z)(l,2),c=i[0],s=i[1];(0,a.useEffect)((function(){var e=n.get("from"),t=n.get("from_committed_nodes"),a=n.get("interval"),l=n.get("result"),o=n.get("to"),i=n.get("to_committed_nodes");switch(l){case"success":var u={from:e,fromNodes:t,interval:a,to:o,toNodes:i,success:!0};c(Pl(u)),(0,tl.L)("billing","callback","global-view",u);break;case"failure":var m={from:e,fromNodes:t,interval:a,to:o,toNodes:i,success:!1};s(Pl(m)),(0,tl.L)("billing","callback","global-view",m)}n&&l&&(n.delete("from"),n.delete("fromNodes"),n.delete("interval"),n.delete("result"),n.delete("to"),n.delete("toNodes"),r(n))}),[n])}();var e=(0,Gn.Gl)(),t=e.loaded,n=e.value,l=(0,Gn.RP)(),i=l.loaded,c=l.value,s=(0,zn.m)();return a.createElement(_.ZP,{feature:"Billing"},a.createElement(d.Flex,{column:!0,height:"calc(100% - 30px)",gap:3},a.createElement(r.Z5,null,a.createElement(r.AW,{path:"/all-plans",element:a.createElement(wl,{isSmall:s,currentPlan:c,loaded:t,currentLoaded:i,plans:n})}),a.createElement(r.AW,{path:"/",element:a.createElement(el,{isSmall:s,currentPlan:c,loaded:t,currentLoaded:i,plans:n})}))))},Tl=n(41898),Sl=["containerProps"],kl=["settingsTab"];function Il(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function jl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Il(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Il(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fl=(0,s.Z)((function(){return Promise.all([n.e(6502),n.e(6129)]).then(n.bind(n,66129))})),Dl=(0,m.default)(p.G).withConfig({displayName:"manage-workspace__ColumnHeader",componentId:"sc-j9n54n-0"})(["width:180px;padding:16px;"]),Al=function(e){return function(t){return a.createElement(g.TZ,{flex:"1",overflow:"hidden"},a.createElement(e,t))}},Ml=function(e){return function(t){var n=t.containerProps,r=void 0===n?{}:n,l=(0,c.Z)(t,Sl);return a.createElement(g.TZ,(0,i.Z)({flex:"1",overflow:"hidden",height:"100%",padding:[4,0,0]},r),a.createElement(e,l))}},Nl=Al(_n),Bl=Al(qe),Ll=Al(ht),Rl=Al(pt),_l=Ml(Cn),Ul=Al(Zl),Vl=Ml(function(e){return function(t){return a.createElement(a.Suspense,{fallback:"Loading settings tab..."},a.createElement(e,t))}}(Fl)),Hl=(0,a.memo)((function(){var e=(0,r.s0)(),t=(0,r.TH)(),n=t.state,l=void 0===n?{}:n,i=t.pathname,s=(0,r.UO)(),m=s.settingsTab,p=(0,c.Z)(s,kl),b=(0,a.useState)((null===l||void 0===l?void 0:l.previousUrlPath)||null),E=(0,o.Z)(b,1)[0],y=(0,v.OS)("name"),x=function(e){var t=z.dH.indexOf(e);return-1!==t?t:z.z2}(m),w=(0,a.useCallback)((function(t){var n=function(e,t){var n=e.split("/"),a=n.indexOf("settings")+1-n.length;return"".concat(n.slice(0,a).join("/"),"/").concat(z.dH[t]||z.z2)}(i,t);e(n)}),[m]);(0,a.useEffect)((function(){z.fV[m]||e((0,u.Gn)(i,jl(jl({},p),{},{settingsTab:z.z2})))}),[]);var C=(0,h.gI)("billing:ReadBasic"),O=(0,h.gI)("room:ReadAll"),P=(0,h.gI)("user:ReadAll"),Z=(0,h.gI)("channel:ReadAll"),T=(0,k.jW)();(0,a.useEffect)((function(){C||m===z.fM&&e((0,u.Gn)(i,jl(jl({},p),{},{settingsTab:z.z2})))}),[C,m]);var S=(0,v.uk)(),I=(0,a.useCallback)((function(){e(E||"/spaces/".concat(S))}),[E,S]);return y?a.createElement(_.ZP,{feature:"SpaceSettings"},a.createElement(g.u6,{full:!0,"data-testid":"manageWorkspaceModal",closeOnClickOutside:!1,onClose:I,width:"100%"},a.createElement(f.x,{"data-testid":"manageWorkspaceModal-header",onClose:I,title:a.createElement(Wn,null)}),a.createElement(d.Tabs,{row:!0,column:!1,"data-testid":"manageWorkspaceModal-tabs",selected:x,onChange:w,TabsHeader:Dl,tabsProps:{column:!0},height:"100%",noDefaultBorder:!0,position:"relative",overflow:"hidden",width:"100%"},a.createElement(d.Tab,{basis:0,"data-testid":"manageWorkspaceModal-spaceTab",label:z.fV[z.m3],"data-ga":"manage-space::click-tab::space-tab",isMenuItem:!0},a.createElement(Nl,{"data-testid":"manageWorkspaceModal-spaceTabContent",onClose:I,small:!0})),a.createElement(d.Tab,{basis:0,"data-testid":"manageWorkspaceModal-warRoomsTab","data-ga":"manage-space::click-tab::rooms-tab",label:"Rooms",isMenuItem:!0},a.createElement(Bl,{"data-testid":"manageWorkspaceModal-warRoomsTabContent"})),(O||T)&&a.createElement(d.Tab,{basis:0,label:"Nodes","data-testid":"manageWorkspaceModal-nodesTab","data-ga":"manage-space::click-tab::nodes-tab",isMenuItem:!0},a.createElement(Ll,{"data-testid":"manageWorkspaceModal-nodesTabContent"})),P&&a.createElement(d.Tab,{basis:0,"data-testid":"manageWorkspaceModal-usersTab","data-ga":"manage-space::click-tab::users-tab",label:"Users",isMenuItem:!0},a.createElement(Rl,{"data-testid":"manageWorkspaceModal-usersTabContent"})),Z&&a.createElement(d.Tab,{basis:0,label:"Alerts & Notifications","data-testid":"manageWorkspaceModal-notificationsTab","data-ga":"manage-space::click-tab::notifications-tab",isMenuItem:!0},a.createElement(_l,null)),C&&!window.envSettings.onprem&&a.createElement(d.Tab,{basis:0,"data-testid":"manageWorkspaceModal-billingTab","data-ga":"manage-space::click-tab::billing-tab",label:"Plan & Billing",isMenuItem:!0},a.createElement(Ul,{"data-testid":"manageWorkspaceModal-billingTabContent"})),a.createElement(d.Tab,{basis:0,"data-testid":"manageWorkspaceModal-integrationsTab","data-ga":"manage-space::click-tab::integrations-tab",label:"Integrations",isMenuItem:!0},a.createElement(Vl,{flavour:Tl.RV.settingsPage,containerProps:{padding:[0]},"data-testid":"manageWorkspaceModal-integrationsTabContent"}))))):null})),Wl=function(){var e=(0,r.TH)(),t=e.pathname,n=e.state;return a.createElement(r.Z5,null,a.createElement(r.AW,{path:"/",element:a.createElement(r.Fg,{state:n,to:{pathname:"".concat(t,"/").concat(z.z2)}})}),a.createElement(r.AW,{path:":settingsTab/*",element:a.createElement(Hl,null)}))}},14809:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var a=n(87462),r=n(67294),l=n(93416),o=n(89250),i=n(13477),c=n(94666),s=n(15861),u=n(29439),m=n(64687),d=n.n(m),p=(n(57327),n(41539),n(88449),n(2490),n(59849),n(4480)),g=n(93017),f=n(274),b=n(46585),h=n(74059),E=n(57079),v=n(58502),y=n(95383),x=n(53606),w="leave-space-dialog",C="leaveSpaceDialog",O=function(e){var t=e.id,n=e.name,m=e.onClose,O=(0,o.s0)(),P=(0,i.Iy)("id"),Z=(0,c.H4)(),T=(0,c.nP)(),S=(0,c.Wy)(),k=function(e){var t=(0,g.Z)(),n=(0,u.Z)(t,2)[1];return(0,p._8)((function(t){var a=t.snapshot,r=t.set,l=t.reset;return function(){var t=(0,s.Z)(d().mark((function t(o){var i,s,m,p,g,x,w,C,O;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=o.currentUserId,s=o.onSuccess,m=o.onError,t.next=3,a.getPromise((0,h.st)("ids"));case 3:if(p=t.sent,g=p.filter((function(t){return e!==t})),x=(0,u.Z)(g,1),w=x[0]){t.next=9;break}return n({header:"Spaces",text:b.T$.leave}),t.abrupt("return");case 9:if(t.t0=w,!t.t0){t.next=14;break}return t.next=13,a.getPromise((0,v.ZP)(w));case 13:t.t0=t.sent;case 14:return C=t.t0,O=C.slug,r((0,h.st)("ids"),g),r(E.Z,(function(t){return t.filter((function(t){return t!==e}))})),t.prev=18,t.next=21,(0,f.Sz)(e,[i]);case 21:s&&s(O),(0,c.zm)(l,e),(0,y.r1)(l,e),l((0,v.ZP)(e)),t.next=31;break;case 27:t.prev=27,t.t1=t.catch(18),r((0,h.st)("ids"),p),m&&m();case 31:case"end":return t.stop()}}),t,null,[[18,27]])})));return function(e){return t.apply(this,arguments)}}()}),[e])}(t),I=(0,x.Z)(t),j=(0,r.useCallback)((function(e){return O("/spaces/".concat(e))}),[]),F=1===Z.length,D=1===T.length&&S,A=F?{confirmLabel:"Yes, leave","data-ga":"".concat(w,"-last-member"),"data-testid":"".concat(C,"LastMember"),handleConfirm:function(){return I({onSuccess:j})},message:r.createElement(r.Fragment,null,"If you leave, space ",r.createElement("strong",null,n)," will be deleted immediately.",r.createElement("br",null),"Are you sure you want to continue?"),title:"Leave and delete ".concat(n," space")}:D?{confirmLabel:"Give rights","data-ga":"".concat(w,"-last-admin"),"data-testid":"".concat(C,"LastAdmin"),handleConfirm:function(){return O("users")},isConfirmPositive:!0,message:r.createElement(r.Fragment,null,"You are the last admin of ",r.createElement("strong",null,n)," space. Please give admin rights to another member so you can leave this space."),title:"Leave ".concat(n," space")}:{confirmLabel:"Yes, leave","data-ga":w,"data-testid":C,handleConfirm:function(){return k({currentUserId:P,onSuccess:j})},message:r.createElement(r.Fragment,null,"You are about to leave ",r.createElement("strong",null,n)," space.",r.createElement("br",null),"Are you sure you want to continue?"),title:"Leave ".concat(n," space")};return r.createElement(l.ConfirmationDialog,(0,a.Z)({handleDecline:m},A))}},43656:function(e,t,n){"use strict";var a=n(29439),r=n(37518),l=n(96929),o=n(41379),i=n(74059),c=n(97945),s=n(46667);t.Z=function(){var e=(0,r.Jb)().id,t=void 0===e?"":e,n=(0,l.X7)(t,"ids"),u=(0,l.X7)(t,"loaded"),m=(0,c.Ne)(n),d=(0,i.th)(),p=(0,s.Z)(),g=(0,a.Z)(p,4),f=g[0],b=g[3];return(0,o.Z)({id:t,spaceId:d,polling:!0}),{areDefaultRoomNodesLoaded:u,nodes:m,isClaimNodeModalOpen:f,closeClaimNodeModal:b}}},21285:function(e,t,n){"use strict";var a=n(47908),r=n(51400),l=n(26244);e.exports=function(e){for(var t=a(this),n=l(t),o=arguments.length,i=r(o>1?arguments[1]:void 0,n),c=o>2?arguments[2]:void 0,s=void 0===c?n:r(c,n);s>i;)t[i++]=e;return t}},43290:function(e,t,n){"use strict";var a=n(82109),r=n(21285),l=n(51223);a({target:"Array",proto:!0},{fill:r}),l("fill")},73955:function(e,t,n){var a=n(79833),r=0;e.exports=function(e){var t=++r;return a(e)+t}}}]);