import{d as _,eA as w,G as C,b as h,c as k,w as c,f as d,u as O}from"./outputWidgets.e33755f8.js";import{v as x,C as I}from"./icons.f6b19bc0.js";import{a as v}from"./asyncComputed.8bd4aeca.js";import"./authorManager.62b862f9.js";import"./index.0a6756f7.js";import{O as l}from"./organization.a0d50745.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.71d1cd3f.js";import{C as D}from"./CrudView.2f0c3c83.js";import{B}from"./BaseLayout.f64f85ae.js";import{a as N}from"./ant-design.4ca18c4d.js";import"./index.cf4c23b9.js";import"./record.fe2d13ca.js";import"./pubsub.d8fbcc91.js";import"./gateway.f3da19f9.js";import"./logo.084e5d7c.js";import"./Text.03e848c4.js";import"./Title.ac2baa04.js";import"./index.68c8be46.js";import"./FormItem.fdb358e6.js";import"./hasIn.5c4a4bf3.js";import"./Form.e78b9235.js";import"./Modal.e934f1f6.js";import"./router.8c7b3fad.js";import"./index.9f6d3055.js";import"./url.3d250afc.js";import"./index.98828044.js";import"./index.58a4a13c.js";import"./index.4b06b554.js";import"./index.72b0b8fe.js";import"./index.7be3845f.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="65ea335d-143d-48d6-8f56-2e11b2fffc0f",a._sentryDebugIdIdentifier="sentry-dbid-65ea335d-143d-48d6-8f56-2e11b2fffc0f")}catch{}})();const mt=_({__name:"Organizations",setup(a){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:f,result:r,refetch:u}=v(()=>l.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},g=async t=>{const e=await l.create(t.name);s({key:e.id})},y=async({key:t})=>{var o,m;await N("Are you sure you want to delete this organization?")&&(await((m=(o=r.value)==null?void 0:o.find(z=>z.id===t))==null?void 0:m.delete()),u())},b=C(()=>{var t,e;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(e=(t=r.value)==null?void 0:t.map(o=>({key:o.id,cells:[{text:o.name,link:`/organizations/${encodeURIComponent(o.id)}`},{text:o.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:y,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(h(),k(B,null,{navbar:c(()=>[d(A,{breadcrumb:n})]),content:c(()=>[d(D,{"entity-name":"organization",loading:O(f),title:"My organizations",description:"An organization is your company\u2019s account. Add co-workers, manage their access, organize projects and billing.","create-button-text":"Create Organization","empty-title":"No organizations here yet",table:b.value,fields:i,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{mt as default};
//# sourceMappingURL=Organizations.c149098e.js.map
