import{d as _,ey as w,G as h,b as k,c as C,w as c,f as l,u as O}from"./outputWidgets.0fb707c7.js";import{e as x,b as I}from"./icons.24a85994.js";import{a as v}from"./asyncComputed.a0ca296c.js";import"./router.81de177d.js";import{O as d}from"./organization.510c9436.js";import"./columns.37a1e6f7.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.78422c92.js";import{C as A}from"./CrudView.e365e55f.js";import{B}from"./BaseLayout.4284e9c0.js";import{a as N}from"./ant-design.c18e1d39.js";import"./Form.0dcb97c0.js";import"./Title.f00a58f9.js";import"./transButton.220177fb.js";import"./Text.3ec0a64d.js";import"./index.140c5bc8.js";import"./gateway.7ee47e62.js";import"./activeRecord.204186f3.js";import"./pubsub.7d8bce56.js";import"./index.cf4c23b9.js";import"./logo.084e5d7c.js";import"./index.a2e845fd.js";import"./index.ebe62e37.js";import"./url.d43b75f5.js";import"./index.85d2f01b.js";import"./index.8dbf2994.js";import"./index.0d3d2205.js";import"./index.e8ef1073.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]="081c53f3-e022-4a9b-af87-7e45a0cb939c",o._sentryDebugIdIdentifier="sentry-dbid-081c53f3-e022-4a9b-af87-7e45a0cb939c")}catch{}})();const it=_({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:f}=v(()=>d.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},g=async t=>{const a=await d.create(t.name);s({key:a.id})},y=async({key:t})=>{var e,m;await N("Are you sure you want to delete this organization?")&&(await((m=(e=r.value)==null?void 0:e.find(z=>z.id===t))==null?void 0:m.delete()),f())},b=h(()=>{var t,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(t=r.value)==null?void 0:t.map(e=>({key:e.id,cells:[{text:e.name,link:`/organizations/${encodeURIComponent(e.id)}`},{text:e.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:y,dangerous:!0}]}]})))!=null?a:[]}});return(t,a)=>(k(),C(B,null,{navbar:c(()=>[l(D,{breadcrumb:n})]),content:c(()=>[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:b.value,fields:i,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{it as default};
//# sourceMappingURL=Organizations.16df0a6e.js.map
