import{u as L,aw as p,g4 as P,g0 as T,ax as A,r as N,g5 as u,dO as m}from"./index-46ma1THH.js";const h=()=>{const{fsId:f}=L(),{id:S,project:s,isLoading:g}=p(),{currentData:o,isFetching:l}=P({fsId:+f}),{data:n,isLoading:D}=T(S),{data:e,isLoading:E}=A(),r=N.useMemo(()=>{var c;let i=!0,d=!1;const a=(c=s==null?void 0:s.projectTeam)==null?void 0:c.find(({user:t})=>t.username===(e==null?void 0:e.username));if(!n||!o)i=!1;else{const t=n.find(F=>F.projectName===o.projectName);d=!t,t?(t.permission===u.READ_ONLY||t.permission===u.EDITABLE_BY_OWNERS&&(a==null?void 0:a.teamRole)===m.DATA_SCIENTIST)&&(i=!1):i=!0}return{can:i,isOwnFs:d,isDataScientist:(a==null?void 0:a.teamRole)===m.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:g||D||l||E}};export{h as u};
