import{e as f,r as m}from"./main-D6SjkSWq.js";function l(c){const{user:e,hasPermission:s}=f();return m.useMemo(()=>{const a={canEdit:!0,canDelete:!0,managesTrack:!0};return c.every(t=>{var o,u;if(!t){a.canEdit=!1,a.canDelete=!1,a.managesTrack=!1;return}const n=(o=t.artists)==null?void 0:o.map(r=>r.id),i=t.owner_id===(e==null?void 0:e.id)||!!((u=e==null?void 0:e.artists)!=null&&u.find(r=>n==null?void 0:n.includes(r.id)));i||(a.managesTrack=!1),!s("tracks.update")&&!s("music.update")&&!i&&(a.canEdit=!1),!s("tracks.delete")&&!s("music.delete")&&!i&&(a.canDelete=!1)}),a},[e,c,s])}export{l as u};
