import{C as b}from"./CrudView.4178d97f.js";import{a as c}from"./ant-design.0bb3969c.js";import{a as g}from"./asyncComputed.9837140d.js";import{d as w,eu as _,eH as h,f as I,c as k,u as v,eI as x,o as C}from"./vue-router.33ac8cf0.js";import{a as z}from"./gateway.b01778f9.js";import{M as n}from"./member.ec0899a2.js";import"./tables.aea27d65.js";import"./router.431f1655.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.e2bbbfd3.js";import"./BookOutlined.c6692cb9.js";import"./url.d6d42cf8.js";import"./PhDotsThree.vue.34aeb4af.js";import"./index.4deb3bba.js";import"./index.f737d7de.js";import"./popupNotifcation.6b8971b6.js";import"./record.88671b98.js";import"./string.cf4460b1.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]="685c86b6-6441-4f05-aab8-dbbf1f1126f6",o._sentryDebugIdIdentifier="sentry-dbid-685c86b6-6441-4f05-aab8-dbbf1f1126f6")}catch{}})();const P=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,l=[{key:"email",label:"Email"}],d=async e=>{await n.create(r,e.email),m()};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),m())}const{loading:f,result:p,refetch:m}=g(()=>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(b,{"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:d},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.0ce07841.js.map
