var e=[`owner`,`admin`,`member`],t=`,`,n=new Set([`owner`,`admin`]),r={invitationCancel:n,invitationCreate:n,memberDelete:n,memberUpdate:n,organizationUpdate:n},i=new Set(e);function a(e){return i.has(e)}function o(e){let n=Array.isArray(e)?e:typeof e==`string`?e.split(t):[],r=[],i=new Set;for(let e of n){let t=e.trim();!a(t)||i.has(t)||(i.add(t),r.push(t))}return r}function s(n){let r=new Set(o(n));return e.filter(e=>r.has(e)).join(t)}function c(e){let t=r[e.permission];return o(e.rawRole).some(e=>t.has(e))}function l(e){return o(e.rawRole).includes(e.roleName)}function u(e){return c({permission:`organizationUpdate`,rawRole:e.rawRole})}export{s as a,o as i,c as n,l as r,u as t};