import{C as g}from"./CrudView.6a433a98.js";import{a as c}from"./ant-design.1010e180.js";import{a as b}from"./asyncComputed.c6a51599.js";import{d as w,eC as _,eJ as h,K as I,b as C,c as k,u as v,eP as x}from"./vue-router.67809441.js";import{a as z}from"./gateway.e3e12758.js";import"./index.faf1d629.js";import{M as n}from"./member.96916995.js";import"./router.f4c6c59f.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.30df229c.js";import"./BookOutlined.aea72855.js";import"./url.bf0f022f.js";import"./index.bad8e5d7.js";import"./index.31900902.js";import"./popupNotifcation.c8631a6a.js";import"./record.79dce665.js";import"./string.d96a9f97.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="e93979ce-0f13-42aa-901d-b0d5d5f1a762",o._sentryDebugIdIdentifier="sentry-dbid-e93979ce-0f13-42aa-901d-b0d5d5f1a762")}catch{}})();const q=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,l=[{key:"email",label:"Email"}],m=async e=>{await n.create(r,e.email),d()};async function u(e){var t;if(((t=z.getAuthor())==null?void 0:t.claims.email)===e.email&&await c("You are about to remove your own access. You won't be able to access this organization anymore. Are you sure?")){await n.delete(r,e.authorId),await s.push({name:"organizations"});return}await c("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),d())}const{loading:f,result:p,refetch:d}=b(()=>n.list(r)),y=I(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=p.value)==null?void 0:e.map(t=>({key:t.email,cells:[{type:"text",text:t.email},{type:"text",text:t.role},{type:"actions",actions:[{icon:x,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(C(),k(g,{"entity-name":"editors",loading:v(f),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:y.value,"create-button-text":"Add editors",fields:l,onCreate:m},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Editors.7173b84f.js.map
