File: //opt/netdata/usr/local/local/share/netdata/web/v3/7667.08bcd0b173ba9b825242.chunk.js
try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},o=(new e.Error).stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="afd9478b-e943-46a5-8be0-bf381349db5e",e._sentryDebugIdIdentifier="sentry-dbid-afd9478b-e943-46a5-8be0-bf381349db5e")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"7c174a810ceb580519f3181b86370f2046d11e4e"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[5187,7667],{17667:(e,o,t)=>{t.r(o),t.d(o,{default:()=>ro});var n=t(96540),l=t(87073),a=t(24285),s=t(88934),r=t(18121),i=t(6304),c=t(32742),d=(t(98992),t(81454),t(33185)),u=t(24609),p=t(70140),h=t(24655),g=t(74848);const x=(0,d.default)(l.Flex).attrs((e=>({width:"100%",column:!0,alignItems:"center",overflow:{vertical:"auto",horizontal:"hidden"},...e}))).withConfig({displayName:"spacesList__SpacesListContainer",componentId:"sc-vabwjt-0"})(["margin-top:-8px;&&{margin-bottom:8px;}"]),C=()=>{const e=(0,u.vt)(),o=(0,p.A)(),{spaceIds:t,colors:n}=o||{};return(0,g.jsx)(x,{"data-testid":"workspaceBar-spacesList",children:t.map((o=>{const t=n?.[o];return(0,g.jsx)(h.A,{testIdPrefix:"workspaceBar-space",spaceId:o,active:o===e,backgroundColor:t},o)}))})};var m=t(46587),b=t(72679),j=t(64156),f=t(63872);const v=()=>{const e=(0,n.useRef)(),[o,,t,l]=(0,i.A)(),[s,r]=(0,a.tF)("spacesList"),c=(0,p.A)(),[d,u]=(0,n.useState)(c),[h,,g,x]=(0,i.A)(),[C]=(0,f.A)(),m=(0,n.useCallback)((e=>{u((o=>({...o,spaceIds:e})))}),[u]),b=(0,n.useCallback)((e=>{let{id:o,color:t}=e;u((e=>({...e,colors:{...e.colors,[o]:t}})))}),[u]),j=(0,n.useCallback)((e=>{u((o=>({...o,colors:{...o.colors,[e]:c.colors?.[e]}})))}),[c,u]),v=(0,n.useCallback)((e=>{u((o=>({...o,colors:{...o.colors,[e]:void 0}})))}),[u]),k=(0,n.useCallback)((e=>{t(),r(d),l(),x(),C({header:"Success",text:"Your changes have been successfully saved."}),"function"===typeof e&&e()}),[d,r,x,C,t,l]),w=(0,n.useMemo)((()=>!!s),[s]),I=(0,n.useCallback)((()=>{t(),r(null),l(),C({header:"Success",text:"All settings have been successfully deleted."})}),[r,t,l]),y=(0,n.useCallback)((()=>{u(c),x()}),[c,u,x]);return(0,n.useEffect)((()=>{u(c)}),[c,u]),(0,n.useEffect)((()=>(e.current=Date.now(),()=>{e.current=0})),[]),(0,n.useEffect)((()=>{Date.now()-e.current>500&&g()}),[d,e]),{state:d,onOrderChange:m,onColorChange:b,onColorReset:j,onColorClear:v,onSave:k,onDelete:I,onReset:y,canDelete:w,isDirty:h,loading:o}};var k=t(43375),w=t(43627),I=t(74979),y=t(7542);const A=(0,d.default)(l.Flex).attrs((e=>({width:7,height:7,round:!0,border:{side:"all",color:"border"},cursor:"pointer",alignItems:"center",justifyContent:"center",...e}))).withConfig({displayName:"styled__StyledColorBox",componentId:"sc-1iqu0oz-0"})(["background-color:",";"],(e=>e.background)),S=(0,d.default)(l.Icon).attrs((e=>({color:(0,y.T4)(e.backgroundColor)?["neutral","black"]:["neutral","white"],...e}))).withConfig({displayName:"styled__StyledIcon",componentId:"sc-1iqu0oz-1"})([""]);var F=t(45087);t(8872);const R={green:["green50","green100","green150","green180"],red:["red50","red100","red150","red180"],yellow:["yellow50","yellow100","yellow150","yellow180"],blue:["blue50","blue100","blue150","blue180"],purple:["purple50","purple100","purple150","purple180"],violet:["violet50","violet100","violet150","violet180"]};var B=t(74891);const T=(0,B.A)(A),D=e=>{let{value:o,theme:t,onChange:a}=e;const s=(0,n.useMemo)((()=>Object.entries(R).reduce(((e,o)=>{let[n,a]=o;return[...e,...a.map((e=>(0,l.getColor)([n,e])({theme:t})))]}),[])),[t]),r=(0,n.useCallback)((()=>{const e=Math.floor(Math.random()*s.length-1),o=s[e];a({target:{value:o}})}),[s,a]);return(0,g.jsx)(T,{border:"none",background:o,onClick:r,tooltip:"Change to random color",children:(0,g.jsx)(S,{name:"refresh",backgroundColor:o})})},P=(0,n.memo)(D),_=e=>{let{theme:o,onChange:t}=e;return(0,g.jsx)(l.Flex,{gap:2,children:Object.entries(R).map((e=>{let[n,a]=e;return(0,g.jsx)(l.Flex,{column:!0,gap:2,children:a.map((e=>{const a=(0,l.getColor)([n,e])({theme:o});return(0,g.jsx)(A,{border:"none",background:a,onClick:()=>t({target:{value:a}})},e)}))},n)}))})},M=(0,n.memo)(_),O=e=>{let{value:o,onChange:t}=e;const a=(0,d.useTheme)(),[s,r]=(0,n.useState)();return(0,n.useEffect)((()=>{r((0,y.Bi)(o)?null:"Invalid color value.")}),[o]),(0,g.jsxs)(l.Flex,{column:!0,gap:2,padding:[4],children:[(0,g.jsxs)(l.Flex,{gap:2,children:[(0,g.jsx)(P,{value:o,theme:a,onChange:t}),(0,g.jsx)(l.TextInput,{height:7,value:o,onChange:t,error:s})]}),(0,g.jsx)(l.TextSmall,{children:"Choose from default colors."}),(0,g.jsx)(M,{theme:a,onChange:t})]})},N=e=>{let{value:o,tooltip:t,onChange:a}=e;const s=(0,n.useRef)(),[r,c,,d]=(0,i.A)(!1);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(F.A,{align:"bottom",content:t,children:(0,g.jsx)(l.Flex,{ref:s,children:(0,g.jsx)(A,{background:o,onClick:c})})}),s.current&&r?(0,g.jsx)(l.Drop,{width:60,target:s.current,align:{top:"bottom",right:"right"},background:"modalBackground",margin:[2,0,0],round:!0,onClickOutside:d,onEsc:d,children:(0,g.jsx)(O,{value:o,onChange:a})}):null]})},L=e=>{let{value:o,onChange:t}=e;const l=(0,d.useTheme)(),a=(0,n.useMemo)((()=>l?.colors?.spaceIdle),[l]);return(0,g.jsx)(N,{value:o||a,onChange:t,tooltip:"Change color"})},E=e=>{let{id:o,color:t,onColorChange:l,onColorReset:a,onColorClear:s}=e;const r=(0,p.A)(),i=(0,n.useMemo)((()=>r.colors?.[o]!=t),[r,t]),c=(0,n.useCallback)((e=>{l({id:o,color:e.target.value})}),[o,l]),d=(0,n.useCallback)((()=>{a(o)}),[o,a]),u=(0,n.useCallback)((()=>{s(o)}),[o,s]);return{isDirty:i,hasColor:!!t,onChange:c,onReset:d,onClear:u}},H=(0,B.A)(l.Icon),z=e=>{let{id:o,color:t,onColorChange:n,onColorReset:a,onColorClear:s}=e;const{attributes:r,listeners:i,setNodeRef:c,transform:d,transition:p}=(0,w.gl)({id:o}),h={transform:I.Ks.Transform.toString(d),transition:p},{name:x}=(0,u.ns)(o),{isDirty:C,hasColor:m,onChange:b,onReset:j,onClear:f}=E({id:o,color:t,onColorChange:n,onColorReset:a,onColorClear:s});return(0,g.jsx)("div",{ref:c,style:h,...r,children:(0,g.jsxs)(l.Flex,{gap:1,alignItems:"center",children:[(0,g.jsx)(l.Icon,{name:"nav_dots",color:"textLite",...i,cursor:"grab"}),(0,g.jsx)(L,{value:t,onChange:b}),(0,g.jsx)(l.TextBig,{padding:[0,0,0,2],children:x}),C?(0,g.jsx)(H,{name:"reload",color:"text",cursor:"pointer",onClick:j,tooltip:"Reset background color to previous value",noWrapper:!0}):null,m?(0,g.jsx)(H,{name:"x",color:"text",cursor:"pointer",onClick:f,tooltip:"Remove background color",noWrapper:!0}):null]},o)})},W=e=>{let{spaceIds:o,colors:t,onOrderChange:l,onColorChange:a,onColorReset:s,onColorClear:r}=e;const[i,c]=(0,n.useState)(o),d=(0,k.FR)((0,k.MS)(k.AN),(0,k.MS)(k.uN,{coordinateGetter:w.JR})),u=(0,n.useCallback)((e=>{const{active:o,over:t}=e;o?.id&&t?.id&&o.id!==t.id&&c((e=>{const n=e.indexOf(o.id),l=e.indexOf(t.id);return(0,w.be)(e,n,l)}))}),[w.be,c]);return(0,n.useEffect)((()=>{c(o)}),[o,c]),(0,n.useEffect)((()=>{l(i)}),[i,l]),(0,g.jsx)(k.Mp,{sensors:d,collisionDetection:k.fp,onDragEnd:u,children:(0,g.jsx)(w.gB,{items:i,strategy:w._G,children:i.map((e=>(0,g.jsx)(z,{id:e,color:t?.[e],onColorChange:a,onColorReset:s,onColorClear:r},e)))})})},U=e=>{let{spaceIds:o,colors:t,onOrderChange:n,onColorChange:a,onColorReset:s,onColorClear:r}=e;return(0,g.jsxs)(l.Flex,{column:!0,gap:4,children:[(0,g.jsx)(l.Text,{children:"Reorder spaces by dragging and customize their colors using the color picker."}),(0,g.jsx)(l.Flex,{column:!0,gap:4,children:(0,g.jsx)(W,{spaceIds:o,colors:t,onOrderChange:n,onColorChange:a,onColorReset:s,onColorClear:r})})]})},q="closeModal",G="deleteSettings",Y=()=>(0,g.jsxs)(l.Flex,{column:!0,gap:2,children:[(0,g.jsx)(l.Text,{children:"There are some unsaved changes that will be lost after closing the modal window."}),(0,g.jsx)(l.Text,{children:"Are you sure you want to colse without saving your changes?"})]}),V=()=>(0,g.jsxs)(l.Flex,{column:!0,gap:2,children:[(0,g.jsx)(l.Text,{children:"You are about to delete all previously saved settings. This action cannot be reverted."}),(0,g.jsx)(l.Text,{children:"Are you sure you want to continue?"})]}),J={[q]:{title:"Close modal",confirmLabel:"Close without saving",message:(0,g.jsx)(Y,{})},[G]:{title:"Delete settings",confirmLabel:"Yes, delete settings",message:(0,g.jsx)(V,{})}},Z=e=>{let{flavour:o,handleConfirm:t,handleDecline:a}=e;const s=(0,n.useMemo)((()=>J[o]),[o]);return(0,g.jsx)(l.ConfirmationDialog,{"data-testid":"spacesListDialog",handleConfirm:t,handleDecline:a,...s})},$=(0,B.A)(l.Button),K=e=>{let{onClose:o}=e;const{state:t,onOrderChange:a,onColorChange:s,onColorReset:r,onColorClear:i,onSave:c,onDelete:d,onReset:u,canDelete:p,isDirty:h,loading:x}=v(),{spaceIds:C,colors:m}=t||{},b=(0,j.A)("(max-width: 767px)"),f=x,[k,w]=(0,n.useState)(),I=(0,n.useCallback)((()=>w()),[w]),y=(0,n.useMemo)((()=>({width:b?"90vw":{min:"400px",base:"30vw"},height:b?"90vh":{max:"90vh"}})),[b]),A=(0,n.useCallback)((()=>{h?w(q):o()}),[h,w,o]),S=(0,n.useCallback)((()=>{w(G)}),[w]),F=(0,n.useCallback)((()=>{if(k===q)return I(),void o();k===G&&(d(),o())}),[k,o,I]),R=(0,n.useCallback)((()=>{c(o)}),[c]);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(l.Modal,{backdropProps:{backdropBlur:!0},onEsc:A,children:(0,g.jsxs)(l.ModalContent,{...y,children:[(0,g.jsxs)(l.ModalHeader,{justifyContent:"between",padding:[4],round:!0,children:[(0,g.jsx)(l.Flex,{gap:3,alignItems:"center",children:(0,g.jsx)(l.H4,{children:"Configure spaces list"})}),(0,g.jsx)(l.ModalCloseButton,{onClose:A})]}),(0,g.jsx)(l.ModalBody,{overflow:{vertical:"auto"},children:(0,g.jsx)(U,{spaceIds:C,colors:m,onOrderChange:a,onColorChange:s,onColorReset:r,onColorClear:i})}),(0,g.jsxs)(l.ModalFooter,{gap:2,justifyContent:"between",children:[(0,g.jsx)($,{label:"Delete all settings",flavour:"borderless",disabled:f||!p,onClick:S,danger:!0,tooltip:f||!p?null:"Delete any previously saved settings."}),(0,g.jsxs)(l.Flex,{gap:2,children:[(0,g.jsx)(l.Button,{label:"Close",flavour:"hollow",onClick:A,disabled:f}),(0,g.jsx)(l.Button,{label:"Reset",flavour:"hollow",onClick:u,disabled:f||!h}),(0,g.jsx)(l.Button,{label:"Save",onClick:R,disabled:f||!h})]})]})]})}),k?(0,g.jsx)(Z,{flavour:k,handleConfirm:F,handleDecline:I}):null]})};var X=t(21548);const Q=e=>{let{onSpaceSettingsClick:o,onSpaceListClick:t,onClose:a}=e;const s=(0,n.useCallback)((e=>()=>{"function"===typeof e&&e(),a()}),[a]),r=(0,n.useMemo)((()=>[{label:"Space Settings",onClick:s(o),border:{side:"bottom",color:"border"}},{label:"Customize Space List",onClick:s(t)}]),[o,t,a]);return(0,g.jsx)(l.Flex,{column:!0,round:.5,border:{side:"all",color:"border"},children:r.map((e=>(0,g.jsx)(X.A,{...e},e.label)))})},ee=d.default.div.withConfig({displayName:"separator__Separator",componentId:"sc-met802-0"})(["height:1px;width:",";background:",";"],(0,l.getSizeBy)(3),(0,l.getColor)("border")),oe=()=>{const e=(0,n.useRef)(),[o,t,,a]=(0,i.A)(!1),[s,,r,c]=(0,i.A)(),d=(0,p.A)(),{spaceIds:u}=d||{},h=(0,m.uW)("isAnonymous"),x=(0,b.A)();return h||!u.length?null:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(ee,{"data-testid":"workspaceBar-separator"}),(0,g.jsx)(l.Flex,{"data-testid":"space-list-settings-container",ref:e,children:(0,g.jsx)(l.IconButton,{icon:"settings_h",iconColor:"text",neutral:!0,onClick:t})}),e.current&&o?(0,g.jsx)(l.Drop,{width:45,target:e.current,align:{top:"top",left:"right"},background:"darkBackground",round:!0,onClickOutside:a,onEsc:a,children:(0,g.jsx)(Q,{onSpaceSettingsClick:x,onSpaceListClick:r,onClose:a})}):null,s&&(0,g.jsx)(K,{onClose:c})]})};var te=t(30582),ne=t(99746),le=t(51571),ae=t(19186),se=t(45187),re=t(48464),ie=t(39175);const ce=(0,B.A)(l.IconButton),de=e=>{const o=(0,ae.ID)(),t=(0,ie.tB)(o),n=(0,m.uW)("isAnonymous"),{isInitialized:a}=(0,se.R)();return!a||t||n?null:(0,g.jsx)(l.Flex,{position:"relative",children:(0,g.jsx)(ce,{className:re.zs,"data-testid":"open-referrer-modal",icon:"giftbox",neutral:!0,width:"20px",height:"20px",tooltip:{title:"Referral program",description:"Spread the word, earn up to $1000 with Netdata!"},tooltipProps:{align:"right"},...e})})},ue=(0,B.A)(l.IconButton),pe=e=>{let{modalProps:o={},...t}=e;const n=(0,u.vt)(),a=(0,ie.ES)(n);return(0,g.jsx)(l.News,{app:ie.Ay?a?"agent":["cloud","agent"]:"cloud",modalProps:o,children:e=>{let{toggle:o,upToDate:n}=e;return(0,g.jsx)(ue,{icon:"insights",iconColor:n?"text":"attention",onClick:o,"data-ga":"news::click-news::global-view","data-testid":"cloud-app-news",neutral:n,width:"20px",height:"20px",tooltip:{title:"News & Announcements",description:"Stay updated with the latest Netdata features and improvements"},tooltipProps:{align:"right"},...t})}})};var he=t(41514),ge=t(92318);const xe=(0,B.A)(l.IconButton),Ce=(0,d.default)(l.Flex).attrs((e=>({width:"32px",height:"32px",alignItems:"center",justifyContent:"center",border:{side:"all",color:e.isOpen?"primary":"border"},round:"50%",...e}))).withConfig({displayName:"spaceInfo__Accessor",componentId:"sc-1jvcnnq-0"})([""]),me=(0,d.default)(l.Flex).attrs((e=>({column:!0,gap:1,alignItems:"center",...e}))).withConfig({displayName:"spaceInfo__IconsContainer",componentId:"sc-1jvcnnq-1"})(["",""],(e=>{let{visible:o}=e;return o?"":"visibility: hidden;"})),be={onClickOut:()=>(0,he.H)("header-help","click-out-modal","global-view"),onCloseClick:()=>(0,he.H)("header-help","click-close","global-view"),onOpenIssueClick:()=>(0,he.H)("header-help","click-\u03bfpen-issue","global-view"),onContributeClick:()=>(0,he.H)("header-help","click-contribute","global-view"),onOpenBugClick:()=>(0,he.H)("header-help","click-bug","global-view"),onSupportClick:()=>(0,he.H)("header-help","click-support","global-view"),onVisitDocumentClick:()=>(0,he.H)("header-help","click-visit-doc","global-view"),onGoToDemoClick:()=>(0,he.H)("header-help","click-go-to-demo","global-view")},je=()=>{const[e,o]=(0,r.useHovered)({},[]),t=o,a=(0,n.useCallback)((()=>{window.open("https://status.netdata.cloud","_blank")}),[]);return(0,g.jsxs)(l.Flex,{id:"space-info-container",width:"100%",alignItems:"center",ref:e,column:!0,gap:2,children:[(0,g.jsxs)(me,{visible:t,children:[(0,g.jsx)(l.Documentation,{app:"cloud",demoUrl:ge.A.demoUrl,modalProps:{"data-testid":"space-info-content-container"},...be,children:e=>(0,g.jsx)(xe,{icon:"question",iconColor:"primary",neutral:!1,onClick:e,"data-ga":"header-help::click-help::global-view","data-testid":"documentation-button",width:"18px",height:"18px",tooltip:{title:"Help & Resources",description:"Read documentation, engage with the community and let us know about any feature requests or bugs"},tooltipProps:{align:"right"}})}),(0,g.jsx)(xe,{icon:"antenna",iconColor:"primary",neutral:!1,onClick:a,width:"18px",height:"18px",tooltip:{title:"Operational Status",description:"View service status, incidents, and maintenance updates for Netdata Cloud"},tooltipProps:{align:"right"}}),!window.envSettings.onprem&&(0,g.jsx)(n.Suspense,{fallback:"",children:(0,g.jsx)(pe,{iconColor:"primary",neutral:!1,modalProps:{"data-testid":"space-info-content-container"}})}),(0,g.jsx)(de,{iconColor:"primary",neutral:!1})]}),(0,g.jsx)(Ce,{isOpen:t,children:(0,g.jsx)(l.Icon,{name:"informationPress",color:t?"primary":"text"})})]})};var fe=t(94404);const ve=(0,B.A)(le.A),ke=(0,fe.A)(ve),we=e=>{let{spacePanelCollapsed:o,toggleSpacePanel:t}=e;const[a,,d,u]=(0,i.A)(),p=(0,s.Zp)(),h=(0,n.useCallback)((function(){let{slug:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return p(`/spaces/${e}`)}),[]),[x,m]=(0,r.useHovered)({},[]);return(0,g.jsxs)(l.Flex,{ref:x,height:"100vh",width:12,background:"sideBarMini","data-testid":"workspaceBar",padding:[3,0],column:!0,alignItems:"center",gap:6,justifyContent:"between",children:[(0,g.jsxs)(l.Flex,{width:"100%",column:!0,"data-testid":"workspaceBar-spaces-list",gap:4,alignItems:"center",overflow:"hidden",children:[o&&m?(0,g.jsx)(l.Flex,{"data-testid":"workspaceBar-expandButton",width:"32px",height:"32px",alignItems:"center",justifyContent:"center",cursor:"pointer",onClick:t,role:"button",children:(0,g.jsx)(l.Icon,{name:"chevron_right",color:"primary",width:"24px",height:"24px"})}):(0,g.jsx)(c.A,{"data-testid":"workspaceBar-netdataLogo"}),(0,g.jsx)(ee,{"data-testid":"workspaceBar-separator"}),(0,g.jsx)(C,{}),(0,g.jsx)(ke,{permission:"user:CreateSpace",ifForbidden:"hide",icon:"plus",onClick:d,"data-testid":"workspaceBar-addSpace-button",feature:"CreateSpace",isStart:!0,tooltip:{title:"Create New Space",description:"Spaces isolate infrastructure, providing fully independent administration and user management"},tooltipProps:{align:"right"},iconWidth:"20px",iconHeight:"20px",padding:[.5]}),(0,g.jsx)(oe,{})]}),(0,g.jsxs)(l.Flex,{column:!0,"data-testid":"workspaceBar-actionsList",gap:4,alignItems:"center",children:[(0,g.jsx)(je,{}),(0,g.jsx)(ne.A,{})]}),a&&(0,g.jsx)(te.A,{onClose:u,onDone:h})]})};var Ie=t(85005),ye=t(98595),Ae=t(64602),Se=t(99728);const Fe=e=>o=>{const t=(0,u.vt)();return(0,n.createElement)(e,{...o,key:t})};var Re=t(31933);const Be={isSidebar:!0,padding:[1,2,1,4],textColor:"menuItem"},Te=Fe((()=>{const e=(0,Se.JT)("room:Create"),o=(0,Se.JT)("room:Read"),[t,a]=(0,i.A)(o),[s,,r,c]=(0,i.A)(!1),d=(0,n.useCallback)((o=>{o.stopPropagation(),e&&r()}),[e]);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(ye.A,{"data-testid":"workspaceRooms-menuList",disabled:!o,headerTestId:"workspaceRooms-warRooms",isOpen:t,label:(0,g.jsxs)(l.Flex,{padding:[1,0],margin:[0,0,1,0],flex:!0,justifyContent:"between",alignItems:"center",height:"24px",children:[(0,g.jsxs)(l.Flex,{alignItems:"center",gap:2,children:[(0,g.jsx)(l.Icon,{name:"space_new",color:"menuItem",width:"14px",height:"14px"}),(0,g.jsx)(l.Text,{color:"menuItem",children:"Rooms"})]}),(0,g.jsxs)(l.Flex,{alignItems:"center",gap:2,children:[(0,g.jsx)(F.A,{content:"Create a new room",align:"right",children:(0,g.jsx)(le.A,{permission:"room:Create",icon:"plus",flavour:"hollow",onClick:d,"data-testid":"workspaceRooms-addWarRoom-button"})}),(0,g.jsx)(Ae.v,{right:!t,name:"chevron_down",size:"small",color:"textLite"})]})]}),toggleOpen:a,children:(0,g.jsx)(l.Flex,{column:!0,"data-testid":"workspaceRooms-warRoomsList",padding:[0,0,1],children:(0,g.jsx)(Re.A,{...Be})})}),s&&(0,g.jsx)(Ie.n,{onClose:c,isSubmodal:!1})]})}));var De=t(7960),Pe=t(85720),_e=t(98591);const Me=(0,d.default)(l.Flex).attrs({alignItems:"center",justifyContent:"center",width:10,height:4,round:.5,background:"sideBarMini"}).withConfig({displayName:"styled__AdminPill",componentId:"sc-1ps23b1-0"})(["opacity:0;",":hover &{opacity:1;}"],Pe.G),Oe=(0,De.A)((()=>t.e(35).then(t.bind(t,70035))),"CurrentPlan"),Ne=e=>{let{children:o,onToggle:t}=e;return(0,g.jsxs)(l.Flex,{column:!0,gap:1,children:[(0,g.jsxs)(l.Flex,{justifyContent:"between",alignItems:"center",children:[(0,g.jsx)(l.Flex,{alignItems:"center",overflow:"hidden",children:o}),(0,g.jsx)(l.Button,{onClick:t,icon:"chevron_left",neutral:!0,flavour:"hollow",small:!0})]}),(0,g.jsx)(n.Suspense,{fallback:"",children:(0,g.jsx)(Oe,{})})]})};var Le=t(89590),Ee=t(1174),He=t(61661),ze=t(89942);const We=()=>{const e=(0,ze.PP)(),[o,t]=(0,He.XL)(),{reset:l}=(0,He.b8)(),a=(0,n.useCallback)((()=>{l(),(0,ze.Z8)({...e,integrationsModalOpen:"true"}),t("true")}),[l,t,e]);return{isIntegrationsVisible:o,hideIntegrations:(0,n.useCallback)((()=>{(0,ze.Z8)({...e,integrationsModalOpen:""}),t("")}),[e,t]),onIntegrationsClick:a}};var Ue=t(56284);const qe=(0,De.A)((()=>t.e(2201).then(t.bind(t,52201)).then((e=>({default:e.TrialWarning})))),"TrialWarning"),Ge=(0,d.default)(ye.N).attrs({padding:[2],color:"textLite"}).withConfig({displayName:"spacePanel__ListHeader",componentId:"sc-1275zgk-0"})([""]),Ye=e=>(0,g.jsxs)(l.Flex,{alignItems:"center",gap:2,...e,children:[(0,g.jsx)(Me,{children:(0,g.jsx)(l.TextFemto,{strong:!0,color:"text",children:"ADMIN"})}),(0,g.jsx)(l.Flex,{opacity:"medium",children:(0,g.jsx)(l.Icon,{name:"padlock",size:"small",width:"18px",height:"18px",color:"text"})})]}),Ve={iconWidth:"14px",iconHeight:"14px",padding:[1,2],gap:2,isSidebar:!0,textColor:"menuItem",iconColor:"menuItem"},Je=e=>{let{toggleSpacePanel:o}=e;const t=(0,u.ap)(),[a,,s,r]=(0,i.A)(),[,c]=(0,_e.A)("manageInvitations"),d=(0,u.dg)(),{onIntegrationsClick:p}=We();return(0,g.jsxs)(g.Fragment,{children:[a&&(0,g.jsx)(Le.A,{onClose:r}),(0,g.jsx)(ye.A,{"data-testid":"spacesPanel",isOpen:!0,label:(0,g.jsx)(Ne,{onToggle:o,children:(0,g.jsx)(Ue.default,{maxFontSize:20,Component:l.TextSmall,strong:!0,title:t.name,lineHeight:"unset",children:t.name})}),headerTestId:"spacesPanel-activeSpaceHeader",Header:Ge,children:(0,g.jsxs)(l.Flex,{column:!0,padding:[2,0,1],"data-testid":"spacesPanel-menuList",children:[(0,g.jsx)(n.Suspense,{fallback:"",children:(0,g.jsx)(qe,{flavour:"sidebar"})}),(0,g.jsx)(Pe.A,{onClick:p,testid:"agentDashboard-addIntegrations",dataGa:"integrations::click-add-integrations::sideMenu",icon:"integrations",...Ve,children:"Integrations"}),d?null:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(Ee.A,{permission:"node:Create",children:e=>(0,g.jsx)(Pe.A,{actions:e?null:(0,g.jsx)(Ye,{"data-testid":"adminWarning-notAdmin"}),disabled:!e,onClick:s,testid:"spacesPanel-claimNodes",icon:"nodes_hollow",...Ve,children:"Connect Nodes"})}),(0,g.jsx)(Ee.A,{permission:"space:InviteUser",children:e=>(0,g.jsx)(Pe.A,{actions:e?null:(0,g.jsx)(Ye,{"data-testid":"adminWarning-cannotInvite"}),disabled:!e,onClick:c,testid:"spacesPanel-inviteUsers",icon:"user",...Ve,children:"Invite Users"})})]})]})})]})},Ze=e=>{let{spacePanelCollapsed:o,toggleSpacePanel:t}=e;return(0,g.jsx)(l.Collapsible,{width:56,background:"sideBar",border:{side:"right",color:"borderSecondary"},open:!o,direction:"horizontal",children:(0,g.jsxs)(l.Flex,{flex:!0,width:56,column:!0,overflow:{vertical:"hidden"},padding:[2,0],position:"relative",children:[(0,g.jsx)(Je,{toggleSpacePanel:t}),(0,g.jsx)(l.Flex,{overflow:{vertical:"auto"},flex:!0,column:!0,children:(0,g.jsx)(Te,{})})]})})};var $e=t(29263),Ke=t(32788),Xe=t(37846),Qe=t(62718),eo=t(14815),oo=t(60908);const to=(0,De.A)((()=>Promise.all([t.e(1220),t.e(3864),t.e(8791),t.e(3185),t.e(1861)]).then(t.bind(t,53185)))),no={"data-testid":"addIntegrationModal"},lo={"data-testid":"addIntegration-header"},ao={"data-testid":"addIntegration-content",overflow:"hidden",hasFooter:!1,padding:[0],hasModalTitle:!1},so=e=>{let{title:o="Integrations",onClose:t}=e;return(0,g.jsx)(oo.Ay,{feature:"IntegrationsModal",children:(0,g.jsxs)(Xe.GO,{right:!0,closeOnEsc:!0,closeOnOverlayClick:!0,onClose:t,...no,children:[(0,g.jsx)($e.z,{title:(0,g.jsx)(l.TextBig,{color:"textLite",children:o}),onClose:t,...lo||{}}),(0,g.jsx)(Ke.Yv,{...ao||{},children:(0,g.jsx)(n.Suspense,{fallback:(0,g.jsx)(Qe.H$,{}),children:(0,g.jsx)(to,{flavour:eo.D_.addNodesModal})})})]})})},ro=(0,n.memo)((()=>{const[e,o]=(0,a.tF)("spacePanelCollapsed"),{isIntegrationsVisible:t,hideIntegrations:s}=We(),r=(0,n.useCallback)((()=>o(!e)),[e,o]);return(0,n.useLayoutEffect)((()=>{const e=setTimeout((()=>window.dispatchEvent(new Event("resize"))),400);return()=>clearTimeout(e)}),[e]),(0,g.jsxs)(l.Flex,{children:[(0,g.jsx)(we,{spacePanelCollapsed:e,toggleSpacePanel:r}),(0,g.jsx)(Ze,{spacePanelCollapsed:e,toggleSpacePanel:r}),t&&(0,g.jsx)(so,{onClose:s})]})}))},45187:(e,o,t)=>{t.d(o,{R:()=>i,H:()=>c});var n=t(34843),l=t(52035);const a=(0,l.eU)(!1),s=(0,l.eU)(!1);var r=t(96540);const i=()=>{const[e,o]=(0,n.fp)(a);return{isInitialized:e,init:(0,r.useCallback)((()=>o(!0)),[o])}},c=()=>{const[e,o]=(0,n.fp)(s);return{isActive:e,activate:(0,r.useCallback)((()=>o(!0)),[o]),deactivate:(0,r.useCallback)((()=>o(!1)),[o])}}}}]);