import{R as N,k as R,o as e,S as d,dl as x,aW as v,b as O,j as s,ar as B,fd as U,i,h as n,D as T,dn as _,dp as F,aR as L,a4 as b,cs as r}from"./app-BgLa5dit.js";import{u as M}from"./ekVIVtrT.chunk.js";import{E as H}from"./CPYC3VpT.chunk.js";import{D as C}from"./BE59vaMU.chunk.js";import{D as P}from"./BYqcacqE.chunk.js";import{C as k}from"./gSHF4kJG.chunk.js";import"./KIVqng-q.chunk.js";import"./0GREfvNX.chunk.js";import"./JAv_fVmZ.chunk.js";import"./B5-QmNlz.chunk.js";import"./CTg_3F42.chunk.js";import"./DEF_vJGe.chunk.js";import"./CGQPfl0D.chunk.js";import"./D6bTl1fN.chunk.js";import"./kOrk-qeI.chunk.js";function ia(t){var p,S;const[u,h]=N.useState(!0),l=R(),o=e(d.presentation(t.presentationId)),D=e(L.currentUser()),f=e(d.classification(t.classificationId));function m(a){return C.dashboards({targetType:T.ClassificationDirectory,classificationId:t.classificationId},u,a)}function A(a){l(m(a))}const I=M(m,A),g=(S=(p=e(d.classificationMembers(t.classificationId,x.Tags)).data)==null?void 0:p.data)==null?void 0:S.find(a=>a.name===v.MOVIES_AND_TV),{hasPermissions:c}=O();function E(){return!!(c(b.TopicDashboardStatusUpdate)||g&&c(b.MoviesAndTvDashboardStatusUpdate)||r.isTertiary(t.presentationId)||r.isNewZealandTopic(t.presentationId)||r.isInternationalTopic(t.presentationId)||r.isCanadaTopic(t.presentationId))}function j(a){return l(C.updateDashboard(a.id,a))}return!o.data||!D.data||!f.data?s.jsx("div",{className:"text-center py-3",children:s.jsx(B,{as:"div",animation:"border",role:"status"})}):s.jsxs(s.Fragment,{children:[s.jsx(H,{memberType:t.memberType,presentation:o.data,classificationId:t.classificationId,getTabs:(a,y)=>U.getEditClassificationTabs(i.SUBJECTS,a,y,c)}),s.jsx(k,{classification:f.data,active:"directory"}),s.jsx(P,{presentation:o.data,dashboards:I.items,onStatusChange:j,canPublish:E(),columns:_.getColumnSet(F.ClassificationDashboard),filterArchivedDashboards:u,setFilterArchivedDashboards:h,getEditDetailsAppLink:a=>({application:i.SUBJECTS,action:n.Subjects.EDIT_CLASSIFICATION_DASHBOARD,args:[t.classificationId,a]}),getDeleteAppLink:a=>({application:i.SUBJECTS,action:n.Subjects.REMOVE_CLASSIFICATION_DASHBOARD,args:[t.classificationId,a]}),getNewDashboardAppLink:()=>({application:i.SUBJECTS,action:n.Subjects.NEW_CLASSIFICATION_DASHBOARD,args:[t.classificationId,t.presentationId,T.ClassificationDirectory]}),getCopyDashboardAppLink:a=>({application:i.SUBJECTS,action:n.Subjects.COPY_CLASSIFICATION_DASHBOARD,args:[a]})})]})}export{ia as EditClassificationDirectoriesListView};
//# sourceMappingURL=BoGZN3Il.chunk.js.map
