import{d as b,ex as y,F as z,b as O,c as w,e as c,er as h,bu as k,bw as v,t as x}from"./registerWidgets.6f5be576.js";import{e as C,f as I}from"./icons.b2622455.js";import{a as N}from"./asyncComputed.ea0bb8a8.js";import"./gateway.1c0effff.js";import{O as d}from"./organization.4d16496d.js";import"./index.1c2771c5.js";import{C as D}from"./CrudView.81000b9b.js";import{N as A}from"./Navbar.a70a3503.js";import"./passwordlessManager.1e2193ad.js";import"./pubsub.1dc45978.js";import"./storage.d8b26e7f.js";import"./activeRecord.eb203c6f.js";import"./DropdownMenu.ecdd2e52.js";import"./Modal.dd94f88f.js";import"./LoadingIndicator.2446cb23.js";import"./lottie.df73e4a1.js";import"./logo.084e5d7c.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="e257888f-aa2e-4c34-a9f8-7ab873ca5a59",n._sentryDebugIdIdentifier="sentry-dbid-e257888f-aa2e-4c34-a9f8-7ab873ca5a59")}catch{}})();const B={class:"organizations"},E=b({__name:"Organizations",setup(n){const o=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],l=y(),{loading:m,result:r,refetch:p}=N(()=>d.list()),s=({key:e})=>{l.push({name:"organization",params:{organizationId:e}})},u=async e=>{const a=await d.create(e.name);s({key:a.id})},g=async({key:e})=>{var a,t;confirm("Are you sure you want to delete this organization?")&&(await((t=(a=r.value)==null?void 0:a.find(_=>_.id===e))==null?void 0:t.delete()),p())},f=z(()=>{var e,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Organization Actions"}],rows:(a=(e=r.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.name,classes:["title","centered"],link:`/organizations/${encodeURIComponent(t.id)}`},{text:t.id},{text:"",classes:["centered"],actions:[{icon:C,label:"Delete",onClick:g,dangerous:!0},{icon:I,label:"Edit Organization",onClick:s}]}]})))!=null?a:[]}});return(e,a)=>(O(),w(v,null,[c(A,{breadcrumb:o}),h("div",B,[c(D,{"entity-name":"organization",loading:k(m),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:f.value,fields:i,onCreate:u},null,8,["loading","table"])])],64))}});const W=x(E,[["__scopeId","data-v-29b5921d"]]);export{W as default};
//# sourceMappingURL=Organizations.e7a66bde.js.map
