!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"48d9eb4d3342ea0ac79a97ca2a631ad14571d487"};var a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="f84283eb-252c-4552-832e-00296a2c06f8",e._sentryDebugIdIdentifier="sentry-dbid-f84283eb-252c-4552-832e-00296a2c06f8")}catch(e){}}(),(globalThis.webpackChunkcloud_frontend=globalThis.webpackChunkcloud_frontend||[]).push([[7530],{17530(e,a,n){n.r(a),n.d(a,{default:()=>f});n(74423);var s=n(32977),o=n(24609),i=n(6304),t=n(99728),r=n(29022),l=n(36348),c=n(79748),d=n(5981),m=n(74848);const u={noRoomPermission:{header:e=>`Your role doesn't give you permission to access any of the troubleshooting information on ${e}.`},noSpacePermission:{header:e=>`Your role doesn't give you permission to access any information on ${e}.`},noRooms:{header:e=>`You currently don't have permission to see any room on ${e}.`}},h=e=>{let{onClick:a,spaceName:n}=e;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(s.Text,{margin:[2,0,0],children:"You can also leave this Space if you wish. "}),(0,m.jsx)(s.Button,{flavour:"borderless",icon:"switch_off",label:`Leave ${n}`,margin:[0,0,0,7],onClick:a,strong:!0})]})},g=["noSpacePermission","noRoomPermission"],f=e=>{let{reason:a}=e;const n=(0,o.ap)(),[f,,p,b]=(0,i.A)(),{header:x}=u[a],y=(0,o.bq)(),v=(0,t.JT)("billing:ReadBasic");return(0,m.jsx)(r.A,{title:x(n.name),children:(0,m.jsxs)(m.Fragment,{children:["noSpacePermission"===a&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(s.Text,{children:"Please contact the Space administrators if this is unexpected."}),(0,m.jsx)(h,{onClick:p,spaceName:n.name})]}),v&&g.includes(a)&&(0,m.jsxs)(s.Text,{children:["To manage Plan & Billing information please"," ",(0,m.jsx)(c.A,{as:d.N_,to:`/spaces/${y}/settings/billing`,children:"click here."})]}),"noRooms"===a&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(s.Text,{children:"Please contact a Space administrator or manager if this is unexpected."}),(0,m.jsx)(h,{onClick:p,spaceName:n.name})]}),f&&(0,m.jsx)(l.A,{id:n.id,name:n.name,onClose:b})]})})}},36348(e,a,n){n.d(a,{A:()=>C});var s=n(96540),o=n(32977),i=n(5981),t=n(46587),r=n(86706),l=(n(98992),n(54520),n(30569)),c=n(84929),d=n(63872),m=n(77389),u=n(99236),h=n(24609),g=n(32874),f=n(15624),p=n(49916);const b=e=>{const[,a]=(0,d.A)();return(0,l.yF)((0,s.useCallback)(async(n,s,o)=>{let{currentUserId:i,onSuccess:t,onError:l}=o;const d=await n((0,h.nC)("ids")),b=d.filter(a=>e!==a),x=e=>{s(e,c.Ut)},[y]=b;if(!y)return void a({header:"Spaces",text:u.sh.leave});const{slug:v}=y&&await n((0,f.Ay)(y));s((0,h.nC)("ids"),b),s(g.A,a=>a.filter(a=>a!==e));try{await(0,m.XY)(e,[i]),t&&t(v),(0,r.Z8)(x,e),(0,p.Is)(x,e),x((0,f.Ay)(e))}catch(j){s((0,h.nC)("ids"),d),l&&l()}},[e,a]))};n.dn(b);var x=n(64999),y=n(74848);const v="leave-space-dialog",j="leaveSpaceDialog",C=e=>{let{id:a,name:n,onClose:l}=e;const c=(0,i.Zp)(),d=(0,t.uW)("id"),m=(0,r.Gi)(),u=(0,r.i3)(),h=(0,r.pB)(),g=b(a),f=(0,x.A)(a),p=(0,s.useCallback)(e=>c(`/spaces/${e}`),[]),C=1===m.length,w=1===u.length&&h,A=C?{confirmLabel:"Yes, leave","data-ga":`${v}-last-member`,"data-testid":`${j}LastMember`,handleConfirm:()=>f({onSuccess:p}),message:(0,y.jsxs)(y.Fragment,{children:["If you leave, space ",(0,y.jsx)("strong",{children:n})," will be deleted immediately.",(0,y.jsx)("br",{}),"Are you sure you want to continue?"]}),title:`Leave and delete ${n} space`}:w?{confirmLabel:"Give rights","data-ga":`${v}-last-admin`,"data-testid":`${j}LastAdmin`,handleConfirm:()=>c("users"),isConfirmPositive:!0,message:(0,y.jsxs)(y.Fragment,{children:["You are the last admin of ",(0,y.jsx)("strong",{children:n})," space. Please give admin rights to another member so you can leave this space."]}),title:`Leave ${n} space`}:{confirmLabel:"Yes, leave","data-ga":v,"data-testid":j,handleConfirm:()=>g({currentUserId:d,onSuccess:p}),message:(0,y.jsxs)(y.Fragment,{children:["You are about to leave ",(0,y.jsx)("strong",{children:n})," space.",(0,y.jsx)("br",{}),"Are you sure you want to continue?"]}),title:`Leave ${n} space`};return(0,y.jsx)(o.ConfirmationDialog,{handleDecline:l,...A})}}}]);