import{d as _,ex as w,H as h,b as k,c as O,w as c,f as d,u as C}from"./registerWidgets.4340e287.js";import{e as x,b as I}from"./icons.da02f7f7.js";import{a as v}from"./asyncComputed.a4cc4ebe.js";import"./gateway.1f2ccdb0.js";import{O as l}from"./organization.9c2e4599.js";import"./index.dbce76fa.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.9256bd68.js";import{_ as A}from"./CrudView.vue_vue_type_script_setup_true_lang.e9f57b5e.js";import{B}from"./BaseLayout.6b4d6782.js";import{a as N}from"./ant-design.56df7a71.js";import"./passwordlessManager.8c70219b.js";import"./pubsub.3290d859.js";import"./storage.dfe55847.js";import"./activeRecord.c40ac301.js";import"./logo.084e5d7c.js";import"./index.f58e2ef8.js";import"./Title.4165770a.js";import"./index.c13b703c.js";import"./index.87d21376.js";import"./Form.7b78c348.js";import"./index.17a2edf7.js";import"./index.7bc7e814.js";import"./index.d24f6130.js";import"./index.9aade351.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]="83827aff-d418-42c2-9c31-dd68b1498f73",o._sentryDebugIdIdentifier="sentry-dbid-83827aff-d418-42c2-9c31-dd68b1498f73")}catch{}})();const at=_({__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(()=>l.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},g=async t=>{const a=await l.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(),O(B,null,{navbar:c(()=>[d(D,{breadcrumb:n})]),content:c(()=>[d(A,{"entity-name":"organization",loading:C(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{at as default};
//# sourceMappingURL=Organizations.5890c7e5.js.map
