import{d as _,ez as w,J as h,b as k,c as C,w as m,f as l,u as O}from"./outputWidgets.300f3e96.js";import{e as x,b as I}from"./icons.faa6dbaa.js";import{a as v}from"./asyncComputed.6561fe78.js";import"./router.fdc19966.js";import{O as d}from"./organization.ffaf9442.js";import"./index.92fda3db.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.e6bb4a9d.js";import{C as A}from"./CrudView.0d50f6ef.js";import{B}from"./BaseLayout.d72db165.js";import{a as N}from"./ant-design.e9641753.js";import"./Title.f9e3ac72.js";import"./index.4c022ec6.js";import"./gateway.d0550bff.js";import"./activeRecord.6e31bcda.js";import"./pubsub.f4c4af7d.js";import"./logo.084e5d7c.js";import"./index.b12dda90.js";import"./index.c74452a7.js";import"./index.5dabecc6.js";import"./Form.e5ad8df8.js";import"./url.f346bb44.js";import"./index.f69106a7.js";import"./index.0deb6cbe.js";import"./index.b49fb559.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="ba1acec0-57b2-4532-ae53-6e68e0e16bac",o._sentryDebugIdIdentifier="sentry-dbid-ba1acec0-57b2-4532-ae53-6e68e0e16bac")}catch{}})();const ae=_({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:g}=v(()=>d.list()),s=({key:e})=>{p.push({name:"organization",params:{organizationId:e}})},f=async e=>{const a=await d.create(e.name);s({key:a.id})},b=async({key:e})=>{var t,c;await N("Are you sure you want to delete this organization?")&&(await((c=(t=r.value)==null?void 0:t.find(z=>z.id===e))==null?void 0:c.delete()),g())},y=h(()=>{var e,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=r.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.name,link:`/organizations/${encodeURIComponent(t.id)}`},{text:t.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(k(),C(B,null,{navbar:m(()=>[l(D,{breadcrumb:n})]),content:m(()=>[l(A,{"entity-name":"organization",loading:O(u),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:y.value,fields:i,onCreate:f},null,8,["loading","table"])]),_:1}))}});export{ae as default};
//# sourceMappingURL=Organizations.ca665ef9.js.map
