import{d as y,K as z,b,c as O,e as c,x as w,z as d,F as k,H as h,q as x}from"./registerWidgets.309e60e2.js";import{f as C,g as v}from"./icons.5353538a.js";import{a as I}from"./asyncComputed.b00f3898.js";import"./gateway.51cb6e51.js";import{O as l}from"./organization.ff0a826c.js";import"./index.1c1ab019.js";import{C as N}from"./CrudView.7aecf6b4.js";import{N as D}from"./Navbar.590e241e.js";import"./passwordlessManager.707ad0fd.js";import"./pubsub.5200d147.js";import"./activeRecord.fda98ee0.js";import"./DropdownMenu.5c576288.js";import"./Modal.93f98c35.js";import"./LoadingIndicator.bc80793d.js";import"./lottie.e2f196ac.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]="bfd298f4-262e-4d4d-aa42-41430a50f2aa",n._sentryDebugIdIdentifier="sentry-dbid-bfd298f4-262e-4d4d-aa42-41430a50f2aa")}catch{}})();const A={class:"organizations"},B=y({__name:"Organizations",setup(n){const o=[{key:"name",label:"Organization Name"}],i=h(),{loading:m,result:r,refetch:p}=I(()=>l.list()),s=({key:e})=>{i.push({name:"organization",params:{organizationId:e}})},u=async e=>{const a=await l.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:v,label:"Edit Organization",onClick:s}]}]})))!=null?a:[]}});return(e,a)=>(b(),O(k,null,[c(D),w("div",A,[c(N,{"entity-name":"organization",loading:d(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:d(f),fields:o,onCreate:u},null,8,["loading","table"])])],64))}});const Q=x(B,[["__scopeId","data-v-360ce05c"]]);export{Q as default};
//# sourceMappingURL=Organizations.186f50bf.js.map
