import{aI as S,bc as f,b0 as x,az as l,ao as t,aF as v,L as y,aq as A,bU as i,M as d,f0 as C,bw as P,dK as u,o as w,W as I,p as R,E as U,r as j,v as T,f as E,e as M}from"./app-k0jcl5PQ.js";import{U as k}from"./9ls1F1Ve.chunk.js";import"./fstW5ZQE.chunk.js";const p="userManager.deleteStudentsVideo",o=y.encloseNamespace(p);function q(e,s){return s.toString()===d.Clip.toString()?C.clip(e):s.toString()===d.Interactive.toString()?P.interactiveMetadata(e):u.video(e)}function D(e){const[s,m]=S.useState(!1),r=f(),g=x(),a=l(k.getUser(e.userId)),n=l(q(e.videoId,e.typeId));async function h(){m(!0);try{await g(u.delete(e.videoId)),r.success(o("success",{video:n.data.name,name:a.data.name,escapeText:!0})),w.logUserAction({id:e.videoId},{actionType:j.Delete,entity:U.Video,location:R.Popup,workflowPhase:I.Complete}),T.trigger({application:M.USER_MANAGER,action:E.UserManager.STUDENTS_VIDEOS,args:[e.userId]})}catch{r.error(o("error",{video:n.data.name,name:a.data.name,escapeText:!0}))}finally{e.closePopup()}}const c=n.hasCompleted&&a.hasCompleted;return t.jsx(v,{title:o("title"),closePopup:e.closePopup,showLoadingSpinner:!c,children:c&&t.jsxs(t.Fragment,{children:[t.jsx("p",{children:t.jsx(A,{namespace:p,phrase:"info",options:{video:n.data.name,name:a.data.name}})}),t.jsxs(i,{children:[t.jsx(i.Cancel,{onClick:e.closePopup}),t.jsx(i.Submit,{variant:"danger",text:o("delete",{name:a.data.name}),showSpinner:s,onClick:h})]})]})})}export{D as DeleteStudentsVideoView};
//# sourceMappingURL=Yr8Wla1p.chunk.js.map
