import{aI as m,az as O,bc as T,c4 as v,aX as L,ao as s,aF as R,L as b,aO as E,aq as e,aZ as d,bU as c,ci as y,m as H,o as M,p as N,W as w,ch as D,r as U,E as B,A as _,l as I,a as q,f as i,v as F,e as S}from"./app-k0jcl5PQ.js";import{O as G}from"./fbx3ux4i.chunk.js";import{C as x}from"./_XP6hjk3.chunk.js";const C="classrooms.archiveClassroom",t=b.encloseNamespace(C);function X(o){const[r,A]=m.useState(!1),[f,l]=m.useState(!1),n=O(x.getClassroom(o.id)),u=T(),g=v(),{hasPermissions:h}=L();function j(){l(!0);const a={name:n.data.name,id:n.data.id,status:G.getStatusAsNumber(y.Disabled)};H(g,x.editClassroom(a,P,k))}function P(){l(!1),M.logUserAction({id:o.id},{entity:B.Classroom,actionType:U.Archive,descriptor:D.On,workflowPhase:w.Complete,location:N.Popup});const a={heading:I.Success,type:_.Success,message:t("successText",{name:n.data.name,escapeText:!0})};h(d.ManageCustomerSettings)&&(a.appLink={application:S.SETTINGS,action:i.Settings.ARCHIVED_CLASSROOMS},a.appLinkText=t("successAppLinkText"),a.appLinkClassName="info-link"),u.success(a),o.closePopup();const p=q.getCurrentRoute().appLink;(p.action===i.Classrooms.CLASSROOM_STUDENTS||p.action===i.Classrooms.CLASSROOM_GROUPS||p.action===i.Classrooms.CLASSROOM_TEACHERS)&&F.trigger({application:S.CLASSROOMS,action:i.Classrooms.HOME},{replace:!0})}function k(){l(!1),u.error(t("error",{name:n.data.name,escapeText:!0}))}return s.jsxs(R,{closePopup:o.closePopup,title:t("archive"),children:[s.jsxs(E.Provider,{value:C,children:[s.jsx("p",{className:"mb-0",children:s.jsx(e,{phrase:"info"})}),s.jsxs("ul",{children:[s.jsx("li",{children:s.jsx(e,{phrase:"infoPoint1"})}),s.jsx("li",{children:s.jsx(e,{phrase:"infoPoint2"})}),s.jsx("li",{children:s.jsx(e,{phrase:"infoPoint3"})}),s.jsx("li",{children:s.jsx(e,{phrase:"infoPoint4"})})]}),s.jsxs("p",{children:[s.jsx(e,{phrase:"canStillAccess"})," ",s.jsx(e,{phrase:h(d.ManageCustomerSettings)?"retrieveAdmins":"retrieveTeachers"})]})]}),s.jsxs(c,{children:[s.jsx(c.Checkbox,{id:"archive",onToggle:()=>A(!r),checked:r,label:t("iUnderstand")}),s.jsx(c.Cancel,{onClick:o.closePopup}),s.jsx(c.Submit,{text:t("archive"),onClick:j,variant:"dark",disabled:!r,showSpinner:f})]})]})}export{X as ArchiveClassroomView};
//# sourceMappingURL=Dt-jsEaB.chunk.js.map
