import{d as z,ex as _,H as O,b as w,c as k,w as c,f as m,u as h}from"./registerWidgets.2031932d.js";import{e as x,b as C}from"./icons.3cd62928.js";import{a as I}from"./asyncComputed.57cbb10a.js";import"./gateway.5ec242d0.js";import{O as l}from"./organization.568809ba.js";import"./index.f3f00cf3.js";import{_ as v}from"./Navbar.vue_vue_type_script_setup_true_lang.dd664761.js";import{_ as D}from"./CrudView.vue_vue_type_script_setup_true_lang.65f898ee.js";import{B as M}from"./BaseLayout.c048975a.js";import{M as A}from"./index.e8af61a6.js";import"./passwordlessManager.50ecc1b4.js";import"./pubsub.9625b443.js";import"./storage.8b8c0b1c.js";import"./activeRecord.7b173443.js";import"./logo.084e5d7c.js";import"./Text.f7290fbc.js";import"./Title.6d39f4ca.js";import"./transButton.d9059bcf.js";import"./index.b4b072a9.js";import"./index.5a7b7c6a.js";import"./Modal.380d5af9.js";import"./index.bdecc667.js";import"./index.29b38c7d.js";import"./index.88f03b56.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]="b41082c3-2585-4713-8aa3-ebac3bffd9e9",o._sentryDebugIdIdentifier="sentry-dbid-b41082c3-2585-4713-8aa3-ebac3bffd9e9")}catch{}})();const et=z({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],d=_(),{loading:p,result:r,refetch:u}=I(()=>l.list()),s=({key:t})=>{d.push({name:"organization",params:{organizationId:t}})},f=async t=>{const e=await l.create(t.name);s({key:e.id})},g=async({key:t})=>{A.confirm({title:"Are you sure you want to delete this organization?",onOk:async()=>{var e,a;await((a=(e=r.value)==null?void 0:e.find(y=>y.id===t))==null?void 0:a.delete()),u()}})},b=O(()=>{var t,e;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Organization Actions"}],rows:(e=(t=r.value)==null?void 0:t.map(a=>({key:a.id,cells:[{text:a.name,link:`/organizations/${encodeURIComponent(a.id)}`},{text:a.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:C,label:"Delete",onClick:g,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(w(),k(M,null,{navbar:c(()=>[m(v,{breadcrumb:n})]),content:c(()=>[m(D,{"entity-name":"organization",loading:h(p),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:f},null,8,["loading","table"])]),_:1}))}});export{et as default};
//# sourceMappingURL=Organizations.ba6996fb.js.map
