import{d as _,J as z,L as b,b as O,c as w,e as c,y as h,A as k,F as v,t as C}from"./registerWidgets.2f354556.js";import{e as x,f as I}from"./icons.1cdfa11b.js";import{a as N}from"./asyncComputed.7c1b85ba.js";import"./gateway.b2e13b61.js";import{O as d}from"./organization.00ab1f23.js";import"./index.a8dd38cc.js";import{C as A}from"./CrudView.f76acddd.js";import{N as D}from"./Navbar.7c7b2337.js";import"./passwordlessManager.96ab3f5a.js";import"./pubsub.cb65003c.js";import"./activeRecord.931023a0.js";import"./DropdownMenu.f3f9574e.js";import"./Modal.55b06151.js";import"./LoadingIndicator.14779776.js";import"./lottie.61602e49.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]="a02a4358-1273-49d9-9a33-78504f03d5a1",n._sentryDebugIdIdentifier="sentry-dbid-a02a4358-1273-49d9-9a33-78504f03d5a1")}catch{}})();const B={class:"organizations"},E=_({__name:"Organizations",setup(n){const o=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],l=z(),{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(y=>y.id===e))==null?void 0:t.delete()),p())},f=b(()=>{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:x,label:"Delete",onClick:g,dangerous:!0},{icon:I,label:"Edit Organization",onClick:s}]}]})))!=null?a:[]}});return(e,a)=>(O(),w(v,null,[c(D,{breadcrumb:o}),h("div",B,[c(A,{"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 S=C(E,[["__scopeId","data-v-29b5921d"]]);export{S as default};
//# sourceMappingURL=Organizations.226abf76.js.map
