import{az as l,aj as c,aX as h,aZ as d,b0 as m,fO as y}from"./app-k0jcl5PQ.js";function T(){var n;const s=l(c.currentUser()),{hasPermissions:e,isLoaded:t}=h();return t&&!!((n=s.data)!=null&&n.isAuthenticated)&&!e(d.StudentExperience)&&!e(d.GuestExperience)}const p={learningLevels(s,e){return{url:"{gateway}/v1/learning-levels",key:"learning:levels",normalize:!1,success:s,error:e}}};function P(){const s=m(),e=l(c.currentUser()),t=T(),n=l(t&&c.getTeachingLevel(e.data.id,e.data.customerId)),g=e.hasCompleted&&(t?n.hasCompleted:!0);async function u(a){await s(c.setTeachingLevel(a))}async function v(a){var o;if(!(a!=null&&a.learningLevel))return;const i=await s(p.learningLevels());if(!((o=i==null?void 0:i.data)!=null&&o.length))return;const f=y.getMappedPresentationLevel(a.learningLevel),r=i.data.find(L=>L.value===f);r!=null&&r.id&&await u(r.id)}return{teachingLevel:n.data,isLoaded:g,setTeachingLevelAsync:u,setTeachingLevelFromPresentationAsync:v}}export{T as a,P as u};
//# sourceMappingURL=CECGJrz_.chunk.js.map
