import{d as _,ey as w,H as h,b as k,c as C,w as c,f as l,u as O}from"./outputWidgets.4420c31f.js";import{e as x,b as I}from"./icons.2ee60219.js";import{a as v}from"./asyncComputed.937eb3b8.js";import"./router.141c8be7.js";import{O as d}from"./organization.9fa0a734.js";import"./columns.d0453565.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.3ef3f270.js";import{C as A}from"./CrudView.4a9e50e2.js";import{B}from"./BaseLayout.7e15c8e2.js";import{a as N}from"./ant-design.4ad26ba4.js";import"./Title.f4c9dd29.js";import"./index.1ba1c343.js";import"./gateway.c8298b74.js";import"./activeRecord.a89b1253.js";import"./pubsub.1ac087cf.js";import"./index.f4ac7424.js";import"./logo.084e5d7c.js";import"./index.6f566923.js";import"./index.adf86569.js";import"./index.7712b032.js";import"./Form.6825d217.js";import"./url.14f2bdd6.js";import"./index.32966139.js";import"./index.f4ff3772.js";import"./index.afb0f92e.js";import"./index.f792c329.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]="7fbaf3f9-2f75-4889-9fcf-77a7707583af",o._sentryDebugIdIdentifier="sentry-dbid-7fbaf3f9-2f75-4889-9fcf-77a7707583af")}catch{}})();const nt=_({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:f,result:r,refetch:u}=v(()=>d.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},g=async t=>{const e=await d.create(t.name);s({key:e.id})},y=async({key:t})=>{var a,m;await N("Are you sure you want to delete this organization?")&&(await((m=(a=r.value)==null?void 0:a.find(z=>z.id===t))==null?void 0:m.delete()),u())},b=h(()=>{var t,e;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(e=(t=r.value)==null?void 0:t.map(a=>({key:a.id,cells:[{text:a.name,link:`/organizations/${encodeURIComponent(a.id)}`},{text:a.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:y,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(k(),C(B,null,{navbar:c(()=>[l(D,{breadcrumb:n})]),content:c(()=>[l(A,{"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{nt as default};
//# sourceMappingURL=Organizations.a37f1e67.js.map
