diff --git a/public/apps/webapp-schulverwaltung/assets/locales/de-CH.json b/public/apps/webapp-schulverwaltung/assets/locales/de-CH.json index a3d89c30..a433fd51 100644 --- a/public/apps/webapp-schulverwaltung/assets/locales/de-CH.json +++ b/public/apps/webapp-schulverwaltung/assets/locales/de-CH.json @@ -265,9 +265,7 @@ } }, "study-course-detail": { - "status": "Status", - "yes": "Ja", - "no": "Nein" + "status": "Status" } }, "courses": { diff --git a/public/apps/webapp-schulverwaltung/assets/locales/fr-CH.json b/public/apps/webapp-schulverwaltung/assets/locales/fr-CH.json index a0d9d4d8..9dac00f2 100644 --- a/public/apps/webapp-schulverwaltung/assets/locales/fr-CH.json +++ b/public/apps/webapp-schulverwaltung/assets/locales/fr-CH.json @@ -265,9 +265,7 @@ } }, "study-course-detail": { - "status": "Statut", - "yes": "Oui", - "no": "Non" + "status": "Statut" } }, "courses": { diff --git a/public/apps/webapp-schulverwaltung/chunk-LT27JE32.js b/public/apps/webapp-schulverwaltung/chunk-2B4VW3HX.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-LT27JE32.js rename to public/apps/webapp-schulverwaltung/chunk-2B4VW3HX.js index 3fff7690..9fdd84a7 100644 --- a/public/apps/webapp-schulverwaltung/chunk-LT27JE32.js +++ b/public/apps/webapp-schulverwaltung/chunk-2B4VW3HX.js @@ -1,2 +1,2 @@ -import{a as We,b as Ye}from"./chunk-CFQ5O3WW.js";import{b as ie}from"./chunk-DJH5AAGM.js";import"./chunk-C7RLEXTD.js";import"./chunk-QB4DIFWS.js";import{a as Ze}from"./chunk-W4ESFJ6M.js";import"./chunk-IGEPJF2N.js";import{a as Ke}from"./chunk-5ZBE3UL7.js";import"./chunk-4UVNKLEN.js";import{p as Ge}from"./chunk-PXVJ3QLD.js";import"./chunk-HCNFZOWE.js";import{e as ee}from"./chunk-CKFTESOV.js";import{b as He}from"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import"./chunk-A3AAQWNQ.js";import"./chunk-FH4OOWQM.js";import{d as Ue,f as F,g as qe}from"./chunk-Z4YBXGVO.js";import"./chunk-3L4RH6QP.js";import{d as ze}from"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{b as Be,c as Fe,x as Ne}from"./chunk-UYCIECIQ.js";import"./chunk-G6EB45SC.js";import{e as de,o as je}from"./chunk-WCDEMEW2.js";import{j as Ve}from"./chunk-XFA6UPZX.js";import{a as X,b as te}from"./chunk-PSYDBHTH.js";import{w as we}from"./chunk-W4U7QKJF.js";import"./chunk-AVBHFGIF.js";import{$a as c,Ab as E,Bb as U,Cb as H,Db as Te,Eb as w,Ga as S,Hc as Ie,Ic as Ee,Id as Re,Ja as fe,Jb as a,Jd as Ae,Kb as r,Lb as R,M as y,Md as Oe,Na as p,Nb as Pe,Nc as Q,O as be,P as D,Pa as oe,Pd as M,Qa as _,Ra as _e,Rd as Le,Va as m,X as B,Ya as Ce,Za as ge,_ as x,_a as d,a as V,ab as C,b as q,bc as De,cc as O,cd as L,d as pe,db as ae,dc as Y,ea as K,eb as ve,fa as W,g as me,ga as ue,gb as j,h as he,hb as f,hc as ce,ib as ye,jb as Se,l as A,lc as Z,n as u,o as G,qb as re,qc as $e,rb as l,sb as P,tb as T,ub as se,vb as xe,wa as z,xa as n,xc as ke,ya as v,yc as Me,zc as J}from"./chunk-2W7IS4PN.js";var ut=["*"];function ft(e,s){e&1&&ae(0)}function _t(e,s){if(e&1&&(d(0,"a",1),p(1,ft,1,0,"ng-container",3),c()),e&2){let t=f(),i=re(3);_("routerLink",t.link)("queryParams",t.linkParams),n(),_("ngTemplateOutlet",i)}}function Ct(e,s){e&1&&ae(0)}function gt(e,s){if(e&1&&(d(0,"a",2),p(1,Ct,1,0,"ng-container",3),c()),e&2){let t=f(),i=re(3);_("href",t.externalLink,z),n(),_("ngTemplateOutlet",i)}}function vt(e,s){if(e&1&&(d(0,"span",5),l(1),c()),e&2){let t=f(2);n(),P(t.count)}}function yt(e,s){e&1&&(ue(),d(0,"svg",6),C(1,"path",7),c())}function St(e,s){if(e&1&&(d(0,"span",4),l(1),a(2,"translate"),c(),d(3,"div"),Se(4),p(5,vt,2,1,"span",5)(6,yt,2,0,":svg:svg",6),c()),e&2){let t=f();n(),P(r(2,2,t.label)),n(4),m(t.hasCount(t.count)?5:6)}}var Je=(()=>{class e{constructor(){}hasCount(t){return typeof t=="number"&&t>=0}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-action"]],inputs:{label:"label",count:"count",link:"link",linkParams:"linkParams",externalLink:"externalLink"},ngContentSelectors:ut,decls:4,vars:2,consts:[["actionContent",""],[3,"routerLink","queryParams"],[3,"href"],[4,"ngTemplateOutlet"],[1,"label"],[1,"count"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","fill","none"],["fill","currentColor","d","m12 20-1.425-1.4 5.6-5.6H4v-2h12.175l-5.6-5.6L12 4l8 8-8 8Z"]],template:function(i,o){i&1&&(ye(),p(0,_t,2,3,"a",1)(1,gt,2,2,"a",2)(2,St,7,4,"ng-template",null,0,Pe)),i&2&&(m(o.externalLink?-1:0),n(),m(o.externalLink?1:-1))},dependencies:[J,De,M],styles:["a[_ngcontent-%COMP%]{display:flex;gap:1rem;justify-content:space-between;align-items:center;padding:1rem 1.5rem;background:#f7e9d2;text-decoration:none;line-height:1}a[_ngcontent-%COMP%]:hover{background:#f2e0c3}a[_ngcontent-%COMP%]:focus-visible{outline-width:2px;outline-offset:-2px}div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.label[_ngcontent-%COMP%]{font-weight:400}.count[_ngcontent-%COMP%]{font-size:1.5rem}"]})}}return e})();var Qe=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-deadline"]],inputs:{count:"count"},decls:3,vars:8,template:function(i,o){i&1&&(l(0),a(1,"translate"),a(2,"addSpace")),i&2&&xe("",r(1,3,"dashboard.actions.deadline"),"",R(2,5,": ",":"),"",o.count,` +import{a as We,b as Ye}from"./chunk-TDZZHHCJ.js";import{b as ie}from"./chunk-DJH5AAGM.js";import"./chunk-XUB6XQAX.js";import"./chunk-QB4DIFWS.js";import{a as Ze}from"./chunk-W4ESFJ6M.js";import"./chunk-IGEPJF2N.js";import{a as Ke}from"./chunk-5ZBE3UL7.js";import"./chunk-4UVNKLEN.js";import{p as Ge}from"./chunk-PXVJ3QLD.js";import"./chunk-HCNFZOWE.js";import{e as ee}from"./chunk-CKFTESOV.js";import{b as He}from"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import"./chunk-A3AAQWNQ.js";import"./chunk-FH4OOWQM.js";import{d as Ue,f as F,g as qe}from"./chunk-Z4YBXGVO.js";import"./chunk-3L4RH6QP.js";import{d as ze}from"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{b as Be,c as Fe,x as Ne}from"./chunk-UYCIECIQ.js";import"./chunk-G6EB45SC.js";import{e as de,o as je}from"./chunk-WCDEMEW2.js";import{j as Ve}from"./chunk-XFA6UPZX.js";import{a as X,b as te}from"./chunk-PSYDBHTH.js";import{w as we}from"./chunk-W4U7QKJF.js";import"./chunk-AVBHFGIF.js";import{$a as c,Ab as E,Bb as U,Cb as H,Db as Te,Eb as w,Ga as S,Hc as Ie,Ic as Ee,Id as Re,Ja as fe,Jb as a,Jd as Ae,Kb as r,Lb as R,M as y,Md as Oe,Na as p,Nb as Pe,Nc as Q,O as be,P as D,Pa as oe,Pd as M,Qa as _,Ra as _e,Rd as Le,Va as m,X as B,Ya as Ce,Za as ge,_ as x,_a as d,a as V,ab as C,b as q,bc as De,cc as O,cd as L,d as pe,db as ae,dc as Y,ea as K,eb as ve,fa as W,g as me,ga as ue,gb as j,h as he,hb as f,hc as ce,ib as ye,jb as Se,l as A,lc as Z,n as u,o as G,qb as re,qc as $e,rb as l,sb as P,tb as T,ub as se,vb as xe,wa as z,xa as n,xc as ke,ya as v,yc as Me,zc as J}from"./chunk-2W7IS4PN.js";var ut=["*"];function ft(e,s){e&1&&ae(0)}function _t(e,s){if(e&1&&(d(0,"a",1),p(1,ft,1,0,"ng-container",3),c()),e&2){let t=f(),i=re(3);_("routerLink",t.link)("queryParams",t.linkParams),n(),_("ngTemplateOutlet",i)}}function Ct(e,s){e&1&&ae(0)}function gt(e,s){if(e&1&&(d(0,"a",2),p(1,Ct,1,0,"ng-container",3),c()),e&2){let t=f(),i=re(3);_("href",t.externalLink,z),n(),_("ngTemplateOutlet",i)}}function vt(e,s){if(e&1&&(d(0,"span",5),l(1),c()),e&2){let t=f(2);n(),P(t.count)}}function yt(e,s){e&1&&(ue(),d(0,"svg",6),C(1,"path",7),c())}function St(e,s){if(e&1&&(d(0,"span",4),l(1),a(2,"translate"),c(),d(3,"div"),Se(4),p(5,vt,2,1,"span",5)(6,yt,2,0,":svg:svg",6),c()),e&2){let t=f();n(),P(r(2,2,t.label)),n(4),m(t.hasCount(t.count)?5:6)}}var Je=(()=>{class e{constructor(){}hasCount(t){return typeof t=="number"&&t>=0}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-action"]],inputs:{label:"label",count:"count",link:"link",linkParams:"linkParams",externalLink:"externalLink"},ngContentSelectors:ut,decls:4,vars:2,consts:[["actionContent",""],[3,"routerLink","queryParams"],[3,"href"],[4,"ngTemplateOutlet"],[1,"label"],[1,"count"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","fill","none"],["fill","currentColor","d","m12 20-1.425-1.4 5.6-5.6H4v-2h12.175l-5.6-5.6L12 4l8 8-8 8Z"]],template:function(i,o){i&1&&(ye(),p(0,_t,2,3,"a",1)(1,gt,2,2,"a",2)(2,St,7,4,"ng-template",null,0,Pe)),i&2&&(m(o.externalLink?-1:0),n(),m(o.externalLink?1:-1))},dependencies:[J,De,M],styles:["a[_ngcontent-%COMP%]{display:flex;gap:1rem;justify-content:space-between;align-items:center;padding:1rem 1.5rem;background:#f7e9d2;text-decoration:none;line-height:1}a[_ngcontent-%COMP%]:hover{background:#f2e0c3}a[_ngcontent-%COMP%]:focus-visible{outline-width:2px;outline-offset:-2px}div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.label[_ngcontent-%COMP%]{font-weight:400}.count[_ngcontent-%COMP%]{font-size:1.5rem}"]})}}return e})();var Qe=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-deadline"]],inputs:{count:"count"},decls:3,vars:8,template:function(i,o){i&1&&(l(0),a(1,"translate"),a(2,"addSpace")),i&2&&xe("",r(1,3,"dashboard.actions.deadline"),"",R(2,5,": ",":"),"",o.count,` `)},dependencies:[M,qe],styles:["[_nghost-%COMP%]{background:#ea161f;color:#fff;white-space:nowrap;font-weight:500;font-size:.875rem;min-height:1.5rem;display:flex;padding:.375rem .5rem;align-items:center;border-radius:2.5rem}"]})}}return e})();var Xe=Q({Id:Ee,Holder:Ie});var et=(()=>{class e extends X{constructor(t,i){super(t,i,Xe,"TeacherSubstitutions")}getTeacherSubstitution(t){return this.getList({params:{"filter.Id":`=${t}`}}).pipe(u(i=>i[0]||null))}static{this.\u0275fac=function(i){return new(i||e)(x(Z),x(L))}}static{this.\u0275prov=B({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var kt=["LessonTeacherRole","ClassTeacherRole","TeacherRole","AbsenceAdministratorRole"],Mt=["LessonTeacherRole","TeacherRole","StudentRole","SubstituteAdministratorRole"],It=["LessonTeacherRole","StudentRole"],I=(()=>{class e{constructor(t,i,o,h,b,$,N,bt){this.settingsService=t,this.lessonPresencesService=i,this.studentsService=o,this.courseService=h,this.teacherSubstitutionService=b,this.personService=$,this.storageService=N,this.settings=bt,this.rolesAndPermissions$=this.settingsService.getRolesAndPermissions(),this.userId$=new he(1),this.lessonAbsences$=this.userId$.pipe(D(g=>this.studentsService.getLessonAbsences(g)),y(1)),this.lessonIncidents$=this.userId$.pipe(D(g=>this.studentsService.getLessonIncidents(g)),y(1)),this.loading$=this.rolesAndPermissions$.pipe(u(g=>g==null)),this.hasSearch$=this.rolesAndPermissions$.pipe(u(this.hasRoles(kt))),this.hasActions$=this.rolesAndPermissions$.pipe(u(this.hasRoles(Mt))),this.hasTimetable$=this.rolesAndPermissions$.pipe(u(this.hasRoles(It))),this.hasLessonTeacherRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["LessonTeacherRole"])),y(1)),this.hasTeacherRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["TeacherRole"])),y(1)),this.hasStudentRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["StudentRole"])),y(1)),this.hasSubstituteAdministratorRole$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["SubstituteAdministratorRole"])),y(1)),this.editAbsencesCount$=this.hasLessonTeacherRole$.pipe(D(g=>g?this.lessonPresencesService.checkableAbsencesCount():A(!1)),y(1)),this.openAbsencesCount$=this.rolesAndPermissions$.pipe(u(this.hasRoles(["LessonTeacherRole","ClassTeacherRole"])),D(g=>g?this.lessonPresencesService.getListOfUnconfirmed():A([])),u(g=>g.length),y(1)),this.myAbsencesCount$=this.hasStudentRole$.pipe(D(g=>g?this.getMyAbsences():A([])),u(this.getMyAbsencesCount.bind(this)),y(1)),this.coursesToRateCount$=this.courseService.getNumberOfCoursesForRating().pipe(be(0),y(1)),this.hasPresenceControl$=this.hasLessonTeacherRole$.pipe(D(g=>g?this.lessonPresencesService.hasLessonsLessonTeacher():A(!1)),y(1)),this.hasOpenAbsences$=this.openAbsencesCount$.pipe(u(g=>g>0),y(1)),this.editAbsencesParams$=this.getFullName().pipe(u(g=>({confirmationStates:this.settings.checkableAbsenceStateId,teacher:g})),y(1));let le=this.storageService.getPayload()?.id_person;le&&this.userId$.next(Number(le))}hasRoles(t){return i=>(i??[]).some(o=>t.includes(o))}getMyAbsences(){return G([this.userId$,this.lessonAbsences$,this.lessonIncidents$]).pipe(D(([t,i,o])=>this.loadTimetableEntries(t,i,o).pipe(u(h=>[...i,...o].map(b=>this.withTimetableEntry(b,h)).filter(we)))))}getMyAbsencesCount(t){return t?.filter(i=>("ConfirmationStateId"in i?i.ConfirmationStateId:null)===this.settings.unconfirmedAbsenceStateId).length||0}getFullName(){let t=Number(this.storageService.getPayload()?.substitution_id)||null;return t?this.teacherSubstitutionService.getTeacherSubstitution(t).pipe(u(i=>i?.Holder)):this.personService.getMyself().pipe(u(i=>i.FullName))}withTimetableEntry(t,i){return i.find(o=>o.Id===t.LessonRef.Id)?t:null}loadTimetableEntries(t,i,o){return this.studentsService.getTimetableEntries(t,{"filter.Id":`;${[...i,...o].map(h=>h.LessonRef.Id).join(";")}`})}static{this.\u0275fac=function(i){return new(i||e)(x(ie),x(ee),x(F),x(Ge),x(et),x(He),x(Le),x(L))}}static{this.\u0275prov=B({token:e,factory:e.\u0275fac})}}return e})();var Et=()=>["/presence-control"],Rt=()=>["/edit-absences"],At=()=>["/open-absences"],Ot=()=>["/events"],Lt=()=>["/my-absences","report"],wt=()=>["/my-absences"];function Bt(e,s){e&1&&C(0,"bkd-dashboard-action",0),e&2&&_("label","dashboard.actions.presence-control")("link",w(2,Et))}function jt(e,s){if(e&1&&(C(0,"bkd-dashboard-action",1),a(1,"async"),a(2,"async")),e&2){let t=f();_("label","dashboard.actions.edit-absences")("link",w(8,Rt))("linkParams",r(1,4,t.dashboardService.editAbsencesParams$))("count",r(2,6,t.dashboardService.editAbsencesCount$))}}function Ft(e,s){if(e&1&&(C(0,"bkd-dashboard-action",2),a(1,"async")),e&2){let t=f();_("label","dashboard.actions.open-absences")("link",w(5,At))("count",r(1,3,t.dashboardService.openAbsencesCount$))}}function Nt(e,s){if(e&1&&(C(0,"bkd-dashboard-deadline",4),a(1,"async")),e&2){let t=f(2);_("count",r(1,1,t.dashboardService.coursesToRateCount$))}}function zt(e,s){if(e&1&&(d(0,"bkd-dashboard-action",0),p(1,Nt,2,3,"bkd-dashboard-deadline",4),a(2,"async"),c()),e&2){let t,i=f();_("label","dashboard.actions.tests")("link",w(5,Ot)),n(),m((t=r(2,3,i.dashboardService.coursesToRateCount$))!==null&&t!==void 0&&t?1:-1)}}function Ut(e,s){e&1&&C(0,"bkd-dashboard-action",0),e&2&&_("label","dashboard.actions.my-absences-report")("link",w(2,Lt))}function Ht(e,s){if(e&1&&(C(0,"bkd-dashboard-action",2),a(1,"async")),e&2){let t=f();_("label","dashboard.actions.my-absences")("link",w(5,wt))("count",r(1,3,t.dashboardService.myAbsencesCount$))}}function Vt(e,s){if(e&1&&C(0,"bkd-dashboard-action",3),e&2){let t=f();_("label","dashboard.actions.substitutions")("externalLink",t.substitutionsAdminLink)}}var it=(()=>{class e{constructor(t,i){this.dashboardService=t,this.settings=i}get substitutionsAdminLink(){return this.settings.dashboard.substitutionsAdminLink}static{this.\u0275fac=function(i){return new(i||e)(v(I),v(L))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-actions"]],decls:15,vars:23,consts:[[3,"label","link"],[3,"label","link","linkParams","count"],[3,"label","link","count"],[3,"label","externalLink"],[3,"count"]],template:function(i,o){i&1&&(p(0,Bt,1,3,"bkd-dashboard-action",0),a(1,"async"),p(2,jt,3,9,"bkd-dashboard-action",1),a(3,"async"),a(4,"async"),p(5,Ft,2,6,"bkd-dashboard-action",2),a(6,"async"),p(7,zt,3,6,"bkd-dashboard-action",0),a(8,"async"),p(9,Ut,1,3,"bkd-dashboard-action",0),a(10,"async"),p(11,Ht,2,6,"bkd-dashboard-action",2),a(12,"async"),p(13,Vt,1,2,"bkd-dashboard-action",3),a(14,"async")),i&2&&(m(r(1,7,o.dashboardService.hasPresenceControl$)?0:-1),n(2),m(r(3,9,o.dashboardService.hasLessonTeacherRole$)&&r(4,11,o.dashboardService.editAbsencesParams$)?2:-1),n(3),m(r(6,13,o.dashboardService.hasOpenAbsences$)?5:-1),n(2),m(r(8,15,o.dashboardService.hasTeacherRole$)?7:-1),n(2),m(r(10,17,o.dashboardService.hasStudentRole$)?9:-1),n(2),m(r(12,19,o.dashboardService.hasStudentRole$)?11:-1),n(2),m(r(14,21,o.dashboardService.hasSubstituteAdministratorRole$)?13:-1))},dependencies:[Je,Qe,O],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}"]})}}return e})();var nt=(()=>{class e{constructor(t,i){this.studentsRestService=t,this.router=i}navigateToDossier(t){return pe(this,null,function*(){let i=Number(t);yield this.router.navigate(["dashboard","student",i,"addresses"])})}static{this.\u0275fac=function(i){return new(i||e)(v(F),v(Me))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-search"]],decls:1,vars:2,consts:[[3,"valueChange","typeaheadService","placeholder"]],template:function(i,o){i&1&&(d(0,"bkd-typeahead",0),j("valueChange",function(b){return b&&o.navigateToDossier(b)}),c()),i&2&&_("typeaheadService",o.studentsRestService)("placeholder","dashboard.search.placeholder")},dependencies:[Ze],styles:["[_nghost-%COMP%]{display:block;padding:.75rem;background:#f7e9d2}"]})}}return e})();var ot=(()=>{class e{constructor(t){this.sanitizer=t}transform(t,i){switch(i){case"html":return this.sanitizer.bypassSecurityTrustHtml(t);case"style":return this.sanitizer.bypassSecurityTrustStyle(t);case"script":return this.sanitizer.bypassSecurityTrustScript(t);case"url":return this.sanitizer.bypassSecurityTrustUrl(t);case"resourceUrl":return this.sanitizer.bypassSecurityTrustResourceUrl(t);default:throw new Error(`Invalid safe type specified: ${i}`)}}static{this.\u0275fac=function(i){return new(i||e)(v($e,16))}}static{this.\u0275pipe=fe({name:"safe",type:e,pure:!0})}}return e})();function at(e){return{id:ct(e.EventId,e.Id),from:e.From,until:e.To,eventId:e.EventId,subject:e.EventDesignation,room:e.EventLocation||void 0,teacher:e.EventManagerInformation||void 0}}function rt(e){let s=e.reduce((t,i)=>{let o=ct(i.EventRef.Id,i.LessonRef.Id);return q(V({},t),{[o]:[...t[o]??[],i.StudyClassNumber]})},{});return Object.keys(s).reduce((t,i)=>q(V({},t),{[i]:Re([...s[i]].sort())}),{})}function st(e,s){return e.map(t=>q(V({},t),{studyClass:s[t.id]?.join(", ")}))}function ct(e,s){return`${e}-${s}`}var qt=(e,s)=>s.id;function Gt(e,s){e&1&&(d(0,"th"),l(1),a(2,"translate"),c()),e&2&&(n(),T(" ",r(2,1,"dashboard.timetable.table.teacher")," "))}function Kt(e,s){if(e&1&&(E(0),d(1,"a",3),l(2),d(3,"span",8),l(4),c()()),e&2){let t=f().$implicit,i=f(2).buildLink(t.eventId);n(),_("routerLink",i.link)("queryParams",i.params),n(),T(" ",t.subject,""),n(2),T(", ",t.studyClass,"")}}function Wt(e,s){if(e&1&&l(0),e&2){let t=f().$implicit;T(" ",t.subject," ")}}function Yt(e,s){if(e&1&&(d(0,"td",4),l(1),a(2,"translate"),c()),e&2){let t=f().$implicit;n(),se(" ",r(2,2,"dashboard.timetable.table.study-class"),": ",t.studyClass," ")}}function Zt(e,s){if(e&1&&(d(0,"td",5),l(1),c()),e&2){let t=f().$implicit;n(),T(" ",t.teacher," ")}}function Jt(e,s){e&1&&(d(0,"span",7),l(1),a(2,"translate"),c()),e&2&&(n(),P(r(2,1,"dashboard.timetable.table.room")))}function Qt(e,s){if(e&1&&(d(0,"tr")(1,"td",1),l(2),a(3,"date"),a(4,"date"),c(),d(5,"td",2),p(6,Kt,5,4,"a",3),a(7,"async"),p(8,Wt,1,1),c(),p(9,Yt,3,4,"td",4),a(10,"async"),p(11,Zt,2,1,"td",5),a(12,"async"),d(13,"td",6),p(14,Jt,3,3,"span",7),l(15),c()()),e&2){let t=s.$implicit,i=f(2);n(2),se(" ",R(3,7,t.from,"HH:mm"),"\u2013",R(4,10,t.until,"HH:mm")," "),n(4),m(r(7,13,i.isTeacher$)?6:8),n(3),m(r(10,15,i.isTeacher$)?9:-1),n(2),m(r(12,17,i.isStudent$)?11:-1),n(3),m(t.room?14:-1),n(),T(" ",t.room," ")}}function Xt(e,s){if(e&1&&(d(0,"table",0)(1,"thead")(2,"tr")(3,"th"),l(4),a(5,"translate"),c(),d(6,"th"),l(7),a(8,"translate"),c(),p(9,Gt,3,3,"th"),a(10,"async"),d(11,"th"),l(12),a(13,"translate"),c()()(),d(14,"tbody"),Ce(15,Qt,16,19,"tr",null,qt),c()()),e&2){let t=f();n(4),P(r(5,4,"dashboard.timetable.table.time")),n(3),P(r(8,6,"dashboard.timetable.table.subject")),n(2),m(r(10,8,t.isStudent$)?9:-1),n(3),T(" ",r(13,10,"dashboard.timetable.table.room")," "),n(3),ge(t.entries)}}function ei(e,s){e&1&&(d(0,"p"),l(1),a(2,"translate"),c()),e&2&&(n(),P(r(2,1,"dashboard.timetable.no-entries")))}var dt=(()=>{class e{constructor(t){this.dashboardService=t,this.entries=[],this.isStudent$=this.dashboardService.hasStudentRole$,this.isTeacher$=this.dashboardService.hasLessonTeacherRole$}buildLink(t){return ze(We(t,"/dashboard"))}static{this.\u0275fac=function(i){return new(i||e)(v(I))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-timetable-table"]],inputs:{entries:"entries"},decls:2,vars:1,consts:[[1,"table"],[1,"time"],[1,"subject"],[3,"routerLink","queryParams"],[1,"study-class"],[1,"teacher"],[1,"room"],[1,"room-label"],[1,"subject-study-class"]],template:function(i,o){i&1&&p(0,Xt,17,12,"table",0)(1,ei,3,3,"p"),i&2&&m(o.entries.length>0?0:1)},dependencies:[O,Y,M,J],styles:['td[_ngcontent-%COMP%], th[_ngcontent-%COMP%]{padding:1rem 1.75rem}.room-label[_ngcontent-%COMP%], td.study-class[_ngcontent-%COMP%]{display:none}@media (max-width: 767.98px){table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{display:none}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%]{border-top:1px solid var(--bs-border-color)}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"time room" "subject subject" "study-class study-class" "teacher teacher";gap:.5rem;padding:1rem;border-bottom:1px solid var(--bs-border-color)}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0;padding:0}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.time[_ngcontent-%COMP%]{grid-area:time;font-size:.875rem;line-height:1.125rem;font-weight:300}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.subject[_ngcontent-%COMP%]{grid-area:subject;font-size:1rem;line-height:1.25rem;font-weight:400}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.teacher[_ngcontent-%COMP%]{grid-area:teacher;font-size:.8125rem;line-height:1.0625rem;font-weight:300}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.room[_ngcontent-%COMP%]{grid-area:room;text-align:right;font-size:.875rem;line-height:1.125rem;font-weight:300}table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td.study-class[_ngcontent-%COMP%]{grid-area:study-class;font-size:.8125rem;line-height:1.0625rem;font-weight:300}td.study-class[_ngcontent-%COMP%]{display:block}.subject-study-class[_ngcontent-%COMP%]{display:none}.room-label[_ngcontent-%COMP%]{display:inline}}']})}}return e})();var ti=Q({}),lt=(()=>{class e extends X{constructor(t,i){super(t,i,ti,"Teachers")}getTimetableEntries(t,i={}){let o=i instanceof ce?i:new ce({fromObject:i});return o=o.set("fields","Id,From,To,EventId,EventNumber,EventDesignation,EventLocation"),this.http.get(`${this.baseUrl}/${t}/TimetableEntries/CurrentSemester`,{params:o}).pipe(D(Oe(Ue)))}static{this.\u0275fac=function(i){return new(i||e)(x(Z),x(L))}}static{this.\u0275prov=B({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function ni(e,s){e&1&&(d(0,"a",6),a(1,"safe"),l(2),a(3,"translate"),c()),e&2&&(_("href",R(1,2,s,"url"),z),n(2),T(" ",r(3,5,"dashboard.timetable.subscribe-calendar")," "))}function oi(e,s){e&1&&C(0,"bkd-spinner")}function ai(e,s){e&1&&(d(0,"a",8),a(1,"safe"),l(2),a(3,"translate"),c()),e&2&&(_("href",R(1,2,s,"url"),z),n(2),T(" ",r(3,5,"dashboard.timetable.subscribe-calendar")," "))}function ri(e,s){if(e&1&&(C(0,"bkd-dashboard-timetable-table",7),p(1,ai,4,7,"a",8),a(2,"async")),e&2){let t,i=f(),o=H(18);_("entries",o),n(),m((t=r(2,2,i.getSubscribeCalendarUrl()))?1:-1,t)}}var si="cal",pt=(()=>{class e{constructor(t,i,o,h,b,$){this.teachersService=t,this.studentsService=i,this.lessonPresencesService=o,this.userSettings=h,this.dashboardService=b,this.loadingService=$,this.userId$=this.dashboardService.userId$,this.isTeacher$=this.dashboardService.hasLessonTeacherRole$,this.isStudent$=this.dashboardService.hasStudentRole$,this.date$=new me(de(new Date)),this.loading$=this.loadingService.loading$,this.timetableEntries$=this.loadTimetableEntries()}gotoToday(){this.date$.next(de(new Date))}gotoPreviousDay(){this.date$.next(Fe(this.date$.getValue(),1))}gotoNextDay(){this.date$.next(Be(this.date$.getValue(),1))}getSubscribeCalendarUrl(){return this.userSettings.getSetting(si)}loadTimetableEntries(){return G([this.isTeacher$,this.isStudent$,this.userId$,this.date$]).pipe(D(([t,i,o,h])=>{let b=()=>t?this.fetchTimetableEntries("teacher",o,h):i?this.fetchTimetableEntries("student",o,h):A([]);return this.loadingService.load(b())}),y(1))}fetchTimetableEntries(t,i,o){let h={"filter.From":`=${je(o,"yyyy-MM-dd")}`,sort:"From,To"};return(t==="teacher"?this.teachersService.getTimetableEntries(i,h):this.studentsService.getTimetableEntries(i,h)).pipe(u(b=>b.map(at)),u(b=>Ae(b,$=>$.id)),D(b=>t==="teacher"?this.loadStudyClasses(o).pipe(u($=>st(b,$))):A(b)))}loadStudyClasses(t){return this.lessonPresencesService.getLessonStudyClassesByDate(t).pipe(u(rt))}static{this.\u0275fac=function(i){return new(i||e)(v(lt),v(F),v(ee),v(ie),v(I),v(Ve))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-timetable"]],decls:23,vars:24,consts:[[1,"header"],["type","button",1,"btn","btn-primary","today",3,"click"],["type","button",1,"btn","btn-secondary","previous-day",3,"click"],[1,"material-icons"],["type","button",1,"btn","btn-secondary","next-day",3,"click"],[1,"date"],["target","_parent",1,"btn","btn-secondary","subscribe-calendar-header",3,"href"],[3,"entries"],["target","_parent",1,"btn","btn-secondary","subscribe-calendar-bottom",3,"href"]],template:function(i,o){if(i&1){let h=ve();d(0,"div",0)(1,"button",1),j("click",function(){return K(h),W(o.gotoToday())}),l(2),a(3,"translate"),c(),d(4,"button",2),a(5,"translate"),j("click",function(){return K(h),W(o.gotoPreviousDay())}),d(6,"span",3),l(7,"chevron_left"),c()(),d(8,"button",4),a(9,"translate"),j("click",function(){return K(h),W(o.gotoNextDay())}),d(10,"span",3),l(11,"chevron_right"),c()(),d(12,"div",5),l(13),a(14,"async"),a(15,"date"),c(),p(16,ni,4,7,"a",6),a(17,"async"),c(),E(18),a(19,"async"),p(20,oi,1,0,"bkd-spinner"),a(21,"async"),p(22,ri,3,4)}if(i&2){let h;n(2),T(" ",r(3,6,"dashboard.timetable.today")," "),n(2),oe("aria-label",r(5,8,"dashboard.timetable.previousDay")),n(4),oe("aria-label",r(9,10,"dashboard.timetable.nextDay")),n(5),P(R(15,14,r(14,12,o.date$),"E, dd. MMMM yyyy")),n(3),m((h=r(17,17,o.getSubscribeCalendarUrl()))?16:-1,h),n(2),U(r(19,19,o.timetableEntries$)),n(2),m(r(21,22,o.loading$)?20:22)}},dependencies:[dt,te,O,Y,M,ot],styles:["[_nghost-%COMP%]{display:block;margin-bottom:1rem}.header[_ngcontent-%COMP%]{margin-top:1rem;margin-bottom:2rem;display:flex;align-items:center;gap:1rem}.previous-day[_ngcontent-%COMP%], .next-day[_ngcontent-%COMP%]{padding-left:.375rem;padding-right:.375rem}.date[_ngcontent-%COMP%]{font-size:1.25rem;font-weight:600}.subscribe-calendar-header[_ngcontent-%COMP%]{margin-left:auto}.subscribe-calendar-bottom[_ngcontent-%COMP%]{display:none}a.btn[_ngcontent-%COMP%]{text-decoration:none}@media (max-width: 767.98px){.subscribe-calendar-header[_ngcontent-%COMP%]{display:none}.subscribe-calendar-bottom[_ngcontent-%COMP%]{display:block;margin-top:2rem}}@media (max-width: 767.98px) and (max-width: 575.98px){.header[_ngcontent-%COMP%]{flex-wrap:wrap-reverse}.header[_ngcontent-%COMP%] .date[_ngcontent-%COMP%]{width:100%}}"]})}}return e})();function ci(e,s){e&1&&C(0,"bkd-spinner")}function di(e,s){e&1&&(d(0,"p"),l(1),a(2,"translate"),c()),e&2&&(n(),T(" ",r(2,1,"dashboard.no-access")," "))}function li(e,s){e&1&&(d(0,"div")(1,"h2"),l(2),a(3,"translate"),c(),C(4,"bkd-dashboard-search"),c()),e&2&&(n(2),P(r(3,1,"dashboard.search.title")))}function pi(e,s){e&1&&(d(0,"div")(1,"h2"),l(2),a(3,"translate"),c(),C(4,"bkd-dashboard-actions"),c()),e&2&&(n(2),P(r(3,1,"dashboard.actions.title")))}function mi(e,s){if(e&1&&(d(0,"div",1),p(1,li,5,3,"div")(2,pi,5,3,"div"),c()),e&2){f();let t=H(2),i=H(4);n(),m(t?1:-1),n(),m(i?2:-1)}}function hi(e,s){e&1&&(d(0,"div",2)(1,"h2"),l(2),a(3,"translate"),c(),C(4,"bkd-dashboard-timetable"),c()),e&2&&(n(2),P(r(3,1,"dashboard.timetable.title")))}var mt=(()=>{class e{constructor(t){this.dashboardService=t}static{this.\u0275fac=function(i){return new(i||e)(v(I))}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard-layout"]],decls:17,vars:19,consts:[[1,"columns"],[1,"search-actions-column"],[1,"timetable-column"]],template:function(i,o){if(i&1&&(E(0),a(1,"async"),E(2),a(3,"async"),E(4),a(5,"async"),E(6),a(7,"async"),d(8,"div")(9,"h1"),l(10),a(11,"translate"),c(),p(12,ci,1,0,"bkd-spinner")(13,di,3,3,"p"),d(14,"div",0),p(15,mi,3,2,"div",1)(16,hi,5,3,"div",2),c()()),i&2){let h=r(1,7,o.dashboardService.loading$);n(2);let b=U(r(3,9,o.dashboardService.hasSearch$));n(2);let $=U(r(5,12,o.dashboardService.hasActions$)),N=r(7,15,o.dashboardService.hasTimetable$);n(5),_e("visually-hidden",h||b||$||N),n(),T(" ",r(11,17,"dashboard.heading")," "),n(2),m(h?12:-1),n(),m(!h&&!b&&!$&&!N?13:-1),n(2),m(b||$?15:-1),n(),m(N?16:-1)}},dependencies:[te,nt,it,pt,O,M],styles:[".columns[_ngcontent-%COMP%]{display:flex;flex-direction:column}.columns[_ngcontent-%COMP%], .search-actions-column[_ngcontent-%COMP%]{gap:3rem}.search-actions-column[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;max-width:40rem}.timetable-column[_ngcontent-%COMP%]{flex:2}@media (min-width: 992px){.columns[_ngcontent-%COMP%]{flex-direction:row;gap:1.5rem}.search-actions-column[_ngcontent-%COMP%]{max-width:33%}}"],changeDetection:0})}}return e})();var ht=(()=>{class e{constructor(){}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=S({type:e,selectors:[["bkd-dashboard"]],features:[Te([I,Ne])],decls:1,vars:0,template:function(i,o){i&1&&C(0,"router-outlet")},dependencies:[ke],encapsulation:2,changeDetection:0})}}return e})();var En=[{path:"",component:ht,children:[{path:"",component:mt},Ke,Ye("students/:id")]}];export{En as DASHBOARD_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-C7RLEXTD.js b/public/apps/webapp-schulverwaltung/chunk-C7RLEXTD.js deleted file mode 100644 index e6178aae..00000000 --- a/public/apps/webapp-schulverwaltung/chunk-C7RLEXTD.js +++ /dev/null @@ -1 +0,0 @@ -import{q as l}from"./chunk-PXVJ3QLD.js";import{a as y}from"./chunk-PSYDBHTH.js";import{Hc as n,Ic as i,Md as m,Nc as p,P as o,Vc as d,X as c,_ as s,cd as v,hc as f,lc as u,n as a}from"./chunk-2W7IS4PN.js";var E=p({Id:i,Designation:n,Leadership:d(n),StudentCount:i}),I=p({Id:i,EventType:n,EventTypeId:i});var M=(()=>{class e extends y{constructor(t,r){super(t,r,E,"Events")}getStudyCourseEvents(){let t=new f().set("filter.EventTypeId","=1");return this.getList({params:t})}getSubscriptionDetailsDefinitions(t){return this.http.get(`${this.baseUrl}/${t}/SubscriptionDetails`).pipe(o(m(l)))}getEventTypeId(t){let r={fields:"Id,EventTypeId,EventType","filter.Id":`=${t}`};return this.http.get(`${this.baseUrl}/`,{params:r}).pipe(o(m(I)),a(b=>b[0]?.EventTypeId??null))}static{this.\u0275fac=function(r){return new(r||e)(s(u),s(v))}}static{this.\u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{M as a}; diff --git a/public/apps/webapp-schulverwaltung/chunk-CFQ5O3WW.js b/public/apps/webapp-schulverwaltung/chunk-CFQ5O3WW.js deleted file mode 100644 index 0c566250..00000000 --- a/public/apps/webapp-schulverwaltung/chunk-CFQ5O3WW.js +++ /dev/null @@ -1,2 +0,0 @@ -import{a as ct}from"./chunk-C7RLEXTD.js";import{a as lt,b as pt}from"./chunk-QB4DIFWS.js";import{a as Ai}from"./chunk-IGEPJF2N.js";import{a as It}from"./chunk-5ZBE3UL7.js";import{e as Vi}from"./chunk-4UVNKLEN.js";import{a as Et,b as ki,c as Pi,d as Mi,e as Oi,f as st,g as at,h as $i,i as Gi,j as Li,k as Di,l as Fi,m as Be,o as Ri,p as ge,r as je,s as Bi,u as ji,v as dt}from"./chunk-PXVJ3QLD.js";import{e as xi}from"./chunk-CKFTESOV.js";import{b as rt}from"./chunk-DTTSX64G.js";import{a as yi}from"./chunk-Y4QYVF5K.js";import{a as Hi}from"./chunk-A3AAQWNQ.js";import{a as mt,c as Ni}from"./chunk-FH4OOWQM.js";import{a as Ei,b as Ii}from"./chunk-Z4YBXGVO.js";import{a as bi,d as ot}from"./chunk-3L4RH6QP.js";import{a as Ti,d as wi}from"./chunk-DTYYCJHM.js";import{G as Ve,x as Si}from"./chunk-UYCIECIQ.js";import{a as Re,c as Ci,d as xe}from"./chunk-G6EB45SC.js";import{o as _i}from"./chunk-WCDEMEW2.js";import{i as nt,j as be}from"./chunk-XFA6UPZX.js";import{a as it,b as he}from"./chunk-PSYDBHTH.js";import{a as ei,b as se,h as pi,i as ci,k as mi,l as ui,r as et,w as ue}from"./chunk-W4U7QKJF.js";import{a as tt}from"./chunk-AVBHFGIF.js";import{$ as At,$a as a,$b as ce,Ab as R,Ad as De,B as Ft,Bb as A,Bd as li,C as Rt,Cb as O,D as Bt,Db as ne,Ea as bt,Eb as Oe,F as ae,Fa as Pe,Fb as D,Ga as _,Gb as wt,H as Z,Hd as hi,Ia as Yt,Id as gi,J as qe,Ja as Kt,Jb as l,K as jt,Kb as c,Kd as fi,Lb as F,M as J,Md as vi,Na as T,O as Vt,Ob as Qt,Od as X,P as M,Pd as I,Qa as m,R as _e,Ra as le,Rd as Fe,Sb as z,Tb as Xt,Va as y,X as oe,Xa as Me,Ya as H,Za as N,_ as $,_a as s,a as L,ab as x,b as j,ba as Ht,ca as Nt,cc as Y,cd as me,da as ke,dc as $e,ea as w,eb as G,f as ie,fa as E,fd as Ke,g as q,gb as b,h as xt,ha as Ut,hb as u,hd as Le,ib as Zt,id as Ze,jb as Jt,jd as ti,ka as Wt,kb as pe,l as U,lb as Tt,lc as Ye,m as Dt,ma as ee,md as ii,n as S,nd as ni,o as W,od as Je,pa as zt,pd as ri,qa as V,qb as Se,ra as qt,rb as p,rd as si,sb as f,sd as ai,tb as v,ub as Ue,w as ze,wa as de,wc as re,wd as Qe,x as ve,xa as r,xb as we,xc as ye,xd as Xe,ya as C,yb as Ee,yc as Ge,yd as oi,zb as Ie,zc as Q,zd as di}from"./chunk-2W7IS4PN.js";var zn=t=>[t,"tests"];function qn(t,o){if(t&1&&(s(0,"span"),p(1),l(2,"date"),x(3,"wbr"),p(4),l(5,"date"),a()),t&2){let e=u();r(),v("",F(2,2,e.event().dateFrom,"dd.MM.yyyy"),"\u2013"),r(3),f(F(5,5,e.event().dateTo,"dd.MM.yyyy"))}}function Yn(t,o){if(t&1&&(s(0,"a",6)(1,"i",8),p(2,"arrow_right_alt"),a(),s(3,"span",9),p(4),a()()),t&2){let e=u(2);m("routerLink",D(2,zn,e.event().id)),r(4),f(e.event().evaluationText)}}function Kn(t,o){if(t&1&&(s(0,"a",7)(1,"i",8),p(2,"arrow_right_alt"),a(),s(3,"span",9),p(4),a()()),t&2){let e=u(2);m("href",e.event().evaluationLink,de),r(4),v("",e.event().evaluationText," ")}}function Zn(t,o){if(t&1&&(s(0,"div",5),T(1,Yn,5,4,"a",6)(2,Kn,5,2,"a",7),a()),t&2){let e=u();r(),y(e.event().evaluationLink?-1:1),r(),y(e.event().evaluationLink?2:-1)}}var Ui=(()=>{class t{constructor(){this.event=V.required(),this.withRatings=V(!0),this.link=z(()=>wi(this.event().detailLink))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-list-entry"]],inputs:{event:[1,"event"],withRatings:[1,"withRatings"]},decls:11,vars:9,consts:[[1,"designation"],[3,"routerLink","queryParams"],[1,"date"],[1,"registrations"],[1,"registrations-label"],[1,"rating"],[1,"d-flex",3,"routerLink"],[1,"d-flex",3,"href"],[1,"material-icons"],[1,"ps-1"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"a",1),p(2),a()(),s(3,"div",2),T(4,qn,6,8,"span"),a(),s(5,"div",3),p(6),s(7,"span",4),p(8),l(9,"translate"),a()(),T(10,Zn,3,2,"div",5)),i&2&&(r(),m("routerLink",n.link().link)("queryParams",n.link().params),r(),f(n.event().designation),r(2),y(n.event().dateFrom&&n.event().dateTo?4:-1),r(2),v(" ",n.event().studentCount," "),r(2),f(c(9,7,n.event().studentCount===1?"events.registration":"events.registrations")),r(2),y(n.withRatings()&&n.event().evaluationText?10:-1))},dependencies:[Q,$e,I],styles:['[_nghost-%COMP%]{display:grid;padding:1rem;border-bottom:1px solid #dee2e6;grid-template-areas:"designation date registrations rating";grid-template-columns:4fr 2fr 2fr 3fr}.designation[_ngcontent-%COMP%]{grid-area:designation;padding-right:1rem}.date[_ngcontent-%COMP%]{grid-area:date;padding-right:1rem}.registrations[_ngcontent-%COMP%]{grid-area:registrations;padding-right:1rem}.rating[_ngcontent-%COMP%]{grid-area:rating}.rating[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.rating[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.rating[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.registrations-label[_ngcontent-%COMP%]{display:none}@media (max-width: 575.98px){.registrations-label[_ngcontent-%COMP%]{display:inline}.designation[_ngcontent-%COMP%], .date[_ngcontent-%COMP%], .registrations[_ngcontent-%COMP%]{padding-right:0}[_nghost-%COMP%]{grid-template-areas:"designation" "date" "registrations" "rating";grid-template-columns:1fr}}']})}}return t})();var Jn=10300,Qn=10260,Xn=10250,er=14030,tr=10350;function ut(t){let{HasEvaluationStarted:o,EvaluationUntil:e,HasTestGrading:i}=t.EvaluationStatusRef;if(o===!0&&(t.StatusId===er||t.StatusId===tr))return{value:te.Rating};if(o===!0&&i===!1){if(e)return{value:te.RatingUntil};if(t.StatusId===Jn)return{value:te.IntermediateRating}}return o===!1&&i===!0&&t.StatusId!==Qn&&t.StatusId!==Xn?{value:te.Tests}:o===!0&&i===!0?e?{value:te.Tests,label:te.RatingUntil}:{value:te.Tests,label:te.IntermediateRating}:null}function Wi(t){return t.EvaluationStatusRef.HasEvaluationStarted===!0}function zi(t){return t.EvaluationStatusRef.HasReviewOfEvaluationStarted===!0&&!!t.FinalGrades?.length}function ht(t){let o=t.Classes?t.Classes.map(e=>e.Number).join(", "):null;return o?t.Designation+", "+o:t.Designation}function qi(t,o){return t?(o.Leadership??"").split(",").some(e=>e.trim()===t.fullname):!1}function Yi(t,o){let e=new URLSearchParams({returnlink:o});return o.startsWith("/dashboard")?`/dashboard/students/${t}?${e}`:o.startsWith("/events/current")?`/events/current/${t}?${e}`:`/events/${t}/students?${e}`}function Ki(t){let o=t.ParticipatingStudents?.map(e=>({id:e.Id,name:e.FullName,email:e.DisplayEmail??void 0}))??[];return{eventId:t.Id,eventDesignation:t.Designation,studyClasses:(t.Classes??[]).map(e=>e.Designation).sort(),entries:o}}function kt(t,o){return j(L({},t),{entries:t.entries.map(e=>{let i=o.find(d=>d.StudentId===e.id),n=i?[i.CompanyName,i.CompanyNameAddition].filter(Boolean).join(" \u2013 "):void 0;return j(L({},e),{company:n})})})}function Pt(t,o,e,{emailFallback:i}={}){return{eventId:t,eventDesignation:e[0]?.EventDesignation??"",studyClasses:[],entries:o.map(n=>({id:n.Id,subscriptionId:e.find(d=>d.PersonId===n.Id)?.Id,name:n.FullName,email:(i?n.DisplayEmail??n.Email:n.DisplayEmail)??void 0,status:e.find(d=>d.PersonId===n.Id)?.Status}))}}function Zi(t,o){return j(L({},t),{entries:t.entries.map(e=>j(L({},e),{studyClass:o.find(i=>i.StudentRef.Id===e.id)?.StudyClassNumber}))})}var te=function(t){return t.Rating="rating",t.RatingUntil="rating-until",t.IntermediateRating="intermediate-rating",t.Tests="add-tests",t}(te||{}),Ne=(()=>{class t{constructor(e,i,n,d,h,g,P,B,fe){this.coursesRestService=e,this.eventsRestService=i,this.studyClassRestService=n,this.subscriptionsRestService=d,this.loadingService=h,this.storageService=g,this.translate=P,this.router=B,this.settings=fe,this.loading$=this.loadingService.loading$,this.searchFields$=new q(["designation"]),this.searchSubject$=new q(""),this.search$=this.searchSubject$.asObservable(),this.roles$=new q(null),this.isClassTeacher$=this.roles$.pipe(S(Ce=>yi(Ce,"ClassTeacherRole")),J(1)),this.withStudyCourses$=new q(!1),this.unratedCourses$=this.roles$.pipe(M(this.loadUnratedCourses.bind(this)),J(1)),this.studyCourses$=this.withStudyCourses$.pipe(M(this.loadStudyCourses.bind(this)),J(1)),this.formativeAssessments$=this.isClassTeacher$.pipe(M(this.loadFormativeAssessments.bind(this)),J(1)),this.studyClasses$=this.isClassTeacher$.pipe(M(this.loadStudyClasses.bind(this)),J(1)),this.events$=this.getEvents().pipe(J(1)),this.filteredEvents$=W([this.events$,this.searchFields$,this.search$]).pipe(S(xe(pt)))}setSearch(e){this.searchSubject$.next(e)}setRoles(e){this.roles$.next(e)}setWithStudyCourses(e){this.withStudyCourses$.next(e)}setSearchFields(e){this.searchFields$.next(e)}getEntries(e=!1){return this.filteredEvents$.pipe(S(i=>e?i.filter(n=>n.evaluationText):i))}getEvents(){return this.loadingService.load(W([this.unratedCourses$,this.studyCourses$,this.formativeAssessments$,this.studyClasses$]),{stopOnFirstValue:!0}).pipe(S(xe(this.createAndSortEvents.bind(this))))}loadUnratedCourses(e){return this.coursesRestService.getExpandedCourses(e).pipe(S(i=>i.filter(n=>!zi(n))))}loadStudyCourses(e){if(!e)return U([]);let i=this.storageService.getPayload();return this.eventsRestService.getStudyCourseEvents().pipe(S(n=>n.filter(d=>qi(i,d))),M(n=>this.subscriptionsRestService.getSubscriptionCountsByEvents(n.map(d=>d.Id)).pipe(S(d=>n.map(h=>j(L({},h),{StudentCount:d[h.Id]??0}))))))}loadFormativeAssessments(e){return e?this.studyClassRestService.getActiveFormativeAssessments():U([])}loadStudyClasses(e){return e?this.studyClassRestService.getActive():U([])}createAndSortEvents(e,i,n,d){let h=d.filter(g=>!n.map(P=>P.Id).includes(g.Id));return[...this.createFromCourses(e),...this.createFromStudyCourses(i),...this.createFromAssessments(n),...this.createFromStudyClasses(h)].sort((g,P)=>g.designation.localeCompare(P.designation))}createFromCourses(e){return e.map(i=>{let n=ut(i);return{id:i.Id,designation:ht(i),detailLink:this.buildStudentsLink(i.Id),studentCount:i.AttendanceRef.StudentCount||0,dateFrom:i.DateFrom,dateTo:i.DateTo,state:n?.value||null,evaluationText:this.getEvaluationText(n,i.EvaluationStatusRef.EvaluationUntil),evaluationLink:n?.value&&n?.value!==te.Tests?this.buildEvaluationLink(i.Id):null}})}createFromStudyCourses(e){return e.map(i=>({id:i.Id,designation:i.Designation,detailLink:this.buildStudentsLink(i.Id),studentCount:i.StudentCount,state:null}))}createFromAssessments(e){return this.createFromStudyClasses(e).map(n=>j(L({},n),{state:te.Rating,evaluationText:this.translate.instant("events.state.rating"),evaluationLink:this.buildEvaluationLink(n.id)}))}createFromStudyClasses(e){return e.map(i=>({id:i.Id,designation:i.Number,detailLink:this.buildStudentsLink(i.Id),studentCount:i.StudentCount,state:null}))}getEvaluationText(e,i){let n=e?.label||e?.value;return n?this.translate.instant(`events.state.${n}`)+(n===te.RatingUntil?` ${i?_i(i,"dd.MM.yyyy"):""}`:""):""}buildStudentsLink(e){return Yi(e,this.router.url)}buildEvaluationLink(e){return(this.settings.eventlist.evaluation??"").replace(":id",String(e))}static{this.\u0275fac=function(i){return new(i||t)($(ge),$(ct),$(Ai),$(je),$(be),$(Fe),$(X),$(Ge),$(me))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var rr=(t,o)=>o.id,sr=()=>[];function ar(t,o){t&1&&x(0,"bkd-spinner")}function or(t,o){t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2&&(r(),v(" ",c(2,1,"events.rating")," "))}function dr(t,o){if(t&1&&x(0,"bkd-events-list-entry",8),t&2){let e=o.$implicit,i=u(3);m("event",e)("withRatings",i.withRatings)}}function lr(t,o){if(t&1&&(s(0,"div",3)(1,"div",4),p(2),l(3,"translate"),a(),s(4,"div",5),p(5),l(6,"translate"),a(),s(7,"div",6),p(8),l(9,"translate"),a(),T(10,or,3,3,"div",7),a(),H(11,dr,1,2,"bkd-events-list-entry",8,rr)),t&2){let e=u(2),i=O(0);r(2),f(c(3,4,"events.designation")),r(3),f(c(6,6,"events.date")),r(3),v(" ",c(9,8,"events.registrations")," "),r(2),y(e.withRatings?10:-1),r(),N(i)}}function pr(t,o){t&1&&(s(0,"p",2),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events.no-events")))}function cr(t,o){if(t&1&&T(0,lr,13,10)(1,pr,3,3,"p",2),t&2){u();let e=O(0);y(e.length>0?0:1)}}var Xi=["designation"],mr=[...Xi,"evaluationText"],ft=(()=>{class t{constructor(e,i){this.state=e,this.storage=i,this.withStudyCourses=!1,this.withRatings=!0,this.state.setRoles(this.storage.getPayload()?.roles??null)}ngOnChanges(e){e.withStudyCourses&&this.state.setWithStudyCourses(e.withStudyCourses.currentValue),e.withRatings&&this.state.setSearchFields(e.withRatings.currentValue?mr:Xi)}static{this.\u0275fac=function(i){return new(i||t)(C(Ne),C(Fe))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-list"]],inputs:{withStudyCourses:"withStudyCourses",withRatings:"withRatings"},features:[ke],decls:10,vars:17,consts:[[1,"bkd-container"],[1,"d-flex","search",3,"valueChange","value","placeholder","label","disabled"],[1,"mt-3"],[1,"event-header"],[1,"designation"],[1,"date"],[1,"registrations"],[1,"rating"],[3,"event","withRatings"]],template:function(i,n){if(i&1){let d=G();R(0),l(1,"async"),s(2,"div",0)(3,"bkd-resettable-input",1),l(4,"async"),l(5,"translate"),l(6,"translate"),b("valueChange",function(g){return w(d),E(n.state.setSearch(g))}),a(),T(7,ar,1,0,"bkd-spinner"),l(8,"async"),T(9,cr,2,1),a()}if(i&2){let d,h=A((d=c(1,5,n.state.getEntries(n.withRatings)))!==null&&d!==void 0?d:Oe(16,sr));r(3),m("value",c(4,8,n.state.search$))("placeholder",c(5,10,"events.search-by"))("label",c(6,12,"events.search"))("disabled",!h),r(4),y(c(8,14,n.state.loading$)?7:9)}},dependencies:[lt,he,Y,I,Ui],styles:['.search[_ngcontent-%COMP%]{max-width:500px}.event-header[_ngcontent-%COMP%]{display:grid;padding:1rem;border-bottom:2px solid #dee2e6;grid-template-areas:"designation date registrations rating";grid-template-columns:4fr 2fr 2fr 3fr}@media (max-width: 575.98px){.event-header[_ngcontent-%COMP%]{display:none}}']})}}return t})();var en=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-current-list"]],decls:4,vars:5,consts:[[3,"withStudyCourses","withRatings"]],template:function(i,n){i&1&&(s(0,"h1"),p(1),l(2,"translate"),a(),x(3,"bkd-events-list",0)),i&2&&(r(),f(c(2,3,"events.current.title")),r(2),m("withStudyCourses",!0)("withRatings",!1))},dependencies:[ft,I],encapsulation:2,changeDetection:0})}}return t})();var tn=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-current"]],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();var nn=(()=>{class t{constructor(){this.entry=V.required(),this.multipleStudyClasses=V(!1),this.returnLink=V(null),this.link=z(()=>["student",this.entry().id,"addresses"]),this.linkParams=z(()=>{let e=this.returnLink();return e?{returnparams:new URLSearchParams({returnlink:e}).toString()}:{}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-course-entry"]],inputs:{entry:[1,"entry"],multipleStudyClasses:[1,"multipleStudyClasses"],returnLink:[1,"returnLink"]},decls:7,vars:10,consts:[[1,"avatar","large",3,"studentId","link","linkParams"],[1,"name",3,"title","routerLink","queryParams"],[1,"study-class"],[1,"company",3,"title"]],template:function(i,n){i&1&&(x(0,"bkd-avatar",0),s(1,"a",1),p(2),a(),s(3,"div",2),p(4),a(),s(5,"div",3),p(6),a()),i&2&&(m("studentId",n.entry().id)("link",n.link())("linkParams",n.linkParams()),r(),m("title",n.entry().name)("routerLink",n.link())("queryParams",n.linkParams()),r(),f(n.entry().name),r(2),v(" ",n.multipleStudyClasses()?n.entry().studyClass:"",` -`),r(),m("title",n.entry().company),r(),f(n.entry().company))},dependencies:[Q,Vi],styles:['[_nghost-%COMP%]{display:grid;grid-template-columns:min-content 1fr;grid-template-rows:min-content min-content 1fr;grid-template-areas:"avatar name" "avatar study-class" "avatar company";padding:2rem 1rem}.avatar[_ngcontent-%COMP%]{grid-area:avatar;margin-right:1.5rem}.name[_ngcontent-%COMP%]{grid-area:name}.study-class[_ngcontent-%COMP%]{grid-area:study-class;font-size:.875rem}.company[_ngcontent-%COMP%]{grid-area:company;align-content:end;padding-bottom:1.5rem}.name[_ngcontent-%COMP%], .company[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}'],changeDetection:0})}}return t})();var ur=t=>({count:t});function hr(t,o){if(t&1&&(s(0,"div",0),p(1),l(2,"translate"),a()),t&2){u();let e=O(2);r(),v(" ",F(2,1,e===1?"events-students.registration":"events-students.registrations",D(4,ur,e))," ")}}var vt=(()=>{class t{constructor(){this.title=V.required(),this.count=V(null),this.searchTerm=Pe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-header"]],inputs:{title:[1,"title"],count:[1,"count"],searchTerm:[1,"searchTerm"]},outputs:{searchTerm:"searchTermChange"},decls:7,vars:10,consts:[[1,"additional-info"],[1,"search",3,"valueChange","value","placeholder","label"]],template:function(i,n){if(i&1){let d=G();s(0,"h1"),p(1),a(),R(2),T(3,hr,3,6,"div",0),s(4,"bkd-resettable-input",1),l(5,"translate"),l(6,"translate"),b("valueChange",function(g){return w(d),E(n.searchTerm.set(g))}),a()}if(i&2){r(),f(n.title()),r();let d=A(n.count());r(),y(d!==null?3:-1),r(),m("value",n.searchTerm())("placeholder",c(5,6,"events-students.search-placeholder"))("label",c(6,8,"events-students.search"))}},dependencies:[I,lt],styles:["h1[_ngcontent-%COMP%]{margin-bottom:0}.search[_ngcontent-%COMP%]{margin-top:1rem;display:flex;max-width:300px}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}"],changeDetection:0})}}return t})();var gr=(t,o)=>o.id;function fr(t,o){t&1&&(s(0,"p"),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events-students.no-entries")))}function vr(t,o){if(t&1&&x(0,"bkd-events-students-course-entry",2),t&2){let e=o.$implicit,i=u();m("entry",e)("multipleStudyClasses",i.multipleStudyClasses())("returnLink",i.returnLink())}}var rn=(()=>{class t{constructor(){this.title=V.required(),this.count=V.required(),this.entries=V.required(),this.multipleStudyClasses=V(!1),this.returnLink=V(null),this.searchTerm=Pe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-course-list"]],inputs:{title:[1,"title"],count:[1,"count"],entries:[1,"entries"],multipleStudyClasses:[1,"multipleStudyClasses"],returnLink:[1,"returnLink"],searchTerm:[1,"searchTerm"]},outputs:{searchTerm:"searchTermChange"},decls:5,vars:4,consts:[[3,"searchTermChange","title","count","searchTerm"],[1,"list"],[3,"entry","multipleStudyClasses","returnLink"]],template:function(i,n){i&1&&(s(0,"bkd-events-students-header",0),Ie("searchTermChange",function(h){return Ee(n.searchTerm,h)||(n.searchTerm=h),h}),a(),s(1,"section",1),T(2,fr,3,3,"p"),H(3,vr,1,3,"bkd-events-students-course-entry",2,gr),a()),i&2&&(m("title",n.title())("count",n.count()),we("searchTerm",n.searchTerm),r(2),y(n.entries().length===0?2:-1),r(),N(n.entries()))},dependencies:[I,vt,nn],styles:["[_nghost-%COMP%]{display:block;overflow:hidden}section.list[_ngcontent-%COMP%]{width:calc(100% + 1px);margin-top:1rem;display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr))}bkd-events-students-course-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;border-right:1px solid #dee2e6}"],changeDetection:0})}}return t})();var sn=(()=>{class t{constructor(){this.entry=V.required(),this.returnLink=V(null),this.link=z(()=>["study-course-student",this.entry().id]),this.linkParams=z(()=>{let e=this.returnLink();return e?{returnparams:new URLSearchParams({returnlink:e}).toString()}:{}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-study-course-entry"]],inputs:{entry:[1,"entry"],returnLink:[1,"returnLink"]},decls:4,vars:4,consts:[[1,"name",3,"routerLink","queryParams"],[1,"status"]],template:function(i,n){i&1&&(s(0,"a",0),p(1),a(),s(2,"div",1),p(3),a()),i&2&&(m("routerLink",n.link())("queryParams",n.linkParams()),r(),f(n.entry().name),r(2),f(n.entry().status))},dependencies:[Q],styles:["[_nghost-%COMP%]{display:flex;flex-direction:row;align-items:stretch;border-bottom:1px solid #dee2e6}.name[_ngcontent-%COMP%], .status[_ngcontent-%COMP%]{padding:1rem}.name[_ngcontent-%COMP%]{flex:2;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.status[_ngcontent-%COMP%]{flex:1;padding-left:0}@media (max-width: 750px){[_nghost-%COMP%]{flex-direction:column}.name[_ngcontent-%COMP%]{padding-bottom:0}.status[_ngcontent-%COMP%]{padding-top:0;padding-left:1rem;font-size:.875rem}}"],changeDetection:0})}}return t})();var Cr=(t,o)=>o.id;function _r(t,o){if(t&1){let e=G();s(0,"div",2)(1,"div",4),b("click",function(){w(e);let n=u();return E(n.toggleSort.emit())}),p(2),l(3,"translate"),s(4,"span",5),p(5),a()()()}if(t&2){let e=u();r(),m("className",e.primarySortKey),r(),v(" ",c(3,3,"events-students.list.header."+e.primarySortKey)," "),r(3),f(e.getSortDirectionCharacter(e.sortCriteria()))}}function Sr(t,o){t&1&&(s(0,"p"),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events-students.no-entries")))}function yr(t,o){if(t&1&&x(0,"bkd-events-students-study-course-entry",3),t&2){let e=o.$implicit,i=u();m("entry",e)("returnLink",i.returnLink())}}var an=(()=>{class t{constructor(){this.title=V.required(),this.count=V.required(),this.entries=V.required(),this.returnLink=V(null),this.sortCriteria=V.required(),this.toggleSort=zt(),this.searchTerm=Pe(),this.primarySortKey="name"}getSortDirectionCharacter(e){return e.ascending?"\u2191":"\u2193"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-study-course-list"]],inputs:{title:[1,"title"],count:[1,"count"],entries:[1,"entries"],returnLink:[1,"returnLink"],sortCriteria:[1,"sortCriteria"],searchTerm:[1,"searchTerm"]},outputs:{toggleSort:"toggleSort",searchTerm:"searchTermChange"},features:[ne([])],decls:6,vars:4,consts:[[3,"searchTermChange","title","count","searchTerm"],[1,"list"],[1,"list-header"],[3,"entry","returnLink"],[1,"name",3,"click","className"],[1,"sort-direction"]],template:function(i,n){i&1&&(s(0,"bkd-events-students-header",0),Ie("searchTermChange",function(h){return Ee(n.searchTerm,h)||(n.searchTerm=h),h}),a(),s(1,"section",1),T(2,_r,6,5,"div",2)(3,Sr,3,3,"p"),H(4,yr,1,2,"bkd-events-students-study-course-entry",3,Cr),a()),i&2&&(m("title",n.title())("count",n.count()),we("searchTerm",n.searchTerm),r(2),y(n.entries().length>0?2:3),r(2),N(n.entries()))},dependencies:[I,vt,sn],styles:[".list-header[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;border-bottom:2px solid #dee2e6}.name[_ngcontent-%COMP%]{padding:1rem}"],changeDetection:0})}}return t})();function on(t,o,e){o||Nt(t);let i=o??At(Wt);return e?Ht(i,e):i}function We(t,o){let e=on(We,o?.injector),i;return z(()=>(i||(i=Xt(()=>se(t,j(L({},o),{injector:e})))),i()))}var dn=(()=>{class t extends it{constructor(e,i){super(e,i,Ei,"ApprenticeshipContracts")}getCompaniesForStudents(e){let i=new Date,n={"filter.StudentId":`;${e.join(";")}`,"filter.ApprenticeshipDateFrom":`<${i.toISOString()}`,"filter.ApprenticeshipDateTo":`>${i.toISOString()}`,fields:"Id,StudentId,CompanyName,CompanyNameAddition"};return this.http.get(`${this.baseUrl}/`,{params:n}).pipe(M(vi(Ii)))}static{this.\u0275fac=function(i){return new(i||t)($(Ye),$(me))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ct=1;var ln=10,_t=(()=>{class t{constructor(e,i,n,d,h,g,P,B,fe){this.route=e,this.loadingService=i,this.eventsService=n,this.coursesService=d,this.subscriptionsService=h,this.personsService=g,this.apprenticeshipContractsService=P,this.lessonPresencesService=B,this.reportsService=fe,this.eventId$=W([this.route.paramMap,this.route.parent?.paramMap??U(null)]).pipe(S(([Ce,Wn])=>Number(Ce.get("id")||Wn?.get("id")))),this.eventTypeId$=this.eventId$.pipe(M(this.loadEventTypeId.bind(this))),this.eventTypeId=We(this.eventTypeId$,{initialValue:null}),this.studentEntries=We(this.loadStudentEntries(),{initialValue:null}),this.isStudyCourse=z(()=>this.eventTypeId()===Ct),this.loading=se(this.loadingService.loading(mt)),this.title=z(()=>this.getTitle(this.studentEntries())),this.multipleStudyClasses=z(()=>(this.studentEntries()?.studyClasses?.length??0)>1),this.searchTerm=bt(""),this.sortCriteria=bt({primarySortKey:"name",ascending:!0}),this.entries=z(()=>this.studentEntries()?.entries??[]),this.sortedEntries=z(()=>this.sortStudentEntries(this.entries(),this.sortCriteria())),this.filteredEntries=z(()=>pt(this.sortedEntries(),["name","status","company","studyClass"],this.searchTerm())),this.mailtoLink=z(()=>this.getMailtoLink(this.eventTypeId(),this.entries())),this.reports=We(W([this.eventId$,this.eventTypeId$.pipe(ve(ue))]).pipe(M(xe(this.loadReports.bind(this)))),{initialValue:[]})}loadEventTypeId(e){return this.loadingService.load(this.eventsService.getEventTypeId(e),mt)}loadStudentEntries(){return W([this.eventId$,this.eventTypeId$]).pipe(M(([e,i])=>{let n=()=>{switch(i){case null:return U(null);case Ct:return this.loadStudyCourseStudents(e);case ln:return this.loadStudyClassStudents(e);default:return this.loadCourseStudents(e)}};return this.loadingService.load(n(),mt)}))}toggleSort(){this.sortCriteria.update(e=>j(L({},e),{ascending:!e.ascending}))}loadStudyCourseStudents(e){return this.subscriptionsService.getSubscriptionsByCourse(e).pipe(M(i=>this.personsService.getSummaries(i.map(({PersonId:n})=>n).filter(ue)).pipe(S(n=>Pt(e,n,i)))))}loadStudyClassStudents(e){return this.subscriptionsService.getSubscriptionsByCourse(e,{"filter.IsOkay":"=1"}).pipe(M(i=>{let n=i.map(({PersonId:d})=>d).filter(ue);return W([this.personsService.getSummaries(n),this.apprenticeshipContractsService.getCompaniesForStudents(n)]).pipe(S(([d,h])=>{let g=Pt(e,d,i,{emailFallback:!0});return kt(g,h)}))}))}loadCourseStudents(e){return this.coursesService.getExpandedCourseWithParticipants(e).pipe(S(Ki),M(i=>W([this.apprenticeshipContractsService.getCompaniesForStudents(i.entries.map(({id:n})=>n)),this.lessonPresencesService.getLessonStudyClassesByEvent(e)]).pipe(S(([n,d])=>{let h=kt(i,n);return Zi(h,d)}))))}getTitle(e){if(!e||!e.eventDesignation)return null;let{eventDesignation:i,studyClasses:n}=e;return[i,...n].join(", ")}getMailtoLink(e,i){if(e===null||e===Ct)return null;let n=i.map(d=>d.email).filter(Boolean);return n.length>0?`mailto:${n.join(";")}`:null}loadReports(e,i){switch(i){case null:case Ct:return U([]);case ln:return this.reportsService.getStudyClassStudentsReports(e);default:return this.reportsService.getCourseStudentsReports(e)}}sortStudentEntries(e,i){return[...e].sort(Er(i))}static{this.\u0275fac=function(i){return new(i||t)($(re),$(be),$(ct),$(ge),$(je),$(rt),$(dn),$(xi),$(ot))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function Er(t){return(o,e)=>t.ascending?o.name.localeCompare(e.name):e.name.localeCompare(o.name)}var kr=t=>[t];function Pr(t,o){if(t&1&&(s(0,"a",4)(1,"i",6),p(2,"mail"),a()()),t&2){let e=u(2);m("href",e.state.mailtoLink(),de)}}function Mr(t,o){if(t&1&&(s(0,"bkd-backlink",0)(1,"div",3),T(2,Pr,3,1,"a",4),x(3,"bkd-reports-link",5),a()()),t&2){let e=u(),i=O(0);m("link",D(3,kr,i)),r(2),y(e.state.mailtoLink()?2:-1),r(),m("reports",e.state.reports())}}function Or(t,o){t&1&&x(0,"bkd-spinner")}function $r(t,o){t&1&&(s(0,"p"),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"events-students.no-entries")))}function Gr(t,o){if(t&1){let e=G();s(0,"bkd-events-students-study-course-list",7),b("toggleSort",function(){w(e);let n=u();return E(n.state.toggleSort())}),Ie("searchTermChange",function(n){w(e);let d=u();return Ee(d.state.searchTerm,n)||(d.state.searchTerm=n),E(n)}),a()}if(t&2){let e=u();m("title",e.state.title())("count",e.state.entries().length)("entries",e.state.filteredEntries())("returnLink",e.returnLink())("sortCriteria",e.state.sortCriteria()),we("searchTerm",e.state.searchTerm)}}function Lr(t,o){if(t&1){let e=G();s(0,"bkd-events-students-course-list",8),Ie("searchTermChange",function(n){w(e);let d=u();return Ee(d.state.searchTerm,n)||(d.state.searchTerm=n),E(n)}),a()}if(t&2){let e=u();m("title",e.state.title())("count",e.state.entries().length)("entries",e.state.filteredEntries())("multipleStudyClasses",e.state.multipleStudyClasses())("returnLink",e.returnLink()),we("searchTerm",e.state.searchTerm)}}var pn=(()=>{class t{constructor(e,i){this.state=e,this.route=i,this.returnLink=se(this.route.queryParams.pipe(S(({returnlink:n})=>n?decodeURIComponent(n):null)))}static{this.\u0275fac=function(i){return new(i||t)(C(_t),C(re))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-list"]],decls:6,vars:3,consts:[[3,"link"],[3,"title","count","entries","returnLink","sortCriteria","searchTerm"],[3,"title","count","entries","multipleStudyClasses","returnLink","searchTerm"],[1,"d-flex"],["target","_blank",1,"mail","btn","btn-primary","btn-icon","me-2",3,"href"],[1,"ms-2",3,"reports"],[1,"material-icons"],[3,"toggleSort","searchTermChange","title","count","entries","returnLink","sortCriteria","searchTerm"],[3,"searchTermChange","title","count","entries","multipleStudyClasses","returnLink","searchTerm"]],template:function(i,n){if(i&1&&(R(0),T(1,Mr,4,5,"bkd-backlink",0)(2,Or,1,0,"bkd-spinner")(3,$r,3,3,"p")(4,Gr,1,6,"bkd-events-students-study-course-list",1)(5,Lr,1,6,"bkd-events-students-course-list",2)),i&2){let d=A(n.returnLink());r(),y(d?1:-1),r(),y(n.state.loading()?2:n.state.entries().length===0?3:n.state.isStudyCourse()?4:5)}},dependencies:[I,he,Ve,nt,rn,an],encapsulation:2,changeDetection:0})}}return t})();var Dr=(t,o)=>o.id;function Fr(t,o){if(t&1&&(p(0),l(1,"date")),t&2){u(2);let e=O(2);v(" ",F(1,1,e.Birthdate,"dd.MM.yyyy")," ")}}function Rr(t,o){if(t&1&&p(0),t&2){u(2);let e=O(2);v(" (",e.Gender,") ")}}function Br(t,o){if(t&1&&(p(0),x(1,"br")),t&2){u(2);let e=O(2);v(" ",e.AddressLine1,"")}}function jr(t,o){if(t&1&&(p(0),x(1,"br")),t&2){u(2);let e=O(2);Ue(" ",e.Zip," ",e.Location,"")}}function Vr(t,o){if(t&1&&(s(0,"a",4),p(1),a(),x(2,"br")),t&2){u(2);let e=O(2);Tt("href","tel:",e.PhonePrivate,"",de),r(),f(e.PhonePrivate)}}function Ar(t,o){if(t&1&&(s(0,"a",4),p(1),a()),t&2){u(2);let e=O(2);Tt("href","tel:",e.PhoneMobile,"",de),r(),f(e.PhoneMobile)}}function Hr(t,o){if(t&1&&(s(0,"h1"),p(1),a(),s(2,"span",3),T(3,Fr,2,4)(4,Rr,1,1),a(),s(5,"address"),T(6,Br,2,1)(7,jr,2,2)(8,Vr,3,3)(9,Ar,2,3,"a",4),a()),t&2){u();let e=O(2);r(),f(e.FullName),r(2),y(e.Birthdate?3:-1),r(),y(e.Gender?4:-1),r(2),y(e.AddressLine1?6:-1),r(),y(e.Zip&&e.Location?7:-1),r(),y(e.PhonePrivate?8:-1),r(),y(e.PhoneMobile?9:-1)}}function Nr(t,o){if(t&1&&(s(0,"div",2),p(1),l(2,"translate"),s(3,"span",5),p(4),a()()),t&2){u();let e=O(4);r(),v(" ",c(2,2,"events-students.study-course-detail.status"),": "),r(3),f(e)}}function Ur(t,o){if(t&1&&(s(0,"a",7),p(1),a()),t&2){let e=u(2).$implicit;pe("href",e.file,de),r(),f(e.value)}}function Wr(t,o){if(t&1&&p(0),t&2){let e=u(2).$implicit;v(" ",e.value," ")}}function zr(t,o){if(t&1&&(s(0,"div",6)(1,"div"),p(2),a(),T(3,Ur,2,2,"a",7)(4,Wr,1,1),a()),t&2){let e=u().$implicit;r(2),f(e.label),r(),y(e.file!==null?3:4)}}function qr(t,o){if(t&1&&T(0,zr,5,2,"div",6),t&2){let e=o.$implicit;y(e.value?0:-1)}}function Yr(t,o){t&1&&x(0,"bkd-spinner")}var cn=(()=>{class t{constructor(e,i,n,d,h,g,P){this.settings=e,this.route=i,this.personsService=n,this.subscriptionsService=d,this.storageService=h,this.loadingService=g,this.translate=P,this.eventId$=this.route.parent?.paramMap.pipe(S(B=>Number(B.get("id"))))??U(0),this.personId$=this.route.paramMap.pipe(S(B=>Number(B.get("id")))),this.person=se(this.personId$.pipe(M(B=>this.personsService.get(B))),{initialValue:null}),this.subscription=se(this.loadSubscription()),this.subscriptionId=z(()=>this.subscription()?.Id??null),this.subscriptionDetails=se(this.loadSubscriptionDetails(),{initialValue:[]}),this.backLink=se(this.route.queryParams.pipe(S(({returnparams:B})=>B),S(Ti))),this.loading=se(this.loadingService.loading$,{initialValue:!0})}loadSubscription(){return this.loadingService.load(W([this.eventId$,this.personId$]).pipe(M(([e,i])=>this.subscriptionsService.getSubscriptionsByCourse(e,{"filter.PersonId":`=${i}`})),S(e=>e[0]??null)),{stopOnFirstValue:!0})}loadSubscriptionDetails(){return this.loadingService.load(ei(this.subscriptionId).pipe(ve(ue),M(e=>this.subscriptionsService.getSubscriptionDetailsById(e)),S(e=>e.map(i=>this.toSubscriptionDetailsEntry(i)))),{stopOnFirstValue:!0})}toSubscriptionDetailsEntry(e){let i=e.Value??"";return i=this.normalizeSubscriptionDetailsYesNoValue(e,i),i=this.normalizeSubscriptionDetailsDropdownValue(e,i),{id:e.Id,label:e.VssDesignation,value:i,file:this.buildFileUrl(e)}}normalizeSubscriptionDetailsYesNoValue(e,i){if((e.VssType==="isYes"||e.VssType==="isYesNo")&&e.ShowAsRadioButtons){if(i==="Ja")return this.translate.instant("events-students.study-course-detail.yes");if(i==="Nein")return this.translate.instant("events-students.study-course-detail.no")}return i}normalizeSubscriptionDetailsDropdownValue(e,i){return e.DropdownItems&&e.VssStyle!=="CB"?e.DropdownItems.find(n=>String(n.Key)===i)?.Value??i:i}buildFileUrl(e){if(e.VssStyle==="PD"||e.VssStyle==="PF"||e.VssStyle==="DA"){let i=this.storageService.getAccessToken()||"";return`${this.settings.apiUrl}/Files/SubscriptionDetails/${e.Id}?token=${i}`}return null}static{this.\u0275fac=function(i){return new(i||t)(C(me),C(re),C(rt),C(je),C(Fe),C(be),C(X))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students-study-course-detail"]],decls:9,vars:6,consts:[[1,"bkd-container","bkd-container-limited"],["link","../..",3,"params"],[1,"status"],[1,"additional-info"],[3,"href"],[1,"ms-2"],[1,"detail"],["target","_blank",3,"href"]],template:function(i,n){if(i&1&&(s(0,"div",0),x(1,"bkd-backlink",1),R(2),T(3,Hr,10,7),R(4),T(5,Nr,5,4,"div",2),H(6,qr,1,1,null,null,Dr),T(8,Yr,1,0,"bkd-spinner"),a()),i&2){let d;r(),m("params",n.backLink()),r();let h=A(n.person());r(),y(h?3:-1),r();let g=A((d=n.subscription())==null?null:d.Status);r(),y(g?5:-1),r(),N(n.subscriptionDetails()),r(2),y(n.loading()?8:-1)}},dependencies:[I,$e,Ve,he],styles:["h1[_ngcontent-%COMP%]{margin-bottom:0}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}address[_ngcontent-%COMP%]{margin:1rem 0}.status[_ngcontent-%COMP%]{display:flex;align-items:center;padding:1rem 0;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.detail[_ngcontent-%COMP%]{max-width:70ch;padding-top:1rem}.detail[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{font-weight:400;color:#00000080}"],changeDetection:0})}}return t})();var mn=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-students"]],features:[ne([_t])],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2,changeDetection:0})}}return t})();var un=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events-tests"]],decls:4,vars:4,consts:[[3,"withRatings"]],template:function(i,n){i&1&&(s(0,"h1"),p(1),l(2,"translate"),a(),x(3,"bkd-events-list",0)),i&2&&(r(),f(c(2,2,"events.title")),r(2),m("withRatings",!0))},dependencies:[ft,I],encapsulation:2})}}return t})();var hn=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-events"]],features:[ne([Ne,Si])],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();function gn(t){return o=>{let e=Number(o.value);return e<=t?{greaterThan:{value:e,greaterThanValue:t}}:null}}function Ot(t){return t.map(({finalGrade:o})=>o).filter(Kr)}function Kr(t){return t!==null}function Cn(t,o,e,i){return t?.map(n=>({student:n,finalGrade:Jr(n,e,i),grades:Zr(n,o)}))}function Zr(t,o){return o.map(e=>{if(e.Results===void 0||e.Results?.length===0)return{kind:"no-result",test:e};let i=e.Results?.find(n=>n.StudentId===t.Id);return i!==void 0?{kind:"grade",result:i,test:e}:{kind:"no-result",test:e}})}function Jr(t,o,e){let i=o.find(d=>d.StudentId===t.Id),n=e.find(d=>d.StudentId===t.Id);return i?{id:i.Id,average:Qr(i),finalGradeId:i.GradeId,freeHandGrade:n?Number(n.Grade):null,canGrade:i.CanGrade}:null}function Qr(t){return t.AverageTestResult===0?null:t.AverageTestResult}var _n=({key:t,ascending:o})=>(e,i)=>{let n=o?1:-1;switch(t){case"FullName":return n*e.student.FullName.localeCompare(i.student.FullName);case"FinalGrade":return!e.finalGrade?.finalGradeId||!i.finalGrade?.finalGradeId?n*-1:n*fn(e.finalGrade.finalGradeId,i.finalGrade.finalGradeId);case"TestsMean":return!e.finalGrade?.average||!i.finalGrade?.average?n*-1:n*fn(e.finalGrade.average,i.finalGrade.average)}return n*Xr(t,e,i)},Xr=(t,o,e)=>{let i=o.grades.filter(vn).find(d=>d.test.Id===t.Id),n=e.grades.filter(vn).find(d=>d.test.Id===t.Id);return t.IsPointGrading&&i?.result.GradeId===n?.result.GradeId?(i?.result.Points??0)-(n?.result.Points??0):((i?.result.GradeId??Number.POSITIVE_INFINITY)-(n?.result.GradeId??Number.POSITIVE_INFINITY))*-1};function fn(t,o){return t===o?0:te.average).filter(e=>e!=null&&e!==0).map(Number);return Et(o)}function xn(t,o){let e=t.map(n=>n.freeHandGrade).filter(n=>!!n),i=t.map(n=>n.finalGradeId).filter(n=>n!==null).map(n=>o.find(d=>d.Key===n)).filter(n=>n!==void 0).map(n=>n?.Value).filter(n=>n!==void 0).map(Number).filter(n=>!isNaN(n));return Et([...i,...e])}function $t(t,o){return[...o.filter(e=>e.Id!==t?.Id),t].filter(e=>e!=null)}function bn({id:t,selectedGradeId:o},e){return e.map(i=>i.Id!==t?i:j(L({},i),{GradeId:o}))}function Tn(t,o){switch(o.type){case"reset":return o.payload;case"updateResult":return t?j(L({},t),{Tests:Pi(o.payload.testResult,t.Tests||[],o.payload.ignore),Gradings:o.payload.grading?$t(o.payload.grading,t.Gradings||[]):t.Gradings}):null;case"deleteResult":return t?j(L({},t),{Tests:Mi(o.payload.testId,o.payload.studentId,t.Tests||[]),Gradings:o.payload.grading?$t(o.payload.grading,t.Gradings||[]):t.Gradings||[]}):null;case"toggle-test-state":return t?j(L({},t),{Tests:Oi(o.payload,t.Tests||[])}):null;case"final-grade-overwritten":return t?j(L({},t),{Gradings:bn({id:o.payload.id,selectedGradeId:o.payload.selectedGradeId},t.Gradings||[])}):null;case"replace-grades":return t?j(L({},t),{Gradings:o.payload}):null;case"delete-test":return t?j(L({},t),{Tests:$i(o.payload,t.Tests||[])}):null;default:return t}}var wn=(()=>{class t extends it{constructor(e,i){super(e,i,Ri,"Gradings")}updateGrade(e,i){return this.http.put(`${this.baseUrl}/${e}`,{GradeId:i}).pipe(S(()=>e))}static{this.\u0275fac=function(i){return new(i||t)($(Ye),$(me))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Gt={onlyMine:!1,hidePublished:!1},K=(()=>{class t{constructor(e,i,n,d,h){this.coursesRestService=e,this.gradingScalesRestService=i,this.gradingsRestService=n,this.loadingService=d,this.sortService=h,this.action$=new xt(1),this.loading$=this.loadingService.loading$,this._courseId$=new xt(1),this.courseId$=this._courseId$.asObservable(),this.fetchedCourse$=this._courseId$.pipe(M(g=>this.loadingService.load(this.coursesRestService.getExpandedCourse(g))),J(1)),this.course$=ze(this.action$,this.fetchedCourse$.pipe(ve(ue),S(g=>({type:"reset",payload:g})))).pipe(jt(Tn,null),ve(ue),J(1)),this.tests$=this.course$.pipe(S(g=>g.Tests||[]),S(Gi)),this.hasTests$=this.tests$.pipe(S(g=>g.length>0)),this.filterSubject$=new q(Gt),this.filter$=this.filterSubject$.asObservable(),this.expandedHeaderSubject$=new q(!1),this.expandedHeader$=this.expandedHeaderSubject$.asObservable(),this.filteredTests$=W([this.tests$,this.filter$]).pipe(S(([g,P])=>g.filter(B=>(!P.onlyMine||B.IsOwner)&&(!P.hidePublished||!B.IsPublished)))),this.sorting$=this.sortService.sorting$,this.studentGrades$=W([this.course$,this.filteredTests$,this.sorting$]).pipe(S(xe(this.toStudentGrades.bind(this)))),this.canSetFinalGrade$=this.course$.pipe(S(Wi)),this.gradingScaleIds$=this.course$.pipe(S(g=>gi([...(g.Tests??[]).map(P=>P.GradingScaleId),g.GradingScaleId]).filter(ue)),Z(hi),J(1)),this.gradingScales$=this.gradingScaleIds$.pipe(M(g=>this.gradingScalesRestService.getGradingScales(g)),J(1)),this.UNDEFINED_GRADINGSCALE_ID=-1,this.gradingScalesOptions$=this.gradingScales$.pipe(S(g=>g.map(P=>{let B=P?.Id||this.UNDEFINED_GRADINGSCALE_ID,fe=P?.Grades.map(Ce=>({Key:Ce.Id,Value:Ce.Designation}))||[];return{id:B,options:fe}}).reduce((P,B)=>j(L({},P),{[B.id]:B.options}),{})),J(1)),this.meanOfStudentGradesForCourse$=this.studentGrades$.pipe(S(g=>yn(Ot(g)))),this.meanOfFinalGradesForCourse$=W([this.gradingScalesOptions$,this.studentGrades$]).pipe(M(xe(this.meanOfOverwrittenGradesForCourse.bind(this))))}setCourseId(e){this._courseId$.next(e)}setFilter(e){this.filterSubject$.next(e)}gradingOptionsForTest$(e){return this.gradingOptions$(e.GradingScaleId)}gradingOptionsForCourse$(){return this.course$.pipe(M(e=>this.gradingOptions$(e.GradingScaleId)))}toStudentGrades(e,i=[],n){return Cn(e.ParticipatingStudents??[],i,e.Gradings??[],e.FinalGrades??[]).sort(_n(n))}setSorting(e){this.sortService.setSorting(e)}getSortingChar$(e){return this.sortService.getSortingChar$(e)}sortBy(e){this.sortService.toggleSorting(e)}toggleHeader(e){this.expandedHeaderSubject$.next(e)}optimisticallyUpdateGrade(e){return this.course$.pipe(ae(1),S(i=>{let{originalResult:n,updatedResult:d}=this.buildOptimisticResultUpdate(i,e);return this.updateTestResult(d,null),n}))}saveGrade(e,i){this.course$.pipe(ae(1),M(n=>this.coursesRestService.updateTestResult(n.Id,e).pipe(Ft(d=>(i&&this.updateTestResult(L({},i),null),Dt(()=>d)))))).subscribe(({testResult:n,grading:d})=>this.updateOrDeleteTestResult(e.testId,e.studentId,n,d,"gradeId"in e?"grade":"points"))}publish(e){this.coursesRestService.publishTest(e.Id).subscribe(this.toggleTestPublishedState.bind(this))}unpublish(e){this.coursesRestService.unpublishTest(e.Id).subscribe(this.toggleTestPublishedState.bind(this))}deleteTest(e){this.action$.next({type:"delete-test",payload:e})}overwriteFinalGrade({id:e,selectedGradeId:i}){this.gradingsRestService.updateGrade(e,i).subscribe(()=>{this.action$.next({type:"final-grade-overwritten",payload:{id:e,selectedGradeId:i}})})}setAveragesAsFinalGrades(e){this.coursesRestService.setAverageAsFinalGrade(e).subscribe(i=>this.action$.next({type:"replace-grades",payload:i.Gradings}))}buildOptimisticResultUpdate(e,i){let n=ki(e,i.testId,i.studentId),d=n?L({},n):{Id:"",TestId:i.testId,StudentId:i.studentId,CourseRegistrationId:0,GradeId:null,GradeValue:null,GradeDesignation:null,Points:null};return d.GradeId="gradeId"in i?i.gradeId:n?.GradeId??null,d.Points="points"in i?i.points:n?.Points??null,{originalResult:n,updatedResult:d}}updateOrDeleteTestResult(e,i,n,d,h){n?this.updateTestResult(n,d,h):this.deleteTestResult(e,i,d)}updateTestResult(e,i,n){this.action$.next({type:"updateResult",payload:{testResult:e,grading:i??null,ignore:n}})}deleteTestResult(e,i,n){this.action$.next({type:"deleteResult",payload:{testId:e,studentId:i,grading:n}})}toggleTestPublishedState(e){this.action$.next({type:"toggle-test-state",payload:e})}gradingOptions$(e){return e===null?U(null):this.gradingScalesOptions$.pipe(S(i=>i[e]),J(1))}meanOfOverwrittenGradesForCourse(e,i){return this.course$.pipe(S(n=>{if(n.GradingScaleId===null||e[n.GradingScaleId]===void 0)return null;let d=e[n.GradingScaleId];return xn(Ot(i),d)}))}static{this.\u0275fac=function(i){return new(i||t)($(ge),$(Bi),$(wn),$(be),$(Ni))}}static{this.\u0275prov=oe({token:t,factory:t.\u0275fac})}}return t})();var is=t=>["/events",t,"tests"];function ns(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function rs(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function ss(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function as(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function os(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=o.$implicit;r(),v(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function ds(t,o){if(t&1&&(s(0,"div",29)(1,"div",30)(2,"div",16)(3,"label",31),p(4),l(5,"translate"),a(),s(6,"div",32),x(7,"input",33),l(8,"async"),H(9,as,3,4,"div",7,Me),l(11,"async"),a()()(),s(12,"div",30)(13,"div",16)(14,"label",34),p(15),l(16,"translate"),a(),s(17,"div",32),x(18,"input",35),l(19,"async"),H(20,os,3,4,"div",7,Me),l(22,"async"),a()()()(),s(23,"div",36),Ut(),s(24,"math")(25,"mi"),p(26),l(27,"translate"),a(),s(28,"mo"),p(29,"="),a(),s(30,"mfrac")(31,"mrow")(32,"mi"),p(33),l(34,"translate"),a(),s(35,"mo"),p(36,"\xD7"),a(),s(37,"mn"),p(38,"5"),a()(),s(39,"mi"),p(40),l(41,"translate"),a()(),s(42,"mo"),p(43,"+"),a(),s(44,"mn"),p(45,"1"),a()()()),t&2){let e,i,n=u(2);r(4),f(c(5,9,"tests.form.max-points")),r(3),le("is-invalid",((e=c(8,11,n.maxPointsErrors$))==null?null:e.length)||!1),r(2),N(c(11,13,n.maxPointsErrors$)),r(6),f(c(16,15,"tests.form.max-points-adjusted")),r(3),le("is-invalid",((i=c(19,17,n.maxPointsAdjustedErrors$))==null?null:i.length)||!1),r(2),N(c(22,19,n.maxPointsAdjustedErrors$)),r(6),v(" ",c(27,21,"tests.form.math.grade")," "),r(7),v(" ",c(34,23,"tests.form.math.points")," "),r(7),f(c(41,25,"tests.form.math.max-points"))}}function ls(t,o){t&1&&(s(0,"div",28)(1,"span",37),p(2,"Loading..."),a()())}function ps(t,o){if(t&1){let e=G();s(0,"form",2),b("ngSubmit",function(){w(e);let n=u();return E(n.onSubmit())}),s(1,"div",3)(2,"div",4)(3,"label",5),p(4),l(5,"translate"),a(),x(6,"input",6),l(7,"async"),l(8,"translate"),H(9,ns,3,4,"div",7,Me),l(11,"async"),a(),s(12,"div",8)(13,"label",9),p(14),l(15,"translate"),a(),s(16,"div",10)(17,"span",11)(18,"i",12),p(19,"calendar_today"),a()(),s(20,"input",13,0),l(22,"async"),l(23,"translate"),b("click",function(){w(e);let n=Se(21);return E(n.toggle())}),a(),H(24,rs,3,4,"div",7,Me),l(26,"async"),a()()(),s(27,"div",14)(28,"label",15),p(29),l(30,"translate"),a(),s(31,"div",4)(32,"div",16)(33,"label",17),p(34),l(35,"translate"),a(),s(36,"div",18),x(37,"input",19),l(38,"async"),H(39,ss,3,4,"div",7,Me),l(41,"async"),a()()()(),s(42,"div")(43,"label",15),p(44),l(45,"translate"),a(),s(46,"div",20),x(47,"input",21),s(48,"label",22),p(49),l(50,"translate"),a()(),s(51,"div",20),x(52,"input",23),s(53,"label",24),p(54),l(55,"translate"),a()(),T(56,ds,46,27),a(),s(57,"div",25)(58,"button",26),l(59,"async"),p(60),l(61,"translate"),a(),s(62,"button",27),p(63),l(64,"translate"),T(65,ls,3,0,"div",28),a()()()}if(t&2){let e,i,n,d,h=u();m("formGroup",h.formGroup),r(4),f(c(5,26,"tests.form.designation")),r(2),le("is-invalid",((e=c(7,28,h.designationErrors$))==null?null:e.length)||!1),m("placeholder",c(8,30,"tests.form.designation-placeholder")),r(3),N(c(11,32,h.designationErrors$)),r(5),f(c(15,34,"tests.form.date")),r(3),m("id",h.componentId),r(3),le("is-invalid",((i=c(22,36,h.dateErrors$))==null?null:i.length)||!1),m("placeholder",c(23,38,"shared.date-select.default-placeholder")),r(4),N(c(26,40,h.dateErrors$)),r(5),f(c(30,42,"tests.form.weight")),r(5),f(c(35,44,"tests.form.factor")),r(3),le("is-invalid",((n=c(38,46,h.weightErrors$))==null?null:n.length)||!1),r(2),N(c(41,48,h.weightErrors$)),r(5),f(c(45,50,"tests.form.grading-type")),r(3),m("value",!1),r(2),f(c(50,52,"tests.form.grades")),r(3),m("value",!0),r(2),f(c(55,54,"tests.form.points")),r(2),y((d=h.formGroup.get("isPointGrading"))!=null&&d.value?56:-1),r(2),m("disabled",h.saving)("routerLink",D(62,is,c(59,56,h.courseId$))),r(2),v(" ",c(61,58,"tests.form.cancel")," "),r(2),m("disabled",h.saving),r(),v(" ",c(64,60,"tests.form.save")," "),r(2),y(h.saving?65:-1)}}var St=(()=>{class t{constructor(e,i,n){this.fb=e,this.translate=i,this.testStateService=n,this.test=null,this.saving=!1,this.save=new ee,this.componentId=fi("bkd-tests-edit-form"),this.formGroup=this.createFormGroup(),this.submitted$=new q(!1),this.destroy$=new ie,this.designationErrors$=Re(U(this.formGroup),this.submitted$,"designation"),this.dateErrors$=Re(U(this.formGroup),this.submitted$,"date"),this.maxPointsErrors$=Re(U(this.formGroup),this.submitted$,"maxPoints"),this.maxPointsAdjustedErrors$=Re(U(this.formGroup),this.submitted$,"maxPointsAdjusted"),this.weightErrors$=Re(U(this.formGroup),this.submitted$,"weight"),this.courseId$=this.testStateService.courseId$}ngOnInit(){this.test&&this.setInitialValues(this.test),Ci(U(this.formGroup),"isPointGrading").pipe(_e(this.destroy$)).subscribe(this.togglePointFieldsDisability.bind(this))}ngOnDestroy(){this.destroy$.next()}onSubmit(){this.submitted$.next(!0),this.formGroup.valid&&this.save.emit(this.formGroup.value)}createFormGroup(){return this.fb.group({designation:["",Le.required],date:[null,Le.required],weight:[1,Le.compose([Le.required,gn(0)])],isPointGrading:[!1],maxPoints:[{value:null,disabled:!0},Le.required],maxPointsAdjusted:[{value:null,disabled:!0},null]})}setInitialValues(e){this.formGroup.patchValue({designation:e.Designation,date:e.Date,weight:e.Weight,isPointGrading:e.IsPointGrading,maxPoints:e.MaxPoints,maxPointsAdjusted:e.MaxPointsAdjusted}),e.Results&&e.Results.length>0&&(this.formGroup.get("isPointGrading")?.disable(),this.formGroup.get("maxPoints")?.disable(),this.formGroup.get("maxPointsAdjusted")?.disable()),this.togglePointFieldsDisability()}togglePointFieldsDisability(){let e=this.formGroup.get("maxPoints"),i=this.formGroup.get("maxPointsAdjusted");this.formGroup.get("isPointGrading")?.value?(e?.enable(),i?.enable()):(e?.reset({value:this.test?.MaxPoints,disabled:!0}),i?.reset({value:this.test?.MaxPointsAdjusted,disabled:!0}))}static{this.\u0275fac=function(i){return new(i||t)(C(di),C(X),C(K))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-edit-form"]],inputs:{test:"test",saving:"saving"},outputs:{save:"save"},features:[ne([{provide:pi,useClass:ui},{provide:ci,useClass:Hi}])],decls:1,vars:1,consts:[["dp","ngbDatepicker"],[3,"formGroup"],[3,"ngSubmit","formGroup"],[1,"row","g-3","mb-3"],[1,"col-md-6"],["for","designation",1,"form-label"],["id","designation","name","designation","type","text","formControlName","designation","required","",1,"form-control",3,"placeholder"],[1,"invalid-feedback"],[1,"col-md-6","mb-3"],["for","date",1,"form-label"],[1,"input-group"],[1,"input-group-text",3,"id"],[1,"material-icons"],["id","date","name","date","type","text","ngbDatepicker","","formControlName","date","required","",1,"form-control",3,"click","placeholder"],[1,"row","mb-3"],[1,"form-label"],[1,"row"],["for","factor",1,"form-label","col-3","col-sm-2"],[1,"col-9","col-sm-10"],["id","factor","name","factor","type","number","formControlName","weight","step","0.05","min","0","required","",1,"form-control"],[1,"form-check"],["type","radio","formControlName","isPointGrading","id","type-grades",1,"form-check-input",3,"value"],["for","type-grades",1,"form-check-label"],["type","radio","formControlName","isPointGrading","id","type-points",1,"form-check-input",3,"value"],["for","type-points",1,"form-check-label"],[1,"d-flex","justify-content-end","mt-4"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","routerLink"],["type","submit",1,"btn","btn-primary","ms-2",3,"disabled"],["role","status",1,"spinner-border","spinner-border-sm","align-middle"],[1,"row","ms-4","mb-3","g-3"],[1,"col-sm-6","col-md-4"],["for","max-points",1,"ms-2","col-4","col-form-label"],[1,"col-6"],["type","number","name","maxPoints","id","max-points","formControlName","maxPoints","step","0.01","min","0","max","999","required","",1,"form-control"],["for","max-points-adjusted",1,"ms-2","col-4","col-form-label"],["type","number","name","maxPointsAdjusted","id","max-points-adjusted","formControlName","maxPointsAdjusted","step","0.01","min","0","max","999",1,"form-control"],[1,"ms-4","ps-3","py-3"],[1,"visually-hidden"]],template:function(i,n){i&1&&T(0,ps,66,64,"form",1),i&2&&y(n.formGroup?0:-1)},dependencies:[De,ni,Ke,Je,ri,Ze,ti,oi,Xe,Qe,li,si,ai,mi,Q,Y,I],styles:["#factor[_ngcontent-%COMP%], #max-points[_ngcontent-%COMP%], #max-points-adjusted[_ngcontent-%COMP%]{width:5em}"]})}}return t})();var En=(()=>{class t{constructor(e,i,n,d,h){this.route=e,this.courseService=i,this.toastService=n,this.translate=d,this.router=h,this.saving$=new q(!1),this.courseId$=this.route.paramMap.pipe(S(g=>Number(g.get("id"))),Z())}save(e){this.saving$.next(!0);let{designation:i,date:n,weight:d,isPointGrading:h,maxPoints:g,maxPointsAdjusted:P}=e;this.courseId$.pipe(M(B=>this.courseService.add(B,n,i,d,h,g,P)),qe(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.toastService.success(this.translate.instant("tests.form.save-success")),this.navigateBack()}navigateBack(){this.courseId$.subscribe(e=>void this.router.navigate(["events",e,"tests"]))}static{this.\u0275fac=function(i){return new(i||t)(C(re),C(ge),C(tt),C(X),C(Ge))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-add"]],decls:6,vars:6,consts:[[1,"bkd-container","bkd-container-limited"],[3,"save","saving"]],template:function(i,n){i&1&&(s(0,"h1"),p(1),l(2,"translate"),a(),s(3,"div",0)(4,"bkd-tests-edit-form",1),l(5,"async"),b("save",function(h){return n.save(h)}),a()()),i&2&&(r(),f(c(2,2,"tests.add-title")),r(3),m("saving",c(5,4,n.saving$)))},dependencies:[St,Y,I],encapsulation:2})}}return t})();var In=(()=>{class t{constructor(e){this.activeModal=e}get canDeleteTest(){return(this.test?.Results?.filter(i=>i.GradeId!==null||i.GradeValue!==null||i.Points!==null)||[]).length===0}static{this.\u0275fac=function(i){return new(i||t)(C(et))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-delete"]],inputs:{test:"test"},decls:13,vars:10,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click","hidden"],[1,"px-2"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"],[1,"px-3"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"p",1),p(2),l(3,"translate"),a()(),s(4,"div",2)(5,"button",3),b("click",function(){return n.activeModal.dismiss()}),s(6,"span",4),p(7),l(8,"translate"),a()(),s(9,"button",5),b("click",function(){return n.activeModal.close(n.canDeleteTest?n.test:null)}),s(10,"span",6),p(11),l(12,"translate"),a()()()),i&2&&(r(2),v(" ",c(3,4,n.canDeleteTest?"tests.form.confirm":"tests.form.delete-not-allowed")," "),r(3),m("hidden",!n.canDeleteTest),r(2),v(" ",c(8,6,"tests.dialog.no")," "),r(4),v(" ",c(12,8,n.canDeleteTest?"tests.dialog.yes":"tests.dialog.ok")," "))},dependencies:[I],encapsulation:2})}}return t})();var hs=t=>({test:t});function gs(t,o){t&1&&x(0,"bkd-spinner")}function fs(t,o){if(t&1){let e=G();s(0,"div",1)(1,"h1"),p(2),l(3,"translate"),a(),s(4,"button",2),b("click",function(){w(e);let n=u(),d=O(0);return E(n.openDeleteModal(d))}),s(5,"i",3),p(6,"delete"),a()()(),s(7,"bkd-tests-edit-form",4),b("save",function(n){w(e);let d=u();return E(d.save(n))}),a()}if(t&2){u();let e=O(0),i=O(2);r(2),v(" ",F(3,3,"tests.edit-title",D(6,hs,e.Designation))," "),r(5),m("test",e)("saving",i)}}var kn=(()=>{class t{constructor(e,i,n,d,h,g,P){this.state=e,this.courseService=i,this.route=n,this.toastService=d,this.translate=h,this.router=g,this.modalService=P,this.saving$=new q(!1),this.testId$=this.route.paramMap.pipe(S(B=>Number(B.get("testId"))),Z()),this.test$=W([this.state.tests$,this.testId$]).pipe(S(([B,fe])=>B.find(Ce=>Ce.Id===fe)))}openDeleteModal(e){let i=this.modalService.open(In);i.componentInstance.test=e,i.result.then(n=>{n&&this.courseService.delete(e.CourseId,e.Id).subscribe(this.onDeleteSuccess.bind(this))},()=>{})}save(e){this.saving$.next(!0);let{designation:i,date:n,weight:d,isPointGrading:h,maxPoints:g,maxPointsAdjusted:P}=e;W([this.state.courseId$,this.testId$]).pipe(ae(1),M(([B,fe])=>this.courseService.update(B,fe,i,n,d,h,g,P)),qe(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.toastService.success(this.translate.instant("tests.form.save-success")),this.navigateBack()}onDeleteSuccess(e){this.toastService.success(this.translate.instant("tests.form.delete-success")),this.state.deleteTest(e),this.navigateBack()}navigateBack(){this.state.courseId$.pipe(ae(1)).subscribe(e=>void this.router.navigate(["events",e,"tests"]))}static{this.\u0275fac=function(i){return new(i||t)(C(K),C(ge),C(re),C(tt),C(X),C(Ge),C(dt))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-edit"]],decls:8,vars:9,consts:[[1,"bkd-container","bkd-container-limited"],[1,"d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-primary","btn-icon",3,"click"],[1,"material-icons"],[3,"save","test","saving"]],template:function(i,n){if(i&1&&(R(0),l(1,"async"),R(2),l(3,"async"),s(4,"div",0),T(5,gs,1,0,"bkd-spinner"),l(6,"async"),T(7,fs,8,8),a()),i&2){let d=A(c(1,1,n.test$));r(2),A(c(3,4,n.saving$)),r(3),y(c(6,7,n.state.loading$)?5:d?7:-1)}},dependencies:[St,he,Y,I],encapsulation:2})}}return t})();var vs=t=>({designation:t}),Pn=(()=>{class t{constructor(e){this.activeModal=e}static{this.\u0275fac=function(i){return new(i||t)(C(et))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-publish-test"]],inputs:{test:"test"},decls:11,vars:12,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"p",1),p(2),l(3,"translate"),a()(),s(4,"div",2)(5,"button",3),b("click",function(){return n.activeModal.dismiss()}),p(6),l(7,"translate"),a(),s(8,"button",4),b("click",function(){return n.activeModal.close(!0)}),p(9),l(10,"translate"),a()()),i&2&&(r(2),v(" ",F(3,3,n.test.IsPublished?"tests.publishing.unpublish":"tests.publishing.publish",D(10,vs,n.test.Designation))," "),r(4),v(" ",c(7,6,"tests.publishing.cancel")," "),r(3),v(" ",c(10,8,"tests.publishing.confirm")," "))},dependencies:[I],encapsulation:2})}}return t})();var Cs=t=>({maxPoints:t});function _s(t,o){if(t&1&&(s(0,"div",6),p(1),l(2,"translate"),a()),t&2){let e=u(2);r(),v(" ",F(2,1,"global.validation-errors.invalidPoints",D(4,Cs,e.maxPoints))," ")}}function Ss(t,o){if(t&1){let e=G();s(0,"div",3)(1,"input",5,0),b("ngModelChange",function(){w(e);let n=Se(2),d=u();return E(d.onPointsChange(n.value))}),a(),T(3,_s,3,6,"div",6),a()}if(t&2){let e=Se(2),i=u();r(),le("is-invalid",e.errors),pe("max",i.maxPoints),pe("tabindex",i.tabIndex),m("disabled",i.grade.test.IsPublished)("ngModel",i.grade.kind==="grade"?i.grade.result.Points:null),r(2),y(e.errors?3:-1)}}var ys=1250,Mn=(()=>{class t{constructor(e){this.state=e,this.maxPoints=0,this.pointsSubject$=new ie,this.gradeSubject$=new ie,this.gradingScaleDisabledSubject$=new q(!0),this.gradingScaleDisabled$=this.gradingScaleDisabledSubject$.asObservable(),this.destroy$=new ie}ngOnInit(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale()),this.maxPoints=Sn(this.grade),this.initSave(this.pointsSubject$.pipe(ve(this.isValid.bind(this)),S(e=>({studentId:this.student.Id,testId:this.grade.test.Id,points:e?Number(e):null})))),this.initSave(this.gradeSubject$.pipe(S(e=>({studentId:this.student.Id,testId:this.grade.test.Id,gradeId:e}))))}ngOnChanges(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale())}ngOnDestroy(){this.destroy$.next()}onPointsChange(e){this.pointsSubject$.next(e),this.gradingScaleDisabledSubject$.next(!(e===null||e===""))}onGradeChange(e){this.gradeSubject$.next(e)}isValid(e){return e===""||e===null?!0:isNaN(Number(e))?!1:!(Number(e)<0||Number(e)>this.maxPoints)}initSave(e){e.pipe(Rt(i=>this.state.optimisticallyUpdateGrade(i).pipe(S(n=>({params:i,originalResult:n})))),Bt(ys),_e(this.destroy$)).subscribe(({params:i,originalResult:n})=>this.state.saveGrade(i,n))}disableGradingScale(){return this.grade.test.IsPublished?!0:this.grade.kind==="no-result"?!1:this.grade.result.Points!=null&&this.grade.test.IsPointGrading}static{this.\u0275fac=function(i){return new(i||t)(C(K))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-grade"]],inputs:{grade:"grade",student:"student",tabIndex:"tabIndex",gradeOptions:"gradeOptions"},features:[ke],decls:5,vars:8,consts:[["points","ngModel"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],[1,"point-input-container","me-2","me-md-3"],["data-testid","grade-select",1,"grade-select",3,"valueChange","options","allowEmpty","value","disabled","tabindex"],["type","number","step","0.01","min","0","data-testid","point-input",1,"form-control",3,"ngModelChange","max","disabled","tabindex","ngModel"],["data-testid","validation-error-message",1,"invalid-feedback"]],template:function(i,n){i&1&&(s(0,"div",1)(1,"div",2),T(2,Ss,4,7,"div",3),s(3,"bkd-select",4),l(4,"async"),b("valueChange",function(h){return n.onGradeChange(h)}),a()()()),i&2&&(r(2),y(n.grade.test.IsPointGrading?2:-1),r(),m("options",n.gradeOptions)("allowEmpty",!0)("value",n.grade.kind==="grade"?n.grade.result.GradeId:null)("disabled",c(4,6,n.gradingScaleDisabled$))("tabindex",n.tabIndex))},dependencies:[De,Ke,Je,Ze,Xe,Qe,ii,Be,Y,I],styles:[".point-input-container[_ngcontent-%COMP%]{width:4em}[_nghost-%COMP%] select{width:127px}@media (min-width: 576px){.point-input-container[_ngcontent-%COMP%]{width:5em}}"]})}}return t})();function xs(t,o){if(t&1&&(s(0,"span",1),p(1),a()),t&2){let e=u();r(),f(e.calculatePointsAverage(e.test))}}var On=(()=>{class t{constructor(e){this.locale=e}calculatePointsAverage(e){return this.safeAverage(e,2,st)}calculateGradeAverage(e){return this.safeAverage(e,3,at)}safeAverage(e,i,n){try{return Fi(n(e),this.locale,i)}catch{return Li}}static{this.\u0275fac=function(i){return new(i||t)(C(Qt))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-average-grades"]],inputs:{test:"test"},decls:4,vars:2,consts:[[1,"d-flex","flex-row","w-100"],["data-testid","average-points",1,"mr-2","mr-md-3","average-points"],["data-testid","average-grade"]],template:function(i,n){i&1&&(s(0,"div",0),T(1,xs,2,1,"span",1),s(2,"span",2),p(3),a()()),i&2&&(r(),y(n.test.IsPointGrading?1:-1),r(2),f(n.calculateGradeAverage(n.test)))},styles:[".average-points[_ngcontent-%COMP%]{min-width:4.5em}@media (min-width: 576px){.average-points[_ngcontent-%COMP%]{min-width:6em}}"]})}}return t})();var $n=(()=>{class t{constructor(){this.disabled=!1,this.width="127px",this.gradeIdSelected=new ee}onGradeChange(e){this.gradeId?.valueOf()!==void 0&&this.gradeIdSelected.emit({id:this.gradeId?.valueOf(),selectedGradeId:e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-grade-select"]],inputs:{options:"options",valueId:"valueId",gradeId:"gradeId",disabled:"disabled",width:"width"},outputs:{gradeIdSelected:"gradeIdSelected"},decls:1,vars:5,consts:[["data-testid","grade-select",3,"valueChange","options","allowEmpty","value","disabled","width"]],template:function(i,n){i&1&&(s(0,"bkd-select",0),b("valueChange",function(h){return n.onGradeChange(h)}),a()),i&2&&m("options",n.options)("allowEmpty",!0)("value",n.valueId)("disabled",n.disabled)("width",n.width)},dependencies:[Be],encapsulation:2})}}return t})();var bs=576,Gn=(()=>{class t{constructor(e,i){this.portal=e,this.state=i,this.destroy$=new ie,this.handleWindowScroll=()=>{this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleWindowResize=()=>{this.updateStickyWidth(),this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleTableScroll=()=>{this.updateStickyLeftOffset()}}ngOnInit(){W([this.state.filteredTests$,this.state.expandedHeader$]).pipe(_e(this.destroy$)).subscribe(()=>setTimeout(()=>this.updateStickyWidth()))}ngAfterViewInit(){this.handleWindowScroll(),this.handleTableScroll(),this.handleWindowResize(),this.window.addEventListener("scroll",this.handleWindowScroll),this.getTableScrollContainer()?.addEventListener("scroll",this.handleTableScroll),this.window.addEventListener("resize",this.handleWindowResize)}ngOnDestroy(){this.window.removeEventListener("scroll",this.handleWindowScroll),this.getTableScrollContainer()?.removeEventListener("scroll",this.handleTableScroll),this.window.removeEventListener("resize",this.handleWindowResize)}get window(){return this.portal.window??window}getTableScrollContainer(){return document.querySelector(".table-responsive-wrapper")??null}updateStickyVisibility(){if(this.isSmallBreakpointDown())return;let e=this.inlineHeader.getTop()+this.getIframeScrollY();this.stickyHeader.shown=this.getScrollTop()>e}updateStickyTopOffset(){this.isSmallBreakpointDown()||this.stickyHeader.setTopOffset(this.portal.inIframe?this.getScrollTop():0)}updateStickyLeftOffset(){this.isSmallBreakpointDown()||this.stickyHeader.setLeftOffset(this.inlineHeader.getLeft())}updateStickyWidth(){this.isSmallBreakpointDown()||(this.stickyHeader.setWidth(this.inlineHeader.getWidth()),this.stickyHeader.setColumnWidths(this.inlineHeader.getColumnWidths()),this.stickyHeader.setStickyColumnHeights(this.inlineHeader.getStickyColumnsHeights()))}getScrollTop(){return this.window.scrollY-this.portal.getIframeTop()}getIframeScrollY(){return window.scrollY}isSmallBreakpointDown(){return window.innerWidth({"btn-primary":t,"btn-outline-secondary":o}),Dn=(()=>{class t{constructor(){this.filter=Gt,this.filterChange=new ee}showOnlyMine(){this.filterChange.next(j(L({},this.filter),{onlyMine:!0}))}showAll(){this.filterChange.next(j(L({},this.filter),{onlyMine:!1}))}onHidePublishedChange(e){let i=(e.target&&e.target instanceof HTMLInputElement&&e.target?.checked)??!1;this.filterChange.next(j(L({},this.filter),{hidePublished:i}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-test-table-filter"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},decls:13,vars:18,consts:[[1,"only-mine-buttons"],["type","button",1,"btn","desktop",3,"click","ngClass"],["type","button",1,"btn","ms-2","desktop",3,"click","ngClass"],[1,"hide-published"],[1,"form-check"],["id","hide-published","type","checkbox",1,"form-check-input",3,"change","checked"],["for","hide-published",1,"form-check-label"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"button",1),b("click",function(){return n.showAll()}),p(2),l(3,"translate"),a(),s(4,"button",2),b("click",function(){return n.showOnlyMine()}),p(5),l(6,"translate"),a()(),s(7,"div",3)(8,"div",4)(9,"input",5),b("change",function(h){return n.onHidePublishedChange(h)}),a(),s(10,"label",6),p(11),l(12,"translate"),a()()()),i&2&&(r(),m("ngClass",wt(12,Ln,!n.filter.onlyMine,n.filter.onlyMine)),r(),v(" ",c(3,6,"tests.all-tests")," "),r(2),m("ngClass",wt(15,Ln,n.filter.onlyMine,!n.filter.onlyMine)),r(),v(" ",c(6,8,"tests.owned-tests")," "),r(4),m("checked",n.filter.hidePublished),r(2),v(" ",c(12,10,"tests.hide-published")," "))},dependencies:[ce,De,I],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;justify-content:space-between;height:100%}.only-mine-buttons[_ngcontent-%COMP%]{display:flex;align-items:center;height:3.625rem}.hide-published[_ngcontent-%COMP%]{display:flex;align-items:center;height:2.375rem;margin-bottom:1rem}.hide-published[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:300}.hide-published[_ngcontent-%COMP%] .form-check[_ngcontent-%COMP%]{margin-bottom:0}"]})}}return t})();var Ts=["*"],Fn=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-preserve-line-height"]],ngContentSelectors:Ts,decls:3,vars:0,template:function(i,n){i&1&&(Zt(),s(0,"div"),Jt(1),p(2,"\xA0"),a())},encapsulation:2})}}return t})();var Rn=(()=>{class t{constructor(e){this.translate=e}transform(e){return`${e.Weight} (${e.WeightPercent}%)${this.getPoints(e)}`}getPoints(e){return e.IsPointGrading?`, ${e.MaxPointsAdjusted??e.MaxPoints} ${this.translate.instant("tests.summary.points")}`:""}static{this.\u0275fac=function(i){return new(i||t)(C(X,16))}}static{this.\u0275pipe=Kt({name:"testSummaryShort",type:t,pure:!0})}}return t})();var ws=t=>[t,"edit"];function Es(t,o){t&1&&(s(0,"i",9),p(1,"edit"),a())}function Is(t,o){if(t&1&&(s(0,"div",5)(1,"div",7)(2,"bkd-preserve-line-height"),p(3),l(4,"date"),a(),s(5,"a",8),T(6,Es,2,0,"i",9),a()(),s(7,"bkd-preserve-line-height"),p(8),l(9,"testSummaryShort"),a(),s(10,"bkd-preserve-line-height"),p(11),a()()),t&2){let e=u();r(3),f(F(4,5,e.test.Date,"dd.MM.yyyy")),r(2),m("routerLink",D(10,ws,e.test.Id)),r(),y(e.test.IsOwner&&e.test.IsPublished===!1?6:-1),r(2),v(" ",c(9,8,e.test)," "),r(3),f(e.test.Owner)}}function ks(t,o){if(t&1){let e=G();s(0,"div",6)(1,"a",10),l(2,"translate"),b("click",function(){w(e);let n=u();return E(n.unpublishTest())}),s(3,"i",11),p(4,"lock"),a(),s(5,"span"),p(6),l(7,"translate"),a()(),s(8,"bkd-caret",12),b("click",function(){w(e);let n=u();return E(n.emitToggleHeader())}),a()()}if(t&2){let e=u();r(),pe("title",c(2,3,"tests.edit")),r(5),f(c(7,5,"tests.published")),r(2),m("expanded",e.expanded)}}function Ps(t,o){if(t&1){let e=G();s(0,"div",6)(1,"a",13),l(2,"translate"),b("click",function(){w(e);let n=u();return E(n.publishTest())}),s(3,"i",11),p(4,"lock_open"),a(),s(5,"span"),p(6),l(7,"translate"),a()(),s(8,"bkd-caret",12),b("click",function(){w(e);let n=u();return E(n.emitToggleHeader())}),a()()}if(t&2){let e=u();r(),pe("title",c(2,3,"tests.publish")),r(5),f(c(7,5,"tests.not-published")),r(2),m("expanded",e.expanded)}}var Bn=(()=>{class t{constructor(){this.toggleHeader=new ee,this.publish=new ee,this.unpublish=new ee}emitToggleHeader(){this.toggleHeader.emit(!this.expanded)}publishTest(){this.publish.emit(this.test)}unpublishTest(){this.unpublish.emit(this.test)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-test-table-header"]],inputs:{test:"test",expanded:"expanded"},outputs:{toggleHeader:"toggleHeader",publish:"publish",unpublish:"unpublish"},decls:9,vars:5,consts:[[1,"d-flex","flex-column","h-100","justify-content-between"],["role","button",1,"test-designation","d-flex","flex-row","my-3","align-items-end","justify-content-between",3,"click"],[3,"ngClass"],[1,"align-self-start",3,"expanded"],[1,"d-flex","flex-column"],[1,"d-flex","flex-column","mb-3"],[1,"d-flex","align-items-center","justify-content-between","test-status"],[1,"d-flex","flex-row","justify-content-between"],[1,"btn","btn-link","p-0","edit",3,"routerLink"],[1,"material-icons"],[1,"d-flex","btn","btn-link","ps-0","edit",3,"click","title"],[1,"material-icons","me-1"],[1,"expand-mobile",3,"click","expanded"],[1,"d-flex","btn","btn-link","ps-0",3,"click","title"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"div",1),b("click",function(){return n.emitToggleHeader()}),s(2,"div",2),p(3),a(),x(4,"bkd-caret",3),a(),s(5,"div",4),T(6,Is,12,12,"div",5)(7,ks,9,7,"div",6)(8,Ps,9,7,"div",6),a()()),i&2&&(r(2),m("ngClass",n.expanded?"expanded":"collapsed"),r(),v(" ",n.test.Designation," "),r(),m("expanded",n.expanded),r(2),y(n.expanded?6:-1),r(),y(n.test.IsPublished?7:8))},dependencies:[ce,bi,Fn,Q,$e,I,Rn],styles:["[_nghost-%COMP%]{font-weight:300}.collapsed[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.test-designation[_ngcontent-%COMP%]{display:none!important}.test-status[_ngcontent-%COMP%]{order:-1;padding-bottom:1rem}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:#000}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.edit[_ngcontent-%COMP%]{color:#00000080;text-decoration:none}@media (min-width: 811px){.test-designation[_ngcontent-%COMP%]{display:inherit!important}.test-status[_ngcontent-%COMP%]{order:initial}.expand-mobile[_ngcontent-%COMP%]{display:none!important}}"]})}}return t})();var Ms=["bkdTestEditGradesHeader",""],Lt=(t,o)=>o.Id,Os=t=>({"test-point-grading":t}),$s=t=>({selected:t});function Gs(t,o){if(t&1){let e=G();s(0,"th",3)(1,"bkd-test-table-header",14),b("toggleHeader",function(n){w(e);let d=u();return E(d.state.toggleHeader(n))})("publish",function(n){w(e);let d=u();return E(d.publish.emit(n))})("unpublish",function(n){w(e);let d=u();return E(d.unpublish.emit(n))}),a()()}if(t&2){let e=o.$implicit,i=u(),n=O(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)("expanded",n)}}function Ls(t,o){if(t&1){let e=G();s(0,"th",4)(1,"bkd-test-table-header",14),b("toggleHeader",function(n){w(e);let d=u();return E(d.state.toggleHeader(n))})("publish",function(n){w(e);let d=u();return E(d.publish.emit(n))})("unpublish",function(n){w(e);let d=u();return E(d.unpublish.emit(n))}),a()()}if(t&2){let e=o.$implicit,i=u(),n=O(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)("expanded",n)}}function Ds(t,o){if(t&1){let e=G();s(0,"div",15)(1,"span",16),b("click",function(){w(e);let n=u().$implicit,d=u();return E(d.state.sortBy(n))}),p(2),l(3,"translate"),a()()}t&2&&(r(2),v("",c(3,1,"tests.points")," "))}function Fs(t,o){if(t&1){let e=G();s(0,"th",13)(1,"div",8),T(2,Ds,4,3,"div",15),s(3,"div",9)(4,"span",16),b("click",function(){let n=w(e).$implicit,d=u();return E(d.state.sortBy(n))}),p(5),l(6,"translate"),a()(),s(7,"div",10),p(8),l(9,"async"),a()()()}if(t&2){let e=o.$implicit,i=u();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(2),y(e.IsPointGrading?2:-1),r(3),f(c(6,4,"tests.grade")),r(3),v(" ",c(9,6,i.state.getSortingChar$(e))," ")}}var jn=(()=>{class t{set shown(e){let i=this.element.nativeElement.classList;e?i.add("shown"):i.remove("shown")}constructor(e,i){this.state=e,this.element=i,this.sticky=!1,this.publish=new ee,this.unpublish=new ee}getTop(){return this.element.nativeElement.getBoundingClientRect().top}getLeft(){return this.element.nativeElement.getBoundingClientRect().left}setTopOffset(e){this.element.nativeElement.style.top=`${e}px`}setLeftOffset(e){this.element.nativeElement.style.left=`${e}px`}getWidth(){return this.element.nativeElement.getBoundingClientRect().width}setWidth(e){this.element.nativeElement.style.width=`${e}px`}getColumnWidths(){return this.getRowsAndColumns().map(e=>e.map(i=>i.getBoundingClientRect().width))}setColumnWidths(e){let i=this.getRowsAndColumns();if(i.length!==e.length||!i.every((n,d)=>n.length===e[d].length))throw new Error("Given column widths do not match number of header rows/columns");i.forEach((n,d)=>n.forEach((h,g)=>{h.style.width=`${e[d][g]}px`,h.style.minWidth=`${e[d][g]}px`}))}getStickyColumnsHeights(){return this.getRowsAndColumns(".sticky").map(e=>e.map(i=>i.getBoundingClientRect().height))}setStickyColumnHeights(e){let i=this.getRowsAndColumns(".sticky");if(i.length!==e.length||!i.every((n,d)=>n.length===e[d].length))throw new Error("Given column heights do not match number of sticky header columns");i.forEach((n,d)=>n.forEach((h,g)=>{h.style.height=`${e[d][g]}px`})),this.getRows().forEach((n,d)=>{let h=e[d].reduce((g,P)=>Math.max(g,P),0);n.style.height=`${h}px`})}getRowsAndColumns(e){return this.getRows().map(i=>Array.from(i.querySelectorAll(`th:not(.header-mobile)${e??""}`)))}getRows(){return Array.from(this.element.nativeElement.querySelectorAll("tr"))}static{this.\u0275fac=function(i){return new(i||t)(C(K),C(qt))}}static{this.\u0275cmp=_({type:t,selectors:[["thead","bkdTestEditGradesHeader",""]],hostVars:2,hostBindings:function(i,n){i&2&&le("sticky",n.sticky)},inputs:{selectedTest:"selectedTest",sticky:"sticky",shown:"shown"},outputs:{publish:"publish",unpublish:"unpublish"},attrs:Ms,decls:42,vars:32,consts:[[1,"header-collapsible"],["colspan","3",1,"desktop","sticky"],[3,"filterChange","filter"],["container","body",1,"test-grade","grade","test-info-desktop",3,"ngClass"],["container","body","colspan","3",1,"test-grade","header-mobile","test-info-mobile",3,"ngClass"],[1,"filler"],[3,"ngClass"],[1,"sticky","student-name",3,"click"],[1,"d-flex"],[1,"column-title"],[1,"sort-direction","ms-1"],[1,"sticky","student-grade","desktop",3,"click","ngClass"],[1,"border-end","sticky","student-average","desktop",3,"click"],["container","body",1,"test-grade",3,"ngClass"],[3,"toggleHeader","publish","unpublish","test","expanded"],[1,"column-title","point-input-container","me-2","me-md-3"],[3,"click"]],template:function(i,n){if(i&1){let d=G();R(0),l(1,"async"),R(2),l(3,"async"),R(4),l(5,"async"),s(6,"tr",0)(7,"th",1)(8,"bkd-test-table-filter",2),b("filterChange",function(g){return w(d),E(n.state.setFilter(g))}),a()(),H(9,Gs,2,3,"th",3,Lt),H(11,Ls,2,3,"th",4,Lt),x(13,"th",5),a(),s(14,"tr",6)(15,"th",7),b("click",function(){return w(d),E(n.state.sortBy("FullName"))}),s(16,"div",8)(17,"div",9),p(18),l(19,"translate"),a(),s(20,"div",10),p(21),l(22,"async"),a()()(),s(23,"th",11),b("click",function(){return w(d),E(n.state.sortBy("FinalGrade"))}),s(24,"div",8)(25,"div",9),p(26),l(27,"translate"),a(),s(28,"div",10),p(29),l(30,"async"),a()()(),s(31,"th",12),b("click",function(){return w(d),E(n.state.sortBy("TestsMean"))}),s(32,"div",8)(33,"div",9),p(34),l(35,"translate"),a(),s(36,"div",10),p(37),l(38,"async"),a()()(),H(39,Fs,10,8,"th",13,Lt),x(41,"th",5),a()}if(i&2){let d=c(1,9,n.state.filteredTests$),h=c(3,11,n.state.filter$);r(4),A(c(5,13,n.state.expandedHeader$)),r(4),m("filter",h),r(),N(d),r(2),N(d),r(3),m("ngClass",D(28,Os,n.selectedTest==null?null:n.selectedTest.IsPointGrading)),r(4),v(" ",c(19,16,"tests.student.name")," "),r(3),v(" ",c(22,18,n.state.getSortingChar$("FullName"))," "),r(2),m("ngClass",D(30,$s,n.selectedTest===void 0)),r(3),v(" ",c(27,20,"tests.grade")," "),r(3),v(" ",c(30,22,n.state.getSortingChar$("FinalGrade"))," "),r(5),v(" ",c(35,24,"tests.mean")," "),r(3),v(" ",c(38,26,n.state.getSortingChar$("TestsMean"))," "),r(2),N(d)}},dependencies:[Y,ce,I,Dn,Bn],styles:["[_nghost-%COMP%]{--spacer: 16px;--point-input-size: 4em;--grade-input-size: 127px;--points-grade-gap: 1rem;--student-name-column-width: 225px;--student-grade-column-width: calc( var(--spacer) + var(--grade-input-size) + var(--spacer) );--student-average-column-width: 100px;--test-grade-column-width: calc( var(--spacer) + var(--point-input-size) + var(--points-grade-gap) + var(--grade-input-size) + var(--spacer) );--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}@media (max-width: 767.98px){[_nghost-%COMP%]{--points-grade-gap: calc(.5 * var(--spacer))}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}@media (max-width: 810px){tr[_ngcontent-%COMP%]:not(.header-collapsible):not(.test-point-grading) th.test-grade[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]:not(.test-point-grading) th.student-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.test-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.student-grade[_ngcontent-%COMP%]{width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));min-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));max-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer))}}th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{padding:0;width:auto}@media (max-width: 810px){th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{width:0}}th.test-grade[_ngcontent-%COMP%] .column-title.point-input-container[_ngcontent-%COMP%]{width:var(--point-input-size)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block;padding-right:0}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}.sticky[_nghost-%COMP%]{position:fixed;top:0;left:0;z-index:1000;display:none}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;vertical-align:top}.header-collapsible[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;padding:0 1rem}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:none!important}@media (min-width: 811px){.sticky.shown[_nghost-%COMP%]{display:table-header-group}tr[_ngcontent-%COMP%] th.test-info-mobile[_ngcontent-%COMP%]{display:none!important}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:table-cell!important}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;padding-top:.25rem;padding-bottom:.25rem;border-top:initial}.sticky[_nghost-%COMP%]{margin-left:var(--test-columns-offset)}.sticky[_nghost-%COMP%] th.sticky[_ngcontent-%COMP%]{position:fixed}}"],changeDetection:0})}}return t})();var Rs=(t,o)=>o.student.Id,Bs=(t,o)=>o.Id,js=(t,o)=>o.id,Vs=t=>({"test-point-grading":t}),Vn=t=>({selected:t}),As=t=>["student",t,"grades"],Hs=t=>({"visible-on-mobile":t});function Ns(t,o){if(t&1){let e=G();s(0,"bkd-grade-select",19),l(1,"async"),l(2,"async"),b("gradeIdSelected",function(n){w(e);let d=u(2);return E(d.state.overwriteFinalGrade(n))}),a()}if(t&2){let e=u().$implicit,i=u();m("options",c(1,4,i.state.gradingOptionsForCourse$()))("valueId",e.finalGrade.finalGradeId)("gradeId",e.finalGrade.id)("disabled",c(2,6,i.isEditFinalGradesAllowed(e))===!1)}}function Us(t,o){if(t&1&&(s(0,"div"),p(1),a()),t&2){let e=u().$implicit;r(),v(" ",e.finalGrade.freeHandGrade," ")}}function Ws(t,o){if(t&1&&(R(0),s(1,"td",11),x(2,"bkd-grade",20),l(3,"async"),a()),t&2){let e=o.$implicit,i=o.$index,n=u(),d=n.$implicit,h=n.$index,g=u(),P=e.grade;r(),m("ngClass",g.selectedTest!==void 0&&P.test.Id===g.selectedTest.Id?"selected":""),r(),m("grade",P)("gradeOptions",c(3,5,g.state.gradingOptionsForTest$(P.test)))("student",d.student)("tabIndex",(1+i)*1e3+h)}}function zs(t,o){if(t&1&&(s(0,"tr")(1,"td",6)(2,"a",15)(3,"div"),p(4),a(),s(5,"div",8),p(6),l(7,"translate"),l(8,"decimalOrDash"),a()()(),s(9,"td",16),T(10,Ns,3,8,"bkd-grade-select",17)(11,Us,2,1,"div"),a(),s(12,"td",18),p(13),l(14,"decimalOrDash"),a(),H(15,Ws,4,7,"td",11,js),x(17,"td",12),a()),t&2){let e=o.$implicit,i=u();r(2),m("routerLink",D(16,As,e.student.Id)),r(2),f(e.student.FullName),r(2),Ue(" ",c(7,8,"tests.mean"),": ",F(8,10,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),r(3),m("ngClass",D(18,Vn,i.selectedTest===void 0)),r(),y(e.finalGrade&&!e.finalGrade.freeHandGrade?10:-1),r(),y(e.finalGrade&&e.finalGrade.freeHandGrade?11:-1),r(2),v(" ",F(14,13,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),r(2),N(i.getGrades(e))}}function qs(t,o){if(t&1&&(s(0,"td",11),x(1,"bkd-average-grades",21),a()),t&2){let e=o.$implicit,i=u();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)||e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)}}function Ys(t,o){if(t&1){let e=G();s(0,"button",22),b("click",function(){w(e);let n=u();return E(n.setAverageAsFinalGrade())}),p(1),l(2,"translate"),a()}if(t&2){let e=u(),i=O(2);m("ngClass",D(4,Hs,!i||!e.selectedTest)),r(),v(" ",c(2,2,"tests.set-final-grade")," ")}}var An=(()=>{class t{constructor(e,i){this.state=e,this.modalService=i}ngOnInit(){this.state.setSorting({key:"FullName",ascending:!0})}setAverageAsFinalGrade(){this.state.course$.pipe(ae(1)).subscribe(e=>this.state.setAveragesAsFinalGrades({CourseIds:[e.Id]}))}isEditFinalGradesAllowed(e){return this.state.course$.pipe(S(i=>!!(ut(i)?.value&&e.finalGrade?.canGrade)))}getGrades(e){return e.grades.flatMap(i=>({id:`${e.student.Id}-${i.test.Id}`,grade:i}))}publish(e){let i=this.openModal(e);this.onCloseModal(i,()=>this.state.publish(e))}unpublish(e){let i=this.openModal(e);this.onCloseModal(i,()=>this.state.unpublish(e))}calculatePointsAverage(e){return this.safeAverage(e,st)}calculateGradeAverage(e){return this.safeAverage(e,at)}safeAverage(e,i){try{return i(e).toString()}catch{return"\u2013"}}openModal(e){let i=this.modalService.open(Pn);return i.componentInstance.test=e,i}onCloseModal(e,i){e.result.then(n=>{n&&i()},()=>{})}static{this.\u0275fac=function(i){return new(i||t)(C(K),C(dt))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-test-edit-grades"]],inputs:{selectedTest:"selectedTest"},features:[ne([Ne])],decls:40,vars:45,consts:[["inlineHeader",""],["stickyHeader",""],[1,"table-responsive-wrapper"],["bkdTestEditGradesHeaderSticky","",1,"table","table-hover","h-100",3,"ngClass","inlineHeader","stickyHeader"],["bkdTestEditGradesHeader","",3,"publish","unpublish","selectedTest"],["bkdTestEditGradesHeader","",3,"publish","unpublish","sticky","selectedTest"],[1,"sticky","student-name"],[1,"d-flex","flex-column"],[1,"student-average-inline"],[1,"desktop","sticky","student-grade",3,"ngClass"],[1,"desktop","border-end","sticky","student-average"],[1,"test-grade",3,"ngClass"],[1,"filler"],[1,"action-buttons"],["data-testId","apply-average-button","type","button",1,"apply-average-button","btn","btn-primary","m-3",3,"ngClass"],[3,"routerLink"],[1,"sticky","student-grade",3,"ngClass"],[3,"options","valueId","gradeId","disabled"],[1,"border-end","sticky","student-average"],[3,"gradeIdSelected","options","valueId","gradeId","disabled"],[3,"grade","gradeOptions","student","tabIndex"],[3,"test"],["data-testId","apply-average-button","type","button",1,"apply-average-button","btn","btn-primary","m-3",3,"click","ngClass"]],template:function(i,n){if(i&1){let d=G();R(0),l(1,"async"),R(2),l(3,"async"),R(4),l(5,"async"),s(6,"div",2)(7,"table",3)(8,"thead",4,0),b("publish",function(g){return w(d),E(n.publish(g))})("unpublish",function(g){return w(d),E(n.unpublish(g))}),a(),s(10,"thead",5,1),b("publish",function(g){return w(d),E(n.publish(g))})("unpublish",function(g){return w(d),E(n.unpublish(g))}),a(),s(12,"tbody"),H(13,zs,18,20,"tr",null,Rs),s(15,"tr")(16,"td",6)(17,"div",7)(18,"div"),p(19),l(20,"translate"),a(),s(21,"div",8),p(22),l(23,"translate"),l(24,"async"),l(25,"decimalOrDash"),a()()(),s(26,"td",9),p(27),l(28,"async"),l(29,"decimalOrDash"),a(),s(30,"td",10),p(31),l(32,"async"),l(33,"decimalOrDash"),a(),H(34,qs,2,2,"td",11,Bs),x(36,"td",12),a()()(),s(37,"div",13),T(38,Ys,3,6,"button",14),l(39,"async"),a()()}if(i&2){let d=Se(9),h=Se(11),g=c(1,13,n.state.filteredTests$);r(2),A(c(3,15,n.state.hasTests$));let P=c(5,18,n.state.studentGrades$);r(5),m("ngClass",D(41,Vs,n.selectedTest==null?null:n.selectedTest.IsPointGrading))("inlineHeader",d)("stickyHeader",h),r(),m("selectedTest",n.selectedTest),r(2),m("sticky",!0)("selectedTest",n.selectedTest),r(3),N(P),r(6),f(c(20,20,"tests.average")),r(3),Ue(" ",c(23,22,"tests.mean"),": ",F(25,26,c(24,24,n.state.meanOfStudentGradesForCourse$),"1-3")," "),r(4),m("ngClass",D(43,Vn,n.selectedTest===void 0)),r(),v(" ",F(29,31,c(28,29,n.state.meanOfFinalGradesForCourse$),"1-3")," "),r(4),v(" ",F(33,36,c(32,34,n.state.meanOfStudentGradesForCourse$),"1-3")," "),r(3),N(g),r(4),y(c(39,39,n.state.canSetFinalGrade$)?38:-1)}},dependencies:[ce,Q,$n,Mn,On,Y,I,Di,Gn,jn],styles:["[_nghost-%COMP%]{--spacer: 16px;--point-input-size: 4em;--grade-input-size: 127px;--points-grade-gap: 1rem;--student-name-column-width: 225px;--student-grade-column-width: calc( var(--spacer) + var(--grade-input-size) + var(--spacer) );--student-average-column-width: 100px;--test-grade-column-width: calc( var(--spacer) + var(--point-input-size) + var(--points-grade-gap) + var(--grade-input-size) + var(--spacer) );--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}@media (max-width: 767.98px){[_nghost-%COMP%]{--points-grade-gap: calc(.5 * var(--spacer))}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}@media (max-width: 810px){tr[_ngcontent-%COMP%]:not(.header-collapsible):not(.test-point-grading) th.test-grade[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]:not(.test-point-grading) th.student-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.test-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.student-grade[_ngcontent-%COMP%]{width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));min-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));max-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer))}}th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{padding:0;width:auto}@media (max-width: 810px){th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{width:0}}th.test-grade[_ngcontent-%COMP%] .column-title.point-input-container[_ngcontent-%COMP%]{width:var(--point-input-size)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block;padding-right:0}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child{text-decoration:underline}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.student-average-inline[_ngcontent-%COMP%]{color:#4e4e4ef2;font-size:.875rem;line-height:1}@media (min-width: 811px){.table-responsive-wrapper[_ngcontent-%COMP%]{display:block;overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0}.action-buttons[_ngcontent-%COMP%]{position:sticky;left:0}}@media (max-width: 810px){.apply-average-button[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]})}}return t})();var Ks=()=>["/events"],Zs=t=>({count:t});function Js(t,o){if(t&1&&(s(0,"div",7),p(1),l(2,"translate"),a()),t&2){let e=u();r(),v(" ",F(2,1,e.course.ParticipatingStudents.length===1?"courses.registration":"courses.registrations",D(4,Zs,e.course.ParticipatingStudents.length))," ")}}var Hn=(()=>{class t{constructor(e){this.reportsService=e,this.course$=new q(null),this.reports$=this.course$.pipe(S(i=>i?.Id),Z(),M(i=>i?this.reportsService.getCourseTestsReports(i):U([])),Vt([]))}ngOnChanges(e){e.course&&this.course$.next(e.course.currentValue)}getDesignation(){return ht(this.course)}static{this.\u0275fac=function(i){return new(i||t)(C(ot))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-header"]],inputs:{course:"course"},features:[ke],decls:12,vars:7,consts:[[3,"link"],[1,"d-flex"],["routerLink","add",1,"edit","btn","btn-primary","btn-icon","ms-2"],[1,"material-icons"],[1,"ms-2",3,"reports"],["id","excel-import"],[1,"d-flex","flex-column","header"],[1,"additional-info"]],template:function(i,n){i&1&&(s(0,"bkd-backlink",0)(1,"div",1)(2,"a",2)(3,"i",3),p(4,"add"),a()(),x(5,"bkd-reports-link",4),l(6,"async"),x(7,"div",5),a()(),s(8,"div",6)(9,"h1"),p(10),a(),T(11,Js,3,6,"div",7),a()),i&2&&(m("link",Oe(6,Ks)),r(5),m("reports",c(6,4,n.reports$)),r(5),f(n.getDesignation()),r(),y(n.course.ParticipatingStudents?11:-1))},dependencies:[Ve,Q,nt,Y,I],styles:[".header[_ngcontent-%COMP%]{padding-bottom:1rem;border-bottom:1px solid #dee2e6}h1[_ngcontent-%COMP%]{margin-bottom:0}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}"]})}}return t})();var Qs=()=>[],Xs=t=>({"visible-on-mobile":t});function ea(t,o){t&1&&x(0,"bkd-spinner")}function ta(t,o){if(t&1){let e=G();s(0,"bkd-select",4),b("valueChange",function(n){w(e);let d=u(2);return E(n&&d.testSelected(n))}),a(),x(1,"bkd-test-edit-grades",5)}if(t&2){u(2);let e=O(6),i=O(8),n=O(10);m("options",e)("value",i)("allowEmpty",!1),r(),m("selectedTest",n)}}function ia(t,o){t&1&&(s(0,"p",2),p(1),l(2,"translate"),a()),t&2&&(r(),f(c(2,1,"tests.no-tests")))}function na(t,o){if(t&1&&(s(0,"a",3),l(1,"async"),s(2,"i",6),p(3,"arrow_right_alt"),a(),s(4,"span",7),p(5),l(6,"translate"),a()()),t&2){let e=u(2),i=O(4),n=O(10);pe("href",c(1,3,e.buildLinkToRatingOverview()),de),m("ngClass",D(7,Xs,!i||!n)),r(5),f(c(6,5,"tests.link-to-rating-overview"))}}function ra(t,o){if(t&1&&(x(0,"bkd-tests-header",1),T(1,ta,2,4)(2,ia,3,3,"p",2)(3,na,7,9,"a",3),l(4,"async")),t&2){let e=u(),i=O(0),n=O(2);m("course",i),r(),y(n.length>0?1:2),r(2),y(c(4,3,e.state.canSetFinalGrade$)?3:-1)}}var Nn=(()=>{class t{constructor(e,i,n){this.settings=e,this.state=i,this.translate=n,this.selectTest$=new ie,this.testOptions$=this.state.tests$.pipe(S(d=>[{Key:-1,Value:this.translate.instant("tests.grade")},...d.map(h=>({Key:h.Id,Value:h.Designation}))]),Z()),this.selectedTestId$=ze(this.selectTest$,this.state.tests$.pipe(ae(1),S(d=>d[0]?.Id))).pipe(Z()),this.selectedTest$=this.selectedTestId$.pipe(M(d=>this.state.tests$.pipe(S(h=>h.find(g=>g.Id===d)))),Z())}testSelected(e){this.selectTest$.next(e)}buildLinkToRatingOverview(){return this.state.course$.pipe(ae(1),S(e=>this.settings.eventlist.evaluation.replace(":id",String(e.Id))))}static{this.\u0275fac=function(i){return new(i||t)(C(me),C(K),C(X))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests-list"]],decls:16,vars:22,consts:[[1,"bkd-container"],[3,"course"],[1,"mt-3","px-3"],[1,"rating-overview","d-flex","justify-content-end","pe-3","border-top","pt-3",3,"ngClass","href"],["width","100%",1,"tests-dropdown",3,"valueChange","options","value","allowEmpty"],[3,"selectedTest"],[1,"material-icons","fw-bold"],[1,"ps-1"]],template:function(i,n){if(i&1&&(R(0),l(1,"async"),R(2),l(3,"async"),R(4),l(5,"async"),R(6),l(7,"async"),R(8),l(9,"async"),R(10),l(11,"async"),s(12,"div",0),T(13,ea,1,0,"bkd-spinner"),l(14,"async"),T(15,ra,5,5),a()),i&2){let d;A(c(1,1,n.state.course$)),r(2),A((d=c(3,4,n.state.tests$))!==null&&d!==void 0?d:Oe(21,Qs)),r(2),A(c(5,7,n.state.hasTests$)),r(2),A(c(7,10,n.testOptions$)),r(2),A(c(9,13,n.selectedTestId$)),r(2),A(c(11,16,n.selectedTest$)),r(3),y(c(14,19,n.state.loading$)?13:15)}},dependencies:[Hn,Be,An,ce,he,Y,I],styles:[".tests-dropdown[_ngcontent-%COMP%]{display:block;padding:1rem 0}@media (min-width: 811px){.tests-dropdown[_ngcontent-%COMP%]{display:none}}a.rating-overview[_ngcontent-%COMP%]{text-decoration:none}a.rating-overview[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}a.rating-overview[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}@media (max-width: 810px){a.rating-overview[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]})}}return t})();var yt=(()=>{class t{constructor(e,i){this.state=e,this.route=i,this.courseId$=this.route.paramMap.pipe(S(n=>Number(n.get("id"))),Z()),this.destroy$=new ie}ngOnInit(){this.courseId$.pipe(_e(this.destroy$)).subscribe(e=>this.state.setCourseId(e))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(i){return new(i||t)(C(K),C(re))}}static{this.\u0275cmp=_({type:t,selectors:[["bkd-tests"]],features:[ne([K])],decls:1,vars:0,template:function(i,n){i&1&&x(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();function Un(t){return{path:t,component:mn,children:[{path:"",component:pn},{path:"study-course-student/:id",component:cn},It]}}var xc=[{path:"",component:hn,children:[{path:"",component:un},{path:"current",component:tn,children:[{path:"",component:en},Un(":id")]},{path:":id",component:yt,children:[{path:"tests",component:Nn},Un("students")]},{path:":id/tests/:testId/edit",component:yt,children:[{path:"",component:kn}]},{path:":id/tests/add",component:yt,children:[{path:"",component:En}]},{path:":id/tests",children:[It]}]}];export{Yi as a,Un as b,xc as c}; diff --git a/public/apps/webapp-schulverwaltung/chunk-6WEK6KVH.js b/public/apps/webapp-schulverwaltung/chunk-GQNMRCRW.js similarity index 99% rename from public/apps/webapp-schulverwaltung/chunk-6WEK6KVH.js rename to public/apps/webapp-schulverwaltung/chunk-GQNMRCRW.js index 10b668d2..6229623c 100644 --- a/public/apps/webapp-schulverwaltung/chunk-6WEK6KVH.js +++ b/public/apps/webapp-schulverwaltung/chunk-GQNMRCRW.js @@ -1 +1 @@ -import{a as pe,b as Pe}from"./chunk-DJH5AAGM.js";import{a as bn}from"./chunk-C7RLEXTD.js";import{a as _n,b as vn}from"./chunk-QB4DIFWS.js";import{b as Pn}from"./chunk-DM5T4OMV.js";import{a as Cn}from"./chunk-5ZBE3UL7.js";import{e as fn}from"./chunk-4UVNKLEN.js";import{q as gn,v as ye}from"./chunk-PXVJ3QLD.js";import{a as ct}from"./chunk-HCNFZOWE.js";import{b as zt,c as Xt,e as Qe}from"./chunk-CKFTESOV.js";import{a as rn}from"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import{a as yn}from"./chunk-A3AAQWNQ.js";import{c as at,g as un}from"./chunk-Z4YBXGVO.js";import{a as cn}from"./chunk-3L4RH6QP.js";import{a as an,b as pn}from"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{a as Sn}from"./chunk-3P6YOVUR.js";import{B as ve,C as sn,E as st,G as hn,g as Zt,h as He,l as qe,m as en,n as tn,o as rt,t as nn,x as on}from"./chunk-UYCIECIQ.js";import{d as se}from"./chunk-G6EB45SC.js";import{e as Jt,o as Yt}from"./chunk-WCDEMEW2.js";import{g as z,j as ce}from"./chunk-XFA6UPZX.js";import{a as We,b as be,f as ln,g as dn,h as mn}from"./chunk-PSYDBHTH.js";import{h as At,i as Rt,j as Ge,k as Gt,l as Nt,m as Ut,o as Ht,p as qt,q as Le,r as re,w as Kt,y as Ue}from"./chunk-W4U7QKJF.js";import{a as _e}from"./chunk-AVBHFGIF.js";import{$a as a,$b as Ot,Ab as G,Ad as oe,B as ht,Bb as Y,C as Ct,Cb as Q,Cd as ot,D as tt,Db as ue,Eb as ke,F as O,Fb as ne,Ga as D,Gb as $t,H as Be,Hd as Ne,Id as $e,Jb as p,K as _t,Kb as m,L as vt,Lb as U,M as E,Md as Wt,N as nt,Na as L,O as je,Od as K,P as T,Pd as V,Qa as x,R as q,Ra as J,Rd as Qt,Sa as Pt,Ta as Ve,Tc as Bt,Va as k,X as R,Xa as St,Xb as Dt,Ya as B,Za as j,_,_a as c,a as le,ab as W,b as de,cc as ie,cd as H,da as bt,dc as ge,ea as v,eb as S,f as $,fa as b,fd as jt,g as me,gb as C,h as we,hb as f,ia as yt,id as Vt,jc as it,jd as fe,kd as he,l as Z,lb as X,lc as Fe,ma as te,md as Ft,n as u,nb as xt,nd as Ce,o as M,ob as It,pb as wt,qb as Mt,rb as d,s as Me,sb as I,tb as y,u as ft,ub as Tt,vb as kt,w as ee,wb as Lt,wc as Ae,x as Te,xa as s,xc as Et,ya as h,zc as Re}from"./chunk-2W7IS4PN.js";function xn(n,r){return+z(n)<+z(r)}function In(n,r){return+z(n)==+z(r)}function wn(n,r,e){let t=+z(n,e?.in),[i,o]=[+z(r.start,e?.in),+z(r.end,e?.in)].sort((l,g)=>l-g);return t>=i&&t<=o}function Mn(n,r,e){let t=r.map(o=>({eventId:o,group:n})),i=e.map(o=>t.find(l=>l.eventId===o.eventId)||o);return[...new Set([...i,...t])].filter(o=>o.group!==null)}var Ke=(()=>{class n extends nn{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=yt(n)))(i||n)}})()}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();function Tn(n,r){return[...n].sort(oi(r))}function oi(n){return(r,e)=>{switch(n.primarySortKey){case"name":{let t=r.name.localeCompare(e.name);return n.ascending?t*-1:t}case"group":{let t=(r.detail.Value||"").localeCompare(e.detail.Value||"");return n.ascending?t*-1:t}}}}function kn(n,r){return n.map(e=>ri(e,r))}function ri(n,r){return{id:n.IdPerson,name:r.find(e=>e.StudentRef.Id===n.IdPerson)?.StudentFullName||"",group:n.Value,detail:n}}function Ln(n,r){return n.filter(e=>e.VssId===r.subscriptionDetailGroupId)}function pt(n,r){return n.find(e=>e.VssId===r.subscriptionDetailGroupId)}var si=(n,r)=>r.id;function ci(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),a(),c(2,"label",6),d(3),a()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","group-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),X("for","group-",t,""),s(),y(" ",e.label," ")}}var De=function(n){return n.Select="select",n.Assign="assign",n}(De||{}),$n=(()=>{class n{constructor(e,t){this.activeModal=e,this.translate=t,this.groupOptions=[]}ngOnInit(){this.title=`presence-control.groups.${this.dialogMode}.title`;let e=this.createEmtpyOption();this.groupOptions=this.createGroupOptions(this.subscriptionDetailsDefinitions),this.groupOptions.unshift(e),this.selected=this.groupOptions.find(t=>t.id===this.group)||e}createEmtpyOption(){let e=this.dialogMode===De.Select?"presence-control.groups.all":"presence-control.groups.none";return{id:null,label:this.translate.instant(e)}}createGroupOptions(e){return e.DropdownItems?e.DropdownItems.map(t=>({id:t.Key,label:`${this.translate.instant("presence-control.groups.group")} ${t.Value}`})):[]}getSelectedGroup(){return this.selected}onSelectionChange(e){this.selected=e}static{this.\u0275fac=function(t){return new(t||n)(h(re),h(K))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-group-dialog"]],inputs:{dialogMode:"dialogMode",subscriptionDetailsDefinitions:"subscriptionDetailsDefinitions",group:"group"},decls:14,vars:9,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["type","radio","name","groups",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,ci,4,7,"div",1,si),a()(),c(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),a(),c(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedGroup())}),d(12),p(13,"translate"),a()()),t&2&&(s(2),y(" ",m(3,3,i.title)," "),s(3),j(i.groupOptions),s(4),y(" ",m(10,5,"presence-control.groups.cancel")," "),s(3),y(" ",m(13,7,"presence-control.groups.save")," "))},dependencies:[oe,Ce,fe,he,V],encapsulation:2})}}return n})();function Dn(n,r){return n===null&&r===null||n!==null&&r!==null&&n.TeacherInformation===r.TeacherInformation&&n.LessonDateTimeFrom.getTime()===r.LessonDateTimeFrom.getTime()&&n.LessonDateTimeTo.getTime()===r.LessonDateTimeTo.getTime()}function On(n){let r=new dt(n.TeacherInformation,n.LessonDateTimeFrom,n.LessonDateTimeTo);return r.addLesson(n),r}var dt=class{constructor(r,e,t){this.TeacherInformation=r,this.LessonDateTimeFrom=e,this.LessonDateTimeTo=t,this.lessons=[]}addLesson(r){this.lessons.some(e=>qe(e,r))||(this.lessons.push(r),this.updateId(),this.updateStudyClassNumbers(),this.updateEventDesignations())}getIds(){return[...new Set(this.lessons.map(r=>r.LessonRef.Id))]}getEventIds(){return[...new Set(this.lessons.map(r=>r.EventRef.Id))]}updateId(){this.id=[...new Set(this.lessons.map(r=>r.LessonRef.Id).sort())].join("-")}updateStudyClassNumbers(){this.studyClassNumbers=[...new Set(this.lessons.map(r=>r.StudyClassNumber).sort((r,e)=>r.localeCompare(e)))].join(", ")}updateEventDesignations(){this.eventDesignations=[...new Set(this.lessons.map(r=>r.EventDesignation).sort())].join(", ")}};function En(n){return ai(n).reduce((r,e)=>{let t=r.find(o=>Dn(o,e));if(t)return t.addLesson(e),r;let i=On(e);return[...r,i]},[]).sort(rt)}function Bn(n){if(n.length===0)return null;let r=new Date;if(n=[...n].sort(rt),Xt(r,n[0].LessonDateTimeFrom)){for(let e of n)if(xn(r,e.LessonDateTimeFrom)||wn(r,{start:e.LessonDateTimeFrom,end:e.LessonDateTimeTo}))return e;return n[n.length-1]}return n[0]}function ai(n){return n.reduce((r,e)=>r.some(t=>qe(t,e))?r:[...r,e],[])}function jn(n,r,e,t){return n.map(i=>{let o=r.find(l=>pi(l.presence,i));if(o){let l;return!o.newPresenceTypeId&&i.Comment?l=e.find(g=>g.IsComment)||null:l=e.find(g=>g.Id===o.newPresenceTypeId)||null,de(le({},i),{TypeRef:li(l),Date:null,Type:l?l.Designation:null,ConfirmationStateId:He(l,t)})}return i})}function pi(n,r){return n.LessonRef.Id===r.LessonRef.Id&&n.StudentRef.Id===r.StudentRef.Id}function li(n){return{Id:n?n.Id:null,HRef:null}}function Xe(n){return r=>r.reduce((e,t)=>e+(t.presenceCategory===n?1:0),0)}function Vn(){return n=>n.reduce((r,e)=>r+(e.precedingAbsences&&e.precedingAbsences.length>0?1:0),0)}var Fn=(()=>{class n extends We{constructor(e,t){super(e,t,at,"LessonTeachers")}loadOtherTeachersLessonAbsences(e,t,i){let o=`${this.baseUrl}/except/${e}/LessonAbsences?expand=LessonRef`;return t&&t.length>0&&(o=o.concat("&filter.StudentRef=;"+t.join(";"))),this.http.get(o,{params:i}).pipe(T(Wt(at)))}static{this.\u0275fac=function(t){return new(t||n)(_(Fe),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Ye=(()=>{class n extends We{constructor(e,t){super(e,t,gn,"SubscriptionDetails")}getListForEvent(e){return this.getList({params:{IdEvent:String(e)}})}update(e,t){let i={IdPerson:t.IdPerson,EventId:t.EventId,Value:e};return this.http.put(`${this.baseUrl}/${t.Id}`,i).pipe(u(()=>{}))}static{this.\u0275fac=function(t){return new(t||n)(_(Fe),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Rn="presence-control-group",ae=(()=>{class n{constructor(e,t,i,o,l){this.userSettings=e,this.eventService=t,this.subscriptionDetailsService=i,this.loadingService=o,this.settings=l,this.selectGroup$=new $,this.selectedLesson$=new we,this.lessonPresences$=new we,this.reloadSubscriptionDetails$=new $,this.defaultGroup=null,this.savedGroup$=this.selectedLesson$.pipe(T(g=>this.userSettings.getPresenceControlGroupView().pipe(u(w=>this.findGroupByLesson(w,g))))),this.group$=ee(this.selectGroup$,this.savedGroup$).pipe(je(this.defaultGroup),E(1)),this.loading$=this.loadingService.loading(Rn),this.subscriptionDetailsDefinitions$=this.selectedLesson$.pipe(u(g=>g?.getEventIds()||[]),T(g=>Me(g.map(w=>this.eventService.getSubscriptionDetailsDefinitions(w)))),E(1)),this.groupsAvailability$=this.subscriptionDetailsDefinitions$.pipe(u(g=>g.every(w=>pt(w,this.settings))),E(1)),this.subscriptionDetails$=M([this.selectedLesson$,this.groupsAvailability$,this.reloadSubscriptionDetails$.pipe(u(()=>!1),je(!0))]).pipe(T(([g,w,F])=>g&&w?this.loadSubscriptionDetailsForLesson(g,F):Z([])),u(g=>Ln(g,this.settings)),E(1)),this.subscriptionDetailPersonIds$=M([this.group$,this.subscriptionDetails$]).pipe(u(([g,w])=>w.filter(F=>F.Value===g).map(F=>F.IdPerson)),je([]))}selectGroup(e){this.selectGroup$.next(e)}setSelectedLesson(e){this.selectedLesson$.next(e)}setLessonPresences(e){this.lessonPresences$.next(e)}getSubscriptionDetailsDefinitions(){return this.subscriptionDetailsDefinitions$.pipe(u(ot),u(e=>pt(e,this.settings)))}getSubscriptionDetailsForStudents(){return M([this.subscriptionDetails$,this.lessonPresences$]).pipe(u(se(kn)))}reloadSubscriptionDetails(){this.reloadSubscriptionDetails$.next(void 0)}loadSubscriptionDetailsForLesson(e,t=!0){return this.loadingService.load(Me($e(e.getEventIds()).map(i=>this.subscriptionDetailsService.getListForEvent(i))),t?void 0:Rn).pipe(u(ot))}findGroupByLesson(e,t){return e.find(o=>o.eventId===t?.getEventIds()[0])?.group||this.defaultGroup}static{this.\u0275fac=function(t){return new(t||n)(_(Pe),_(bn),_(Ye),_(ce),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var Un=Object.values(pe),N=(()=>{class n{constructor(e,t,i,o,l,g,w,F,Se,xe){this.userSettings=e,this.lessonPresencesService=t,this.lessonTeacherService=i,this.presenceTypesService=o,this.groupService=l,this.dropDownItemsService=g,this.loadingService=w,this.storageService=F,this.settings=Se,this.location=xe,this.selectedDateSubject$=new me(new Date),this.selectedDate$=this.selectedDateSubject$.asObservable().pipe(u(P=>Jt(P)),Be(Ne)),this.viewModeSubject$=new $,this.viewMode$=ee(this.viewModeSubject$,this.userSettings.getPresenceControlViewMode().pipe(O(1))),this.lessons$=this.selectedDate$.pipe(T(P=>this.loadLessonsByDate(P)),E(1)),this.selectLessonId$=new $,this.selectLesson$=this.selectLessonId$.pipe(T(P=>this.getLessonById(P))),this.selectedLesson$=M([ln(this.selectLesson$.pipe(Be((P,Ie)=>Ne(P,Ie))),dn(this.settings.lessonPresencesRefreshTime)),this.lessons$]).pipe(u(([P,Ie])=>Ie.find(ni=>ni.id===P.id)?P:null),E(1)),this.studyClassCount$=this.selectedLesson$.pipe(u(P=>P?.lessons.length||0)),this.updateLessonPresences$=new $,this.reloadLessonPresences$=new $,this.lessonPresences$=ee(mn(this.selectedLesson$,this.reloadLessonPresences$).pipe(T(P=>P?this.loadLessonPresencesByLesson(P):Z([]))),this.updateLessonPresences$).pipe(E(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(E(1)),this.reloadStudentIdsWithUnconfirmedAbsences$=new $,this.studentIdsWithUnconfirmedAbsences$=ee(this.selectedDate$,this.selectedLesson$.pipe(nt(1)),this.reloadStudentIdsWithUnconfirmedAbsences$).pipe(T(()=>this.loadStudentIdsWithUnconfirmedAbsences()),E(1)),this.loading$=this.loadingService.loading$,this.absenceConfirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(E(1)),this.studentIds$=this.lessonPresences$.pipe(u(P=>$e(P.map(Ie=>Ie.StudentRef.Id))),E(1)),this.otherTeachersAbsences$=this.studentIds$.pipe(Be(Ne),T(P=>P.length>0?this.lessonTeacherService.loadOtherTeachersLessonAbsences(this.getMyself(),P):Z([])),E(1)),this.groupsAvailability$=this.groupService.groupsAvailability$,this.presenceControlEntries$=M([this.selectedLesson$,this.lessonPresences$,this.presenceTypes$,this.absenceConfirmationStates$,this.otherTeachersAbsences$]).pipe(u(se(en))),this.presenceControlEntriesByGroup$=M([this.groupService.group$,this.presenceControlEntries$,this.groupService.subscriptionDetailPersonIds$]).pipe(u(se(Pn)),E(1)),this.presentCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("present"))),this.absentCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("absent"))),this.unapprovedCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("unapproved"))),this.absentPrecedingCount$=this.presenceControlEntriesByGroup$.pipe(u(Vn())),this.queryParamsString$=M([this.selectedDate$,this.selectedLesson$,this.viewMode$]).pipe(u(se(this.buildQueryParams.bind(this))),u(pn)),this.destroy$=new $,this.queryParamsString$.pipe(q(this.destroy$)).subscribe(P=>{this.location.replaceState("/presence-control",P),this.confirmBackLinkParams={returnparams:P}}),this.viewMode$.pipe(nt(1),T(P=>this.userSettings.savePresenceControlViewMode(P)),q(this.destroy$)).subscribe(),this.selectedLesson$.pipe(q(this.destroy$)).subscribe(P=>{this.groupService.setSelectedLesson(P)}),this.lessonPresences$.pipe(q(this.destroy$)).subscribe(P=>this.groupService.setLessonPresences(P))}ngOnDestroy(){this.destroy$.next()}setDate(e){this.selectedDateSubject$.next(e)}setLessonId(e){this.selectLessonId$.next(e)}setViewMode(e){this.viewModeSubject$.next(e)}updateLessonPresencesTypes(e){M([this.lessonPresences$.pipe(O(1)),this.presenceTypes$.pipe(O(1))]).pipe(u(([t,i])=>jn(t,e,i,this.settings))).subscribe(t=>this.updateLessonPresences$.next(t))}getNextPresenceType(e){return this.presenceTypes$.pipe(O(1),u(t=>e.getNextPresenceType(t)))}hasUnconfirmedAbsences(e){return this.studentIdsWithUnconfirmedAbsences$.pipe(u(t=>t.includes(e.lessonPresence.StudentRef.Id)))}updateAfterConfirm(){this.reloadLessonPresences$.next(),this.reloadStudentIdsWithUnconfirmedAbsences$.next()}loadLessonPresencesByLesson(e){return this.loadingService.load(this.lessonPresencesService.getListByLessons(e.lessons))}loadLessonsByDate(e){return this.loadingService.load(this.lessonPresencesService.getLessonsByDate(e)).pipe(u(En))}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.presenceTypes$)}loadStudentIdsWithUnconfirmedAbsences(){return ft(0,this.settings.unconfirmedAbsencesRefreshTime||-1).pipe(T(()=>this.lessonPresencesService.getListOfUnconfirmed()),u(e=>$e(e.map(t=>t.StudentRef.Id))))}buildQueryParams(e,t,i){let o={date:Yt(e,"yyyy-MM-dd"),viewMode:i};return t&&(o.lesson=String(t.id)),o}getLessonById(e){let t=String(e);return this.lessons$.pipe(u(i=>t&&i.find(o=>o.id===t)||Bn(i)),Te(Boolean))}getMyself(){let e=this.storageService.getPayload();return Number(e?.holder_id||e?.id_person)}static{this.\u0275fac=function(t){return new(t||n)(_(Pe),_(Qe),_(Fn),_(ve),_(ae),_(rn),_(ce),_(Qt),_(H),_(Dt))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var fi=(n,r)=>r.id,hi=()=>[],Ci=()=>["/presence-control"];function _i(n,r){if(n&1&&(c(0,"span",12),d(1),a()),n&2){let e=f().$implicit,t=f(),i=Q(0);s(),I(t.getSortDirectionCharacter(i,e))}}function vi(n,r){if(n&1){let e=S();c(0,"div",11),C("click",function(){let i=v(e).$implicit,o=f();return b(o.toggleSort(i))}),d(1),p(2,"translate"),L(3,_i,2,1,"span",12),a()}if(n&2){let e=r.$implicit;f();let t=Q(0);x("className",e),s(),y(" ",m(2,3,"presence-control.groups.list.header."+e)," "),s(2),k(t?3:-1)}}function bi(n,r){n&1&&W(0,"bkd-spinner")}function yi(n,r){n&1&&W(0,"bkd-spinner",18)}function Pi(n,r){if(n&1){let e=S();c(0,"div",13)(1,"div",14)(2,"input",15,0),p(4,"async"),C("change",function(){let i=v(e).$implicit,o=f(2);return b(o.selectionService.toggle(i))}),a()(),c(5,"div",16),d(6),a(),c(7,"div",17)(8,"span"),d(9),a(),L(10,yi,1,0,"bkd-spinner",18),p(11,"async"),a()()}if(n&2){let e=r.$implicit,t=f(2);s(2),x("checked",m(4,4,t.selectionService.isSelected$(e))),s(4),y(" ",e.name," "),s(3),I(e.group?e.group:""),s(),k(m(11,6,t.groupService.loading$)?10:-1)}}function Si(n,r){if(n&1&&B(0,Pi,12,8,"div",13,fi),n&2){f();let e=Q(2);j(e)}}var Wn=(()=>{class n{constructor(e,t,i,o,l,g,w,F,Se){this.route=e,this.state=t,this.selectionService=i,this.groupService=o,this.userSettings=l,this.subscriptionDetailService=g,this.toastService=w,this.translate=F,this.modalService=Se,this.primarySortKeys=["name","group"],this.backlinkQueryParams$=this.route.queryParams.pipe(u(({returnparams:xe})=>xe),u(an)),this.eventIds$=this.state.selectedLesson$.pipe(u(xe=>xe?.getEventIds()||[])),this.sortCriteriaSubject$=new me({primarySortKey:"name",ascending:!1}),this.sortCriteria$=this.sortCriteriaSubject$.asObservable(),this.sortedEntries$=M([this.groupService.getSubscriptionDetailsForStudents(),this.sortCriteria$]).pipe(u(se(Tn))),this.selected=[]}ngOnInit(){this.selectionService.selection$.subscribe(e=>this.selected=e)}selectGroup(){this.openGroupModal(De.Select,this.selectCallback.bind(this))}assignGroup(){this.openGroupModal(De.Assign,this.assignCallback.bind(this))}openGroupModal(e,t){M([this.groupService.getSubscriptionDetailsDefinitions(),this.groupService.group$]).pipe(O(1)).subscribe(([i,o])=>{let l=this.modalService.open($n);l.componentInstance.dialogMode=e,l.componentInstance.subscriptionDetailsDefinitions=i,l.componentInstance.group=o,l.result.then(g=>{t(g)},()=>{})})}selectCallback(e){M([this.eventIds$,this.userSettings.getPresenceControlGroupView()]).pipe(O(1),T(([t,i])=>this.userSettings.savePresenceControlGroupView(Mn(e.id,t,i))),u(()=>e.id)).subscribe(t=>this.groupService.selectGroup(t))}assignCallback(e){Me(this.selected.map(t=>this.subscriptionDetailService.update(e.id,t.detail))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.groupService.reloadSubscriptionDetails(),this.selectionService.clear(),this.toastService.success(this.translate.instant("presence-control.groups.notifications.save-success"))}getSortDirectionCharacter(e,t){return e.primarySortKey!==t?"":e.ascending?"\u2193":"\u2191"}toggleSort(e){this.sortCriteriaSubject$.pipe(O(1)).subscribe(t=>{t.primarySortKey===e?this.sortCriteriaSubject$.next({primarySortKey:e,ascending:!t.ascending}):this.sortCriteriaSubject$.next({primarySortKey:e,ascending:e==="name"})})}static{this.\u0275fac=function(t){return new(t||n)(h(Ae),h(N),h(Ke),h(ae),h(Pe),h(Ye),h(_e),h(K),h(ye))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-group"]],features:[ue([Ke])],decls:33,vars:32,consts:[["checkbox",""],[3,"link","params"],[1,"group-header","mb-2","d-flex","justify-content-between"],[1,"d-flex","align-items-baseline"],[1,"ps-3"],["type","button",1,"show","btn","btn-link",3,"click"],["aria-label","edit",1,"btn","btn-primary","btn-icon","me-2",3,"click"],[1,"material-icons"],[1,"group-list"],[1,"group-list-header"],[3,"className"],[3,"click","className"],[1,"sort-direction"],[1,"group-list-entry"],[1,"checkbox"],["type","checkbox",1,"form-check-input",3,"change","checked"],[1,"name","pe-2"],[1,"group","d-flex","justify-content-between"],[1,"inline","small"]],template:function(t,i){if(t&1){let o=S();G(0),p(1,"async"),G(2),p(3,"async"),G(4),p(5,"async"),G(6),p(7,"async"),c(8,"div"),W(9,"bkd-backlink",1),p(10,"async"),c(11,"h1"),d(12),p(13,"translate"),a(),c(14,"div",2)(15,"div",3)(16,"span",4),d(17),p(18,"translate"),a(),c(19,"button",5),C("click",function(){return v(o),b(i.selectGroup())}),d(20),p(21,"translate"),p(22,"translate"),a()(),c(23,"a",6),C("click",function(){return v(o),b(i.assignGroup())}),c(24,"i",7),d(25,"edit"),a()()(),c(26,"div",8)(27,"div",9),B(28,vi,4,5,"div",10,St),a(),L(30,bi,1,0,"bkd-spinner"),p(31,"async"),L(32,Si,2,0),a()()}if(t&2){let o;Y(m(1,8,i.sortCriteria$)),s(2),Y(m(3,11,i.sortedEntries$));let l=(o=m(5,14,i.selectionService.selection$))!==null&&o!==void 0?o:ke(30,hi),g=m(7,16,i.groupService.group$);s(7),x("link",ke(31,Ci))("params",m(10,18,i.backlinkQueryParams$)),s(3),I(m(13,20,"presence-control.groups.title")),s(5),I(m(18,22,"presence-control.groups.show")),s(3),y(" ",g?m(21,24,"presence-control.groups.group")+" "+g:m(22,26,"presence-control.groups.all")," "),s(3),J("disabled",l.length===0),s(5),j(i.primarySortKeys),s(2),k(m(31,28,i.state.loading$)?30:32)}},dependencies:[hn,be,ie,V],styles:['[_nghost-%COMP%]{display:block}.group-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#000;font-weight:300;text-decoration:underline;padding-left:.5rem}.group-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.group-list-header[_ngcontent-%COMP%]{cursor:pointer;padding:1rem;display:grid;grid-template-areas:"name group";grid-template-columns:3fr 2fr;border-top:1px solid #dee2e6;border-bottom:2px solid #dee2e6}.group-list-entry[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid #dee2e6;display:grid;grid-template-areas:"checkbox name group";grid-template-columns:min-content 3fr 2fr}.checkbox[_ngcontent-%COMP%]{grid-area:checkbox;margin:0;padding:.3rem 1rem 0 0}.checkbox[_ngcontent-%COMP%] input.form-check-input[_ngcontent-%COMP%]{position:static!important;margin:0!important;display:block}.name[_ngcontent-%COMP%]{grid-area:name;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.group[_ngcontent-%COMP%]{grid-area:group}@media (max-width: 750px){.group-list[_ngcontent-%COMP%]{padding-left:0;padding-right:0}.group-list-header[_ngcontent-%COMP%]{grid-template-columns:3fr 1fr}.group-list-entry[_ngcontent-%COMP%]{grid-template-columns:min-content 3fr 1fr}}'],changeDetection:0})}}return n})();var xi=(n,r)=>r.entry.id;function Ii(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit;return b(i.selected=!i.selected)}),a(),c(2,"label",6)(3,"i"),d(4),a(),c(5,"div",7),d(6),p(7,"date"),p(8,"date"),a()()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","lesson-presence-",t,""),x("checked",e.selected),s(),J("fw-bold",i.isCurrentLesson(e)),X("for","lesson-presence-",t,""),s(),Ve("",e.entry.presenceCategory," material-icons pe-2"),s(),I(e.entry.presenceCategoryIcon),s(2),kt(" ",U(7,14,e.entry.lessonPresence.LessonDateTimeFrom,"HH:mm"),"\u2013",U(8,17,e.entry.lessonPresence.LessonDateTimeTo,"HH:mm")," ",e.entry.lessonPresence.EventDesignation," ")}}var Qn=(()=>{class n{constructor(e){this.activeModal=e,this.blockLessonOptions=[]}ngOnInit(){this.blockLessonOptions=this.buildLessonPresenceOptions()}getSelectedEntries(){return this.blockLessonOptions.filter(({selected:e})=>e).map(({entry:e})=>e)}isCurrentLesson(e){return In(e.entry.lessonPresence.LessonDateTimeFrom,this.entry.lessonPresence.LessonDateTimeFrom)}buildLessonPresenceOptions(){return this.blockPresenceControlEntries.map(e=>({entry:e,selected:this.entry.confirmationState===e.confirmationState}))}static{this.\u0275fac=function(t){return new(t||n)(h(re))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-block-lesson-component"]],inputs:{entry:"entry",blockPresenceControlEntries:"blockPresenceControlEntries"},decls:15,vars:11,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"],["type","checkbox",1,"form-check-input",3,"change","id","checked"],[1,"form-check-label","d-flex",3,"for"],[1,"d-block","text-truncate"]],template:function(t,i){if(t&1){let o=S();c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,Ii,9,20,"div",1,xi),a()(),G(7),c(8,"div",2)(9,"button",3),C("click",function(){return v(o),b(i.activeModal.close())}),d(10),p(11,"translate"),a(),c(12,"button",4),C("click",function(){v(o);let g=Q(7);return b(i.activeModal.close(g))}),d(13),p(14,"translate"),a()()}if(t&2){s(2),y(" ",m(3,4,"presence-control.block-lesson.text")," "),s(3),j(i.blockLessonOptions),s(2);let o=Y(i.getSelectedEntries());s(3),y(" ",m(11,7,"presence-control.block-lesson.cancel")," "),s(2),x("disabled",o.length===0),s(),y(" ",m(14,9,"presence-control.block-lesson.save")," ")}},dependencies:[oe,Ce,fe,he,ge,V],styles:[".checkbox[_ngcontent-%COMP%] input.form-check-input[_ngcontent-%COMP%]{position:static!important;margin:0!important;display:block}.absent[_ngcontent-%COMP%]{color:#ea161f}.present[_ngcontent-%COMP%]{color:#3d8608}.unapproved[_ngcontent-%COMP%]{color:#ffa814}"]})}}return n})();var wi=30;function gt(n){return`blockLesson${n.lessonPresence.Id}`}var Ze=(()=>{class n{constructor(e,t,i,o){this.state=e,this.lessonPresencesService=t,this.loadingService=i,this.settings=o}getBlockLessonPresenceControlEntries(e){return M([this.state.lessons$.pipe(O(1)),this.loadChangeableLessonPresences(e),this.state.presenceTypes$.pipe(O(1)),this.state.absenceConfirmationStates$.pipe(O(1)),this.state.otherTeachersAbsences$.pipe(O(1))]).pipe(u(([t,i,o,l,g])=>this.filterBlockLessonPresences(e,i).map(w=>tn(t.find(F=>F.id===w.LessonRef.Id.toString()),w,o,l,g))))}filterBlockLessonPresences(e,t){return[...t].sort((i,o)=>i.LessonDateTimeFrom>o.LessonDateTimeFrom?1:-1).reduce((i,o)=>{let l=i[i.length-1];return this.isWithinBlockTime(o,l)?(i.push(o),i):i.find(g=>g.Id===e.lessonPresence.Id)?i:[o]},[])}isWithinBlockTime(e,t){return t?e.LessonDateTimeFrom.getTime()-t.LessonDateTimeTo.getTime()<=wi*60*1e3:!0}loadChangeableLessonPresences(e){return M([this.loadLessonPresences(e),this.state.presenceTypes$.pipe(O(1))]).pipe(u(([t,i])=>t.filter(o=>Zt(o,i.find(l=>l.Id===o.TypeRef.Id)||null,this.settings))))}loadLessonPresences(e){return this.loadingService.load(this.lessonPresencesService.getListByDateStudentClass(e.lessonPresence.LessonDateTimeFrom,e.lessonPresence.StudentRef.Id,e.lessonPresence.StudyClassRef.Id??void 0).pipe(u(t=>t.filter(i=>i.TeacherInformation===e.lessonPresence.TeacherInformation))),gt(e))}static{this.\u0275fac=function(t){return new(t||n)(_(N),_(Qe),_(ce),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var Ti=(n,r)=>r.Id;function ki(n,r){if(n&1&&(c(0,"div"),d(1),p(2,"date"),p(3,"date"),p(4,"addSpace"),a()),n&2){let e=r.$implicit;s(),Lt(" ",U(2,5,e.LessonRef.From,"HH:mm"),"\u2013",U(3,8,e.LessonRef.To,"HH:mm")," ",e.LessonRef.EventDesignation,"",U(4,11,":",":")," ",e.Type," ")}}var Kn=(()=>{class n{constructor(e){this.activeModal=e}static{this.\u0275fac=function(t){return new(t||n)(h(re))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-preceding-absence"]],inputs:{precedingAbsences:"precedingAbsences"},decls:10,vars:6,consts:[[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),B(4,ki,5,14,"div",null,Ti),a(),c(6,"div",1)(7,"button",2),C("click",function(){return i.activeModal.dismiss()}),d(8),p(9,"translate"),a()()),t&2&&(s(2),y(" ",m(3,2,"presence-control.preceding-absence.text")," "),s(2),j(i.precedingAbsences),s(4),y(" ",m(9,4,"presence-control.preceding-absence.cancel")," "))},dependencies:[ge,V,un],encapsulation:2})}}return n})();var Li=n=>["student",n,"absences"],$i=n=>["/presence-control/student",n,"absences"];function Di(n,r){if(n&1&&(W(0,"bkd-avatar",0),p(1,"async")),n&2){let e=f();x("studentId",m(1,3,e.studentId$))("link",ne(5,$i,e.entry.lessonPresence.StudentRef.Id.toString()))("linkParams",e.profileReturnParams)}}function Oi(n,r){if(n&1&&(c(0,"span"),d(1),a()),n&2){let e=f(2);s(),I(e.entry.presenceType==null?null:e.entry.presenceType.Designation)}}function Ei(n,r){if(n&1){let e=S();c(0,"button",12),C("click",function(){v(e);let i=f();return b(i.updatePresenceType(i.entry))}),L(1,Oi,2,1,"span"),a()}if(n&2){let e=f();s(),k(e.entry.presenceType!=null&&e.entry.presenceType.IsIncident?-1:1)}}function Bi(n,r){n&1&&W(0,"bkd-spinner",5)}function ji(n,r){if(n&1){let e=S();c(0,"button",13),C("click",function(){v(e);let i=f();return b(i.showPrecedingAbsences(i.entry))}),c(1,"i",14),d(2,"info"),a()()}}function Vi(n,r){if(n&1&&(c(0,"span",9),d(1),a()),n&2){let e=f();s(),y(" ",e.entry.lessonPresence.StudyClassNumber," ")}}function Fi(n,r){if(n&1){let e=S();c(0,"a",15),C("click",function(){v(e);let i=f();return b(i.updateIncident(i.entry))}),c(1,"i",4),d(2,"edit"),a(),c(3,"span"),d(4),p(5,"translate"),a()()}if(n&2){let e=f();s(4),I(m(5,1,(e.entry.presenceType==null?null:e.entry.presenceType.IsIncident)&&(e.entry.presenceType==null?null:e.entry.presenceType.Designation)||"presence-control.entry.incident"))}}var zn=(()=>{class n{get classNames(){return[this.entry.presenceCategory,this.viewMode].join(" ")}constructor(e,t,i,o){this.toastService=e,this.translate=t,this.modalService=i,this.loadingService=o,this.hasUnconfirmedAbsences=!1,this.showClassName=!1,this.togglePresenceType=new te,this.changeIncident=new te,this.entry$=new we(1),this.studentId$=this.entry$.pipe(u(({lessonPresence:l})=>l.StudentRef.Id)),this.loading$=this.entry$.pipe(T(l=>this.loadingService.loading(gt(l))))}ngOnChanges(e){e.entry&&this.entry$.next(e.entry.currentValue)}get isListViewMode(){return this.viewMode===pe.List}updatePresenceType(e){e.canChangePresenceType?this.togglePresenceType.emit(e):this.toastService.warning(this.translate.instant("presence-control.entry.update-warning"))}updateIncident(e){e.canChangeIncident&&this.changeIncident.emit(e)}showPrecedingAbsences(e){let t=this.modalService.open(Kn);t.componentInstance.precedingAbsences=e.precedingAbsences}static{this.\u0275fac=function(t){return new(t||n)(h(_e),h(K),h(ye),h(ce))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-entry"]],hostVars:2,hostBindings:function(t,i){t&2&&Pt(i.classNames)},inputs:{entry:"entry",hasUnconfirmedAbsences:"hasUnconfirmedAbsences",viewMode:"viewMode",showClassName:"showClassName",profileReturnParams:"profileReturnParams"},outputs:{togglePresenceType:"togglePresenceType",changeIncident:"changeIncident"},features:[bt],decls:18,vars:20,consts:[[1,"avatar","large",3,"studentId","link","linkParams"],["type","button",1,"presence-category","designation","btn","btn-link"],["type","button",1,"presence-category","status","btn","btn-link",3,"click","disabled"],[1,"position-relative"],[1,"material-icons"],[1,"inline","small"],["type","button",1,"previously-absent","d-flex","btn","btn-link"],[1,"student-info",3,"routerLink","queryParams"],[1,"student-name","text-truncate"],[1,"study-class","text-truncate"],[1,"unconfirmed-absences"],[1,"incident","btn","btn-link"],["type","button",1,"presence-category","designation","btn","btn-link",3,"click"],["type","button",1,"previously-absent","d-flex","btn","btn-link",3,"click"],[1,"material-icons-outlined"],[1,"incident","btn","btn-link",3,"click"]],template:function(t,i){if(t&1){let o=S();L(0,Di,2,7,"bkd-avatar",0)(1,Ei,2,1,"button",1),G(2),p(3,"async"),c(4,"button",2),C("click",function(){return v(o),b(i.updatePresenceType(i.entry))}),c(5,"div",3)(6,"i",4),d(7),a(),L(8,Bi,1,0,"bkd-spinner",5),a()(),L(9,ji,3,0,"button",6),c(10,"a",7)(11,"span",8),d(12),a(),L(13,Vi,2,1,"span",9),c(14,"span",10),d(15),p(16,"translate"),a()(),L(17,Fi,6,3,"a",11)}if(t&2){k(i.isListViewMode?-1:0),s(),k(i.entry.showDesignation?1:-1);let o=m(3,14,i.loading$);s(3),x("disabled",o),s(2),J("invisible",o),s(),I(i.entry.presenceCategoryIcon),s(),k(o?8:-1),s(),k(i.entry.precedingAbsences!=null&&i.entry.precedingAbsences.length?9:-1),s(),x("routerLink",ne(18,Li,i.entry.lessonPresence.StudentRef.Id))("queryParams",i.profileReturnParams),s(2),I(i.entry.lessonPresence.StudentFullName),s(),k(i.isListViewMode&&i.showClassName?13:-1),s(2),y(" ",i.hasUnconfirmedAbsences?m(16,16,"presence-control.entry.unconfirmed-absences"):""," "),s(2),k(i.entry.canChangeIncident?17:-1)}},dependencies:[fn,be,Re,ie,V],styles:['[_nghost-%COMP%]{padding:2rem 1rem;background-color:#fff;display:grid;grid-template-areas:"avatar status designation previously-absent" "avatar student-info student-info student-info" "avatar incident incident incident";grid-template-columns:min-content min-content 3fr min-content}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{align-self:center}.presence-category[_ngcontent-%COMP%]{text-decoration:none}.presence-category[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:.1875rem}.absent[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#ea161f}.present[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#3d8608}.unapproved[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#ffa814}.presence-category[_ngcontent-%COMP%] bkd-spinner[_ngcontent-%COMP%]{color:#000;position:absolute;top:4px;left:5px}.designation[_ngcontent-%COMP%], .student-info[_ngcontent-%COMP%], a.incident[_ngcontent-%COMP%], .incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.avatar[_ngcontent-%COMP%]{grid-area:avatar;margin-right:1.5rem}.status[_ngcontent-%COMP%]{grid-area:status}.status[_ngcontent-%COMP%] .material-icons[_ngcontent-%COMP%]{font-size:2rem}.designation[_ngcontent-%COMP%]{grid-area:designation;text-align:left;line-height:2.375rem}.previously-absent[_ngcontent-%COMP%]{grid-area:previously-absent;text-decoration:none;color:#00000080;justify-self:end}.student-info[_ngcontent-%COMP%]{grid-area:student-info;display:flex;flex-direction:column;text-decoration:none}.student-info[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{text-decoration:underline}.student-info[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.unconfirmed-absences[_ngcontent-%COMP%]{color:#ea161f;font-size:.875rem;line-height:1}.study-class[_ngcontent-%COMP%]{font-size:.875rem;line-height:1}.incident[_ngcontent-%COMP%]{color:#00000080;padding-right:1.5rem;grid-area:incident;display:flex;text-decoration:none}.incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.incident[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:.3em}.grid[_nghost-%COMP%] .status[_ngcontent-%COMP%], .grid[_nghost-%COMP%] .designation[_ngcontent-%COMP%]{align-self:start;margin-left:-1.5rem;margin-top:-.375rem}.grid[_nghost-%COMP%] .incident[_ngcontent-%COMP%]{align-self:end;margin-left:-1.5rem;margin-bottom:-.375rem}.grid[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{padding-right:0;align-self:start}.grid[_nghost-%COMP%] .unconfirmed-absences[_ngcontent-%COMP%]{height:.875rem}.list[_nghost-%COMP%]{grid-template-areas:"student-info status incidentordesignation previously-absent";grid-template-columns:3fr min-content 4fr 3em;padding:.5rem 1rem}.list[_nghost-%COMP%] .status[_ngcontent-%COMP%]{justify-self:start}.list[_nghost-%COMP%] .student-name[_ngcontent-%COMP%]{line-height:1;margin-bottom:.5rem}.list[_nghost-%COMP%] .incident[_ngcontent-%COMP%], .list[_nghost-%COMP%] .designation[_ngcontent-%COMP%]{grid-area:incidentordesignation}.list[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{padding-right:0}@media (max-width: 750px){.list[_nghost-%COMP%]{grid-template-areas:"student-info student-info student-info previously-absent" "status incidentordesignation incidentordesignation incidentordesignation";grid-template-columns:min-content 1fr 1fr min-content;row-gap:1rem}.list[_nghost-%COMP%] .status[_ngcontent-%COMP%]{padding-left:0;padding-right:0}.list[_nghost-%COMP%] .student-name[_ngcontent-%COMP%]{margin-top:.5rem}.list[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{align-self:start}}']})}}return n})();var Ai=(n,r)=>r.viewMode,Ri=(n,r)=>r.id,Gi=(n,r)=>({"btn-link":n,"btn-danger":r}),Ni=n=>["groups",n],Ui=n=>({returnparams:n});function Hi(n,r){if(n&1){let e=S();c(0,"div",22),C("click",function(){v(e);let i=f();return b(i.lessonDropdown==null?null:i.lessonDropdown.toggle())}),d(1),p(2,"date"),c(3,"span",23),d(4),p(5,"date"),a()()}if(n&2){let e=f();s(),y(" ",U(2,2,e.selectedLesson.LessonDateTimeFrom,"HH:mm"),"\u2013"),s(3),I(U(5,5,e.selectedLesson.LessonDateTimeTo,"HH:mm"))}}function qi(n,r){if(n&1){let e=S();c(0,"div",28),C("click",function(){let i=v(e).$implicit,o=f(2);return b(o.selectLessonChange.emit(i))}),c(1,"div",29)(2,"div"),d(3),p(4,"date"),p(5,"date"),a(),c(6,"div",25),d(7),a(),c(8,"div",25),d(9),a()()()}if(n&2){let e=r.$implicit,t=f(2);J("active",e.id===t.selectedLesson.id),s(3),Tt(" ",U(4,6,e.LessonDateTimeFrom,"HH:mm"),"\u2013",U(5,9,e.LessonDateTimeTo,"HH:mm")," "),s(4),y(" ",e.eventDesignations," "),s(2),y(" ",e.studyClassNumbers," ")}}function Wi(n,r){if(n&1&&(c(0,"div",7)(1,"div",24)(2,"div",25),d(3),a(),c(4,"div",25),d(5),a()(),c(6,"div",26),B(7,qi,10,12,"div",27,Ri),a()()),n&2){let e=f();s(3),I(e.selectedLesson.eventDesignations),s(2),I(e.selectedLesson.studyClassNumbers),s(2),j(e.lessons)}}function Qi(n,r){if(n&1){let e=S();c(0,"bkd-caret",30),C("click",function(){v(e);let i=f();return b(i.lessonDropdown==null?null:i.lessonDropdown.toggle())}),a()}if(n&2){let e=f();x("expanded",(e.lessonDropdown==null?null:e.lessonDropdown.isOpen())||!1)}}function Ki(n,r){if(n&1&&(c(0,"a",19),p(1,"async"),p(2,"async"),p(3,"async"),c(4,"i",31),d(5,"groups"),a()()),n&2){let e=f();x("ngClass",$t(9,Gi,m(1,3,e.isGroupSelected$)===!1,m(2,5,e.isGroupSelected$)))("routerLink",ne(12,Ni,e.selectedLesson.id))("queryParams",ne(14,Ui,m(3,7,e.state.queryParamsString$)))}}function zi(n,r){if(n&1){let e=S();c(0,"button",32),C("click",function(){let i=v(e).$implicit,o=f();return b(o.viewModeChange.emit(i.viewMode))}),c(1,"i",31),d(2),a()()}if(n&2){let e=r.$implicit,t=f();J("btn-outline-secondary",e.viewMode===t.viewMode)("btn-link",e.viewMode!==t.viewMode)("active",e.viewMode===t.viewMode),x("disabled",!t.selectedLesson),s(2),I(e.icon)}}var Ji=Le.prototype._positionMenu;Le.prototype._positionMenu=function(...r){let e=Ji.apply(this,r);if(this._anchor.nativeElement.id==="lesson-dropdown"){let t=this._bodyContainer||this._menu.nativeElement,i=t.style.transform?.match(/translate\(([0-9-.]+)px, ([0-9-.]+)px\)/);i&&parseFloat(i[1])<0&&(t.style.transform=`translate(0px, ${i[2]}px)`)}return e};var Jn=(()=>{class n{constructor(e,t,i){this.state=e,this.groupService=t,this.presentCount=null,this.absentCount=null,this.unapprovedCount=null,this.absentPrecedingCount=null,this.search="",this.selectLessonChange=new te,this.selectDateChange=new te,this.searchChange=new te,this.viewModeChange=new te,this.viewModeOptions=[{viewMode:pe.List,icon:"list"},{viewMode:pe.Grid,icon:"view_module"}],this.isGroupSelected$=this.groupService.group$.pipe(u(Kt)),i.popperOptions=o=>de(le({},o),{modifiers:o.modifiers?.map(l=>(l.name==="offset"&&(l.options={offset:({placement:g,reference:w,popper:F})=>g==="bottom-start"?[(window.innerWidth-F.width)/2-w.x,0]:[]}),l))})}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(ae),h(Ge))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-header"]],viewQuery:function(t,i){if(t&1&&xt(Le,5),t&2){let o;It(o=wt())&&(i.lessonDropdown=o.first)}},inputs:{selectedLesson:"selectedLesson",lessons:"lessons",presentCount:"presentCount",absentCount:"absentCount",unapprovedCount:"unapprovedCount",absentPrecedingCount:"absentPrecedingCount",viewMode:"viewMode",selectDate:"selectDate",search:"search"},outputs:{selectLessonChange:"selectLessonChange",selectDateChange:"selectDateChange",searchChange:"searchChange",viewModeChange:"viewModeChange"},features:[ue([Ge,{provide:At,useClass:Nt},{provide:Rt,useClass:yn}])],decls:41,vars:19,consts:[["d","ngbDatepicker"],[1,"navigation"],[1,"lesson-date"],["type","button",1,"btn","btn-link",3,"click"],[1,"material-icons"],["positionTarget",".lesson-date-input","ngbDatepicker","","placement","bottom-start",1,"lesson-date-input",3,"ngModelChange","ngModel"],[1,"lesson-time"],["ngbDropdown","","container","body","display","dynamic","placement","bottom",1,"lesson-description"],[1,"dropdown-caret",3,"expanded"],[1,"states"],[1,"state","present"],[1,"count"],[1,"state","absent"],[1,"state","unapproved"],[1,"state","previously-absent"],[1,"material-icons-outlined"],[1,"search-and-views"],[1,"search",3,"valueChange","value","disabled","placeholder","label"],[1,"group-and-views","d-flex","align-items-center"],["type","button",1,"group","btn","me-2","me-sm-4",3,"ngClass","routerLink","queryParams"],[1,"views"],["type","button",1,"view","btn","btn-primary","btn-icon",3,"disabled","btn-outline-secondary","btn-link","active"],[1,"lesson-time",3,"click"],[1,"lesson-time-to"],["id","lesson-dropdown","ngbDropdownToggle",""],[1,"text-truncate"],["ngbDropdownMenu","","aria-labelledby","lesson-dropdown"],["ngbDropdownItem","",3,"active"],["ngbDropdownItem","",3,"click"],[1,"lesson-entry"],[1,"dropdown-caret",3,"click","expanded"],[1,"material-icons","align-middle"],["type","button",1,"view","btn","btn-primary","btn-icon",3,"click","disabled"]],template:function(t,i){if(t&1){let o=S();c(0,"div",1)(1,"div",2)(2,"button",3),C("click",function(){v(o);let g=Mt(6);return b(g.toggle())}),c(3,"i",4),d(4,"calendar_today"),a()(),c(5,"input",5,0),C("ngModelChange",function(g){return v(o),b(i.selectDateChange.emit(g))}),a()(),L(7,Hi,6,8,"div",6)(8,Wi,9,2,"div",7)(9,Qi,1,1,"bkd-caret",8),a(),c(10,"div",9)(11,"div",10)(12,"i",4),d(13,"check_circle"),a(),c(14,"span",11),d(15),a()(),c(16,"div",12)(17,"i",4),d(18,"cancel"),a(),c(19,"span",11),d(20),a()(),c(21,"div",13)(22,"i",4),d(23,"help"),a(),c(24,"span",11),d(25),a()(),c(26,"div",14)(27,"i",15),d(28,"info"),a(),c(29,"span",11),d(30),a()()(),c(31,"div",16)(32,"bkd-resettable-input",17),p(33,"translate"),p(34,"translate"),C("valueChange",function(g){return v(o),b(i.searchChange.emit(g))}),a(),c(35,"div",18),L(36,Ki,6,16,"a",19),p(37,"async"),c(38,"div",20),B(39,zi,3,8,"button",21,Ai),a()()()}t&2&&(s(5),x("ngModel",i.selectDate),s(2),k(i.selectedLesson?7:-1),s(),k(i.selectedLesson?8:-1),s(),k(i.lessons.length>0?9:-1),s(6),I(i.presentCount!==null?i.presentCount:"?"),s(5),I(i.absentCount!==null?i.absentCount:"?"),s(5),I(i.unapprovedCount!==null?i.unapprovedCount:"?"),s(5),I(i.absentPrecedingCount!==null?i.absentPrecedingCount:"?"),s(2),x("value",i.search)("disabled",!i.selectedLesson)("placeholder",m(33,13,"presence-control.header.search-by-name"))("label",m(34,15,"presence-control.header.search")),s(4),k(m(37,17,i.selectedLesson&&i.state.groupsAvailability$)?36:-1),s(3),j(i.viewModeOptions))},dependencies:[Gt,oe,jt,Vt,Ft,Le,qt,Ht,Ut,cn,_n,Ot,Re,ie,ge,V],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;padding:.75rem 0}.navigation[_ngcontent-%COMP%]{display:grid;grid-template-areas:". date time dropdown-caret" ". description description dropdown-caret";grid-template-columns:1fr auto auto 1fr;align-items:center}.lesson-date[_ngcontent-%COMP%]{grid-area:date;justify-self:end;display:flex;align-items:center;justify-content:flex-end}.lesson-date[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:0 .5ch 0 0}.lesson-date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000;position:relative}.lesson-date-input[_ngcontent-%COMP%]{font-weight:600;background:transparent;border:none;width:11ch}.lesson-time[_ngcontent-%COMP%]{grid-area:time;cursor:pointer}.lesson-description[_ngcontent-%COMP%]{grid-area:description;overflow:hidden;text-align:center;cursor:pointer}.dropdown-toggle[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dropdown-toggle[_ngcontent-%COMP%]:after{display:none}.dropdown-caret[_ngcontent-%COMP%]{grid-area:dropdown-caret;line-height:100%;text-align:left;color:#000}.dropdown-menu[_ngcontent-%COMP%]{width:50ch;padding:0;box-shadow:2px 2px 3px -1px #0003}@media (max-width: 800px){.dropdown-menu[_ngcontent-%COMP%]{width:100vw}}.dropdown-item[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid #dee2e6}.states[_ngcontent-%COMP%]{margin:.75rem 0;display:flex;justify-content:center}.state[_ngcontent-%COMP%]{margin-right:7%;display:flex}.state[_ngcontent-%COMP%]:last-child{margin-right:0}@media (min-width: 1000px){.state[_ngcontent-%COMP%]{margin-right:4rem}}.state.present[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#3d8608}.state.absent[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#ea161f}.state.unapproved[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#ffa814}.state.previously-absent[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#00000080}.state[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-left:.3em;margin-top:1px}.search-and-views[_ngcontent-%COMP%]{padding-top:.75rem;display:flex;justify-content:space-between;border-top:1px solid #dee2e6}.search[_ngcontent-%COMP%]{flex:auto;max-width:300px;margin-right:1rem}.views[_ngcontent-%COMP%]{display:flex}.view[_ngcontent-%COMP%]{color:#4e4e4ef2;background-color:#fff}.view.active[_ngcontent-%COMP%]{color:#fff;background-color:#4e4e4ef2;border:none}.group[_ngcontent-%COMP%], .view[_ngcontent-%COMP%]{text-decoration:none;padding-left:0;padding-right:0;aspect-ratio:1/1;width:calc(.75rem + 2 * var(--bs-border-width) + 1.625rem);border-radius:50%}.group.btn-link[_ngcontent-%COMP%]{color:#000}@media (max-width: 380px){[_nghost-%COMP%]{padding-left:.5rem;padding-right:.5rem}#search-addon[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem}}@media (max-width: 365px){.lesson-time[_ngcontent-%COMP%]{line-height:1}.lesson-time-to[_ngcontent-%COMP%]{display:block}.dropdown-caret[_ngcontent-%COMP%]{padding-left:0}}']})}}return n})();var Xi=(n,r)=>r.id;function Yi(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),a(),c(2,"label",6),d(3),a()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","incident-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),X("for","incident-",t,""),s(),y(" ",e.label," ")}}var Xn=(()=>{class n{constructor(e,t){this.activeModal=e,this.translate=t,this.incidentOptions=[]}ngOnInit(){let e=this.createIncidentOption();this.incidentOptions=this.incidentTypes.map(t=>this.createIncidentOption(t)),this.incidentOptions.unshift(e),this.selected=this.incidentOptions.find(t=>t.id===this.incident?.Id)||e}createIncidentOption(e){return{id:e?e.Id:null,label:e?e.Designation:this.translate.instant("presence-control.incident.no-incident")}}onSelectionChange(e){this.selected=e}getSelectedIncident(){return this.incidentTypes.find(e=>e.Id===this.selected?.id)||null}static{this.\u0275fac=function(t){return new(t||n)(h(re),h(K))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-incident"]],inputs:{incident:"incident",incidentTypes:"incidentTypes"},decls:14,vars:9,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["type","radio","name","incident",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,Yi,4,7,"div",1,Xi),a()(),c(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),a(),c(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedIncident())}),d(12),p(13,"translate"),a()()),t&2&&(s(2),y(" ",m(3,3,"presence-control.incident.text")," "),s(3),j(i.incidentOptions),s(4),y(" ",m(10,5,"presence-control.incident.cancel")," "),s(3),y(" ",m(13,7,"presence-control.incident.save")," "))},dependencies:[oe,Ce,fe,he,V],styles:["form[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child{border-bottom:1px solid #dee2e6;padding-bottom:1rem;margin-bottom:1rem}"]})}}return n})();var Zi=20,eo=100,Ee=function(n){return n.AddUpdateAction="ADD",n.RemoveUpdateAction="REMOVE",n}(Ee||{}),et=(()=>{class n{constructor(e,t,i,o,l){this.toastService=e,this.translate=t,this.restService=i,this.presenceTypesService=o,this.settings=l,this.destroy$=new $,this.action$=new $,this.pendingUpdates$=this.action$.pipe(_t(this.reduceUpdates.bind(this),[]),vt()),this.revertUpdates$=new $,this.performUpdates$=this.pendingUpdates$.pipe(tt(eo),Te(Ue(st)),Ct(this.performUpdates.bind(this))),this.stateUpdates$=ee(this.pendingUpdates$,this.revertUpdates$).pipe(tt(Zi),Te(Ue(st))),this.performUpdates$.pipe(q(this.destroy$)).subscribe()}ngOnDestroy(){this.destroy$.next()}updatePresenceType(e,t=null){this.dispatchAddUpdate(e.lessonPresence,t)}performUpdates(e){let t=this.groupUpdates(e);return M(Object.keys(t).reduce((i,o)=>{let l=t[o];return Object.keys(l).forEach(g=>{let w=l[g];i.push(this.performUpdateForGroup(w))}),i},[])).pipe(u(()=>t))}performUpdateForGroup(e){return e.forEach(t=>this.dispatchRemoveUpdate(t.presence)),this.performLessonPresencesUpdatesByIds(e[0].presence.LessonRef.Id,e.map(t=>t.presence.StudentRef.Id),e[0].newPresenceTypeId).pipe(ht(t=>this.revertUpdatesAfterError(e,t)))}performLessonPresencesUpdatesByIds(e,t,i=null){return i?(i?this.presenceTypesService.getPresenceType(i):Z(null)).pipe(T(l=>this.restService.editLessonPresences([e],t,l?.Id,He(l,this.settings)||void 0,{context:new it().set(ct,{disableErrorHandling:!0})}))):this.restService.removeLessonPresences([e],t,{context:new it().set(ct,{disableErrorHandling:!0})})}revertUpdatesAfterError(e,t){return console.error("Bulk-update of lesson presences failed"),console.error(t),this.toastService.error(this.translate.instant("shared.lesson-presences-update.error")),this.revertUpdates$.next(e.map(i=>de(le({},i),{newPresenceTypeId:i.presence.TypeRef.Id}))),Z(void 0)}groupUpdates(e){return e.reduce((t,i)=>{let o=String(i.newPresenceTypeId&&i.newPresenceTypeId);return t[o]||(t[o]={}),Array.isArray(t[o][i.presence.LessonRef.Id])||(t[o][i.presence.LessonRef.Id]=[]),t[o][i.presence.LessonRef.Id].push(i),t},{})}reduceUpdates(e,t){switch(t.type){case Ee.AddUpdateAction:{let{presence:i,newPresenceTypeId:o}=t.payload,l=e.findIndex(Yn(i));return l===-1?[...e,{presence:i,newPresenceTypeId:o}]:[...e.slice(0,l),{presence:e[l].presence,newPresenceTypeId:o},...e.slice(l+1)]}case Ee.RemoveUpdateAction:return e.filter(Ue(Yn(t.payload)));default:return e}}dispatchAddUpdate(e,t){this.action$.next({type:Ee.AddUpdateAction,payload:{presence:e,newPresenceTypeId:t}})}dispatchRemoveUpdate(e){this.action$.next({type:Ee.RemoveUpdateAction,payload:e})}static{this.\u0275fac=function(t){return new(t||n)(_(_e),_(K),_(sn),_(ve),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Yn(n){return r=>r.presence.LessonRef.Id===n.LessonRef.Id&&r.presence.StudentRef.Id===n.StudentRef.Id}var to=(n,r)=>r.id,no=()=>[],io=n=>({returnparams:n});function oo(n,r){n&1&&W(0,"bkd-spinner")}function ro(n,r){n&1&&(c(0,"p",1),d(1),p(2,"translate"),a()),n&2&&(s(),I(m(2,1,"presence-control.no-lessons")))}function so(n,r){n&1&&(c(0,"p",1),d(1),p(2,"translate"),a()),n&2&&(s(),y(" ",m(2,1,"presence-control.no-lesson-presences")," "))}function co(n,r){if(n&1){let e=S();c(0,"bkd-presence-control-entry",4),p(1,"async"),p(2,"async"),p(3,"async"),p(4,"async"),C("togglePresenceType",function(i){v(e);let o=f(3);return b(o.togglePresenceType(i))})("changeIncident",function(i){v(e);let o=f(3);return b(o.changeIncident(i))}),a()}if(n&2){let e,t=r.$implicit,i=f(3);x("entry",t)("hasUnconfirmedAbsences",m(1,5,i.state.hasUnconfirmedAbsences(t)))("viewMode",m(2,7,i.state.viewMode$))("showClassName",((e=m(3,9,i.state.studyClassCount$))!==null&&e!==void 0?e:0)>1)("profileReturnParams",ne(13,io,m(4,11,i.state.queryParamsString$)))}}function ao(n,r){if(n&1&&(c(0,"div"),p(1,"async"),B(2,co,5,15,"bkd-presence-control-entry",3,to),a()),n&2){let e=f(2),t=Q(4);Ve("default-entries entries view-mode-",m(1,3,e.state.viewMode$),""),s(2),j(t)}}function po(n,r){if(n&1){let e=S();c(0,"bkd-presence-control-header",0),p(1,"async"),p(2,"async"),p(3,"async"),p(4,"async"),p(5,"async"),p(6,"async"),p(7,"async"),C("searchChange",function(i){v(e);let o=f();return b(o.search$.next(i))})("viewModeChange",function(i){v(e);let o=f();return b(o.state.setViewMode(i))})("selectDateChange",function(i){v(e);let o=f();return b(o.state.setDate(i))})("selectLessonChange",function(i){v(e);let o=f();return b(o.state.setLessonId(i.id))}),a(),L(8,ro,3,3,"p",1)(9,so,3,3,"p",1)(10,ao,4,5,"div",2)}if(n&2){let e=f(),t=Q(0),i=Q(2),o=Q(4);x("selectedLesson",t)("lessons",i)("presentCount",m(1,10,e.state.presentCount$))("absentCount",m(2,12,e.state.absentCount$))("unapprovedCount",m(3,14,e.state.unapprovedCount$))("absentPrecedingCount",m(4,16,e.state.absentPrecedingCount$))("viewMode",m(5,18,e.state.viewMode$))("selectDate",m(6,20,e.state.selectedDate$))("search",m(7,22,e.search$)),s(8),k(t?o.length===0?9:10:8)}}var lo=["studentFullName"],ei=(()=>{class n{constructor(e,t,i,o,l,g,w){this.state=e,this.blockLessons=t,this.lessonPresencesUpdateService=i,this.presenceTypesService=o,this.modalService=l,this.scrollPosition=g,this.route=w,this.search$=new me(""),this.entries$=M([this.state.presenceControlEntriesByGroup$,this.search$]).pipe(u(([F,Se])=>vn(F,lo,Se)),E(1)),this.destroy$=new $}ngOnInit(){this.route.queryParams.pipe(q(this.destroy$)).subscribe(this.restoreStateFromParams.bind(this))}ngAfterViewInit(){this.scrollPosition.restore()}ngOnDestroy(){this.destroy$.next()}doTogglePresenceType(e){e.forEach(t=>this.state.getNextPresenceType(t).subscribe(i=>this.lessonPresencesUpdateService.updatePresenceType(t,i?i.Id:null)))}togglePresenceType(e){this.blockLessons.getBlockLessonPresenceControlEntries(e).pipe(O(1)).subscribe(t=>{if(t.length===1){let i=t[0];this.doTogglePresenceType([i])}else{let i=this.modalService.open(Qn);i.componentInstance.entry=e,i.componentInstance.blockPresenceControlEntries=t,i.result.then(o=>{o&&this.doTogglePresenceType(o)},()=>{})}})}updateIncident(e,t){this.lessonPresencesUpdateService.updatePresenceType(e,t)}changeIncident(e){this.presenceTypesService.incidentTypes$.subscribe(t=>{let i=this.modalService.open(Xn);i.componentInstance.incident=t.find(o=>o.Id===e.presenceType?.Id)||null,i.componentInstance.incidentTypes=t,i.result.then(o=>{this.updateIncident(e,o?.Id||null)},()=>{})})}restoreStateFromParams(e){e.date&&this.state.setDate(Bt(e.date));let t=String(e.lesson);t&&this.state.setLessonId(t),e.viewMode&&Un.includes(e.viewMode)&&this.state.setViewMode(e.viewMode)}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(Ze),h(et),h(ve),h(ye),h(Sn),h(Ae))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-list"]],decls:12,vars:16,consts:[[3,"searchChange","viewModeChange","selectDateChange","selectLessonChange","selectedLesson","lessons","presentCount","absentCount","unapprovedCount","absentPrecedingCount","viewMode","selectDate","search"],[1,"mt-3"],[3,"class"],[3,"entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams"],[3,"togglePresenceType","changeIncident","entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams"]],template:function(t,i){if(t&1&&(G(0),p(1,"async"),G(2),p(3,"async"),G(4),p(5,"async"),c(6,"h1"),d(7),p(8,"translate"),a(),L(9,oo,1,0,"bkd-spinner"),p(10,"async"),L(11,po,11,24)),t&2){let o;Y(m(1,2,i.state.selectedLesson$)),s(2),Y(m(3,5,i.state.lessons$)),s(2),Y((o=m(5,8,i.entries$))!==null&&o!==void 0?o:ke(15,no)),s(3),I(m(8,11,"presence-control.title")),s(2),k(m(10,13,i.state.loading$)?9:11)}},dependencies:[Jn,zn,be,ie,V],styles:["bkd-presence-control-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6}.entries.view-mode-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr))}.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{border-right:1px solid #dee2e6}[_nghost-%COMP%]{display:block;overflow:hidden;width:100%}.entries.view-mode-grid[_ngcontent-%COMP%]{width:calc(100% + 1px)}"],changeDetection:0})}}return n})();var ti=(()=>{class n{constructor(e,t){this.state=e,this.lessonPresencesUpdateService=t,this.destroy$=new $}ngOnInit(){this.lessonPresencesUpdateService.stateUpdates$.pipe(q(this.destroy$)).subscribe(e=>this.state.updateLessonPresencesTypes(e))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(et))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control"]],features:[ue([N,Ze,ae,on,{provide:zt,useExisting:N}])],decls:1,vars:0,template:function(t,i){t&1&&W(0,"router-outlet")},dependencies:[Et],encapsulation:2,changeDetection:0})}}return n})();var sc=[{path:"",component:ti,children:[{path:"",component:ei,data:{restoreScrollPositionFrom:["/presence-control/student/:id/addresses","/presence-control/student/:id/absences","/presence-control/student/:id/grades"]}},Cn,{path:"groups/:id",component:Wn}]}];export{sc as PRESENCE_CONTROL_ROUTES}; +import{a as pe,b as Pe}from"./chunk-DJH5AAGM.js";import{a as bn}from"./chunk-XUB6XQAX.js";import{a as _n,b as vn}from"./chunk-QB4DIFWS.js";import{b as Pn}from"./chunk-DM5T4OMV.js";import{a as Cn}from"./chunk-5ZBE3UL7.js";import{e as fn}from"./chunk-4UVNKLEN.js";import{q as gn,v as ye}from"./chunk-PXVJ3QLD.js";import{a as ct}from"./chunk-HCNFZOWE.js";import{b as zt,c as Xt,e as Qe}from"./chunk-CKFTESOV.js";import{a as rn}from"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import{a as yn}from"./chunk-A3AAQWNQ.js";import{c as at,g as un}from"./chunk-Z4YBXGVO.js";import{a as cn}from"./chunk-3L4RH6QP.js";import{a as an,b as pn}from"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import{a as Sn}from"./chunk-3P6YOVUR.js";import{B as ve,C as sn,E as st,G as hn,g as Zt,h as He,l as qe,m as en,n as tn,o as rt,t as nn,x as on}from"./chunk-UYCIECIQ.js";import{d as se}from"./chunk-G6EB45SC.js";import{e as Jt,o as Yt}from"./chunk-WCDEMEW2.js";import{g as z,j as ce}from"./chunk-XFA6UPZX.js";import{a as We,b as be,f as ln,g as dn,h as mn}from"./chunk-PSYDBHTH.js";import{h as At,i as Rt,j as Ge,k as Gt,l as Nt,m as Ut,o as Ht,p as qt,q as Le,r as re,w as Kt,y as Ue}from"./chunk-W4U7QKJF.js";import{a as _e}from"./chunk-AVBHFGIF.js";import{$a as a,$b as Ot,Ab as G,Ad as oe,B as ht,Bb as Y,C as Ct,Cb as Q,Cd as ot,D as tt,Db as ue,Eb as ke,F as O,Fb as ne,Ga as D,Gb as $t,H as Be,Hd as Ne,Id as $e,Jb as p,K as _t,Kb as m,L as vt,Lb as U,M as E,Md as Wt,N as nt,Na as L,O as je,Od as K,P as T,Pd as V,Qa as x,R as q,Ra as J,Rd as Qt,Sa as Pt,Ta as Ve,Tc as Bt,Va as k,X as R,Xa as St,Xb as Dt,Ya as B,Za as j,_,_a as c,a as le,ab as W,b as de,cc as ie,cd as H,da as bt,dc as ge,ea as v,eb as S,f as $,fa as b,fd as jt,g as me,gb as C,h as we,hb as f,ia as yt,id as Vt,jc as it,jd as fe,kd as he,l as Z,lb as X,lc as Fe,ma as te,md as Ft,n as u,nb as xt,nd as Ce,o as M,ob as It,pb as wt,qb as Mt,rb as d,s as Me,sb as I,tb as y,u as ft,ub as Tt,vb as kt,w as ee,wb as Lt,wc as Ae,x as Te,xa as s,xc as Et,ya as h,zc as Re}from"./chunk-2W7IS4PN.js";function xn(n,r){return+z(n)<+z(r)}function In(n,r){return+z(n)==+z(r)}function wn(n,r,e){let t=+z(n,e?.in),[i,o]=[+z(r.start,e?.in),+z(r.end,e?.in)].sort((l,g)=>l-g);return t>=i&&t<=o}function Mn(n,r,e){let t=r.map(o=>({eventId:o,group:n})),i=e.map(o=>t.find(l=>l.eventId===o.eventId)||o);return[...new Set([...i,...t])].filter(o=>o.group!==null)}var Ke=(()=>{class n extends nn{static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=yt(n)))(i||n)}})()}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();function Tn(n,r){return[...n].sort(oi(r))}function oi(n){return(r,e)=>{switch(n.primarySortKey){case"name":{let t=r.name.localeCompare(e.name);return n.ascending?t*-1:t}case"group":{let t=(r.detail.Value||"").localeCompare(e.detail.Value||"");return n.ascending?t*-1:t}}}}function kn(n,r){return n.map(e=>ri(e,r))}function ri(n,r){return{id:n.IdPerson,name:r.find(e=>e.StudentRef.Id===n.IdPerson)?.StudentFullName||"",group:n.Value,detail:n}}function Ln(n,r){return n.filter(e=>e.VssId===r.subscriptionDetailGroupId)}function pt(n,r){return n.find(e=>e.VssId===r.subscriptionDetailGroupId)}var si=(n,r)=>r.id;function ci(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),a(),c(2,"label",6),d(3),a()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","group-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),X("for","group-",t,""),s(),y(" ",e.label," ")}}var De=function(n){return n.Select="select",n.Assign="assign",n}(De||{}),$n=(()=>{class n{constructor(e,t){this.activeModal=e,this.translate=t,this.groupOptions=[]}ngOnInit(){this.title=`presence-control.groups.${this.dialogMode}.title`;let e=this.createEmtpyOption();this.groupOptions=this.createGroupOptions(this.subscriptionDetailsDefinitions),this.groupOptions.unshift(e),this.selected=this.groupOptions.find(t=>t.id===this.group)||e}createEmtpyOption(){let e=this.dialogMode===De.Select?"presence-control.groups.all":"presence-control.groups.none";return{id:null,label:this.translate.instant(e)}}createGroupOptions(e){return e.DropdownItems?e.DropdownItems.map(t=>({id:t.Key,label:`${this.translate.instant("presence-control.groups.group")} ${t.Value}`})):[]}getSelectedGroup(){return this.selected}onSelectionChange(e){this.selected=e}static{this.\u0275fac=function(t){return new(t||n)(h(re),h(K))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-group-dialog"]],inputs:{dialogMode:"dialogMode",subscriptionDetailsDefinitions:"subscriptionDetailsDefinitions",group:"group"},decls:14,vars:9,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["type","radio","name","groups",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,ci,4,7,"div",1,si),a()(),c(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),a(),c(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedGroup())}),d(12),p(13,"translate"),a()()),t&2&&(s(2),y(" ",m(3,3,i.title)," "),s(3),j(i.groupOptions),s(4),y(" ",m(10,5,"presence-control.groups.cancel")," "),s(3),y(" ",m(13,7,"presence-control.groups.save")," "))},dependencies:[oe,Ce,fe,he,V],encapsulation:2})}}return n})();function Dn(n,r){return n===null&&r===null||n!==null&&r!==null&&n.TeacherInformation===r.TeacherInformation&&n.LessonDateTimeFrom.getTime()===r.LessonDateTimeFrom.getTime()&&n.LessonDateTimeTo.getTime()===r.LessonDateTimeTo.getTime()}function On(n){let r=new dt(n.TeacherInformation,n.LessonDateTimeFrom,n.LessonDateTimeTo);return r.addLesson(n),r}var dt=class{constructor(r,e,t){this.TeacherInformation=r,this.LessonDateTimeFrom=e,this.LessonDateTimeTo=t,this.lessons=[]}addLesson(r){this.lessons.some(e=>qe(e,r))||(this.lessons.push(r),this.updateId(),this.updateStudyClassNumbers(),this.updateEventDesignations())}getIds(){return[...new Set(this.lessons.map(r=>r.LessonRef.Id))]}getEventIds(){return[...new Set(this.lessons.map(r=>r.EventRef.Id))]}updateId(){this.id=[...new Set(this.lessons.map(r=>r.LessonRef.Id).sort())].join("-")}updateStudyClassNumbers(){this.studyClassNumbers=[...new Set(this.lessons.map(r=>r.StudyClassNumber).sort((r,e)=>r.localeCompare(e)))].join(", ")}updateEventDesignations(){this.eventDesignations=[...new Set(this.lessons.map(r=>r.EventDesignation).sort())].join(", ")}};function En(n){return ai(n).reduce((r,e)=>{let t=r.find(o=>Dn(o,e));if(t)return t.addLesson(e),r;let i=On(e);return[...r,i]},[]).sort(rt)}function Bn(n){if(n.length===0)return null;let r=new Date;if(n=[...n].sort(rt),Xt(r,n[0].LessonDateTimeFrom)){for(let e of n)if(xn(r,e.LessonDateTimeFrom)||wn(r,{start:e.LessonDateTimeFrom,end:e.LessonDateTimeTo}))return e;return n[n.length-1]}return n[0]}function ai(n){return n.reduce((r,e)=>r.some(t=>qe(t,e))?r:[...r,e],[])}function jn(n,r,e,t){return n.map(i=>{let o=r.find(l=>pi(l.presence,i));if(o){let l;return!o.newPresenceTypeId&&i.Comment?l=e.find(g=>g.IsComment)||null:l=e.find(g=>g.Id===o.newPresenceTypeId)||null,de(le({},i),{TypeRef:li(l),Date:null,Type:l?l.Designation:null,ConfirmationStateId:He(l,t)})}return i})}function pi(n,r){return n.LessonRef.Id===r.LessonRef.Id&&n.StudentRef.Id===r.StudentRef.Id}function li(n){return{Id:n?n.Id:null,HRef:null}}function Xe(n){return r=>r.reduce((e,t)=>e+(t.presenceCategory===n?1:0),0)}function Vn(){return n=>n.reduce((r,e)=>r+(e.precedingAbsences&&e.precedingAbsences.length>0?1:0),0)}var Fn=(()=>{class n extends We{constructor(e,t){super(e,t,at,"LessonTeachers")}loadOtherTeachersLessonAbsences(e,t,i){let o=`${this.baseUrl}/except/${e}/LessonAbsences?expand=LessonRef`;return t&&t.length>0&&(o=o.concat("&filter.StudentRef=;"+t.join(";"))),this.http.get(o,{params:i}).pipe(T(Wt(at)))}static{this.\u0275fac=function(t){return new(t||n)(_(Fe),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Ye=(()=>{class n extends We{constructor(e,t){super(e,t,gn,"SubscriptionDetails")}getListForEvent(e){return this.getList({params:{IdEvent:String(e)}})}update(e,t){let i={IdPerson:t.IdPerson,EventId:t.EventId,Value:e};return this.http.put(`${this.baseUrl}/${t.Id}`,i).pipe(u(()=>{}))}static{this.\u0275fac=function(t){return new(t||n)(_(Fe),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Rn="presence-control-group",ae=(()=>{class n{constructor(e,t,i,o,l){this.userSettings=e,this.eventService=t,this.subscriptionDetailsService=i,this.loadingService=o,this.settings=l,this.selectGroup$=new $,this.selectedLesson$=new we,this.lessonPresences$=new we,this.reloadSubscriptionDetails$=new $,this.defaultGroup=null,this.savedGroup$=this.selectedLesson$.pipe(T(g=>this.userSettings.getPresenceControlGroupView().pipe(u(w=>this.findGroupByLesson(w,g))))),this.group$=ee(this.selectGroup$,this.savedGroup$).pipe(je(this.defaultGroup),E(1)),this.loading$=this.loadingService.loading(Rn),this.subscriptionDetailsDefinitions$=this.selectedLesson$.pipe(u(g=>g?.getEventIds()||[]),T(g=>Me(g.map(w=>this.eventService.getSubscriptionDetailsDefinitions(w)))),E(1)),this.groupsAvailability$=this.subscriptionDetailsDefinitions$.pipe(u(g=>g.every(w=>pt(w,this.settings))),E(1)),this.subscriptionDetails$=M([this.selectedLesson$,this.groupsAvailability$,this.reloadSubscriptionDetails$.pipe(u(()=>!1),je(!0))]).pipe(T(([g,w,F])=>g&&w?this.loadSubscriptionDetailsForLesson(g,F):Z([])),u(g=>Ln(g,this.settings)),E(1)),this.subscriptionDetailPersonIds$=M([this.group$,this.subscriptionDetails$]).pipe(u(([g,w])=>w.filter(F=>F.Value===g).map(F=>F.IdPerson)),je([]))}selectGroup(e){this.selectGroup$.next(e)}setSelectedLesson(e){this.selectedLesson$.next(e)}setLessonPresences(e){this.lessonPresences$.next(e)}getSubscriptionDetailsDefinitions(){return this.subscriptionDetailsDefinitions$.pipe(u(ot),u(e=>pt(e,this.settings)))}getSubscriptionDetailsForStudents(){return M([this.subscriptionDetails$,this.lessonPresences$]).pipe(u(se(kn)))}reloadSubscriptionDetails(){this.reloadSubscriptionDetails$.next(void 0)}loadSubscriptionDetailsForLesson(e,t=!0){return this.loadingService.load(Me($e(e.getEventIds()).map(i=>this.subscriptionDetailsService.getListForEvent(i))),t?void 0:Rn).pipe(u(ot))}findGroupByLesson(e,t){return e.find(o=>o.eventId===t?.getEventIds()[0])?.group||this.defaultGroup}static{this.\u0275fac=function(t){return new(t||n)(_(Pe),_(bn),_(Ye),_(ce),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var Un=Object.values(pe),N=(()=>{class n{constructor(e,t,i,o,l,g,w,F,Se,xe){this.userSettings=e,this.lessonPresencesService=t,this.lessonTeacherService=i,this.presenceTypesService=o,this.groupService=l,this.dropDownItemsService=g,this.loadingService=w,this.storageService=F,this.settings=Se,this.location=xe,this.selectedDateSubject$=new me(new Date),this.selectedDate$=this.selectedDateSubject$.asObservable().pipe(u(P=>Jt(P)),Be(Ne)),this.viewModeSubject$=new $,this.viewMode$=ee(this.viewModeSubject$,this.userSettings.getPresenceControlViewMode().pipe(O(1))),this.lessons$=this.selectedDate$.pipe(T(P=>this.loadLessonsByDate(P)),E(1)),this.selectLessonId$=new $,this.selectLesson$=this.selectLessonId$.pipe(T(P=>this.getLessonById(P))),this.selectedLesson$=M([ln(this.selectLesson$.pipe(Be((P,Ie)=>Ne(P,Ie))),dn(this.settings.lessonPresencesRefreshTime)),this.lessons$]).pipe(u(([P,Ie])=>Ie.find(ni=>ni.id===P.id)?P:null),E(1)),this.studyClassCount$=this.selectedLesson$.pipe(u(P=>P?.lessons.length||0)),this.updateLessonPresences$=new $,this.reloadLessonPresences$=new $,this.lessonPresences$=ee(mn(this.selectedLesson$,this.reloadLessonPresences$).pipe(T(P=>P?this.loadLessonPresencesByLesson(P):Z([]))),this.updateLessonPresences$).pipe(E(1)),this.presenceTypes$=this.loadPresenceTypes().pipe(E(1)),this.reloadStudentIdsWithUnconfirmedAbsences$=new $,this.studentIdsWithUnconfirmedAbsences$=ee(this.selectedDate$,this.selectedLesson$.pipe(nt(1)),this.reloadStudentIdsWithUnconfirmedAbsences$).pipe(T(()=>this.loadStudentIdsWithUnconfirmedAbsences()),E(1)),this.loading$=this.loadingService.loading$,this.absenceConfirmationStates$=this.dropDownItemsService.getAbsenceConfirmationStates().pipe(E(1)),this.studentIds$=this.lessonPresences$.pipe(u(P=>$e(P.map(Ie=>Ie.StudentRef.Id))),E(1)),this.otherTeachersAbsences$=this.studentIds$.pipe(Be(Ne),T(P=>P.length>0?this.lessonTeacherService.loadOtherTeachersLessonAbsences(this.getMyself(),P):Z([])),E(1)),this.groupsAvailability$=this.groupService.groupsAvailability$,this.presenceControlEntries$=M([this.selectedLesson$,this.lessonPresences$,this.presenceTypes$,this.absenceConfirmationStates$,this.otherTeachersAbsences$]).pipe(u(se(en))),this.presenceControlEntriesByGroup$=M([this.groupService.group$,this.presenceControlEntries$,this.groupService.subscriptionDetailPersonIds$]).pipe(u(se(Pn)),E(1)),this.presentCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("present"))),this.absentCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("absent"))),this.unapprovedCount$=this.presenceControlEntriesByGroup$.pipe(u(Xe("unapproved"))),this.absentPrecedingCount$=this.presenceControlEntriesByGroup$.pipe(u(Vn())),this.queryParamsString$=M([this.selectedDate$,this.selectedLesson$,this.viewMode$]).pipe(u(se(this.buildQueryParams.bind(this))),u(pn)),this.destroy$=new $,this.queryParamsString$.pipe(q(this.destroy$)).subscribe(P=>{this.location.replaceState("/presence-control",P),this.confirmBackLinkParams={returnparams:P}}),this.viewMode$.pipe(nt(1),T(P=>this.userSettings.savePresenceControlViewMode(P)),q(this.destroy$)).subscribe(),this.selectedLesson$.pipe(q(this.destroy$)).subscribe(P=>{this.groupService.setSelectedLesson(P)}),this.lessonPresences$.pipe(q(this.destroy$)).subscribe(P=>this.groupService.setLessonPresences(P))}ngOnDestroy(){this.destroy$.next()}setDate(e){this.selectedDateSubject$.next(e)}setLessonId(e){this.selectLessonId$.next(e)}setViewMode(e){this.viewModeSubject$.next(e)}updateLessonPresencesTypes(e){M([this.lessonPresences$.pipe(O(1)),this.presenceTypes$.pipe(O(1))]).pipe(u(([t,i])=>jn(t,e,i,this.settings))).subscribe(t=>this.updateLessonPresences$.next(t))}getNextPresenceType(e){return this.presenceTypes$.pipe(O(1),u(t=>e.getNextPresenceType(t)))}hasUnconfirmedAbsences(e){return this.studentIdsWithUnconfirmedAbsences$.pipe(u(t=>t.includes(e.lessonPresence.StudentRef.Id)))}updateAfterConfirm(){this.reloadLessonPresences$.next(),this.reloadStudentIdsWithUnconfirmedAbsences$.next()}loadLessonPresencesByLesson(e){return this.loadingService.load(this.lessonPresencesService.getListByLessons(e.lessons))}loadLessonsByDate(e){return this.loadingService.load(this.lessonPresencesService.getLessonsByDate(e)).pipe(u(En))}loadPresenceTypes(){return this.loadingService.load(this.presenceTypesService.presenceTypes$)}loadStudentIdsWithUnconfirmedAbsences(){return ft(0,this.settings.unconfirmedAbsencesRefreshTime||-1).pipe(T(()=>this.lessonPresencesService.getListOfUnconfirmed()),u(e=>$e(e.map(t=>t.StudentRef.Id))))}buildQueryParams(e,t,i){let o={date:Yt(e,"yyyy-MM-dd"),viewMode:i};return t&&(o.lesson=String(t.id)),o}getLessonById(e){let t=String(e);return this.lessons$.pipe(u(i=>t&&i.find(o=>o.id===t)||Bn(i)),Te(Boolean))}getMyself(){let e=this.storageService.getPayload();return Number(e?.holder_id||e?.id_person)}static{this.\u0275fac=function(t){return new(t||n)(_(Pe),_(Qe),_(Fn),_(ve),_(ae),_(rn),_(ce),_(Qt),_(H),_(Dt))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var fi=(n,r)=>r.id,hi=()=>[],Ci=()=>["/presence-control"];function _i(n,r){if(n&1&&(c(0,"span",12),d(1),a()),n&2){let e=f().$implicit,t=f(),i=Q(0);s(),I(t.getSortDirectionCharacter(i,e))}}function vi(n,r){if(n&1){let e=S();c(0,"div",11),C("click",function(){let i=v(e).$implicit,o=f();return b(o.toggleSort(i))}),d(1),p(2,"translate"),L(3,_i,2,1,"span",12),a()}if(n&2){let e=r.$implicit;f();let t=Q(0);x("className",e),s(),y(" ",m(2,3,"presence-control.groups.list.header."+e)," "),s(2),k(t?3:-1)}}function bi(n,r){n&1&&W(0,"bkd-spinner")}function yi(n,r){n&1&&W(0,"bkd-spinner",18)}function Pi(n,r){if(n&1){let e=S();c(0,"div",13)(1,"div",14)(2,"input",15,0),p(4,"async"),C("change",function(){let i=v(e).$implicit,o=f(2);return b(o.selectionService.toggle(i))}),a()(),c(5,"div",16),d(6),a(),c(7,"div",17)(8,"span"),d(9),a(),L(10,yi,1,0,"bkd-spinner",18),p(11,"async"),a()()}if(n&2){let e=r.$implicit,t=f(2);s(2),x("checked",m(4,4,t.selectionService.isSelected$(e))),s(4),y(" ",e.name," "),s(3),I(e.group?e.group:""),s(),k(m(11,6,t.groupService.loading$)?10:-1)}}function Si(n,r){if(n&1&&B(0,Pi,12,8,"div",13,fi),n&2){f();let e=Q(2);j(e)}}var Wn=(()=>{class n{constructor(e,t,i,o,l,g,w,F,Se){this.route=e,this.state=t,this.selectionService=i,this.groupService=o,this.userSettings=l,this.subscriptionDetailService=g,this.toastService=w,this.translate=F,this.modalService=Se,this.primarySortKeys=["name","group"],this.backlinkQueryParams$=this.route.queryParams.pipe(u(({returnparams:xe})=>xe),u(an)),this.eventIds$=this.state.selectedLesson$.pipe(u(xe=>xe?.getEventIds()||[])),this.sortCriteriaSubject$=new me({primarySortKey:"name",ascending:!1}),this.sortCriteria$=this.sortCriteriaSubject$.asObservable(),this.sortedEntries$=M([this.groupService.getSubscriptionDetailsForStudents(),this.sortCriteria$]).pipe(u(se(Tn))),this.selected=[]}ngOnInit(){this.selectionService.selection$.subscribe(e=>this.selected=e)}selectGroup(){this.openGroupModal(De.Select,this.selectCallback.bind(this))}assignGroup(){this.openGroupModal(De.Assign,this.assignCallback.bind(this))}openGroupModal(e,t){M([this.groupService.getSubscriptionDetailsDefinitions(),this.groupService.group$]).pipe(O(1)).subscribe(([i,o])=>{let l=this.modalService.open($n);l.componentInstance.dialogMode=e,l.componentInstance.subscriptionDetailsDefinitions=i,l.componentInstance.group=o,l.result.then(g=>{t(g)},()=>{})})}selectCallback(e){M([this.eventIds$,this.userSettings.getPresenceControlGroupView()]).pipe(O(1),T(([t,i])=>this.userSettings.savePresenceControlGroupView(Mn(e.id,t,i))),u(()=>e.id)).subscribe(t=>this.groupService.selectGroup(t))}assignCallback(e){Me(this.selected.map(t=>this.subscriptionDetailService.update(e.id,t.detail))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.groupService.reloadSubscriptionDetails(),this.selectionService.clear(),this.toastService.success(this.translate.instant("presence-control.groups.notifications.save-success"))}getSortDirectionCharacter(e,t){return e.primarySortKey!==t?"":e.ascending?"\u2193":"\u2191"}toggleSort(e){this.sortCriteriaSubject$.pipe(O(1)).subscribe(t=>{t.primarySortKey===e?this.sortCriteriaSubject$.next({primarySortKey:e,ascending:!t.ascending}):this.sortCriteriaSubject$.next({primarySortKey:e,ascending:e==="name"})})}static{this.\u0275fac=function(t){return new(t||n)(h(Ae),h(N),h(Ke),h(ae),h(Pe),h(Ye),h(_e),h(K),h(ye))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-group"]],features:[ue([Ke])],decls:33,vars:32,consts:[["checkbox",""],[3,"link","params"],[1,"group-header","mb-2","d-flex","justify-content-between"],[1,"d-flex","align-items-baseline"],[1,"ps-3"],["type","button",1,"show","btn","btn-link",3,"click"],["aria-label","edit",1,"btn","btn-primary","btn-icon","me-2",3,"click"],[1,"material-icons"],[1,"group-list"],[1,"group-list-header"],[3,"className"],[3,"click","className"],[1,"sort-direction"],[1,"group-list-entry"],[1,"checkbox"],["type","checkbox",1,"form-check-input",3,"change","checked"],[1,"name","pe-2"],[1,"group","d-flex","justify-content-between"],[1,"inline","small"]],template:function(t,i){if(t&1){let o=S();G(0),p(1,"async"),G(2),p(3,"async"),G(4),p(5,"async"),G(6),p(7,"async"),c(8,"div"),W(9,"bkd-backlink",1),p(10,"async"),c(11,"h1"),d(12),p(13,"translate"),a(),c(14,"div",2)(15,"div",3)(16,"span",4),d(17),p(18,"translate"),a(),c(19,"button",5),C("click",function(){return v(o),b(i.selectGroup())}),d(20),p(21,"translate"),p(22,"translate"),a()(),c(23,"a",6),C("click",function(){return v(o),b(i.assignGroup())}),c(24,"i",7),d(25,"edit"),a()()(),c(26,"div",8)(27,"div",9),B(28,vi,4,5,"div",10,St),a(),L(30,bi,1,0,"bkd-spinner"),p(31,"async"),L(32,Si,2,0),a()()}if(t&2){let o;Y(m(1,8,i.sortCriteria$)),s(2),Y(m(3,11,i.sortedEntries$));let l=(o=m(5,14,i.selectionService.selection$))!==null&&o!==void 0?o:ke(30,hi),g=m(7,16,i.groupService.group$);s(7),x("link",ke(31,Ci))("params",m(10,18,i.backlinkQueryParams$)),s(3),I(m(13,20,"presence-control.groups.title")),s(5),I(m(18,22,"presence-control.groups.show")),s(3),y(" ",g?m(21,24,"presence-control.groups.group")+" "+g:m(22,26,"presence-control.groups.all")," "),s(3),J("disabled",l.length===0),s(5),j(i.primarySortKeys),s(2),k(m(31,28,i.state.loading$)?30:32)}},dependencies:[hn,be,ie,V],styles:['[_nghost-%COMP%]{display:block}.group-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#000;font-weight:300;text-decoration:underline;padding-left:.5rem}.group-header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.group-list-header[_ngcontent-%COMP%]{cursor:pointer;padding:1rem;display:grid;grid-template-areas:"name group";grid-template-columns:3fr 2fr;border-top:1px solid #dee2e6;border-bottom:2px solid #dee2e6}.group-list-entry[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid #dee2e6;display:grid;grid-template-areas:"checkbox name group";grid-template-columns:min-content 3fr 2fr}.checkbox[_ngcontent-%COMP%]{grid-area:checkbox;margin:0;padding:.3rem 1rem 0 0}.checkbox[_ngcontent-%COMP%] input.form-check-input[_ngcontent-%COMP%]{position:static!important;margin:0!important;display:block}.name[_ngcontent-%COMP%]{grid-area:name;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.group[_ngcontent-%COMP%]{grid-area:group}@media (max-width: 750px){.group-list[_ngcontent-%COMP%]{padding-left:0;padding-right:0}.group-list-header[_ngcontent-%COMP%]{grid-template-columns:3fr 1fr}.group-list-entry[_ngcontent-%COMP%]{grid-template-columns:min-content 3fr 1fr}}'],changeDetection:0})}}return n})();var xi=(n,r)=>r.entry.id;function Ii(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit;return b(i.selected=!i.selected)}),a(),c(2,"label",6)(3,"i"),d(4),a(),c(5,"div",7),d(6),p(7,"date"),p(8,"date"),a()()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","lesson-presence-",t,""),x("checked",e.selected),s(),J("fw-bold",i.isCurrentLesson(e)),X("for","lesson-presence-",t,""),s(),Ve("",e.entry.presenceCategory," material-icons pe-2"),s(),I(e.entry.presenceCategoryIcon),s(2),kt(" ",U(7,14,e.entry.lessonPresence.LessonDateTimeFrom,"HH:mm"),"\u2013",U(8,17,e.entry.lessonPresence.LessonDateTimeTo,"HH:mm")," ",e.entry.lessonPresence.EventDesignation," ")}}var Qn=(()=>{class n{constructor(e){this.activeModal=e,this.blockLessonOptions=[]}ngOnInit(){this.blockLessonOptions=this.buildLessonPresenceOptions()}getSelectedEntries(){return this.blockLessonOptions.filter(({selected:e})=>e).map(({entry:e})=>e)}isCurrentLesson(e){return In(e.entry.lessonPresence.LessonDateTimeFrom,this.entry.lessonPresence.LessonDateTimeFrom)}buildLessonPresenceOptions(){return this.blockPresenceControlEntries.map(e=>({entry:e,selected:this.entry.confirmationState===e.confirmationState}))}static{this.\u0275fac=function(t){return new(t||n)(h(re))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-block-lesson-component"]],inputs:{entry:"entry",blockPresenceControlEntries:"blockPresenceControlEntries"},decls:15,vars:11,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click","disabled"],["type","checkbox",1,"form-check-input",3,"change","id","checked"],[1,"form-check-label","d-flex",3,"for"],[1,"d-block","text-truncate"]],template:function(t,i){if(t&1){let o=S();c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,Ii,9,20,"div",1,xi),a()(),G(7),c(8,"div",2)(9,"button",3),C("click",function(){return v(o),b(i.activeModal.close())}),d(10),p(11,"translate"),a(),c(12,"button",4),C("click",function(){v(o);let g=Q(7);return b(i.activeModal.close(g))}),d(13),p(14,"translate"),a()()}if(t&2){s(2),y(" ",m(3,4,"presence-control.block-lesson.text")," "),s(3),j(i.blockLessonOptions),s(2);let o=Y(i.getSelectedEntries());s(3),y(" ",m(11,7,"presence-control.block-lesson.cancel")," "),s(2),x("disabled",o.length===0),s(),y(" ",m(14,9,"presence-control.block-lesson.save")," ")}},dependencies:[oe,Ce,fe,he,ge,V],styles:[".checkbox[_ngcontent-%COMP%] input.form-check-input[_ngcontent-%COMP%]{position:static!important;margin:0!important;display:block}.absent[_ngcontent-%COMP%]{color:#ea161f}.present[_ngcontent-%COMP%]{color:#3d8608}.unapproved[_ngcontent-%COMP%]{color:#ffa814}"]})}}return n})();var wi=30;function gt(n){return`blockLesson${n.lessonPresence.Id}`}var Ze=(()=>{class n{constructor(e,t,i,o){this.state=e,this.lessonPresencesService=t,this.loadingService=i,this.settings=o}getBlockLessonPresenceControlEntries(e){return M([this.state.lessons$.pipe(O(1)),this.loadChangeableLessonPresences(e),this.state.presenceTypes$.pipe(O(1)),this.state.absenceConfirmationStates$.pipe(O(1)),this.state.otherTeachersAbsences$.pipe(O(1))]).pipe(u(([t,i,o,l,g])=>this.filterBlockLessonPresences(e,i).map(w=>tn(t.find(F=>F.id===w.LessonRef.Id.toString()),w,o,l,g))))}filterBlockLessonPresences(e,t){return[...t].sort((i,o)=>i.LessonDateTimeFrom>o.LessonDateTimeFrom?1:-1).reduce((i,o)=>{let l=i[i.length-1];return this.isWithinBlockTime(o,l)?(i.push(o),i):i.find(g=>g.Id===e.lessonPresence.Id)?i:[o]},[])}isWithinBlockTime(e,t){return t?e.LessonDateTimeFrom.getTime()-t.LessonDateTimeTo.getTime()<=wi*60*1e3:!0}loadChangeableLessonPresences(e){return M([this.loadLessonPresences(e),this.state.presenceTypes$.pipe(O(1))]).pipe(u(([t,i])=>t.filter(o=>Zt(o,i.find(l=>l.Id===o.TypeRef.Id)||null,this.settings))))}loadLessonPresences(e){return this.loadingService.load(this.lessonPresencesService.getListByDateStudentClass(e.lessonPresence.LessonDateTimeFrom,e.lessonPresence.StudentRef.Id,e.lessonPresence.StudyClassRef.Id??void 0).pipe(u(t=>t.filter(i=>i.TeacherInformation===e.lessonPresence.TeacherInformation))),gt(e))}static{this.\u0275fac=function(t){return new(t||n)(_(N),_(Qe),_(ce),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac})}}return n})();var Ti=(n,r)=>r.Id;function ki(n,r){if(n&1&&(c(0,"div"),d(1),p(2,"date"),p(3,"date"),p(4,"addSpace"),a()),n&2){let e=r.$implicit;s(),Lt(" ",U(2,5,e.LessonRef.From,"HH:mm"),"\u2013",U(3,8,e.LessonRef.To,"HH:mm")," ",e.LessonRef.EventDesignation,"",U(4,11,":",":")," ",e.Type," ")}}var Kn=(()=>{class n{constructor(e){this.activeModal=e}static{this.\u0275fac=function(t){return new(t||n)(h(re))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-preceding-absence"]],inputs:{precedingAbsences:"precedingAbsences"},decls:10,vars:6,consts:[[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),B(4,ki,5,14,"div",null,Ti),a(),c(6,"div",1)(7,"button",2),C("click",function(){return i.activeModal.dismiss()}),d(8),p(9,"translate"),a()()),t&2&&(s(2),y(" ",m(3,2,"presence-control.preceding-absence.text")," "),s(2),j(i.precedingAbsences),s(4),y(" ",m(9,4,"presence-control.preceding-absence.cancel")," "))},dependencies:[ge,V,un],encapsulation:2})}}return n})();var Li=n=>["student",n,"absences"],$i=n=>["/presence-control/student",n,"absences"];function Di(n,r){if(n&1&&(W(0,"bkd-avatar",0),p(1,"async")),n&2){let e=f();x("studentId",m(1,3,e.studentId$))("link",ne(5,$i,e.entry.lessonPresence.StudentRef.Id.toString()))("linkParams",e.profileReturnParams)}}function Oi(n,r){if(n&1&&(c(0,"span"),d(1),a()),n&2){let e=f(2);s(),I(e.entry.presenceType==null?null:e.entry.presenceType.Designation)}}function Ei(n,r){if(n&1){let e=S();c(0,"button",12),C("click",function(){v(e);let i=f();return b(i.updatePresenceType(i.entry))}),L(1,Oi,2,1,"span"),a()}if(n&2){let e=f();s(),k(e.entry.presenceType!=null&&e.entry.presenceType.IsIncident?-1:1)}}function Bi(n,r){n&1&&W(0,"bkd-spinner",5)}function ji(n,r){if(n&1){let e=S();c(0,"button",13),C("click",function(){v(e);let i=f();return b(i.showPrecedingAbsences(i.entry))}),c(1,"i",14),d(2,"info"),a()()}}function Vi(n,r){if(n&1&&(c(0,"span",9),d(1),a()),n&2){let e=f();s(),y(" ",e.entry.lessonPresence.StudyClassNumber," ")}}function Fi(n,r){if(n&1){let e=S();c(0,"a",15),C("click",function(){v(e);let i=f();return b(i.updateIncident(i.entry))}),c(1,"i",4),d(2,"edit"),a(),c(3,"span"),d(4),p(5,"translate"),a()()}if(n&2){let e=f();s(4),I(m(5,1,(e.entry.presenceType==null?null:e.entry.presenceType.IsIncident)&&(e.entry.presenceType==null?null:e.entry.presenceType.Designation)||"presence-control.entry.incident"))}}var zn=(()=>{class n{get classNames(){return[this.entry.presenceCategory,this.viewMode].join(" ")}constructor(e,t,i,o){this.toastService=e,this.translate=t,this.modalService=i,this.loadingService=o,this.hasUnconfirmedAbsences=!1,this.showClassName=!1,this.togglePresenceType=new te,this.changeIncident=new te,this.entry$=new we(1),this.studentId$=this.entry$.pipe(u(({lessonPresence:l})=>l.StudentRef.Id)),this.loading$=this.entry$.pipe(T(l=>this.loadingService.loading(gt(l))))}ngOnChanges(e){e.entry&&this.entry$.next(e.entry.currentValue)}get isListViewMode(){return this.viewMode===pe.List}updatePresenceType(e){e.canChangePresenceType?this.togglePresenceType.emit(e):this.toastService.warning(this.translate.instant("presence-control.entry.update-warning"))}updateIncident(e){e.canChangeIncident&&this.changeIncident.emit(e)}showPrecedingAbsences(e){let t=this.modalService.open(Kn);t.componentInstance.precedingAbsences=e.precedingAbsences}static{this.\u0275fac=function(t){return new(t||n)(h(_e),h(K),h(ye),h(ce))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-entry"]],hostVars:2,hostBindings:function(t,i){t&2&&Pt(i.classNames)},inputs:{entry:"entry",hasUnconfirmedAbsences:"hasUnconfirmedAbsences",viewMode:"viewMode",showClassName:"showClassName",profileReturnParams:"profileReturnParams"},outputs:{togglePresenceType:"togglePresenceType",changeIncident:"changeIncident"},features:[bt],decls:18,vars:20,consts:[[1,"avatar","large",3,"studentId","link","linkParams"],["type","button",1,"presence-category","designation","btn","btn-link"],["type","button",1,"presence-category","status","btn","btn-link",3,"click","disabled"],[1,"position-relative"],[1,"material-icons"],[1,"inline","small"],["type","button",1,"previously-absent","d-flex","btn","btn-link"],[1,"student-info",3,"routerLink","queryParams"],[1,"student-name","text-truncate"],[1,"study-class","text-truncate"],[1,"unconfirmed-absences"],[1,"incident","btn","btn-link"],["type","button",1,"presence-category","designation","btn","btn-link",3,"click"],["type","button",1,"previously-absent","d-flex","btn","btn-link",3,"click"],[1,"material-icons-outlined"],[1,"incident","btn","btn-link",3,"click"]],template:function(t,i){if(t&1){let o=S();L(0,Di,2,7,"bkd-avatar",0)(1,Ei,2,1,"button",1),G(2),p(3,"async"),c(4,"button",2),C("click",function(){return v(o),b(i.updatePresenceType(i.entry))}),c(5,"div",3)(6,"i",4),d(7),a(),L(8,Bi,1,0,"bkd-spinner",5),a()(),L(9,ji,3,0,"button",6),c(10,"a",7)(11,"span",8),d(12),a(),L(13,Vi,2,1,"span",9),c(14,"span",10),d(15),p(16,"translate"),a()(),L(17,Fi,6,3,"a",11)}if(t&2){k(i.isListViewMode?-1:0),s(),k(i.entry.showDesignation?1:-1);let o=m(3,14,i.loading$);s(3),x("disabled",o),s(2),J("invisible",o),s(),I(i.entry.presenceCategoryIcon),s(),k(o?8:-1),s(),k(i.entry.precedingAbsences!=null&&i.entry.precedingAbsences.length?9:-1),s(),x("routerLink",ne(18,Li,i.entry.lessonPresence.StudentRef.Id))("queryParams",i.profileReturnParams),s(2),I(i.entry.lessonPresence.StudentFullName),s(),k(i.isListViewMode&&i.showClassName?13:-1),s(2),y(" ",i.hasUnconfirmedAbsences?m(16,16,"presence-control.entry.unconfirmed-absences"):""," "),s(2),k(i.entry.canChangeIncident?17:-1)}},dependencies:[fn,be,Re,ie,V],styles:['[_nghost-%COMP%]{padding:2rem 1rem;background-color:#fff;display:grid;grid-template-areas:"avatar status designation previously-absent" "avatar student-info student-info student-info" "avatar incident incident incident";grid-template-columns:min-content min-content 3fr min-content}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{align-self:center}.presence-category[_ngcontent-%COMP%]{text-decoration:none}.presence-category[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{top:.1875rem}.absent[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#ea161f}.present[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#3d8608}.unapproved[_nghost-%COMP%] .presence-category[_ngcontent-%COMP%]{color:#ffa814}.presence-category[_ngcontent-%COMP%] bkd-spinner[_ngcontent-%COMP%]{color:#000;position:absolute;top:4px;left:5px}.designation[_ngcontent-%COMP%], .student-info[_ngcontent-%COMP%], a.incident[_ngcontent-%COMP%], .incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.avatar[_ngcontent-%COMP%]{grid-area:avatar;margin-right:1.5rem}.status[_ngcontent-%COMP%]{grid-area:status}.status[_ngcontent-%COMP%] .material-icons[_ngcontent-%COMP%]{font-size:2rem}.designation[_ngcontent-%COMP%]{grid-area:designation;text-align:left;line-height:2.375rem}.previously-absent[_ngcontent-%COMP%]{grid-area:previously-absent;text-decoration:none;color:#00000080;justify-self:end}.student-info[_ngcontent-%COMP%]{grid-area:student-info;display:flex;flex-direction:column;text-decoration:none}.student-info[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{text-decoration:underline}.student-info[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.unconfirmed-absences[_ngcontent-%COMP%]{color:#ea161f;font-size:.875rem;line-height:1}.study-class[_ngcontent-%COMP%]{font-size:.875rem;line-height:1}.incident[_ngcontent-%COMP%]{color:#00000080;padding-right:1.5rem;grid-area:incident;display:flex;text-decoration:none}.incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.incident[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.incident[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:.3em}.grid[_nghost-%COMP%] .status[_ngcontent-%COMP%], .grid[_nghost-%COMP%] .designation[_ngcontent-%COMP%]{align-self:start;margin-left:-1.5rem;margin-top:-.375rem}.grid[_nghost-%COMP%] .incident[_ngcontent-%COMP%]{align-self:end;margin-left:-1.5rem;margin-bottom:-.375rem}.grid[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{padding-right:0;align-self:start}.grid[_nghost-%COMP%] .unconfirmed-absences[_ngcontent-%COMP%]{height:.875rem}.list[_nghost-%COMP%]{grid-template-areas:"student-info status incidentordesignation previously-absent";grid-template-columns:3fr min-content 4fr 3em;padding:.5rem 1rem}.list[_nghost-%COMP%] .status[_ngcontent-%COMP%]{justify-self:start}.list[_nghost-%COMP%] .student-name[_ngcontent-%COMP%]{line-height:1;margin-bottom:.5rem}.list[_nghost-%COMP%] .incident[_ngcontent-%COMP%], .list[_nghost-%COMP%] .designation[_ngcontent-%COMP%]{grid-area:incidentordesignation}.list[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{padding-right:0}@media (max-width: 750px){.list[_nghost-%COMP%]{grid-template-areas:"student-info student-info student-info previously-absent" "status incidentordesignation incidentordesignation incidentordesignation";grid-template-columns:min-content 1fr 1fr min-content;row-gap:1rem}.list[_nghost-%COMP%] .status[_ngcontent-%COMP%]{padding-left:0;padding-right:0}.list[_nghost-%COMP%] .student-name[_ngcontent-%COMP%]{margin-top:.5rem}.list[_nghost-%COMP%] .previously-absent[_ngcontent-%COMP%]{align-self:start}}']})}}return n})();var Ai=(n,r)=>r.viewMode,Ri=(n,r)=>r.id,Gi=(n,r)=>({"btn-link":n,"btn-danger":r}),Ni=n=>["groups",n],Ui=n=>({returnparams:n});function Hi(n,r){if(n&1){let e=S();c(0,"div",22),C("click",function(){v(e);let i=f();return b(i.lessonDropdown==null?null:i.lessonDropdown.toggle())}),d(1),p(2,"date"),c(3,"span",23),d(4),p(5,"date"),a()()}if(n&2){let e=f();s(),y(" ",U(2,2,e.selectedLesson.LessonDateTimeFrom,"HH:mm"),"\u2013"),s(3),I(U(5,5,e.selectedLesson.LessonDateTimeTo,"HH:mm"))}}function qi(n,r){if(n&1){let e=S();c(0,"div",28),C("click",function(){let i=v(e).$implicit,o=f(2);return b(o.selectLessonChange.emit(i))}),c(1,"div",29)(2,"div"),d(3),p(4,"date"),p(5,"date"),a(),c(6,"div",25),d(7),a(),c(8,"div",25),d(9),a()()()}if(n&2){let e=r.$implicit,t=f(2);J("active",e.id===t.selectedLesson.id),s(3),Tt(" ",U(4,6,e.LessonDateTimeFrom,"HH:mm"),"\u2013",U(5,9,e.LessonDateTimeTo,"HH:mm")," "),s(4),y(" ",e.eventDesignations," "),s(2),y(" ",e.studyClassNumbers," ")}}function Wi(n,r){if(n&1&&(c(0,"div",7)(1,"div",24)(2,"div",25),d(3),a(),c(4,"div",25),d(5),a()(),c(6,"div",26),B(7,qi,10,12,"div",27,Ri),a()()),n&2){let e=f();s(3),I(e.selectedLesson.eventDesignations),s(2),I(e.selectedLesson.studyClassNumbers),s(2),j(e.lessons)}}function Qi(n,r){if(n&1){let e=S();c(0,"bkd-caret",30),C("click",function(){v(e);let i=f();return b(i.lessonDropdown==null?null:i.lessonDropdown.toggle())}),a()}if(n&2){let e=f();x("expanded",(e.lessonDropdown==null?null:e.lessonDropdown.isOpen())||!1)}}function Ki(n,r){if(n&1&&(c(0,"a",19),p(1,"async"),p(2,"async"),p(3,"async"),c(4,"i",31),d(5,"groups"),a()()),n&2){let e=f();x("ngClass",$t(9,Gi,m(1,3,e.isGroupSelected$)===!1,m(2,5,e.isGroupSelected$)))("routerLink",ne(12,Ni,e.selectedLesson.id))("queryParams",ne(14,Ui,m(3,7,e.state.queryParamsString$)))}}function zi(n,r){if(n&1){let e=S();c(0,"button",32),C("click",function(){let i=v(e).$implicit,o=f();return b(o.viewModeChange.emit(i.viewMode))}),c(1,"i",31),d(2),a()()}if(n&2){let e=r.$implicit,t=f();J("btn-outline-secondary",e.viewMode===t.viewMode)("btn-link",e.viewMode!==t.viewMode)("active",e.viewMode===t.viewMode),x("disabled",!t.selectedLesson),s(2),I(e.icon)}}var Ji=Le.prototype._positionMenu;Le.prototype._positionMenu=function(...r){let e=Ji.apply(this,r);if(this._anchor.nativeElement.id==="lesson-dropdown"){let t=this._bodyContainer||this._menu.nativeElement,i=t.style.transform?.match(/translate\(([0-9-.]+)px, ([0-9-.]+)px\)/);i&&parseFloat(i[1])<0&&(t.style.transform=`translate(0px, ${i[2]}px)`)}return e};var Jn=(()=>{class n{constructor(e,t,i){this.state=e,this.groupService=t,this.presentCount=null,this.absentCount=null,this.unapprovedCount=null,this.absentPrecedingCount=null,this.search="",this.selectLessonChange=new te,this.selectDateChange=new te,this.searchChange=new te,this.viewModeChange=new te,this.viewModeOptions=[{viewMode:pe.List,icon:"list"},{viewMode:pe.Grid,icon:"view_module"}],this.isGroupSelected$=this.groupService.group$.pipe(u(Kt)),i.popperOptions=o=>de(le({},o),{modifiers:o.modifiers?.map(l=>(l.name==="offset"&&(l.options={offset:({placement:g,reference:w,popper:F})=>g==="bottom-start"?[(window.innerWidth-F.width)/2-w.x,0]:[]}),l))})}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(ae),h(Ge))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-header"]],viewQuery:function(t,i){if(t&1&&xt(Le,5),t&2){let o;It(o=wt())&&(i.lessonDropdown=o.first)}},inputs:{selectedLesson:"selectedLesson",lessons:"lessons",presentCount:"presentCount",absentCount:"absentCount",unapprovedCount:"unapprovedCount",absentPrecedingCount:"absentPrecedingCount",viewMode:"viewMode",selectDate:"selectDate",search:"search"},outputs:{selectLessonChange:"selectLessonChange",selectDateChange:"selectDateChange",searchChange:"searchChange",viewModeChange:"viewModeChange"},features:[ue([Ge,{provide:At,useClass:Nt},{provide:Rt,useClass:yn}])],decls:41,vars:19,consts:[["d","ngbDatepicker"],[1,"navigation"],[1,"lesson-date"],["type","button",1,"btn","btn-link",3,"click"],[1,"material-icons"],["positionTarget",".lesson-date-input","ngbDatepicker","","placement","bottom-start",1,"lesson-date-input",3,"ngModelChange","ngModel"],[1,"lesson-time"],["ngbDropdown","","container","body","display","dynamic","placement","bottom",1,"lesson-description"],[1,"dropdown-caret",3,"expanded"],[1,"states"],[1,"state","present"],[1,"count"],[1,"state","absent"],[1,"state","unapproved"],[1,"state","previously-absent"],[1,"material-icons-outlined"],[1,"search-and-views"],[1,"search",3,"valueChange","value","disabled","placeholder","label"],[1,"group-and-views","d-flex","align-items-center"],["type","button",1,"group","btn","me-2","me-sm-4",3,"ngClass","routerLink","queryParams"],[1,"views"],["type","button",1,"view","btn","btn-primary","btn-icon",3,"disabled","btn-outline-secondary","btn-link","active"],[1,"lesson-time",3,"click"],[1,"lesson-time-to"],["id","lesson-dropdown","ngbDropdownToggle",""],[1,"text-truncate"],["ngbDropdownMenu","","aria-labelledby","lesson-dropdown"],["ngbDropdownItem","",3,"active"],["ngbDropdownItem","",3,"click"],[1,"lesson-entry"],[1,"dropdown-caret",3,"click","expanded"],[1,"material-icons","align-middle"],["type","button",1,"view","btn","btn-primary","btn-icon",3,"click","disabled"]],template:function(t,i){if(t&1){let o=S();c(0,"div",1)(1,"div",2)(2,"button",3),C("click",function(){v(o);let g=Mt(6);return b(g.toggle())}),c(3,"i",4),d(4,"calendar_today"),a()(),c(5,"input",5,0),C("ngModelChange",function(g){return v(o),b(i.selectDateChange.emit(g))}),a()(),L(7,Hi,6,8,"div",6)(8,Wi,9,2,"div",7)(9,Qi,1,1,"bkd-caret",8),a(),c(10,"div",9)(11,"div",10)(12,"i",4),d(13,"check_circle"),a(),c(14,"span",11),d(15),a()(),c(16,"div",12)(17,"i",4),d(18,"cancel"),a(),c(19,"span",11),d(20),a()(),c(21,"div",13)(22,"i",4),d(23,"help"),a(),c(24,"span",11),d(25),a()(),c(26,"div",14)(27,"i",15),d(28,"info"),a(),c(29,"span",11),d(30),a()()(),c(31,"div",16)(32,"bkd-resettable-input",17),p(33,"translate"),p(34,"translate"),C("valueChange",function(g){return v(o),b(i.searchChange.emit(g))}),a(),c(35,"div",18),L(36,Ki,6,16,"a",19),p(37,"async"),c(38,"div",20),B(39,zi,3,8,"button",21,Ai),a()()()}t&2&&(s(5),x("ngModel",i.selectDate),s(2),k(i.selectedLesson?7:-1),s(),k(i.selectedLesson?8:-1),s(),k(i.lessons.length>0?9:-1),s(6),I(i.presentCount!==null?i.presentCount:"?"),s(5),I(i.absentCount!==null?i.absentCount:"?"),s(5),I(i.unapprovedCount!==null?i.unapprovedCount:"?"),s(5),I(i.absentPrecedingCount!==null?i.absentPrecedingCount:"?"),s(2),x("value",i.search)("disabled",!i.selectedLesson)("placeholder",m(33,13,"presence-control.header.search-by-name"))("label",m(34,15,"presence-control.header.search")),s(4),k(m(37,17,i.selectedLesson&&i.state.groupsAvailability$)?36:-1),s(3),j(i.viewModeOptions))},dependencies:[Gt,oe,jt,Vt,Ft,Le,qt,Ht,Ut,cn,_n,Ot,Re,ie,ge,V],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;padding:.75rem 0}.navigation[_ngcontent-%COMP%]{display:grid;grid-template-areas:". date time dropdown-caret" ". description description dropdown-caret";grid-template-columns:1fr auto auto 1fr;align-items:center}.lesson-date[_ngcontent-%COMP%]{grid-area:date;justify-self:end;display:flex;align-items:center;justify-content:flex-end}.lesson-date[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:0 .5ch 0 0}.lesson-date[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000;position:relative}.lesson-date-input[_ngcontent-%COMP%]{font-weight:600;background:transparent;border:none;width:11ch}.lesson-time[_ngcontent-%COMP%]{grid-area:time;cursor:pointer}.lesson-description[_ngcontent-%COMP%]{grid-area:description;overflow:hidden;text-align:center;cursor:pointer}.dropdown-toggle[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dropdown-toggle[_ngcontent-%COMP%]:after{display:none}.dropdown-caret[_ngcontent-%COMP%]{grid-area:dropdown-caret;line-height:100%;text-align:left;color:#000}.dropdown-menu[_ngcontent-%COMP%]{width:50ch;padding:0;box-shadow:2px 2px 3px -1px #0003}@media (max-width: 800px){.dropdown-menu[_ngcontent-%COMP%]{width:100vw}}.dropdown-item[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid #dee2e6}.states[_ngcontent-%COMP%]{margin:.75rem 0;display:flex;justify-content:center}.state[_ngcontent-%COMP%]{margin-right:7%;display:flex}.state[_ngcontent-%COMP%]:last-child{margin-right:0}@media (min-width: 1000px){.state[_ngcontent-%COMP%]{margin-right:4rem}}.state.present[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#3d8608}.state.absent[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#ea161f}.state.unapproved[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#ffa814}.state.previously-absent[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#00000080}.state[_ngcontent-%COMP%] .count[_ngcontent-%COMP%]{margin-left:.3em;margin-top:1px}.search-and-views[_ngcontent-%COMP%]{padding-top:.75rem;display:flex;justify-content:space-between;border-top:1px solid #dee2e6}.search[_ngcontent-%COMP%]{flex:auto;max-width:300px;margin-right:1rem}.views[_ngcontent-%COMP%]{display:flex}.view[_ngcontent-%COMP%]{color:#4e4e4ef2;background-color:#fff}.view.active[_ngcontent-%COMP%]{color:#fff;background-color:#4e4e4ef2;border:none}.group[_ngcontent-%COMP%], .view[_ngcontent-%COMP%]{text-decoration:none;padding-left:0;padding-right:0;aspect-ratio:1/1;width:calc(.75rem + 2 * var(--bs-border-width) + 1.625rem);border-radius:50%}.group.btn-link[_ngcontent-%COMP%]{color:#000}@media (max-width: 380px){[_nghost-%COMP%]{padding-left:.5rem;padding-right:.5rem}#search-addon[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem}}@media (max-width: 365px){.lesson-time[_ngcontent-%COMP%]{line-height:1}.lesson-time-to[_ngcontent-%COMP%]{display:block}.dropdown-caret[_ngcontent-%COMP%]{padding-left:0}}']})}}return n})();var Xi=(n,r)=>r.id;function Yi(n,r){if(n&1){let e=S();c(0,"div",1)(1,"input",5),C("change",function(){let i=v(e).$implicit,o=f();return b(o.onSelectionChange(i))}),a(),c(2,"label",6),d(3),a()()}if(n&2){let e=r.$implicit,t=r.$index,i=f();s(),X("id","incident-",t,""),x("checked",e.id===i.selected.id)("value",e.id),s(),X("for","incident-",t,""),s(),y(" ",e.label," ")}}var Xn=(()=>{class n{constructor(e,t){this.activeModal=e,this.translate=t,this.incidentOptions=[]}ngOnInit(){let e=this.createIncidentOption();this.incidentOptions=this.incidentTypes.map(t=>this.createIncidentOption(t)),this.incidentOptions.unshift(e),this.selected=this.incidentOptions.find(t=>t.id===this.incident?.Id)||e}createIncidentOption(e){return{id:e?e.Id:null,label:e?e.Designation:this.translate.instant("presence-control.incident.no-incident")}}onSelectionChange(e){this.selected=e}getSelectedIncident(){return this.incidentTypes.find(e=>e.Id===this.selected?.id)||null}static{this.\u0275fac=function(t){return new(t||n)(h(re),h(K))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-incident"]],inputs:{incident:"incident",incidentTypes:"incidentTypes"},decls:14,vars:9,consts:[[1,"modal-body"],[1,"form-check"],[1,"modal-footer"],["type","button",1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["type","radio","name","incident",1,"form-check-input",3,"change","id","checked","value"],[1,"form-check-label",3,"for"]],template:function(t,i){t&1&&(c(0,"div",0)(1,"p"),d(2),p(3,"translate"),a(),c(4,"form"),B(5,Yi,4,7,"div",1,Xi),a()(),c(7,"div",2)(8,"button",3),C("click",function(){return i.activeModal.dismiss()}),d(9),p(10,"translate"),a(),c(11,"button",4),C("click",function(){return i.activeModal.close(i.getSelectedIncident())}),d(12),p(13,"translate"),a()()),t&2&&(s(2),y(" ",m(3,3,"presence-control.incident.text")," "),s(3),j(i.incidentOptions),s(4),y(" ",m(10,5,"presence-control.incident.cancel")," "),s(3),y(" ",m(13,7,"presence-control.incident.save")," "))},dependencies:[oe,Ce,fe,he,V],styles:["form[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:first-child{border-bottom:1px solid #dee2e6;padding-bottom:1rem;margin-bottom:1rem}"]})}}return n})();var Zi=20,eo=100,Ee=function(n){return n.AddUpdateAction="ADD",n.RemoveUpdateAction="REMOVE",n}(Ee||{}),et=(()=>{class n{constructor(e,t,i,o,l){this.toastService=e,this.translate=t,this.restService=i,this.presenceTypesService=o,this.settings=l,this.destroy$=new $,this.action$=new $,this.pendingUpdates$=this.action$.pipe(_t(this.reduceUpdates.bind(this),[]),vt()),this.revertUpdates$=new $,this.performUpdates$=this.pendingUpdates$.pipe(tt(eo),Te(Ue(st)),Ct(this.performUpdates.bind(this))),this.stateUpdates$=ee(this.pendingUpdates$,this.revertUpdates$).pipe(tt(Zi),Te(Ue(st))),this.performUpdates$.pipe(q(this.destroy$)).subscribe()}ngOnDestroy(){this.destroy$.next()}updatePresenceType(e,t=null){this.dispatchAddUpdate(e.lessonPresence,t)}performUpdates(e){let t=this.groupUpdates(e);return M(Object.keys(t).reduce((i,o)=>{let l=t[o];return Object.keys(l).forEach(g=>{let w=l[g];i.push(this.performUpdateForGroup(w))}),i},[])).pipe(u(()=>t))}performUpdateForGroup(e){return e.forEach(t=>this.dispatchRemoveUpdate(t.presence)),this.performLessonPresencesUpdatesByIds(e[0].presence.LessonRef.Id,e.map(t=>t.presence.StudentRef.Id),e[0].newPresenceTypeId).pipe(ht(t=>this.revertUpdatesAfterError(e,t)))}performLessonPresencesUpdatesByIds(e,t,i=null){return i?(i?this.presenceTypesService.getPresenceType(i):Z(null)).pipe(T(l=>this.restService.editLessonPresences([e],t,l?.Id,He(l,this.settings)||void 0,{context:new it().set(ct,{disableErrorHandling:!0})}))):this.restService.removeLessonPresences([e],t,{context:new it().set(ct,{disableErrorHandling:!0})})}revertUpdatesAfterError(e,t){return console.error("Bulk-update of lesson presences failed"),console.error(t),this.toastService.error(this.translate.instant("shared.lesson-presences-update.error")),this.revertUpdates$.next(e.map(i=>de(le({},i),{newPresenceTypeId:i.presence.TypeRef.Id}))),Z(void 0)}groupUpdates(e){return e.reduce((t,i)=>{let o=String(i.newPresenceTypeId&&i.newPresenceTypeId);return t[o]||(t[o]={}),Array.isArray(t[o][i.presence.LessonRef.Id])||(t[o][i.presence.LessonRef.Id]=[]),t[o][i.presence.LessonRef.Id].push(i),t},{})}reduceUpdates(e,t){switch(t.type){case Ee.AddUpdateAction:{let{presence:i,newPresenceTypeId:o}=t.payload,l=e.findIndex(Yn(i));return l===-1?[...e,{presence:i,newPresenceTypeId:o}]:[...e.slice(0,l),{presence:e[l].presence,newPresenceTypeId:o},...e.slice(l+1)]}case Ee.RemoveUpdateAction:return e.filter(Ue(Yn(t.payload)));default:return e}}dispatchAddUpdate(e,t){this.action$.next({type:Ee.AddUpdateAction,payload:{presence:e,newPresenceTypeId:t}})}dispatchRemoveUpdate(e){this.action$.next({type:Ee.RemoveUpdateAction,payload:e})}static{this.\u0275fac=function(t){return new(t||n)(_(_e),_(K),_(sn),_(ve),_(H))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Yn(n){return r=>r.presence.LessonRef.Id===n.LessonRef.Id&&r.presence.StudentRef.Id===n.StudentRef.Id}var to=(n,r)=>r.id,no=()=>[],io=n=>({returnparams:n});function oo(n,r){n&1&&W(0,"bkd-spinner")}function ro(n,r){n&1&&(c(0,"p",1),d(1),p(2,"translate"),a()),n&2&&(s(),I(m(2,1,"presence-control.no-lessons")))}function so(n,r){n&1&&(c(0,"p",1),d(1),p(2,"translate"),a()),n&2&&(s(),y(" ",m(2,1,"presence-control.no-lesson-presences")," "))}function co(n,r){if(n&1){let e=S();c(0,"bkd-presence-control-entry",4),p(1,"async"),p(2,"async"),p(3,"async"),p(4,"async"),C("togglePresenceType",function(i){v(e);let o=f(3);return b(o.togglePresenceType(i))})("changeIncident",function(i){v(e);let o=f(3);return b(o.changeIncident(i))}),a()}if(n&2){let e,t=r.$implicit,i=f(3);x("entry",t)("hasUnconfirmedAbsences",m(1,5,i.state.hasUnconfirmedAbsences(t)))("viewMode",m(2,7,i.state.viewMode$))("showClassName",((e=m(3,9,i.state.studyClassCount$))!==null&&e!==void 0?e:0)>1)("profileReturnParams",ne(13,io,m(4,11,i.state.queryParamsString$)))}}function ao(n,r){if(n&1&&(c(0,"div"),p(1,"async"),B(2,co,5,15,"bkd-presence-control-entry",3,to),a()),n&2){let e=f(2),t=Q(4);Ve("default-entries entries view-mode-",m(1,3,e.state.viewMode$),""),s(2),j(t)}}function po(n,r){if(n&1){let e=S();c(0,"bkd-presence-control-header",0),p(1,"async"),p(2,"async"),p(3,"async"),p(4,"async"),p(5,"async"),p(6,"async"),p(7,"async"),C("searchChange",function(i){v(e);let o=f();return b(o.search$.next(i))})("viewModeChange",function(i){v(e);let o=f();return b(o.state.setViewMode(i))})("selectDateChange",function(i){v(e);let o=f();return b(o.state.setDate(i))})("selectLessonChange",function(i){v(e);let o=f();return b(o.state.setLessonId(i.id))}),a(),L(8,ro,3,3,"p",1)(9,so,3,3,"p",1)(10,ao,4,5,"div",2)}if(n&2){let e=f(),t=Q(0),i=Q(2),o=Q(4);x("selectedLesson",t)("lessons",i)("presentCount",m(1,10,e.state.presentCount$))("absentCount",m(2,12,e.state.absentCount$))("unapprovedCount",m(3,14,e.state.unapprovedCount$))("absentPrecedingCount",m(4,16,e.state.absentPrecedingCount$))("viewMode",m(5,18,e.state.viewMode$))("selectDate",m(6,20,e.state.selectedDate$))("search",m(7,22,e.search$)),s(8),k(t?o.length===0?9:10:8)}}var lo=["studentFullName"],ei=(()=>{class n{constructor(e,t,i,o,l,g,w){this.state=e,this.blockLessons=t,this.lessonPresencesUpdateService=i,this.presenceTypesService=o,this.modalService=l,this.scrollPosition=g,this.route=w,this.search$=new me(""),this.entries$=M([this.state.presenceControlEntriesByGroup$,this.search$]).pipe(u(([F,Se])=>vn(F,lo,Se)),E(1)),this.destroy$=new $}ngOnInit(){this.route.queryParams.pipe(q(this.destroy$)).subscribe(this.restoreStateFromParams.bind(this))}ngAfterViewInit(){this.scrollPosition.restore()}ngOnDestroy(){this.destroy$.next()}doTogglePresenceType(e){e.forEach(t=>this.state.getNextPresenceType(t).subscribe(i=>this.lessonPresencesUpdateService.updatePresenceType(t,i?i.Id:null)))}togglePresenceType(e){this.blockLessons.getBlockLessonPresenceControlEntries(e).pipe(O(1)).subscribe(t=>{if(t.length===1){let i=t[0];this.doTogglePresenceType([i])}else{let i=this.modalService.open(Qn);i.componentInstance.entry=e,i.componentInstance.blockPresenceControlEntries=t,i.result.then(o=>{o&&this.doTogglePresenceType(o)},()=>{})}})}updateIncident(e,t){this.lessonPresencesUpdateService.updatePresenceType(e,t)}changeIncident(e){this.presenceTypesService.incidentTypes$.subscribe(t=>{let i=this.modalService.open(Xn);i.componentInstance.incident=t.find(o=>o.Id===e.presenceType?.Id)||null,i.componentInstance.incidentTypes=t,i.result.then(o=>{this.updateIncident(e,o?.Id||null)},()=>{})})}restoreStateFromParams(e){e.date&&this.state.setDate(Bt(e.date));let t=String(e.lesson);t&&this.state.setLessonId(t),e.viewMode&&Un.includes(e.viewMode)&&this.state.setViewMode(e.viewMode)}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(Ze),h(et),h(ve),h(ye),h(Sn),h(Ae))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control-list"]],decls:12,vars:16,consts:[[3,"searchChange","viewModeChange","selectDateChange","selectLessonChange","selectedLesson","lessons","presentCount","absentCount","unapprovedCount","absentPrecedingCount","viewMode","selectDate","search"],[1,"mt-3"],[3,"class"],[3,"entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams"],[3,"togglePresenceType","changeIncident","entry","hasUnconfirmedAbsences","viewMode","showClassName","profileReturnParams"]],template:function(t,i){if(t&1&&(G(0),p(1,"async"),G(2),p(3,"async"),G(4),p(5,"async"),c(6,"h1"),d(7),p(8,"translate"),a(),L(9,oo,1,0,"bkd-spinner"),p(10,"async"),L(11,po,11,24)),t&2){let o;Y(m(1,2,i.state.selectedLesson$)),s(2),Y(m(3,5,i.state.lessons$)),s(2),Y((o=m(5,8,i.entries$))!==null&&o!==void 0?o:ke(15,no)),s(3),I(m(8,11,"presence-control.title")),s(2),k(m(10,13,i.state.loading$)?9:11)}},dependencies:[Jn,zn,be,ie,V],styles:["bkd-presence-control-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6}.entries.view-mode-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr))}.entries.view-mode-grid[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{border-right:1px solid #dee2e6}[_nghost-%COMP%]{display:block;overflow:hidden;width:100%}.entries.view-mode-grid[_ngcontent-%COMP%]{width:calc(100% + 1px)}"],changeDetection:0})}}return n})();var ti=(()=>{class n{constructor(e,t){this.state=e,this.lessonPresencesUpdateService=t,this.destroy$=new $}ngOnInit(){this.lessonPresencesUpdateService.stateUpdates$.pipe(q(this.destroy$)).subscribe(e=>this.state.updateLessonPresencesTypes(e))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(t){return new(t||n)(h(N),h(et))}}static{this.\u0275cmp=D({type:n,selectors:[["bkd-presence-control"]],features:[ue([N,Ze,ae,on,{provide:zt,useExisting:N}])],decls:1,vars:0,template:function(t,i){t&1&&W(0,"router-outlet")},dependencies:[Et],encapsulation:2,changeDetection:0})}}return n})();var sc=[{path:"",component:ti,children:[{path:"",component:ei,data:{restoreScrollPositionFrom:["/presence-control/student/:id/addresses","/presence-control/student/:id/absences","/presence-control/student/:id/grades"]}},Cn,{path:"groups/:id",component:Wn}]}];export{sc as PRESENCE_CONTROL_ROUTES}; diff --git a/public/apps/webapp-schulverwaltung/chunk-TDZZHHCJ.js b/public/apps/webapp-schulverwaltung/chunk-TDZZHHCJ.js new file mode 100644 index 00000000..bdfe17da --- /dev/null +++ b/public/apps/webapp-schulverwaltung/chunk-TDZZHHCJ.js @@ -0,0 +1,2 @@ +import{a as mt}from"./chunk-XUB6XQAX.js";import{a as pt,b as ct}from"./chunk-QB4DIFWS.js";import{a as Vi}from"./chunk-IGEPJF2N.js";import{a as It}from"./chunk-5ZBE3UL7.js";import{e as Ai}from"./chunk-4UVNKLEN.js";import{a as wt,b as ki,c as Pi,d as Mi,e as Oi,f as at,g as ot,h as $i,i as Gi,j as Li,k as Di,l as Fi,m as Be,o as Ri,p as ge,r as je,s as Bi,u as ji,v as lt}from"./chunk-PXVJ3QLD.js";import{e as xi}from"./chunk-CKFTESOV.js";import{b as st}from"./chunk-DTTSX64G.js";import{a as yi}from"./chunk-Y4QYVF5K.js";import{a as Hi}from"./chunk-A3AAQWNQ.js";import{a as ut,c as Ni}from"./chunk-FH4OOWQM.js";import{a as wi,b as Ii}from"./chunk-Z4YBXGVO.js";import{a as bi,d as dt}from"./chunk-3L4RH6QP.js";import{a as Ti,d as Ei}from"./chunk-DTYYCJHM.js";import{G as Ae,x as Si}from"./chunk-UYCIECIQ.js";import{a as Fe,c as Ci,d as Re}from"./chunk-G6EB45SC.js";import{o as _i}from"./chunk-WCDEMEW2.js";import{i as rt,j as xe}from"./chunk-XFA6UPZX.js";import{a as nt,b as he}from"./chunk-PSYDBHTH.js";import{a as ei,b as se,h as pi,i as ci,k as mi,l as ui,r as tt,w as ue}from"./chunk-W4U7QKJF.js";import{a as it}from"./chunk-AVBHFGIF.js";import{$ as Vt,$a as a,$b as ce,Ab as R,Ad as Le,B as Ft,Bb as A,Bd as li,C as Rt,Cb as P,D as Bt,Db as ne,Ea as Tt,Eb as Me,F as oe,Fa as ke,Fb as D,Ga as S,Gb as Et,H as Z,Hd as hi,Ia as Yt,Id as gi,J as Ye,Ja as Kt,Jb as p,K as jt,Kb as c,Kd as fi,Lb as F,M as Q,Md as vi,Na as T,O as At,Ob as Xt,Od as ae,P as O,Pd as I,Qa as m,R as _e,Ra as le,Rd as De,Sb as U,Tb as Jt,Va as _,X as de,Xa as Pe,Ya as V,Za as H,_ as $,_a as s,a as L,ab as C,b as B,ba as Ht,ca as Nt,cc as Y,cd as me,da as Ie,dc as Oe,ea as E,eb as G,f as te,fa as w,fd as Ze,g as z,gb as b,h as bt,ha as Ut,hb as u,hd as Ge,ib as Zt,id as Qe,jb as Qt,jd as ti,ka as Wt,kb as pe,l as N,lb as Ne,lc as Ke,m as Dt,ma as J,md as ii,n as y,nd as ni,o as q,od as Xe,pa as zt,pd as ri,qa as j,qb as Se,ra as qt,rb as l,rd as si,sb as v,sd as ai,tb as f,ub as Ue,w as qe,wa as ie,wc as re,wd as Je,x as ve,xa as r,xb as Te,xc as ye,xd as et,ya as x,yb as Ee,yc as $e,yd as oi,zb as we,zc as X,zd as di}from"./chunk-2W7IS4PN.js";var zn=t=>[t,"tests"];function qn(t,o){if(t&1&&(s(0,"span"),l(1),p(2,"date"),C(3,"wbr"),l(4),p(5,"date"),a()),t&2){let e=u();r(),f("",F(2,2,e.event().dateFrom,"dd.MM.yyyy"),"\u2013"),r(3),v(F(5,5,e.event().dateTo,"dd.MM.yyyy"))}}function Yn(t,o){if(t&1&&(s(0,"a",6)(1,"i",8),l(2,"arrow_right_alt"),a(),s(3,"span",9),l(4),a()()),t&2){let e=u(2);m("routerLink",D(2,zn,e.event().id)),r(4),v(e.event().evaluationText)}}function Kn(t,o){if(t&1&&(s(0,"a",7)(1,"i",8),l(2,"arrow_right_alt"),a(),s(3,"span",9),l(4),a()()),t&2){let e=u(2);m("href",e.event().evaluationLink,ie),r(4),f("",e.event().evaluationText," ")}}function Zn(t,o){if(t&1&&(s(0,"div",5),T(1,Yn,5,4,"a",6)(2,Kn,5,2,"a",7),a()),t&2){let e=u();r(),_(e.event().evaluationLink?-1:1),r(),_(e.event().evaluationLink?2:-1)}}var Ui=(()=>{class t{constructor(){this.event=j.required(),this.withRatings=j(!0),this.link=U(()=>Ei(this.event().detailLink))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-list-entry"]],inputs:{event:[1,"event"],withRatings:[1,"withRatings"]},decls:11,vars:9,consts:[[1,"designation"],[3,"routerLink","queryParams"],[1,"date"],[1,"registrations"],[1,"registrations-label"],[1,"rating"],[1,"d-flex",3,"routerLink"],[1,"d-flex",3,"href"],[1,"material-icons"],[1,"ps-1"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"a",1),l(2),a()(),s(3,"div",2),T(4,qn,6,8,"span"),a(),s(5,"div",3),l(6),s(7,"span",4),l(8),p(9,"translate"),a()(),T(10,Zn,3,2,"div",5)),i&2&&(r(),m("routerLink",n.link().link)("queryParams",n.link().params),r(),v(n.event().designation),r(2),_(n.event().dateFrom&&n.event().dateTo?4:-1),r(2),f(" ",n.event().studentCount," "),r(2),v(c(9,7,n.event().studentCount===1?"events.registration":"events.registrations")),r(2),_(n.withRatings()&&n.event().evaluationText?10:-1))},dependencies:[X,Oe,I],styles:['[_nghost-%COMP%]{display:grid;padding:1rem;border-bottom:1px solid #dee2e6;grid-template-areas:"designation date registrations rating";grid-template-columns:4fr 2fr 2fr 3fr}.designation[_ngcontent-%COMP%]{grid-area:designation;padding-right:1rem}.date[_ngcontent-%COMP%]{grid-area:date;padding-right:1rem}.registrations[_ngcontent-%COMP%]{grid-area:registrations;padding-right:1rem}.rating[_ngcontent-%COMP%]{grid-area:rating}.rating[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.rating[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.rating[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.registrations-label[_ngcontent-%COMP%]{display:none}@media (max-width: 575.98px){.registrations-label[_ngcontent-%COMP%]{display:inline}.designation[_ngcontent-%COMP%], .date[_ngcontent-%COMP%], .registrations[_ngcontent-%COMP%]{padding-right:0}[_nghost-%COMP%]{grid-template-areas:"designation" "date" "registrations" "rating";grid-template-columns:1fr}}']})}}return t})();var Qn=10300,Xn=10260,Jn=10250,er=14030,tr=10350;function ht(t){let{HasEvaluationStarted:o,EvaluationUntil:e,HasTestGrading:i}=t.EvaluationStatusRef;if(o===!0&&(t.StatusId===er||t.StatusId===tr))return{value:ee.Rating};if(o===!0&&i===!1){if(e)return{value:ee.RatingUntil};if(t.StatusId===Qn)return{value:ee.IntermediateRating}}return o===!1&&i===!0&&t.StatusId!==Xn&&t.StatusId!==Jn?{value:ee.Tests}:o===!0&&i===!0?e?{value:ee.Tests,label:ee.RatingUntil}:{value:ee.Tests,label:ee.IntermediateRating}:null}function Wi(t){return t.EvaluationStatusRef.HasEvaluationStarted===!0}function zi(t){return t.EvaluationStatusRef.HasReviewOfEvaluationStarted===!0&&!!t.FinalGrades?.length}function gt(t){let o=t.Classes?t.Classes.map(e=>e.Number).join(", "):null;return o?t.Designation+", "+o:t.Designation}function qi(t,o){return t?(o.Leadership??"").split(",").some(e=>e.trim()===t.fullname):!1}function Yi(t,o){let e=new URLSearchParams({returnlink:o});return o.startsWith("/dashboard")?`/dashboard/students/${t}?${e}`:o.startsWith("/events/current")?`/events/current/${t}?${e}`:`/events/${t}/students?${e}`}function Ki(t){let o=t.ParticipatingStudents?.map(e=>({id:e.Id,name:e.FullName,email:e.DisplayEmail??void 0}))??[];return{eventId:t.Id,eventDesignation:t.Designation,studyClasses:(t.Classes??[]).map(e=>e.Designation).sort(),entries:o}}function kt(t,o){return B(L({},t),{entries:t.entries.map(e=>{let i=o.find(d=>d.StudentId===e.id),n=i?[i.CompanyName,i.CompanyNameAddition].filter(Boolean).join(" \u2013 "):void 0;return B(L({},e),{company:n})})})}function Pt(t,o,e,{eventDesignation:i,emailFallback:n}={}){return{eventId:t,eventDesignation:i??e[0]?.EventDesignation??"",studyClasses:[],entries:o.map(d=>({id:d.Id,subscriptionId:e.find(h=>h.PersonId===d.Id)?.Id,name:d.FullName,email:(n?d.DisplayEmail??d.Email:d.DisplayEmail)??void 0,status:e.find(h=>h.PersonId===d.Id)?.Status}))}}function Zi(t,o){return B(L({},t),{entries:t.entries.map(e=>B(L({},e),{studyClass:o.find(i=>i.StudentRef.Id===e.id)?.StudyClassNumber}))})}var ee=function(t){return t.Rating="rating",t.RatingUntil="rating-until",t.IntermediateRating="intermediate-rating",t.Tests="add-tests",t}(ee||{}),He=(()=>{class t{constructor(e,i,n,d,h,g,k,W,fe){this.coursesRestService=e,this.eventsRestService=i,this.studyClassRestService=n,this.subscriptionsRestService=d,this.loadingService=h,this.storageService=g,this.translate=k,this.router=W,this.settings=fe,this.loading$=this.loadingService.loading$,this.searchFields$=new z(["designation"]),this.searchSubject$=new z(""),this.search$=this.searchSubject$.asObservable(),this.roles$=new z(null),this.isClassTeacher$=this.roles$.pipe(y(Ce=>yi(Ce,"ClassTeacherRole")),Q(1)),this.withStudyCourses$=new z(!1),this.unratedCourses$=this.roles$.pipe(O(this.loadUnratedCourses.bind(this)),Q(1)),this.studyCourses$=this.withStudyCourses$.pipe(O(this.loadStudyCourses.bind(this)),Q(1)),this.formativeAssessments$=this.isClassTeacher$.pipe(O(this.loadFormativeAssessments.bind(this)),Q(1)),this.studyClasses$=this.isClassTeacher$.pipe(O(this.loadStudyClasses.bind(this)),Q(1)),this.events$=this.getEvents().pipe(Q(1)),this.filteredEvents$=q([this.events$,this.searchFields$,this.search$]).pipe(y(Re(ct)))}setSearch(e){this.searchSubject$.next(e)}setRoles(e){this.roles$.next(e)}setWithStudyCourses(e){this.withStudyCourses$.next(e)}setSearchFields(e){this.searchFields$.next(e)}getEntries(e=!1){return this.filteredEvents$.pipe(y(i=>e?i.filter(n=>n.evaluationText):i))}getEvents(){return this.loadingService.load(q([this.unratedCourses$,this.studyCourses$,this.formativeAssessments$,this.studyClasses$]),{stopOnFirstValue:!0}).pipe(y(Re(this.createAndSortEvents.bind(this))))}loadUnratedCourses(e){return this.coursesRestService.getExpandedCourses(e).pipe(y(i=>i.filter(n=>!zi(n))))}loadStudyCourses(e){if(!e)return N([]);let i=this.storageService.getPayload();return this.eventsRestService.getStudyCourseEvents().pipe(y(n=>n.filter(d=>qi(i,d))),O(n=>this.subscriptionsRestService.getSubscriptionCountsByEvents(n.map(d=>d.Id)).pipe(y(d=>n.map(h=>B(L({},h),{StudentCount:d[h.Id]??0}))))))}loadFormativeAssessments(e){return e?this.studyClassRestService.getActiveFormativeAssessments():N([])}loadStudyClasses(e){return e?this.studyClassRestService.getActive():N([])}createAndSortEvents(e,i,n,d){let h=d.filter(g=>!n.map(k=>k.Id).includes(g.Id));return[...this.createFromCourses(e),...this.createFromStudyCourses(i),...this.createFromAssessments(n),...this.createFromStudyClasses(h)].sort((g,k)=>g.designation.localeCompare(k.designation))}createFromCourses(e){return e.map(i=>{let n=ht(i);return{id:i.Id,designation:gt(i),detailLink:this.buildStudentsLink(i.Id),studentCount:i.AttendanceRef.StudentCount||0,dateFrom:i.DateFrom,dateTo:i.DateTo,state:n?.value||null,evaluationText:this.getEvaluationText(n,i.EvaluationStatusRef.EvaluationUntil),evaluationLink:n?.value&&n?.value!==ee.Tests?this.buildEvaluationLink(i.Id):null}})}createFromStudyCourses(e){return e.map(i=>({id:i.Id,designation:i.Designation,detailLink:this.buildStudentsLink(i.Id),studentCount:i.StudentCount,state:null}))}createFromAssessments(e){return this.createFromStudyClasses(e).map(n=>B(L({},n),{state:ee.Rating,evaluationText:this.translate.instant("events.state.rating"),evaluationLink:this.buildEvaluationLink(n.id)}))}createFromStudyClasses(e){return e.map(i=>({id:i.Id,designation:i.Number,detailLink:this.buildStudentsLink(i.Id),studentCount:i.StudentCount,state:null}))}getEvaluationText(e,i){let n=e?.label||e?.value;return n?this.translate.instant(`events.state.${n}`)+(n===ee.RatingUntil?` ${i?_i(i,"dd.MM.yyyy"):""}`:""):""}buildStudentsLink(e){return Yi(e,this.router.url)}buildEvaluationLink(e){return(this.settings.eventlist.evaluation??"").replace(":id",String(e))}static{this.\u0275fac=function(i){return new(i||t)($(ge),$(mt),$(Vi),$(je),$(xe),$(De),$(ae),$($e),$(me))}}static{this.\u0275prov=de({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var rr=(t,o)=>o.id,sr=()=>[];function ar(t,o){t&1&&C(0,"bkd-spinner")}function or(t,o){t&1&&(s(0,"div",7),l(1),p(2,"translate"),a()),t&2&&(r(),f(" ",c(2,1,"events.rating")," "))}function dr(t,o){if(t&1&&C(0,"bkd-events-list-entry",8),t&2){let e=o.$implicit,i=u(3);m("event",e)("withRatings",i.withRatings)}}function lr(t,o){if(t&1&&(s(0,"div",3)(1,"div",4),l(2),p(3,"translate"),a(),s(4,"div",5),l(5),p(6,"translate"),a(),s(7,"div",6),l(8),p(9,"translate"),a(),T(10,or,3,3,"div",7),a(),V(11,dr,1,2,"bkd-events-list-entry",8,rr)),t&2){let e=u(2),i=P(0);r(2),v(c(3,4,"events.designation")),r(3),v(c(6,6,"events.date")),r(3),f(" ",c(9,8,"events.registrations")," "),r(2),_(e.withRatings?10:-1),r(),H(i)}}function pr(t,o){t&1&&(s(0,"p",2),l(1),p(2,"translate"),a()),t&2&&(r(),v(c(2,1,"events.no-events")))}function cr(t,o){if(t&1&&T(0,lr,13,10)(1,pr,3,3,"p",2),t&2){u();let e=P(0);_(e.length>0?0:1)}}var Ji=["designation"],mr=[...Ji,"evaluationText"],vt=(()=>{class t{constructor(e,i){this.state=e,this.storage=i,this.withStudyCourses=!1,this.withRatings=!0,this.state.setRoles(this.storage.getPayload()?.roles??null)}ngOnChanges(e){e.withStudyCourses&&this.state.setWithStudyCourses(e.withStudyCourses.currentValue),e.withRatings&&this.state.setSearchFields(e.withRatings.currentValue?mr:Ji)}static{this.\u0275fac=function(i){return new(i||t)(x(He),x(De))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-list"]],inputs:{withStudyCourses:"withStudyCourses",withRatings:"withRatings"},features:[Ie],decls:10,vars:17,consts:[[1,"bkd-container"],[1,"d-flex","search",3,"valueChange","value","placeholder","label","disabled"],[1,"mt-3"],[1,"event-header"],[1,"designation"],[1,"date"],[1,"registrations"],[1,"rating"],[3,"event","withRatings"]],template:function(i,n){if(i&1){let d=G();R(0),p(1,"async"),s(2,"div",0)(3,"bkd-resettable-input",1),p(4,"async"),p(5,"translate"),p(6,"translate"),b("valueChange",function(g){return E(d),w(n.state.setSearch(g))}),a(),T(7,ar,1,0,"bkd-spinner"),p(8,"async"),T(9,cr,2,1),a()}if(i&2){let d,h=A((d=c(1,5,n.state.getEntries(n.withRatings)))!==null&&d!==void 0?d:Me(16,sr));r(3),m("value",c(4,8,n.state.search$))("placeholder",c(5,10,"events.search-by"))("label",c(6,12,"events.search"))("disabled",!h),r(4),_(c(8,14,n.state.loading$)?7:9)}},dependencies:[pt,he,Y,I,Ui],styles:['.search[_ngcontent-%COMP%]{max-width:500px}.event-header[_ngcontent-%COMP%]{display:grid;padding:1rem;border-bottom:2px solid #dee2e6;grid-template-areas:"designation date registrations rating";grid-template-columns:4fr 2fr 2fr 3fr}@media (max-width: 575.98px){.event-header[_ngcontent-%COMP%]{display:none}}']})}}return t})();var en=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-current-list"]],decls:4,vars:5,consts:[[3,"withStudyCourses","withRatings"]],template:function(i,n){i&1&&(s(0,"h1"),l(1),p(2,"translate"),a(),C(3,"bkd-events-list",0)),i&2&&(r(),v(c(2,3,"events.current.title")),r(2),m("withStudyCourses",!0)("withRatings",!1))},dependencies:[vt,I],encapsulation:2,changeDetection:0})}}return t})();var tn=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-current"]],decls:1,vars:0,template:function(i,n){i&1&&C(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();var nn=(()=>{class t{constructor(){this.entry=j.required(),this.multipleStudyClasses=j(!1),this.returnLink=j(null),this.link=U(()=>["student",this.entry().id,"addresses"]),this.linkParams=U(()=>{let e=this.returnLink();return e?{returnparams:new URLSearchParams({returnlink:e}).toString()}:{}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-students-course-entry"]],inputs:{entry:[1,"entry"],multipleStudyClasses:[1,"multipleStudyClasses"],returnLink:[1,"returnLink"]},decls:7,vars:10,consts:[[1,"avatar","large",3,"studentId","link","linkParams"],[1,"name",3,"title","routerLink","queryParams"],[1,"study-class"],[1,"company",3,"title"]],template:function(i,n){i&1&&(C(0,"bkd-avatar",0),s(1,"a",1),l(2),a(),s(3,"div",2),l(4),a(),s(5,"div",3),l(6),a()),i&2&&(m("studentId",n.entry().id)("link",n.link())("linkParams",n.linkParams()),r(),m("title",n.entry().name)("routerLink",n.link())("queryParams",n.linkParams()),r(),v(n.entry().name),r(2),f(" ",n.multipleStudyClasses()?n.entry().studyClass:"",` +`),r(),m("title",n.entry().company),r(),v(n.entry().company))},dependencies:[X,Ai],styles:['[_nghost-%COMP%]{display:grid;grid-template-columns:min-content 1fr;grid-template-rows:min-content min-content 1fr;grid-template-areas:"avatar name" "avatar study-class" "avatar company";padding:2rem 1rem}.avatar[_ngcontent-%COMP%]{grid-area:avatar;margin-right:1.5rem}.name[_ngcontent-%COMP%]{grid-area:name}.study-class[_ngcontent-%COMP%]{grid-area:study-class;font-size:.875rem}.company[_ngcontent-%COMP%]{grid-area:company;align-content:end;padding-bottom:1.5rem}.name[_ngcontent-%COMP%], .company[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}'],changeDetection:0})}}return t})();var ur=t=>({count:t});function hr(t,o){if(t&1&&(s(0,"div",0),l(1),p(2,"translate"),a()),t&2){u();let e=P(2);r(),f(" ",F(2,1,e===1?"events-students.registration":"events-students.registrations",D(4,ur,e))," ")}}var Ct=(()=>{class t{constructor(){this.title=j.required(),this.count=j(null),this.searchTerm=ke()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-students-header"]],inputs:{title:[1,"title"],count:[1,"count"],searchTerm:[1,"searchTerm"]},outputs:{searchTerm:"searchTermChange"},decls:7,vars:10,consts:[[1,"additional-info"],[1,"search",3,"valueChange","value","placeholder","label"]],template:function(i,n){if(i&1){let d=G();s(0,"h1"),l(1),a(),R(2),T(3,hr,3,6,"div",0),s(4,"bkd-resettable-input",1),p(5,"translate"),p(6,"translate"),b("valueChange",function(g){return E(d),w(n.searchTerm.set(g))}),a()}if(i&2){r(),v(n.title()),r();let d=A(n.count());r(),_(d!==null?3:-1),r(),m("value",n.searchTerm())("placeholder",c(5,6,"events-students.search-placeholder"))("label",c(6,8,"events-students.search"))}},dependencies:[I,pt],styles:["h1[_ngcontent-%COMP%]{margin-bottom:0}.search[_ngcontent-%COMP%]{margin-top:1rem;display:flex;max-width:300px}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}"],changeDetection:0})}}return t})();var gr=(t,o)=>o.id;function fr(t,o){t&1&&(s(0,"p"),l(1),p(2,"translate"),a()),t&2&&(r(),v(c(2,1,"events-students.no-entries")))}function vr(t,o){if(t&1&&C(0,"bkd-events-students-course-entry",2),t&2){let e=o.$implicit,i=u();m("entry",e)("multipleStudyClasses",i.multipleStudyClasses())("returnLink",i.returnLink())}}var rn=(()=>{class t{constructor(){this.title=j.required(),this.count=j.required(),this.entries=j.required(),this.multipleStudyClasses=j(!1),this.returnLink=j(null),this.searchTerm=ke()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-students-course-list"]],inputs:{title:[1,"title"],count:[1,"count"],entries:[1,"entries"],multipleStudyClasses:[1,"multipleStudyClasses"],returnLink:[1,"returnLink"],searchTerm:[1,"searchTerm"]},outputs:{searchTerm:"searchTermChange"},decls:5,vars:4,consts:[[3,"searchTermChange","title","count","searchTerm"],[1,"list"],[3,"entry","multipleStudyClasses","returnLink"]],template:function(i,n){i&1&&(s(0,"bkd-events-students-header",0),we("searchTermChange",function(h){return Ee(n.searchTerm,h)||(n.searchTerm=h),h}),a(),s(1,"section",1),T(2,fr,3,3,"p"),V(3,vr,1,3,"bkd-events-students-course-entry",2,gr),a()),i&2&&(m("title",n.title())("count",n.count()),Te("searchTerm",n.searchTerm),r(2),_(n.entries().length===0?2:-1),r(),H(n.entries()))},dependencies:[I,Ct,nn],styles:["[_nghost-%COMP%]{display:block;overflow:hidden}section.list[_ngcontent-%COMP%]{width:calc(100% + 1px);margin-top:1rem;display:grid;grid-template-columns:repeat(auto-fill,minmax(400px,1fr))}bkd-events-students-course-entry[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;border-right:1px solid #dee2e6}"],changeDetection:0})}}return t})();var sn=(()=>{class t{constructor(){this.entry=j.required(),this.returnLink=j(null),this.link=U(()=>["study-course-student",this.entry().id]),this.linkParams=U(()=>{let e=this.returnLink();return e?{returnparams:new URLSearchParams({returnlink:e}).toString()}:{}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-students-study-course-entry"]],inputs:{entry:[1,"entry"],returnLink:[1,"returnLink"]},decls:4,vars:4,consts:[[1,"name",3,"routerLink","queryParams"],[1,"status"]],template:function(i,n){i&1&&(s(0,"a",0),l(1),a(),s(2,"div",1),l(3),a()),i&2&&(m("routerLink",n.link())("queryParams",n.linkParams()),r(),v(n.entry().name),r(2),v(n.entry().status))},dependencies:[X],styles:["[_nghost-%COMP%]{display:flex;flex-direction:row;align-items:stretch;border-bottom:1px solid #dee2e6}.name[_ngcontent-%COMP%], .status[_ngcontent-%COMP%]{padding:1rem}.name[_ngcontent-%COMP%]{flex:2;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.status[_ngcontent-%COMP%]{flex:1;padding-left:0}@media (max-width: 750px){[_nghost-%COMP%]{flex-direction:column}.name[_ngcontent-%COMP%]{padding-bottom:0}.status[_ngcontent-%COMP%]{padding-top:0;padding-left:1rem;font-size:.875rem}}"],changeDetection:0})}}return t})();var Cr=(t,o)=>o.id;function _r(t,o){if(t&1){let e=G();s(0,"div",2)(1,"div",4),b("click",function(){E(e);let n=u();return w(n.toggleSort.emit())}),l(2),p(3,"translate"),s(4,"span",5),l(5),a()()()}if(t&2){let e=u();r(),m("className",e.primarySortKey),r(),f(" ",c(3,3,"events-students.list.header."+e.primarySortKey)," "),r(3),v(e.getSortDirectionCharacter(e.sortCriteria()))}}function Sr(t,o){t&1&&(s(0,"p"),l(1),p(2,"translate"),a()),t&2&&(r(),v(c(2,1,"events-students.no-entries")))}function yr(t,o){if(t&1&&C(0,"bkd-events-students-study-course-entry",3),t&2){let e=o.$implicit,i=u();m("entry",e)("returnLink",i.returnLink())}}var an=(()=>{class t{constructor(){this.title=j.required(),this.count=j.required(),this.entries=j.required(),this.returnLink=j(null),this.sortCriteria=j.required(),this.toggleSort=zt(),this.searchTerm=ke(),this.primarySortKey="name"}getSortDirectionCharacter(e){return e.ascending?"\u2191":"\u2193"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-students-study-course-list"]],inputs:{title:[1,"title"],count:[1,"count"],entries:[1,"entries"],returnLink:[1,"returnLink"],sortCriteria:[1,"sortCriteria"],searchTerm:[1,"searchTerm"]},outputs:{toggleSort:"toggleSort",searchTerm:"searchTermChange"},features:[ne([])],decls:6,vars:4,consts:[[3,"searchTermChange","title","count","searchTerm"],[1,"list"],[1,"list-header"],[3,"entry","returnLink"],[1,"name",3,"click","className"],[1,"sort-direction"]],template:function(i,n){i&1&&(s(0,"bkd-events-students-header",0),we("searchTermChange",function(h){return Ee(n.searchTerm,h)||(n.searchTerm=h),h}),a(),s(1,"section",1),T(2,_r,6,5,"div",2)(3,Sr,3,3,"p"),V(4,yr,1,2,"bkd-events-students-study-course-entry",3,Cr),a()),i&2&&(m("title",n.title())("count",n.count()),Te("searchTerm",n.searchTerm),r(2),_(n.entries().length>0?2:3),r(2),H(n.entries()))},dependencies:[I,Ct,sn],styles:[".list-header[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;border-bottom:2px solid #dee2e6}.name[_ngcontent-%COMP%]{padding:1rem}"],changeDetection:0})}}return t})();function on(t,o,e){o||Nt(t);let i=o??Vt(Wt);return e?Ht(i,e):i}function ze(t,o){let e=on(ze,o?.injector),i;return U(()=>(i||(i=Jt(()=>se(t,B(L({},o),{injector:e})))),i()))}var dn=(()=>{class t extends nt{constructor(e,i){super(e,i,wi,"ApprenticeshipContracts")}getCompaniesForStudents(e){let i=new Date,n={"filter.StudentId":`;${e.join(";")}`,"filter.ApprenticeshipDateFrom":`<${i.toISOString()}`,"filter.ApprenticeshipDateTo":`>${i.toISOString()}`,fields:"Id,StudentId,CompanyName,CompanyNameAddition"};return this.http.get(`${this.baseUrl}/`,{params:n}).pipe(O(vi(Ii)))}static{this.\u0275fac=function(i){return new(i||t)($(Ke),$(me))}}static{this.\u0275prov=de({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var _t=1;var ln=10,St=(()=>{class t{constructor(e,i,n,d,h,g,k,W,fe){this.route=e,this.loadingService=i,this.eventsService=n,this.coursesService=d,this.subscriptionsService=h,this.personsService=g,this.apprenticeshipContractsService=k,this.lessonPresencesService=W,this.reportsService=fe,this.eventId$=q([this.route.paramMap,this.route.parent?.paramMap??N(null)]).pipe(y(([Ce,Wn])=>Number(Ce.get("id")||Wn?.get("id"))),Z()),this.eventSummary$=this.eventId$.pipe(O(this.loadEventSummary.bind(this)),Q(1)),this.eventSummary=ze(this.eventSummary$,{initialValue:null}),this.eventTypeId=U(()=>this.eventSummary()?.EventTypeId??null),this.studentEntries=ze(this.loadStudentEntries(),{initialValue:null}),this.isStudyCourse=U(()=>this.eventTypeId()===_t),this.loading=se(this.loadingService.loading(ut)),this.title=U(()=>this.getTitle(this.studentEntries())),this.multipleStudyClasses=U(()=>(this.studentEntries()?.studyClasses?.length??0)>1),this.searchTerm=Tt(""),this.sortCriteria=Tt({primarySortKey:"name",ascending:!0}),this.entries=U(()=>this.studentEntries()?.entries??[]),this.sortedEntries=U(()=>this.sortStudentEntries(this.entries(),this.sortCriteria())),this.filteredEntries=U(()=>ct(this.sortedEntries(),["name","status","company","studyClass"],this.searchTerm())),this.mailtoLink=U(()=>this.getMailtoLink(this.eventTypeId(),this.entries())),this.reports=ze(this.eventSummary$.pipe(ve(ue)).pipe(O(this.loadReports.bind(this))),{initialValue:[]})}loadEventSummary(e){return this.loadingService.load(this.eventsService.getEventSummary(e),ut)}loadStudentEntries(){return this.eventSummary$.pipe(O(e=>{let i=()=>{if(!e)return N(null);switch(e.EventTypeId){case _t:return this.loadStudyCourseStudents(e);case ln:return this.loadStudyClassStudents(e.Id);default:return this.loadCourseStudents(e.Id)}};return this.loadingService.load(i(),ut)}))}toggleSort(){this.sortCriteria.update(e=>B(L({},e),{ascending:!e.ascending}))}loadStudyCourseStudents({Id:e,Designation:i}){return this.subscriptionsService.getSubscriptionsByCourse(e).pipe(O(n=>this.personsService.getSummaries(n.map(({PersonId:d})=>d).filter(ue)).pipe(y(d=>Pt(e,d,n,{eventDesignation:i})))))}loadStudyClassStudents(e){return this.subscriptionsService.getSubscriptionsByCourse(e,{"filter.IsOkay":"=1"}).pipe(O(i=>{let n=i.map(({PersonId:d})=>d).filter(ue);return q([this.personsService.getSummaries(n),this.apprenticeshipContractsService.getCompaniesForStudents(n)]).pipe(y(([d,h])=>{let g=Pt(e,d,i,{emailFallback:!0});return kt(g,h)}))}))}loadCourseStudents(e){return this.coursesService.getExpandedCourseWithParticipants(e).pipe(y(Ki),O(i=>q([this.apprenticeshipContractsService.getCompaniesForStudents(i.entries.map(({id:n})=>n)),this.lessonPresencesService.getLessonStudyClassesByEvent(e)]).pipe(y(([n,d])=>{let h=kt(i,n);return Zi(h,d)}))))}getTitle(e){if(!e||!e.eventDesignation)return null;let{eventDesignation:i,studyClasses:n}=e;return[i,...n].join(", ")}getMailtoLink(e,i){if(e===null||e===_t)return null;let n=i.map(d=>d.email).filter(Boolean);return n.length>0?`mailto:${n.join(";")}`:null}loadReports({Id:e,EventTypeId:i}){switch(i){case null:case _t:return N([]);case ln:return this.reportsService.getStudyClassStudentsReports(e);default:return this.reportsService.getCourseStudentsReports(e)}}sortStudentEntries(e,i){return[...e].sort(wr(i))}static{this.\u0275fac=function(i){return new(i||t)($(re),$(xe),$(mt),$(ge),$(je),$(st),$(dn),$(xi),$(dt))}}static{this.\u0275prov=de({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function wr(t){return(o,e)=>t.ascending?o.name.localeCompare(e.name):e.name.localeCompare(o.name)}var kr=t=>[t];function Pr(t,o){if(t&1&&(s(0,"a",4)(1,"i",6),l(2,"mail"),a()()),t&2){let e=u(2);m("href",e.state.mailtoLink(),ie)}}function Mr(t,o){if(t&1&&(s(0,"bkd-backlink",0)(1,"div",3),T(2,Pr,3,1,"a",4),C(3,"bkd-reports-link",5),a()()),t&2){let e=u(),i=P(0);m("link",D(3,kr,i)),r(2),_(e.state.mailtoLink()?2:-1),r(),m("reports",e.state.reports())}}function Or(t,o){t&1&&C(0,"bkd-spinner")}function $r(t,o){t&1&&(s(0,"p"),l(1),p(2,"translate"),a()),t&2&&(r(),v(c(2,1,"events-students.no-entries")))}function Gr(t,o){if(t&1){let e=G();s(0,"bkd-events-students-study-course-list",7),b("toggleSort",function(){E(e);let n=u();return w(n.state.toggleSort())}),we("searchTermChange",function(n){E(e);let d=u();return Ee(d.state.searchTerm,n)||(d.state.searchTerm=n),w(n)}),a()}if(t&2){let e=u();m("title",e.state.title())("count",e.state.entries().length)("entries",e.state.filteredEntries())("returnLink",e.returnLink())("sortCriteria",e.state.sortCriteria()),Te("searchTerm",e.state.searchTerm)}}function Lr(t,o){if(t&1){let e=G();s(0,"bkd-events-students-course-list",8),we("searchTermChange",function(n){E(e);let d=u();return Ee(d.state.searchTerm,n)||(d.state.searchTerm=n),w(n)}),a()}if(t&2){let e=u();m("title",e.state.title())("count",e.state.entries().length)("entries",e.state.filteredEntries())("multipleStudyClasses",e.state.multipleStudyClasses())("returnLink",e.returnLink()),Te("searchTerm",e.state.searchTerm)}}var pn=(()=>{class t{constructor(e,i){this.state=e,this.route=i,this.returnLink=se(this.route.queryParams.pipe(y(({returnlink:n})=>n?decodeURIComponent(n):null)))}static{this.\u0275fac=function(i){return new(i||t)(x(St),x(re))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-students-list"]],decls:6,vars:3,consts:[[3,"link"],[3,"title","count","entries","returnLink","sortCriteria","searchTerm"],[3,"title","count","entries","multipleStudyClasses","returnLink","searchTerm"],[1,"d-flex"],["target","_blank",1,"mail","btn","btn-primary","btn-icon","me-2",3,"href"],[1,"ms-2",3,"reports"],[1,"material-icons"],[3,"toggleSort","searchTermChange","title","count","entries","returnLink","sortCriteria","searchTerm"],[3,"searchTermChange","title","count","entries","multipleStudyClasses","returnLink","searchTerm"]],template:function(i,n){if(i&1&&(R(0),T(1,Mr,4,5,"bkd-backlink",0)(2,Or,1,0,"bkd-spinner")(3,$r,3,3,"p")(4,Gr,1,6,"bkd-events-students-study-course-list",1)(5,Lr,1,6,"bkd-events-students-course-list",2)),i&2){let d=A(n.returnLink());r(),_(d?1:-1),r(),_(n.state.loading()?2:n.state.entries().length===0?3:n.state.isStudyCourse()?4:5)}},dependencies:[I,he,Ae,rt,rn,an],encapsulation:2,changeDetection:0})}}return t})();var Dr=(t,o)=>o.id;function Fr(t,o){if(t&1&&(l(0),p(1,"date")),t&2){u(2);let e=P(2);f(" ",F(1,1,e.Birthdate,"dd.MM.yyyy")," ")}}function Rr(t,o){if(t&1&&l(0),t&2){u(2);let e=P(2);f(" (",e.Gender,") ")}}function Br(t,o){if(t&1&&(l(0),C(1,"br")),t&2){u(2);let e=P(2);f(" ",e.AddressLine1,"")}}function jr(t,o){if(t&1&&(l(0),C(1,"br")),t&2){u(2);let e=P(2);f(" ",e.AddressLine2,"")}}function Ar(t,o){if(t&1&&(l(0),C(1,"br")),t&2){u(2);let e=P(2);Ue(" ",e.Zip," ",e.Location,"")}}function Vr(t,o){if(t&1&&(s(0,"a",4),l(1),a(),C(2,"br")),t&2){u(2);let e=P(2);Ne("href","tel:",e.PhonePrivate,"",ie),r(),v(e.PhonePrivate)}}function Hr(t,o){if(t&1&&(s(0,"a",4),l(1),a(),C(2,"br")),t&2){u(2);let e=P(2);Ne("href","tel:",e.PhoneMobile,"",ie),r(),v(e.PhoneMobile)}}function Nr(t,o){if(t&1&&(s(0,"a",4),l(1),a(),C(2,"br")),t&2){u(2);let e=P(2);Ne("href","mailto:",e.Email,"",ie),r(),f(" ",e.Email," ")}}function Ur(t,o){if(t&1&&(s(0,"a",4),l(1),a(),C(2,"br")),t&2){u(2);let e=P(2);Ne("href","mailto:",e.Email2,"",ie),r(),f(" ",e.Email2," ")}}function Wr(t,o){if(t&1&&(s(0,"h1"),l(1),a(),s(2,"span",3),T(3,Fr,2,4)(4,Rr,1,1),a(),s(5,"address"),T(6,Br,2,1)(7,jr,2,1)(8,Ar,2,2)(9,Vr,3,3)(10,Hr,3,3)(11,Nr,3,3)(12,Ur,3,3),a()),t&2){u();let e=P(2);r(),v(e.FullName),r(2),_(e.Birthdate?3:-1),r(),_(e.Gender?4:-1),r(2),_(e.AddressLine1?6:-1),r(),_(e.AddressLine2?7:-1),r(),_(e.Zip&&e.Location?8:-1),r(),_(e.PhonePrivate?9:-1),r(),_(e.PhoneMobile?10:-1),r(),_(e.Email?11:-1),r(),_(e.Email2?12:-1)}}function zr(t,o){if(t&1&&(s(0,"div",2),l(1),p(2,"translate"),s(3,"span",5),l(4),a()()),t&2){u();let e=P(4);r(),f(" ",c(2,2,"events-students.study-course-detail.status"),": "),r(3),v(e)}}function qr(t,o){if(t&1&&(s(0,"div",6)(1,"h2"),l(2),a()()),t&2){let e=u().$implicit;r(2),v(e.label)}}function Yr(t,o){if(t&1&&(s(0,"a",7),l(1),a()),t&2){let e=u(2).$implicit;pe("href",e.file,ie),r(),v(e.value)}}function Kr(t,o){if(t&1&&l(0),t&2){let e=u(2).$implicit;f(" ",e.value," ")}}function Zr(t,o){if(t&1&&(s(0,"div",6)(1,"div"),l(2),a(),T(3,Yr,2,2,"a",7)(4,Kr,1,1),a()),t&2){let e=u().$implicit;r(2),v(e.label),r(),_(e.file!==null?3:4)}}function Qr(t,o){if(t&1&&T(0,qr,3,1,"div",6)(1,Zr,5,2,"div",6),t&2){let e=o.$implicit;_(e.heading?0:e.value?1:-1)}}function Xr(t,o){t&1&&C(0,"bkd-spinner")}var cn=(()=>{class t{constructor(e,i,n,d,h,g){this.settings=e,this.route=i,this.personsService=n,this.subscriptionsService=d,this.storageService=h,this.loadingService=g,this.eventId$=this.route.parent?.paramMap.pipe(y(k=>Number(k.get("id"))))??N(0),this.personId$=this.route.paramMap.pipe(y(k=>Number(k.get("id")))),this.person=se(this.personId$.pipe(O(k=>this.personsService.get(k))),{initialValue:null}),this.subscription=se(this.loadSubscription()),this.subscriptionId=U(()=>this.subscription()?.Id??null),this.subscriptionDetails=se(this.loadSubscriptionDetails(),{initialValue:[]}),this.backLink=se(this.route.queryParams.pipe(y(({returnparams:k})=>k),y(Ti))),this.loading=se(this.loadingService.loading$,{initialValue:!0})}loadSubscription(){return this.loadingService.load(q([this.eventId$,this.personId$]).pipe(O(([e,i])=>this.subscriptionsService.getSubscriptionsByCourse(e,{"filter.PersonId":`=${i}`})),y(e=>e[0]??null)),{stopOnFirstValue:!0})}loadSubscriptionDetails(){return this.loadingService.load(ei(this.subscriptionId).pipe(ve(ue),O(e=>this.subscriptionsService.getSubscriptionDetailsById(e)),y(e=>e.map(i=>this.toSubscriptionDetailsEntry(i)))),{stopOnFirstValue:!0})}toSubscriptionDetailsEntry(e){let i=e.Value??"";return i=this.normalizeSubscriptionDetailsDropdownValue(e,i),{id:e.Id,label:e.VssDesignation,value:i,file:this.buildFileUrl(e),heading:e.VssStyle==="HE"}}normalizeSubscriptionDetailsDropdownValue(e,i){return e.DropdownItems&&e.VssStyle!=="CB"?e.DropdownItems.find(n=>String(n.Key)===i)?.Value??i:i}buildFileUrl(e){if(e.VssStyle==="PD"||e.VssStyle==="PF"||e.VssStyle==="DA"){let i=this.storageService.getAccessToken()||"";return`${this.settings.apiUrl}/Files/SubscriptionDetails/${e.Id}?token=${i}`}return null}static{this.\u0275fac=function(i){return new(i||t)(x(me),x(re),x(st),x(je),x(De),x(xe))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-students-study-course-detail"]],decls:9,vars:6,consts:[[1,"bkd-container","bkd-container-limited"],["link","../..",3,"params"],[1,"status"],[1,"additional-info"],[3,"href"],[1,"ms-2"],[1,"detail"],["target","_blank",3,"href"]],template:function(i,n){if(i&1&&(s(0,"div",0),C(1,"bkd-backlink",1),R(2),T(3,Wr,13,10),R(4),T(5,zr,5,4,"div",2),V(6,Qr,2,1,null,null,Dr),T(8,Xr,1,0,"bkd-spinner"),a()),i&2){let d;r(),m("params",n.backLink()),r();let h=A(n.person());r(),_(h?3:-1),r();let g=A((d=n.subscription())==null?null:d.Status);r(),_(g?5:-1),r(),H(n.subscriptionDetails()),r(2),_(n.loading()?8:-1)}},dependencies:[I,Oe,Ae,he],styles:["h1[_ngcontent-%COMP%]{margin-bottom:0}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}address[_ngcontent-%COMP%]{margin:1rem 0}.status[_ngcontent-%COMP%]{display:flex;align-items:center;padding:1rem 0;border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.detail[_ngcontent-%COMP%]{max-width:70ch;padding-top:1rem}.detail[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0}.detail[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{font-weight:400;color:#00000080}"],changeDetection:0})}}return t})();var mn=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-students"]],features:[ne([St])],decls:1,vars:0,template:function(i,n){i&1&&C(0,"router-outlet")},dependencies:[ye],encapsulation:2,changeDetection:0})}}return t})();var un=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events-tests"]],decls:4,vars:4,consts:[[3,"withRatings"]],template:function(i,n){i&1&&(s(0,"h1"),l(1),p(2,"translate"),a(),C(3,"bkd-events-list",0)),i&2&&(r(),v(c(2,2,"events.title")),r(2),m("withRatings",!0))},dependencies:[vt,I],encapsulation:2})}}return t})();var hn=(()=>{class t{constructor(){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-events"]],features:[ne([He,Si])],decls:1,vars:0,template:function(i,n){i&1&&C(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();function gn(t){return o=>{let e=Number(o.value);return e<=t?{greaterThan:{value:e,greaterThanValue:t}}:null}}function Ot(t){return t.map(({finalGrade:o})=>o).filter(Jr)}function Jr(t){return t!==null}function Cn(t,o,e,i){return t?.map(n=>({student:n,finalGrade:ts(n,e,i),grades:es(n,o)}))}function es(t,o){return o.map(e=>{if(e.Results===void 0||e.Results?.length===0)return{kind:"no-result",test:e};let i=e.Results?.find(n=>n.StudentId===t.Id);return i!==void 0?{kind:"grade",result:i,test:e}:{kind:"no-result",test:e}})}function ts(t,o,e){let i=o.find(d=>d.StudentId===t.Id),n=e.find(d=>d.StudentId===t.Id);return i?{id:i.Id,average:is(i),finalGradeId:i.GradeId,freeHandGrade:n?Number(n.Grade):null,canGrade:i.CanGrade}:null}function is(t){return t.AverageTestResult===0?null:t.AverageTestResult}var _n=({key:t,ascending:o})=>(e,i)=>{let n=o?1:-1;switch(t){case"FullName":return n*e.student.FullName.localeCompare(i.student.FullName);case"FinalGrade":return!e.finalGrade?.finalGradeId||!i.finalGrade?.finalGradeId?n*-1:n*fn(e.finalGrade.finalGradeId,i.finalGrade.finalGradeId);case"TestsMean":return!e.finalGrade?.average||!i.finalGrade?.average?n*-1:n*fn(e.finalGrade.average,i.finalGrade.average)}return n*ns(t,e,i)},ns=(t,o,e)=>{let i=o.grades.filter(vn).find(d=>d.test.Id===t.Id),n=e.grades.filter(vn).find(d=>d.test.Id===t.Id);return t.IsPointGrading&&i?.result.GradeId===n?.result.GradeId?(i?.result.Points??0)-(n?.result.Points??0):((i?.result.GradeId??Number.POSITIVE_INFINITY)-(n?.result.GradeId??Number.POSITIVE_INFINITY))*-1};function fn(t,o){return t===o?0:te.average).filter(e=>e!=null&&e!==0).map(Number);return wt(o)}function xn(t,o){let e=t.map(n=>n.freeHandGrade).filter(n=>!!n),i=t.map(n=>n.finalGradeId).filter(n=>n!==null).map(n=>o.find(d=>d.Key===n)).filter(n=>n!==void 0).map(n=>n?.Value).filter(n=>n!==void 0).map(Number).filter(n=>!isNaN(n));return wt([...i,...e])}function $t(t,o){return[...o.filter(e=>e.Id!==t?.Id),t].filter(e=>e!=null)}function bn({id:t,selectedGradeId:o},e){return e.map(i=>i.Id!==t?i:B(L({},i),{GradeId:o}))}function Tn(t,o){switch(o.type){case"reset":return o.payload;case"updateResult":return t?B(L({},t),{Tests:Pi(o.payload.testResult,t.Tests||[],o.payload.ignore),Gradings:o.payload.grading?$t(o.payload.grading,t.Gradings||[]):t.Gradings}):null;case"deleteResult":return t?B(L({},t),{Tests:Mi(o.payload.testId,o.payload.studentId,t.Tests||[]),Gradings:o.payload.grading?$t(o.payload.grading,t.Gradings||[]):t.Gradings||[]}):null;case"toggle-test-state":return t?B(L({},t),{Tests:Oi(o.payload,t.Tests||[])}):null;case"final-grade-overwritten":return t?B(L({},t),{Gradings:bn({id:o.payload.id,selectedGradeId:o.payload.selectedGradeId},t.Gradings||[])}):null;case"replace-grades":return t?B(L({},t),{Gradings:o.payload}):null;case"delete-test":return t?B(L({},t),{Tests:$i(o.payload,t.Tests||[])}):null;default:return t}}var En=(()=>{class t extends nt{constructor(e,i){super(e,i,Ri,"Gradings")}updateGrade(e,i){return this.http.put(`${this.baseUrl}/${e}`,{GradeId:i}).pipe(y(()=>e))}static{this.\u0275fac=function(i){return new(i||t)($(Ke),$(me))}}static{this.\u0275prov=de({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Gt={onlyMine:!1,hidePublished:!1},K=(()=>{class t{constructor(e,i,n,d,h){this.coursesRestService=e,this.gradingScalesRestService=i,this.gradingsRestService=n,this.loadingService=d,this.sortService=h,this.action$=new bt(1),this.loading$=this.loadingService.loading$,this._courseId$=new bt(1),this.courseId$=this._courseId$.asObservable(),this.fetchedCourse$=this._courseId$.pipe(O(g=>this.loadingService.load(this.coursesRestService.getExpandedCourse(g))),Q(1)),this.course$=qe(this.action$,this.fetchedCourse$.pipe(ve(ue),y(g=>({type:"reset",payload:g})))).pipe(jt(Tn,null),ve(ue),Q(1)),this.tests$=this.course$.pipe(y(g=>g.Tests||[]),y(Gi)),this.hasTests$=this.tests$.pipe(y(g=>g.length>0)),this.filterSubject$=new z(Gt),this.filter$=this.filterSubject$.asObservable(),this.expandedHeaderSubject$=new z(!1),this.expandedHeader$=this.expandedHeaderSubject$.asObservable(),this.filteredTests$=q([this.tests$,this.filter$]).pipe(y(([g,k])=>g.filter(W=>(!k.onlyMine||W.IsOwner)&&(!k.hidePublished||!W.IsPublished)))),this.sorting$=this.sortService.sorting$,this.studentGrades$=q([this.course$,this.filteredTests$,this.sorting$]).pipe(y(Re(this.toStudentGrades.bind(this)))),this.canSetFinalGrade$=this.course$.pipe(y(Wi)),this.gradingScaleIds$=this.course$.pipe(y(g=>gi([...(g.Tests??[]).map(k=>k.GradingScaleId),g.GradingScaleId]).filter(ue)),Z(hi),Q(1)),this.gradingScales$=this.gradingScaleIds$.pipe(O(g=>this.gradingScalesRestService.getGradingScales(g)),Q(1)),this.UNDEFINED_GRADINGSCALE_ID=-1,this.gradingScalesOptions$=this.gradingScales$.pipe(y(g=>g.map(k=>{let W=k?.Id||this.UNDEFINED_GRADINGSCALE_ID,fe=k?.Grades.map(Ce=>({Key:Ce.Id,Value:Ce.Designation}))||[];return{id:W,options:fe}}).reduce((k,W)=>B(L({},k),{[W.id]:W.options}),{})),Q(1)),this.meanOfStudentGradesForCourse$=this.studentGrades$.pipe(y(g=>yn(Ot(g)))),this.meanOfFinalGradesForCourse$=q([this.gradingScalesOptions$,this.studentGrades$]).pipe(O(Re(this.meanOfOverwrittenGradesForCourse.bind(this))))}setCourseId(e){this._courseId$.next(e)}setFilter(e){this.filterSubject$.next(e)}gradingOptionsForTest$(e){return this.gradingOptions$(e.GradingScaleId)}gradingOptionsForCourse$(){return this.course$.pipe(O(e=>this.gradingOptions$(e.GradingScaleId)))}toStudentGrades(e,i=[],n){return Cn(e.ParticipatingStudents??[],i,e.Gradings??[],e.FinalGrades??[]).sort(_n(n))}setSorting(e){this.sortService.setSorting(e)}getSortingChar$(e){return this.sortService.getSortingChar$(e)}sortBy(e){this.sortService.toggleSorting(e)}toggleHeader(e){this.expandedHeaderSubject$.next(e)}optimisticallyUpdateGrade(e){return this.course$.pipe(oe(1),y(i=>{let{originalResult:n,updatedResult:d}=this.buildOptimisticResultUpdate(i,e);return this.updateTestResult(d,null),n}))}saveGrade(e,i){this.course$.pipe(oe(1),O(n=>this.coursesRestService.updateTestResult(n.Id,e).pipe(Ft(d=>(i&&this.updateTestResult(L({},i),null),Dt(()=>d)))))).subscribe(({testResult:n,grading:d})=>this.updateOrDeleteTestResult(e.testId,e.studentId,n,d,"gradeId"in e?"grade":"points"))}publish(e){this.coursesRestService.publishTest(e.Id).subscribe(this.toggleTestPublishedState.bind(this))}unpublish(e){this.coursesRestService.unpublishTest(e.Id).subscribe(this.toggleTestPublishedState.bind(this))}deleteTest(e){this.action$.next({type:"delete-test",payload:e})}overwriteFinalGrade({id:e,selectedGradeId:i}){this.gradingsRestService.updateGrade(e,i).subscribe(()=>{this.action$.next({type:"final-grade-overwritten",payload:{id:e,selectedGradeId:i}})})}setAveragesAsFinalGrades(e){this.coursesRestService.setAverageAsFinalGrade(e).subscribe(i=>this.action$.next({type:"replace-grades",payload:i.Gradings}))}buildOptimisticResultUpdate(e,i){let n=ki(e,i.testId,i.studentId),d=n?L({},n):{Id:"",TestId:i.testId,StudentId:i.studentId,CourseRegistrationId:0,GradeId:null,GradeValue:null,GradeDesignation:null,Points:null};return d.GradeId="gradeId"in i?i.gradeId:n?.GradeId??null,d.Points="points"in i?i.points:n?.Points??null,{originalResult:n,updatedResult:d}}updateOrDeleteTestResult(e,i,n,d,h){n?this.updateTestResult(n,d,h):this.deleteTestResult(e,i,d)}updateTestResult(e,i,n){this.action$.next({type:"updateResult",payload:{testResult:e,grading:i??null,ignore:n}})}deleteTestResult(e,i,n){this.action$.next({type:"deleteResult",payload:{testId:e,studentId:i,grading:n}})}toggleTestPublishedState(e){this.action$.next({type:"toggle-test-state",payload:e})}gradingOptions$(e){return e===null?N(null):this.gradingScalesOptions$.pipe(y(i=>i[e]),Q(1))}meanOfOverwrittenGradesForCourse(e,i){return this.course$.pipe(y(n=>{if(n.GradingScaleId===null||e[n.GradingScaleId]===void 0)return null;let d=e[n.GradingScaleId];return xn(Ot(i),d)}))}static{this.\u0275fac=function(i){return new(i||t)($(ge),$(Bi),$(En),$(xe),$(Ni))}}static{this.\u0275prov=de({token:t,factory:t.\u0275fac})}}return t})();var as=t=>["/events",t,"tests"];function os(t,o){if(t&1&&(s(0,"div",7),l(1),p(2,"translate"),a()),t&2){let e=o.$implicit;r(),f(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function ds(t,o){if(t&1&&(s(0,"div",7),l(1),p(2,"translate"),a()),t&2){let e=o.$implicit;r(),f(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function ls(t,o){if(t&1&&(s(0,"div",7),l(1),p(2,"translate"),a()),t&2){let e=o.$implicit;r(),f(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function ps(t,o){if(t&1&&(s(0,"div",7),l(1),p(2,"translate"),a()),t&2){let e=o.$implicit;r(),f(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function cs(t,o){if(t&1&&(s(0,"div",7),l(1),p(2,"translate"),a()),t&2){let e=o.$implicit;r(),f(" ",F(2,1,"global.validation-errors."+e.error,e.params)," ")}}function ms(t,o){if(t&1&&(s(0,"div",29)(1,"div",30)(2,"div",16)(3,"label",31),l(4),p(5,"translate"),a(),s(6,"div",32),C(7,"input",33),p(8,"async"),V(9,ps,3,4,"div",7,Pe),p(11,"async"),a()()(),s(12,"div",30)(13,"div",16)(14,"label",34),l(15),p(16,"translate"),a(),s(17,"div",32),C(18,"input",35),p(19,"async"),V(20,cs,3,4,"div",7,Pe),p(22,"async"),a()()()(),s(23,"div",36),Ut(),s(24,"math")(25,"mi"),l(26),p(27,"translate"),a(),s(28,"mo"),l(29,"="),a(),s(30,"mfrac")(31,"mrow")(32,"mi"),l(33),p(34,"translate"),a(),s(35,"mo"),l(36,"\xD7"),a(),s(37,"mn"),l(38,"5"),a()(),s(39,"mi"),l(40),p(41,"translate"),a()(),s(42,"mo"),l(43,"+"),a(),s(44,"mn"),l(45,"1"),a()()()),t&2){let e,i,n=u(2);r(4),v(c(5,9,"tests.form.max-points")),r(3),le("is-invalid",((e=c(8,11,n.maxPointsErrors$))==null?null:e.length)||!1),r(2),H(c(11,13,n.maxPointsErrors$)),r(6),v(c(16,15,"tests.form.max-points-adjusted")),r(3),le("is-invalid",((i=c(19,17,n.maxPointsAdjustedErrors$))==null?null:i.length)||!1),r(2),H(c(22,19,n.maxPointsAdjustedErrors$)),r(6),f(" ",c(27,21,"tests.form.math.grade")," "),r(7),f(" ",c(34,23,"tests.form.math.points")," "),r(7),v(c(41,25,"tests.form.math.max-points"))}}function us(t,o){t&1&&(s(0,"div",28)(1,"span",37),l(2,"Loading..."),a()())}function hs(t,o){if(t&1){let e=G();s(0,"form",2),b("ngSubmit",function(){E(e);let n=u();return w(n.onSubmit())}),s(1,"div",3)(2,"div",4)(3,"label",5),l(4),p(5,"translate"),a(),C(6,"input",6),p(7,"async"),p(8,"translate"),V(9,os,3,4,"div",7,Pe),p(11,"async"),a(),s(12,"div",8)(13,"label",9),l(14),p(15,"translate"),a(),s(16,"div",10)(17,"span",11)(18,"i",12),l(19,"calendar_today"),a()(),s(20,"input",13,0),p(22,"async"),p(23,"translate"),b("click",function(){E(e);let n=Se(21);return w(n.toggle())}),a(),V(24,ds,3,4,"div",7,Pe),p(26,"async"),a()()(),s(27,"div",14)(28,"label",15),l(29),p(30,"translate"),a(),s(31,"div",4)(32,"div",16)(33,"label",17),l(34),p(35,"translate"),a(),s(36,"div",18),C(37,"input",19),p(38,"async"),V(39,ls,3,4,"div",7,Pe),p(41,"async"),a()()()(),s(42,"div")(43,"label",15),l(44),p(45,"translate"),a(),s(46,"div",20),C(47,"input",21),s(48,"label",22),l(49),p(50,"translate"),a()(),s(51,"div",20),C(52,"input",23),s(53,"label",24),l(54),p(55,"translate"),a()(),T(56,ms,46,27),a(),s(57,"div",25)(58,"button",26),p(59,"async"),l(60),p(61,"translate"),a(),s(62,"button",27),l(63),p(64,"translate"),T(65,us,3,0,"div",28),a()()()}if(t&2){let e,i,n,d,h=u();m("formGroup",h.formGroup),r(4),v(c(5,26,"tests.form.designation")),r(2),le("is-invalid",((e=c(7,28,h.designationErrors$))==null?null:e.length)||!1),m("placeholder",c(8,30,"tests.form.designation-placeholder")),r(3),H(c(11,32,h.designationErrors$)),r(5),v(c(15,34,"tests.form.date")),r(3),m("id",h.componentId),r(3),le("is-invalid",((i=c(22,36,h.dateErrors$))==null?null:i.length)||!1),m("placeholder",c(23,38,"shared.date-select.default-placeholder")),r(4),H(c(26,40,h.dateErrors$)),r(5),v(c(30,42,"tests.form.weight")),r(5),v(c(35,44,"tests.form.factor")),r(3),le("is-invalid",((n=c(38,46,h.weightErrors$))==null?null:n.length)||!1),r(2),H(c(41,48,h.weightErrors$)),r(5),v(c(45,50,"tests.form.grading-type")),r(3),m("value",!1),r(2),v(c(50,52,"tests.form.grades")),r(3),m("value",!0),r(2),v(c(55,54,"tests.form.points")),r(2),_((d=h.formGroup.get("isPointGrading"))!=null&&d.value?56:-1),r(2),m("disabled",h.saving)("routerLink",D(62,as,c(59,56,h.courseId$))),r(2),f(" ",c(61,58,"tests.form.cancel")," "),r(2),m("disabled",h.saving),r(),f(" ",c(64,60,"tests.form.save")," "),r(2),_(h.saving?65:-1)}}var yt=(()=>{class t{constructor(e,i,n){this.fb=e,this.translate=i,this.testStateService=n,this.test=null,this.saving=!1,this.save=new J,this.componentId=fi("bkd-tests-edit-form"),this.formGroup=this.createFormGroup(),this.submitted$=new z(!1),this.destroy$=new te,this.designationErrors$=Fe(N(this.formGroup),this.submitted$,"designation"),this.dateErrors$=Fe(N(this.formGroup),this.submitted$,"date"),this.maxPointsErrors$=Fe(N(this.formGroup),this.submitted$,"maxPoints"),this.maxPointsAdjustedErrors$=Fe(N(this.formGroup),this.submitted$,"maxPointsAdjusted"),this.weightErrors$=Fe(N(this.formGroup),this.submitted$,"weight"),this.courseId$=this.testStateService.courseId$}ngOnInit(){this.test&&this.setInitialValues(this.test),Ci(N(this.formGroup),"isPointGrading").pipe(_e(this.destroy$)).subscribe(this.togglePointFieldsDisability.bind(this))}ngOnDestroy(){this.destroy$.next()}onSubmit(){this.submitted$.next(!0),this.formGroup.valid&&this.save.emit(this.formGroup.value)}createFormGroup(){return this.fb.group({designation:["",Ge.required],date:[null,Ge.required],weight:[1,Ge.compose([Ge.required,gn(0)])],isPointGrading:[!1],maxPoints:[{value:null,disabled:!0},Ge.required],maxPointsAdjusted:[{value:null,disabled:!0},null]})}setInitialValues(e){this.formGroup.patchValue({designation:e.Designation,date:e.Date,weight:e.Weight,isPointGrading:e.IsPointGrading,maxPoints:e.MaxPoints,maxPointsAdjusted:e.MaxPointsAdjusted}),e.Results&&e.Results.length>0&&(this.formGroup.get("isPointGrading")?.disable(),this.formGroup.get("maxPoints")?.disable(),this.formGroup.get("maxPointsAdjusted")?.disable()),this.togglePointFieldsDisability()}togglePointFieldsDisability(){let e=this.formGroup.get("maxPoints"),i=this.formGroup.get("maxPointsAdjusted");this.formGroup.get("isPointGrading")?.value?(e?.enable(),i?.enable()):(e?.reset({value:this.test?.MaxPoints,disabled:!0}),i?.reset({value:this.test?.MaxPointsAdjusted,disabled:!0}))}static{this.\u0275fac=function(i){return new(i||t)(x(di),x(ae),x(K))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-tests-edit-form"]],inputs:{test:"test",saving:"saving"},outputs:{save:"save"},features:[ne([{provide:pi,useClass:ui},{provide:ci,useClass:Hi}])],decls:1,vars:1,consts:[["dp","ngbDatepicker"],[3,"formGroup"],[3,"ngSubmit","formGroup"],[1,"row","g-3","mb-3"],[1,"col-md-6"],["for","designation",1,"form-label"],["id","designation","name","designation","type","text","formControlName","designation","required","",1,"form-control",3,"placeholder"],[1,"invalid-feedback"],[1,"col-md-6","mb-3"],["for","date",1,"form-label"],[1,"input-group"],[1,"input-group-text",3,"id"],[1,"material-icons"],["id","date","name","date","type","text","ngbDatepicker","","formControlName","date","required","",1,"form-control",3,"click","placeholder"],[1,"row","mb-3"],[1,"form-label"],[1,"row"],["for","factor",1,"form-label","col-3","col-sm-2"],[1,"col-9","col-sm-10"],["id","factor","name","factor","type","number","formControlName","weight","step","0.05","min","0","required","",1,"form-control"],[1,"form-check"],["type","radio","formControlName","isPointGrading","id","type-grades",1,"form-check-input",3,"value"],["for","type-grades",1,"form-check-label"],["type","radio","formControlName","isPointGrading","id","type-points",1,"form-check-input",3,"value"],["for","type-points",1,"form-check-label"],[1,"d-flex","justify-content-end","mt-4"],["type","button",1,"btn","btn-outline-secondary",3,"disabled","routerLink"],["type","submit",1,"btn","btn-primary","ms-2",3,"disabled"],["role","status",1,"spinner-border","spinner-border-sm","align-middle"],[1,"row","ms-4","mb-3","g-3"],[1,"col-sm-6","col-md-4"],["for","max-points",1,"ms-2","col-4","col-form-label"],[1,"col-6"],["type","number","name","maxPoints","id","max-points","formControlName","maxPoints","step","0.01","min","0","max","999","required","",1,"form-control"],["for","max-points-adjusted",1,"ms-2","col-4","col-form-label"],["type","number","name","maxPointsAdjusted","id","max-points-adjusted","formControlName","maxPointsAdjusted","step","0.01","min","0","max","999",1,"form-control"],[1,"ms-4","ps-3","py-3"],[1,"visually-hidden"]],template:function(i,n){i&1&&T(0,hs,66,64,"form",1),i&2&&_(n.formGroup?0:-1)},dependencies:[Le,ni,Ze,Xe,ri,Qe,ti,oi,et,Je,li,si,ai,mi,X,Y,I],styles:["#factor[_ngcontent-%COMP%], #max-points[_ngcontent-%COMP%], #max-points-adjusted[_ngcontent-%COMP%]{width:5em}"]})}}return t})();var wn=(()=>{class t{constructor(e,i,n,d,h){this.route=e,this.courseService=i,this.toastService=n,this.translate=d,this.router=h,this.saving$=new z(!1),this.courseId$=this.route.paramMap.pipe(y(g=>Number(g.get("id"))),Z())}save(e){this.saving$.next(!0);let{designation:i,date:n,weight:d,isPointGrading:h,maxPoints:g,maxPointsAdjusted:k}=e;this.courseId$.pipe(O(W=>this.courseService.add(W,n,i,d,h,g,k)),Ye(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.toastService.success(this.translate.instant("tests.form.save-success")),this.navigateBack()}navigateBack(){this.courseId$.subscribe(e=>void this.router.navigate(["events",e,"tests"]))}static{this.\u0275fac=function(i){return new(i||t)(x(re),x(ge),x(it),x(ae),x($e))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-tests-add"]],decls:6,vars:6,consts:[[1,"bkd-container","bkd-container-limited"],[3,"save","saving"]],template:function(i,n){i&1&&(s(0,"h1"),l(1),p(2,"translate"),a(),s(3,"div",0)(4,"bkd-tests-edit-form",1),p(5,"async"),b("save",function(h){return n.save(h)}),a()()),i&2&&(r(),v(c(2,2,"tests.add-title")),r(3),m("saving",c(5,4,n.saving$)))},dependencies:[yt,Y,I],encapsulation:2})}}return t})();var In=(()=>{class t{constructor(e){this.activeModal=e}get canDeleteTest(){return(this.test?.Results?.filter(i=>i.GradeId!==null||i.GradeValue!==null||i.Points!==null)||[]).length===0}static{this.\u0275fac=function(i){return new(i||t)(x(tt))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-tests-delete"]],inputs:{test:"test"},decls:13,vars:10,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click","hidden"],[1,"px-2"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"],[1,"px-3"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"p",1),l(2),p(3,"translate"),a()(),s(4,"div",2)(5,"button",3),b("click",function(){return n.activeModal.dismiss()}),s(6,"span",4),l(7),p(8,"translate"),a()(),s(9,"button",5),b("click",function(){return n.activeModal.close(n.canDeleteTest?n.test:null)}),s(10,"span",6),l(11),p(12,"translate"),a()()()),i&2&&(r(2),f(" ",c(3,4,n.canDeleteTest?"tests.form.confirm":"tests.form.delete-not-allowed")," "),r(3),m("hidden",!n.canDeleteTest),r(2),f(" ",c(8,6,"tests.dialog.no")," "),r(4),f(" ",c(12,8,n.canDeleteTest?"tests.dialog.yes":"tests.dialog.ok")," "))},dependencies:[I],encapsulation:2})}}return t})();var Cs=t=>({test:t});function _s(t,o){t&1&&C(0,"bkd-spinner")}function Ss(t,o){if(t&1){let e=G();s(0,"div",1)(1,"h1"),l(2),p(3,"translate"),a(),s(4,"button",2),b("click",function(){E(e);let n=u(),d=P(0);return w(n.openDeleteModal(d))}),s(5,"i",3),l(6,"delete"),a()()(),s(7,"bkd-tests-edit-form",4),b("save",function(n){E(e);let d=u();return w(d.save(n))}),a()}if(t&2){u();let e=P(0),i=P(2);r(2),f(" ",F(3,3,"tests.edit-title",D(6,Cs,e.Designation))," "),r(5),m("test",e)("saving",i)}}var kn=(()=>{class t{constructor(e,i,n,d,h,g,k){this.state=e,this.courseService=i,this.route=n,this.toastService=d,this.translate=h,this.router=g,this.modalService=k,this.saving$=new z(!1),this.testId$=this.route.paramMap.pipe(y(W=>Number(W.get("testId"))),Z()),this.test$=q([this.state.tests$,this.testId$]).pipe(y(([W,fe])=>W.find(Ce=>Ce.Id===fe)))}openDeleteModal(e){let i=this.modalService.open(In);i.componentInstance.test=e,i.result.then(n=>{n&&this.courseService.delete(e.CourseId,e.Id).subscribe(this.onDeleteSuccess.bind(this))},()=>{})}save(e){this.saving$.next(!0);let{designation:i,date:n,weight:d,isPointGrading:h,maxPoints:g,maxPointsAdjusted:k}=e;q([this.state.courseId$,this.testId$]).pipe(oe(1),O(([W,fe])=>this.courseService.update(W,fe,i,n,d,h,g,k)),Ye(()=>this.saving$.next(!1))).subscribe(this.onSaveSuccess.bind(this))}onSaveSuccess(){this.toastService.success(this.translate.instant("tests.form.save-success")),this.navigateBack()}onDeleteSuccess(e){this.toastService.success(this.translate.instant("tests.form.delete-success")),this.state.deleteTest(e),this.navigateBack()}navigateBack(){this.state.courseId$.pipe(oe(1)).subscribe(e=>void this.router.navigate(["events",e,"tests"]))}static{this.\u0275fac=function(i){return new(i||t)(x(K),x(ge),x(re),x(it),x(ae),x($e),x(lt))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-tests-edit"]],decls:8,vars:9,consts:[[1,"bkd-container","bkd-container-limited"],[1,"d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-primary","btn-icon",3,"click"],[1,"material-icons"],[3,"save","test","saving"]],template:function(i,n){if(i&1&&(R(0),p(1,"async"),R(2),p(3,"async"),s(4,"div",0),T(5,_s,1,0,"bkd-spinner"),p(6,"async"),T(7,Ss,8,8),a()),i&2){let d=A(c(1,1,n.test$));r(2),A(c(3,4,n.saving$)),r(3),_(c(6,7,n.state.loading$)?5:d?7:-1)}},dependencies:[yt,he,Y,I],encapsulation:2})}}return t})();var ys=t=>({designation:t}),Pn=(()=>{class t{constructor(e){this.activeModal=e}static{this.\u0275fac=function(i){return new(i||t)(x(tt))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-publish-test"]],inputs:{test:"test"},decls:11,vars:12,consts:[[1,"modal-body"],["data-testid","confirmation-message"],[1,"modal-footer"],["data-testid","cancel-button","type","button",1,"btn","btn-outline-secondary",3,"click"],["data-testid","confirm-button","type","button",1,"btn","btn-primary",3,"click"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"p",1),l(2),p(3,"translate"),a()(),s(4,"div",2)(5,"button",3),b("click",function(){return n.activeModal.dismiss()}),l(6),p(7,"translate"),a(),s(8,"button",4),b("click",function(){return n.activeModal.close(!0)}),l(9),p(10,"translate"),a()()),i&2&&(r(2),f(" ",F(3,3,n.test.IsPublished?"tests.publishing.unpublish":"tests.publishing.publish",D(10,ys,n.test.Designation))," "),r(4),f(" ",c(7,6,"tests.publishing.cancel")," "),r(3),f(" ",c(10,8,"tests.publishing.confirm")," "))},dependencies:[I],encapsulation:2})}}return t})();var xs=t=>({maxPoints:t});function bs(t,o){if(t&1&&(s(0,"div",6),l(1),p(2,"translate"),a()),t&2){let e=u(2);r(),f(" ",F(2,1,"global.validation-errors.invalidPoints",D(4,xs,e.maxPoints))," ")}}function Ts(t,o){if(t&1){let e=G();s(0,"div",3)(1,"input",5,0),b("ngModelChange",function(){E(e);let n=Se(2),d=u();return w(d.onPointsChange(n.value))}),a(),T(3,bs,3,6,"div",6),a()}if(t&2){let e=Se(2),i=u();r(),le("is-invalid",e.errors),pe("max",i.maxPoints),pe("tabindex",i.tabIndex),m("disabled",i.grade.test.IsPublished)("ngModel",i.grade.kind==="grade"?i.grade.result.Points:null),r(2),_(e.errors?3:-1)}}var Es=1250,Mn=(()=>{class t{constructor(e){this.state=e,this.maxPoints=0,this.pointsSubject$=new te,this.gradeSubject$=new te,this.gradingScaleDisabledSubject$=new z(!0),this.gradingScaleDisabled$=this.gradingScaleDisabledSubject$.asObservable(),this.destroy$=new te}ngOnInit(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale()),this.maxPoints=Sn(this.grade),this.initSave(this.pointsSubject$.pipe(ve(this.isValid.bind(this)),y(e=>({studentId:this.student.Id,testId:this.grade.test.Id,points:e?Number(e):null})))),this.initSave(this.gradeSubject$.pipe(y(e=>({studentId:this.student.Id,testId:this.grade.test.Id,gradeId:e}))))}ngOnChanges(){this.gradingScaleDisabledSubject$.next(this.disableGradingScale())}ngOnDestroy(){this.destroy$.next()}onPointsChange(e){this.pointsSubject$.next(e),this.gradingScaleDisabledSubject$.next(!(e===null||e===""))}onGradeChange(e){this.gradeSubject$.next(e)}isValid(e){return e===""||e===null?!0:isNaN(Number(e))?!1:!(Number(e)<0||Number(e)>this.maxPoints)}initSave(e){e.pipe(Rt(i=>this.state.optimisticallyUpdateGrade(i).pipe(y(n=>({params:i,originalResult:n})))),Bt(Es),_e(this.destroy$)).subscribe(({params:i,originalResult:n})=>this.state.saveGrade(i,n))}disableGradingScale(){return this.grade.test.IsPublished?!0:this.grade.kind==="no-result"?!1:this.grade.result.Points!=null&&this.grade.test.IsPointGrading}static{this.\u0275fac=function(i){return new(i||t)(x(K))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-grade"]],inputs:{grade:"grade",student:"student",tabIndex:"tabIndex",gradeOptions:"gradeOptions"},features:[Ie],decls:5,vars:8,consts:[["points","ngModel"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],[1,"point-input-container","me-2","me-md-3"],["data-testid","grade-select",1,"grade-select",3,"valueChange","options","allowEmpty","value","disabled","tabindex"],["type","number","step","0.01","min","0","data-testid","point-input",1,"form-control",3,"ngModelChange","max","disabled","tabindex","ngModel"],["data-testid","validation-error-message",1,"invalid-feedback"]],template:function(i,n){i&1&&(s(0,"div",1)(1,"div",2),T(2,Ts,4,7,"div",3),s(3,"bkd-select",4),p(4,"async"),b("valueChange",function(h){return n.onGradeChange(h)}),a()()()),i&2&&(r(2),_(n.grade.test.IsPointGrading?2:-1),r(),m("options",n.gradeOptions)("allowEmpty",!0)("value",n.grade.kind==="grade"?n.grade.result.GradeId:null)("disabled",c(4,6,n.gradingScaleDisabled$))("tabindex",n.tabIndex))},dependencies:[Le,Ze,Xe,Qe,et,Je,ii,Be,Y,I],styles:[".point-input-container[_ngcontent-%COMP%]{width:4em}[_nghost-%COMP%] select{width:127px}@media (min-width: 576px){.point-input-container[_ngcontent-%COMP%]{width:5em}}"]})}}return t})();function ws(t,o){if(t&1&&(s(0,"span",1),l(1),a()),t&2){let e=u();r(),v(e.calculatePointsAverage(e.test))}}var On=(()=>{class t{constructor(e){this.locale=e}calculatePointsAverage(e){return this.safeAverage(e,2,at)}calculateGradeAverage(e){return this.safeAverage(e,3,ot)}safeAverage(e,i,n){try{return Fi(n(e),this.locale,i)}catch{return Li}}static{this.\u0275fac=function(i){return new(i||t)(x(Xt))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-average-grades"]],inputs:{test:"test"},decls:4,vars:2,consts:[[1,"d-flex","flex-row","w-100"],["data-testid","average-points",1,"mr-2","mr-md-3","average-points"],["data-testid","average-grade"]],template:function(i,n){i&1&&(s(0,"div",0),T(1,ws,2,1,"span",1),s(2,"span",2),l(3),a()()),i&2&&(r(),_(n.test.IsPointGrading?1:-1),r(2),v(n.calculateGradeAverage(n.test)))},styles:[".average-points[_ngcontent-%COMP%]{min-width:4.5em}@media (min-width: 576px){.average-points[_ngcontent-%COMP%]{min-width:6em}}"]})}}return t})();var $n=(()=>{class t{constructor(){this.disabled=!1,this.width="127px",this.gradeIdSelected=new J}onGradeChange(e){this.gradeId?.valueOf()!==void 0&&this.gradeIdSelected.emit({id:this.gradeId?.valueOf(),selectedGradeId:e})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-grade-select"]],inputs:{options:"options",valueId:"valueId",gradeId:"gradeId",disabled:"disabled",width:"width"},outputs:{gradeIdSelected:"gradeIdSelected"},decls:1,vars:5,consts:[["data-testid","grade-select",3,"valueChange","options","allowEmpty","value","disabled","width"]],template:function(i,n){i&1&&(s(0,"bkd-select",0),b("valueChange",function(h){return n.onGradeChange(h)}),a()),i&2&&m("options",n.options)("allowEmpty",!0)("value",n.valueId)("disabled",n.disabled)("width",n.width)},dependencies:[Be],encapsulation:2})}}return t})();var Is=576,Gn=(()=>{class t{constructor(e,i){this.portal=e,this.state=i,this.destroy$=new te,this.handleWindowScroll=()=>{this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleWindowResize=()=>{this.updateStickyWidth(),this.updateStickyVisibility(),this.updateStickyTopOffset()},this.handleTableScroll=()=>{this.updateStickyLeftOffset()}}ngOnInit(){q([this.state.filteredTests$,this.state.expandedHeader$]).pipe(_e(this.destroy$)).subscribe(()=>setTimeout(()=>this.updateStickyWidth()))}ngAfterViewInit(){this.handleWindowScroll(),this.handleTableScroll(),this.handleWindowResize(),this.window.addEventListener("scroll",this.handleWindowScroll),this.getTableScrollContainer()?.addEventListener("scroll",this.handleTableScroll),this.window.addEventListener("resize",this.handleWindowResize)}ngOnDestroy(){this.window.removeEventListener("scroll",this.handleWindowScroll),this.getTableScrollContainer()?.removeEventListener("scroll",this.handleTableScroll),this.window.removeEventListener("resize",this.handleWindowResize)}get window(){return this.portal.window??window}getTableScrollContainer(){return document.querySelector(".table-responsive-wrapper")??null}updateStickyVisibility(){if(this.isSmallBreakpointDown())return;let e=this.inlineHeader.getTop()+this.getIframeScrollY();this.stickyHeader.shown=this.getScrollTop()>e}updateStickyTopOffset(){this.isSmallBreakpointDown()||this.stickyHeader.setTopOffset(this.portal.inIframe?this.getScrollTop():0)}updateStickyLeftOffset(){this.isSmallBreakpointDown()||this.stickyHeader.setLeftOffset(this.inlineHeader.getLeft())}updateStickyWidth(){this.isSmallBreakpointDown()||(this.stickyHeader.setWidth(this.inlineHeader.getWidth()),this.stickyHeader.setColumnWidths(this.inlineHeader.getColumnWidths()),this.stickyHeader.setStickyColumnHeights(this.inlineHeader.getStickyColumnsHeights()))}getScrollTop(){return this.window.scrollY-this.portal.getIframeTop()}getIframeScrollY(){return window.scrollY}isSmallBreakpointDown(){return window.innerWidth({"btn-primary":t,"btn-outline-secondary":o}),Dn=(()=>{class t{constructor(){this.filter=Gt,this.filterChange=new J}showOnlyMine(){this.filterChange.next(B(L({},this.filter),{onlyMine:!0}))}showAll(){this.filterChange.next(B(L({},this.filter),{onlyMine:!1}))}onHidePublishedChange(e){let i=(e.target&&e.target instanceof HTMLInputElement&&e.target?.checked)??!1;this.filterChange.next(B(L({},this.filter),{hidePublished:i}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-test-table-filter"]],inputs:{filter:"filter"},outputs:{filterChange:"filterChange"},decls:13,vars:18,consts:[[1,"only-mine-buttons"],["type","button",1,"btn","desktop",3,"click","ngClass"],["type","button",1,"btn","ms-2","desktop",3,"click","ngClass"],[1,"hide-published"],[1,"form-check"],["id","hide-published","type","checkbox",1,"form-check-input",3,"change","checked"],["for","hide-published",1,"form-check-label"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"button",1),b("click",function(){return n.showAll()}),l(2),p(3,"translate"),a(),s(4,"button",2),b("click",function(){return n.showOnlyMine()}),l(5),p(6,"translate"),a()(),s(7,"div",3)(8,"div",4)(9,"input",5),b("change",function(h){return n.onHidePublishedChange(h)}),a(),s(10,"label",6),l(11),p(12,"translate"),a()()()),i&2&&(r(),m("ngClass",Et(12,Ln,!n.filter.onlyMine,n.filter.onlyMine)),r(),f(" ",c(3,6,"tests.all-tests")," "),r(2),m("ngClass",Et(15,Ln,n.filter.onlyMine,!n.filter.onlyMine)),r(),f(" ",c(6,8,"tests.owned-tests")," "),r(4),m("checked",n.filter.hidePublished),r(2),f(" ",c(12,10,"tests.hide-published")," "))},dependencies:[ce,Le,I],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;justify-content:space-between;height:100%}.only-mine-buttons[_ngcontent-%COMP%]{display:flex;align-items:center;height:3.625rem}.hide-published[_ngcontent-%COMP%]{display:flex;align-items:center;height:2.375rem;margin-bottom:1rem}.hide-published[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-weight:300}.hide-published[_ngcontent-%COMP%] .form-check[_ngcontent-%COMP%]{margin-bottom:0}"]})}}return t})();var ks=["*"],Fn=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-preserve-line-height"]],ngContentSelectors:ks,decls:3,vars:0,template:function(i,n){i&1&&(Zt(),s(0,"div"),Qt(1),l(2,"\xA0"),a())},encapsulation:2})}}return t})();var Rn=(()=>{class t{constructor(e){this.translate=e}transform(e){return`${e.Weight} (${e.WeightPercent}%)${this.getPoints(e)}`}getPoints(e){return e.IsPointGrading?`, ${e.MaxPointsAdjusted??e.MaxPoints} ${this.translate.instant("tests.summary.points")}`:""}static{this.\u0275fac=function(i){return new(i||t)(x(ae,16))}}static{this.\u0275pipe=Kt({name:"testSummaryShort",type:t,pure:!0})}}return t})();var Ps=t=>[t,"edit"];function Ms(t,o){t&1&&(s(0,"i",9),l(1,"edit"),a())}function Os(t,o){if(t&1&&(s(0,"div",5)(1,"div",7)(2,"bkd-preserve-line-height"),l(3),p(4,"date"),a(),s(5,"a",8),T(6,Ms,2,0,"i",9),a()(),s(7,"bkd-preserve-line-height"),l(8),p(9,"testSummaryShort"),a(),s(10,"bkd-preserve-line-height"),l(11),a()()),t&2){let e=u();r(3),v(F(4,5,e.test.Date,"dd.MM.yyyy")),r(2),m("routerLink",D(10,Ps,e.test.Id)),r(),_(e.test.IsOwner&&e.test.IsPublished===!1?6:-1),r(2),f(" ",c(9,8,e.test)," "),r(3),v(e.test.Owner)}}function $s(t,o){if(t&1){let e=G();s(0,"div",6)(1,"a",10),p(2,"translate"),b("click",function(){E(e);let n=u();return w(n.unpublishTest())}),s(3,"i",11),l(4,"lock"),a(),s(5,"span"),l(6),p(7,"translate"),a()(),s(8,"bkd-caret",12),b("click",function(){E(e);let n=u();return w(n.emitToggleHeader())}),a()()}if(t&2){let e=u();r(),pe("title",c(2,3,"tests.edit")),r(5),v(c(7,5,"tests.published")),r(2),m("expanded",e.expanded)}}function Gs(t,o){if(t&1){let e=G();s(0,"div",6)(1,"a",13),p(2,"translate"),b("click",function(){E(e);let n=u();return w(n.publishTest())}),s(3,"i",11),l(4,"lock_open"),a(),s(5,"span"),l(6),p(7,"translate"),a()(),s(8,"bkd-caret",12),b("click",function(){E(e);let n=u();return w(n.emitToggleHeader())}),a()()}if(t&2){let e=u();r(),pe("title",c(2,3,"tests.publish")),r(5),v(c(7,5,"tests.not-published")),r(2),m("expanded",e.expanded)}}var Bn=(()=>{class t{constructor(){this.toggleHeader=new J,this.publish=new J,this.unpublish=new J}emitToggleHeader(){this.toggleHeader.emit(!this.expanded)}publishTest(){this.publish.emit(this.test)}unpublishTest(){this.unpublish.emit(this.test)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-test-table-header"]],inputs:{test:"test",expanded:"expanded"},outputs:{toggleHeader:"toggleHeader",publish:"publish",unpublish:"unpublish"},decls:9,vars:5,consts:[[1,"d-flex","flex-column","h-100","justify-content-between"],["role","button",1,"test-designation","d-flex","flex-row","my-3","align-items-end","justify-content-between",3,"click"],[3,"ngClass"],[1,"align-self-start",3,"expanded"],[1,"d-flex","flex-column"],[1,"d-flex","flex-column","mb-3"],[1,"d-flex","align-items-center","justify-content-between","test-status"],[1,"d-flex","flex-row","justify-content-between"],[1,"btn","btn-link","p-0","edit",3,"routerLink"],[1,"material-icons"],[1,"d-flex","btn","btn-link","ps-0","edit",3,"click","title"],[1,"material-icons","me-1"],[1,"expand-mobile",3,"click","expanded"],[1,"d-flex","btn","btn-link","ps-0",3,"click","title"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"div",1),b("click",function(){return n.emitToggleHeader()}),s(2,"div",2),l(3),a(),C(4,"bkd-caret",3),a(),s(5,"div",4),T(6,Os,12,12,"div",5)(7,$s,9,7,"div",6)(8,Gs,9,7,"div",6),a()()),i&2&&(r(2),m("ngClass",n.expanded?"expanded":"collapsed"),r(),f(" ",n.test.Designation," "),r(),m("expanded",n.expanded),r(2),_(n.expanded?6:-1),r(),_(n.test.IsPublished?7:8))},dependencies:[ce,bi,Fn,X,Oe,I,Rn],styles:["[_nghost-%COMP%]{font-weight:300}.collapsed[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.test-designation[_ngcontent-%COMP%]{display:none!important}.test-status[_ngcontent-%COMP%]{order:-1;padding-bottom:1rem}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}.test-status[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:#000}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}.test-status[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}.edit[_ngcontent-%COMP%]{color:#00000080;text-decoration:none}@media (min-width: 811px){.test-designation[_ngcontent-%COMP%]{display:inherit!important}.test-status[_ngcontent-%COMP%]{order:initial}.expand-mobile[_ngcontent-%COMP%]{display:none!important}}"]})}}return t})();var Ls=["bkdTestEditGradesHeader",""],Lt=(t,o)=>o.Id,Ds=t=>({"test-point-grading":t}),Fs=t=>({selected:t});function Rs(t,o){if(t&1){let e=G();s(0,"th",3)(1,"bkd-test-table-header",14),b("toggleHeader",function(n){E(e);let d=u();return w(d.state.toggleHeader(n))})("publish",function(n){E(e);let d=u();return w(d.publish.emit(n))})("unpublish",function(n){E(e);let d=u();return w(d.unpublish.emit(n))}),a()()}if(t&2){let e=o.$implicit,i=u(),n=P(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)("expanded",n)}}function Bs(t,o){if(t&1){let e=G();s(0,"th",4)(1,"bkd-test-table-header",14),b("toggleHeader",function(n){E(e);let d=u();return w(d.state.toggleHeader(n))})("publish",function(n){E(e);let d=u();return w(d.publish.emit(n))})("unpublish",function(n){E(e);let d=u();return w(d.unpublish.emit(n))}),a()()}if(t&2){let e=o.$implicit,i=u(),n=P(4);m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)("expanded",n)}}function js(t,o){if(t&1){let e=G();s(0,"div",15)(1,"span",16),b("click",function(){E(e);let n=u().$implicit,d=u();return w(d.state.sortBy(n))}),l(2),p(3,"translate"),a()()}t&2&&(r(2),f("",c(3,1,"tests.points")," "))}function As(t,o){if(t&1){let e=G();s(0,"th",13)(1,"div",8),T(2,js,4,3,"div",15),s(3,"div",9)(4,"span",16),b("click",function(){let n=E(e).$implicit,d=u();return w(d.state.sortBy(n))}),l(5),p(6,"translate"),a()(),s(7,"div",10),l(8),p(9,"async"),a()()()}if(t&2){let e=o.$implicit,i=u();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(2),_(e.IsPointGrading?2:-1),r(3),v(c(6,4,"tests.grade")),r(3),f(" ",c(9,6,i.state.getSortingChar$(e))," ")}}var jn=(()=>{class t{set shown(e){let i=this.element.nativeElement.classList;e?i.add("shown"):i.remove("shown")}constructor(e,i){this.state=e,this.element=i,this.sticky=!1,this.publish=new J,this.unpublish=new J}getTop(){return this.element.nativeElement.getBoundingClientRect().top}getLeft(){return this.element.nativeElement.getBoundingClientRect().left}setTopOffset(e){this.element.nativeElement.style.top=`${e}px`}setLeftOffset(e){this.element.nativeElement.style.left=`${e}px`}getWidth(){return this.element.nativeElement.getBoundingClientRect().width}setWidth(e){this.element.nativeElement.style.width=`${e}px`}getColumnWidths(){return this.getRowsAndColumns().map(e=>e.map(i=>i.getBoundingClientRect().width))}setColumnWidths(e){let i=this.getRowsAndColumns();if(i.length!==e.length||!i.every((n,d)=>n.length===e[d].length))throw new Error("Given column widths do not match number of header rows/columns");i.forEach((n,d)=>n.forEach((h,g)=>{h.style.width=`${e[d][g]}px`,h.style.minWidth=`${e[d][g]}px`}))}getStickyColumnsHeights(){return this.getRowsAndColumns(".sticky").map(e=>e.map(i=>i.getBoundingClientRect().height))}setStickyColumnHeights(e){let i=this.getRowsAndColumns(".sticky");if(i.length!==e.length||!i.every((n,d)=>n.length===e[d].length))throw new Error("Given column heights do not match number of sticky header columns");i.forEach((n,d)=>n.forEach((h,g)=>{h.style.height=`${e[d][g]}px`})),this.getRows().forEach((n,d)=>{let h=e[d].reduce((g,k)=>Math.max(g,k),0);n.style.height=`${h}px`})}getRowsAndColumns(e){return this.getRows().map(i=>Array.from(i.querySelectorAll(`th:not(.header-mobile)${e??""}`)))}getRows(){return Array.from(this.element.nativeElement.querySelectorAll("tr"))}static{this.\u0275fac=function(i){return new(i||t)(x(K),x(qt))}}static{this.\u0275cmp=S({type:t,selectors:[["thead","bkdTestEditGradesHeader",""]],hostVars:2,hostBindings:function(i,n){i&2&&le("sticky",n.sticky)},inputs:{selectedTest:"selectedTest",sticky:"sticky",shown:"shown"},outputs:{publish:"publish",unpublish:"unpublish"},attrs:Ls,decls:42,vars:32,consts:[[1,"header-collapsible"],["colspan","3",1,"desktop","sticky"],[3,"filterChange","filter"],["container","body",1,"test-grade","grade","test-info-desktop",3,"ngClass"],["container","body","colspan","3",1,"test-grade","header-mobile","test-info-mobile",3,"ngClass"],[1,"filler"],[3,"ngClass"],[1,"sticky","student-name",3,"click"],[1,"d-flex"],[1,"column-title"],[1,"sort-direction","ms-1"],[1,"sticky","student-grade","desktop",3,"click","ngClass"],[1,"border-end","sticky","student-average","desktop",3,"click"],["container","body",1,"test-grade",3,"ngClass"],[3,"toggleHeader","publish","unpublish","test","expanded"],[1,"column-title","point-input-container","me-2","me-md-3"],[3,"click"]],template:function(i,n){if(i&1){let d=G();R(0),p(1,"async"),R(2),p(3,"async"),R(4),p(5,"async"),s(6,"tr",0)(7,"th",1)(8,"bkd-test-table-filter",2),b("filterChange",function(g){return E(d),w(n.state.setFilter(g))}),a()(),V(9,Rs,2,3,"th",3,Lt),V(11,Bs,2,3,"th",4,Lt),C(13,"th",5),a(),s(14,"tr",6)(15,"th",7),b("click",function(){return E(d),w(n.state.sortBy("FullName"))}),s(16,"div",8)(17,"div",9),l(18),p(19,"translate"),a(),s(20,"div",10),l(21),p(22,"async"),a()()(),s(23,"th",11),b("click",function(){return E(d),w(n.state.sortBy("FinalGrade"))}),s(24,"div",8)(25,"div",9),l(26),p(27,"translate"),a(),s(28,"div",10),l(29),p(30,"async"),a()()(),s(31,"th",12),b("click",function(){return E(d),w(n.state.sortBy("TestsMean"))}),s(32,"div",8)(33,"div",9),l(34),p(35,"translate"),a(),s(36,"div",10),l(37),p(38,"async"),a()()(),V(39,As,10,8,"th",13,Lt),C(41,"th",5),a()}if(i&2){let d=c(1,9,n.state.filteredTests$),h=c(3,11,n.state.filter$);r(4),A(c(5,13,n.state.expandedHeader$)),r(4),m("filter",h),r(),H(d),r(2),H(d),r(3),m("ngClass",D(28,Ds,n.selectedTest==null?null:n.selectedTest.IsPointGrading)),r(4),f(" ",c(19,16,"tests.student.name")," "),r(3),f(" ",c(22,18,n.state.getSortingChar$("FullName"))," "),r(2),m("ngClass",D(30,Fs,n.selectedTest===void 0)),r(3),f(" ",c(27,20,"tests.grade")," "),r(3),f(" ",c(30,22,n.state.getSortingChar$("FinalGrade"))," "),r(5),f(" ",c(35,24,"tests.mean")," "),r(3),f(" ",c(38,26,n.state.getSortingChar$("TestsMean"))," "),r(2),H(d)}},dependencies:[Y,ce,I,Dn,Bn],styles:["[_nghost-%COMP%]{--spacer: 16px;--point-input-size: 4em;--grade-input-size: 127px;--points-grade-gap: 1rem;--student-name-column-width: 225px;--student-grade-column-width: calc( var(--spacer) + var(--grade-input-size) + var(--spacer) );--student-average-column-width: 100px;--test-grade-column-width: calc( var(--spacer) + var(--point-input-size) + var(--points-grade-gap) + var(--grade-input-size) + var(--spacer) );--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}@media (max-width: 767.98px){[_nghost-%COMP%]{--points-grade-gap: calc(.5 * var(--spacer))}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}@media (max-width: 810px){tr[_ngcontent-%COMP%]:not(.header-collapsible):not(.test-point-grading) th.test-grade[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]:not(.test-point-grading) th.student-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.test-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.student-grade[_ngcontent-%COMP%]{width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));min-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));max-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer))}}th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{padding:0;width:auto}@media (max-width: 810px){th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{width:0}}th.test-grade[_ngcontent-%COMP%] .column-title.point-input-container[_ngcontent-%COMP%]{width:var(--point-input-size)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block;padding-right:0}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}.sticky[_nghost-%COMP%]{position:fixed;top:0;left:0;z-index:1000;display:none}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;vertical-align:top}.header-collapsible[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-bottom:1px solid #dee2e6;padding:0 1rem}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:none!important}@media (min-width: 811px){.sticky.shown[_nghost-%COMP%]{display:table-header-group}tr[_ngcontent-%COMP%] th.test-info-mobile[_ngcontent-%COMP%]{display:none!important}tr[_ngcontent-%COMP%] th.test-info-desktop[_ngcontent-%COMP%]{display:table-cell!important}tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:none;padding-top:.25rem;padding-bottom:.25rem;border-top:initial}.sticky[_nghost-%COMP%]{margin-left:var(--test-columns-offset)}.sticky[_nghost-%COMP%] th.sticky[_ngcontent-%COMP%]{position:fixed}}"],changeDetection:0})}}return t})();var Vs=(t,o)=>o.student.Id,Hs=(t,o)=>o.Id,Ns=(t,o)=>o.id,Us=t=>({"test-point-grading":t}),An=t=>({selected:t}),Ws=t=>["student",t,"grades"],zs=t=>({"visible-on-mobile":t});function qs(t,o){if(t&1){let e=G();s(0,"bkd-grade-select",19),p(1,"async"),p(2,"async"),b("gradeIdSelected",function(n){E(e);let d=u(2);return w(d.state.overwriteFinalGrade(n))}),a()}if(t&2){let e=u().$implicit,i=u();m("options",c(1,4,i.state.gradingOptionsForCourse$()))("valueId",e.finalGrade.finalGradeId)("gradeId",e.finalGrade.id)("disabled",c(2,6,i.isEditFinalGradesAllowed(e))===!1)}}function Ys(t,o){if(t&1&&(s(0,"div"),l(1),a()),t&2){let e=u().$implicit;r(),f(" ",e.finalGrade.freeHandGrade," ")}}function Ks(t,o){if(t&1&&(R(0),s(1,"td",11),C(2,"bkd-grade",20),p(3,"async"),a()),t&2){let e=o.$implicit,i=o.$index,n=u(),d=n.$implicit,h=n.$index,g=u(),k=e.grade;r(),m("ngClass",g.selectedTest!==void 0&&k.test.Id===g.selectedTest.Id?"selected":""),r(),m("grade",k)("gradeOptions",c(3,5,g.state.gradingOptionsForTest$(k.test)))("student",d.student)("tabIndex",(1+i)*1e3+h)}}function Zs(t,o){if(t&1&&(s(0,"tr")(1,"td",6)(2,"a",15)(3,"div"),l(4),a(),s(5,"div",8),l(6),p(7,"translate"),p(8,"decimalOrDash"),a()()(),s(9,"td",16),T(10,qs,3,8,"bkd-grade-select",17)(11,Ys,2,1,"div"),a(),s(12,"td",18),l(13),p(14,"decimalOrDash"),a(),V(15,Ks,4,7,"td",11,Ns),C(17,"td",12),a()),t&2){let e=o.$implicit,i=u();r(2),m("routerLink",D(16,Ws,e.student.Id)),r(2),v(e.student.FullName),r(2),Ue(" ",c(7,8,"tests.mean"),": ",F(8,10,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),r(3),m("ngClass",D(18,An,i.selectedTest===void 0)),r(),_(e.finalGrade&&!e.finalGrade.freeHandGrade?10:-1),r(),_(e.finalGrade&&e.finalGrade.freeHandGrade?11:-1),r(2),f(" ",F(14,13,e.finalGrade==null?null:e.finalGrade.average,"1-3")," "),r(2),H(i.getGrades(e))}}function Qs(t,o){if(t&1&&(s(0,"td",11),C(1,"bkd-average-grades",21),a()),t&2){let e=o.$implicit,i=u();m("ngClass",e.Id===(i.selectedTest==null?null:i.selectedTest.Id)||e.Id===(i.selectedTest==null?null:i.selectedTest.Id)?"selected":""),r(),m("test",e)}}function Xs(t,o){if(t&1){let e=G();s(0,"button",22),b("click",function(){E(e);let n=u();return w(n.setAverageAsFinalGrade())}),l(1),p(2,"translate"),a()}if(t&2){let e=u(),i=P(2);m("ngClass",D(4,zs,!i||!e.selectedTest)),r(),f(" ",c(2,2,"tests.set-final-grade")," ")}}var Vn=(()=>{class t{constructor(e,i){this.state=e,this.modalService=i}ngOnInit(){this.state.setSorting({key:"FullName",ascending:!0})}setAverageAsFinalGrade(){this.state.course$.pipe(oe(1)).subscribe(e=>this.state.setAveragesAsFinalGrades({CourseIds:[e.Id]}))}isEditFinalGradesAllowed(e){return this.state.course$.pipe(y(i=>!!(ht(i)?.value&&e.finalGrade?.canGrade)))}getGrades(e){return e.grades.flatMap(i=>({id:`${e.student.Id}-${i.test.Id}`,grade:i}))}publish(e){let i=this.openModal(e);this.onCloseModal(i,()=>this.state.publish(e))}unpublish(e){let i=this.openModal(e);this.onCloseModal(i,()=>this.state.unpublish(e))}calculatePointsAverage(e){return this.safeAverage(e,at)}calculateGradeAverage(e){return this.safeAverage(e,ot)}safeAverage(e,i){try{return i(e).toString()}catch{return"\u2013"}}openModal(e){let i=this.modalService.open(Pn);return i.componentInstance.test=e,i}onCloseModal(e,i){e.result.then(n=>{n&&i()},()=>{})}static{this.\u0275fac=function(i){return new(i||t)(x(K),x(lt))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-test-edit-grades"]],inputs:{selectedTest:"selectedTest"},features:[ne([He])],decls:40,vars:45,consts:[["inlineHeader",""],["stickyHeader",""],[1,"table-responsive-wrapper"],["bkdTestEditGradesHeaderSticky","",1,"table","table-hover","h-100",3,"ngClass","inlineHeader","stickyHeader"],["bkdTestEditGradesHeader","",3,"publish","unpublish","selectedTest"],["bkdTestEditGradesHeader","",3,"publish","unpublish","sticky","selectedTest"],[1,"sticky","student-name"],[1,"d-flex","flex-column"],[1,"student-average-inline"],[1,"desktop","sticky","student-grade",3,"ngClass"],[1,"desktop","border-end","sticky","student-average"],[1,"test-grade",3,"ngClass"],[1,"filler"],[1,"action-buttons"],["data-testId","apply-average-button","type","button",1,"apply-average-button","btn","btn-primary","m-3",3,"ngClass"],[3,"routerLink"],[1,"sticky","student-grade",3,"ngClass"],[3,"options","valueId","gradeId","disabled"],[1,"border-end","sticky","student-average"],[3,"gradeIdSelected","options","valueId","gradeId","disabled"],[3,"grade","gradeOptions","student","tabIndex"],[3,"test"],["data-testId","apply-average-button","type","button",1,"apply-average-button","btn","btn-primary","m-3",3,"click","ngClass"]],template:function(i,n){if(i&1){let d=G();R(0),p(1,"async"),R(2),p(3,"async"),R(4),p(5,"async"),s(6,"div",2)(7,"table",3)(8,"thead",4,0),b("publish",function(g){return E(d),w(n.publish(g))})("unpublish",function(g){return E(d),w(n.unpublish(g))}),a(),s(10,"thead",5,1),b("publish",function(g){return E(d),w(n.publish(g))})("unpublish",function(g){return E(d),w(n.unpublish(g))}),a(),s(12,"tbody"),V(13,Zs,18,20,"tr",null,Vs),s(15,"tr")(16,"td",6)(17,"div",7)(18,"div"),l(19),p(20,"translate"),a(),s(21,"div",8),l(22),p(23,"translate"),p(24,"async"),p(25,"decimalOrDash"),a()()(),s(26,"td",9),l(27),p(28,"async"),p(29,"decimalOrDash"),a(),s(30,"td",10),l(31),p(32,"async"),p(33,"decimalOrDash"),a(),V(34,Qs,2,2,"td",11,Hs),C(36,"td",12),a()()(),s(37,"div",13),T(38,Xs,3,6,"button",14),p(39,"async"),a()()}if(i&2){let d=Se(9),h=Se(11),g=c(1,13,n.state.filteredTests$);r(2),A(c(3,15,n.state.hasTests$));let k=c(5,18,n.state.studentGrades$);r(5),m("ngClass",D(41,Us,n.selectedTest==null?null:n.selectedTest.IsPointGrading))("inlineHeader",d)("stickyHeader",h),r(),m("selectedTest",n.selectedTest),r(2),m("sticky",!0)("selectedTest",n.selectedTest),r(3),H(k),r(6),v(c(20,20,"tests.average")),r(3),Ue(" ",c(23,22,"tests.mean"),": ",F(25,26,c(24,24,n.state.meanOfStudentGradesForCourse$),"1-3")," "),r(4),m("ngClass",D(43,An,n.selectedTest===void 0)),r(),f(" ",F(29,31,c(28,29,n.state.meanOfFinalGradesForCourse$),"1-3")," "),r(4),f(" ",F(33,36,c(32,34,n.state.meanOfStudentGradesForCourse$),"1-3")," "),r(3),H(g),r(4),_(c(39,39,n.state.canSetFinalGrade$)?38:-1)}},dependencies:[ce,X,$n,Mn,On,Y,I,Di,Gn,jn],styles:["[_nghost-%COMP%]{--spacer: 16px;--point-input-size: 4em;--grade-input-size: 127px;--points-grade-gap: 1rem;--student-name-column-width: 225px;--student-grade-column-width: calc( var(--spacer) + var(--grade-input-size) + var(--spacer) );--student-average-column-width: 100px;--test-grade-column-width: calc( var(--spacer) + var(--point-input-size) + var(--points-grade-gap) + var(--grade-input-size) + var(--spacer) );--student-grade-column-offset: var(--student-name-column-width);--student-average-column-offset: calc( var(--student-grade-column-offset) + var(--student-grade-column-width) );--test-columns-offset: calc( var(--student-average-column-offset) + var(--student-average-column-width) )}@media (min-width: 1000px){[_nghost-%COMP%]{--student-name-column-width: 275px}}@media (max-width: 767.98px){[_nghost-%COMP%]{--points-grade-gap: calc(.5 * var(--spacer))}}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:1rem}td[_ngcontent-%COMP%]{vertical-align:middle}@media (min-width: 576px){[_nghost-%COMP%]{--point-input-size: 5em}}tr[_ngcontent-%COMP%]:not(.header-collapsible) th.test-grade[_ngcontent-%COMP%], td.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}@media (max-width: 810px){tr[_ngcontent-%COMP%]:not(.header-collapsible):not(.test-point-grading) th.test-grade[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]:not(.test-point-grading) th.student-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.test-grade[_ngcontent-%COMP%], table[_ngcontent-%COMP%]:not(.test-point-grading) td.student-grade[_ngcontent-%COMP%]{width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));min-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer));max-width:calc(var(--spacer) + var(--grade-input-size) + var(--spacer))}}th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{padding:0;width:auto}@media (max-width: 810px){th.filler[_ngcontent-%COMP%], .header-collapsible[_ngcontent-%COMP%] th.filler[_ngcontent-%COMP%], td.filler[_ngcontent-%COMP%]{width:0}}th.test-grade[_ngcontent-%COMP%] .column-title.point-input-container[_ngcontent-%COMP%]{width:var(--point-input-size)}@media (max-width: 810px){.desktop[_ngcontent-%COMP%]:not(.selected), .student-grade[_ngcontent-%COMP%]:not(.selected), .student-average[_ngcontent-%COMP%], .test-grade[_ngcontent-%COMP%]:not(.selected){display:none}table[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%], thead[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%]{display:flex;width:100%}.student-name[_ngcontent-%COMP%]{flex:1;display:block;padding-right:0}.test-grade[_ngcontent-%COMP%]{flex:none;display:block}}@media (min-width: 811px){.mobile[_ngcontent-%COMP%]{display:none}.student-name[_ngcontent-%COMP%]{width:var(--student-name-column-width);min-width:var(--student-name-column-width);max-width:var(--student-name-column-width)}.student-grade[_ngcontent-%COMP%]{width:var(--student-grade-column-width);min-width:var(--student-grade-column-width);max-width:var(--student-grade-column-width)}.student-average[_ngcontent-%COMP%]{width:var(--student-average-column-width);min-width:var(--student-average-column-width);max-width:var(--student-average-column-width)}.test-grade[_ngcontent-%COMP%]{width:var(--test-grade-column-width);min-width:var(--test-grade-column-width);max-width:var(--test-grade-column-width)}th.sticky[_ngcontent-%COMP%], td.sticky[_ngcontent-%COMP%]{position:sticky;left:0;background-color:#fff}th.sticky.student-grade[_ngcontent-%COMP%], td.sticky.student-grade[_ngcontent-%COMP%]{left:var(--student-grade-column-offset)}th.sticky.student-average[_ngcontent-%COMP%], td.sticky.student-average[_ngcontent-%COMP%]{left:var(--student-average-column-offset)}}@media (max-width: 1200px){[_nghost-%COMP%]{--student-average-column-width: 1px}.student-average[_ngcontent-%COMP%]{padding:0;overflow:hidden}}@media (min-width: 1201px){.student-average-inline[_ngcontent-%COMP%]{display:none}}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%], tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child{text-decoration:underline}tbody[_ngcontent-%COMP%] td.student-name[_ngcontent-%COMP%] a[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:first-child:hover{text-decoration-color:#ea161f}.student-average-inline[_ngcontent-%COMP%]{color:#4e4e4ef2;font-size:.875rem;line-height:1}@media (min-width: 811px){.table-responsive-wrapper[_ngcontent-%COMP%]{display:block;overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:separate;border-spacing:0}.action-buttons[_ngcontent-%COMP%]{position:sticky;left:0}}@media (max-width: 810px){.apply-average-button[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]})}}return t})();var Js=()=>["/events"],ea=t=>({count:t});function ta(t,o){if(t&1&&(s(0,"div",7),l(1),p(2,"translate"),a()),t&2){let e=u();r(),f(" ",F(2,1,e.course.ParticipatingStudents.length===1?"courses.registration":"courses.registrations",D(4,ea,e.course.ParticipatingStudents.length))," ")}}var Hn=(()=>{class t{constructor(e){this.reportsService=e,this.course$=new z(null),this.reports$=this.course$.pipe(y(i=>i?.Id),Z(),O(i=>i?this.reportsService.getCourseTestsReports(i):N([])),At([]))}ngOnChanges(e){e.course&&this.course$.next(e.course.currentValue)}getDesignation(){return gt(this.course)}static{this.\u0275fac=function(i){return new(i||t)(x(dt))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-tests-header"]],inputs:{course:"course"},features:[Ie],decls:12,vars:7,consts:[[3,"link"],[1,"d-flex"],["routerLink","add",1,"edit","btn","btn-primary","btn-icon","ms-2"],[1,"material-icons"],[1,"ms-2",3,"reports"],["id","excel-import"],[1,"d-flex","flex-column","header"],[1,"additional-info"]],template:function(i,n){i&1&&(s(0,"bkd-backlink",0)(1,"div",1)(2,"a",2)(3,"i",3),l(4,"add"),a()(),C(5,"bkd-reports-link",4),p(6,"async"),C(7,"div",5),a()(),s(8,"div",6)(9,"h1"),l(10),a(),T(11,ta,3,6,"div",7),a()),i&2&&(m("link",Me(6,Js)),r(5),m("reports",c(6,4,n.reports$)),r(5),v(n.getDesignation()),r(),_(n.course.ParticipatingStudents?11:-1))},dependencies:[Ae,X,rt,Y,I],styles:[".header[_ngcontent-%COMP%]{padding-bottom:1rem;border-bottom:1px solid #dee2e6}h1[_ngcontent-%COMP%]{margin-bottom:0}.additional-info[_ngcontent-%COMP%]{color:#adb5bd}"]})}}return t})();var ia=()=>[],na=t=>({"visible-on-mobile":t});function ra(t,o){t&1&&C(0,"bkd-spinner")}function sa(t,o){if(t&1){let e=G();s(0,"bkd-select",4),b("valueChange",function(n){E(e);let d=u(2);return w(n&&d.testSelected(n))}),a(),C(1,"bkd-test-edit-grades",5)}if(t&2){u(2);let e=P(6),i=P(8),n=P(10);m("options",e)("value",i)("allowEmpty",!1),r(),m("selectedTest",n)}}function aa(t,o){t&1&&(s(0,"p",2),l(1),p(2,"translate"),a()),t&2&&(r(),v(c(2,1,"tests.no-tests")))}function oa(t,o){if(t&1&&(s(0,"a",3),p(1,"async"),s(2,"i",6),l(3,"arrow_right_alt"),a(),s(4,"span",7),l(5),p(6,"translate"),a()()),t&2){let e=u(2),i=P(4),n=P(10);pe("href",c(1,3,e.buildLinkToRatingOverview()),ie),m("ngClass",D(7,na,!i||!n)),r(5),v(c(6,5,"tests.link-to-rating-overview"))}}function da(t,o){if(t&1&&(C(0,"bkd-tests-header",1),T(1,sa,2,4)(2,aa,3,3,"p",2)(3,oa,7,9,"a",3),p(4,"async")),t&2){let e=u(),i=P(0),n=P(2);m("course",i),r(),_(n.length>0?1:2),r(2),_(c(4,3,e.state.canSetFinalGrade$)?3:-1)}}var Nn=(()=>{class t{constructor(e,i,n){this.settings=e,this.state=i,this.translate=n,this.selectTest$=new te,this.testOptions$=this.state.tests$.pipe(y(d=>[{Key:-1,Value:this.translate.instant("tests.grade")},...d.map(h=>({Key:h.Id,Value:h.Designation}))]),Z()),this.selectedTestId$=qe(this.selectTest$,this.state.tests$.pipe(oe(1),y(d=>d[0]?.Id))).pipe(Z()),this.selectedTest$=this.selectedTestId$.pipe(O(d=>this.state.tests$.pipe(y(h=>h.find(g=>g.Id===d)))),Z())}testSelected(e){this.selectTest$.next(e)}buildLinkToRatingOverview(){return this.state.course$.pipe(oe(1),y(e=>this.settings.eventlist.evaluation.replace(":id",String(e.Id))))}static{this.\u0275fac=function(i){return new(i||t)(x(me),x(K),x(ae))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-tests-list"]],decls:16,vars:22,consts:[[1,"bkd-container"],[3,"course"],[1,"mt-3","px-3"],[1,"rating-overview","d-flex","justify-content-end","pe-3","border-top","pt-3",3,"ngClass","href"],["width","100%",1,"tests-dropdown",3,"valueChange","options","value","allowEmpty"],[3,"selectedTest"],[1,"material-icons","fw-bold"],[1,"ps-1"]],template:function(i,n){if(i&1&&(R(0),p(1,"async"),R(2),p(3,"async"),R(4),p(5,"async"),R(6),p(7,"async"),R(8),p(9,"async"),R(10),p(11,"async"),s(12,"div",0),T(13,ra,1,0,"bkd-spinner"),p(14,"async"),T(15,da,5,5),a()),i&2){let d;A(c(1,1,n.state.course$)),r(2),A((d=c(3,4,n.state.tests$))!==null&&d!==void 0?d:Me(21,ia)),r(2),A(c(5,7,n.state.hasTests$)),r(2),A(c(7,10,n.testOptions$)),r(2),A(c(9,13,n.selectedTestId$)),r(2),A(c(11,16,n.selectedTest$)),r(3),_(c(14,19,n.state.loading$)?13:15)}},dependencies:[Hn,Be,Vn,ce,he,Y,I],styles:[".tests-dropdown[_ngcontent-%COMP%]{display:block;padding:1rem 0}@media (min-width: 811px){.tests-dropdown[_ngcontent-%COMP%]{display:none}}a.rating-overview[_ngcontent-%COMP%]{text-decoration:none}a.rating-overview[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{text-decoration:underline}a.rating-overview[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:hover{text-decoration-color:#ea161f}@media (max-width: 810px){a.rating-overview[_ngcontent-%COMP%]:not(.visible-on-mobile){display:none!important}}"]})}}return t})();var xt=(()=>{class t{constructor(e,i){this.state=e,this.route=i,this.courseId$=this.route.paramMap.pipe(y(n=>Number(n.get("id"))),Z()),this.destroy$=new te}ngOnInit(){this.courseId$.pipe(_e(this.destroy$)).subscribe(e=>this.state.setCourseId(e))}ngOnDestroy(){this.destroy$.next()}static{this.\u0275fac=function(i){return new(i||t)(x(K),x(re))}}static{this.\u0275cmp=S({type:t,selectors:[["bkd-tests"]],features:[ne([K])],decls:1,vars:0,template:function(i,n){i&1&&C(0,"router-outlet")},dependencies:[ye],encapsulation:2})}}return t})();function Un(t){return{path:t,component:mn,children:[{path:"",component:pn},{path:"study-course-student/:id",component:cn},It]}}var Ec=[{path:"",component:hn,children:[{path:"",component:un},{path:"current",component:tn,children:[{path:"",component:en},Un(":id")]},{path:":id",component:xt,children:[{path:"tests",component:Nn},Un("students")]},{path:":id/tests/:testId/edit",component:xt,children:[{path:"",component:kn}]},{path:":id/tests/add",component:xt,children:[{path:"",component:wn}]},{path:":id/tests",children:[It]}]}];export{Yi as a,Un as b,Ec as c}; diff --git a/public/apps/webapp-schulverwaltung/chunk-UYAGBYT7.js b/public/apps/webapp-schulverwaltung/chunk-UNXP5O74.js similarity index 83% rename from public/apps/webapp-schulverwaltung/chunk-UYAGBYT7.js rename to public/apps/webapp-schulverwaltung/chunk-UNXP5O74.js index e103f97e..62e170eb 100644 --- a/public/apps/webapp-schulverwaltung/chunk-UYAGBYT7.js +++ b/public/apps/webapp-schulverwaltung/chunk-UNXP5O74.js @@ -1 +1 @@ -import{b as a,c as b}from"./chunk-CFQ5O3WW.js";import"./chunk-C7RLEXTD.js";import"./chunk-QB4DIFWS.js";import"./chunk-IGEPJF2N.js";import"./chunk-5ZBE3UL7.js";import"./chunk-4UVNKLEN.js";import"./chunk-PXVJ3QLD.js";import"./chunk-HCNFZOWE.js";import"./chunk-CKFTESOV.js";import"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import"./chunk-A3AAQWNQ.js";import"./chunk-FH4OOWQM.js";import"./chunk-Z4YBXGVO.js";import"./chunk-3L4RH6QP.js";import"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import"./chunk-UYCIECIQ.js";import"./chunk-G6EB45SC.js";import"./chunk-WCDEMEW2.js";import"./chunk-XFA6UPZX.js";import"./chunk-PSYDBHTH.js";import"./chunk-W4U7QKJF.js";import"./chunk-AVBHFGIF.js";import"./chunk-2W7IS4PN.js";export{b as EVENTS_ROUTES,a as getStudentsRoute}; +import{b as a,c as b}from"./chunk-TDZZHHCJ.js";import"./chunk-XUB6XQAX.js";import"./chunk-QB4DIFWS.js";import"./chunk-IGEPJF2N.js";import"./chunk-5ZBE3UL7.js";import"./chunk-4UVNKLEN.js";import"./chunk-PXVJ3QLD.js";import"./chunk-HCNFZOWE.js";import"./chunk-CKFTESOV.js";import"./chunk-DTTSX64G.js";import"./chunk-Y4QYVF5K.js";import"./chunk-AYQPMCNZ.js";import"./chunk-A3AAQWNQ.js";import"./chunk-FH4OOWQM.js";import"./chunk-Z4YBXGVO.js";import"./chunk-3L4RH6QP.js";import"./chunk-DTYYCJHM.js";import"./chunk-XAZECV42.js";import"./chunk-UYCIECIQ.js";import"./chunk-G6EB45SC.js";import"./chunk-WCDEMEW2.js";import"./chunk-XFA6UPZX.js";import"./chunk-PSYDBHTH.js";import"./chunk-W4U7QKJF.js";import"./chunk-AVBHFGIF.js";import"./chunk-2W7IS4PN.js";export{b as EVENTS_ROUTES,a as getStudentsRoute}; diff --git a/public/apps/webapp-schulverwaltung/chunk-XUB6XQAX.js b/public/apps/webapp-schulverwaltung/chunk-XUB6XQAX.js new file mode 100644 index 00000000..6a4d48d3 --- /dev/null +++ b/public/apps/webapp-schulverwaltung/chunk-XUB6XQAX.js @@ -0,0 +1 @@ +import{q as y}from"./chunk-PXVJ3QLD.js";import{a as v}from"./chunk-PSYDBHTH.js";import{Hc as i,Ic as n,Md as m,Nc as p,P as o,Vc as d,X as c,_ as s,cd as l,hc as u,lc as f,n as a}from"./chunk-2W7IS4PN.js";var g=p({Id:n,Designation:i,Leadership:d(i),StudentCount:n}),E=p({Id:n,EventType:i,EventTypeId:n,Designation:i});var M=(()=>{class e extends v{constructor(t,r){super(t,r,g,"Events")}getStudyCourseEvents(){let t=new u().set("filter.EventTypeId","=1");return this.getList({params:t})}getSubscriptionDetailsDefinitions(t){return this.http.get(`${this.baseUrl}/${t}/SubscriptionDetails`).pipe(o(m(y)))}getEventSummary(t){let r={fields:"Id,EventTypeId,EventType,Designation","filter.Id":`=${t}`};return this.http.get(`${this.baseUrl}/`,{params:r}).pipe(o(m(E)),a(b=>b[0]??null))}static{this.\u0275fac=function(r){return new(r||e)(s(f),s(l))}}static{this.\u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{M as a}; diff --git a/public/apps/webapp-schulverwaltung/main.js b/public/apps/webapp-schulverwaltung/main.js index 7e5d2aed..f13fd782 100644 --- a/public/apps/webapp-schulverwaltung/main.js +++ b/public/apps/webapp-schulverwaltung/main.js @@ -1 +1 @@ -import{b as Mn}from"./chunk-HCNFZOWE.js";import{c as An}from"./chunk-DTYYCJHM.js";import{a as bn,b as wn}from"./chunk-XAZECV42.js";import{t as gn}from"./chunk-W4U7QKJF.js";import{a as ge}from"./chunk-AVBHFGIF.js";import{$ as H,$a as Y,B as jt,Ba as Gt,Bc as mn,Cc as fn,Ed as yn,Ga as J,Jb as fe,Kb as pe,Ld as _n,Na as xt,Nd as Sn,Od as En,Pd as Oe,Qa as Ne,Qd as vn,Rd as Tn,Sa as Wt,V as v,Va as Jt,Wa as Yt,Wb as nn,X as W,Xa as Xt,Ya as Ce,Z as qt,Za as Fe,_ as j,_a as U,_b as rt,a as Pe,ab as Zt,bd as pn,c as Bt,cc as sn,cd as X,ea as Ut,eb as en,fa as Qt,gb as tn,hb as st,k as Kt,kc as rn,lc as on,mc as an,na as De,nc as ln,oa as Vt,oc as cn,pc as un,rb as re,sa as nt,sb as it,ta as Ht,tb as Re,xa as q,xc as hn,ya as ie,yc as ke,zc as dn}from"./chunk-2W7IS4PN.js";function _s(s){let e=s,t=Math.floor(Math.abs(s)),n=s.toString().replace(/^[^.]*\.?/,"").length;return t===1&&n===0?1:5}var Pn=["de-CH",[["AM","PM"],void 0,void 0],void 0,[["S","M","D","M","D","F","S"],["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],["So","Mo","Di","Mi","Do","Fr","Sa"]],[["S","M","D","M","D","F","S"],["So","Mo","Di","Mi","Do","Fr","Sa"],["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]],[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan.","Feb.","M\xE4rz","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],["Januar","Februar","M\xE4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]],[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","M\xE4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],["Januar","Februar","M\xE4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]],[["v. Chr.","n. Chr."],void 0,void 0],1,[6,0],["dd.MM.yy","dd.MM.y","d. MMMM y","EEEE, d. MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH:mm:ss zzzz"],["{1}, {0}",void 0,"{1} 'um' {0}",void 0],[".","\u2019",";","%","+","-","E","\xB7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4\xA0#,##0.00;\xA4-#,##0.00","#E0"],"CHF","CHF","Schweizer Franken",{ATS:["\xF6S"],AUD:["AU$","$"],BGM:["BGK"],BGO:["BGJ"],BYN:[void 0,"\u0440."],CUC:[void 0,"Cub$"],DEM:["DM"],EUR:[],FKP:[void 0,"Fl\xA3"],GHS:[void 0,"\u20B5"],GNF:[void 0,"F.G."],KMF:[void 0,"FC"],PHP:[void 0,"\u20B1"],RON:[void 0,"L"],RUR:[void 0,"\u0440."],RWF:[void 0,"F.Rw"],SYP:[],THB:["\u0E3F"],TWD:["NT$"],XXX:[],ZMW:[void 0,"K"]},"ltr",_s];function Ss(s){let e=s,t=Math.floor(Math.abs(s)),n=s.toString().replace(/^[^.]*\.?/,"").length,i=parseInt(s.toString().replace(/^[^e]*(e([-+]?\d+))?/,"$2"))||0;return t===0||t===1?1:i===0&&t!==0&&t%1e6===0&&n===0||!(i>=0&&i<=5)?4:5}var Dn=["fr-CH",[["AM","PM"],void 0,void 0],void 0,[["D","L","M","M","J","V","S"],["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],["di","lu","ma","me","je","ve","sa"]],void 0,[["J","F","M","A","M","J","J","A","S","O","N","D"],["janv.","f\xE9vr.","mars","avr.","mai","juin","juil.","ao\xFBt","sept.","oct.","nov.","d\xE9c."],["janvier","f\xE9vrier","mars","avril","mai","juin","juillet","ao\xFBt","septembre","octobre","novembre","d\xE9cembre"]],void 0,[["av. J.-C.","ap. J.-C."],void 0,["avant J\xE9sus-Christ","apr\xE8s J\xE9sus-Christ"]],1,[6,0],["dd.MM.yy","d MMM y","d MMMM y","EEEE, d MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH.mm:ss 'h' zzzz"],["{1} {0}","{1}, {0}","{1} '\xE0' {0}",void 0],[",","\u202F",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":","."],["#,##0.###","#,##0%","#,##0.00\xA0\xA4","#E0"],"CHF","CHF","franc suisse",{ARS:["$AR","$"],AUD:["$AU","$"],BEF:["FB"],BMD:["$BM","$"],BND:["$BN","$"],BYN:[void 0,"\u0440."],BZD:["$BZ","$"],CAD:["$CA","$"],CLP:["$CL","$"],CNY:[void 0,"\xA5"],COP:["$CO","$"],CYP:["\xA3CY"],EGP:[void 0,"\xA3E"],FJD:["$FJ","$"],FKP:["\xA3FK","\xA3"],FRF:["F"],GBP:["\xA3GB","\xA3"],GIP:["\xA3GI","\xA3"],HKD:[void 0,"$"],IEP:["\xA3IE"],ILP:["\xA3IL"],ITL:["\u20A4IT"],JPY:[void 0,"\xA5"],KMF:[void 0,"FC"],LBP:["\xA3LB","\xA3L"],MTP:["\xA3MT"],MXN:["$MX","$"],NAD:["$NA","$"],NIO:[void 0,"$C"],NZD:["$NZ","$"],PHP:[void 0,"\u20B1"],RHD:["$RH"],RON:[void 0,"L"],RWF:[void 0,"FR"],SBD:["$SB","$"],SGD:["$SG","$"],SRD:["$SR","$"],TOP:[void 0,"$T"],TTD:["$TT","$"],TWD:[void 0,"NT$"],USD:["$US","$"],UYU:["$UY","$"],WST:["$WS"],XCD:[void 0,"$"],XPF:["FCFP"],ZMW:[void 0,"Kw"]},"ltr",Ss];function Es(s,e){if(s&1&&(U(0,"i",3),re(1),Y()),s&2){let t=st().$implicit;q(),it(t.icon)}}function vs(s,e){if(s&1){let t=en();U(0,"ngb-toast",1),tn("hidden",function(){let i=Ut(t).$implicit,r=st();return Qt(r.toastService.remove(i))}),U(1,"div",2),xt(2,Es,2,1,"i",3),U(3,"span"),re(4),Y()()()}if(s&2){let t=e.$implicit;Wt(t.classname),Ne("header",t.header||"")("autohide",!0),q(2),Jt(t.icon?2:-1),q(2),it(t.message)}}var Cn=(()=>{class s{constructor(t){this.toastService=t}static{this.\u0275fac=function(n){return new(n||s)(ie(ge))}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-toast"]],decls:3,vars:2,consts:[[3,"header","class","autohide"],[3,"hidden","header","autohide"],[1,"d-flex","gap-2"],[1,"material-icons"]],template:function(n,i){n&1&&(Ce(0,vs,5,6,"ngb-toast",0,Xt),fe(2,"async")),n&2&&Fe(pe(2,0,i.toastService.toasts$))},dependencies:[gn,sn],styles:["[_nghost-%COMP%]{position:fixed;top:0;right:0;margin:.5em;z-index:1200}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{font-size:medium}"]})}}return s})();var Fn=new qt("Navigator API",{providedIn:"root",factory:()=>navigator});var Rn=(()=>{class s{constructor(t,n,i,r){this.toastService=n,this.settings=i,this.navigator=r,t.initialize(),this.checkSettings()}checkSettings(){_n(pn)(this.settings).pipe(jt(t=>(console.error(String(t)),this.toastService.error("Please check the contents of the settings.js file (see Console output for more details).","Invalid Settings"),Kt))).subscribe()}static{this.\u0275fac=function(n){return new(n||s)(ie(wn),ie(ge),ie(X),ie(Fn))}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-app"]],decls:2,vars:0,consts:[["aria-live","polite","aria-atomic","true"]],template:function(n,i){n&1&&Zt(0,"bkd-toast",0)(1,"router-outlet")},dependencies:[Cn,hn],styles:["[_nghost-%COMP%]{width:100%}"],changeDetection:0})}}return s})();var _=function(s){return s[s.State=0]="State",s[s.Transition=1]="Transition",s[s.Sequence=2]="Sequence",s[s.Group=3]="Group",s[s.Animate=4]="Animate",s[s.Keyframes=5]="Keyframes",s[s.Style=6]="Style",s[s.Trigger=7]="Trigger",s[s.Reference=8]="Reference",s[s.AnimateChild=9]="AnimateChild",s[s.AnimateRef=10]="AnimateRef",s[s.Query=11]="Query",s[s.Stagger=12]="Stagger",s}(_||{}),Q="*";function kn(s,e=null){return{type:_.Sequence,steps:s,options:e}}function ot(s){return{type:_.Style,styles:s,offset:null}}var Z=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(e=0,t=0){this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},Se=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(e){this.players=e;let t=0,n=0,i=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++n==r&&this._onDestroy()}),o.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){let t=e*this.totalTime;this.players.forEach(n=>{let i=n.totalTime?Math.min(1,t/n.totalTime):1;n.setPosition(i)})}getPosition(){let e=this.players.reduce((t,n)=>t===null||n.totalTime>t.totalTime?n:t,null);return e!=null?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},Ie="!";function On(s){return new v(3e3,!1)}function Ts(){return new v(3100,!1)}function bs(){return new v(3101,!1)}function ws(s){return new v(3001,!1)}function As(s){return new v(3003,!1)}function Ms(s){return new v(3004,!1)}function Ps(s,e){return new v(3005,!1)}function Ds(){return new v(3006,!1)}function Ns(){return new v(3007,!1)}function Cs(s,e){return new v(3008,!1)}function Fs(s){return new v(3002,!1)}function Rs(s,e,t,n,i){return new v(3010,!1)}function ks(){return new v(3011,!1)}function Os(){return new v(3012,!1)}function Is(){return new v(3200,!1)}function Ls(){return new v(3202,!1)}function $s(){return new v(3013,!1)}function zs(s){return new v(3014,!1)}function Bs(s){return new v(3015,!1)}function Ks(s){return new v(3016,!1)}function js(s,e){return new v(3404,!1)}function qs(s){return new v(3502,!1)}function Us(s){return new v(3503,!1)}function Qs(){return new v(3300,!1)}function Vs(s){return new v(3504,!1)}function Hs(s){return new v(3301,!1)}function Gs(s,e){return new v(3302,!1)}function xs(s){return new v(3303,!1)}function Ws(s,e){return new v(3400,!1)}function Js(s){return new v(3401,!1)}function Ys(s){return new v(3402,!1)}function Xs(s,e){return new v(3505,!1)}function ee(s){switch(s.length){case 0:return new Z;case 1:return s[0];default:return new Se(s)}}function xn(s,e,t=new Map,n=new Map){let i=[],r=[],o=-1,a=null;if(e.forEach(l=>{let c=l.get("offset"),h=c==o,u=h&&a||new Map;l.forEach((S,y)=>{let m=y,g=S;if(y!=="offset")switch(m=s.normalizePropertyName(m,i),g){case Ie:g=t.get(y);break;case Q:g=n.get(y);break;default:g=s.normalizeStyleValue(y,m,g,i);break}u.set(m,g)}),h||r.push(u),a=u,o=c}),i.length)throw qs(i);return r}function Dt(s,e,t,n){switch(e){case"start":s.onStart(()=>n(t&&at(t,"start",s)));break;case"done":s.onDone(()=>n(t&&at(t,"done",s)));break;case"destroy":s.onDestroy(()=>n(t&&at(t,"destroy",s)));break}}function at(s,e,t){let n=t.totalTime,i=!!t.disabled,r=Nt(s.element,s.triggerName,s.fromState,s.toState,e||s.phaseName,n??s.totalTime,i),o=s._data;return o!=null&&(r._data=o),r}function Nt(s,e,t,n,i="",r=0,o){return{element:s,triggerName:e,fromState:t,toState:n,phaseName:i,totalTime:r,disabled:!!o}}function O(s,e,t){let n=s.get(e);return n||s.set(e,n=t),n}function In(s){let e=s.indexOf(":"),t=s.substring(1,e),n=s.slice(e+1);return[t,n]}var Zs=typeof document>"u"?null:document.documentElement;function Ct(s){let e=s.parentNode||s.host||null;return e===Zs?null:e}function ei(s){return s.substring(1,6)=="ebkit"}var ae=null,Ln=!1;function ti(s){ae||(ae=ni()||{},Ln=ae.style?"WebkitAppearance"in ae.style:!1);let e=!0;return ae.style&&!ei(s)&&(e=s in ae.style,!e&&Ln&&(e="Webkit"+s.charAt(0).toUpperCase()+s.slice(1)in ae.style)),e}function ni(){return typeof document<"u"?document.body:null}function Wn(s,e){for(;e;){if(e===s)return!0;e=Ct(e)}return!1}function Jn(s,e,t){if(t)return Array.from(s.querySelectorAll(e));let n=s.querySelector(e);return n?[n]:[]}var Ft=(()=>{class s{validateStyleProperty(t){return ti(t)}containsElement(t,n){return Wn(t,n)}getParentElement(t){return Ct(t)}query(t,n,i){return Jn(t,n,i)}computeStyle(t,n,i){return i||""}animate(t,n,i,r,o,a=[],l){return new Z(i,r)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=W({token:s,factory:s.\u0275fac})}return s})(),ue=class{static NOOP=new Ft},he=class{};var si=1e3,Yn="{{",ii="}}",Xn="ng-enter",mt="ng-leave",Le="ng-trigger",je=".ng-trigger",$n="ng-animating",ft=".ng-animating";function G(s){if(typeof s=="number")return s;let e=s.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:pt(parseFloat(e[1]),e[2])}function pt(s,e){switch(e){case"s":return s*si;default:return s}}function qe(s,e,t){return s.hasOwnProperty("duration")?s:ri(s,e,t)}function ri(s,e,t){let n=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,i,r=0,o="";if(typeof s=="string"){let a=s.match(n);if(a===null)return e.push(On(s)),{duration:0,delay:0,easing:""};i=pt(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(r=pt(parseFloat(l),a[4]));let c=a[5];c&&(o=c)}else i=s;if(!t){let a=!1,l=e.length;i<0&&(e.push(Ts()),a=!0),r<0&&(e.push(bs()),a=!0),a&&e.splice(l,0,On(s))}return{duration:i,delay:r,easing:o}}function oi(s){return s.length?s[0]instanceof Map?s:s.map(e=>new Map(Object.entries(e))):[]}function V(s,e,t){e.forEach((n,i)=>{let r=Rt(i);t&&!t.has(i)&&t.set(i,s.style[r]),s.style[r]=n})}function ce(s,e){e.forEach((t,n)=>{let i=Rt(n);s.style[i]=""})}function Ee(s){return Array.isArray(s)?s.length==1?s[0]:kn(s):s}function ai(s,e,t){let n=e.params||{},i=Zn(s);i.length&&i.forEach(r=>{n.hasOwnProperty(r)||t.push(ws(r))})}var gt=new RegExp(`${Yn}\\s*(.+?)\\s*${ii}`,"g");function Zn(s){let e=[];if(typeof s=="string"){let t;for(;t=gt.exec(s);)e.push(t[1]);gt.lastIndex=0}return e}function Te(s,e,t){let n=`${s}`,i=n.replace(gt,(r,o)=>{let a=e[o];return a==null&&(t.push(As(o)),a=""),a.toString()});return i==n?s:i}var li=/-+([a-z0-9])/g;function Rt(s){return s.replace(li,(...e)=>e[1].toUpperCase())}function ci(s,e){return s===0||e===0}function ui(s,e,t){if(t.size&&e.length){let n=e[0],i=[];if(t.forEach((r,o)=>{n.has(o)||i.push(o),n.set(o,r)}),i.length)for(let r=1;ro.set(a,kt(s,a)))}}return e}function k(s,e,t){switch(e.type){case _.Trigger:return s.visitTrigger(e,t);case _.State:return s.visitState(e,t);case _.Transition:return s.visitTransition(e,t);case _.Sequence:return s.visitSequence(e,t);case _.Group:return s.visitGroup(e,t);case _.Animate:return s.visitAnimate(e,t);case _.Keyframes:return s.visitKeyframes(e,t);case _.Style:return s.visitStyle(e,t);case _.Reference:return s.visitReference(e,t);case _.AnimateChild:return s.visitAnimateChild(e,t);case _.AnimateRef:return s.visitAnimateRef(e,t);case _.Query:return s.visitQuery(e,t);case _.Stagger:return s.visitStagger(e,t);default:throw Ms(e.type)}}function kt(s,e){return window.getComputedStyle(s)[e]}var hi=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),Ue=class extends he{normalizePropertyName(e,t){return Rt(e)}normalizeStyleValue(e,t,n,i){let r="",o=n.toString().trim();if(hi.has(t)&&n!==0&&n!=="0")if(typeof n=="number")r="px";else{let a=n.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&i.push(Ps(e,n))}return o+r}};var Qe="*";function di(s,e){let t=[];return typeof s=="string"?s.split(/\s*,\s*/).forEach(n=>mi(n,t,e)):t.push(s),t}function mi(s,e,t){if(s[0]==":"){let l=fi(s,t);if(typeof l=="function"){e.push(l);return}s=l}let n=s.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(n==null||n.length<4)return t.push(Bs(s)),e;let i=n[1],r=n[2],o=n[3];e.push(zn(i,o));let a=i==Qe&&o==Qe;r[0]=="<"&&!a&&e.push(zn(o,i))}function fi(s,e){switch(s){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,n)=>parseFloat(n)>parseFloat(t);case":decrement":return(t,n)=>parseFloat(n) *"}}var $e=new Set(["true","1"]),ze=new Set(["false","0"]);function zn(s,e){let t=$e.has(s)||ze.has(s),n=$e.has(e)||ze.has(e);return(i,r)=>{let o=s==Qe||s==i,a=e==Qe||e==r;return!o&&t&&typeof i=="boolean"&&(o=i?$e.has(s):ze.has(s)),!a&&n&&typeof r=="boolean"&&(a=r?$e.has(e):ze.has(e)),o&&a}}var es=":self",pi=new RegExp(`s*${es}s*,?`,"g");function ts(s,e,t,n){return new yt(s).build(e,t,n)}var Bn="",yt=class{_driver;constructor(e){this._driver=e}build(e,t,n){let i=new _t(t);return this._resetContextStyleTimingState(i),k(this,Ee(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector=Bn,e.collectedStyles=new Map,e.collectedStyles.set(Bn,new Map),e.currentTime=0}visitTrigger(e,t){let n=t.queryCount=0,i=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(Ds()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==_.State){let l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(h=>{l.name=h,r.push(this.visitState(l,t))}),l.name=c}else if(a.type==_.Transition){let l=this.visitTransition(a,t);n+=l.queryCount,i+=l.depCount,o.push(l)}else t.errors.push(Ns())}),{type:_.Trigger,name:e.name,states:r,transitions:o,queryCount:n,depCount:i,options:null}}visitState(e,t){let n=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(n.containsDynamicStyles){let r=new Set,o=i||{};n.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{Zn(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(Cs(e.name,[...r.values()]))}return{type:_.State,name:e.name,style:n,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let n=k(this,Ee(e.animation),t),i=di(e.expr,t.errors);return{type:_.Transition,matchers:i,animation:n,queryCount:t.queryCount,depCount:t.depCount,options:le(e.options)}}visitSequence(e,t){return{type:_.Sequence,steps:e.steps.map(n=>k(this,n,t)),options:le(e.options)}}visitGroup(e,t){let n=t.currentTime,i=0,r=e.steps.map(o=>{t.currentTime=n;let a=k(this,o,t);return i=Math.max(i,t.currentTime),a});return t.currentTime=i,{type:_.Group,steps:r,options:le(e.options)}}visitAnimate(e,t){let n=Si(e.timings,t.errors);t.currentAnimateTimings=n;let i,r=e.styles?e.styles:ot({});if(r.type==_.Keyframes)i=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};n.easing&&(c.easing=n.easing),o=ot(c)}t.currentTime+=n.duration+n.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,i=l}return t.currentAnimateTimings=null,{type:_.Animate,timings:n,style:i,options:null}}visitStyle(e,t){let n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}_makeStyleAst(e,t){let n=[],i=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of i)typeof a=="string"?a===Q?n.push(a):t.errors.push(Fs(a)):n.push(new Map(Object.entries(a)));let r=!1,o=null;return n.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(o=a.get("easing"),a.delete("easing")),!r)){for(let l of a.values())if(l.toString().indexOf(Yn)>=0){r=!0;break}}}),{type:_.Style,styles:n,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let n=t.currentAnimateTimings,i=t.currentTime,r=t.currentTime;n&&r>0&&(r-=n.duration+n.delay),e.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,l)=>{let c=t.collectedStyles.get(t.currentQuerySelector),h=c.get(l),u=!0;h&&(r!=i&&r>=h.startTime&&i<=h.endTime&&(t.errors.push(Rs(l,h.startTime,h.endTime,r,i)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:i}),t.options&&ai(a,t.options,t.errors)})})}visitKeyframes(e,t){let n={type:_.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(ks()),n;let i=1,r=0,o=[],a=!1,l=!1,c=0,h=e.steps.map(w=>{let A=this._makeStyleAst(w,t),N=A.offset!=null?A.offset:_i(A.styles),P=0;return N!=null&&(r++,P=A.offset=N),l=l||P<0||P>1,a=a||P0&&r{let N=S>0?A==y?1:S*A:o[A],P=N*T;t.currentTime=m+g.delay+P,g.duration=P,this._validateStyleAst(w,t),w.offset=N,n.styles.push(w)}),n}visitReference(e,t){return{type:_.Reference,animation:k(this,Ee(e.animation),t),options:le(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:_.AnimateChild,options:le(e.options)}}visitAnimateRef(e,t){return{type:_.AnimateRef,animation:this.visitReference(e.animation,t),options:le(e.options)}}visitQuery(e,t){let n=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=gi(e.selector);t.currentQuerySelector=n.length?n+" "+r:r,O(t.collectedStyles,t.currentQuerySelector,new Map);let a=k(this,Ee(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:_.Query,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:le(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push($s());let n=e.timings==="full"?{duration:0,delay:0,easing:"full"}:qe(e.timings,t.errors,!0);return{type:_.Stagger,animation:k(this,Ee(e.animation),t),timings:n,options:null}}};function gi(s){let e=!!s.split(/\s*,\s*/).find(t=>t==es);return e&&(s=s.replace(pi,"")),s=s.replace(/@\*/g,je).replace(/@\w+/g,t=>je+"-"+t.slice(1)).replace(/:animating/g,ft),[s,e]}function yi(s){return s?Pe({},s):null}var _t=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}};function _i(s){if(typeof s=="string")return null;let e=null;if(Array.isArray(s))s.forEach(t=>{if(t instanceof Map&&t.has("offset")){let n=t;e=parseFloat(n.get("offset")),n.delete("offset")}});else if(s instanceof Map&&s.has("offset")){let t=s;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function Si(s,e){if(s.hasOwnProperty("duration"))return s;if(typeof s=="number"){let r=qe(s,e).duration;return lt(r,0,"")}let t=s;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=lt(0,0,"");return r.dynamic=!0,r.strValue=t,r}let i=qe(t,e);return lt(i.duration,i.delay,i.easing)}function le(s){return s?(s=Pe({},s),s.params&&(s.params=yi(s.params))):s={},s}function lt(s,e,t){return{duration:s,delay:e,easing:t}}function Ot(s,e,t,n,i,r,o=null,a=!1){return{type:1,element:s,keyframes:e,preStyleProps:t,postStyleProps:n,duration:i,delay:r,totalTime:i+r,easing:o,subTimeline:a}}var be=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let n=this._map.get(e);n||this._map.set(e,n=[]),n.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},Ei=1,vi=":enter",Ti=new RegExp(vi,"g"),bi=":leave",wi=new RegExp(bi,"g");function ns(s,e,t,n,i,r=new Map,o=new Map,a,l,c=[]){return new St().buildKeyframes(s,e,t,n,i,r,o,a,l,c)}var St=class{buildKeyframes(e,t,n,i,r,o,a,l,c,h=[]){c=c||new be;let u=new Et(e,t,c,i,r,h,[]);u.options=l;let S=l.delay?G(l.delay):0;u.currentTimeline.delayNextStep(S),u.currentTimeline.setStyles([o],null,u.errors,l),k(this,n,u);let y=u.timelines.filter(m=>m.containsAnimation());if(y.length&&a.size){let m;for(let g=y.length-1;g>=0;g--){let T=y[g];if(T.element===t){m=T;break}}m&&!m.allowOnlyTimelineStyles()&&m.setStyles([a],null,u.errors,l)}return y.length?y.map(m=>m.buildKeyframes()):[Ot(t,[],[],[],0,S,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let n=t.subInstructions.get(t.element);if(n){let i=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(n,i,i.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,n),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,n){for(let i of e){let r=i?.delay;if(r){let o=typeof r=="number"?r:G(Te(r,i?.params??{},t.errors));n.delayNextStep(o)}}}_visitSubInstructions(e,t,n){let r=t.currentTimeline.currentTime,o=n.duration!=null?G(n.duration):null,a=n.delay!=null?G(n.delay):null;return o!==0&&e.forEach(l=>{let c=t.appendInstructionToTimeline(l,o,a);r=Math.max(r,c.duration+c.delay)}),r}visitReference(e,t){t.updateOptions(e.options,!0),k(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let n=t.subContextCount,i=t,r=e.options;if(r&&(r.params||r.delay)&&(i=t.createSubContext(r),i.transformIntoNewTimeline(),r.delay!=null)){i.previousNode.type==_.Style&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=Ve);let o=G(r.delay);i.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>k(this,o,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let n=[],i=t.currentTimeline.currentTime,r=e.options&&e.options.delay?G(e.options.delay):0;e.steps.forEach(o=>{let a=t.createSubContext(e.options);r&&a.delayNextStep(r),k(this,o,a),i=Math.max(i,a.currentTimeline.currentTime),n.push(a.currentTimeline)}),n.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let n=e.strValue,i=t.params?Te(n,t.params,t.errors):n;return qe(i,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let n=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),i.snapshotCurrentStyles());let r=e.style;r.type==_.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(n.duration),this.visitStyle(r,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let n=t.currentTimeline,i=t.currentAnimateTimings;!i&&n.hasCurrentStyleProperties()&&n.forwardFrame();let r=i&&i.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(r):n.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let n=t.currentAnimateTimings,i=t.currentTimeline.duration,r=n.duration,a=t.createSubContext().currentTimeline;a.easing=n.easing,e.styles.forEach(l=>{let c=l.offset||0;a.forwardTime(c*r),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(i+r),t.previousNode=e}visitQuery(e,t){let n=t.currentTimeline.currentTime,i=e.options||{},r=i.delay?G(i.delay):0;r&&(t.previousNode.type===_.Style||n==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=Ve);let o=n,a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,h)=>{t.currentQueryIndex=h;let u=t.createSubContext(e.options,c);r&&u.delayNextStep(r),c===t.element&&(l=u.currentTimeline),k(this,e.animation,u),u.currentTimeline.applyStylesToKeyframe();let S=u.currentTimeline.currentTime;o=Math.max(o,S)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let n=t.parentContext,i=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),l=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":l=a-l;break;case"full":l=n.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;k(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=i.currentTime-u+(i.startTime-n.currentTimeline.startTime)}},Ve={},Et=class s{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Ve;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,n,i,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=o,this.timelines=a,this.currentTimeline=l||new He(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let n=e,i=this.options;n.duration!=null&&(i.duration=G(n.duration)),n.delay!=null&&(i.delay=G(n.delay));let r=n.params;if(r){let o=i.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=Te(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let n=e.params={};Object.keys(t).forEach(i=>{n[i]=t[i]})}}return e}createSubContext(e=null,t,n){let i=t||this.element,r=new s(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=Ve,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,n){let i={duration:t??e.duration,delay:this.currentTimeline.currentTime+(n??0)+e.delay,easing:""},r=new vt(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,n,i,r,o){let a=[];if(i&&a.push(this.element),e.length>0){e=e.replace(Ti,"."+this._enterClassName),e=e.replace(wi,"."+this._leaveClassName);let l=n!=1,c=this._driver.query(this.element,e,l);n!==0&&(c=n<0?c.slice(c.length+n,c.length):c.slice(0,n)),a.push(...c)}return!r&&a.length==0&&o.push(zs(t)),a}},He=class s{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,n,i){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=i,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new s(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=Ei,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,n]of this._globalTimelineStyles)this._backFill.set(t,n||Q),this._currentKeyframe.set(t,Q);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,n,i){t&&this._previousKeyframe.set("easing",t);let r=i&&i.params||{},o=Ai(e,this._globalTimelineStyles);for(let[a,l]of o){let c=Te(l,r,n);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??Q),this._updateStyle(a,c)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,n)=>{let i=this._styleSummary.get(n);(!i||t.time>i.time)&&this._updateStyle(n,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,n=this._keyframes.size===1&&this.duration===0,i=[];this._keyframes.forEach((a,l)=>{let c=new Map([...this._backFill,...a]);c.forEach((h,u)=>{h===Ie?e.add(u):h===Q&&t.add(u)}),n||c.set("offset",l/this.duration),i.push(c)});let r=[...e.values()],o=[...t.values()];if(n){let a=i[0],l=new Map(a);a.set("offset",0),l.set("offset",1),i=[a,l]}return Ot(this.element,i,r,o,this.duration,this.startTime,this.easing,!1)}},vt=class extends He{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,n,i,r,o,a=!1){super(e,t,o.delay),this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=n+t,a=t/o,l=new Map(e[0]);l.set("offset",0),r.push(l);let c=new Map(e[0]);c.set("offset",Kn(a)),r.push(c);let h=e.length-1;for(let u=1;u<=h;u++){let S=new Map(e[u]),y=S.get("offset"),m=t+y*n;S.set("offset",Kn(m/o)),r.push(S)}n=o,t=0,i="",e=r}return Ot(this.element,e,this.preStyleProps,this.postStyleProps,n,t,i,!0)}};function Kn(s,e=3){let t=Math.pow(10,e-1);return Math.round(s*t)/t}function Ai(s,e){let t=new Map,n;return s.forEach(i=>{if(i==="*"){n??=e.keys();for(let r of n)t.set(r,Q)}else for(let[r,o]of i)t.set(r,o)}),t}function jn(s,e,t,n,i,r,o,a,l,c,h,u,S){return{type:0,element:s,triggerName:e,isRemovalTransition:i,fromState:t,fromStyles:r,toState:n,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:S}}var ct={},Ge=class{_triggerName;ast;_stateStyles;constructor(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}match(e,t,n,i){return Mi(this.ast.matchers,e,t,n,i)}buildStyles(e,t,n){let i=this._stateStyles.get("*");return e!==void 0&&(i=this._stateStyles.get(e?.toString())||i),i?i.buildStyles(t,n):new Map}build(e,t,n,i,r,o,a,l,c,h){let u=[],S=this.ast.options&&this.ast.options.params||ct,y=a&&a.params||ct,m=this.buildStyles(n,y,u),g=l&&l.params||ct,T=this.buildStyles(i,g,u),w=new Set,A=new Map,N=new Map,P=i==="void",de={params:ss(g,S),delay:this.ast.options?.delay},B=h?[]:ns(e,t,this.ast.animation,r,o,m,T,de,c,u),C=0;return B.forEach(F=>{C=Math.max(F.duration+F.delay,C)}),u.length?jn(t,this._triggerName,n,i,P,m,T,[],[],A,N,C,u):(B.forEach(F=>{let te=F.element,me=O(A,te,new Set);F.preStyleProps.forEach(ne=>me.add(ne));let It=O(N,te,new Set);F.postStyleProps.forEach(ne=>It.add(ne)),te!==t&&w.add(te)}),jn(t,this._triggerName,n,i,P,m,T,B,[...w.values()],A,N,C))}};function Mi(s,e,t,n,i){return s.some(r=>r(e,t,n,i))}function ss(s,e){let t=Pe({},e);return Object.entries(s).forEach(([n,i])=>{i!=null&&(t[n]=i)}),t}var Tt=class{styles;defaultParams;normalizer;constructor(e,t,n){this.styles=e,this.defaultParams=t,this.normalizer=n}buildStyles(e,t){let n=new Map,i=ss(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=Te(o,i,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),n.set(a,o)})}),n}};function Pi(s,e,t){return new bt(s,e,t)}var bt=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,n){this.name=e,this.ast=t,this._normalizer=n,t.states.forEach(i=>{let r=i.options&&i.options.params||{};this.states.set(i.name,new Tt(i.style,r,n))}),qn(this.states,"true","1"),qn(this.states,"false","0"),t.transitions.forEach(i=>{this.transitionFactories.push(new Ge(e,i,this.states))}),this.fallbackTransition=Di(e,this.states,this._normalizer)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,n,i){return this.transitionFactories.find(o=>o.match(e,t,n,i))||null}matchStyles(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}};function Di(s,e,t){let n=[(o,a)=>!0],i={type:_.Sequence,steps:[],options:null},r={type:_.Transition,animation:i,matchers:n,options:null,queryCount:0,depCount:0};return new Ge(s,r,e)}function qn(s,e,t){s.has(e)?s.has(t)||s.set(t,s.get(e)):s.has(t)&&s.set(e,s.get(t))}var Ni=new be,wt=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n}register(e,t){let n=[],i=[],r=ts(this._driver,t,n,i);if(n.length)throw Us(n);i.length&&void 0,this._animations.set(e,r)}_buildPlayer(e,t,n){let i=e.element,r=xn(this._normalizer,e.keyframes,t,n);return this._driver.animate(i,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,n={}){let i=[],r=this._animations.get(e),o,a=new Map;if(r?(o=ns(this._driver,t,r,Xn,mt,new Map,new Map,n,Ni,i),o.forEach(h=>{let u=O(a,h.element,new Map);h.postStyleProps.forEach(S=>u.set(S,null))})):(i.push(Qs()),o=[]),i.length)throw Vs(i);a.forEach((h,u)=>{h.forEach((S,y)=>{h.set(y,this._driver.computeStyle(u,y,Q))})});let l=o.map(h=>{let u=a.get(h.element);return this._buildPlayer(h,new Map,u)}),c=ee(l);return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Hs(e);return t}listen(e,t,n,i){let r=Nt(t,"","","");return Dt(this._getPlayer(e),n,r,i),()=>{}}command(e,t,n,i){if(n=="register"){this.register(e,i[0]);return}if(n=="create"){let o=i[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(e);break}}},Un="ng-animate-queued",Ci=".ng-animate-queued",ut="ng-animate-disabled",Fi=".ng-animate-disabled",Ri="ng-star-inserted",ki=".ng-star-inserted",Oi=[],is={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ii={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},$="__ng_removed",we=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let n=e&&e.hasOwnProperty("value"),i=n?e.value:e;if(this.value=$i(i),n){let r=e,{value:o}=r,a=Bt(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let n=this.options.params;Object.keys(t).forEach(i=>{n[i]==null&&(n[i]=t[i])})}}},ve="void",ht=new we(ve),At=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,n,i){if(!this._triggers.has(t))throw Gs(n,t);if(n==null||n.length==0)throw xs(t);if(!zi(n))throw Ws(n,t);let r=O(this._elementListeners,e,[]),o={name:t,phase:n,callback:i};r.push(o);let a=O(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,Le),L(e,Le+"-"+t),a.set(t,ht)),()=>{this._engine.afterFlush(()=>{let l=r.indexOf(o);l>=0&&r.splice(l,1),this._triggers.has(t)||a.delete(t)})}}register(e,t){return this._triggers.has(e)?!1:(this._triggers.set(e,t),!0)}_getTrigger(e){let t=this._triggers.get(e);if(!t)throw Js(e);return t}trigger(e,t,n,i=!0){let r=this._getTrigger(t),o=new Ae(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,Le),L(e,Le+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new we(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=ht),!(c.value===ve)&&l.value===c.value){if(!ji(l.params,c.params)){let g=[],T=r.matchStyles(l.value,l.params,g),w=r.matchStyles(c.value,c.params,g);g.length?this._engine.reportError(g):this._engine.afterFlush(()=>{ce(e,T),V(e,w)})}return}let S=O(this._engine.playersByElement,e,[]);S.forEach(g=>{g.namespaceId==this.id&&g.triggerName==t&&g.queued&&g.destroy()});let y=r.matchTransition(l.value,c.value,e,c.params),m=!1;if(!y){if(!i)return;y=r.fallbackTransition,m=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:m}),m||(L(e,Un),o.onStart(()=>{ye(e,Un)})),o.onDone(()=>{let g=this.players.indexOf(o);g>=0&&this.players.splice(g,1);let T=this._engine.playersByElement.get(e);if(T){let w=T.indexOf(o);w>=0&&T.splice(w,1)}}),this.players.push(o),S.push(o),o}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,n)=>{this._elementListeners.set(n,t.filter(i=>i.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(n=>n.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let n=this._engine.driver.query(e,je,!0);n.forEach(i=>{if(i[$])return;let r=this._engine.fetchNamespacesByElement(i);r.size?r.forEach(o=>o.triggerLeaveAnimation(i,t,!1,!0)):this.clearElementCache(i)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(e,t,n,i){let r=this._engine.statesByElement.get(e),o=new Map;if(r){let a=[];if(r.forEach((l,c)=>{if(o.set(c,l.value),this._triggers.has(c)){let h=this.trigger(e,c,ve,i);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),n&&ee(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),n=this._engine.statesByElement.get(e);if(t&&n){let i=new Set;t.forEach(r=>{let o=r.name;if(i.has(o))return;i.add(o);let l=this._triggers.get(o).fallbackTransition,c=n.get(o)||ht,h=new we(ve),u=new Ae(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:h,player:u,isFallbackTransition:!0})})}}removeNode(e,t){let n=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(n.totalAnimations){let r=n.players.length?n.playersByQueriedElement.get(e):[];if(r&&r.length)i=!0;else{let o=e;for(;o=o.parentNode;)if(n.statesByElement.get(o)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)n.markElementAsRemoved(this.id,e,!1,t);else{let r=e[$];(!r||r===is)&&(n.afterFlush(()=>this.clearElementCache(e)),n.destroyInnerAnimations(e),n._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(n=>{let i=n.player;if(i.destroyed)return;let r=n.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==n.triggerName){let l=Nt(r,n.triggerName,n.fromState.value,n.toState.value);l._data=e,Dt(n.player,a.phase,l,a.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(n)}),this._queue=[],t.sort((n,i)=>{let r=n.transition.ast.depCount,o=i.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(n.element,i.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Mt=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,n){this.bodyNode=e,this.driver=t,this._normalizer=n}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(n=>{n.queued&&e.push(n)})}),e}createNamespace(e,t){let n=new At(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(n,t):(this.newHostElements.set(t,n),this.collectEnterElement(t)),this._namespaceLookup[e]=n}_balanceNamespaceList(e,t){let n=this._namespaceList,i=this.namespacesByHostElement;if(n.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=i.get(a);if(l){let c=n.indexOf(l);n.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||n.unshift(e)}else n.push(e);return i.set(t,e),e}register(e,t){let n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}registerTrigger(e,t,n){let i=this._namespaceLookup[e];i&&i.register(t,n)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let n=this._fetchNamespace(e);this.namespacesByHostElement.delete(n.hostElement);let i=this._namespaceList.indexOf(n);i>=0&&this._namespaceList.splice(i,1),n.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,n=this.statesByElement.get(e);if(n){for(let i of n.values())if(i.namespaceId){let r=this._fetchNamespace(i.namespaceId);r&&t.add(r)}}return t}trigger(e,t,n,i){if(Be(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,n,i),!0}return!1}insertNode(e,t,n,i){if(!Be(t))return;let r=t[$];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let o=this.collectedLeaveElements.indexOf(t);o>=0&&this.collectedLeaveElements.splice(o,1)}if(e){let o=this._fetchNamespace(e);o&&o.insertNode(t,n)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,ut)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ye(e,ut))}removeNode(e,t,n){if(Be(t)){let i=e?this._fetchNamespace(e):null;i?i.removeNode(t,n):this.markElementAsRemoved(e,t,!1,n);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,n)}else this._onRemovalComplete(t,n)}markElementAsRemoved(e,t,n,i,r){this.collectedLeaveElements.push(t),t[$]={namespaceId:e,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,n,i,r){return Be(t)?this._fetchNamespace(e).listen(t,n,i,r):()=>{}}_buildInstruction(e,t,n,i,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,i,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,je,!0);t.forEach(n=>this.destroyActiveAnimationsForElement(n)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,ft,!0),t.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return ee(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[$];if(t&&t.setForRemoval){if(e[$]=is,t.namespaceId){this.destroyInnerAnimations(e);let n=this._fetchNamespace(t.namespaceId);n&&n.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(ut)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Fi,!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,i)=>this._balanceNamespaceList(n,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nn()),this._flushFns=[],this._whenQuietFns.length){let n=this._whenQuietFns;this._whenQuietFns=[],t.length?ee(t).onDone(()=>{n.forEach(i=>i())}):n.forEach(i=>i())}}reportError(e){throw Ys(e)}_flushAnimations(e,t){let n=new be,i=[],r=new Map,o=[],a=new Map,l=new Map,c=new Map,h=new Set;this.disabledNodes.forEach(d=>{h.add(d);let f=this.driver.query(d,Ci,!0);for(let p=0;p{let p=Xn+g++;m.set(f,p),d.forEach(E=>L(E,p))});let T=[],w=new Set,A=new Set;for(let d=0;dw.add(E)):A.add(f))}let N=new Map,P=Hn(S,Array.from(w));P.forEach((d,f)=>{let p=mt+g++;N.set(f,p),d.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((d,f)=>{let p=m.get(f);d.forEach(E=>ye(E,p))}),P.forEach((d,f)=>{let p=N.get(f);d.forEach(E=>ye(E,p))}),T.forEach(d=>{this.processLeaveNode(d)})});let de=[],B=[];for(let d=this._namespaceList.length-1;d>=0;d--)this._namespaceList[d].drainQueuedTransitions(t).forEach(p=>{let E=p.player,M=p.element;if(de.push(E),this.collectedEnterElements.length){let D=M[$];if(D&&D.setForMove){if(D.previousTriggersValues&&D.previousTriggersValues.has(p.triggerName)){let se=D.previousTriggersValues.get(p.triggerName),I=this.statesByElement.get(p.element);if(I&&I.has(p.triggerName)){let Me=I.get(p.triggerName);Me.value=se,I.set(p.triggerName,Me)}}E.destroy();return}}let K=!u||!this.driver.containsElement(u,M),R=N.get(M),x=m.get(M),b=this._buildInstruction(p,n,x,R,K);if(b.errors&&b.errors.length){B.push(b);return}if(K){E.onStart(()=>ce(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}if(p.isFallbackTransition){E.onStart(()=>ce(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}let zt=[];b.timelines.forEach(D=>{D.stretchStartingKeyframe=!0,this.disabledNodes.has(D.element)||zt.push(D)}),b.timelines=zt,n.append(M,b.timelines);let ys={instruction:b,player:E,element:M};o.push(ys),b.queriedElements.forEach(D=>O(a,D,[]).push(E)),b.preStyleProps.forEach((D,se)=>{if(D.size){let I=l.get(se);I||l.set(se,I=new Set),D.forEach((Me,tt)=>I.add(tt))}}),b.postStyleProps.forEach((D,se)=>{let I=c.get(se);I||c.set(se,I=new Set),D.forEach((Me,tt)=>I.add(tt))})});if(B.length){let d=[];B.forEach(f=>{d.push(Xs(f.triggerName,f.errors))}),de.forEach(f=>f.destroy()),this.reportError(d)}let C=new Map,F=new Map;o.forEach(d=>{let f=d.element;n.has(f)&&(F.set(f,f),this._beforeAnimationBuild(d.player.namespaceId,d.instruction,C))}),i.forEach(d=>{let f=d.element;this._getPreviousPlayers(f,!1,d.namespaceId,d.triggerName,null).forEach(E=>{O(C,f,[]).push(E),E.destroy()})});let te=T.filter(d=>Gn(d,l,c)),me=new Map;Vn(me,this.driver,A,c,Q).forEach(d=>{Gn(d,l,c)&&te.push(d)});let ne=new Map;y.forEach((d,f)=>{Vn(ne,this.driver,new Set(d),l,Ie)}),te.forEach(d=>{let f=me.get(d),p=ne.get(d);me.set(d,new Map([...f?.entries()??[],...p?.entries()??[]]))});let et=[],Lt=[],$t={};o.forEach(d=>{let{element:f,player:p,instruction:E}=d;if(n.has(f)){if(h.has(f)){p.onDestroy(()=>V(f,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),i.push(p);return}let M=$t;if(F.size>1){let R=f,x=[];for(;R=R.parentNode;){let b=F.get(R);if(b){M=b;break}x.push(R)}x.forEach(b=>F.set(b,M))}let K=this._buildAnimation(p.namespaceId,E,C,r,ne,me);if(p.setRealPlayer(K),M===$t)et.push(p);else{let R=this.playersByElement.get(M);R&&R.length&&(p.parentPlayer=ee(R)),i.push(p)}}else ce(f,E.fromStyles),p.onDestroy(()=>V(f,E.toStyles)),Lt.push(p),h.has(f)&&i.push(p)}),Lt.forEach(d=>{let f=r.get(d.element);if(f&&f.length){let p=ee(f);d.setRealPlayer(p)}}),i.forEach(d=>{d.parentPlayer?d.syncPlayerEvents(d.parentPlayer):d.destroy()});for(let d=0;d!K.destroyed);M.length?Bi(this,f,M):this.processLeaveNode(f)}return T.length=0,et.forEach(d=>{this.players.push(d),d.onDone(()=>{d.destroy();let f=this.players.indexOf(d);this.players.splice(f,1)}),d.play()}),et}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,n,i,r){let o=[];if(t){let a=this.playersByQueriedElement.get(e);a&&(o=a)}else{let a=this.playersByElement.get(e);if(a){let l=!r||r==ve;a.forEach(c=>{c.queued||!l&&c.triggerName!=i||o.push(c)})}}return(n||i)&&(o=o.filter(a=>!(n&&n!=a.namespaceId||i&&i!=a.triggerName))),o}_beforeAnimationBuild(e,t,n){let i=t.triggerName,r=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:i;for(let l of t.timelines){let c=l.element,h=c!==r,u=O(n,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let m=y.getRealPlayer();m.beforeDestroy&&m.beforeDestroy(),y.destroy(),u.push(y)})}ce(r,t.fromStyles)}_buildAnimation(e,t,n,i,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,S=t.timelines.map(m=>{let g=m.element;h.add(g);let T=g[$];if(T&&T.removedBeforeQueried)return new Z(m.duration,m.delay);let w=g!==l,A=Ki((n.get(g)||Oi).map(C=>C.getRealPlayer())).filter(C=>{let F=C;return F.element?F.element===g:!1}),N=r.get(g),P=o.get(g),de=xn(this._normalizer,m.keyframes,N,P),B=this._buildPlayer(m,de,A);if(m.subTimeline&&i&&u.add(g),w){let C=new Ae(e,a,g);C.setRealPlayer(B),c.push(C)}return B});c.forEach(m=>{O(this.playersByQueriedElement,m.element,[]).push(m),m.onDone(()=>Li(this.playersByQueriedElement,m.element,m))}),h.forEach(m=>L(m,$n));let y=ee(S);return y.onDestroy(()=>{h.forEach(m=>ye(m,$n)),V(l,t.toStyles)}),u.forEach(m=>{O(i,m,[]).push(y)}),y}_buildPlayer(e,t,n){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new Z(e.duration,e.delay)}},Ae=class{namespaceId;triggerName;element;_player=new Z;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,t,n){this.namespaceId=e,this.triggerName=t,this.element=n}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,n)=>{t.forEach(i=>Dt(e,n,void 0,i))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){let t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){O(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){let t=this._player;t.triggerCallback&&t.triggerCallback(e)}};function Li(s,e,t){let n=s.get(e);if(n){if(n.length){let i=n.indexOf(t);n.splice(i,1)}n.length==0&&s.delete(e)}return n}function $i(s){return s??null}function Be(s){return s&&s.nodeType===1}function zi(s){return s=="start"||s=="done"}function Qn(s,e){let t=s.style.display;return s.style.display=e??"none",t}function Vn(s,e,t,n,i){let r=[];t.forEach(l=>r.push(Qn(l)));let o=[];n.forEach((l,c)=>{let h=new Map;l.forEach(u=>{let S=e.computeStyle(c,u,i);h.set(u,S),(!S||S.length==0)&&(c[$]=Ii,o.push(c))}),s.set(c,h)});let a=0;return t.forEach(l=>Qn(l,r[a++])),o}function Hn(s,e){let t=new Map;if(s.forEach(a=>t.set(a,[])),e.length==0)return t;let n=1,i=new Set(e),r=new Map;function o(a){if(!a)return n;let l=r.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:i.has(c)?l=n:l=o(c),r.set(a,l),l}return e.forEach(a=>{let l=o(a);l!==n&&t.get(l).push(a)}),t}function L(s,e){s.classList?.add(e)}function ye(s,e){s.classList?.remove(e)}function Bi(s,e,t){ee(t).onDone(()=>s.processLeaveNode(e))}function Ki(s){let e=[];return rs(s,e),e}function rs(s,e){for(let t=0;ti.add(r)):e.set(s,n),t.delete(s),!0}var _e=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,n){this._driver=t,this._normalizer=n,this._transitionEngine=new Mt(e.body,t,n),this._timelineEngine=new wt(e.body,t,n),this._transitionEngine.onRemovalComplete=(i,r)=>this.onRemovalComplete(i,r)}registerTrigger(e,t,n,i,r){let o=e+"-"+i,a=this._triggerCache[o];if(!a){let l=[],c=[],h=ts(this._driver,r,l,c);if(l.length)throw js(i,l);c.length&&void 0,a=Pi(i,h,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,i,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,n,i){this._transitionEngine.insertNode(e,t,n,i)}onRemove(e,t,n){this._transitionEngine.removeNode(e,t,n)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,n,i){if(n.charAt(0)=="@"){let[r,o]=In(n),a=i;this._timelineEngine.command(r,t,o,a)}else this._transitionEngine.trigger(e,t,n,i)}listen(e,t,n,i,r){if(n.charAt(0)=="@"){let[o,a]=In(n);return this._timelineEngine.listen(o,t,a,r)}return this._transitionEngine.listen(e,t,n,i,r)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}};function qi(s,e){let t=null,n=null;return Array.isArray(e)&&e.length?(t=dt(e[0]),e.length>1&&(n=dt(e[e.length-1]))):e instanceof Map&&(t=dt(e)),t||n?new Ui(s,t,n):null}var Ui=(()=>{class s{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(t,n,i){this._element=t,this._startStyles=n,this._endStyles=i;let r=s.initialStylesByElement.get(t);r||s.initialStylesByElement.set(t,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&V(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(V(this._element,this._initialStyles),this._endStyles&&(V(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(s.initialStylesByElement.delete(this._element),this._startStyles&&(ce(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(ce(this._element,this._endStyles),this._endStyles=null),V(this._element,this._initialStyles),this._state=3)}}return s})();function dt(s){let e=null;return s.forEach((t,n)=>{Qi(n)&&(e=e||new Map,e.set(n,t))}),e}function Qi(s){return s==="display"||s==="position"}var xe=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,t,n,i){this.element=e,this.keyframes=t,this.options=n,this._specialStyles=i,this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let t=()=>this._onFinish();this.domPlayer.addEventListener("finish",t),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",t)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){let t=[];return e.forEach(n=>{t.push(Object.fromEntries(n))}),t}_triggerWebAnimation(e,t,n){return e.animate(this._convertKeyframesToObject(t),n)}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((n,i)=>{i!=="offset"&&e.set(i,this._finished?n:kt(this.element,i))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},We=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return Wn(e,t)}getParentElement(e){return Ct(e)}query(e,t,n){return Jn(e,t,n)}computeStyle(e,t,n){return kt(e,t)}animate(e,t,n,i,r,o=[]){let a=i==0?"both":"forwards",l={duration:n,delay:i,fill:a};r&&(l.easing=r);let c=new Map,h=o.filter(y=>y instanceof xe);ci(n,i)&&h.forEach(y=>{y.currentSnapshot.forEach((m,g)=>c.set(g,m))});let u=oi(t).map(y=>new Map(y));u=ui(e,u,c);let S=qi(e,u);return new xe(e,u,l,S)}};var Ke="@",os="@.disabled",Je=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,t,n,i){this.namespaceId=e,this.delegate=t,this.engine=n,this._onDestroy=i}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,n,i=!0){this.delegate.insertBefore(e,t,n),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,n){this.parentNode(t)&&this.engine.onRemove(this.namespaceId,t,this.delegate)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,n,i){this.delegate.setAttribute(e,t,n,i)}removeAttribute(e,t,n){this.delegate.removeAttribute(e,t,n)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,n,i){this.delegate.setStyle(e,t,n,i)}removeStyle(e,t,n){this.delegate.removeStyle(e,t,n)}setProperty(e,t,n){t.charAt(0)==Ke&&t==os?this.disableAnimations(e,!!n):this.delegate.setProperty(e,t,n)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,n){return this.delegate.listen(e,t,n)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},Pt=class extends Je{factory;constructor(e,t,n,i,r){super(t,n,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,n){t.charAt(0)==Ke?t.charAt(1)=="."&&t==os?(n=n===void 0?!0:!!n,this.disableAnimations(e,n)):this.engine.process(this.namespaceId,e,t.slice(1),n):this.delegate.setProperty(e,t,n)}listen(e,t,n){if(t.charAt(0)==Ke){let i=Vi(e),r=t.slice(1),o="";return r.charAt(0)!=Ke&&([r,o]=Hi(r)),this.engine.listen(this.namespaceId,i,r,o,a=>{let l=a._data||-1;this.factory.scheduleListenerCallback(l,n,a)})}return this.delegate.listen(e,t,n)}};function Vi(s){switch(s){case"body":return document.body;case"document":return document;case"window":return window;default:return s}}function Hi(s){let e=s.indexOf("."),t=s.substring(0,e),n=s.slice(e+1);return[t,n]}var Ye=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,t,n){this.delegate=e,this.engine=t,this._zone=n,t.onRemovalComplete=(i,r)=>{r?.removeChild(null,i)}}createRenderer(e,t){let n="",i=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let c=this._rendererCache,h=c.get(i);if(!h){let u=()=>c.delete(i);h=new Je(n,i,this.engine,u),c.set(i,h)}return h}let r=t.id,o=t.id+"-"+this._currentId;this._currentId++,this.engine.register(o,e);let a=c=>{Array.isArray(c)?c.forEach(a):this.engine.registerTrigger(r,o,e,c.name,c)};return t.data.animation.forEach(a),new Pt(this,o,i,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,n){if(e>=0&&et(n));return}let i=this._animationCallbacksBuffer;i.length==0&&queueMicrotask(()=>{this._zone.run(()=>{i.forEach(r=>{let[o,a]=r;o(a)}),this._animationCallbacksBuffer=[]})}),i.push([t,n])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}};var xi=(()=>{class s extends _e{constructor(t,n,i){super(t,n,i)}ngOnDestroy(){this.flush()}static \u0275fac=function(n){return new(n||s)(j(nn),j(ue),j(he))};static \u0275prov=W({token:s,factory:s.\u0275fac})}return s})();function Wi(){return new Ue}function Ji(s,e,t){return new Ye(s,e,t)}var as=[{provide:he,useFactory:Wi},{provide:_e,useClass:xi},{provide:Gt,useFactory:Ji,deps:[cn,_e,De]}],Yi=[{provide:ue,useFactory:()=>new We},{provide:nt,useValue:"BrowserAnimations"},...as],kr=[{provide:ue,useClass:Ft},{provide:nt,useValue:"NoopAnimations"},...as];function ls(){return Ht("NgEagerAnimations"),[...Yi]}var Xe=class{http;prefix;suffix;constructor(e,t="/assets/i18n/",n=".json"){this.http=e,this.prefix=t,this.suffix=n}getTranslation(e){return this.http.get(`${this.prefix}${e}${this.suffix}`)}};function Xi(s,e){if(s&1&&(U(0,"li")(1,"h2")(2,"a",1),re(3),fe(4,"translate"),Y()()()),s&2){let t,n=e.$implicit;q(2),Ne("routerLink","/"+n.path),q(),Re(" ",pe(4,2,((t=n.name)!==null&&t!==void 0?t:n.path)+".title")," ")}}var cs=(()=>{class s{constructor(){this.sections=[{path:"dashboard"},{path:"presence-control"},{path:"open-absences"},{path:"edit-absences"},{path:"evaluate-absences"},{path:"events"},{path:"events/current",name:"events.current"},{path:"my-absences"},{path:"my-profile"},{path:"my-grades"},{path:"my-settings"}]}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-home"]],decls:3,vars:0,consts:[[1,"mt-3"],[3,"routerLink"]],template:function(n,i){n&1&&(U(0,"ul",0),Ce(1,Xi,5,4,"li",null,Yt),Y()),n&2&&(q(),Fe(i.sections))},dependencies:[dn,Oe],encapsulation:2,changeDetection:0})}}return s})();var us=(()=>{class s{constructor(){}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-unauthenticated"]],decls:4,vars:3,consts:[[1,"bkd-container"],[1,"alert","alert-danger","my-3"]],template:function(n,i){n&1&&(U(0,"div",0)(1,"div",1),re(2),fe(3,"translate"),Y()()),n&2&&(q(2),Re(" ",pe(3,1,"unauthenticated.message")," "))},dependencies:[Oe],encapsulation:2})}}return s})();var Ze=(()=>{class s{constructor(t){this.storage=t}get isAuthenticated(){return!!this.accessToken}get accessToken(){return this.storage.getAccessToken()}static{this.\u0275fac=function(n){return new(n||s)(j(Tn))}}static{this.\u0275prov=W({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();function z(){return()=>{let s=H(Ze),e=H(ke);return s.isAuthenticated?!0:(e.navigate(["/unauthenticated"]),!1)}}var hs=[{path:"dashboard",canActivate:[z()],loadChildren:()=>import("./chunk-LT27JE32.js").then(s=>s.DASHBOARD_ROUTES)},{path:"presence-control",canActivate:[z()],loadChildren:()=>import("./chunk-6WEK6KVH.js").then(s=>s.PRESENCE_CONTROL_ROUTES)},{path:"open-absences",canActivate:[z()],loadChildren:()=>import("./chunk-2EI6QWJT.js").then(s=>s.OPEN_ABSENCES_ROUTES)},{path:"edit-absences",canActivate:[z()],loadChildren:()=>import("./chunk-A7BPIB5B.js").then(s=>s.EDIT_ABSENCES_ROUTES)},{path:"evaluate-absences",canActivate:[z()],loadChildren:()=>import("./chunk-P3FNPE6I.js").then(s=>s.EVALUATE_ABSENCES_ROUTES)},{path:"events",canActivate:[z()],loadChildren:()=>import("./chunk-UYAGBYT7.js").then(s=>s.EVENTS_ROUTES)},{path:"my-absences",canActivate:[z()],loadChildren:()=>import("./chunk-7Q4JYW24.js").then(s=>s.MY_ABSENCES_ROUTES)},{path:"my-profile",canActivate:[z()],loadChildren:()=>import("./chunk-2QM4IFNS.js").then(s=>s.MY_PROFILE_ROUTES)},{path:"my-grades",canActivate:[z()],loadChildren:()=>import("./chunk-EMYBIMWP.js").then(s=>s.MY_GRADES_ROUTES)},{path:"my-settings",canActivate:[z()],loadChildren:()=>import("./chunk-B47FYJ6R.js").then(s=>s.MY_SETTINGS_ROUTES)},{path:"unauthenticated",component:us},{path:"",component:cs,pathMatch:"full"}];function ds(){return(s,e)=>{let t=H(Ze),n=H(X);if(s.url.startsWith(n.apiUrl)&&t.accessToken){let i=s.headers.set("Authorization",`Bearer ${t.accessToken}`);return e(s.clone({headers:i}))}return e(s)}}function ms(){return(s,e)=>{let t=H(X);if(!s.headers.has("X-Role-Restriction")&&t.headerRoleRestriction){let n=Zi();if(n&&t.headerRoleRestriction[n]){let i=s.headers.set("X-Role-Restriction",t.headerRoleRestriction[n]);return e(s.clone({headers:i}))}}return e(s)}}function Zi(){let s=H(ke),e=s.url?An(s.url):null;return e?yn(e):null}function fs(){return[{provide:Vt,useClass:er}]}var er=(()=>{class s{constructor(t,n,i){this.ngZone=t,this.translate=n,this.toastService=i}handleError(t){console.error(String(t)),t instanceof rn||this.notifyError()}notifyError(){this.ngZone.run(()=>{this.toastService.error(this.translate.instant("global.app-errors.exception-message"),this.translate.instant("global.app-errors.exception-title"))})}static{this.\u0275fac=function(n){return new(n||s)(j(De),j(En),j(ge))}}static{this.\u0275prov=W({token:s,factory:s.\u0275fac})}}return s})();function tr(s,e){return new Xe(s,`${e.scriptsAndAssetsPath}/assets/locales/`,".json")}var ps={providers:[mn(hs,fn()),an(ln([Mn(),ds(),ms()])),ls(),fs(),vn({loader:{provide:Sn,useFactory:tr,deps:[on,X]}}),bn()]};var gs={production:!0};gs.production&&void 0;rt(Pn);rt(Dn);un(Rn,ps).catch(s=>console.error(s)); +import{b as Mn}from"./chunk-HCNFZOWE.js";import{c as An}from"./chunk-DTYYCJHM.js";import{a as bn,b as wn}from"./chunk-XAZECV42.js";import{t as gn}from"./chunk-W4U7QKJF.js";import{a as ge}from"./chunk-AVBHFGIF.js";import{$ as H,$a as Y,B as jt,Ba as Gt,Bc as mn,Cc as fn,Ed as yn,Ga as J,Jb as fe,Kb as pe,Ld as _n,Na as xt,Nd as Sn,Od as En,Pd as Oe,Qa as Ne,Qd as vn,Rd as Tn,Sa as Wt,V as v,Va as Jt,Wa as Yt,Wb as nn,X as W,Xa as Xt,Ya as Ce,Z as qt,Za as Fe,_ as j,_a as U,_b as rt,a as Pe,ab as Zt,bd as pn,c as Bt,cc as sn,cd as X,ea as Ut,eb as en,fa as Qt,gb as tn,hb as st,k as Kt,kc as rn,lc as on,mc as an,na as De,nc as ln,oa as Vt,oc as cn,pc as un,rb as re,sa as nt,sb as it,ta as Ht,tb as Re,xa as q,xc as hn,ya as ie,yc as ke,zc as dn}from"./chunk-2W7IS4PN.js";function _s(s){let e=s,t=Math.floor(Math.abs(s)),n=s.toString().replace(/^[^.]*\.?/,"").length;return t===1&&n===0?1:5}var Pn=["de-CH",[["AM","PM"],void 0,void 0],void 0,[["S","M","D","M","D","F","S"],["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],["So","Mo","Di","Mi","Do","Fr","Sa"]],[["S","M","D","M","D","F","S"],["So","Mo","Di","Mi","Do","Fr","Sa"],["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]],[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan.","Feb.","M\xE4rz","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],["Januar","Februar","M\xE4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]],[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","M\xE4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],["Januar","Februar","M\xE4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]],[["v. Chr.","n. Chr."],void 0,void 0],1,[6,0],["dd.MM.yy","dd.MM.y","d. MMMM y","EEEE, d. MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH:mm:ss zzzz"],["{1}, {0}",void 0,"{1} 'um' {0}",void 0],[".","\u2019",";","%","+","-","E","\xB7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4\xA0#,##0.00;\xA4-#,##0.00","#E0"],"CHF","CHF","Schweizer Franken",{ATS:["\xF6S"],AUD:["AU$","$"],BGM:["BGK"],BGO:["BGJ"],BYN:[void 0,"\u0440."],CUC:[void 0,"Cub$"],DEM:["DM"],EUR:[],FKP:[void 0,"Fl\xA3"],GHS:[void 0,"\u20B5"],GNF:[void 0,"F.G."],KMF:[void 0,"FC"],PHP:[void 0,"\u20B1"],RON:[void 0,"L"],RUR:[void 0,"\u0440."],RWF:[void 0,"F.Rw"],SYP:[],THB:["\u0E3F"],TWD:["NT$"],XXX:[],ZMW:[void 0,"K"]},"ltr",_s];function Ss(s){let e=s,t=Math.floor(Math.abs(s)),n=s.toString().replace(/^[^.]*\.?/,"").length,i=parseInt(s.toString().replace(/^[^e]*(e([-+]?\d+))?/,"$2"))||0;return t===0||t===1?1:i===0&&t!==0&&t%1e6===0&&n===0||!(i>=0&&i<=5)?4:5}var Dn=["fr-CH",[["AM","PM"],void 0,void 0],void 0,[["D","L","M","M","J","V","S"],["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],["di","lu","ma","me","je","ve","sa"]],void 0,[["J","F","M","A","M","J","J","A","S","O","N","D"],["janv.","f\xE9vr.","mars","avr.","mai","juin","juil.","ao\xFBt","sept.","oct.","nov.","d\xE9c."],["janvier","f\xE9vrier","mars","avril","mai","juin","juillet","ao\xFBt","septembre","octobre","novembre","d\xE9cembre"]],void 0,[["av. J.-C.","ap. J.-C."],void 0,["avant J\xE9sus-Christ","apr\xE8s J\xE9sus-Christ"]],1,[6,0],["dd.MM.yy","d MMM y","d MMMM y","EEEE, d MMMM y"],["HH:mm","HH:mm:ss","HH:mm:ss z","HH.mm:ss 'h' zzzz"],["{1} {0}","{1}, {0}","{1} '\xE0' {0}",void 0],[",","\u202F",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":","."],["#,##0.###","#,##0%","#,##0.00\xA0\xA4","#E0"],"CHF","CHF","franc suisse",{ARS:["$AR","$"],AUD:["$AU","$"],BEF:["FB"],BMD:["$BM","$"],BND:["$BN","$"],BYN:[void 0,"\u0440."],BZD:["$BZ","$"],CAD:["$CA","$"],CLP:["$CL","$"],CNY:[void 0,"\xA5"],COP:["$CO","$"],CYP:["\xA3CY"],EGP:[void 0,"\xA3E"],FJD:["$FJ","$"],FKP:["\xA3FK","\xA3"],FRF:["F"],GBP:["\xA3GB","\xA3"],GIP:["\xA3GI","\xA3"],HKD:[void 0,"$"],IEP:["\xA3IE"],ILP:["\xA3IL"],ITL:["\u20A4IT"],JPY:[void 0,"\xA5"],KMF:[void 0,"FC"],LBP:["\xA3LB","\xA3L"],MTP:["\xA3MT"],MXN:["$MX","$"],NAD:["$NA","$"],NIO:[void 0,"$C"],NZD:["$NZ","$"],PHP:[void 0,"\u20B1"],RHD:["$RH"],RON:[void 0,"L"],RWF:[void 0,"FR"],SBD:["$SB","$"],SGD:["$SG","$"],SRD:["$SR","$"],TOP:[void 0,"$T"],TTD:["$TT","$"],TWD:[void 0,"NT$"],USD:["$US","$"],UYU:["$UY","$"],WST:["$WS"],XCD:[void 0,"$"],XPF:["FCFP"],ZMW:[void 0,"Kw"]},"ltr",Ss];function Es(s,e){if(s&1&&(U(0,"i",3),re(1),Y()),s&2){let t=st().$implicit;q(),it(t.icon)}}function vs(s,e){if(s&1){let t=en();U(0,"ngb-toast",1),tn("hidden",function(){let i=Ut(t).$implicit,r=st();return Qt(r.toastService.remove(i))}),U(1,"div",2),xt(2,Es,2,1,"i",3),U(3,"span"),re(4),Y()()()}if(s&2){let t=e.$implicit;Wt(t.classname),Ne("header",t.header||"")("autohide",!0),q(2),Jt(t.icon?2:-1),q(2),it(t.message)}}var Cn=(()=>{class s{constructor(t){this.toastService=t}static{this.\u0275fac=function(n){return new(n||s)(ie(ge))}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-toast"]],decls:3,vars:2,consts:[[3,"header","class","autohide"],[3,"hidden","header","autohide"],[1,"d-flex","gap-2"],[1,"material-icons"]],template:function(n,i){n&1&&(Ce(0,vs,5,6,"ngb-toast",0,Xt),fe(2,"async")),n&2&&Fe(pe(2,0,i.toastService.toasts$))},dependencies:[gn,sn],styles:["[_nghost-%COMP%]{position:fixed;top:0;right:0;margin:.5em;z-index:1200}[_nghost-%COMP%] > *[_ngcontent-%COMP%]{font-size:medium}"]})}}return s})();var Fn=new qt("Navigator API",{providedIn:"root",factory:()=>navigator});var Rn=(()=>{class s{constructor(t,n,i,r){this.toastService=n,this.settings=i,this.navigator=r,t.initialize(),this.checkSettings()}checkSettings(){_n(pn)(this.settings).pipe(jt(t=>(console.error(String(t)),this.toastService.error("Please check the contents of the settings.js file (see Console output for more details).","Invalid Settings"),Kt))).subscribe()}static{this.\u0275fac=function(n){return new(n||s)(ie(wn),ie(ge),ie(X),ie(Fn))}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-app"]],decls:2,vars:0,consts:[["aria-live","polite","aria-atomic","true"]],template:function(n,i){n&1&&Zt(0,"bkd-toast",0)(1,"router-outlet")},dependencies:[Cn,hn],styles:["[_nghost-%COMP%]{width:100%}"],changeDetection:0})}}return s})();var _=function(s){return s[s.State=0]="State",s[s.Transition=1]="Transition",s[s.Sequence=2]="Sequence",s[s.Group=3]="Group",s[s.Animate=4]="Animate",s[s.Keyframes=5]="Keyframes",s[s.Style=6]="Style",s[s.Trigger=7]="Trigger",s[s.Reference=8]="Reference",s[s.AnimateChild=9]="AnimateChild",s[s.AnimateRef=10]="AnimateRef",s[s.Query=11]="Query",s[s.Stagger=12]="Stagger",s}(_||{}),Q="*";function kn(s,e=null){return{type:_.Sequence,steps:s,options:e}}function ot(s){return{type:_.Style,styles:s,offset:null}}var Z=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(e=0,t=0){this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},Se=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(e){this.players=e;let t=0,n=0,i=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++n==r&&this._onDestroy()}),o.onStart(()=>{++i==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){let t=e*this.totalTime;this.players.forEach(n=>{let i=n.totalTime?Math.min(1,t/n.totalTime):1;n.setPosition(i)})}getPosition(){let e=this.players.reduce((t,n)=>t===null||n.totalTime>t.totalTime?n:t,null);return e!=null?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},Ie="!";function On(s){return new v(3e3,!1)}function Ts(){return new v(3100,!1)}function bs(){return new v(3101,!1)}function ws(s){return new v(3001,!1)}function As(s){return new v(3003,!1)}function Ms(s){return new v(3004,!1)}function Ps(s,e){return new v(3005,!1)}function Ds(){return new v(3006,!1)}function Ns(){return new v(3007,!1)}function Cs(s,e){return new v(3008,!1)}function Fs(s){return new v(3002,!1)}function Rs(s,e,t,n,i){return new v(3010,!1)}function ks(){return new v(3011,!1)}function Os(){return new v(3012,!1)}function Is(){return new v(3200,!1)}function Ls(){return new v(3202,!1)}function $s(){return new v(3013,!1)}function zs(s){return new v(3014,!1)}function Bs(s){return new v(3015,!1)}function Ks(s){return new v(3016,!1)}function js(s,e){return new v(3404,!1)}function qs(s){return new v(3502,!1)}function Us(s){return new v(3503,!1)}function Qs(){return new v(3300,!1)}function Vs(s){return new v(3504,!1)}function Hs(s){return new v(3301,!1)}function Gs(s,e){return new v(3302,!1)}function xs(s){return new v(3303,!1)}function Ws(s,e){return new v(3400,!1)}function Js(s){return new v(3401,!1)}function Ys(s){return new v(3402,!1)}function Xs(s,e){return new v(3505,!1)}function ee(s){switch(s.length){case 0:return new Z;case 1:return s[0];default:return new Se(s)}}function xn(s,e,t=new Map,n=new Map){let i=[],r=[],o=-1,a=null;if(e.forEach(l=>{let c=l.get("offset"),h=c==o,u=h&&a||new Map;l.forEach((S,y)=>{let m=y,g=S;if(y!=="offset")switch(m=s.normalizePropertyName(m,i),g){case Ie:g=t.get(y);break;case Q:g=n.get(y);break;default:g=s.normalizeStyleValue(y,m,g,i);break}u.set(m,g)}),h||r.push(u),a=u,o=c}),i.length)throw qs(i);return r}function Dt(s,e,t,n){switch(e){case"start":s.onStart(()=>n(t&&at(t,"start",s)));break;case"done":s.onDone(()=>n(t&&at(t,"done",s)));break;case"destroy":s.onDestroy(()=>n(t&&at(t,"destroy",s)));break}}function at(s,e,t){let n=t.totalTime,i=!!t.disabled,r=Nt(s.element,s.triggerName,s.fromState,s.toState,e||s.phaseName,n??s.totalTime,i),o=s._data;return o!=null&&(r._data=o),r}function Nt(s,e,t,n,i="",r=0,o){return{element:s,triggerName:e,fromState:t,toState:n,phaseName:i,totalTime:r,disabled:!!o}}function O(s,e,t){let n=s.get(e);return n||s.set(e,n=t),n}function In(s){let e=s.indexOf(":"),t=s.substring(1,e),n=s.slice(e+1);return[t,n]}var Zs=typeof document>"u"?null:document.documentElement;function Ct(s){let e=s.parentNode||s.host||null;return e===Zs?null:e}function ei(s){return s.substring(1,6)=="ebkit"}var ae=null,Ln=!1;function ti(s){ae||(ae=ni()||{},Ln=ae.style?"WebkitAppearance"in ae.style:!1);let e=!0;return ae.style&&!ei(s)&&(e=s in ae.style,!e&&Ln&&(e="Webkit"+s.charAt(0).toUpperCase()+s.slice(1)in ae.style)),e}function ni(){return typeof document<"u"?document.body:null}function Wn(s,e){for(;e;){if(e===s)return!0;e=Ct(e)}return!1}function Jn(s,e,t){if(t)return Array.from(s.querySelectorAll(e));let n=s.querySelector(e);return n?[n]:[]}var Ft=(()=>{class s{validateStyleProperty(t){return ti(t)}containsElement(t,n){return Wn(t,n)}getParentElement(t){return Ct(t)}query(t,n,i){return Jn(t,n,i)}computeStyle(t,n,i){return i||""}animate(t,n,i,r,o,a=[],l){return new Z(i,r)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=W({token:s,factory:s.\u0275fac})}return s})(),ue=class{static NOOP=new Ft},he=class{};var si=1e3,Yn="{{",ii="}}",Xn="ng-enter",mt="ng-leave",Le="ng-trigger",je=".ng-trigger",$n="ng-animating",ft=".ng-animating";function G(s){if(typeof s=="number")return s;let e=s.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:pt(parseFloat(e[1]),e[2])}function pt(s,e){switch(e){case"s":return s*si;default:return s}}function qe(s,e,t){return s.hasOwnProperty("duration")?s:ri(s,e,t)}function ri(s,e,t){let n=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,i,r=0,o="";if(typeof s=="string"){let a=s.match(n);if(a===null)return e.push(On(s)),{duration:0,delay:0,easing:""};i=pt(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(r=pt(parseFloat(l),a[4]));let c=a[5];c&&(o=c)}else i=s;if(!t){let a=!1,l=e.length;i<0&&(e.push(Ts()),a=!0),r<0&&(e.push(bs()),a=!0),a&&e.splice(l,0,On(s))}return{duration:i,delay:r,easing:o}}function oi(s){return s.length?s[0]instanceof Map?s:s.map(e=>new Map(Object.entries(e))):[]}function V(s,e,t){e.forEach((n,i)=>{let r=Rt(i);t&&!t.has(i)&&t.set(i,s.style[r]),s.style[r]=n})}function ce(s,e){e.forEach((t,n)=>{let i=Rt(n);s.style[i]=""})}function Ee(s){return Array.isArray(s)?s.length==1?s[0]:kn(s):s}function ai(s,e,t){let n=e.params||{},i=Zn(s);i.length&&i.forEach(r=>{n.hasOwnProperty(r)||t.push(ws(r))})}var gt=new RegExp(`${Yn}\\s*(.+?)\\s*${ii}`,"g");function Zn(s){let e=[];if(typeof s=="string"){let t;for(;t=gt.exec(s);)e.push(t[1]);gt.lastIndex=0}return e}function Te(s,e,t){let n=`${s}`,i=n.replace(gt,(r,o)=>{let a=e[o];return a==null&&(t.push(As(o)),a=""),a.toString()});return i==n?s:i}var li=/-+([a-z0-9])/g;function Rt(s){return s.replace(li,(...e)=>e[1].toUpperCase())}function ci(s,e){return s===0||e===0}function ui(s,e,t){if(t.size&&e.length){let n=e[0],i=[];if(t.forEach((r,o)=>{n.has(o)||i.push(o),n.set(o,r)}),i.length)for(let r=1;ro.set(a,kt(s,a)))}}return e}function k(s,e,t){switch(e.type){case _.Trigger:return s.visitTrigger(e,t);case _.State:return s.visitState(e,t);case _.Transition:return s.visitTransition(e,t);case _.Sequence:return s.visitSequence(e,t);case _.Group:return s.visitGroup(e,t);case _.Animate:return s.visitAnimate(e,t);case _.Keyframes:return s.visitKeyframes(e,t);case _.Style:return s.visitStyle(e,t);case _.Reference:return s.visitReference(e,t);case _.AnimateChild:return s.visitAnimateChild(e,t);case _.AnimateRef:return s.visitAnimateRef(e,t);case _.Query:return s.visitQuery(e,t);case _.Stagger:return s.visitStagger(e,t);default:throw Ms(e.type)}}function kt(s,e){return window.getComputedStyle(s)[e]}var hi=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),Ue=class extends he{normalizePropertyName(e,t){return Rt(e)}normalizeStyleValue(e,t,n,i){let r="",o=n.toString().trim();if(hi.has(t)&&n!==0&&n!=="0")if(typeof n=="number")r="px";else{let a=n.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&i.push(Ps(e,n))}return o+r}};var Qe="*";function di(s,e){let t=[];return typeof s=="string"?s.split(/\s*,\s*/).forEach(n=>mi(n,t,e)):t.push(s),t}function mi(s,e,t){if(s[0]==":"){let l=fi(s,t);if(typeof l=="function"){e.push(l);return}s=l}let n=s.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(n==null||n.length<4)return t.push(Bs(s)),e;let i=n[1],r=n[2],o=n[3];e.push(zn(i,o));let a=i==Qe&&o==Qe;r[0]=="<"&&!a&&e.push(zn(o,i))}function fi(s,e){switch(s){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,n)=>parseFloat(n)>parseFloat(t);case":decrement":return(t,n)=>parseFloat(n) *"}}var $e=new Set(["true","1"]),ze=new Set(["false","0"]);function zn(s,e){let t=$e.has(s)||ze.has(s),n=$e.has(e)||ze.has(e);return(i,r)=>{let o=s==Qe||s==i,a=e==Qe||e==r;return!o&&t&&typeof i=="boolean"&&(o=i?$e.has(s):ze.has(s)),!a&&n&&typeof r=="boolean"&&(a=r?$e.has(e):ze.has(e)),o&&a}}var es=":self",pi=new RegExp(`s*${es}s*,?`,"g");function ts(s,e,t,n){return new yt(s).build(e,t,n)}var Bn="",yt=class{_driver;constructor(e){this._driver=e}build(e,t,n){let i=new _t(t);return this._resetContextStyleTimingState(i),k(this,Ee(e),i)}_resetContextStyleTimingState(e){e.currentQuerySelector=Bn,e.collectedStyles=new Map,e.collectedStyles.set(Bn,new Map),e.currentTime=0}visitTrigger(e,t){let n=t.queryCount=0,i=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(Ds()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==_.State){let l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(h=>{l.name=h,r.push(this.visitState(l,t))}),l.name=c}else if(a.type==_.Transition){let l=this.visitTransition(a,t);n+=l.queryCount,i+=l.depCount,o.push(l)}else t.errors.push(Ns())}),{type:_.Trigger,name:e.name,states:r,transitions:o,queryCount:n,depCount:i,options:null}}visitState(e,t){let n=this.visitStyle(e.styles,t),i=e.options&&e.options.params||null;if(n.containsDynamicStyles){let r=new Set,o=i||{};n.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{Zn(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(Cs(e.name,[...r.values()]))}return{type:_.State,name:e.name,style:n,options:i?{params:i}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let n=k(this,Ee(e.animation),t),i=di(e.expr,t.errors);return{type:_.Transition,matchers:i,animation:n,queryCount:t.queryCount,depCount:t.depCount,options:le(e.options)}}visitSequence(e,t){return{type:_.Sequence,steps:e.steps.map(n=>k(this,n,t)),options:le(e.options)}}visitGroup(e,t){let n=t.currentTime,i=0,r=e.steps.map(o=>{t.currentTime=n;let a=k(this,o,t);return i=Math.max(i,t.currentTime),a});return t.currentTime=i,{type:_.Group,steps:r,options:le(e.options)}}visitAnimate(e,t){let n=Si(e.timings,t.errors);t.currentAnimateTimings=n;let i,r=e.styles?e.styles:ot({});if(r.type==_.Keyframes)i=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};n.easing&&(c.easing=n.easing),o=ot(c)}t.currentTime+=n.duration+n.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,i=l}return t.currentAnimateTimings=null,{type:_.Animate,timings:n,style:i,options:null}}visitStyle(e,t){let n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}_makeStyleAst(e,t){let n=[],i=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of i)typeof a=="string"?a===Q?n.push(a):t.errors.push(Fs(a)):n.push(new Map(Object.entries(a)));let r=!1,o=null;return n.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(o=a.get("easing"),a.delete("easing")),!r)){for(let l of a.values())if(l.toString().indexOf(Yn)>=0){r=!0;break}}}),{type:_.Style,styles:n,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let n=t.currentAnimateTimings,i=t.currentTime,r=t.currentTime;n&&r>0&&(r-=n.duration+n.delay),e.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,l)=>{let c=t.collectedStyles.get(t.currentQuerySelector),h=c.get(l),u=!0;h&&(r!=i&&r>=h.startTime&&i<=h.endTime&&(t.errors.push(Rs(l,h.startTime,h.endTime,r,i)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:i}),t.options&&ai(a,t.options,t.errors)})})}visitKeyframes(e,t){let n={type:_.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(ks()),n;let i=1,r=0,o=[],a=!1,l=!1,c=0,h=e.steps.map(w=>{let A=this._makeStyleAst(w,t),N=A.offset!=null?A.offset:_i(A.styles),P=0;return N!=null&&(r++,P=A.offset=N),l=l||P<0||P>1,a=a||P0&&r{let N=S>0?A==y?1:S*A:o[A],P=N*T;t.currentTime=m+g.delay+P,g.duration=P,this._validateStyleAst(w,t),w.offset=N,n.styles.push(w)}),n}visitReference(e,t){return{type:_.Reference,animation:k(this,Ee(e.animation),t),options:le(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:_.AnimateChild,options:le(e.options)}}visitAnimateRef(e,t){return{type:_.AnimateRef,animation:this.visitReference(e.animation,t),options:le(e.options)}}visitQuery(e,t){let n=t.currentQuerySelector,i=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=gi(e.selector);t.currentQuerySelector=n.length?n+" "+r:r,O(t.collectedStyles,t.currentQuerySelector,new Map);let a=k(this,Ee(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:_.Query,selector:r,limit:i.limit||0,optional:!!i.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:le(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push($s());let n=e.timings==="full"?{duration:0,delay:0,easing:"full"}:qe(e.timings,t.errors,!0);return{type:_.Stagger,animation:k(this,Ee(e.animation),t),timings:n,options:null}}};function gi(s){let e=!!s.split(/\s*,\s*/).find(t=>t==es);return e&&(s=s.replace(pi,"")),s=s.replace(/@\*/g,je).replace(/@\w+/g,t=>je+"-"+t.slice(1)).replace(/:animating/g,ft),[s,e]}function yi(s){return s?Pe({},s):null}var _t=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}};function _i(s){if(typeof s=="string")return null;let e=null;if(Array.isArray(s))s.forEach(t=>{if(t instanceof Map&&t.has("offset")){let n=t;e=parseFloat(n.get("offset")),n.delete("offset")}});else if(s instanceof Map&&s.has("offset")){let t=s;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function Si(s,e){if(s.hasOwnProperty("duration"))return s;if(typeof s=="number"){let r=qe(s,e).duration;return lt(r,0,"")}let t=s;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=lt(0,0,"");return r.dynamic=!0,r.strValue=t,r}let i=qe(t,e);return lt(i.duration,i.delay,i.easing)}function le(s){return s?(s=Pe({},s),s.params&&(s.params=yi(s.params))):s={},s}function lt(s,e,t){return{duration:s,delay:e,easing:t}}function Ot(s,e,t,n,i,r,o=null,a=!1){return{type:1,element:s,keyframes:e,preStyleProps:t,postStyleProps:n,duration:i,delay:r,totalTime:i+r,easing:o,subTimeline:a}}var be=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let n=this._map.get(e);n||this._map.set(e,n=[]),n.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},Ei=1,vi=":enter",Ti=new RegExp(vi,"g"),bi=":leave",wi=new RegExp(bi,"g");function ns(s,e,t,n,i,r=new Map,o=new Map,a,l,c=[]){return new St().buildKeyframes(s,e,t,n,i,r,o,a,l,c)}var St=class{buildKeyframes(e,t,n,i,r,o,a,l,c,h=[]){c=c||new be;let u=new Et(e,t,c,i,r,h,[]);u.options=l;let S=l.delay?G(l.delay):0;u.currentTimeline.delayNextStep(S),u.currentTimeline.setStyles([o],null,u.errors,l),k(this,n,u);let y=u.timelines.filter(m=>m.containsAnimation());if(y.length&&a.size){let m;for(let g=y.length-1;g>=0;g--){let T=y[g];if(T.element===t){m=T;break}}m&&!m.allowOnlyTimelineStyles()&&m.setStyles([a],null,u.errors,l)}return y.length?y.map(m=>m.buildKeyframes()):[Ot(t,[],[],[],0,S,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let n=t.subInstructions.get(t.element);if(n){let i=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(n,i,i.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,n),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,n){for(let i of e){let r=i?.delay;if(r){let o=typeof r=="number"?r:G(Te(r,i?.params??{},t.errors));n.delayNextStep(o)}}}_visitSubInstructions(e,t,n){let r=t.currentTimeline.currentTime,o=n.duration!=null?G(n.duration):null,a=n.delay!=null?G(n.delay):null;return o!==0&&e.forEach(l=>{let c=t.appendInstructionToTimeline(l,o,a);r=Math.max(r,c.duration+c.delay)}),r}visitReference(e,t){t.updateOptions(e.options,!0),k(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let n=t.subContextCount,i=t,r=e.options;if(r&&(r.params||r.delay)&&(i=t.createSubContext(r),i.transformIntoNewTimeline(),r.delay!=null)){i.previousNode.type==_.Style&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=Ve);let o=G(r.delay);i.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>k(this,o,i)),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>n&&i.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let n=[],i=t.currentTimeline.currentTime,r=e.options&&e.options.delay?G(e.options.delay):0;e.steps.forEach(o=>{let a=t.createSubContext(e.options);r&&a.delayNextStep(r),k(this,o,a),i=Math.max(i,a.currentTimeline.currentTime),n.push(a.currentTimeline)}),n.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(i),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let n=e.strValue,i=t.params?Te(n,t.params,t.errors):n;return qe(i,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let n=t.currentAnimateTimings=this._visitTiming(e.timings,t),i=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),i.snapshotCurrentStyles());let r=e.style;r.type==_.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(n.duration),this.visitStyle(r,t),i.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let n=t.currentTimeline,i=t.currentAnimateTimings;!i&&n.hasCurrentStyleProperties()&&n.forwardFrame();let r=i&&i.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(r):n.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let n=t.currentAnimateTimings,i=t.currentTimeline.duration,r=n.duration,a=t.createSubContext().currentTimeline;a.easing=n.easing,e.styles.forEach(l=>{let c=l.offset||0;a.forwardTime(c*r),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(i+r),t.previousNode=e}visitQuery(e,t){let n=t.currentTimeline.currentTime,i=e.options||{},r=i.delay?G(i.delay):0;r&&(t.previousNode.type===_.Style||n==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=Ve);let o=n,a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,h)=>{t.currentQueryIndex=h;let u=t.createSubContext(e.options,c);r&&u.delayNextStep(r),c===t.element&&(l=u.currentTimeline),k(this,e.animation,u),u.currentTimeline.applyStylesToKeyframe();let S=u.currentTimeline.currentTime;o=Math.max(o,S)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let n=t.parentContext,i=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),l=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":l=a-l;break;case"full":l=n.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;k(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=i.currentTime-u+(i.startTime-n.currentTimeline.startTime)}},Ve={},Et=class s{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Ve;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,n,i,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=i,this._leaveClassName=r,this.errors=o,this.timelines=a,this.currentTimeline=l||new He(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let n=e,i=this.options;n.duration!=null&&(i.duration=G(n.duration)),n.delay!=null&&(i.delay=G(n.delay));let r=n.params;if(r){let o=i.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=Te(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let n=e.params={};Object.keys(t).forEach(i=>{n[i]=t[i]})}}return e}createSubContext(e=null,t,n){let i=t||this.element,r=new s(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=Ve,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,n){let i={duration:t??e.duration,delay:this.currentTimeline.currentTime+(n??0)+e.delay,easing:""},r=new vt(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,i,e.stretchStartingKeyframe);return this.timelines.push(r),i}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,n,i,r,o){let a=[];if(i&&a.push(this.element),e.length>0){e=e.replace(Ti,"."+this._enterClassName),e=e.replace(wi,"."+this._leaveClassName);let l=n!=1,c=this._driver.query(this.element,e,l);n!==0&&(c=n<0?c.slice(c.length+n,c.length):c.slice(0,n)),a.push(...c)}return!r&&a.length==0&&o.push(zs(t)),a}},He=class s{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,n,i){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=i,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new s(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=Ei,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,n]of this._globalTimelineStyles)this._backFill.set(t,n||Q),this._currentKeyframe.set(t,Q);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,n,i){t&&this._previousKeyframe.set("easing",t);let r=i&&i.params||{},o=Ai(e,this._globalTimelineStyles);for(let[a,l]of o){let c=Te(l,r,n);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??Q),this._updateStyle(a,c)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,n)=>{let i=this._styleSummary.get(n);(!i||t.time>i.time)&&this._updateStyle(n,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,n=this._keyframes.size===1&&this.duration===0,i=[];this._keyframes.forEach((a,l)=>{let c=new Map([...this._backFill,...a]);c.forEach((h,u)=>{h===Ie?e.add(u):h===Q&&t.add(u)}),n||c.set("offset",l/this.duration),i.push(c)});let r=[...e.values()],o=[...t.values()];if(n){let a=i[0],l=new Map(a);a.set("offset",0),l.set("offset",1),i=[a,l]}return Ot(this.element,i,r,o,this.duration,this.startTime,this.easing,!1)}},vt=class extends He{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,n,i,r,o,a=!1){super(e,t,o.delay),this.keyframes=n,this.preStyleProps=i,this.postStyleProps=r,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:n,easing:i}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=n+t,a=t/o,l=new Map(e[0]);l.set("offset",0),r.push(l);let c=new Map(e[0]);c.set("offset",Kn(a)),r.push(c);let h=e.length-1;for(let u=1;u<=h;u++){let S=new Map(e[u]),y=S.get("offset"),m=t+y*n;S.set("offset",Kn(m/o)),r.push(S)}n=o,t=0,i="",e=r}return Ot(this.element,e,this.preStyleProps,this.postStyleProps,n,t,i,!0)}};function Kn(s,e=3){let t=Math.pow(10,e-1);return Math.round(s*t)/t}function Ai(s,e){let t=new Map,n;return s.forEach(i=>{if(i==="*"){n??=e.keys();for(let r of n)t.set(r,Q)}else for(let[r,o]of i)t.set(r,o)}),t}function jn(s,e,t,n,i,r,o,a,l,c,h,u,S){return{type:0,element:s,triggerName:e,isRemovalTransition:i,fromState:t,fromStyles:r,toState:n,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:S}}var ct={},Ge=class{_triggerName;ast;_stateStyles;constructor(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}match(e,t,n,i){return Mi(this.ast.matchers,e,t,n,i)}buildStyles(e,t,n){let i=this._stateStyles.get("*");return e!==void 0&&(i=this._stateStyles.get(e?.toString())||i),i?i.buildStyles(t,n):new Map}build(e,t,n,i,r,o,a,l,c,h){let u=[],S=this.ast.options&&this.ast.options.params||ct,y=a&&a.params||ct,m=this.buildStyles(n,y,u),g=l&&l.params||ct,T=this.buildStyles(i,g,u),w=new Set,A=new Map,N=new Map,P=i==="void",de={params:ss(g,S),delay:this.ast.options?.delay},B=h?[]:ns(e,t,this.ast.animation,r,o,m,T,de,c,u),C=0;return B.forEach(F=>{C=Math.max(F.duration+F.delay,C)}),u.length?jn(t,this._triggerName,n,i,P,m,T,[],[],A,N,C,u):(B.forEach(F=>{let te=F.element,me=O(A,te,new Set);F.preStyleProps.forEach(ne=>me.add(ne));let It=O(N,te,new Set);F.postStyleProps.forEach(ne=>It.add(ne)),te!==t&&w.add(te)}),jn(t,this._triggerName,n,i,P,m,T,B,[...w.values()],A,N,C))}};function Mi(s,e,t,n,i){return s.some(r=>r(e,t,n,i))}function ss(s,e){let t=Pe({},e);return Object.entries(s).forEach(([n,i])=>{i!=null&&(t[n]=i)}),t}var Tt=class{styles;defaultParams;normalizer;constructor(e,t,n){this.styles=e,this.defaultParams=t,this.normalizer=n}buildStyles(e,t){let n=new Map,i=ss(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=Te(o,i,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),n.set(a,o)})}),n}};function Pi(s,e,t){return new bt(s,e,t)}var bt=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,n){this.name=e,this.ast=t,this._normalizer=n,t.states.forEach(i=>{let r=i.options&&i.options.params||{};this.states.set(i.name,new Tt(i.style,r,n))}),qn(this.states,"true","1"),qn(this.states,"false","0"),t.transitions.forEach(i=>{this.transitionFactories.push(new Ge(e,i,this.states))}),this.fallbackTransition=Di(e,this.states,this._normalizer)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,n,i){return this.transitionFactories.find(o=>o.match(e,t,n,i))||null}matchStyles(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}};function Di(s,e,t){let n=[(o,a)=>!0],i={type:_.Sequence,steps:[],options:null},r={type:_.Transition,animation:i,matchers:n,options:null,queryCount:0,depCount:0};return new Ge(s,r,e)}function qn(s,e,t){s.has(e)?s.has(t)||s.set(t,s.get(e)):s.has(t)&&s.set(e,s.get(t))}var Ni=new be,wt=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n}register(e,t){let n=[],i=[],r=ts(this._driver,t,n,i);if(n.length)throw Us(n);i.length&&void 0,this._animations.set(e,r)}_buildPlayer(e,t,n){let i=e.element,r=xn(this._normalizer,e.keyframes,t,n);return this._driver.animate(i,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,n={}){let i=[],r=this._animations.get(e),o,a=new Map;if(r?(o=ns(this._driver,t,r,Xn,mt,new Map,new Map,n,Ni,i),o.forEach(h=>{let u=O(a,h.element,new Map);h.postStyleProps.forEach(S=>u.set(S,null))})):(i.push(Qs()),o=[]),i.length)throw Vs(i);a.forEach((h,u)=>{h.forEach((S,y)=>{h.set(y,this._driver.computeStyle(u,y,Q))})});let l=o.map(h=>{let u=a.get(h.element);return this._buildPlayer(h,new Map,u)}),c=ee(l);return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Hs(e);return t}listen(e,t,n,i){let r=Nt(t,"","","");return Dt(this._getPlayer(e),n,r,i),()=>{}}command(e,t,n,i){if(n=="register"){this.register(e,i[0]);return}if(n=="create"){let o=i[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(i[0]));break;case"destroy":this.destroy(e);break}}},Un="ng-animate-queued",Ci=".ng-animate-queued",ut="ng-animate-disabled",Fi=".ng-animate-disabled",Ri="ng-star-inserted",ki=".ng-star-inserted",Oi=[],is={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Ii={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},$="__ng_removed",we=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let n=e&&e.hasOwnProperty("value"),i=n?e.value:e;if(this.value=$i(i),n){let r=e,{value:o}=r,a=Bt(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let n=this.options.params;Object.keys(t).forEach(i=>{n[i]==null&&(n[i]=t[i])})}}},ve="void",ht=new we(ve),At=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,n,i){if(!this._triggers.has(t))throw Gs(n,t);if(n==null||n.length==0)throw xs(t);if(!zi(n))throw Ws(n,t);let r=O(this._elementListeners,e,[]),o={name:t,phase:n,callback:i};r.push(o);let a=O(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,Le),L(e,Le+"-"+t),a.set(t,ht)),()=>{this._engine.afterFlush(()=>{let l=r.indexOf(o);l>=0&&r.splice(l,1),this._triggers.has(t)||a.delete(t)})}}register(e,t){return this._triggers.has(e)?!1:(this._triggers.set(e,t),!0)}_getTrigger(e){let t=this._triggers.get(e);if(!t)throw Js(e);return t}trigger(e,t,n,i=!0){let r=this._getTrigger(t),o=new Ae(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,Le),L(e,Le+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new we(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=ht),!(c.value===ve)&&l.value===c.value){if(!ji(l.params,c.params)){let g=[],T=r.matchStyles(l.value,l.params,g),w=r.matchStyles(c.value,c.params,g);g.length?this._engine.reportError(g):this._engine.afterFlush(()=>{ce(e,T),V(e,w)})}return}let S=O(this._engine.playersByElement,e,[]);S.forEach(g=>{g.namespaceId==this.id&&g.triggerName==t&&g.queued&&g.destroy()});let y=r.matchTransition(l.value,c.value,e,c.params),m=!1;if(!y){if(!i)return;y=r.fallbackTransition,m=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:m}),m||(L(e,Un),o.onStart(()=>{ye(e,Un)})),o.onDone(()=>{let g=this.players.indexOf(o);g>=0&&this.players.splice(g,1);let T=this._engine.playersByElement.get(e);if(T){let w=T.indexOf(o);w>=0&&T.splice(w,1)}}),this.players.push(o),S.push(o),o}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,n)=>{this._elementListeners.set(n,t.filter(i=>i.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(n=>n.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let n=this._engine.driver.query(e,je,!0);n.forEach(i=>{if(i[$])return;let r=this._engine.fetchNamespacesByElement(i);r.size?r.forEach(o=>o.triggerLeaveAnimation(i,t,!1,!0)):this.clearElementCache(i)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(i=>this.clearElementCache(i)))}triggerLeaveAnimation(e,t,n,i){let r=this._engine.statesByElement.get(e),o=new Map;if(r){let a=[];if(r.forEach((l,c)=>{if(o.set(c,l.value),this._triggers.has(c)){let h=this.trigger(e,c,ve,i);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),n&&ee(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),n=this._engine.statesByElement.get(e);if(t&&n){let i=new Set;t.forEach(r=>{let o=r.name;if(i.has(o))return;i.add(o);let l=this._triggers.get(o).fallbackTransition,c=n.get(o)||ht,h=new we(ve),u=new Ae(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:h,player:u,isFallbackTransition:!0})})}}removeNode(e,t){let n=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let i=!1;if(n.totalAnimations){let r=n.players.length?n.playersByQueriedElement.get(e):[];if(r&&r.length)i=!0;else{let o=e;for(;o=o.parentNode;)if(n.statesByElement.get(o)){i=!0;break}}}if(this.prepareLeaveAnimationListeners(e),i)n.markElementAsRemoved(this.id,e,!1,t);else{let r=e[$];(!r||r===is)&&(n.afterFlush(()=>this.clearElementCache(e)),n.destroyInnerAnimations(e),n._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(n=>{let i=n.player;if(i.destroyed)return;let r=n.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==n.triggerName){let l=Nt(r,n.triggerName,n.fromState.value,n.toState.value);l._data=e,Dt(n.player,a.phase,l,a.callback)}}),i.markedForDestroy?this._engine.afterFlush(()=>{i.destroy()}):t.push(n)}),this._queue=[],t.sort((n,i)=>{let r=n.transition.ast.depCount,o=i.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(n.element,i.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Mt=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,n){this.bodyNode=e,this.driver=t,this._normalizer=n}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(n=>{n.queued&&e.push(n)})}),e}createNamespace(e,t){let n=new At(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(n,t):(this.newHostElements.set(t,n),this.collectEnterElement(t)),this._namespaceLookup[e]=n}_balanceNamespaceList(e,t){let n=this._namespaceList,i=this.namespacesByHostElement;if(n.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=i.get(a);if(l){let c=n.indexOf(l);n.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||n.unshift(e)}else n.push(e);return i.set(t,e),e}register(e,t){let n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}registerTrigger(e,t,n){let i=this._namespaceLookup[e];i&&i.register(t,n)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let n=this._fetchNamespace(e);this.namespacesByHostElement.delete(n.hostElement);let i=this._namespaceList.indexOf(n);i>=0&&this._namespaceList.splice(i,1),n.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,n=this.statesByElement.get(e);if(n){for(let i of n.values())if(i.namespaceId){let r=this._fetchNamespace(i.namespaceId);r&&t.add(r)}}return t}trigger(e,t,n,i){if(Be(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,n,i),!0}return!1}insertNode(e,t,n,i){if(!Be(t))return;let r=t[$];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let o=this.collectedLeaveElements.indexOf(t);o>=0&&this.collectedLeaveElements.splice(o,1)}if(e){let o=this._fetchNamespace(e);o&&o.insertNode(t,n)}i&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,ut)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ye(e,ut))}removeNode(e,t,n){if(Be(t)){let i=e?this._fetchNamespace(e):null;i?i.removeNode(t,n):this.markElementAsRemoved(e,t,!1,n);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,n)}else this._onRemovalComplete(t,n)}markElementAsRemoved(e,t,n,i,r){this.collectedLeaveElements.push(t),t[$]={namespaceId:e,setForRemoval:i,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,n,i,r){return Be(t)?this._fetchNamespace(e).listen(t,n,i,r):()=>{}}_buildInstruction(e,t,n,i,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,i,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,je,!0);t.forEach(n=>this.destroyActiveAnimationsForElement(n)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,ft,!0),t.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return ee(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[$];if(t&&t.setForRemoval){if(e[$]=is,t.namespaceId){this.destroyInnerAnimations(e);let n=this._fetchNamespace(t.namespaceId);n&&n.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(ut)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Fi,!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,i)=>this._balanceNamespaceList(n,i)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nn()),this._flushFns=[],this._whenQuietFns.length){let n=this._whenQuietFns;this._whenQuietFns=[],t.length?ee(t).onDone(()=>{n.forEach(i=>i())}):n.forEach(i=>i())}}reportError(e){throw Ys(e)}_flushAnimations(e,t){let n=new be,i=[],r=new Map,o=[],a=new Map,l=new Map,c=new Map,h=new Set;this.disabledNodes.forEach(d=>{h.add(d);let f=this.driver.query(d,Ci,!0);for(let p=0;p{let p=Xn+g++;m.set(f,p),d.forEach(E=>L(E,p))});let T=[],w=new Set,A=new Set;for(let d=0;dw.add(E)):A.add(f))}let N=new Map,P=Hn(S,Array.from(w));P.forEach((d,f)=>{let p=mt+g++;N.set(f,p),d.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((d,f)=>{let p=m.get(f);d.forEach(E=>ye(E,p))}),P.forEach((d,f)=>{let p=N.get(f);d.forEach(E=>ye(E,p))}),T.forEach(d=>{this.processLeaveNode(d)})});let de=[],B=[];for(let d=this._namespaceList.length-1;d>=0;d--)this._namespaceList[d].drainQueuedTransitions(t).forEach(p=>{let E=p.player,M=p.element;if(de.push(E),this.collectedEnterElements.length){let D=M[$];if(D&&D.setForMove){if(D.previousTriggersValues&&D.previousTriggersValues.has(p.triggerName)){let se=D.previousTriggersValues.get(p.triggerName),I=this.statesByElement.get(p.element);if(I&&I.has(p.triggerName)){let Me=I.get(p.triggerName);Me.value=se,I.set(p.triggerName,Me)}}E.destroy();return}}let K=!u||!this.driver.containsElement(u,M),R=N.get(M),x=m.get(M),b=this._buildInstruction(p,n,x,R,K);if(b.errors&&b.errors.length){B.push(b);return}if(K){E.onStart(()=>ce(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}if(p.isFallbackTransition){E.onStart(()=>ce(M,b.fromStyles)),E.onDestroy(()=>V(M,b.toStyles)),i.push(E);return}let zt=[];b.timelines.forEach(D=>{D.stretchStartingKeyframe=!0,this.disabledNodes.has(D.element)||zt.push(D)}),b.timelines=zt,n.append(M,b.timelines);let ys={instruction:b,player:E,element:M};o.push(ys),b.queriedElements.forEach(D=>O(a,D,[]).push(E)),b.preStyleProps.forEach((D,se)=>{if(D.size){let I=l.get(se);I||l.set(se,I=new Set),D.forEach((Me,tt)=>I.add(tt))}}),b.postStyleProps.forEach((D,se)=>{let I=c.get(se);I||c.set(se,I=new Set),D.forEach((Me,tt)=>I.add(tt))})});if(B.length){let d=[];B.forEach(f=>{d.push(Xs(f.triggerName,f.errors))}),de.forEach(f=>f.destroy()),this.reportError(d)}let C=new Map,F=new Map;o.forEach(d=>{let f=d.element;n.has(f)&&(F.set(f,f),this._beforeAnimationBuild(d.player.namespaceId,d.instruction,C))}),i.forEach(d=>{let f=d.element;this._getPreviousPlayers(f,!1,d.namespaceId,d.triggerName,null).forEach(E=>{O(C,f,[]).push(E),E.destroy()})});let te=T.filter(d=>Gn(d,l,c)),me=new Map;Vn(me,this.driver,A,c,Q).forEach(d=>{Gn(d,l,c)&&te.push(d)});let ne=new Map;y.forEach((d,f)=>{Vn(ne,this.driver,new Set(d),l,Ie)}),te.forEach(d=>{let f=me.get(d),p=ne.get(d);me.set(d,new Map([...f?.entries()??[],...p?.entries()??[]]))});let et=[],Lt=[],$t={};o.forEach(d=>{let{element:f,player:p,instruction:E}=d;if(n.has(f)){if(h.has(f)){p.onDestroy(()=>V(f,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),i.push(p);return}let M=$t;if(F.size>1){let R=f,x=[];for(;R=R.parentNode;){let b=F.get(R);if(b){M=b;break}x.push(R)}x.forEach(b=>F.set(b,M))}let K=this._buildAnimation(p.namespaceId,E,C,r,ne,me);if(p.setRealPlayer(K),M===$t)et.push(p);else{let R=this.playersByElement.get(M);R&&R.length&&(p.parentPlayer=ee(R)),i.push(p)}}else ce(f,E.fromStyles),p.onDestroy(()=>V(f,E.toStyles)),Lt.push(p),h.has(f)&&i.push(p)}),Lt.forEach(d=>{let f=r.get(d.element);if(f&&f.length){let p=ee(f);d.setRealPlayer(p)}}),i.forEach(d=>{d.parentPlayer?d.syncPlayerEvents(d.parentPlayer):d.destroy()});for(let d=0;d!K.destroyed);M.length?Bi(this,f,M):this.processLeaveNode(f)}return T.length=0,et.forEach(d=>{this.players.push(d),d.onDone(()=>{d.destroy();let f=this.players.indexOf(d);this.players.splice(f,1)}),d.play()}),et}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,n,i,r){let o=[];if(t){let a=this.playersByQueriedElement.get(e);a&&(o=a)}else{let a=this.playersByElement.get(e);if(a){let l=!r||r==ve;a.forEach(c=>{c.queued||!l&&c.triggerName!=i||o.push(c)})}}return(n||i)&&(o=o.filter(a=>!(n&&n!=a.namespaceId||i&&i!=a.triggerName))),o}_beforeAnimationBuild(e,t,n){let i=t.triggerName,r=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:i;for(let l of t.timelines){let c=l.element,h=c!==r,u=O(n,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let m=y.getRealPlayer();m.beforeDestroy&&m.beforeDestroy(),y.destroy(),u.push(y)})}ce(r,t.fromStyles)}_buildAnimation(e,t,n,i,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,S=t.timelines.map(m=>{let g=m.element;h.add(g);let T=g[$];if(T&&T.removedBeforeQueried)return new Z(m.duration,m.delay);let w=g!==l,A=Ki((n.get(g)||Oi).map(C=>C.getRealPlayer())).filter(C=>{let F=C;return F.element?F.element===g:!1}),N=r.get(g),P=o.get(g),de=xn(this._normalizer,m.keyframes,N,P),B=this._buildPlayer(m,de,A);if(m.subTimeline&&i&&u.add(g),w){let C=new Ae(e,a,g);C.setRealPlayer(B),c.push(C)}return B});c.forEach(m=>{O(this.playersByQueriedElement,m.element,[]).push(m),m.onDone(()=>Li(this.playersByQueriedElement,m.element,m))}),h.forEach(m=>L(m,$n));let y=ee(S);return y.onDestroy(()=>{h.forEach(m=>ye(m,$n)),V(l,t.toStyles)}),u.forEach(m=>{O(i,m,[]).push(y)}),y}_buildPlayer(e,t,n){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new Z(e.duration,e.delay)}},Ae=class{namespaceId;triggerName;element;_player=new Z;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,t,n){this.namespaceId=e,this.triggerName=t,this.element=n}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,n)=>{t.forEach(i=>Dt(e,n,void 0,i))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){let t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){O(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){let t=this._player;t.triggerCallback&&t.triggerCallback(e)}};function Li(s,e,t){let n=s.get(e);if(n){if(n.length){let i=n.indexOf(t);n.splice(i,1)}n.length==0&&s.delete(e)}return n}function $i(s){return s??null}function Be(s){return s&&s.nodeType===1}function zi(s){return s=="start"||s=="done"}function Qn(s,e){let t=s.style.display;return s.style.display=e??"none",t}function Vn(s,e,t,n,i){let r=[];t.forEach(l=>r.push(Qn(l)));let o=[];n.forEach((l,c)=>{let h=new Map;l.forEach(u=>{let S=e.computeStyle(c,u,i);h.set(u,S),(!S||S.length==0)&&(c[$]=Ii,o.push(c))}),s.set(c,h)});let a=0;return t.forEach(l=>Qn(l,r[a++])),o}function Hn(s,e){let t=new Map;if(s.forEach(a=>t.set(a,[])),e.length==0)return t;let n=1,i=new Set(e),r=new Map;function o(a){if(!a)return n;let l=r.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:i.has(c)?l=n:l=o(c),r.set(a,l),l}return e.forEach(a=>{let l=o(a);l!==n&&t.get(l).push(a)}),t}function L(s,e){s.classList?.add(e)}function ye(s,e){s.classList?.remove(e)}function Bi(s,e,t){ee(t).onDone(()=>s.processLeaveNode(e))}function Ki(s){let e=[];return rs(s,e),e}function rs(s,e){for(let t=0;ti.add(r)):e.set(s,n),t.delete(s),!0}var _e=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,n){this._driver=t,this._normalizer=n,this._transitionEngine=new Mt(e.body,t,n),this._timelineEngine=new wt(e.body,t,n),this._transitionEngine.onRemovalComplete=(i,r)=>this.onRemovalComplete(i,r)}registerTrigger(e,t,n,i,r){let o=e+"-"+i,a=this._triggerCache[o];if(!a){let l=[],c=[],h=ts(this._driver,r,l,c);if(l.length)throw js(i,l);c.length&&void 0,a=Pi(i,h,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,i,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,n,i){this._transitionEngine.insertNode(e,t,n,i)}onRemove(e,t,n){this._transitionEngine.removeNode(e,t,n)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,n,i){if(n.charAt(0)=="@"){let[r,o]=In(n),a=i;this._timelineEngine.command(r,t,o,a)}else this._transitionEngine.trigger(e,t,n,i)}listen(e,t,n,i,r){if(n.charAt(0)=="@"){let[o,a]=In(n);return this._timelineEngine.listen(o,t,a,r)}return this._transitionEngine.listen(e,t,n,i,r)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}};function qi(s,e){let t=null,n=null;return Array.isArray(e)&&e.length?(t=dt(e[0]),e.length>1&&(n=dt(e[e.length-1]))):e instanceof Map&&(t=dt(e)),t||n?new Ui(s,t,n):null}var Ui=(()=>{class s{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(t,n,i){this._element=t,this._startStyles=n,this._endStyles=i;let r=s.initialStylesByElement.get(t);r||s.initialStylesByElement.set(t,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&V(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(V(this._element,this._initialStyles),this._endStyles&&(V(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(s.initialStylesByElement.delete(this._element),this._startStyles&&(ce(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(ce(this._element,this._endStyles),this._endStyles=null),V(this._element,this._initialStyles),this._state=3)}}return s})();function dt(s){let e=null;return s.forEach((t,n)=>{Qi(n)&&(e=e||new Map,e.set(n,t))}),e}function Qi(s){return s==="display"||s==="position"}var xe=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,t,n,i){this.element=e,this.keyframes=t,this.options=n,this._specialStyles=i,this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let t=()=>this._onFinish();this.domPlayer.addEventListener("finish",t),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",t)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){let t=[];return e.forEach(n=>{t.push(Object.fromEntries(n))}),t}_triggerWebAnimation(e,t,n){return e.animate(this._convertKeyframesToObject(t),n)}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((n,i)=>{i!=="offset"&&e.set(i,this._finished?n:kt(this.element,i))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},We=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return Wn(e,t)}getParentElement(e){return Ct(e)}query(e,t,n){return Jn(e,t,n)}computeStyle(e,t,n){return kt(e,t)}animate(e,t,n,i,r,o=[]){let a=i==0?"both":"forwards",l={duration:n,delay:i,fill:a};r&&(l.easing=r);let c=new Map,h=o.filter(y=>y instanceof xe);ci(n,i)&&h.forEach(y=>{y.currentSnapshot.forEach((m,g)=>c.set(g,m))});let u=oi(t).map(y=>new Map(y));u=ui(e,u,c);let S=qi(e,u);return new xe(e,u,l,S)}};var Ke="@",os="@.disabled",Je=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,t,n,i){this.namespaceId=e,this.delegate=t,this.engine=n,this._onDestroy=i}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,n,i=!0){this.delegate.insertBefore(e,t,n),this.engine.onInsert(this.namespaceId,t,e,i)}removeChild(e,t,n){this.parentNode(t)&&this.engine.onRemove(this.namespaceId,t,this.delegate)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,n,i){this.delegate.setAttribute(e,t,n,i)}removeAttribute(e,t,n){this.delegate.removeAttribute(e,t,n)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,n,i){this.delegate.setStyle(e,t,n,i)}removeStyle(e,t,n){this.delegate.removeStyle(e,t,n)}setProperty(e,t,n){t.charAt(0)==Ke&&t==os?this.disableAnimations(e,!!n):this.delegate.setProperty(e,t,n)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,n){return this.delegate.listen(e,t,n)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},Pt=class extends Je{factory;constructor(e,t,n,i,r){super(t,n,i,r),this.factory=e,this.namespaceId=t}setProperty(e,t,n){t.charAt(0)==Ke?t.charAt(1)=="."&&t==os?(n=n===void 0?!0:!!n,this.disableAnimations(e,n)):this.engine.process(this.namespaceId,e,t.slice(1),n):this.delegate.setProperty(e,t,n)}listen(e,t,n){if(t.charAt(0)==Ke){let i=Vi(e),r=t.slice(1),o="";return r.charAt(0)!=Ke&&([r,o]=Hi(r)),this.engine.listen(this.namespaceId,i,r,o,a=>{let l=a._data||-1;this.factory.scheduleListenerCallback(l,n,a)})}return this.delegate.listen(e,t,n)}};function Vi(s){switch(s){case"body":return document.body;case"document":return document;case"window":return window;default:return s}}function Hi(s){let e=s.indexOf("."),t=s.substring(0,e),n=s.slice(e+1);return[t,n]}var Ye=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,t,n){this.delegate=e,this.engine=t,this._zone=n,t.onRemovalComplete=(i,r)=>{r?.removeChild(null,i)}}createRenderer(e,t){let n="",i=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let c=this._rendererCache,h=c.get(i);if(!h){let u=()=>c.delete(i);h=new Je(n,i,this.engine,u),c.set(i,h)}return h}let r=t.id,o=t.id+"-"+this._currentId;this._currentId++,this.engine.register(o,e);let a=c=>{Array.isArray(c)?c.forEach(a):this.engine.registerTrigger(r,o,e,c.name,c)};return t.data.animation.forEach(a),new Pt(this,o,i,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,n){if(e>=0&&et(n));return}let i=this._animationCallbacksBuffer;i.length==0&&queueMicrotask(()=>{this._zone.run(()=>{i.forEach(r=>{let[o,a]=r;o(a)}),this._animationCallbacksBuffer=[]})}),i.push([t,n])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}};var xi=(()=>{class s extends _e{constructor(t,n,i){super(t,n,i)}ngOnDestroy(){this.flush()}static \u0275fac=function(n){return new(n||s)(j(nn),j(ue),j(he))};static \u0275prov=W({token:s,factory:s.\u0275fac})}return s})();function Wi(){return new Ue}function Ji(s,e,t){return new Ye(s,e,t)}var as=[{provide:he,useFactory:Wi},{provide:_e,useClass:xi},{provide:Gt,useFactory:Ji,deps:[cn,_e,De]}],Yi=[{provide:ue,useFactory:()=>new We},{provide:nt,useValue:"BrowserAnimations"},...as],kr=[{provide:ue,useClass:Ft},{provide:nt,useValue:"NoopAnimations"},...as];function ls(){return Ht("NgEagerAnimations"),[...Yi]}var Xe=class{http;prefix;suffix;constructor(e,t="/assets/i18n/",n=".json"){this.http=e,this.prefix=t,this.suffix=n}getTranslation(e){return this.http.get(`${this.prefix}${e}${this.suffix}`)}};function Xi(s,e){if(s&1&&(U(0,"li")(1,"h2")(2,"a",1),re(3),fe(4,"translate"),Y()()()),s&2){let t,n=e.$implicit;q(2),Ne("routerLink","/"+n.path),q(),Re(" ",pe(4,2,((t=n.name)!==null&&t!==void 0?t:n.path)+".title")," ")}}var cs=(()=>{class s{constructor(){this.sections=[{path:"dashboard"},{path:"presence-control"},{path:"open-absences"},{path:"edit-absences"},{path:"evaluate-absences"},{path:"events"},{path:"events/current",name:"events.current"},{path:"my-absences"},{path:"my-profile"},{path:"my-grades"},{path:"my-settings"}]}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-home"]],decls:3,vars:0,consts:[[1,"mt-3"],[3,"routerLink"]],template:function(n,i){n&1&&(U(0,"ul",0),Ce(1,Xi,5,4,"li",null,Yt),Y()),n&2&&(q(),Fe(i.sections))},dependencies:[dn,Oe],encapsulation:2,changeDetection:0})}}return s})();var us=(()=>{class s{constructor(){}static{this.\u0275fac=function(n){return new(n||s)}}static{this.\u0275cmp=J({type:s,selectors:[["bkd-unauthenticated"]],decls:4,vars:3,consts:[[1,"bkd-container"],[1,"alert","alert-danger","my-3"]],template:function(n,i){n&1&&(U(0,"div",0)(1,"div",1),re(2),fe(3,"translate"),Y()()),n&2&&(q(2),Re(" ",pe(3,1,"unauthenticated.message")," "))},dependencies:[Oe],encapsulation:2})}}return s})();var Ze=(()=>{class s{constructor(t){this.storage=t}get isAuthenticated(){return!!this.accessToken}get accessToken(){return this.storage.getAccessToken()}static{this.\u0275fac=function(n){return new(n||s)(j(Tn))}}static{this.\u0275prov=W({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();function z(){return()=>{let s=H(Ze),e=H(ke);return s.isAuthenticated?!0:(e.navigate(["/unauthenticated"]),!1)}}var hs=[{path:"dashboard",canActivate:[z()],loadChildren:()=>import("./chunk-2B4VW3HX.js").then(s=>s.DASHBOARD_ROUTES)},{path:"presence-control",canActivate:[z()],loadChildren:()=>import("./chunk-GQNMRCRW.js").then(s=>s.PRESENCE_CONTROL_ROUTES)},{path:"open-absences",canActivate:[z()],loadChildren:()=>import("./chunk-2EI6QWJT.js").then(s=>s.OPEN_ABSENCES_ROUTES)},{path:"edit-absences",canActivate:[z()],loadChildren:()=>import("./chunk-A7BPIB5B.js").then(s=>s.EDIT_ABSENCES_ROUTES)},{path:"evaluate-absences",canActivate:[z()],loadChildren:()=>import("./chunk-P3FNPE6I.js").then(s=>s.EVALUATE_ABSENCES_ROUTES)},{path:"events",canActivate:[z()],loadChildren:()=>import("./chunk-UNXP5O74.js").then(s=>s.EVENTS_ROUTES)},{path:"my-absences",canActivate:[z()],loadChildren:()=>import("./chunk-7Q4JYW24.js").then(s=>s.MY_ABSENCES_ROUTES)},{path:"my-profile",canActivate:[z()],loadChildren:()=>import("./chunk-2QM4IFNS.js").then(s=>s.MY_PROFILE_ROUTES)},{path:"my-grades",canActivate:[z()],loadChildren:()=>import("./chunk-EMYBIMWP.js").then(s=>s.MY_GRADES_ROUTES)},{path:"my-settings",canActivate:[z()],loadChildren:()=>import("./chunk-B47FYJ6R.js").then(s=>s.MY_SETTINGS_ROUTES)},{path:"unauthenticated",component:us},{path:"",component:cs,pathMatch:"full"}];function ds(){return(s,e)=>{let t=H(Ze),n=H(X);if(s.url.startsWith(n.apiUrl)&&t.accessToken){let i=s.headers.set("Authorization",`Bearer ${t.accessToken}`);return e(s.clone({headers:i}))}return e(s)}}function ms(){return(s,e)=>{let t=H(X);if(!s.headers.has("X-Role-Restriction")&&t.headerRoleRestriction){let n=Zi();if(n&&t.headerRoleRestriction[n]){let i=s.headers.set("X-Role-Restriction",t.headerRoleRestriction[n]);return e(s.clone({headers:i}))}}return e(s)}}function Zi(){let s=H(ke),e=s.url?An(s.url):null;return e?yn(e):null}function fs(){return[{provide:Vt,useClass:er}]}var er=(()=>{class s{constructor(t,n,i){this.ngZone=t,this.translate=n,this.toastService=i}handleError(t){console.error(String(t)),t instanceof rn||this.notifyError()}notifyError(){this.ngZone.run(()=>{this.toastService.error(this.translate.instant("global.app-errors.exception-message"),this.translate.instant("global.app-errors.exception-title"))})}static{this.\u0275fac=function(n){return new(n||s)(j(De),j(En),j(ge))}}static{this.\u0275prov=W({token:s,factory:s.\u0275fac})}}return s})();function tr(s,e){return new Xe(s,`${e.scriptsAndAssetsPath}/assets/locales/`,".json")}var ps={providers:[mn(hs,fn()),an(ln([Mn(),ds(),ms()])),ls(),fs(),vn({loader:{provide:Sn,useFactory:tr,deps:[on,X]}}),bn()]};var gs={production:!0};gs.production&&void 0;rt(Pn);rt(Dn);un(Rn,ps).catch(s=>console.error(s));