import{u as L,e3 as S,cH as E,r as P,e_ as m}from"./index-d6499a22.js";import{u as h}from"./index-da50fbe6.js";import{u as O}from"./useCurrentProject-b23444be.js";const _=()=>{const{fsId:u}=L(),{id:f,project:s,isLoading:l}=O(),{currentData:o,isFetching:p}=S({fsId:+u}),{data:n,isLoading:g}=h(f),{data:e,isLoading:D}=E(),r=P.useMemo(()=>{var d;let i=!0,c=!1;const a=(d=s==null?void 0:s.projectTeam)==null?void 0:d.find(({user:t})=>t.username===(e==null?void 0:e.username));if(!n||!o)i=!1;else{const t=n.find(F=>F.projectName.includes(o.projectName));c=!t,t?(t.permission===m.READ_ONLY||t.permission===m.EDITABLE_BY_OWNERS&&(a==null?void 0:a.teamRole)==="Data scientist")&&(i=!1):i=!0}return{can:i,isOwnFs:c,isDataScientist:(a==null?void 0:a.teamRole)==="Data scientist"}},[e==null?void 0:e.username,o,s==null?void 0:s.projectTeam,n]);return{canEdit:r.can,isOwnFs:r.isOwnFs,isDataScientist:r.isDataScientist,isLoading:l||g||p||D}};export{_ as u};
