1import{a as z,b as W}from"./chunk-FSPLBFPO.js";import{a as V}from"./chunk-RKWCVQ5O.js";import{b as K,g as $}from"./chunk-J7O77OTW.js";import"./chunk-JAMIBOER.js";import"./chunk-QK6IUVKJ.js";import"./chunk-LILYNYRY.js";import"./chunk-NUAKQNHL.js";import"./chunk-O45G375V.js";import"./chunk-7NHQJQ3F.js";import"./chunk-NOC3MZFU.js";import"./chunk-3THXTNAZ.js";import"./chunk-3KDSEBHL.js";import{a as H}from"./chunk-GHNA73VC.js";import"./chunk-SQ37JYJT.js";import"./chunk-V6VAXNRW.js";import{l as G}from"./chunk-LNPJLEEG.js";import"./chunk-RE7V4DI7.js";import{a as q}from"./chunk-VEZOP25Z.js";import{i as b}from"./chunk-AN3OHQC6.js";import{b as U}from"./chunk-T6GBLIDK.js";import"./chunk-2RC67WCD.js";import"./chunk-DURRPHZN.js";import"./chunk-AADXCDDQ.js";import"./chunk-EHTOC24S.js";import{f as L}from"./chunk-FB7FS64X.js";import{i as R,j as Y}from"./chunk-VKBALEK7.js";import"./chunk-UPEYVTOD.js";import"./chunk-L52YFI7W.js";import"./chunk-2Y4RSYZ3.js";import"./chunk-6KZPU7I5.js";import"./chunk-E52KUUD2.js";import{a as j}from"./chunk-GFTBXMUA.js";import"./chunk-LN2US5MX.js";import"./chunk-TNG2U3NN.js";import{Ca as P,ia as D,xa as F}from"./chunk-MYTHGJJN.js";import"./chunk-ZA6XVE2D.js";import{Ja as p,Ka as g,Pa as S,Q as M,Qa as c,R as O,Ra as m,Rc as E,Sa as v,Z as T,_ as N,ab as w,dc as A,eb as k,jb as y,lb as h,na as u,sa as a,va as _}from"./chunk-GIDQBKS2.js";import"./chunk-GNS2YLOT.js";import{a as x,b as I,g as f}from"./chunk-GJ6UDTAD.js";function te(n,C){if(n&1){let e=w();c(0,"custom-select",1),y("onChoiceChanged",function(t){M(e);let r=h();return O(r.changeLevel(t));}),m();}if(n&2){let e=h();S("choices",e.levelChoices)("defaultSelected",e.selectedFilters.levelId)("placeholder",null);}}function ie(n,C){if(n&1){let e=w();c(0,"custom-select",1),y("onChoiceChanged",function(t){M(e);let r=h();return O(r.changeCourse(t));}),m();}if(n&2){let e=h();S("choices",e.coursesChoices)("defaultSelected",e.selectedFilters.courseId)("placeholder",null);}}var B=(()=>{class n{constructor(e,i,t,r,l){this.kartableDocumentService=e,this.studentProfileService=i,this.levelHasCourseService=t,this.schoolYearService=r,this.courseService=l,this.searchParams=this.kartableDocumentService.getSearchParams(),this.selectedFilters={levelId:this.searchParams().levelId??null,courseId:this.searchParams().courseId??null};}ngOnInit(){Promise.all([this.studentProfileService.getFilteredLevels(),this.studentProfileService.getUserStudentProfiles()]).then(e=>f(this,null,function*(){let i=e[0],t=e[1];t.length===0?this.levels=i:this.levels=i.filter(r=>{let l=t.filter(o=>o.level.curriculumOrder===r.curriculumOrder);return l.length===0||l.find(o=>o.level.id===r.id);}),this.levelChoices=this.mapToCustomSelectChoice(this.levels,"Tous les niveaux"),yield this.setCourses(this.selectedFilters?.levelId);}));}changeLevel(e){return f(this,null,function*(){let i=this.kartableDocumentService.getSearchParams(),t=yield this.schoolYearService.getCurrentSchoolYear(),r=I(x({},i()),{levelId:e??null,page:1,schoolYearId:t.id});this.kartableDocumentService.setSearchParams(r),yield this.setCourses(e);});}changeCourse(e){let i=this.kartableDocumentService.getSearchParams(),t=I(x({},i()),{courseId:e??null,page:1});this.kartableDocumentService.setSearchParams(t);}setCourses(e){return f(this,null,function*(){if(e){let t=yield this.schoolYearService.getCurrentSchoolYear(),r=this.levels.find(l=>l.id===Number(e));this.courses=yield this.levelHasCourseService.getCoursesByLevel(t,r);}else this.courses=yield this.courseService.getAllCourses();this.coursesChoices=this.mapToCustomSelectChoice(this.courses,"Toutes les mati\xE8res");let i=this.kartableDocumentService.getSearchParams();i()?.courseId&&!this.courses.some(t=>t.id===i()?.courseId)&&this.changeCourse();});}mapToCustomSelectChoice(e,i){let t=[];return t.push({id:null,value:void 0,label:i}),e.forEach(r=>{t.push({id:r.id,value:r.id,label:r.fullLabel});}),t;}static{this.ɵfac=function(i){return new(i||n)(a(b),a(Y),a(q),a(R),a(U));};}static{this.ɵcmp=_({type:n,selectors:[["search-filters"]],decls:2,vars:2,consts:[[3,"choices","defaultSelected","placeholder"],[3,"onChoiceChanged","choices","defaultSelected","placeholder"]],template:function(i,t){i&1&&(p(0,te,1,3,"custom-select",0),p(1,ie,1,3,"custom-select",0)),i&2&&(g(t.levelChoices!=null&&t.levelChoices.length?0:-1),u(),g(t.coursesChoices!=null&&t.coursesChoices.length?1:-1));},dependencies:[P,F],styles:["[_nghost-%COMP%]{margin-bottom:16px}@media screen and (min-width:760px){[_nghost-%COMP%]{display:-webkit- flex;display:flex;flex-direction:row;gap:16px}}.search-form-container[_ngcontent-%COMP%]{max-width:600px}@media screen and (min-width:760px){custom-select[_ngcontent-%COMP%]{flex:0 1 50%}}custom-select[_ngcontent-%COMP%]:first-of-type{margin-bottom:16px}@media screen and (min-width:760px){custom-select[_ngcontent-%COMP%]:first-of-type{margin-bottom:0}}"]});}}return n;})();function ne(n,C){n&1&&(c(0,"kartable-sidebar"),v(1,"kartable-navigation-menu",9),m()),n&2&&(u(),S("activeMenuItem","search"));}function re(n,C){if(n&1&&v(0,"kartable-nav-bar",2),n&2){let e=h();S("currentUser",e.currentUser)("activeTab","search");}}function oe(n,C){n&1&&(c(0,"div",8),v(1,"kartable-loader"),m());}var Te=(()=>{class n{constructor(e,i,t,r,l){this.activatedRoute=e,this.kartableDocumentService=i,this.route=t,this.domStateService=r,this.location=l,this.isSearching=T(!1),this.screenWidthSignal=this.domStateService.getWidthSignal();let o=K(this.route.queryParams)(),X={query:o?.query?o.query:null,levelId:o?.levelId?Number(o.levelId):null,courseId:o?.courseId?Number(o.courseId):null,
1schoolYearId:o?.schoolYearId?Number(o.schoolYearId):null,page:o?.page?Number(o.page):null},J=L(X);this.kartableDocumentService.setSearchParams(J),this.isSearching=this.kartableDocumentService.isSearchingDocuments(),N(()=>{let s=this.kartableDocumentService.getSearchParams()(),d=new URLSearchParams();s.query&&d.set("query",s.query),s.page&&d.set("page",s.page.toString()),s.levelId&&d.set("levelId",s.levelId.toString()),s.courseId&&d.set("courseId",s.courseId.toString()),s.schoolYearId&&d.set("schoolYearId",s.schoolYearId.toString());let Q=this.location.path().split("?")[0];this.location.replaceState(Q,d.toString());});}ngOnInit(){this.activatedRoute.data.subscribe(({currentUser:e})=>{this.currentUser=e;});}static{this.ɵfac=function(i){return new(i||n)(a(E),a(b),a(E),a(j),a(A));};}static{this.ɵcmp=_({type:n,selectors:[["search-page"]],hostAttrs:["data-is-themable",""],decls:12,vars:2,consts:()=>{let e;return e="Recherche",[e,[1,"navigation-wrapper"],[3,"currentUser","activeTab"],[1,"navigation__main","page--app","search-container"],[1,"h2","u-mb-2"],[1,"search-form-container"],[1,"u-mb-2","u-block"],[1,"search-results-container"],[1,"loader-container"],[3,"activeMenuItem"]];},template:function(i,t){i&1&&(c(0,"div",1),p(1,ne,2,1,"kartable-sidebar")(2,re,1,2,"kartable-nav-bar",2),c(3,"div",3)(4,"h1",4),k(5,0),m(),c(6,"div",5),v(7,"search-form",6)(8,"search-filters"),c(9,"div",7),p(10,oe,2,0,"div",8),v(11,"search-result-list"),m()()()()),i&2&&(u(),g(t.screenWidthSignal()>760?1:2),u(9),g(t.isSearching()?10:-1));},dependencies:[P,D,G,z,W,B,$,V,H],styles:[".search-container[_ngcontent-%COMP%]{height:calc(100vh - 88px)}@media screen and (min-width:760px){.search-container[_ngcontent-%COMP%]{height:auto}}.search-form-container[_ngcontent-%COMP%]{max-width:600px}.search-results-container[_ngcontent-%COMP%]{position:relative}.loader-container[_ngcontent-%COMP%]{position:absolute;height:100%;width:100%;top:0;left:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(var(--backgroundColorRgb),.8);z-index:10;min-height:100px;border-radius:8px}","@media screen and (min-width:760px){.navigation-wrapper[_ngcontent-%COMP%]{min-height:100%;display:-webkit- flex;display:flex;flex-direction:row}}.navigation__main[_ngcontent-%COMP%]{padding-top:0}@media screen and (min-width:760px){.navigation__main[_ngcontent-%COMP%]{padding-bottom:0;flex-grow:1;position:relative;z-index:1}}.dashboardK2-container[_ngcontent-%COMP%], .live-container[_ngcontent-%COMP%], .search-container[_ngcontent-%COMP%]{padding:16px 16px calc(72px + env(safe-area-inset-bottom)) 16px}@media screen and (min-width:760px){.dashboardK2-container[_ngcontent-%COMP%], .live-container[_ngcontent-%COMP%], .search-container[_ngcontent-%COMP%]{padding:32px}}"]});}}return n;})();export{Te as SearchPageComponent};/**i18n:44cf96fd07078b73af38b8a9f6c2f9a21ef0c0d4f8c1931c662293dc8e99f2f3*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.