import{az as N,bN as O,L as d,ah as l,aX as M,ao as a,fp as b,f as i,e as r,aU as m,aP as w,aq as P,p as v,cu as A,W as U,r as j}from"./app-k0jcl5PQ.js";import{B as R}from"./CCtuxSlD.chunk.js";import{P as _}from"./D9SGbB34.chunk.js";import{P as G,V as H,a as B}from"./DH1mz64H.chunk.js";import{u as C}from"./CAxN5LKv.chunk.js";import{u as F}from"./DDxzgH2W.chunk.js";import{U as D}from"./9ls1F1Ve.chunk.js";import"./CPXlV0fg.chunk.js";import"./BwBaQklX.chunk.js";import"./BlKMjFEf.chunk.js";import"./CofWDDSQ.chunk.js";import"./DwvfEevL.chunk.js";import"./ByBCp1MC.chunk.js";import"./BhYYYlpK.chunk.js";import"./FGhEvk_q.chunk.js";import"./WCBjpMHJ.chunk.js";import"./DoFMWlew.chunk.js";import"./CMnqIsoM.chunk.js";import"./eerUhItV.chunk.js";import"./Cukd0Qmt.chunk.js";import"./B31bqZwo.chunk.js";import"./uoUaCILN.chunk.js";import"./f_twTV5Z.chunk.js";import"./BDeUEvb2.chunk.js";import"./Daim1zo7.chunk.js";import"./B3XH0kWB.chunk.js";import"./BRhv_AHY.chunk.js";import"./BDviDDog.chunk.js";import"./wCY37Ze3.chunk.js";import"./CIN5bTKK.chunk.js";import"./DIAJ896Y.chunk.js";import"./fstW5ZQE.chunk.js";const o="userManager.studentsVideos",p=d.encloseNamespace(o);function Pa(s){var u,g,h,E,x,S;const t=N(D.getUser(s.id)),n=N(D.getStudentVideos(s.id,s.cursor));O({title:t.data?d.getPhrase(o,"pageTitle",{name:l.getFullName(t.data)}):""});const{hasPermissions:I}=M(),{commonVideoProps:L}=F(null);C(t);function T(){var e;return[{name:d.getPhrase(o,"settingsBreadcrumb"),appLink:{application:r.SETTINGS,action:i.Settings.HOME}},{name:d.getPhrase(o,"studentsBreadcrumb"),appLink:{application:r.USER_MANAGER,action:i.UserManager.STUDENTS}},{name:p("heading",{name:l.getFullName(t.data),yearGroup:(e=t.data.masterYearGroup)==null?void 0:e.name}),active:!0}]}function k(e,V){const y={...V.analyticsOptions,entity:A.getAnalyticsEntity(e),location:v.ViewStudentVideos},f={...V.analyticsData,id:e.id},c=[];return A.isVideo(e)&&c.push({order:1,label:p("download"),appLink:{application:r.VIDEOS,action:i.Videos.DOWNLOAD_VIDEO,args:[e.id]},analyticsOptions:{...y,actionType:j.Download,workflowPhase:U.Start},analyticsData:f}),c.push({order:2,label:p("delete"),appLink:{application:r.USER_MANAGER,action:i.UserManager.DELETE_STUDENTS_VIDEO,args:[s.id,e.id],params:{typeId:e.typeId}},className:"text-danger",analyticsOptions:{...y,actionType:j.Delete,workflowPhase:U.Start},analyticsData:f}),c}return t.hasCompleted&&n.hasCompleted?a.jsx(H.Provider,{value:{getVideoActions:k},children:a.jsxs("div",{className:"px-3",children:[a.jsx("h1",{className:"h2",children:p("heading",{name:l.getFullName(t.data),yearGroup:(u=t.data.masterYearGroup)==null?void 0:u.name})}),a.jsx("div",{className:"pb-3",children:a.jsx(R,{breadcrumbs:T()})}),(h=(g=n.data)==null?void 0:g.data)!=null&&h.length?a.jsx(B,{videos:(E=n.data)==null?void 0:E.data,getVideoAppLink:e=>({application:r.USER_MANAGER,action:i.UserManager.STUDENTS_VIDEO,args:[s.id,e.id],params:{typeId:e.typeId}}),hasPermissions:I,getPreviewQuestionsAppLink:e=>b.getPreviewQuestionsAppLink(e),presentationAudiences:null,commonVideoProps:{...L,canFavourite:null,setFavourite:null}}):a.jsxs(m,{children:[a.jsx(m.Image,{src:w.EmptyStates.MY_VIDEOS,altText:p("emptyInfo")}),a.jsx(m.Heading,{children:a.jsx(P,{namespace:o,phrase:"emptyHeading"})}),a.jsx(m.Info,{children:a.jsx(P,{namespace:o,phrase:"emptyInfo",options:{name:t.data.name}})})]}),!!((S=(x=n.data)==null?void 0:x.pagination)!=null&&S.cursors)&&a.jsx(_,{appLink:{application:r.USER_MANAGER,action:i.UserManager.STUDENTS_VIDEOS},cursors:{next:n.data.pagination.cursors.next,previous:s.cursor},buttonVariant:"outline-dark",className:"py-2 float-end",prevHack:!0})]})}):a.jsx("div",{className:"mx-n2",children:a.jsx(G,{allowBulkActions:!0})})}export{Pa as StudentsVideosView};
//# sourceMappingURL=CVtJw-BG.chunk.js.map
