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.1e9167ab.js";import{e as x,b as C}from"./icons.41af03d8.js";import{a as I}from"./asyncComputed.8a644895.js";import"./gateway.6096f5a8.js";import{O as l}from"./organization.a2c74ee1.js";import"./index.11f5d4e4.js";import{_ as v}from"./Navbar.vue_vue_type_script_setup_true_lang.901e5473.js";import{_ as D}from"./CrudView.vue_vue_type_script_setup_true_lang.e0bf9fc2.js";import{B as M}from"./BaseLayout.6055d322.js";import{M as A}from"./index.ed4213c8.js";import"./passwordlessManager.b7f590c1.js";import"./pubsub.09eafe35.js";import"./storage.84fcb572.js";import"./activeRecord.60b6bd01.js";import"./logo.084e5d7c.js";import"./Text.c8d7b4c0.js";import"./Title.d1f45d59.js";import"./transButton.755e702e.js";import"./index.d74062f4.js";import"./index.4b30ebdc.js";import"./Modal.b646cd22.js";import"./index.9165a659.js";import"./index.32c7f8ee.js";import"./index.8a092bed.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]="c6382163-8729-4137-a055-c07b48a40e28",o._sentryDebugIdIdentifier="sentry-dbid-c6382163-8729-4137-a055-c07b48a40e28")}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}})},g=async t=>{const e=await l.create(t.name);s({key:e.id})},f=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(b=>b.id===t))==null?void 0:a.delete()),u()}})},y=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:f,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:y.value,fields:i,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{et as default};
//# sourceMappingURL=Organizations.a8a5a651.js.map
