import{u as L,ay as p,eW as P,g6 as T,az as A,r as N,ga as u,cs as m}from"./index-C1DmWO_C.js";const j=()=>{const{fsId:f}=L(),{id:S,project:s,isLoading:l}=p(),{currentData:o,isFetching:g}=P({fsId:+f}),{data:n,isLoading:D}=T(S),{data:e,isLoading:E}=A(),r=N.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===o.projectName);c=!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:c,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:l||D||g||E}};export{j as u};
