import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{D as t,Dt as n}from"./vendor-vue-core-X6q-rGJs.js";import{N as r}from"./vendor-vueuse-B_IQhD9R.js";import{yn as i}from"./dialogService-Cqui0UMO.js";function getPermissions(e,t){return e===`personal`?{canViewOtherMembers:!1,canViewPendingInvites:!1,canInviteMembers:!1,canManageInvites:!1,canRemoveMembers:!1,canLeaveWorkspace:!1,canAccessWorkspaceMenu:!1,canManageSubscription:!0}:t===`owner`?{canViewOtherMembers:!0,canViewPendingInvites:!0,canInviteMembers:!0,canManageInvites:!0,canRemoveMembers:!0,canLeaveWorkspace:!0,canAccessWorkspaceMenu:!0,canManageSubscription:!0}:{canViewOtherMembers:!0,canViewPendingInvites:!1,canInviteMembers:!1,canManageInvites:!1,canRemoveMembers:!1,canLeaveWorkspace:!0,canAccessWorkspaceMenu:!0,canManageSubscription:!1}}function getUIConfig(e,t){return e===`personal`?{showMembersList:!1,showPendingTab:!1,showSearch:!1,showDateColumn:!1,showRoleBadge:!1,membersGridCols:`grid-cols-1`,pendingGridCols:`grid-cols-[50%_20%_20%_10%]`,headerGridCols:`grid-cols-1`,showEditWorkspaceMenuItem:!1,workspaceMenuAction:null,workspaceMenuDisabledTooltip:null}:t===`owner`?{showMembersList:!0,showPendingTab:!0,showSearch:!0,showDateColumn:!0,showRoleBadge:!0,membersGridCols:`grid-cols-[50%_40%_10%]`,pendingGridCols:`grid-cols-[50%_20%_20%_10%]`,headerGridCols:`grid-cols-[50%_40%_10%]`,showEditWorkspaceMenuItem:!0,workspaceMenuAction:`delete`,workspaceMenuDisabledTooltip:`workspacePanel.menu.deleteWorkspaceDisabledTooltip`}:{showMembersList:!0,showPendingTab:!1,showSearch:!0,showDateColumn:!0,showRoleBadge:!0,membersGridCols:`grid-cols-[1fr_auto]`,pendingGridCols:`grid-cols-[50%_20%_20%_10%]`,headerGridCols:`grid-cols-[1fr_auto]`,showEditWorkspaceMenuItem:!1,workspaceMenuAction:`leave`,workspaceMenuDisabledTooltip:null}}function useWorkspaceUIInternal(){let e=i(),r=n(`plan`);function setActiveTab(e){r.value=String(e)}let a=t(()=>e.activeWorkspace?.type??`personal`),o=t(()=>e.activeWorkspace?.role??`owner`),s=t(()=>getPermissions(a.value,o.value)),c=t(()=>getUIConfig(a.value,o.value));return{activeTab:t(()=>r.value),setActiveTab,permissions:s,uiConfig:c,workspaceType:a,workspaceRole:o}}const a=r(useWorkspaceUIInternal);export{a as t};
//# sourceMappingURL=useWorkspaceUI-DSqwvVnI.js.map