PageSourceSearch

https://www.ikointl.com/1112.81c57dfb0b482010.js

js ikointl.com collected 2026-09-24 19:37:08 UTC 157,817 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkiko=self.webpackChunkiko||[]).push([[1112],{61112:(Qo,W,l)=>{l.r(W),l.d(W,{SchoolProfileModule:()=>Ho});var f=l(65056),R=l(24424),Oe=l(33464),z=l(17976),Te=l(54088),Y=l(61616),Re=l(6560),I=l(94364),N=l(78600),e=l(34896),Z=l(42004),Ie=l(93796),C=l(5892),c=l(71904),Ge=l(44480),Ye=l(76940),d=l(72584),ee=l(80592),Ee=l(16089),Me=l(3472),te=l(7936),_=l(13492),E=l(16124),$=l(30624),M=l(13384),De=l(57384),A=l(10211),p=l(1296),v=l(40604),y=l(51672),m=function(i){return i.Valid="valid",i.Invalid="invalid",i.Handled="handled",i}(m||{}),Fe=l(93504),S=l(7340),q=l(2292),ie=l(35420),$e=l(37496);let Ae=(()=>{class i{validate(){return m.Valid}getData(){return{}}save(){return(0,p.of)(!0)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-affiliation-completed"]],standalone:!0,features:[e.UHJ],decls:6,vars:0,consts:[[1,"affiliation-completed","d-flex","flex-column","align-items-center","justify-content-center","text-center","p-4"],["src","assets/images/affiliation_form_complete.png","alt","School affiliation submitted",1,"affiliation-completed__image","mb-4"],["translate","",1,"fw-bold","text-primary","mb-3"],["translate","",1,"text-grey","affiliation-completed__message","m-0"]],template:function(n,o){1&n&&(e.I0R(0,"div",0),e.wR5(1,"img",1),e.I0R(2,"h2",2),e.OEk(3,"Thank you for submitting your school!"),e.C$Y(),e.I0R(4,"p",3),e.OEk(5," Our team will review your affiliation application and get back to you shortly. "),e.C$Y()())},dependencies:[d.O0,d.eM],styles:[".affiliation-completed[_ngcontent-%COMP%]{min-height:60vh}.affiliation-completed__image[_ngcontent-%COMP%]{width:320px;max-width:70%;height:auto}.affiliation-completed__message[_ngcontent-%COMP%]{max-width:480px}"]})}}return i})();var O=l(10716);const Pe=(i,s)=>s.tid;function Le(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",3)(1,"div",4)(2,"label",5)(3,"input",6),e.qCj("change",function(){const r=e.usT(t).$implicit,a=e.GaO();return e.CGJ(a.toggleBrand(r.tid))}),e.C$Y(),e.OEk(4),e.wR5(5,"span",7),e.C$Y()()()}if(2&i){const t=s.$implicit,n=e.GaO();e.yG2(3),e.E7m("checked",n.isBrandSelected(t.tid)),e.yG2(),e.oRS(" ",t.name," ")}}function Ue(i,s){1&i&&(e.I0R(0,"div",8),e.OEk(1,"Loading brands\u2026"),e.C$Y())}const Be=i=>({"pb-3 px-3 max-width-body mx-auto mt-lg-2":i});let Ve=(()=>{class i{constructor(){this.inlineField=(0,e.YhN)(!1),this.brands=(0,e.OCB)([]),this.selectedTids=(0,e.OCB)([]),this.authSessionService=(0,e.uUt)(S.i),this.contentService=(0,e.uUt)(C.eu),this.viewService=(0,e.uUt)(C._M);const t=(this.authSessionService.currentSchool()?.field_school_brands??[]).map(n=>+n.id);this.selectedTids.set(t),this.viewService.get("/api/v1/terms/kb_brands.json").subscribe(n=>{n.forEach(o=>{o.tid=+o.tid}),this.brands.set(n)})}validate(){return m.Valid}getData(){return{selectedTids:this.selectedTids()}}setData(t){t?.selectedTids&&this.selectedTids.set(t.selectedTids)}save(){return this.contentService.update(+(this.authSessionService.currentUserProfile?.school).id,{type:"school",field_school_brands:this.selectedTids()}).pipe((0,v.k)(()=>!0))}toggleBrand(t){const n=this.selectedTids();n.includes(t)?this.selectedTids.set(n.filter(o=>o!==t)):this.selectedTids.set([...n,t])}isBrandSelected(t){return this.selectedTids().includes(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-brands"]],inputs:{inlineField:[e.Wk5.SignalBased,"inlineField"]},standalone:!0,features:[e.UHJ],decls:7,vars:4,consts:[[3,"ngClass"],["translate",""],[1,"row"],[1,"col-6","col-md-4","pe-0","mb-2"],[1,"form-check"],[1,"form-check-label","pointer"],["type","checkbox",1,"form-check-input",3,"checked","change"],[1,"form-check-sign"],["translate","",1,"col-12","text-center","text-info","fs-5"],["class","col-6 col-md-4 pe-0 mb-2"],["class","col-12 text-center text-info fs-5","translate",""]],template:function(n,o){1&n&&(e.I0R(0,"div",0)(1,"label-info-point",1),e.OEk(2,"Brands"),e.C$Y(),e.I0R(3,"div",2),e.c53(4,Le,6,2,"div",9,Pe,!1,Ue,2,0,"div",10),e.C$Y()()),2&n&&(e.E7m("ngClass",e.S45(2,Be,!o.inlineField())),e.yG2(4),e.oho(o.brands()))},dependencies:[O.Y9,d.O0,d.eM,f.MD,f.QF],styles:["[_nghost-%COMP%]{display:block}"]})}}return i})();var j=l(37960),ne=l(42776);const Ne=(i,s)=>s.tid;
1function qe(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",3)(1,"div",4)(2,"label",5)(3,"input",6),e.qCj("change",function(){const r=e.usT(t).$implicit,a=e.GaO();return e.CGJ(a.toggleFacility(r.tid))}),e.C$Y(),e.OEk(4),e.wVc(5,"entitiesHtml"),e.wR5(6,"span",7),e.C$Y()()()}if(2&i){const t=s.$implicit,n=e.GaO();e.yG2(3),e.E7m("checked",n.isFacilitySelected(t.tid)),e.yG2(),e.oRS(" ",e.kDX(5,2,t.name)," ")}}function je(i,s){1&i&&(e.I0R(0,"div",8),e.OEk(1,"Loading facilities\u2026"),e.C$Y())}const He=i=>({"pb-3 px-3 max-width-body mx-auto mt-lg-2":i});let Qe=(()=>{class i{constructor(){this.inlineField=(0,e.YhN)(!1),this.facilities=(0,e.OCB)([]),this.selectedTids=(0,e.OCB)([]),this.authSessionService=(0,e.uUt)(S.i),this.contentService=(0,e.uUt)(C.eu),this.viewService=(0,e.uUt)(C._M);const t=(this.authSessionService.currentSchool()?.field_school_facilities??[]).map(n=>+n.id);this.selectedTids.set(t),this.viewService.get("/api/v1/terms/school_facilities.json").subscribe(n=>{n.forEach(o=>{o.tid=+o.tid}),this.facilities.set(n)})}validate(){return m.Valid}getData(){return{selectedTids:this.selectedTids()}}setData(t){t?.selectedTids&&this.selectedTids.set(t.selectedTids)}save(){return this.contentService.update(+(this.authSessionService.currentUserProfile?.school).id,{type:"school",field_school_facilities:this.selectedTids()}).pipe((0,v.k)(()=>!0))}toggleFacility(t){const n=this.selectedTids();n.includes(t)?this.selectedTids.set(n.filter(o=>o!==t)):this.selectedTids.set([...n,t])}isFacilitySelected(t){return this.selectedTids().includes(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-facilities"]],inputs:{inlineField:[e.Wk5.SignalBased,"inlineField"]},standalone:!0,features:[e.UHJ],decls:7,vars:4,consts:[[3,"ngClass"],["translate",""],[1,"row"],[1,"col-6","col-md-4","pe-0","mb-2"],[1,"form-check"],[1,"form-check-label","pointer"],["type","checkbox",1,"form-check-input",3,"checked","change"],[1,"form-check-sign"],["translate","",1,"col-12","text-center","text-info","fs-5"],["class","col-6 col-md-4 pe-0 mb-2"],["class","col-12 text-center text-info fs-5","translate",""]],template:function(n,o){1&n&&(e.I0R(0,"div",0)(1,"label-info-point",1),e.OEk(2,"Facilities"),e.C$Y(),e.I0R(3,"div",2),e.c53(4,qe,7,4,"div",9,Ne,!1,je,2,0,"div",10),e.C$Y()()),2&n&&(e.E7m("ngClass",e.S45(2,He,!o.inlineField())),e.yG2(4),e.oho(o.facilities()))},dependencies:[O.Y9,d.O0,d.eM,f.MD,f.QF,j.y,ne.s],styles:["[_nghost-%COMP%]{display:block}"]})}}return i})();var x=l(93072),Je=l(46356);function Xe(i,s){1&i&&(e.I0R(0,"li",7),e.OEk(1,"Logo is required"),e.C$Y())}function Ke(i,s){1&i&&(e.I0R(0,"li",7),e.OEk(1,"Center name is required"),e.C$Y())}const We=()=>({count:5});function ze(i,s){1&i&&(e.I0R(0,"li"),e.OEk(1),e.wVc(2,"translate"),e.C$Y()),2&i&&(e.yG2(),e.cNF(e.g7$(2,1,"At least 5 gallery images are required",e.q4q(4,We))))}function Ze(i,s){if(1&i&&(e.I0R(0,"div",5)(1,"div"),e.wR5(2,"i",6),e.OEk(3),e.wVc(4,"translate"),e.C$Y(),e.I0R(5,"ul"),e.yuY(6,Xe,2,0,"li",7)(7,Ke,2,0,"li",7)(8,ze,3,5,"li"),e.C$Y()()),2&i){const t=e.GaO();e.yG2(3),e.oRS(" ",e.kDX(4,4,"Please fix the errors below:"),""),e.yG2(3),e.C0Y(6,t.logo()?-1:6),e.yG2(),e.C0Y(7,t.title()?-1:7),e.yG2(),e.C0Y(8,t.galleryImages().length<5?8:-1)}}let et=(()=>{class i{constructor(){this.logo=(0,e.OCB)(""),this.galleryImages=(0,e.OCB)([]),this.title=(0,e.OCB)(""),this.showValidation=(0,e.OCB)(!1),this.saveTitleBind=this.saveTitle.bind(this),this.saveLogoBind=this.saveLogo.bind(this),this.uploadImageGalleryBind=this.uploadImageGallery.bind(this),this.saveGalleryBind=this.saveGallery.bind(this),this.notificationsService=(0,e.uUt)(E.E),this.authSessionService=(0,e.uUt)(S.i),this.contentService=(0,e.uUt)(C.eu),this.customService=(0,e.uUt)(x.kP),this.translateService=(0,e.uUt)(d.qS),this.logoToSave="";const t=this.authSessionService.currentSchool()?.field_school_gallery.map((n,o)=>(n.id=this.authSessionService.currentSchool()?.field_school_gallery_ids[o],n));this.title.set(this.authSessionService.currentSchool()?.title??""),this.logo.set(this.authSessionService.currentSchool()?.field_school_logo??""),this.galleryImages.set(t??[])}validate(){const t=!!this.logo(),n=!!this.title(),o=this.galleryImages().length>=5,r=t&&n&&o;return this.showValidation.set(!r),r?m.Valid:m.Invalid}setData(t){t&&(this.galleryImages.set(t.gallery),this.title.set(t.title),this.logo.set(t.logo),this.logoToSave=t.logoToSave)}
1getData(){return{gallery:this.galleryImages(),title:this.title(),logo:this.logo(),logoToSave:this.logoToSave}}save(){const t={field_school_gallery:this.galleryImages().map(n=>n.id),title:this.title(),type:"school"};return this.logoToSave&&(t.field_school_logo=this.logoToSave),this.contentService.update(+(this.authSessionService.currentUserProfile?.school).id,t).pipe((0,v.k)(()=>(this.authSessionService.initProfile().subscribe(),!0)))}uploadImageGallery(t){const n=this.authSessionService.currentSchoolId,o=this.customService.getFileObjectFromImgData(t.split(",")[1],`logo-${n}-${Date.now()}.jpeg`);return this.customService.uploadFile("node","school",`${n}/field_school_gallery`,o).pipe((0,v.k)(r=>({id:r.fid[0].value,url:C.So.backEndUrl+r.uri[0].url})),(0,y.a)(r=>{let a=this.translateService.instant("An error occurred while uploading the image");throw r.error.message&&(a=r.error.message.split("\n")[1].trim()??r.error.message),new Error(a)}))}saveLogo(t){const n=this.authSessionService.currentSchoolId,o=this.customService.getFileObjectFromImgData(t.split(",")[1],`logo-${n}-${Date.now()}.jpeg`),r=this.logo();return this.logo.set(t),this.showValidation()&&this.validate(),this.customService.uploadFile("node","school",`${n}/field_school_logo`,o).pipe((0,v.k)(a=>(this.logoToSave=a.fid[0].value,!0)),(0,y.a)(()=>(this.logo.set(r),this.notificationsService.notifyError(this.translateService.instant("There was an error saving the logo")),(0,p.of)(!1))))}saveGallery(t){return this.galleryImages.set(t.map(n=>({id:n.id,max_2600x2600:n.url}))),this.showValidation()&&this.validate(),(0,p.of)(!0)}saveTitle(t){return this.title.set(t),this.showValidation()&&this.validate(),(0,p.of)(!0)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-gallery"]],standalone:!0,features:[e.UHJ],decls:7,vars:13,consts:[[1,"pb-3","px-3","max-width-body","mx-auto"],[3,"logo","title","images","functionUploadImageGallery","functionSaveGallery","isEditable","needUrlOnGallery","functionSaveTitle","functionSaveLogo"],["class","invalid-feedback d-block ms-1 mt-1"],[1,"gallery-hint","mt-3","text-muted"],[1,"icon","icon-info-circle","me-1","text-info"],[1,"invalid-feedback","d-block","ms-1","mt-1"],[1,"icon","icon-exclamation-triangle","me-1"],["translate",""]],template:function(n,o){1&n&&(e.I0R(0,"div",0),e.wR5(1,"modern-header-gallery",1),e.yuY(2,Ze,9,6,"div",2),e.I0R(3,"p",3),e.wR5(4,"i",4),e.OEk(5),e.wVc(6,"translate"),e.C$Y()()),2&n&&(e.yG2(),e.E7m("logo",o.logo())("title",o.title())("images",o.galleryImages())("functionUploadImageGallery",o.uploadImageGalleryBind)("functionSaveGallery",o.saveGalleryBind)("isEditable",!0)("needUrlOnGallery",!0)("functionSaveTitle",o.saveTitleBind)("functionSaveLogo",o.saveLogoBind),e.yG2(),e.C0Y(2,o.showValidation()?2:-1),e.yG2(3),e.oRS(" ",e.kDX(6,11,"Upload logo photos that best showcase your Center and its facilities. This will be your public profile visible to kiters booking lessons. You should upload at least 5 images in the gallery.")," "))},dependencies:[Je.m,d.O0,d.sD,d.eM],styles:[".gallery-hint[_ngcontent-%COMP%]{font-size:.85rem;line-height:1.5;font-style:italic}"]})}}return i})();var P=l(53600),tt=l(63284),it=l(87604),nt=l(19236),ot=l(5220),oe=l(74576),st=l(42024),rt=l(62704),w=l(25052),L=l(9984);function at(i,s){if(1&i&&e.wR5(0,"h5",2),2&i){const t=e.GaO();e.E7m("innerHTML",t.model().label,e.E3n)}}const lt=(i,s)=>s.id;function ct(i,s){if(1&i){const t=e.KQA();e.I0R(0,"span",8),e.qCj("click",function(){e.usT(t);const o=e.GaO().$index,r=e.GaO();return e.CGJ(r.requestRemoval(o))}),e.wR5(1,"i",9),e.I0R(2,"small"),e.OEk(3),e.wVc(4,"translate"),e.C$Y()()}if(2&i){const t=e.GaO(2);let n;e.yG2(3),e.cNF(e.kDX(4,1,null!==(n=t.options().removeLabel)&&void 0!==n?n:"Remove"))}}function dt(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",10)(1,"span",11),e.OEk(2),e.wVc(3,"translate"),e.C$Y(),e.I0R(4,"span",12)(5,"button",13),e.qCj("click",function(){e.usT(t);const o=e.GaO().$index,r=e.GaO();return e.CGJ(r.removeItem(o))}),e.OEk(6),e.wVc(7,"translate"),e.C$Y(),e.I0R(8,"button",14),e.qCj("click",function(){e.usT(t);const o=e.GaO(2);return e.CGJ(o.cancelRemoval())}),e.OEk(9),e.wVc(10,"translate"),e.C$Y()()()}if(2&i){const t=e.GaO(2);let n;e.yG2(2),e.oRS(" ",e.kDX(3,3,null!==(n=t.options().removeConfirmLabel)&&void 0!==n?n:"Do you want to remove this item and all its data?")," "),e.yG2(4),e.oRS(" ",e.kDX(7,5,"Yes")," "),e.yG2(3),e.oRS(" ",e.kDX(10,7,"Cancel")," ")}}
1function mt(i,s){if(1&i&&e.wR5(0,"dynamic-ng-bootstrap-form-control",15),2&i){const t=s.$implicit,n=e.GaO().$index,o=e.GaO();let r;e.E7m("group",null==(r=o.formArray())?null:r.at(n))("model",t)("templates",o.templates())("layout",o.layout())}}function ut(i,s){if(1&i&&(e.I0R(0,"section",3)(1,"header",4)(2,"span",5),e.OEk(3),e.wVc(4,"translate"),e.C$Y(),e.yuY(5,ct,5,3,"span",6),e.C$Y(),e.yuY(6,dt,11,9,"div",7),e.c53(7,mt,1,4,"dynamic-ng-bootstrap-form-control",15,lt),e.C$Y()),2&i){const t=s.$implicit,n=s.$index,o=e.GaO();let r;e.yG2(3),e.CAO("",e.kDX(4,4,null!==(r=o.options().itemLabel)&&void 0!==r?r:"")," ",n+1,""),e.yG2(2),e.C0Y(5,o.canRemove()?5:-1),e.yG2(),e.C0Y(6,o.pendingRemoval()===n?6:-1),e.yG2(),e.oho(t.group)}}function ft(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",16),e.qCj("click",function(){e.usT(t);const o=e.GaO();return e.CGJ(o.addItem())}),e.wR5(1,"i",17),e.OEk(2),e.wVc(3,"translate"),e.C$Y()}if(2&i){const t=e.GaO();let n;e.yG2(2),e.oRS(" ",e.kDX(3,1,null!==(n=t.options().addLabel)&&void 0!==n?n:"Add")," ")}}let _t=(()=>{class i{constructor(){this.model=e.YhN.required(),this.group=e.YhN.required(),this.layout=(0,e.YhN)({}),this.templates=(0,e.YhN)(void 0),this.options=(0,e.YhN)({}),this.itemsCountChange=new e._w7,this.items=(0,e.OCB)([]),this.pendingRemoval=(0,e.OCB)(null),this.formArray=(0,e.S6b)(()=>this.group().get(this.model().id)),this.canAdd=(0,e.S6b)(()=>{const t=this.options().maxItems;return void 0===t||this.items().length<t}),this.canRemove=(0,e.S6b)(()=>this.items().length>(this.options().minItems??1)),this.dynamicFormService=(0,e.uUt)(w.Sy8),(0,e.o3l)(()=>{this.items.set([...this.model().groups]),this.pendingRemoval.set(null)},{allowSignalWrites:!0})}addItem(){const t=this.formArray();!t||!this.canAdd()||(this.dynamicFormService.addFormArrayGroup(t,this.model()),this.syncItems())}requestRemoval(t){this.pendingRemoval.set(t)}cancelRemoval(){this.pendingRemoval.set(null)}removeItem(t){const n=this.formArray();n&&this.canRemove()?(this.dynamicFormService.removeFormArrayGroup(t,n,this.model()),this.syncItems()):this.pendingRemoval.set(null)}syncItems(){this.items.set([...this.model().groups]),this.pendingRemoval.set(null),this.itemsCountChange.emit(this.items().length)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["dynamic-form-array-fields"]],inputs:{model:[e.Wk5.SignalBased,"model"],group:[e.Wk5.SignalBased,"group"],layout:[e.Wk5.SignalBased,"layout"],templates:[e.Wk5.SignalBased,"templates"],options:[e.Wk5.SignalBased,"options"]},outputs:{itemsCountChange:"itemsCountChange"},standalone:!0,features:[e.UHJ],decls:4,vars:2,consts:[["class","text-primary mb-2",3,"innerHTML"],["class","d-flex mt-1 mb-3 text-info align-items-center justify-content-center pointer"],[1,"text-primary","mb-2",3,"innerHTML"],[1,"dynamic-form-array-item","mb-3"],[1,"d-flex","align-items-center","justify-content-between","mb-2"],[1,"fw-bold","text-primary"],["class","d-flex align-items-center text-info pointer"],["class","alert alert-warning small d-flex flex-wrap align-items-center justify-content-between rounded-1 py-2"],[1,"d-flex","align-items-center","text-info","pointer",3,"click"],[1,"icon","icon-lg","icon-times-circle","me-1"],[1,"alert","alert-warning","small","d-flex","flex-wrap","align-items-center","justify-content-between","rounded-1","py-2"],[1,"me-2"],[1,"d-flex","align-items-center"],["type","button",1,"btn","btn-sm","btn-primary","me-2",3,"click"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click"],[3,"group","model","templates","layout"],[1,"d-flex","mt-1","mb-3","text-info","align-items-center","justify-content-center","pointer",3,"click"],[1,"icon-lg","icon","icon-plus-circle","me-1"],["class","dynamic-form-array-item mb-3"]],template:function(n,o){1&n&&(e.yuY(0,at,1,1,"h5",0),e.c53(1,ut,9,6,"section",18,e.oxv),e.yuY(3,ft,4,3,"div",1)),2&n&&(e.C0Y(0,o.model().label&&!o.options().hideLabel?0:-1),e.yG2(),e.oho(o.items()),e.yG2(2),e.C0Y(3,o.canAdd()?3:-1))},dependencies:[w.HkJ,L.CG,L.wn,d.O0,d.sD],styles:[".dynamic-form-array-item[_ngcontent-%COMP%] + .dynamic-form-array-item[_ngcontent-%COMP%]{border-top:2px solid var(--bs-primary);padding-top:1rem}"]})}}return i})();var pt=l(45268);const ht=["content"];function gt(i,s){1&i&&e.wR5(0,"wind-guts-loader")}const se=(i,s)=>s.id;
1function Ct(i,s){if(1&i&&(e.I0R(0,"h3",7),e.OEk(1),e.wVc(2,"translate"),e.C$Y()),2&i){const t=e.GaO(3);e.yG2(),e.cNF(e.kDX(2,1,t.title()))}}function vt(i,s){if(1&i&&(e.wR5(0,"p",8),e.wVc(1,"translate")),2&i){const t=e.GaO(3);e.E7m("innerHTML",e.kDX(1,1,t.subtitle()),e.E3n)}}function yt(i,s){if(1&i&&(e.I0R(0,"div",4),e.yuY(1,Ct,3,3,"h3",5)(2,vt,2,3,"p",6),e.C$Y()),2&i){const t=e.GaO(2);e.yG2(),e.C0Y(1,t.title()?1:-1),e.yG2(),e.C0Y(2,t.subtitle()?2:-1)}}function bt(i,s){if(1&i&&e.wR5(0,"dynamic-form-array-fields",9),2&i){const t=e.GaO(2).$implicit,n=e.GaO(2);e.E7m("model",n.asArrayModel(t))("group",n.formGroup)("layout",n.layout())("templates",n.templates)("options",n.arrayOptions(t.id))}}function St(i,s){if(1&i&&e.wR5(0,"dynamic-form-array-fields",9),2&i){const t=e.GaO().$implicit,n=e.GaO(3).$implicit,o=e.GaO(2);e.E7m("model",o.asArrayModel(t))("group",o.formGroup.get(n.id))("layout",o.layout())("templates",o.templates)("options",o.arrayOptions(t.id))}}function xt(i,s){if(1&i&&e.wR5(0,"dynamic-ng-bootstrap-form-control",10),2&i){const t=e.GaO().$implicit,n=e.GaO(3).$implicit,o=e.GaO(2);e.E7m("group",o.formGroup.get(n.id))("model",t)("templates",o.templates)("layout",o.layout())}}function wt(i,s){if(1&i&&e.yuY(0,St,1,5,"dynamic-form-array-fields",9)(1,xt,1,4),2&i){const t=s.$implicit,n=e.GaO(5);e.C0Y(0,n.isArrayModel(t)?0:1)}}function kt(i,s){if(1&i&&e.c53(0,wt,2,1,null,null,se),2&i){const t=e.GaO(2).$implicit,n=e.GaO(2);e.oho(n.asGroupModel(t).group)}}function Ot(i,s){if(1&i&&e.wR5(0,"dynamic-ng-bootstrap-form-control",10),2&i){const t=e.GaO(2).$implicit,n=e.GaO(2);e.E7m("group",n.formGroup)("model",t)("templates",n.templates)("layout",n.layout())}}function Tt(i,s){if(1&i&&e.yuY(0,bt,1,5,"dynamic-form-array-fields",9)(1,kt,2,0)(2,Ot,1,4),2&i){const t=e.GaO().$implicit,n=e.GaO(2);e.C0Y(0,n.isArrayModel(t)?0:n.isGroupModel(t)?1:2)}}function Rt(i,s){1&i&&e.yuY(0,Tt,3,1),2&i&&e.C0Y(0,"webform_id"!==s.$implicit.id?0:-1)}function It(i,s){if(1&i&&(e.yuY(0,yt,3,2,"div",1),e.wR5(1,"alert-banner",2),e.I0R(2,"div",null,3),e.c53(4,Rt,1,1,null,null,se),e.C$Y()),2&i){const t=e.GaO();e.C0Y(0,t.title()||t.subtitle()?0:-1),e.yG2(),e.E7m("banner",t.alertBanner()),e.yG2(3),e.oho(t.formModel)}}const Gt=()=>({noCropping:!0,hideBiometricGrid:!0,takePictureTitle:"Take a picture",backCamera:!0}),Yt=(i,s,t,n,o,r,a,u,h,g)=>({type:"webform",id:i,field:s,multiple:t,model:n,control:o,minResolution:r,minLength:a,maxSize:u,previousValue:h,picker:g});function Et(i,s){if(1&i&&e.wR5(0,"file-upload-picker-cropper",11),2&i){const t=s.id,n=s.parent,o=e.GaO();let r;e.E7m("config",e.gFU(2,Yt,[o.webformName,t,null==(r=o.getModel(t,n))?null:r.multiple,o.getModel(t,n),o.getControl(t,n),null==(r=o.getModel(t,n))||null==r.additional?null:r.additional.minResolution,null==(r=o.getModel(t,n))||null==r.additional?null:r.additional.minLength,null==(r=o.getModel(t,n))?null:r.maxSize,(null==(r=o.getModel(t,n))||null==r.additional?null:r.additional.previousValue)||(null==(r=o.getControl(t,n))?null:r.value),e.q4q(1,Gt)]))}}let k=(()=>{class i{constructor(){this.formValueChange=new e._w7,this.layout=(0,e.OCB)({}),this.isLoading=(0,e.OCB)(!0),this.webformName="",this.title=(0,e.OCB)(""),this.subtitle=(0,e.OCB)(""),this.alertBanner=(0,e.OCB)(null),this.hostingClass=(0,e.OCB)(""),this.dynamicWebformService=(0,e.uUt)(st.Q),this.dynamicFormService=(0,e.uUt)(w.Sy8),this.authSessionService=(0,e.uUt)(S.i),this.toolsService=(0,e.uUt)(x.qc),this.linksHandlerService=(0,e.uUt)(rt.S),this.fieldsToShow=[],this.subfieldsToShow={},this.subfieldsToHide={},this.hideFieldTitlesSet=new Set,this.hideTitleFilter={},this.fieldsSaveOnly=[],this.arrays={},this.firstValidation=!1,this.linkInterceporInitiated=!1,this.unsubscribeAll=new Y.E}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}ngAfterViewChecked(){!this.containerDiv||this.linkInterceporInitiated||(this.linkInterceporInitiated=!0,this.linksHandlerService.initializeLinkInterceptor(this.containerDiv))}setConfiguration(t){this.webformName=t.webformName,this.title.set(t.title??""),this.subtitle.set(t.subtitle??""),this.fieldsToShow=t.fieldsToShow??[],this.subfieldsToShow=t.subfieldsToShow??{},this.subfieldsToHide=t.subfieldsToHide??{},Array.isArray(t.hideFieldTitles)?(this.hideFieldTitlesSet=new Set(t.hideFieldTitles),this.hideTitleFilter={}):(this.hideFieldTitlesSet=new Set,this.hideTitleFilter=t.hideFieldTitles??{}),this.fieldsSaveOnly=t.fieldsSaveOnly??t.fieldsToShow??[],this.arrays=t.arrays??{},this.submissionId=t.submissionId,this.extraValidation=t.extraValidation,this.layout.set(t.layout??{}),t.hostingClass&&this.hostingClass.set(t.hostingClass),this.initForm()}validate(){if(!this.formGroup)return m.Invalid;
1this.firstValidation=!0,this.toolsService.markFormFieldsDirty(this.formGroup,!1);const t=this.makeExtraValidation();return t!==m.Valid?t:this.formGroup.valid?m.Valid:m.Invalid}getData(){return{values:this.formGroup?.getRawValue()}}setData(t){t?.values&&this.formGroup?this.formGroup.patchValue(t.values,{emitEvent:!1}):this.dataToSet=t}save(){return this.formGroup&&this.formModel?this.dynamicWebformService.submitWebForm(this.formGroup,this.buildSaveModel(),this.submissionId).pipe((0,v.k)(()=>!0),(0,y.a)(()=>(0,p.of)(!1))):(0,p.of)(!1)}isGroupModel(t){return t instanceof w.iu0}asGroupModel(t){return t}isArrayModel(t){return t instanceof w.yEo}asArrayModel(t){return t}arrayOptions(t){return this.arrays[t]??{}}getControl(t,n){const o=this.getModel(t,n);return o?this.dynamicFormService.findControlByModel(o,this.formGroup):void 0}getModel(t,n){return n?.group?.find(a=>a.id===t)??this.dynamicWebformService.getModel(t,this.formModel)}initForm(){this.webformName&&(this.isLoading.set(!0),this.dynamicWebformService.getAndCreate(this.webformName,this.submissionId).subscribe(t=>{const n=t.formModel.filter(r=>"webform_id"===r.id||this.fieldsToShow.includes(r.id));n.forEach(r=>this.applySubfieldFiltersRecursively(r)),(this.hideFieldTitlesSet.size||Object.keys(this.hideTitleFilter).length)&&n.forEach(r=>this.applyHideTitleRecursively(r,!1,this.hideTitleFilter));const o=this.dynamicFormService.createFormGroup(n);this.fieldsToShow.forEach(r=>{const a=t.formGroup.get(r),u=o.get(r);a&&u&&u.patchValue(a.getRawValue(),{emitEvent:!1})}),this.formModel=n,this.formGroup=o,this.dataToSet&&(this.setData(this.dataToSet),this.dataToSet=void 0),this.isLoading.set(!1),o.valueChanges.pipe((0,I.a)(this.unsubscribeAll)).subscribe(r=>{this.formValueChange.emit(r),this.firstValidation&&this.makeExtraValidation(!0)})}))}buildSaveModel(){if(!this.formModel)return[];const t=new Set([...this.fieldsSaveOnly,"webform_id"]);return this.formModel.filter(n=>t.has(n.id))}applySubfieldFiltersRecursively(t,n,o){const a=t instanceof w.yEo;if(!(t instanceof w.iu0||a))return;const u=void 0!==n?n[t.id]:this.subfieldsToShow[t.id],h=void 0!==o?o[t.id]:this.subfieldsToHide[t.id],g="string"==typeof u?{}:Array.isArray(u)?void 0:u,G="string"==typeof h?{}:Array.isArray(h)?void 0:h,b=T=>{const F=this.filterSubControls(T??[],u,h);return F.forEach(V=>this.applySubfieldFiltersRecursively(V,g,G)),F};if(a){const T=t;T.groups.forEach(V=>V.group=b(V.group));const F=T.groupFactory;T.groupFactory=()=>b(F())}else t.group=b(t.group)}filterSubControls(t,n,o){let r=t;if("string"==typeof n)r=r.filter(a=>a.id===n);else if(Array.isArray(n)&&n.length){const a=new Set(n);r=r.filter(u=>a.has(u.id))}else if(n&&!Array.isArray(n)){const a=new Set(Object.keys(n));r=r.filter(u=>a.has(u.id))}if("string"==typeof o)r=r.filter(a=>a.id!==o);else if(Array.isArray(o)&&o.length){const a=new Set(o);r=r.filter(u=>!a.has(u.id))}return r}applyHideTitleRecursively(t,n,o){const r=o[t.id];(n||this.hideFieldTitlesSet.has(t.id)||!0===r||"self"===r||Array.isArray(r))&&(t.label=null);const u=t instanceof w.yEo;if(!(t instanceof w.iu0||u))return;const h=n||!0===r;let g;g=h||"self"===r?{}:Array.isArray(r)?Object.fromEntries(r.map(b=>[b,"self"])):r&&"object"==typeof r?r:{};const G=b=>((b??[]).forEach(T=>this.applyHideTitleRecursively(T,h,g)),b);if(u){const b=t;b.groups.forEach(F=>G(F.group));const T=b.groupFactory;b.groupFactory=()=>G(T())}else G(t.group)}makeExtraValidation(t){if(!this.formGroup)return m.Invalid;if(!this.extraValidation)return m.Valid;const n=this.extraValidation(this.formGroup);return!0!==n?(this.alertBanner.set({type:"warning",message:n||"Please correct the errors.",avoidScrolling:t}),m.Handled):(this.alertBanner.set(null),m.Valid)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["dynamic-form-fields"]],viewQuery:function(n,o){if(1&n&&(e.CC$(ht,5),e.CC$(w.IlO,5)),2&n){let r;e.wto(r=e.Gqi())&&(o.containerDiv=r.first),e.wto(r=e.Gqi())&&(o.templates=r)}},hostVars:2,hostBindings:function(n,o){2&n&&e.m8U(o.hostingClass())},outputs:{formValueChange:"formValueChange"},standalone:!0,features:[e.UHJ],decls:3,vars:1,consts:[["modelType","FILE_UPLOAD"],["class","mb-3"],[1,"mb-2","d-block",3,"banner"],["content",""],[1,"mb-3"],["class","text-primary mb-1"],["class","text-muted small mb-3",3,"innerHTML"],[1,"text-primary","mb-1"],[1,"text-muted","small","mb-3",3,"innerHTML"],[3,"model","group","layout","templates","options"],[3,"group","model","templates","layout"],[3,"config"]],template:function(n,o){1&n&&e.yuY(0,gt,1,0,"wind-guts-loader")(1,It,6,2)(2,Et,1,13,"ng-template",0),2&n&&e.C0Y(0,o.isLoading()?0:o.formGroup&&o.formModel?1:-1)},dependencies:[w.HkJ,w.IlO,L.CG,L.wn,O.kT,pt.O,d.sD,M.s,d.O0,O.gF,_t]})}}return i})();var Mt=l(70336);function Dt(i,s){1&i&&(e.I0R(0,"div",1),e.wR5(1,"wind-guts-loader"),e.C$Y())}function Ft(i,s){1&i&&(e.I0R(0,"div",13),e.wR5(1,"circular-spinner",14),e.OEk(2),e.wVc(3,"translate"),e.C$Y()),2&i&&(e.yG2(2),e.oRS(" ",e.kDX(3,1,"Loading files...")," "))}const $t=(i,s)=>s.fid;function At(i,s){1&i&&e.wR5(0,"app-my-file-item",15),2&i&&e.E7m("file",s.$implicit)}function Pt(i,s){1&i&&(e.I0R(0,"p",16),e.wR5(1,"i",17),e.OEk(2),e.wVc(3,"translate"),e.C$Y()),2&i&&(e.yG2(2),e.oRS(" ",e.kDX(3,1,"You have not uploaded any insurance document yet.")," "))}
1function Lt(i,s){if(1&i&&e.c53(0,At,1,1,"app-my-file-item",18,$t,!1,Pt,4,3,"p",19),2&i){const t=e.GaO(3);e.oho(t.insuranceFiles())}}function Ut(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",7)(1,"h4",3),e.OEk(2,"Uploaded insurance documents"),e.C$Y(),e.I0R(3,"div",8),e.yuY(4,Ft,4,3,"div",9)(5,Lt,3,1),e.C$Y(),e.I0R(6,"div",10)(7,"button",11),e.qCj("click",function(){e.usT(t);const o=e.GaO(2);return e.CGJ(o.openFileUploadModal())}),e.wR5(8,"i",12),e.OEk(9),e.wVc(10,"translate"),e.C$Y()()()}if(2&i){const t=e.GaO(2);e.yG2(4),e.C0Y(4,t.isLoadingFiles()?4:5),e.yG2(5),e.oRS(" ",e.kDX(10,2,"Upload Insurance Document")," ")}}function Bt(i,s){if(1&i){const t=e.KQA();e.wR5(0,"alert-banner"),e.I0R(1,"div",2)(2,"h3",3),e.OEk(3,"Insurance"),e.C$Y(),e.I0R(4,"p",4),e.OEk(5,"Choose one or more option about how to proceed with your insurance."),e.C$Y(),e.I0R(6,"dynamic-form-fields",5),e.qCj("formValueChange",function(o){e.usT(t);const r=e.GaO();return e.CGJ(r.changedCheckBoxValue(o))}),e.C$Y(),e.yuY(7,Ut,11,4,"div",6),e.C$Y()}if(2&i){const t=e.GaO();e.yG2(7),e.C0Y(7,t.mustShowFileBox()?7:-1)}}let Vt=(()=>{class i{constructor(){this.myFilesService=(0,e.uUt)(ot.u),this.isLoading=(0,e.OCB)(!0),this.insuranceFiles=(0,e.OCB)([]),this.isLoadingFiles=(0,Mt.i6)(this.myFilesService.isLoading$),this.mustShowFileBox=(0,e.OCB)(!1),this.modalManagerService=(0,e.uUt)(tt.k),this.unSubscribeAll=new Y.E,this.authSessionService=(0,e.uUt)(S.i),this.myFilesService.getMyFiles(),this.myFilesService.myFiles$.pipe((0,I.a)(this.unSubscribeAll)).subscribe(t=>{this.isLoading.set(!1),this.insuranceFiles.set(t.filter(n=>n.category.some(o=>"210"===o.id)))})}ngOnDestroy(){this.unSubscribeAll.next(),this.unSubscribeAll.complete()}ngAfterViewInit(){this.dynamicFormFieldsComponent&&(this.dynamicFormFieldsComponent.setConfiguration({webformName:"school_affiliation_form",fieldsToShow:["insurance"],submissionId:this.authSessionService.currentUserProfile?.affiliation_id}),this.dataToSet&&this.dynamicFormFieldsComponent.setData(this.dataToSet))}validate(){if(!this.dynamicFormFieldsComponent||!this.dynamicFormFieldsComponent.validate())return m.Invalid;const t=this.dynamicFormFieldsComponent.getData()?.values;return t?.insurance?.i_will_cover_my_school_with_a_separate_insurance_policy_which_in||t?.insurance?.i_will_ensure_my_school_team_members_and_all_of_my_students_sign?t?.insurance?.i_will_cover_my_school_with_a_separate_insurance_policy_which_in&&0===this.insuranceFiles().length?(this.alertBannerComponent?.setBanner({type:"warning",message:"affiliation_form.insurance.missing_files"}),m.Handled):m.Valid:(this.alertBannerComponent?.setBanner({type:"warning",message:"affiliation_form.insurance.required_fields"}),m.Handled)}getData(){return this.dynamicFormFieldsComponent?.getData()}setData(t){this.dataToSet=t}save(){return this.dynamicFormFieldsComponent?this.dynamicFormFieldsComponent.save():(0,p.of)(!1)}changedCheckBoxValue(t){this.mustShowFileBox.set(t?.insurance?.i_will_cover_my_school_with_a_separate_insurance_policy_which_in),this.alertBannerComponent?.setBanner(null)}openFileUploadModal(){this.modalManagerService.open(it.S.fileUpload,{categoryId:"210"}).subscribe(()=>{this.alertBannerComponent?.setBanner(null)})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-insurance"]],viewQuery:function(n,o){if(1&n&&(e.CC$(k,5),e.CC$(P.g,5)),2&n){let r;e.wto(r=e.Gqi())&&(o.dynamicFormFieldsComponent=r.first),e.wto(r=e.Gqi())&&(o.alertBannerComponent=r.first)}},standalone:!0,features:[e.UHJ],decls:3,vars:1,consts:[["class","text-center py-5"],[1,"text-center","py-5"],[1,"px-3","pt-3"],["translate","",1,"text-primary","mb-1"],["translate","",1,"text-muted","small","mb-3"],[3,"formValueChange"],["class","mt-4"],[1,"mt-4"],[1,"row"],["class","flex-fill d-flex justify-content-center align-items-center"],[1,"col-12","mt-2"],[1,"btn","btn-outline-primary","d-flex","align-items-center","rounded-2",3,"click"],[1,"icon","icon-cloud-upload","me-1"],[1,"flex-fill","d-flex","justify-content-center","align-items-center"],["iconClass","text-primary icon-20 me-1"],[1,"col-12","col-lg-6",3,"file"],[1,"text-muted","mt-3"],[1,"icon","icon-info-circle","me-1"],["class","col-12 col-lg-6",3,"file"],["class","text-muted mt-3"]],template:function(n,o){1&n&&(e.I0R(0,"div"),e.yuY(1,Dt,2,0,"div",0)(2,Bt,8,1),e.C$Y()),2&n&&(e.yG2(),e.C0Y(1,o.isLoading()?1:2))},dependencies:[f.MD,k,M.s,d.O0,d.sD,d.eM,nt.m,oe.gb,$.I,P.g]})}}return i})();var re=l(61464),U=l(96956),Nt=l(53788),ae=l(41752),le=l(39732),ce=l(16544),de=l(2676),qt=l(64264),H=l(45824);const jt=(i,s)=>s.lang_code;function Ht(i,s){1&i&&e.wR5(0,"i",30)}
1function Qt(i,s){if(1&i&&(e.wR5(0,"div",31),e.wVc(1,"lowercase")),2&i){const t=e.GaO();e.E7m("ngClass",e.kDX(1,1,t.schoolCountry()))}}function Jt(i,s){1&i&&(e.I0R(0,"div",32),e.OEk(1,"the field is required"),e.C$Y())}function Xt(i,s){1&i&&e.wR5(0,"circular-spinner",33)}function Kt(i,s){1&i&&e.wR5(0,"i",34)}function Wt(i,s){1&i&&(e.I0R(0,"div",32),e.OEk(1,"the field is required"),e.C$Y())}function zt(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",35)(1,"div",36)(2,"label",37)(3,"input",38),e.qCj("click",function(){const r=e.usT(t).$implicit,a=e.GaO();return e.CGJ(a.patchControlValue("preferred_langcode",r.id))}),e.C$Y(),e.OEk(4),e.wR5(5,"span",39),e.C$Y()()()}if(2&i){const t=s.$implicit,n=e.GaO();e.yG2(3),e.E7m("checked",t.id===n.formLocation.value.preferred_langcode),e.yG2(),e.oRS(" ",t.label," ")}}function Zt(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",40)(1,"div",41)(2,"label",37)(3,"input",42),e.qCj("click",function(){const r=e.usT(t).$implicit,a=e.GaO();return e.CGJ(a.toggleSpokenLanguage(r))}),e.C$Y(),e.OEk(4),e.wR5(5,"span",39),e.C$Y()()()}if(2&i){const t=s.$implicit,n=e.GaO();e.yG2(3),e.E7m("checked",-1!==n.formLocation.value.field_language_spoken.indexOf(t.lang_code)),e.yG2(),e.oRS(" ",t.lang_trans," ")}}const me=i=>({"is-invalid":i}),ue=i=>({"form-control-danger":i}),ei=()=>["locality"],ti=i=>({types:i});let ii=(()=>{class i{constructor(){this.schoolCountry=(0,e.OCB)(null),this.preferredLanguageMenuOpen=(0,e.OCB)(!1),this.spokenLanguageMenuOpen=(0,e.OCB)(!1),this.spokenLanguages=(0,e.OCB)([]),this.preferredLanguages=(0,e.OCB)([]),this.filterLanguages=(0,e.OCB)(""),this.geoCodeLoading=(0,e.OCB)(!1),this.toolsService=(0,e.uUt)(x.qc),this.formBuilder=(0,e.uUt)(c.im),this.authSessionService=(0,e.uUt)(S.i),this.staticValuesList=(0,e.uUt)(Nt.E),this.i18nService=(0,e.uUt)(x.WY),this.userService=(0,e.uUt)(C.oz),this.googleMapService=(0,e.uUt)(re.h),this.modalManagerService=(0,e.uUt)(U.kr),this.contentService=(0,e.uUt)(C.eu),this.loggerService=(0,e.uUt)(q.C),this.selectedAddress={geocode:"",lat:0,lon:0},this.currentSchool=this.authSessionService.currentSchool(),this.notificationsService=(0,e.uUt)(E.E),this.translateService=(0,e.uUt)(d.qS),this.buildForm(),this.geoCodeLoading.set(!0),this.googleMapService.initGoogleMaps().pipe((0,N.y)(()=>this.initGeocoder())).subscribe(),this.getSpokenLanguages(),this.getPreferredLanguages()}setData(t){t&&(this.formLocation.patchValue(t.values,{emitEvent:!1}),this.initLocality(),this.setSelectedAddress(t.selectedAddress))}getData(){return{values:this.formLocation.value,selectedAddress:this.selectedAddress}}validate(){return this.toolsService.markFormFieldsDirty(this.formLocation,!1),this.formLocation.valid?m.Valid:m.Invalid}save(){const t=this.formLocation.value;t.field_school_address.administrative_area&&(t.field_school_address.administrative_area="");const n={field_school_address:[t.field_school_address],field_school_gps:[{value:`POINT (${t.field_school_gps.lon||0} ${t.field_school_gps.lat||0})`}],type:"school"},o={field_language_spoken:t.field_language_spoken,preferred_langcode:t.preferred_langcode};return"string"==typeof o.field_language_spoken&&(o.field_language_spoken=o.field_language_spoken.split(", ")),this.contentService.update(this.currentSchool?.nid,n).pipe((0,y.a)(r=>(r?.error?.message??"").includes("field_school_address.0.postal_code")&&n.field_school_address?.[0]?(n.field_school_address[0].postal_code="",this.contentService.update(this.currentSchool?.nid,n)):(0,le.c)(()=>r)),(0,A.m)(()=>this.userService.update(C.So.Connection.current_user.uid,o)),(0,N.y)(()=>this.authSessionService.initProfile()),(0,v.k)(()=>!0),(0,y.a)(r=>(this.loggerService.logError(r),(0,p.of)(!1))))}handleLocalityChange(t){const n=this.formLocation.get("field_school_address");if(!t)return this.resetLocation(),void this.formLocation.get("formattedAddress")?.patchValue("",{emitEvent:!1});const o=this.googleMapService.convertAddressToDrupalAddress(t);this.schoolCountry.set(o.country_code),this.formLocation.get("formattedAddress")?.patchValue(`${o.locality}, ${o.country_name}`,{emitEvent:!1}),n?.patchValue({country_name:o.country_name,country_code:o.country_code,postal_code:o.postal_code,administrative_area:o.administrative_area,address_line1:o.address_line1,locality:o.locality})}openMapForGpsMarker(){this.modalManagerService.open(U.SC.mapSelector,{hideDistanceSelector:!0,initialValue:this.selectedAddress?{formattedAddress:this.selectedAddress.geocode,lat:this.selectedAddress.lat,lng:this.selectedAddress.lon,distance:1}:null}).subscribe(n=>{n&&this.setSelectedAddress({geocode:n.formattedAddress,lat:n.lat,lon:n.lng})})}switchLanguageMenu(){this.preferredLanguageMenuOpen.set(!this.preferredLanguageMenuOpen())}switchSpokenLanguageMenu(){this.spokenLanguageMenuOpen.set(!this.spokenLanguageMenuOpen())}toggleSpokenLanguage(t){const n=this.formLocation.get("field_language_spoken")?.value;if(!n)return void this.formLocation.get("field_language_spoken")?.patchValue([t.lang_code]);if(n&&n.length>
112)return void this.notificationsService.notifyError(this.translateService.instant("Maximum 12 spoken languages allowed."));const o=n.indexOf(t.lang_code);-1===o?n.push(t.lang_code):n.splice(o,1),this.formLocation.get("field_language_spoken")?.patchValue(n)}patchControlValue(t,n,o=!0){const r=this.formLocation.get(t);r?.patchValue(n),o&&(r?.markAsTouched(),r?.markAsDirty())}buildForm(){this.formLocation=this.formBuilder.group({field_school_gps:this.formBuilder.group({geocode:[,c.AQ.required],lat:[this.currentSchool?.field_school_gps?.lat],lon:[this.currentSchool?.field_school_gps?.lon]}),field_school_address:this.formBuilder.group({country_code:[this.currentSchool?.field_school_address_country_code],country_name:[this.currentSchool?.field_school_address_country_name],address_line1:[this.toolsService.encodeHTMLEntities(this.currentSchool?.field_school_address_address_line1||"")],locality:[this.toolsService.encodeHTMLEntities(this.currentSchool?.field_school_address_locality||"")],postal_code:[this.currentSchool?.field_school_address_postal_code],administrative_area:[this.currentSchool?.field_school_address_administrative_area]}),formattedAddress:["",c.AQ.required],preferred_langcode:[this.authSessionService.currentUserProfile?.preferred_langcode?.code,c.AQ.required],field_language_spoken:[this.authSessionService.currentUserProfile?.field_language_spoken.map(t=>t.code)]}),this.initLocality(),this.formLocation.get("formattedAddress")?.valueChanges.subscribe(()=>{this.formLocation.get("field_school_address")?.get("locality")?.value&&this.resetLocation()})}getSpokenLanguages(){this.staticValuesList.getSpokenLanguages().subscribe(t=>{this.spokenLanguages.set(t)})}getPreferredLanguages(){if(!this.i18nService.supportedLanguages)return void this.preferredLanguages.set([]);const t=[];this.i18nService.supportedLanguagesKeys.forEach(n=>{this.i18nService.supportedLanguages[n].mainLanguage&&t.push({id:n.toLowerCase(),direction:"ltr",label:this.i18nService.supportedLanguages[n].name})}),this.preferredLanguages.set(t)}resetLocation(){this.formLocation.get("field_school_address")?.patchValue({country_name:"",country_code:"",postal_code:"",administrative_area:"",address_line1:"",locality:""}),this.schoolCountry.set(null)}setSelectedAddress(t){this.selectedAddress=t,this.patchControlValue("field_school_gps",t),this.geoCoder?.geocode({location:{lat:t.lat,lng:t.lon}}).then(n=>{})}initGeocoder(){return this.geoCoder?(this.geoCodeLoading.set(!1),!0):(this.geoCoder=new google.maps.Geocoder,this.currentSchool?.field_school_gps?.lat&&this.currentSchool?.field_school_gps?.lon?void this.geoCoder?.geocode({location:{lat:this.currentSchool?.field_school_gps?.lat,lng:this.currentSchool?.field_school_gps?.lon}}).then(t=>{this.geoCodeLoading.set(!1),t?.results[0]&&this.formLocation.get("field_school_gps")?.get("geocode")?.patchValue(t.results[0].formatted_address,{emitEvent:!1}),this.selectedAddress=this.formLocation.get("field_school_gps")?.value}).catch(()=>{this.geoCodeLoading.set(!1)}):(this.geoCodeLoading.set(!1),!0))}initLocality(){const t=this.formLocation.get("field_school_address")?.value;t?.locality&&t?.country_code&&t?.country_name&&(this.schoolCountry.set(t?.country_code),this.formLocation.get("formattedAddress")?.patchValue(`${t?.locality}, ${t?.country_name}`,{emitEvent:!1}))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-location"]],standalone:!0,features:[e.UHJ],decls:53,vars:47,consts:[[1,"w-100","mt-lg-2",3,"formGroup"],[1,"p-2","col-12","col-lg-6","mx-auto","row","bg-white","position-relative"],[1,"col-12"],[1,"row"],[1,"text-center","col-12","mx-auto","text-primary"],[1,"icon","icon-150","icon-world_map"],[1,"form-group"],["for","field_school_address",3,"required"],[1,"input-group",3,"ngClass"],["class","text-info icon icon-tree-city"],["appFormControlStatus","","appGooglePlacesAutocomplete","","type","text","placeholder","Cabarete, Dominican Republic","formControlName","formattedAddress",1,"form-control",3,"ngClass","options","addressChange"],["class","invalid-feedback ms-4","translate",""],["formGroupName","field_school_gps",1,"col-12"],[1,"form-group",3,"ngClass"],["for","field_address",3,"required"],[1,"input-group","pointer"],[1,"input-group-text"],[1,"text-info","icon","icon-map-marker-alt"],["formControlName","geocode","readonly","",1,"form-control","bg-white","pointer","no-border-left","no-border-right","text-dark",3,"ngClass","placeholder","click"],["class","geocoder-loader"],[1,"form-group","mt-3"],["for","appLanguage",1,"text-primary","w-100","border-bottom",3,"click"],["translate",""],[1,"float-end","text-info"],[1,"icon-32","icon","icon-angle-down","icon-angle-toggle"],[1,"row",3,"hidden"],["class","col-6 pe-0",4,"ngFor","ngForOf"],["for","spokenLanguage",1,"text-primary","w-100","border-bottom",3,"click"],[1,"form-group","col-12"],["maxlength","128",1,"form-control","mt-2",3,"value","placeholder","input"],[1,"text-info","icon","icon-tree-city"],[1,"iti-flag","iti-flag-select",3,"ngClass"],["translate","",1,"invalid-feedback","ms-4"],[1,"geocoder-loader"],[1,"text-info","icon","icon-map"],[1,"col-6","pe-0"],[1,"form-check","form-check-radio"],[1,"form-check-label"],["type","radio","name","appLanguage",1,"form-check-input",3,"checked","click"],[1,"form-check-sign"],[1,"pe-0","col-md-4","col-lg-3","col-sm-6","col-xs-6"],[1,"form-check"],["type","checkbox","name","spokenLanguage",1,"form-check-input",3,"checked","click"],["class","pe-0 col-md-4 col-lg-3 col-sm-6 col-xs-6"]],template:function(n,o){1&n&&(e.I0R(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),e.wR5(5,"i",5),e.C$Y()()(),e.I0R(6,"div",2)(7,"div",6)(8,"label-info-point",7),e.OEk(9,"Locality"),e.C$Y(),e.I0R(10,"div",8)(11,"div"),e.yuY(12,Ht,1,0,"i",9)(13,Qt,2,3),e.C$Y(),e.I0R(14,"input",10),e.qCj("addressChange",function(a){return o.handleLocalityChange(a)}),e.C$Y()(),e.yuY(15,Jt,2,0,"div",11),e.C$Y()(),e.I0R(16,"form",12)(17,"div",13)(18,"label-info-point",14),e.OEk(19,"GPS Marker"),e.C$Y(),e.I0R(20,"div",15)(21,"div",16),e.wR5(22,"i",17),e.C$Y(),e.I0R(23,"input",18),e.qCj("click",function(){return o.openMapForGpsMarker()}),e.wVc(24,"translate"),e.wVc(25,"translate"),e.C$Y(),e.I0R(26,"div",16),e.yuY(27,Xt,1,0,"circular-spinner",19)(28,Kt,1,0),e.C$Y()()(),e.yuY(29,Wt,2,0,"div",11),e.C$Y(),e.I0R(30,"div",2)(31,"div",20)(32,"label",21),e.qCj("click",function(){return o.switchLanguageMenu()}),e.I0R(33,"span",22),e.OEk(34,"Preferred language"),e.C$Y(),e.I0R(35,"span",23),e.wR5(36,"i",24),e.C$Y()(),e.I0R(37,"div",25),e.yuY(38,zt,6,2,"div",26),e.C$Y()()(),e.I0R(39,"div",2)(40,"div",20)(41,"label",27),e.qCj("click",function(){return o.switchSpokenLanguageMenu()}),e.I0R(42,"span",22),e.OEk(43,"What languages do you speak?"),e.C$Y(),e.I0R(44,"span",23),e.wR5(45,"i",24),e.C$Y()(),e.I0R(46,"div",25)(47,"div",28)(48,"input",29),e.qCj("input",function(a){return o.filterLanguages.set(a.target.value)}),e.wVc(49,"translate"),e.C$Y()(),e.c53(50,Zt,6,2,"div",43,jt),e.wVc(52,"filterSpokenLanguages"),e.C$Y()()()()()),2&n&&(e.E7m("formGroup",o.formLocation),e.yG2(8),e.E7m("required",!0),e.yG2(2),e.
1E7m("ngClass",e.S45(36,me,o.toolsService.fieldIsInvalid(o.formLocation,"formattedAddress"))),e.yG2(),e.uQ9("input-group-text ",o.schoolCountry()?"pe-3":"",""),e.yG2(),e.C0Y(12,o.schoolCountry()?13:12),e.yG2(2),e.E7m("ngClass",e.S45(38,ue,o.toolsService.fieldIsInvalid(o.formLocation,"formattedAddress")))("options",e.S45(41,ti,e.q4q(40,ei))),e.yG2(),e.C0Y(15,o.toolsService.fieldHasError(o.formLocation,"formattedAddress","required")?15:-1),e.yG2(2),e.E7m("ngClass",e.S45(43,me,o.toolsService.fieldIsInvalid(null==o.formLocation?null:o.formLocation.get("field_school_gps"),"geocode"))),e.yG2(),e.E7m("required",!0),e.yG2(5),e.E7m("ngClass",e.S45(45,ue,o.toolsService.fieldIsInvalid(null==o.formLocation?null:o.formLocation.get("field_school_gps"),"geocode")))("placeholder",o.geoCodeLoading()?e.kDX(24,27,"Loading location..."):e.kDX(25,29,"Choose your location")),e.yG2(4),e.C0Y(27,o.geoCodeLoading()?27:28),e.yG2(2),e.C0Y(29,o.toolsService.fieldHasError(null==o.formLocation?null:o.formLocation.get("field_school_gps"),"geocode","required")?29:-1),e.yG2(7),e.eAK("icon-rotate-180",o.preferredLanguageMenuOpen()),e.yG2(),e.E7m("@slideDown",o.preferredLanguageMenuOpen())("hidden",!o.preferredLanguageMenuOpen()),e.yG2(),e.E7m("ngForOf",o.preferredLanguages()),e.yG2(7),e.eAK("icon-rotate-180",o.spokenLanguageMenuOpen()),e.yG2(),e.E7m("@slideDown",o.spokenLanguageMenuOpen())("hidden",!o.spokenLanguageMenuOpen()),e.yG2(2),e._6D("placeholder",e.kDX(49,31,"filter languages")),e.E7m("value",o.filterLanguages()),e.yG2(2),e.oho(e.g7$(52,33,o.spokenLanguages(),o.filterLanguages())))},dependencies:[c.sl,c.sz,c.ot,c.ue,c.u,c.uW,c.Wo,c.Kh,d.O0,d.sD,d.eM,f.MD,f.QF,f.ay,f.Yb,ae.Y,ce.Q,de.U,j.y,qt.Q,O.kT,$.I,H.Y],styles:[".geocode-loader[_ngcontent-%COMP%]{height:16px!important}"],data:{animation:[z.sj]}})}}return i})();var fe=l(60160),Q=l(14260);function ni(i,s){1&i&&(e.I0R(0,"div",1),e.wR5(1,"wind-guts-loader"),e.C$Y())}function oi(i,s){if(1&i&&(e.I0R(0,"div",7),e.wR5(1,"i",8),e.I0R(2,"span"),e.OEk(3),e.wVc(4,"translate"),e.C$Y()()),2&i){const t=e.GaO(2);e.E7m("ngClass","alert-"+t.banner().type),e.yG2(3),e.cNF(e.kDX(4,2,t.banner().message))}}const si=(i,s)=>s.uid;function ri(i,s){1&i&&e.wR5(0,"i",30)}function ai(i,s){1&i&&e.wR5(0,"i",31)}function li(i,s){if(1&i&&(e.I0R(0,"span",32),e.OEk(1),e.wVc(2,"translate"),e.C$Y()),2&i){const t=e.GaO().$implicit;e.yG2(),e.CAO("",e.kDX(2,2,"Active")," + ",t.field_user_insured,"")}}function ci(i,s){if(1&i&&(e.I0R(0,"span",33),e.OEk(1),e.wVc(2,"translate"),e.C$Y()),2&i){const t=e.GaO().$implicit;e.yG2(),e.oRS(" ",e.kDX(2,1,t.expired?"EXPIRED":"SUSPENDED")," ")}}function di(i,s){if(1&i){const t=e.KQA();e.I0R(0,"tr",16),e.qCj("click",function(){const r=e.usT(t).$implicit,a=e.GaO(3);return e.CGJ(a.selectManager(r.uid))}),e.I0R(1,"td",17),e.yuY(2,ri,1,0,"i",18)(3,ai,1,0),e.C$Y(),e.I0R(4,"td",19)(5,"div",20),e.wR5(6,"image-srcset",21),e.I0R(7,"div",22),e.OEk(8),e.wR5(9,"br"),e.I0R(10,"span",23),e.OEk(11),e.C$Y(),e.I0R(12,"span",24),e.wR5(13,"i",25),e.OEk(14),e.C$Y()()()(),e.I0R(15,"td",26),e.wR5(16,"i",25),e.OEk(17),e.C$Y(),e.I0R(18,"td",27),e.OEk(19),e.C$Y(),e.I0R(20,"td",28),e.yuY(21,li,3,4,"span",29)(22,ci,3,3),e.C$Y()()}if(2&i){const t=s.$implicit,n=e.GaO(3);e.eAK("row-selected",n.selectedManagerUid()===t.uid),e.yG2(2),e.C0Y(2,n.selectedManagerUid()===t.uid?2:3),e.yG2(4),e.E7m("width",36)("height",36)("item",t.user_picture)("onErrorImage",n.toolsService.createAvatarWithInitials(t.field_first_name,t.field_surname,36)),e.yG2(2),e.CAO(" ",t.field_first_name," ",t.field_surname," "),e.yG2(3),e.oRS("(",t.uid,")"),e.yG2(3),e.oRS("",t.field_top_qualification_export||(null==t.current_role?null:t.current_role.display_name)," "),e.yG2(3),e.oRS("",t.field_top_qualification_export||(null==t.current_role?null:t.current_role.display_name)," "),e.yG2(2),e.cNF(t.employment_from),e.yG2(2),e.C0Y(21,t.active?21:22)}}function mi(i,s){if(1&i&&(e.I0R(0,"div",9)(1,"table",10)(2,"thead",11)(3,"tr")(4,"th",12),e.OEk(5,"Manager"),e.C$Y(),e.I0R(6,"th",13),e.OEk(7,"Full Name"),e.C$Y(),e.I0R(8,"th",14),e.OEk(9,"Qualification"),e.C$Y(),e.I0R(10,"th",14),e.OEk(11,"Start Date"),e.C$Y(),e.I0R(12,"th",15),e.OEk(13,"Status"),e.C$Y()()(),e.I0R(14,"tbody"),e.c53(15,di,23,14,"tr",34,si),e.C$Y()()()),2&i){const t=e.GaO(2);e.yG2(15),e.oho(t.team())}}function ui(i,s){1&i&&(e.I0R(0,"div",35),e.wR5(1,"i",36),e.I0R(2,"h4",37),e.OEk(3,"No team members found"),e.C$Y(),e.I0R(4,"p",38),e.OEk(5,"Please add instructors to your team before selecting a manager."),e.C$Y()())}function fi(i,s){if(1&i&&(e.yuY(0,oi,5,4,"div",2),e.I0R(1,"div",3)(2,"h3",4),e.OEk(3,"Select Manager"),e.C$Y(),e.I0R(4,"p",5),e.OEk(5,"Choose which team member will be the school manager."),e.C$Y(),e.yuY(6,mi,17,0,"div",6)(7,ui,6,0),e.C$Y()),2&i){const t=e.GaO();e.C0Y(0,t.banner()?0:-1),e.yG2(6),e.C0Y(6,t.team().length?6:7)}}let _i=(()=>{class i{constructor(){this.team=(0,e.OCB)([]),this.selectedManagerUid=(0,e.OCB)(null),this.isLoading=(0,e.OCB)(!0),this.isSaving=(0,e.OCB)(!1),this.banner=(0,e.OCB)(null),this.toolsService=(0,e.uUt)(x.qc),this.schoolTeamService=(0,e.uUt)(fe.e),this.notificationsService=(0,e.uUt)(E.E),this.translateService=(0,e.uUt)(d.qS),this.authSessionService=(0,e.uUt)(S.i),this.unsubScribeAll=new Y.E,this.schoolTeamService.getTeam().subscribe(),this.schoolTeamService.team$.pipe((0,I.a)(this.unsubScribeAll)).subscribe(t=>{t&&(this.team.set(t),this.isLoading.set(!1))}),this.authSessionService.currentSchool()?.school_manager&&this.selectedManagerUid.set(this.authSessionService.currentSchool()?.school_manager)}ngOnDestroy(){this.unsubScribeAll.next(),this.unsubScribeAll.complete()}validate(){return this.selectedManagerUid()?m.Valid:(this.banner.set({type:"warning",message:this.translateService.instant("Please select a manager before saving.")}),m.Handled)}getData(){return{selectedManagerUid:this.selectedManagerUid()}}setData(t){t?.selectedManagerUid&&this.selectedManagerUid.set(t.selectedManagerUid)}setConfiguration(t){t?.banner&&this.banner.set(t.banner)}save(){const t=this.selectedManagerUid();return t?(this.isSaving.set(!0),this.schoolTeamService.setManager(t).pipe((0,v.k)(n=>
1(this.isSaving.set(!1),n.status?(this.notificationsService.notifySuccess(this.translateService.instant("Manager updated successfully")),!0):(this.banner.set({message:this.translateService.instant(n.error||n.message||"An error occurred while setting the manager. Please try again."),type:"danger"}),!1))),(0,y.a)(()=>(this.isSaving.set(!1),(0,p.of)(!1))))):(0,p.of)(!1)}selectManager(t){this.selectedManagerUid.set(t),this.banner.set(null)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-manager"]],standalone:!0,features:[e.UHJ],decls:3,vars:1,consts:[["class","text-center py-5"],[1,"text-center","py-5"],["class","alert mx-3 mt-3 rounded rounded-1 mb-0 d-flex align-items-start gap-2","role","alert",3,"ngClass"],[1,"px-3","pt-3"],["translate","",1,"text-primary","mb-1"],["translate","",1,"text-muted","small","mb-3"],["class","no-more-tables"],["role","alert",1,"alert","mx-3","mt-3","rounded","rounded-1","mb-0","d-flex","align-items-start","gap-2",3,"ngClass"],[1,"icon","icon-exclamation-triangle","flex-shrink-0","mt-1"],[1,"no-more-tables"],[1,"table","table-bordered","table-striped","table-condensed","cf"],[1,"cf"],["translate","",1,"border-end","select-col","text-center"],["translate","",1,"border-end"],["translate","",1,"border-end","d-none","d-sm-table-cell"],["translate","",1,"d-none","d-sm-table-cell"],[1,"small","cursor-pointer",3,"click"],["data-title","Manager",1,"select-col","text-center","align-middle"],["class","icon icon-check-circle text-success select-icon"],["data-title","Full Name"],[1,"d-flex","align-items-center","gap-2"],["imgClass","rounded-circle member-avatar","propertyName","square",3,"width","height","item","onErrorImage"],[1,"text-left"],[1,"member-id"],[1,"d-block","d-lg-none"],[1,"icon","icon-award","me-1","text-success"],["data-title","Qualification",1,"d-none","d-sm-table-cell"],["data-title","Start Date",1,"d-none","d-sm-table-cell"],["data-title","Status",1,"d-none","d-sm-table-cell"],["class","text-secondary"],[1,"icon","icon-check-circle","text-success","select-icon"],[1,"icon","icon-circle","text-muted","select-icon"],[1,"text-secondary"],[1,"text-danger"],["class","small cursor-pointer",3,"row-selected"],[1,"text-center","mt-3","mb-2"],[1,"icon","icon-users","icon-40","text-muted"],["translate","",1,"mt-2"],["translate","",1,"text-muted","small"]],template:function(n,o){1&n&&(e.I0R(0,"div"),e.yuY(1,ni,2,0,"div",0)(2,fi,8,2),e.C$Y()),2&n&&(e.yG2(),e.C0Y(1,o.isLoading()?1:2))},dependencies:[f.MD,f.QF,d.O0,d.sD,d.eM,Q.A,_.AF,M.s],styles:["[_nghost-%COMP%]{display:block}  .member-avatar{width:36px;height:36px;object-fit:cover;flex-shrink:0}.member-id[_ngcontent-%COMP%]{font-size:.8em}.cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}.select-col[_ngcontent-%COMP%]{width:64px}.select-icon[_ngcontent-%COMP%]{font-size:1.4rem}.row-selected[_ngcontent-%COMP%]{background-color:rgb(var(--bs-success-rgb) .12)!important;outline:2px solid var(--bs-success);outline-offset:-2px}"]})}}return i})();var _e=l(6476),pe=l(15340);const pi=(i,s)=>s.id;function hi(i,s){1&i&&(e.I0R(0,"div",9),e.OEk(1,"insert a valid URL"),e.C$Y())}const gi=i=>({"is-invalid":i}),Ci=i=>({"form-control-danger":i});function vi(i,s){if(1&i&&(e.I0R(0,"div",2)(1,"div",3)(2,"label-info-point",4),e.OEk(3),e.wVc(4,"translate"),e.C$Y(),e.I0R(5,"div",5)(6,"div",6),e.wR5(7,"i"),e.C$Y(),e.wR5(8,"input",7),e.yuY(9,hi,2,0,"div",8),e.C$Y()()()),2&i){const t=s.$implicit,n=e.GaO();e.yG2(3),e.cNF(e.kDX(4,10,t.label)),e.yG2(2),e.E7m("ngClass",e.S45(12,gi,n.toolsService.fieldIsInvalid(n.formOnline,t.id))),e.yG2(2),e.uQ9("text-info icon icon-",t.icon,""),e.yG2(),e._6D("id",t.id),e._6D("formControlName",t.id),e.E7m("ngClass",e.S45(14,Ci,n.toolsService.fieldIsInvalid(n.formOnline,t.id)))("placeholder",t.placeholder),e.yG2(),e.C0Y(9,n.toolsService.fieldHasError(n.formOnline,t.id,"url")?9:-1)}}let yi=(()=>{class i{constructor(){this.toolsService=(0,e.uUt)(ie.q),this.fields=[{id:"field_website_url",label:"Web Sites",placeholder:"https://www.example.com",icon:"globe"},{id:"field_facebook_url",label:"Facebook",placeholder:"https://www.facebook.com/example",icon:"facebook"},{id:"field_instagram",label:"Instagram",placeholder:"https://www.instagram.com/example",icon:"instagram"}],this.userProfileService=(0,e.uUt)(pe.k),this.authSessionService=(0,e.uUt)(S.i),this.formBuilder=(0,e.uUt)(c.im),this.loggerService=(0,e.uUt)(q.C),this.buildForm()}getData(){return this.formOnline.value}validate(){return this.toolsService.markFormFieldsDirty(this.formOnline,!1),this.formOnline.valid?m.Valid:m.Invalid}save(){return this.validate()?this.userProfileService.patch(this.formOnline.value).pipe((0,v.k)(()=>!0),(0,y.a)(t=>(this.loggerService.logError(t),(0,p.of)(!1)))):(0,p.of)(!1)}buildForm(){this.formOnline=this.formBuilder.group(this.fields.reduce((t,n)=>(t[n.id]=[this.covnertFalseToEmptyString(this.authSessionService?.currentUserProfile?.[n.id]),[_e.S.url]],t),{}))}covnertFalseToEmptyString(t){return t||""}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-school-form-online-presence"]],standalone:!0,features:[e.UHJ],decls:4,vars:1,consts:[[1,"w-100","mt-lg-2",3,"formGroup"],[1,"p-2","col-12","col-lg-6","mx-auto","row","bg-white","position-relative"],[1,"col-12"],[1,"form-group"],["for","field_first_name"],[1,"input-group",3,"ngClass"],[1,"input-group-text"],["appFormControlStatus","","type","text",1,"form-control",3,"id","ngClass","placeholder","formControlName"],["class","invali
1d-feedback","translate",""],["translate","",1,"invalid-feedback"],["class","col-12"]],template:function(n,o){1&n&&(e.I0R(0,"form",0)(1,"div",1),e.c53(2,vi,10,16,"div",10,pi),e.C$Y()()),2&n&&(e.E7m("formGroup",o.formOnline),e.yG2(2),e.oho(o.fields))},dependencies:[f.MD,f.QF,c.sl,c.sz,c.ot,c.ue,c.u,c.uW,c.Wo,d.O0,d.sD,d.eM,O.Y9]})}}return i})();var he=l(10496),bi=l(41432);function Si(i,s){1&i&&(e.I0R(0,"div",37),e.OEk(1,"the field is required"),e.C$Y())}function xi(i,s){1&i&&(e.I0R(0,"div",37),e.OEk(1,"the field is required"),e.C$Y())}function wi(i,s){1&i&&(e.I0R(0,"div",38),e.OEk(1," the field is required "),e.C$Y())}function ki(i,s){1&i&&(e.I0R(0,"div",38),e.OEk(1," invalid phone number "),e.C$Y())}function Oi(i,s){1&i&&(e.I0R(0,"div",2)(1,"div",3)(2,"label-info-point",39),e.OEk(3,"Center email"),e.C$Y(),e.I0R(4,"div",40)(5,"div",41),e.wR5(6,"i",42),e.C$Y(),e.wR5(7,"input",43),e.I0R(8,"button",44),e.OEk(9," Change "),e.C$Y()()()())}function Ti(i,s){1&i&&(e.I0R(0,"div",2)(1,"div",3)(2,"label-info-point",45),e.OEk(3,"Password"),e.C$Y(),e.I0R(4,"div",40)(5,"div",41),e.wR5(6,"i",46),e.C$Y(),e.wR5(7,"input",47),e.I0R(8,"button",48),e.OEk(9," Change "),e.C$Y()()()())}const ge=i=>({"is-invalid":i}),Ce=i=>({"form-control-danger":i}),Ri=i=>({year:i,month:1,day:1}),Ii=i=>({year:i,month:12,day:31}),Gi=(i,s,t)=>({"icon-venus-mars":i,"icon-mars":s,"icon-venus":t});let Yi=(()=>{class i{constructor(){this.hideEmail=(0,e.OCB)(!1),this.hidePassword=(0,e.OCB)(!1),this.now=new Date,this.toolsService=(0,e.uUt)(x.qc),this.formBuilder=(0,e.uUt)(c.im),this.authSessionService=(0,e.uUt)(S.i),this.translateService=(0,e.uUt)(d.qS),this.notificationsService=(0,e.uUt)(E.E),this.userService=(0,e.uUt)(C.oz),this.googleMapService=(0,e.uUt)(re.h),this.userProfileService=(0,e.uUt)(pe.k),this.buildForm()}validate(){return this.toolsService.markFormFieldsDirty(this.formOwner,!1),this.formOwner.valid?m.Valid:m.Invalid}setConfiguration(t){this.hideEmail.set(t?.hideEmail),this.hidePassword.set(t?.hidePassword)}getData(){const t={...this.formOwner.value};return t.field_birth_date instanceof _.aC&&(t.field_birth_date=this.toolsService.convertNgbDateToIsoDate(t.field_birth_date)),t.ownerAddressObject=this.ownerAddressObject,t}setData(t){t&&(this.formOwner.patchValue(t),t.ownerAddressObject&&(this.ownerAddressObject=t.ownerAddressObject),this.fixBirthDate())}save(){const t={...this.formOwner.value};return t.field_birth_date?t.field_birth_date=this.toolsService.convertNgbDateToIsoDate(t.field_birth_date):delete t.field_birth_date,t.field_gender=t.field_gender.charAt(0),this.ownerAddressObject?t.field_address=[this.ownerAddressObject]:delete t.field_address,t.field_address?.[0]?.administrative_area&&delete t.field_address[0].administrative_area,this.userProfileService.patch(t).pipe((0,y.a)(n=>(n?.message??"").includes("field_address.0.postal_code")&&t.field_address?.[0]?(t.field_address[0].postal_code="",this.userProfileService.patch(t)):(0,le.c)(()=>n)),(0,v.k)(()=>!0),(0,y.a)(n=>(this.notificationsService.notifyError(this.translateService.instant(n.message??"There was an error updating the owner")),(0,p.of)(!1))))}handleOwnerAddressChange(t){if(t)return this.ownerAddressObject=this.googleMapService.convertAddressToDrupalAddress(t),this.ownerAddressObject.address_line1?(t.formatted_address&&(this.ownerAddressObject.address_line1=t.formatted_address),void this.patchControlValue("field_address",t.formatted_address)):(this.notificationsService.notifyError(this.translateService.instant("A full valid address is required")),void delete this.ownerAddressObject);this.ownerAddressObject?this.patchControlValue("field_address",this.ownerAddressObject.address_line1):this.patchControlValue("field_address")}patchControlValue(t,n,o=!0){const r=this.formOwner.get(t);r?.patchValue(n),o&&(r?.markAsTouched(),r?.markAsDirty())}buildForm(){this.formOwner=this.formBuilder.group({field_first_name:[,c.AQ.required],field_surname:[,c.AQ.required],field_birth_date:[],field_gender:["Male"],field_phone:[,c.AQ.required],mail:[this.authSessionService.currentUserProfile?.mail,[c.AQ.required,_e.S.email]],field_address:[]}),this.formOwner.patchValue(this.authSessionService.currentUserProfile??{}
1),this.fixBirthDate()}fixBirthDate(){const t=this.formOwner.get("field_birth_date")?.value;t&&"string"==typeof t&&this.formOwner.get("field_birth_date")?.setValue(this.toolsService.convertstringDatetoNgbDate(t))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-school-form-owner"]],inputs:{hideEmail:[e.Wk5.HasDecoratorInputTransform,"hideEmail","hideEmail",t=>(0,e.OCB)(t)],hidePassword:[e.Wk5.HasDecoratorInputTransform,"hidePassword","hidePassword",t=>(0,e.OCB)(t)]},standalone:!0,features:[e.QJr,e.UHJ],decls:75,vars:41,consts:[[1,"w-100","mt-lg-2",3,"formGroup"],[1,"p-2","col-12","col-lg-6","mx-auto","row","bg-white","position-relative"],[1,"col-12"],[1,"form-group"],["for","field_first_name","translate","",3,"required"],[1,"input-group",3,"ngClass"],[1,"input-group-text"],[1,"text-info","icon","icon-user"],["appFormControlStatus","","id","field_first_name","type","text","placeholder","Jhon","formControlName","field_first_name","autocomplete","given-name","maxlength","20",1,"form-control",3,"ngClass"],["class","invalid-feedback","translate",""],["for","field_surname","translate","",3,"required"],["appFormControlStatus","","id","field_surname","type","text","placeholder","Smith","formControlName","field_surname","autocomplete","family-name","maxlength","15",1,"form-control",3,"ngClass"],["for","field_birth_date","translate",""],[1,"input-group"],[1,"text-info","icon","icon-calendar-alt"],["id","field_birth_date","formControlName","field_birth_date","ngbDatepicker","",1,"form-control","px-2","text-dark","bg-white","cursor",3,"minDate","maxDate","readOnly","placeholder","click"],["db","ngbDatepicker"],["for","field_gender","translate",""],["ngbDropdown","","id","field_gender",1,"dropdown","dropdown-icon-right"],["ngbDropdownToggle","",1,"w-100","btn","btn-simple","border","d-flex","bg-white","align-items-center","btn-round","dropdown-toggle","m-0","text-start","border-light-gray"],[1,"flex-fill"],[1,"me-2"],[1,"text-info","icon","icon-16",3,"ngClass"],["ngbDropdownMenu",""],[1,"dropdown-item",3,"click"],[1,"text-info","icon","icon-16","icon-mars"],["translate",""],[1,"text-info","icon","icon-16","icon-venus"],[1,"text-info","icon","icon-16","icon-venus-mars"],["for","field_address","translate",""],[1,"text-info","icon","icon-home"],["appFormControlStatus","","appGooglePlacesAutocomplete","","formControlName","field_address","placeholder","Novus Mare, Cabarete, Dominican Republic","maxlength","128",1,"form-control",3,"blur","addressChange"],[1,"form-group","form-control-danger"],["for","field_phone",3,"required"],["formControlName","field_phone",3,"cssClass"],["class","invalid-feedback ms-4","translate","",4,"ngIf"],["class","col-12"],["translate","",1,"invalid-feedback"],["translate","",1,"invalid-feedback","ms-4"],["for","email","translate",""],["disabled","",1,"input-group"],[1,"input-group-text","bg-light-gray"],[1,"text-info","icon","icon-envelope"],["appFormControlStatus","","id","email","type","email","placeholder","[email protected]","formControlName","mail","autocomplete","email","maxlength","40","readonly","",1,"form-control"],["routerLink","/edit-profile/email-change","translate","",1,"rounded-3","input-group-append","btn-info","border-0","password-btn","px-3","py-1"],["for","password","translate",""],[1,"text-info","icon","icon-key"],["type","password","autocomplete","current-password","placeholder","***********","readonly","","maxlength","40",1,"form-control"],["routerLink","/edit-profile/password-change","translate","",1,"rounded-3","input-group-append","btn-info","border-0","password-btn","px-3","py-1"]],template:function(n,o){if(1&n){const r=e.KQA();e.I0R(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"label-info-point",4),e.OEk(5,"First Name"),e.C$Y(),e.I0R(6,"div",5)(7,"div",6),e.wR5(8,"i",7),e.C$Y(),e.wR5(9,"input",8),e.yuY(10,Si,2,0,"div",9),e.C$Y()()(),e.I0R(11,"div",2)(12,"div",3)(13,"label-info-point",10),e.OEk(14,"Last Name"),e.C$Y(),e.I0R(15,"div",5)(16,"div",6),e.wR5(17,"i",7),e.C$Y(),e.wR5(18,"input",11),e.yuY(19,xi,2,0,"div",9),e.C$Y()()(),e.I0R(20,"div",2)(21,"div",3)(22,"label-info-point",12),e.OEk(23,"Birthdate"),e.C$Y(),e.I0R(24,"div",13)(25,"div",6),e.wR5(26,"i",14),e.C$Y(),e.I0R(27,"input",15,16),e.qCj("click",function(){e.usT(r);const u=e.Gew(28);
1return e.CGJ(u.toggle())}),e.wVc(29,"translate"),e.C$Y()()()(),e.I0R(30,"div",2)(31,"div",3)(32,"label-info-point",17),e.OEk(33,"Gender"),e.C$Y(),e.I0R(34,"div",18)(35,"button",19)(36,"div",20)(37,"span",21),e.wR5(38,"i",22),e.C$Y(),e.I0R(39,"span"),e.OEk(40),e.wVc(41,"translate"),e.C$Y()()(),e.I0R(42,"div",23)(43,"a",24),e.qCj("click",function(){return o.patchControlValue("field_gender","Male")}),e.I0R(44,"span",21),e.wR5(45,"i",25),e.C$Y(),e.I0R(46,"span",26),e.OEk(47,"Male"),e.C$Y()(),e.I0R(48,"a",24),e.qCj("click",function(){return o.patchControlValue("field_gender","Female")}),e.I0R(49,"span",21),e.wR5(50,"i",27),e.C$Y(),e.I0R(51,"span",26),e.OEk(52,"Female"),e.C$Y()(),e.I0R(53,"a",24),e.qCj("click",function(){return o.patchControlValue("field_gender","Other")}),e.I0R(54,"span",21),e.wR5(55,"i",28),e.C$Y(),e.I0R(56,"span",26),e.OEk(57,"Other"),e.C$Y()()()()()(),e.I0R(58,"div",2)(59,"div",3)(60,"label-info-point",29),e.OEk(61,"Home address"),e.C$Y(),e.I0R(62,"div",13)(63,"div",6),e.wR5(64,"i",30),e.C$Y(),e.I0R(65,"input",31),e.qCj("blur",function(){return o.handleOwnerAddressChange()})("addressChange",function(u){return o.handleOwnerAddressChange(u)}),e.C$Y()()()(),e.I0R(66,"div",2)(67,"div",32)(68,"label-info-point",33),e.OEk(69,"Phone"),e.C$Y(),e.wR5(70,"iko-ngx-intl-tel-input",34),e.yuY(71,wi,2,0,"div",35)(72,ki,2,0,"div",35),e.C$Y()(),e.yuY(73,Oi,10,0,"div",36)(74,Ti,10,0,"div",36),e.C$Y()()}2&n&&(e.E7m("formGroup",o.formOwner),e.yG2(4),e.E7m("required",!0),e.yG2(2),e.E7m("ngClass",e.S45(25,ge,o.toolsService.fieldIsInvalid(o.formOwner,"field_first_name"))),e.yG2(3),e.E7m("ngClass",e.S45(27,Ce,o.toolsService.fieldIsInvalid(o.formOwner,"field_first_name"))),e.yG2(),e.C0Y(10,o.toolsService.fieldHasError(o.formOwner,"field_first_name","required")?10:-1),e.yG2(3),e.E7m("required",!0),e.yG2(2),e.E7m("ngClass",e.S45(29,ge,o.toolsService.fieldIsInvalid(o.formOwner,"field_surname"))),e.yG2(3),e.E7m("ngClass",e.S45(31,Ce,o.toolsService.fieldIsInvalid(o.formOwner,"field_surname"))),e.yG2(),e.C0Y(19,o.toolsService.fieldHasError(o.formOwner,"field_surname","required")?19:-1),e.yG2(8),e._6D("placeholder",e.kDX(29,21,"Select Date")),e.E7m("minDate",e.S45(33,Ri,o.now.getFullYear()-80))("maxDate",e.S45(35,Ii,o.now.getFullYear()-12))("readOnly",!0),e.yG2(11),e.E7m("ngClass",e.uAc(37,Gi,!o.formOwner.value.field_gender||"Other"===o.formOwner.value.field_gender,"Male"===o.formOwner.value.field_gender,"Female"===o.formOwner.value.field_gender)),e.yG2(2),e.cNF(e.kDX(41,23,o.formOwner.value.field_gender)),e.yG2(28),e.E7m("required",!0),e.yG2(2),e.E7m("cssClass",o.toolsService.fieldIsInvalid(o.formOwner,"field_phone")?"is-invalid":""),e.yG2(),e.E7m("ngIf",o.toolsService.fieldHasError(o.formOwner,"field_phone","required")),e.yG2(),e.E7m("ngIf",o.toolsService.fieldHasError(o.formOwner,"field_phone","phoneValidation")),e.yG2(),e.C0Y(73,o.hideEmail()?-1:73),e.yG2(),e.C0Y(74,o.hidePassword()?-1:74))},dependencies:[f.MD,f.QF,f.u_,c.sl,c.sz,c.ot,c.ue,c.u,c.Mj,c.uW,c.Wo,d.O0,d.sD,d.eM,_.cT,_.gt,O.kT,_.S8,_.qs,_.KA,ce.Q,de.U,ee.J,bi.K,H.Y,ae.Y,he.kP,he.am],styles:[".password-btn[_ngcontent-%COMP%]{border-top-left-radius:0!important;border-bottom-left-radius:0!important}"]})}}return i})();const Ei=["datePickerDesktopModal"];function Mi(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",9),e.qCj("click",function(o){e.usT(t);const r=e.GaO();return e.CGJ(r.reset(o))}),e.wR5(1,"i",10),e.C$Y()}}function Di(i,s){if(1&i&&(e.I0R(0,"div")(1,"div",28),e.OEk(2),e.C$Y(),e.wR5(3,"ngb-datepicker-month",29),e.C$Y()),2&i){const t=s.$implicit;e.GaO(2);const n=e.Gew(2);e.yG2(2),e.CAO(" ",n.i18n.getMonthShortName(t.month)," ",t.year," "),e.yG2(),e.E7m("month",t)}}function Fi(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",25)(1,"button",26),e.qCj("click",function(){e.usT(t);const o=e.GaO(3);return e.CGJ(o.addPreviousMonthsToMobileCalendar())}),e.OEk(2," Load previous months "),e.C$Y(),e.c53(3,Di,4,3,"div",null,e.oxv),e.I0R(5,"button",27),e.qCj("click",function(){e.usT(t);const o=e.GaO(3);return e.CGJ(o.addMonthsToMobileCalendar())}),e.OEk(6," Load more dates "),e.C$Y()()}if(2&i){e.GaO();const t=e.Gew(2);e.yG2(3),e.oho(t.state.months)}}function $i(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",21)(1,"ngb-datepicker",22,23),e.qCj("dateSelect",function(o){e.usT(t);const r=e.GaO(2);return e.CGJ(r.onDateSelection(o))}),e.yuY(3,Fi,7,0,"ng-template",24),e.C$Y()()}if(2&i){const t=e.GaO(2),n=e.Gew(10);e.yG2(),e.E7m("displayMonths",t.currentMobileMonth())("startDate",t.mobileStartDate())("dayTemplate",n)}}function Ai(i,s){if(1&i){const t=e.KQA();
1e.I0R(0,"div",30)(1,"ngb-datepicker",31,32),e.qCj("dateSelect",function(o){e.usT(t);const r=e.GaO(2);return e.CGJ(r.onDateSelection(o))}),e.C$Y()()}if(2&i){const t=e.GaO(2),n=e.Gew(10);e.yG2(),e.E7m("displayMonths",2)("dayTemplate",n)("startDate",t.startDate())}}function Pi(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",11)(1,"h4",12),e.wR5(2,"i",13),e.I0R(3,"span",14),e.OEk(4,"Choose Dates"),e.C$Y()(),e.I0R(5,"button",15),e.qCj("click",function(){const r=e.usT(t).$implicit;return e.CGJ(r.dismiss("Cross click"))}),e.C$Y()(),e.I0R(6,"div",16),e.yuY(7,$i,4,3,"div",17)(8,Ai,3,3),e.C$Y(),e.I0R(9,"div",18)(10,"button",19),e.qCj("click",function(){const r=e.usT(t).$implicit;return e.CGJ(r.dismiss(!1))}),e.OEk(11,"Cancel"),e.C$Y(),e.I0R(12,"button",20),e.qCj("click",function(){const r=e.usT(t).$implicit;return e.CGJ(r.close(!0))}),e.OEk(13,"Apply"),e.C$Y()()}if(2&i){const t=e.GaO();e.yG2(7),e.C0Y(7,t.deviceDetectService.isMobile()?7:8)}}function Li(i,s){if(1&i){const t=e.KQA();e.I0R(0,"span",33),e.qCj("mouseenter",function(){const r=e.usT(t).$implicit,a=e.GaO();return e.CGJ(a.hoveredDate=r)})("mouseleave",function(){e.usT(t);const o=e.GaO();return e.CGJ(o.hoveredDate=null)}),e.OEk(1),e.C$Y()}if(2&i){const t=s.$implicit,n=s.focused,o=e.GaO();e.eAK("focused",n)("range",o.isRange(t))("faded",o.isHovered(t)||o.isInside(t))("first",o.isFirst(t))("last",o.isLast(t))("lastHover",o.isLastHover(t)),e.yG2(),e.oRS(" ",t.day," ")}}const ve=i=>({"is-invalid":i});let Ui=(()=>{class i{constructor(){this.hasError=(0,e.YhN)(!1),this.value=(0,e.OCB)(""),this.disabled=(0,e.OCB)(!1),this.calendar=(0,e.uUt)(_.oN),this.hoveredDate=null,this.startDate=(0,e.OCB)(null),this.currentMobileMonth=(0,e.OCB)(6),this.mobileStartDate=(0,e.OCB)(null),this.deviceDetectService=(0,e.uUt)(x.ac),this.fromDate=null,this.tools=(0,e.uUt)(x.qc),this.i18nService=(0,e.uUt)(x.WY),this.nbgModal=(0,e.uUt)(_.Z6),this.currentValue=null,this.dateFormatString="dd MMMM yyyy"}set dateFormat(t){this.dateFormatString=t,this.generatePlaceholder()}writeValue(t){if("string"==typeof t){if(t.includes("-")){const[n,o]=t.split("-");this.fromDate=this.tools.convertDatetoNgbDate(new Date(n)),this.toDate=this.tools.convertDatetoNgbDate(new Date(o))}else this.fromDate=this.tools.convertDatetoNgbDate(new Date(t));t={from:this.fromDate,to:this.toDate}}else this.fromDate=t?.from?this.tools.convertDatetoNgbDate(t.from):null,this.toDate=t?.to?this.tools.convertDatetoNgbDate(t.to):null;this.startDate.set(this.fromDate),this.currentValue=t,this.generatePlaceholder()}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouch=t}setDisabledState(t){this.disabled.set(t)}addMonthsToMobileCalendar(){this.currentMobileMonth.update(t=>t+6)}addPreviousMonthsToMobileCalendar(){const t=this.mobileStartDate();if(t){const n=this.calculateMonthsAgo(t,6);this.mobileStartDate.set(n),this.currentMobileMonth.update(o=>o+6)}}openDatepicker(){if(this.fromDate=this.currentValue?.from?this.tools.convertDatetoNgbDate(this.currentValue?.from):null,this.toDate=this.currentValue?.to?this.tools.convertDatetoNgbDate(this.currentValue?.to):null,this.startDate.set(this.fromDate),this.onTouch?.(),this.deviceDetectService.isMobile())if(this.currentValue){this.mobileStartDate.set(this.tools.convertDatetoNgbDate(this.currentValue.from));const n=this.monthsBetweenDates(this.currentValue.from,this.currentValue.to);this.currentMobileMonth.set(n<=6?6:n)}else{const n=this.calendar.getToday(),o=this.calculateMonthsAgo(n,3);this.mobileStartDate.set(o),this.currentMobileMonth.set(6)}const t=this.nbgModal.open(this.dpDesktop,{centered:!0,scrollable:!0,windowClass:"modal-fullscreen-mobile"});t.shown.subscribe(()=>{if(this.deviceDetectService.isMobile())if(this.currentValue){const n=document.getElementsByClassName("custom-day first")[0];n&&n.scrollIntoView({behavior:"smooth",block:"nearest"})}else{const n=document.getElementsByClassName("scroller-mobile")[0];n&&(n.scrollTop=n.scrollHeight/2.5)}}),t.result.then(n=>{n&&(this.currentValue=this.fromDate&&this.toDate?{from:this.convertNgbDateToDate(this.fromDate),to:this.convertNgbDateToDate(this.toDate)}:null,this.onChange?.(this.currentValue),this.generatePlaceholder())})}reset(t){t.preventDefault(),t.stopPropagation(),this.currentValue=null,this.fromDate=null,this.toDate=null,this.currentMobileMonth.set(6),this.onChange?.(this.currentValue),this.generatePlaceholder()}onDateSelection(t){this.fromDate||this.toDate?this.fromDate&&!this.toDate&&t.after(this.fromDate)?this.toDate=t:(this.toDate=null,this.fromDate=t,this.startDate.set(t)):(this.fromDate=t,this.startDate.set(t))}calculateMonthsAgo(t,n){let o=t.year,r=t.month-n;for(;r<=0;)r+=12,o-=1;return new _.aC(o,r,1)}isHovered(t){return this.fromDate&&!this.toDate&&this.hoveredDate&&t.after(this.fromDate)&&t.before(this.hoveredDate)}isInside(t){return this.toDate&&t.after(this.fromDate)&&t.before(this.toDate)}isFirst(t){return t.equals(this.fromDate)}isLast(t){return t.equals(this.toDate)}isLastHover(t){return!this.toDate&&this.fromDate&&this.hoveredDate&&t.equals(this.hoveredDate)&&t.after(this.fromDate)}isRange(t){return t.equals(this.fromDate)||this.toDate&&t.equals(this.toDate)||this.isInside(t)||this.isHovered(t)}generatePlaceholder(){return this.value.set(this.currentValue?.from&&this.currentValue?.to?this.i18nService.localizeDateAndFormat(this.currentValue?.from??"",this.dateFormatString)+" - "+this.i18nService.localizeDateAndFormat(this.currentValue?.to??"",this.dateFormatString):"")}convertNgbDateToDate(t){return new Date(t.year,t.month-1,t.day)}
1monthsBetweenDates(t,n){let o=0;return o=12*(n.getFullYear()-t.getFullYear()),o-=t.getMonth(),o+=n.getMonth(),o<=0?0:o}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["daterange-selector"]],viewQuery:function(n,o){if(1&n&&e.CC$(Ei,5,e.Yw2),2&n){let r;e.wto(r=e.Gqi())&&(o.dpDesktop=r.first)}},inputs:{hasError:[e.Wk5.SignalBased,"hasError"],dateFormat:"dateFormat"},standalone:!0,features:[e.M5G([{provide:c.Y6,useExisting:(0,e.wd)(()=>i),multi:!0}]),e.UHJ],decls:11,vars:8,consts:[[1,"form-group","w-100"],[1,"input-group","w-100",3,"ngClass","click"],[1,"input-group-text","input-group-prepend"],[1,"text-info","icon","icon-calendar-alt"],["placeholder","Select a date range...",1,"form-control","px-2","text-dark","bg-white","cursor",3,"ngClass","ngModel","focus"],["inputDateRange",""],["class","input-group-text input-group-append"],["datePickerDesktopModal",""],["t",""],[1,"input-group-text","input-group-append",3,"click"],[1,"text-info","icon","icon-times"],[1,"modal-header","safe-area-top"],[1,"modal-title","mt-0"],[1,"icon","icon-calendar-alt","me-2"],["translate",""],["type","button","aria-label","Close",1,"btn-close",3,"click"],[1,"modal-body","px-2"],["class","d-flex justify-content-center scroller-mobile overflow-scroll w-100 mb-3"],[1,"modal-footer","safe-area-bottom"],["type","button",1,"btn","px-4","btn-info","rounded-2",3,"click"],["type","button",1,"btn","px-4","btn-success","rounded-2",3,"click"],[1,"d-flex","justify-content-center","scroller-mobile","overflow-scroll","w-100","mb-3"],["outsideDays","hidden","navigation","none",1,"px-3","pt-1","pb-3","no-header-padding",3,"displayMonths","startDate","dayTemplate","dateSelect"],["dpMobile",""],["ngbDatepickerContent",""],[1,"d-flex","flex-column"],["type","button",1,"btn","btn-outline-primary","w-100","rounded-2","mb-3",3,"click"],["type","button",1,"btn","btn-outline-primary","w-100","rounded-2","mt-3",3,"click"],[1,"text-primary","p-1","fw-bold"],[1,"no-border",3,"month"],[1,"datepicker-scroll-container"],["outsideDays","hidden",3,"displayMonths","dayTemplate","startDate","dateSelect"],["dp",""],[1,"custom-day",3,"mouseenter","mouseleave"]],template:function(n,o){if(1&n){const r=e.KQA();e.I0R(0,"div",0)(1,"div",1),e.qCj("click",function(){return o.openDatepicker()}),e.I0R(2,"div",2),e.wR5(3,"i",3),e.C$Y(),e.I0R(4,"input",4,5),e.qCj("focus",function(){e.usT(r);const u=e.Gew(5);return e.CGJ(u.blur())}),e.C$Y(),e.yuY(6,Mi,2,0,"div",6),e.C$Y()(),e.yuY(7,Pi,14,1,"ng-template",null,7,e.gJz)(9,Li,2,13,"ng-template",null,8,e.gJz)}2&n&&(e.yG2(),e.E7m("ngClass",e.S45(4,ve,o.hasError())),e.yG2(3),e.E7m("ngClass",e.S45(6,ve,o.hasError()))("ngModel",o.value()),e.yG2(2),e.C0Y(6,o.value()?6:-1))},dependencies:[f.MD,f.QF,_.cT,_.a0,_._r,_.kB,c.y,c.ot,c.ue,c._G],styles:[".custom-day[_ngcontent-%COMP%]{text-align:center;padding:.185rem .25rem;display:inline-block;height:2rem;width:2rem}.custom-day.focused[_ngcontent-%COMP%]{background-color:#e6e6e6}.custom-day.range[_ngcontent-%COMP%], .custom-day[_ngcontent-%COMP%]:hover{background-color:#005eb8;color:#fff}.custom-day.range[_ngcontent-%COMP%]:hover:not(.range), .custom-day[_ngcontent-%COMP%]:hover:hover:not(.range){border-radius:10px}.custom-day.range.first[_ngcontent-%COMP%], .custom-day[_ngcontent-%COMP%]:hover.first{border-radius:10px 0 0 10px!important}.custom-day.range.last[_ngcontent-%COMP%], .custom-day.range.lastHover[_ngcontent-%COMP%], .custom-day[_ngcontent-%COMP%]:hover.last, .custom-day[_ngcontent-%COMP%]:hover.lastHover{border-radius:0 10px 10px 0!important}.custom-day.faded[_ngcontent-%COMP%]{background-color:#005eb888;border-radius:0}.custom-day.faded.hover[_ngcontent-%COMP%]{border-radius:0!important}.input-group[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:not(:first-child, .dropdown-menu[_ngcontent-%COMP%], .valid-tooltip[_ngcontent-%COMP%], .valid-feedback[_ngcontent-%COMP%], .invalid-tooltip[_ngcontent-%COMP%], .invalid-feedback)[_ngcontent-%COMP%]   [_ngcontent-%COMP%]:is(:last-child){margin-left:calc(var(--bs-border-width) * -1);border-radius:0 30px 30px 0!important;border-left:none!important}.input-group[_ngcontent-%COMP%]   .input-group-append[_ngcontent-%COMP%]{padding-right:.7rem}.input-group[_ngcontent-%COMP%]   .form-control[_ngcontent-%COMP%]:not(:last-child){margin-left:calc(var(--bs-border-width) * -1);border-left:none!important;border-radius:0!important;border-right:none!important}.scroller-mobile[_ngcontent-%COMP%]{height:calc(100vh - 162px - var(--app-safe-area-top) - var(--app-safe-area-bottom))}ngb-datepicker[_ngcontent-%COMP%]{display:block;border:none!important;border-radius:0!important}ngb-datepicker[_ngcontent-%COMP%]     .ngb-dp-header{background:none;border:none!important;border-radius:0!important}@media (max-width: 768px){ngb-datepicker[_ngcontent-%COMP%]     .ngb-dp-weekdays{position:sticky;top:0;background:#fff!important}}ngb-datepicker[_ngcontent-%COMP%]     .ngb-dp-month-name{background:none}ngb-datepicker[_ngcontent-%COMP%]     .ngb-dp-week{background:none}ngb-datepicker[_ngcontent-%COMP%]     .ngb-dp-weekday{font-style:normal!important}"]})}}return i})();var Bi=l(33712);function Vi(i,s){1&i&&(e.I0R(0,"div",16),e.OEk(1,"the field is required"),e.C$Y())}function Ni(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",6)(1,"div",7)(2,"div",8)(3,"label",9),e.wR5(4,"input",10),e.OEk(5),e.wVc(6,"translate"),e.wR5(7,"span",11),e.C$Y()(),e.wR5(8,"daterange-selector",12),e.I0R(9,"div",13),e.qCj("click",function(){const r=e.usT(t).$index,a=e.GaO();return e.CGJ(a.removeSeasonRow(r))}),e.wR5(10,"i",14),e.C$Y()(),e.yuY(11,Vi,2,0,"div",15),e.C$Y()}if(2&i){const t=s.$implicit,n=e.GaO();e.E7m("formGroup",t),e.yG2(5),e.oRS(" ",e.kDX(6,5,"Recurring")," "),e.yG2(3),e.E7m("hasError",n.toolsService.fieldIsInvalid(t,"value"))("dateFormat",t.value.recurring?"dd MMMM":"dd MMMM yyyy"),e.yG2(3),e.C0Y(11,n.toolsService.fieldHasError(t,"value","required")?11:-1)}}function qi(i,s){1&i&&(e.I0R(0,"div",17),e.OEk(1,"No seasons defined"),e.C$Y())}function ji(i,s){1&i&&e.wR5(0,"i",20)}const ye=i=>({"ms-4":i});function Hi(i,s){if(1&i&&(e.I0R(0,"div",18),e.yuY(1,ji,1,0,"i",19),e.OEk(2),e.wVc(3,"translate"),e.C$Y()),2&i){const t=e.GaO();e.E7m("ngClass",e.S45(5,ye,t.showOnlyEditor())),e.yG2(),e.C0Y(1,t.showOnlyEditor()?-1:1),e.yG2(),e.oRS(" ",e.kDX(3,3,"the seasons cannot overlap")," ")}}function Qi(i,s){1&i&&e.wR5(0,"i",20)}function Ji(i,s){if(1&i&&(e.I0R(0,"div",18),e.yuY(1,Qi,1,0,"i",19),e.OEk(2),e.wVc(3,"translate"),e.C$Y()),2&i){const t=e.GaO();e.E7m("ngClass",e.S45(5,ye,t.showOnlyEditor())),e.yG2(),e.C0Y(1,t.showOnlyEditor()?-1:1),e.yG2(),e.oRS(" ",e.kDX(3,3,"at least one season is required")," ")}}const Xi=i=>({"pb-3 px-3 max-width-body mx-auto mt-lg-2":i}),be=(i,s)=>{const t=i.value.value,n=s.value.value;return!(!n||t.to<n.from||t.from>n.to||(i.controls.value.setErrors({overlapSeasonDates:!0}),s.controls.value.setErrors({overlapSeasonDates:!0}),0))};let Ki=(()=>{class i extends C.mE{constructor(t,n){super(t,n),this.showOnlyEditor=(0,e.YhN)(!1),this.toolsService=(0,e.uUt)(x.qc),this.formBuilder=(0,e.uUt)(c.im),this.authSessionService=(0,e.uUt)(S.i),this.contentService=(0,e.uUt)(C.eu),this.buildForm()}getData(){return this.fieldSchoolSeasonRows.controls.map(t=>({target_id:t.value.target_id,field_season_start_date:this.toolsService.converDateToIsoDate(t.value.value.from),field_season_end_date:this.toolsService.converDateToIsoDate(t.value.value.to),field_season_recurring:t.value.recurring??!1}))}setData(t){t&&Array.isArray(t)&&(this.fieldSchoolSeasonRows.clear(),t.forEach(n=>this.addSeasonToFormGroup(n)))}validate(){return this.toolsService.markFormFieldsDirty(this.schoolSeasonForm),this.fieldSchoolSeasonRows.controls.forEac
1h(t=>{this.toolsService.markFormFieldsDirty(t)}),this.schoolSeasonForm.valid?m.Valid:m.Invalid}save(){const t={method:"patch",frags:[this.authSessionService.currentSchool()?.nid],headers:{"Content-Type":"application/json","X-CSRF-Token":C.So.Connection?.csrf_token??""}},n=this.fieldSchoolSeasonRows.controls.map(o=>({target_id:o.value.target_id,field_season_start_date:this.toolsService.converDateToIsoDate(o.value.value.from),field_season_end_date:this.toolsService.converDateToIsoDate(o.value.value.to),field_season_recurring:o.value.recurring??!1}));return 0===n.length?(0,p.of)(!0):this.request(t,"/api/v1/school/{nid}/seasons",{seasons:n}).pipe((0,v.k)(()=>(this.authSessionService.initProfile().subscribe(),!0)),(0,y.a)(()=>(0,p.of)(!1)))}addSeasonRow(){this.fieldSchoolSeasonRows.push(this.newSeasonRow()),this.fieldSchoolSeasonRows.valid||this.validate()}removeSeasonRow(t){this.fieldSchoolSeasonRows.removeAt(t)}newSeasonRow(t){return this.formBuilder.group({value:[t?.value,c.AQ.required],recurring:[t?.recurring??!1],target_id:[t?.target_id??null]})}get fieldSchoolSeasonRows(){return this.schoolSeasonForm?.get("seasons")}buildForm(){this.schoolSeasonForm=this.formBuilder.group({seasons:this.formBuilder.array([],[this.minOneSeasonValidator,this.overlapSeasonDatesValidator])}),this.authSessionService.currentSchool()?.field_seasons.forEach(t=>this.addSeasonToFormGroup(t))}addSeasonToFormGroup(t){this.fieldSchoolSeasonRows.push(this.newSeasonRow({value:{from:new Date(t.field_season_start_date),to:new Date(t.field_season_end_date)},recurring:t.field_season_recurring,target_id:t.target_id?.toString()}))}minOneSeasonValidator(t){return t.controls.some(r=>!!r.get("value")?.value)?null:{minOneSeason:!0}}overlapSeasonDatesValidator(t){let n=!1;const o=t.controls;for(const h of o)h.get("value")?.errors?.overlapSeasonDates&&h.get("value")?.setErrors(null);const r=o.length,a=[];for(let h=0;h<r;h++){const g=o[h];if(g.value.value){if(g.value.recurring){a.push(g);continue}for(let b=h+1;b<r;b++)n=n||be(g,o[b])}}const u=a.length;for(let h=0;h<u;h++)for(let g=h+1;g<u;g++)n=n||be(a[h],a[g]);return n?{overlapSeasonDates:!0}:null}static{this.\u0275fac=function(n){return new(n||i)(e.GI1(Bi.KK),e.GI1(e.AHE))}}static{this.\u0275cmp=e.In1({type:i,selectors:[["school-seasons-editor"]],inputs:{showOnlyEditor:[e.Wk5.SignalBased,"showOnlyEditor"]},standalone:!0,features:[e.eg9,e.UHJ],decls:13,vars:10,consts:[[3,"ngClass"],[1,"w-100",3,"formGroup"],["for","title","translate","",1,"mb-2"],["class","invalid-feedback",3,"ngClass"],[1,"d-flex","mt-1","mb-3","text-info","align-items-center","justify-content-center","pointer",3,"click"],[1,"icon-lg","icon","icon-plus-circle","me-1"],[1,"row","align-items-center",3,"formGroup"],[1,"d-flex","align-items-center"],[1,"form-check","m-0","me-2","mb-2"],[1,"form-check-label"],["type","checkbox","formControlName","recurring",1,"form-check-input"],[1,"form-check-sign"],["formControlName","value",1,"flex-fill",3,"hasError","dateFormat"],[1,"ms-2","p-0","text-success",3,"click"],[1,"icon-lg","icon","icon-times-circle"],["class","invalid-feedback ms-4","translate",""],["translate","",1,"invalid-feedback","ms-4"],[1,"text-center","w-100","mb-2","mb-3","fs-5","text-info"],[1,"invalid-feedback",3,"ngClass"],["class","icon-lg icon icon-exclamation-triangle me-1"],[1,"icon-lg","icon","icon-exclamation-triangle","me-1"],["class","row align-items-center",3,"formGroup"],["class","text-center w-100 mb-2 mb-3 fs-5 text-info"]],template:function(n,o){if(1&n&&(e.I0R(0,"div",0)(1,"form",1)(2,"label-info-point",2),e.OEk(3,"Opened Seasons"),e.C$Y(),e.c53(4,Ni,12,7,"div",21,e.oxv,!1,qi,2,0,"div",22),e.yuY(7,Hi,4,7,"div",3)(8,Ji,4,7,"div",3),e.I0R(9,"div",4),e.qCj("click",function(){return o.addSeasonRow()}),e.wR5(10,"i",5),e.OEk(11),e.wVc(12,"translate"),e.C$Y()()()),2&n){let r;e.E7m("ngClass",e.S45(8,Xi,!o.showOnlyEditor())),e.yG2(),e.E7m("formGroup",o.schoolSeasonForm),e.yG2(3),e.oho(null==(r=o.schoolSeasonForm.get("seasons"))?null:r.controls),e.yG2(3),e.C0Y(7,o.toolsService.fieldHasError(o.schoolSeasonForm,"seasons","overlapSeasonDates")?7:-1),e.yG2(),e.C0Y(8,o.toolsService.fieldHasError(o.schoolSeasonForm,"
1seasons","minOneSeason")?8:-1),e.yG2(3),e.oRS(" ",e.kDX(12,6,"Add new season row")," ")}},dependencies:[Ui,c.sl,c.sz,c.SU,c.ue,c.u,c.uW,c.Wo,d.O0,d.sD,d.eM,O.Y9,f.MD,f.QF]})}}return i})();var Wi=l(56316);function zi(i,s){1&i&&(e.I0R(0,"li",11),e.OEk(1,"Summary is required"),e.C$Y())}const Zi=(i,s)=>({min:i,actual:s});function en(i,s){if(1&i&&(e.I0R(0,"li"),e.OEk(1),e.wVc(2,"translate"),e.C$Y()),2&i){const t=e.GaO(2);e.yG2(),e.oRS(" ",e.g7$(2,1,"school_affiliation_form_summary_min_length_error",e.IBC(4,Zi,t.MIN_SUMMARY_LENGTH,t.currentCharCount()))," ")}}function tn(i,s){if(1&i&&(e.I0R(0,"div",9)(1,"div"),e.wR5(2,"i",10),e.OEk(3),e.wVc(4,"translate"),e.C$Y(),e.I0R(5,"ul"),e.yuY(6,zi,2,0,"li",11)(7,en,3,7),e.C$Y()()),2&i){const t=e.GaO();let n;e.yG2(3),e.oRS(" ",e.kDX(4,2,"Please fix the errors below:"),""),e.yG2(3),e.C0Y(6,null!=(n=t.summaryForm.get("body"))&&n.hasError("required")?6:t.toolsService.fieldHasError(t.summaryForm,"body","summaryMinLength")?7:-1)}}const nn=i=>({min:i});function J(i){return(i??"").replace(/<[^>]*>/g,"").trim()}function on(i){return s=>{const t=J(s.value??"");return t.length>=i?null:{summaryMinLength:{required:i,actual:t.length}}}}let sn=(()=>{class i{constructor(){this.MIN_SUMMARY_LENGTH=250,this.currentCharCount=(0,e.OCB)(0),this.showValidation=(0,e.OCB)(!1),this.toolsService=(0,e.uUt)(x.qc),this.authSessionService=(0,e.uUt)(S.i),this.contentService=(0,e.uUt)(C.eu),this.notificationsService=(0,e.uUt)(E.E),this.translateService=(0,e.uUt)(d.qS),this.formBuilder=(0,e.uUt)(c.im),this.summaryForm=this.formBuilder.group({body:[this.authSessionService.currentSchool()?.body??"",[c.AQ.required,on(250)]]}),this.authSessionService.currentSchool()?.body&&this.currentCharCount.set(J(this.authSessionService.currentSchool()?.body??"").length),this.summaryForm.get("body")?.valueChanges.subscribe(t=>{this.currentCharCount.set(J(t??"").length)})}validate(){return this.toolsService.markFormFieldsDirty(this.summaryForm),this.showValidation.set(!this.summaryForm.valid),this.summaryForm.valid?m.Valid:m.Invalid}getData(){return{body:this.summaryForm.get("body")?.value}}setData(t){t&&this.summaryForm.patchValue({body:t.body})}save(){const n={body:[{value:this.summaryForm.get("body")?.value,format:"basic_html",processed:null,summary:""}],type:"school"};return this.contentService.update(+(this.authSessionService.currentUserProfile?.school).id,n).pipe((0,v.k)(()=>(this.authSessionService.initProfile().subscribe(),!0)),(0,y.a)(()=>(this.notificationsService.notifyError(this.translateService.instant("There was an error saving the summary")),(0,p.of)(!1))))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-summary"]],standalone:!0,features:[e.UHJ],decls:13,vars:14,consts:[[1,"pb-3","px-3","max-width-body","mx-auto","mt-lg-2"],[3,"formGroup"],[1,"form-group"],["translate","",1,"fw-bold"],["formControlName","body",1,"w-100"],[1,"summary-hint","mt-3","text-muted","small"],[1,"icon","icon-info-circle","me-1","text-info"],[1,"ms-1","fw-bold"],["class","invalid-feedback d-block mt-1"],[1,"invalid-feedback","d-block","mt-1"],[1,"icon","icon-exclamation-triangle","me-1"],["translate",""]],template:function(n,o){1&n&&(e.I0R(0,"div",0)(1,"form",1)(2,"div",2)(3,"label-info-point",3),e.OEk(4,"Summary"),e.C$Y(),e.wR5(5,"app-ckeditor",4),e.C$Y()(),e.I0R(6,"p",5),e.wR5(7,"i",6),e.OEk(8),e.wVc(9,"translate"),e.I0R(10,"span",7),e.OEk(11),e.C$Y()(),e.yuY(12,tn,8,4,"div",8),e.C$Y()),2&n&&(e.yG2(),e.E7m("formGroup",o.summaryForm),e.yG2(7),e.oRS(" ",e.g7$(9,9,"school_affiliation_form_summary_hint",e.S45(12,nn,o.MIN_SUMMARY_LENGTH))," "),e.yG2(2),e.eAK("text-danger",o.currentCharCount()<o.MIN_SUMMARY_LENGTH)("text-green",o.currentCharCount()>=o.MIN_SUMMARY_LENGTH),e.yG2(),e.CAO(" (",o.currentCharCount(),"/",o.MIN_SUMMARY_LENGTH,") "),e.yG2(),e.C0Y(12,o.showValidation()?12:-1))},dependencies:[O.kT,d.eM,H.Y,Wi.U,d.sD,c.sl,c.sz,c.ue,c.u,c.uW,c.Wo],styles:["[_nghost-%COMP%]{display:block}.summary-hint[_ngcontent-%COMP%]{line-height:1.5}"]})}}return i})();var rn=l(52880),xe=l(19432),an=l(2924),ln=l(24112),cn=l(11484);function dn(i,s){1&i&&(e.I0R(0,"div",17),e.wR5(1,"circular-spinner",18),e.C$Y())}const we=(i,s)=>s.uid;function mn(i,s){if(1&i&&(e.I0R(0,"div",30),e.wR5(1,"i",31),e.OEk(2),e.wVc(3,"entitiesHtml"),e.C$Y()),2&i){const t=e.GaO().$implicit;e.yG2(2),e.oRS("",e.kDX(3,1,(t.locality?t.locality+", ":"")+t.country)," ")}}function un(i,s){1&i&&(e.I0R(0,"span",32),e.OEk(1,"In team"),e.C$Y())}function fn(i,s){if(1&i){const t=e.KQA();e.I0R(0,"button",33),e.qCj("click",function(){e.usT(t);const o=e.GaO().$implicit,r=e.GaO(2);return e.CGJ(r.toggleMember(o))}),e.wR5(1,"i",34),e.C$Y()}}function _n(i,s){if(1&i){const t=e.KQA();e.I0R(0,"button",35),e.qCj("click",function(){e.usT(t);const o=e.GaO().$implicit,r=e.GaO(2);return e.CGJ(r.toggleMember(o))}),e.wR5(1,"i",36),e.C$Y()}}function pn(i,s){if(1&i&&(e.I0R(0,"div",19)(1,"img",20),e.qCj("error",function(n){return n.target.src="/assets/images/blank-profile.png"}),e.C$Y(),e.I0R(2,"div",21)(3,"div",22),e.OEk(4),e.C$Y(),e.I0R(5,"div",23),e.wR5(6,"i",24),e.OEk(7),e.C$Y(),e.yuY(8,mn,4,3,"div",25),e.C$Y(),e.I0R(9,"div",26)(10,"div"),e.OEk(11),e.C$Y(),e.I0R(12,"div",27),e.OEk(13,"Students"),e.C$Y()(),e.I0R(14,"div",28),e.yuY(15,un,2,0,"span",29)(16,fn,2,0)(17,_n,2,0),e.C$Y()()),2&i){const t=s.$implicit,n=e.GaO(2);e.eAK("already-in-team",n.isAlreadyInTeam(t.uid))("selected",n.isSelected(t.uid
1)),e.yG2(),e.E7m("src",(null==t.user_picture?null:t.user_picture.square_md)||n.toolsService.createAvatarWithInitials(t.field_first_name,t.field_surname,46),e.K6U)("alt",t.field_first_name+" "+t.field_surname),e.yG2(3),e.CAO("",t.field_first_name," ",t.field_surname,""),e.yG2(3),e.oRS("",t.top_qualification||t.field_top_qualification," "),e.yG2(),e.C0Y(8,t.country?8:-1),e.yG2(3),e.cNF(t.field_certified_students),e.yG2(4),e.C0Y(15,n.isAlreadyInTeam(t.uid)?15:n.isSelected(t.uid)?16:17)}}function hn(i,s){if(1&i&&e.c53(0,pn,18,12,"div",37,we),2&i){const t=e.GaO();e.oho(t.results())}}function gn(i,s){1&i&&(e.I0R(0,"div",38),e.OEk(1,"No members found"),e.C$Y())}function Cn(i,s){1&i&&(e.I0R(0,"div",17),e.wR5(1,"i",39),e.I0R(2,"span",40),e.OEk(3,"Search for instructors to add to your team"),e.C$Y()())}function vn(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",43),e.wR5(1,"image-srcset",44),e.I0R(2,"span",45),e.OEk(3),e.C$Y(),e.I0R(4,"button",46),e.qCj("click",function(){const r=e.usT(t).$implicit,a=e.GaO(2);return e.CGJ(a.removeSelected(r.uid))}),e.wVc(5,"translate"),e.wR5(6,"i",47),e.C$Y()()}if(2&i){const t=s.$implicit,n=e.GaO(2);e.yG2(),e.E7m("width",36)("height",36)("item",t.user_picture)("onErrorImage",n.toolsService.createAvatarWithInitials(t.field_first_name,t.field_surname,46)),e.yG2(2),e.CAO(" ",t.field_first_name," ",t.field_surname," "),e.yG2(),e.E7m("title",e.kDX(5,7,"Remove"))}}function yn(i,s){if(1&i&&(e.I0R(0,"div",41)(1,"div",42),e.c53(2,vn,7,9,"div",48,we),e.C$Y()()),2&i){const t=e.GaO();e.yG2(2),e.oho(t.selectedMembers())}}let bn=(()=>{class i{constructor(){this.existingUids=[],this.searchText="",this.results=(0,e.OCB)([]),this.selectedMembers=(0,e.OCB)([]),this.isSearching=(0,e.OCB)(!1),this.hasSearched=(0,e.OCB)(!1),this.toolsService=(0,e.uUt)(x.qc),this.activeModal=(0,e.uUt)(_._6),this.viewService=(0,e.uUt)(C._M),this.search$=new Y.E,this.destroy$=new Y.E}ngOnInit(){this.search$.pipe((0,ln.o)(400),(0,cn.a)(),(0,xe.G)(t=>t.trim()?(this.isSearching.set(!0),this.viewService.get("/api/v1.2/members.json",{filters:{search_api_fulltext:t.trim(),"field_top_qualification[]":[2,40,42,43,44,45,34,39,4,35,36,37,46]},sorting:{sort_by:"search_api_relevance",sort_order:"DESC"}}).pipe((0,y.a)(()=>(0,p.of)([])))):(this.results.set([]),this.hasSearched.set(!1),this.isSearching.set(!1),(0,p.of)([]))),(0,I.a)(this.destroy$)).subscribe(t=>{this.results.set(t),this.isSearching.set(!1),this.hasSearched.set(!0)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onSearchInput(){this.search$.next(this.searchText)}triggerSearch(){this.search$.next(this.searchText)}isAlreadyInTeam(t){return this.existingUids.includes(t)}isSelected(t){return this.selectedMembers().some(n=>n.uid===t)}toggleMember(t){const n=this.selectedMembers();this.isSelected(t.uid)?this.selectedMembers.set(n.filter(o=>o.uid!==t.uid)):this.selectedMembers.set([...n,t])}removeSelected(t){this.selectedMembers.set(this.selectedMembers().filter(n=>n.uid!==t))}confirm(){this.activeModal.close(this.selectedMembers())}dismiss(){this.activeModal.dismiss()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-add-instructor-modal"]],inputs:{existingUids:"existingUids"},standalone:!0,features:[e.UHJ],decls:25,vars:13,consts:[[1,"modal-header","pt-1","position-relative"],["id","modal-confirm-title",1,"mt-2","modal-title","text-center","mx-auto"],["translate","",1,"d-inline-block","ms-1"],[1,"btn-close","btn-red",3,"click"],[1,"modal-body","flex-fill","d-flex","flex-column","flex-grow-1","overflow-hidden"],[1,"border-bottom","flex-shrink-0"],[1,"input-group","rounded-pill"],[1,"input-group-text"],[1,"icon","icon-search"],["type","text",1,"form-control","no-border",3,"placeholder","ngModel","ngModelChange","keyup.enter"],[1,"flex-fill","overflow-y-auto","px-3","pt-2"],["class","text-center py-4"],["class","border-top px-3 py-2 flex-shrink-0 selected-panel"],[1,"modal-footer","flex-shrink-0"],["translate","",1,"btn","btn-info","rounded-1",3,"click"],[1,"btn","btn-success","rounded-1",3,"disabled","click"],[1,"icon","icon-user-plus","me-1"],[1,"text-center","py-4"],["iconClass","icon-32 text-success"],[1,"d-flex","align-items-center","result-row","rounded","mb-2","px-3","py-2"],[1,"avatar","rounded-circle","flex-shrink-0",3,"src","alt","error"],[1,"flex-fill","ms-3","overflow-hidden"],[1,"text-truncate"],[1,"small","text-truncate"],[1,"icon","icon-award","me-1","text-success"],["class","extra-small text-truncate"],[1,"stats-col","text-center","small","flex-shrink-0","d-none","d-sm-block","me-3"],["translate","",1,"extra-small"],[1,"flex-shrink-0"],["class","small","translate",""],[1,"extra-small","text-truncate"],[1,"icon","icon-map-marker-alt","me-1"],["translate","",1,"small"],[1,"btn-sm","btn-link","text-secondary",3,"click"],[1,"icon","icon-check","icon-24"],[1,"btn-sm","btn-link","text-success",3,"click"],[1,"icon","icon-plus-circle-2","icon-24"],["class","d-flex align-items-center result-row rounded mb-2 px-3 py-2",3,"already-in-team","selected"],["translate","",1,"text-center","py-4"],[1,"icon","icon-search","icon-32","d-block","mb-2","text-success"],["translate",""],[1,"border-top","px-3","py-2","flex-shrink-0","selected-panel"],[1,"d-flex","flex-wrap","gap-2"],[1,"selected-chip","d-flex","align-items-center","bg-white","border","rounded-pill","px-2","py-1","shadow-sm"],["imgClass","selected-avatar rounded-circle flex-shrink-0","propertyName","square",3,"width","height","item","onErrorImage"],[1,"ms-1","small","text-truncate",2,"max-width","90px"],[1,"btn","btn-link","btn-sm","p-0","ms-1","text-danger","lh-1",3,"title","click"],[1,"icon","icon-times-circle"],["class","selected-chip d-flex align-items-center bg-white border rounded-pill px-2 py-1 shadow-sm"]],template:function(n,o){1&n&&(e.I0R(0,"div",0)(1,"h3",1)(2,"span",2),e.OEk(3," Add Instructors"),e.C$Y()(),e.I0R(4,"button",3),e.qCj("click",function(){return o.dismiss()}),e.C$Y()(),e.I0R(5,"div",4)(6,"div",5)(7,"div",6)(8,"span",7),e.
1wR5(9,"i",8),e.C$Y(),e.I0R(10,"input",9),e.iHE("ngModelChange",function(a){return e.kNx(o.searchText,a)||(o.searchText=a),a}),e.qCj("ngModelChange",function(){return o.onSearchInput()})("keyup.enter",function(){return o.triggerSearch()}),e.wVc(11,"translate"),e.C$Y()()(),e.I0R(12,"div",10),e.yuY(13,dn,2,0,"div",11)(14,hn,2,0)(15,gn,2,0)(16,Cn,4,0),e.C$Y(),e.yuY(17,yn,4,0,"div",12),e.I0R(18,"div",13)(19,"button",14),e.qCj("click",function(){return o.dismiss()}),e.OEk(20,"Cancel"),e.C$Y(),e.I0R(21,"button",15),e.qCj("click",function(){return o.confirm()}),e.wR5(22,"i",16),e.OEk(23),e.wVc(24,"translate"),e.C$Y()()()),2&n&&(e.yG2(10),e.E7m("placeholder",e.kDX(11,9,"Search by name, qualification\u2026")),e.OKB("ngModel",o.searchText),e.yG2(2),e.eAK("has-selection",o.selectedMembers().length),e.yG2(),e.C0Y(13,o.isSearching()?13:o.results().length?14:o.hasSearched()?15:16),e.yG2(4),e.C0Y(17,o.selectedMembers().length?17:-1),e.yG2(4),e.E7m("disabled",!o.selectedMembers().length),e.yG2(2),e.CAO(" ",e.kDX(24,11,"Confirm")," (",o.selectedMembers().length,") "))},dependencies:[f.MD,c.y,c.ot,c.ue,c._G,d.O0,d.sD,d.eM,$.I,Q.A,j.y,ne.s],styles:["[_nghost-%COMP%]{max-height:70vh;min-height:70vh}@media (max-width: 575.98px){[_nghost-%COMP%]{height:100dvh;min-height:100dvh;max-height:100dvh}}[_nghost-%COMP%]   .modal-body[_ngcontent-%COMP%]{min-height:0}@media (max-width: 575.98px){[_nghost-%COMP%]{margin:0;max-width:100%;height:100%}[_nghost-%COMP%]   .modal-content[_ngcontent-%COMP%]{height:100%;max-height:100vh;border-radius:0}}.result-row[_ngcontent-%COMP%]{background-color:#0000000a;transition:background-color .15s ease}.result-row[_ngcontent-%COMP%]:hover{background-color:#00000014}.result-row.selected[_ngcontent-%COMP%]{background-color:rgb(var(--bs-success-rgb)/10%)}.result-row.already-in-team[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.avatar[_ngcontent-%COMP%]{width:46px;height:46px;object-fit:cover}.stats-col[_ngcontent-%COMP%]{min-width:56px}.extra-small[_ngcontent-%COMP%]{font-size:.7rem}.selected-panel[_ngcontent-%COMP%]{max-height:150px;overflow-y:auto}.selected-chip[_ngcontent-%COMP%]{max-width:200px}.selected-avatar[_ngcontent-%COMP%]{width:24px;height:24px;object-fit:cover}"]})}}return i})();function Sn(i,s){if(1&i){const t=e.KQA();e.I0R(0,"error-message",1),e.qCj("goBackButtonAction",function(){e.usT(t);const o=e.GaO();return e.CGJ(o.reloadTeam())}),e.wVc(1,"translate"),e.wVc(2,"translate"),e.C$Y()}2&i&&e.E7m("message",e.kDX(1,2,"An error occurred while loading the team. Please try again later."))("goBackButtonText",e.kDX(2,4,"Reload"))}function xn(i,s){1&i&&(e.I0R(0,"div",9),e.wR5(1,"wind-guts-loader"),e.C$Y())}const B=(i,s)=>s.uid;function wn(i,s){1&i&&(e.I0R(0,"div",23),e.wR5(1,"wind-guts-loader"),e.C$Y())}function kn(i,s){1&i&&(e.wR5(0,"div",5),e.I0R(1,"div",40)(2,"span",41),e.wR5(3,"i",42),e.OEk(4),e.wVc(5,"translate"),e.C$Y()()),2&i&&(e.yG2(4),e.oRS(" ",e.kDX(5,1,"Manager"),""))}function On(i,s){if(1&i&&(e.I0R(0,"span",43),e.OEk(1),e.wVc(2,"translate"),e.C$Y()),2&i){const t=e.GaO().$implicit;e.yG2(),e.CAO("",e.kDX(2,2,"Active")," + ",t.field_user_insured,"")}}function Tn(i,s){if(1&i&&(e.I0R(0,"span",44),e.OEk(1),e.C$Y()),2&i){const t=e.GaO().$implicit;e.yG2(),e.oRS(" ",t.expired?"EXPIRED":"SUSPENDED"," ")}}function Rn(i,s){if(1&i&&(e.wR5(0,"i",45),e.wVc(1,"translate")),2&i){const t=e.GaO().$implicit;e.u6R("ngbTooltip","",e.kDX(1,2,"Active")," + ",t.field_user_insured," ")}}function In(i,s){if(1&i&&(e.wR5(0,"i",46),e.wVc(1,"translate")),2&i){const t=e.GaO().$implicit;e.E7m("ngbTooltip",e.kDX(1,1,t.expired?"EXPIRED":"SUSPENDED"))}}function Gn(i,s){if(1&i){const t=e.KQA();e.I0R(0,"i",48),e.qCj("click",function(){e.usT(t);const o=e.GaO(2).$implicit,r=e.GaO(4);return e.CGJ(r.setManager(o.uid))}),e.wVc(1,"translate"),e.C$Y()}2&i&&e.E7m("ngbTooltip",e.kDX(1,1,"Set as manager"))}function Yn(i,s){1&i&&e.wR5(0,"i",49)}function En(i,s){if(1&i&&e.yuY(0,Gn,2,3,"i",47)(1,Yn,1,0),2&i){const t=e.GaO().$implicit,n=e.GaO(4);e.C0Y(0,t.uid!==n.currentManagerUID()&&t.canBeManager?0:1)}}function Mn(i,s){1&i&&e.wR5(0,"circular-spinner",50)}function Dn(i,s){if(1&i){const t=e.KQA();e.I0R(0,"i",51),e.qCj("click",function(){e.usT(t);const o=e.GaO().$implicit,r=e.GaO(4);return e.CGJ(r.downloadDiploma(o))}),e.wVc(1,"translate"),e.C$Y()}2&i&&e.E7m("ngbTooltip",e.kDX(1,1,"Download diploma"))}function Fn(i,s){if(1&i){const t=e.KQA();e.I0R(0,"tr",24)(1,"td",25)(2,"div",26),e.wR5(3,"image-srcset",27),e.I0R(4,"div",28),e.OEk(5),e.wR5(6,"br"),e.I0R(7,"span",29),e.OEk(8),e.C$Y()(),e.yuY(9,kn,6,3),e.C$Y()(),e.I0R(10,"td",30),e.wR5(11,"i",31),e.OEk(12),e.C$Y(),e.I0R(13,"td",32),e.OEk(14),e.C$Y(),e.I0R(15,"td",33),e.yuY(16,On,3,4,"span",34)(17,Tn,2,1),e.C$Y(),e.I0R(18,"td",35),e.yuY(19,Rn,2,4,"i",36)(20,In,2,3),e.C$Y(),e.I0R(21,"td",37),e.yuY(22,En,2,1),e.I0R(23,"i",38),e.qCj("click",function(){const r=e.usT(t).$implicit,a=e.GaO(4);return e.CGJ(a.stageRemove(r.uid))}),e.wVc(24,"translate"),e.C$Y(),e.yuY(25,Mn,1,0,"circular-spinner",39)(26,Dn,2,3),e.C$Y()()}if(2&i){const t=s.$implicit,n=e.GaO(4);e.yG2(3),e.E7m("width",36)("height",36)("item",t.user_picture)("onErrorImage",n.toolsService.createAvatarWithInitials(t.field_first_name,t.field_surname,36)),e.yG2(2),e.CAO(" ",t.field_first_name," ",t.field_surname," "),e.yG2(3),e.oRS("(",t.uid,")"),e.yG2(),e.C0Y(9,t.uid===n.currentManagerUID()?9:-1),e.yG2(3),e.oRS("",t.field_top_qualification_export||(null==t.current_role?null:t.current_role.display_name)," "),e.yG2(2),e.cNF(t.employment_from),e.yG2(2),e.C0Y(16,t.active?16:17),e.yG2(3),e.C0Y(19,t.active?19:20),e.yG2(3),e.C0Y(22,n.mustSetManager()?22:-1),e.yG2(),e.E7m("ngbTooltip",e.kDX(24,15,"Remove from team")),e.yG2(2),e.C0Y(25,n.downloadingDiplomaUid()===t.uid?25:n.canDownloadDiploma(t)?26:-1)}}function $n(i,s){if(1&i&&(e.I0R(0,"div",15),e.yuY(1,wn,2,0,"div",16),e.I0R(2,"div",17)(3,"table",18)(4,"thead",19)(5,"tr")(6,"th",20),e.OEk(7,"Full Name"),e.C$Y(),e.I0R(8,"th",21),e.OEk(9,"Qualification"),e.C$Y(),e.I0R(10,"th",21),e.OEk(11,"Start Date"),e.C$Y(),e.I0R(12,"th",20),e.OEk(13,"Status"),e.C$Y(),e.I0R(14,"th",22),e.OEk(15,"Actions"),e.C$Y()()(),e.I0R(16,"tbody"),e.c53(17,Fn,27,17,"tr",52,B),e.C$Y()()()()),2&i){const t=e.GaO(3);e.yG2(),e.C0Y(1,t.isSettingManager()?1:-1),e.yG2(16),e.oho(t.activeTeam())}}function An(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",53)(1,"h4",22),e.OEk(2,"No active instructors on your school"),e.C$Y(),e.I0R(3,"button",54),e.qCj("click",function(){e.usT(t);const o=e.GaO(3);return e.CGJ(o.openAddModal())}),e.wR5(4,"i",55),e.I0R(5,"span",22),e.OEk(6,"Add Instructors"),e.C$Y()()()}}function Pn(i,s){if(1&i){const t=e.KQA();e.I0R(0,"tr",24)(1,"td",25)(2,"div",26),e.wR5(3,"image-srcset",27),e.OEk(4),e.C$Y()(),e.I0R(5,"td",30),e.wR5(6,"i",31),e.OEk(7),e.C$Y(),e.I0R(8,"td",37)(9,"
1i",60),e.qCj("click",function(){const r=e.usT(t).$implicit,a=e.GaO(4);return e.CGJ(a.removeNewMember(r.uid))}),e.C$Y()()()}if(2&i){const t=s.$implicit,n=e.GaO(4);e.yG2(3),e.E7m("width",36)("height",36)("item",t.user_picture)("onErrorImage",n.toolsService.createAvatarWithInitials(t.field_first_name,t.field_surname,36)),e.yG2(),e.CAO(" ",t.field_first_name," ",t.field_surname," "),e.yG2(3),e.oRS("",t.top_qualification||t.field_top_qualification," ")}}function Ln(i,s){if(1&i&&(e.I0R(0,"div",10)(1,"h3",56)(2,"span",22),e.OEk(3,"Pending Addition"),e.C$Y(),e.I0R(4,"span",57),e.OEk(5),e.C$Y()(),e.I0R(6,"div",17)(7,"table",18)(8,"thead",19)(9,"tr")(10,"th",20),e.OEk(11,"Full Name"),e.C$Y(),e.I0R(12,"th",21),e.OEk(13,"Qualification"),e.C$Y(),e.I0R(14,"th",22),e.OEk(15,"Actions"),e.C$Y()()(),e.I0R(16,"tbody"),e.c53(17,Pn,10,7,"tr",52,B),e.C$Y()()(),e.I0R(19,"p",58),e.wR5(20,"i",59),e.I0R(21,"span",22),e.OEk(22,"These members will be added when you save."),e.C$Y()()()),2&i){const t=e.GaO(3);e.yG2(5),e.oRS("(",t.newMembers().length,")"),e.yG2(12),e.oho(t.newMembers())}}function Un(i,s){if(1&i){const t=e.KQA();e.I0R(0,"tr",63)(1,"td",25)(2,"div",26),e.wR5(3,"image-srcset",27),e.I0R(4,"span",64),e.OEk(5),e.C$Y()()(),e.I0R(6,"td",30),e.OEk(7),e.C$Y(),e.I0R(8,"td",32),e.OEk(9),e.C$Y(),e.I0R(10,"td",37)(11,"i",65),e.qCj("click",function(){const r=e.usT(t).$implicit,a=e.GaO(4);return e.CGJ(a.undoRemove(r.uid))}),e.C$Y()()()}if(2&i){const t=s.$implicit;e.yG2(3),e.E7m("width",36)("height",36)("item",t.user_picture)("onErrorImage","/assets/images/blank-profile.png"),e.yG2(2),e.CAO("",t.field_first_name," ",t.field_surname,""),e.yG2(2),e.oRS(" ",t.field_top_qualification_export||(null==t.current_role?null:t.current_role.display_name)," "),e.yG2(2),e.oRS(" ",t.employment_from," ")}}function Bn(i,s){if(1&i&&(e.I0R(0,"div",61)(1,"h3",56)(2,"span",22),e.OEk(3,"Pending Removal"),e.C$Y(),e.I0R(4,"span",62),e.OEk(5),e.C$Y()(),e.I0R(6,"div",17)(7,"table",18)(8,"thead",19)(9,"tr")(10,"th",20),e.OEk(11,"Full Name"),e.C$Y(),e.I0R(12,"th",21),e.OEk(13,"Qualification"),e.C$Y(),e.I0R(14,"th",21),e.OEk(15,"Start Date"),e.C$Y(),e.I0R(16,"th",22),e.OEk(17,"Actions"),e.C$Y()()(),e.I0R(18,"tbody"),e.c53(19,Un,12,8,"tr",66,B),e.C$Y()()(),e.I0R(21,"p",58),e.wR5(22,"i",59),e.I0R(23,"span",22),e.OEk(24,"These members will be removed when you save."),e.C$Y()()()),2&i){const t=e.GaO(3);e.yG2(5),e.oRS("(",t.removedTeam().length,")"),e.yG2(14),e.oho(t.removedTeam())}}function Vn(i,s){if(1&i&&(e.I0R(0,"span",43),e.OEk(1),e.wVc(2,"translate"),e.C$Y()),2&i){const t=e.GaO().$implicit;e.yG2(),e.CAO("",e.kDX(2,2,"Active")," + ",t.field_user_insured,"")}}function Nn(i,s){if(1&i&&(e.I0R(0,"span",44),e.OEk(1),e.C$Y()),2&i){const t=e.GaO().$implicit;e.yG2(),e.oRS(" ",t.expired?"EXPIRED":"SUSPENDED"," ")}}function qn(i,s){if(1&i&&(e.wR5(0,"i",45),e.wVc(1,"translate")),2&i){const t=e.GaO().$implicit;e.u6R("ngbTooltip","",e.kDX(1,2,"Active")," + ",t.field_user_insured," ")}}function jn(i,s){if(1&i&&(e.wR5(0,"i",46),e.wVc(1,"translate")),2&i){const t=e.GaO().$implicit;e.E7m("ngbTooltip",e.kDX(1,1,t.expired?"EXPIRED":"SUSPENDED"))}}function Hn(i,s){if(1&i&&(e.I0R(0,"tr",24)(1,"td",25)(2,"div",26),e.wR5(3,"image-srcset",27),e.I0R(4,"div",28),e.OEk(5),e.wR5(6,"br"),e.I0R(7,"span",29),e.OEk(8),e.C$Y()()()(),e.I0R(9,"td",30),e.wR5(10,"i",31),e.OEk(11),e.C$Y(),e.I0R(12,"td",32),e.OEk(13),e.C$Y(),e.I0R(14,"td",67),e.OEk(15),e.C$Y(),e.I0R(16,"td",33),e.yuY(17,Vn,3,4,"span",34)(18,Nn,2,1),e.C$Y(),e.I0R(19,"td",35),e.yuY(20,qn,2,4,"i",36)(21,jn,2,3),e.C$Y()()),2&i){const t=s.$implicit,n=e.GaO(4);e.yG2(3),e.E7m("width",36)("height",36)("item",t.user_picture)("onErrorImage",n.toolsService.createAvatarWithInitials(t.field_first_name,t.field_surname,36)),e.yG2(2),e.CAO(" ",t.field_first_name," ",t.field_surname," "),e.yG2(3),e.oRS("(",t.uid,")"),e.yG2(3),e.oRS("",t.field_top_qualification_export||(null==t.current_role?null:t.current_role.display_name)," "),e.yG2(2),e.cNF(t.employment_from),e.yG2(2),e.cNF(t.employment_to),e.yG2(2),e.C0Y(17,t.active?17:18),e.yG2(3),e.C0Y(20,t.active?20:21)}}function Qn(i,s){if(1&i&&(e.I0R(0,"div",10)(1,"h3",11),e.OEk(2,"Past Team"),e.C$Y(),e.I0R(3,"div",17)(4,"table",18)(5,"thead",19)(6,"tr")(7,"th",20),e.OEk(8,"Full Name"),e.C$Y(),e.I0R(9,"th",21),e.OEk(10,"Qualification"),e.C$Y(),e.I0R(11,"th",21),e.OEk(12,"Start Date"),e.C$Y(),e.I0R(13,"th",21),e.OEk(14,"End Date"),e.C$Y(),e.I0R(15,"th",20),e.OEk(16,"Status"),e.C$Y()()(),e.I0R(17,"tbody"),e.c53(18,Hn,22,12,"tr",52,B),e.C$Y()()()()),2&i){const t=e.GaO(3);
1e.yG2(18),e.oho(t.pastTeam())}}function Jn(i,s){if(1&i&&(e.I0R(0,"div",10)(1,"h3",11),e.OEk(2,"Current Team"),e.C$Y(),e.yuY(3,$n,19,1,"div",12)(4,An,7,0),e.C$Y(),e.yuY(5,Ln,23,1,"div",13)(6,Bn,25,1,"div",14)(7,Qn,20,0,"div",13)),2&i){const t=e.GaO(2);e.yG2(3),e.C0Y(3,t.activeTeam().length?3:4),e.yG2(2),e.C0Y(5,t.newMembers().length?5:-1),e.yG2(),e.C0Y(6,t.removedTeam().length?6:-1),e.yG2(),e.C0Y(7,t.pastTeam().length&&t.mustShowPastTeam()?7:-1)}}function Xn(i,s){1&i&&e.wR5(0,"circular-spinner")}function Kn(i,s){1&i&&e.OEk(0," Save ")}function Wn(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",68)(1,"div",69)(2,"button",70),e.qCj("click",function(){e.usT(t);const o=e.GaO(2);return e.CGJ(o.cancel())}),e.OEk(3," Cancel "),e.C$Y()(),e.wR5(4,"div",71),e.I0R(5,"div",72)(6,"button",73),e.qCj("click",function(){e.usT(t);const o=e.GaO(2);return e.CGJ(o.localSave())}),e.yuY(7,Xn,1,0,"circular-spinner")(8,Kn,1,0),e.C$Y()()()}if(2&i){const t=e.GaO(2);e.yG2(2),e.E7m("disabled",t.isSaving()),e.yG2(4),e.E7m("disabled",t.isSaving()),e.yG2(),e.C0Y(7,t.isSaving()?7:8)}}const zn=i=>({"container-fluid flex-fill p-0 mb-5 overflow-scroll position-relative":i});function Zn(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",2)(1,"button",3),e.qCj("click",function(){e.usT(t);const o=e.GaO();return e.CGJ(o.openAddModal())}),e.wVc(2,"translate"),e.wR5(3,"i",4),e.C$Y(),e.I0R(4,"div",5)(5,"div",6),e.wR5(6,"alert-banner"),e.C$Y(),e.yuY(7,xn,2,0,"div",7)(8,Jn,8,4),e.C$Y(),e.yuY(9,Wn,9,3,"div",8),e.C$Y()}if(2&i){const t=e.GaO();e.E7m("ngClass",e.S45(6,zn,t.showBottomBar())),e.yG2(),e.E7m("title",e.kDX(2,4,"Add Members")),e.yG2(6),e.C0Y(7,t.isLoading()?7:8),e.yG2(2),e.C0Y(9,t.showBottomBar()&&t.hasPendingChanges()?9:-1)}}let X=(()=>{class i{constructor(){this.mustShowPastTeam=(0,e.YhN)(!1),this.mustSetManager=(0,e.YhN)(!1),this.showBottomBar=(0,e.YhN)(!1),this.initialTeam=(0,e.OCB)([]),this.removedUids=(0,e.OCB)([]),this.newMembers=(0,e.OCB)([]),this.isLoading=(0,e.OCB)(!0),this.isSaving=(0,e.OCB)(!1),this.currentManagerUID=(0,e.OCB)(null),this.isSettingManager=(0,e.OCB)(!1),this.downloadingDiplomaUid=(0,e.OCB)(null),this.activeTeam=(0,e.S6b)(()=>this.initialTeam().filter(t=>!this.removedUids().includes(t.uid))),this.removedTeam=(0,e.S6b)(()=>this.initialTeam().filter(t=>this.removedUids().includes(t.uid))),this.hasPendingChanges=(0,e.S6b)(()=>this.newMembers().length>0||this.removedUids().length>0),this.pastTeam=(0,e.OCB)([]),this.toolsService=(0,e.uUt)(x.qc),this.schoolTeamService=(0,e.uUt)(fe.e),this.occupiedUids=(0,e.S6b)(()=>[...this.activeTeam().map(t=>t.uid),...this.newMembers().map(t=>t.uid)]),this.ngbModal=(0,e.uUt)(_.Z6),this.notificationsService=(0,e.uUt)(E.E),this.modalManagerService=(0,e.uUt)(U.kr),this.translateService=(0,e.uUt)(d.qS),this.authSessionService=(0,e.uUt)(S.i),this.unsubScribeAll=new Y.E,this.schoolTeamService.getTeam().subscribe(),this.schoolTeamService.team$.pipe((0,I.a)(this.unsubScribeAll)).subscribe(t=>{t&&(this.initialTeam.set(t),this.isLoading.set(!1))}),this.schoolTeamService.expiredTeam$.pipe((0,I.a)(this.unsubScribeAll)).subscribe(t=>{t&&this.pastTeam.set(t)}),this.authSessionService.currentSchool()?.school_manager&&this.currentManagerUID.set(this.authSessionService.currentSchool()?.school_manager)}ngOnDestroy(){this.unsubScribeAll.next(),this.unsubScribeAll.complete()}validate(){return this.newMembers().length||this.activeTeam().length?m.Valid:(this.alertBanner?.setBanner({type:"warning",message:this.translateService.instant("You should add at least one team member to meet IKO requirements. Please add a member with a Level 2 qualification before saving.")}),m.Handled)}getData(){return{newMembers:this.newMembers(),removedUids:this.removedUids()}}setData(t){t?.newMembers&&this.newMembers.set(t.newMembers),t?.removedUids&&this.removedUids.set(t.removedUids)}setConfiguration(t){t?.banner&&this.alertBanner?.setBanner(t.banner)}save(){const t=this.newMembers(),n=this.removedUids();if(0===t.length&&0===n.length)return(0,p.of)(!0);this.isSaving.set(!0);const o=this.occupiedUids();return this.schoolTeamService.checkL2Uids(o).pipe((0,A.m)(r=>r?this.schoolTeamService.bulkEdit(t.map(a=>a.uid),n).pipe((0,v.k)(a=>
1a.status?(this.isSaving.set(!1),this.notificationsService.notifySuccess(this.translateService.instant("Team updated successfully")),!0):(this.alertBanner?.setBanner({message:a.message||this.translateService.instant("An error occurred while updating the team. Please try again."),type:"danger"}),!1)),(0,y.a)(a=>{let u="";const h=JSON.parse(a.error?.message||"false");if(h){switch(a?.status){case 409:case 412:u=this.translateService.instant("managing_members.error-"+a?.status,h)}u&&this.alertBanner?.setBanner({message:u,type:"danger"})}return this.isSaving.set(!1),(0,p.of)(!1)})):(this.isSaving.set(!1),this.alertBanner?.setBanner({message:"At least one team member must have a Level 2 qualification to meet IKO requirements.",type:"warning"}),(0,p.of)(!1))))}reloadTeam(){this.schoolTeamService.getTeam().subscribe()}downloadDiploma(t){if(this.downloadingDiplomaUid()||!this.canDownloadDiploma(t))return;this.downloadingDiplomaUid.set(t.uid);const n={id:Number(t.uid),certification_date:t.last_certification_date??t.employment_from??"",training_level:t.field_top_qualification_export,type:t.current_role?.id?.toString()??"team_member"};this.modalManagerService.open(U.SC.diploma,{...n,hideExpiration:!0,user:{uid:t.uid,field_first_name:t.field_first_name,field_surname:t.field_surname}}).subscribe({next:()=>{this.downloadingDiplomaUid.set(null)},error:()=>{this.notificationsService.notifyError(this.translateService.instant("An error occurred when generating your diploma")),this.downloadingDiplomaUid.set(null)}})}canDownloadDiploma(t){return!!t.field_top_qualification_export&&!t.expired&&!t.suspended&&!1!==t.active}localSave(){this.save().pipe((0,xe.G)(t=>t?(this.isLoading.set(!0),this.cancel(),(0,p.of)(!0).pipe((0,an.o)(1e3),(0,A.m)(()=>this.schoolTeamService.getTeam()))):(this.notificationsService.notifyError(this.translateService.instant("An error occurred while updating the team. Please try again.")),(0,p.of)(!1))),(0,y.a)(()=>(this.notificationsService.notifyError(this.translateService.instant("An error occurred while loading the team. Please try again.")),this.isLoading.set(!1),(0,p.of)(!1)))).subscribe(()=>{this.isLoading.set(!1)})}cancel(){this.alertBanner?.setBanner(null),this.newMembers.set([]),this.removedUids.set([])}openAddModal(){const t=this.ngbModal.open(bn,{size:"lg",centered:!0,scrollable:!0});t.componentInstance.existingUids=[...this.occupiedUids(),...this.removedUids()],t.result.then(n=>{n?.length&&(this.newMembers.set([...this.newMembers(),...n]),this.alertBanner?.setBanner(null))},()=>{})}stageRemove(t){this.alertBanner?.setBanner(null),this.removedUids().includes(t)||this.removedUids.set([...this.removedUids(),t])}undoRemove(t){this.alertBanner?.setBanner(null),this.removedUids.set(this.removedUids().filter(n=>n!==t))}removeNewMember(t){this.alertBanner?.setBanner(null),this.newMembers.set(this.newMembers().filter(n=>n.uid!==t))}setManager(t){this.isSettingManager.set(!0),this.schoolTeamService.setManager(t).pipe((0,I.a)(this.unsubScribeAll)).subscribe({next:n=>{n.status?this.currentManagerUID.set(t):this.notificationsService.notifyError(this.translateService.instant(n.error||"An error occurred while setting the manager. Please try again.")),this.isSettingManager.set(!1)},error:()=>{this.isSettingManager.set(!1)}})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["school-team"]],viewQuery:function(n,o){if(1&n&&e.CC$(P.g,5),2&n){let r;e.wto(r=e.Gqi())&&(o.alertBanner=r.first)}},inputs:{mustShowPastTeam:[e.Wk5.SignalBased,"mustShowPastTeam"],mustSetManager:[e.Wk5.SignalBased,"mustSetManager"],showBottomBar:[e.Wk5.SignalBased,"showBottomBar"]},standalone:!0,features:[e.UHJ],decls:2,vars:1,consts:[["class","flex-fill",3,"message","goBackButtonText"],[1,"flex-fill",3,"message","goBackButtonText","goBackButtonAction"],[3,"ngClass"],[1,"fab-add-members",3,"title","click"],[1,"icon","icon-user-plus"],[1,"flex-fill"],[1,"mx-3"],["class","text-center py-5"],["class","position-fixed bottom-0 button-affiliation z-index-2 d-flex justify-content-between align-items-center"],[1,"text-center","py-5"],[1,"px-3","pt-3"],["translate","",1,"text-primary","mb-1"],["class","position-relative"],["class","px-3 pt-3"],["class","px-3 pt-3 pb-3"],[1,"position-relative"],["class","table-loader-overlay d-flex align-items-center justify-content-center"],[1,"no-more-tables"],[1,"table","table-bordered","table-striped","table-condensed","cf"],[1,"cf"],["translate","",1,"border-end"],["translate","",1,"border-end","d-none","d-sm-table-cell"],["translate",""],[1,"table-loader-overlay","d-flex","align-items-center","justify-content-center"],[1,"small"],["data-title","Full Name"],[1,"d-flex","align-items-center","gap-2"],["imgClass","rounded-circle member-avatar","propertyName","square",3,"width","height","item","onErrorImage"],[1,"text-left"],[1,"member-id"],["data-title","Qualification",1,"d-none","d-sm-table-cell"],[1,"icon","icon-award","me-1","text-success"],["data-title","Start Date",1,"d-none","d-sm-table-cell"],["data-title","Status",1,"d-none","d-sm-table-cell"],["class","text-secondary"],["data-title","Status",1,"d-table-cell","d-sm-none"],["class","icon icon-check-circle text-secondary icon-20",3,"ngbTooltip"],["data-title","Actions",1,"text-center"],[1,"icon","icon-trash-alt","text-danger","cursor-pointer","icon-20",3,"ngbTooltip","click"],["iconClass","icon-20 text-success","class","ms-2"],[1,"text-right"],[1,"badge","bg-primary","text-white"],[1,"icon","icon-user-tie","me-1"],[1,"text-secondary"],["translate","",1,"text-danger"],[1,"icon","icon-check-circle","text-secondary","icon-20",3,"ngbTooltip"],[1,"text-danger","icon-times-circle","icon-20",3,"ngbTooltip"],["class","icon icon-user-tie me-2 text-primary curs
1or-pointer icon-20",3,"ngbTooltip"],[1,"icon","icon-user-tie","me-2","text-primary","cursor-pointer","icon-20",3,"ngbTooltip","click"],[1,"icon","icon-empty","me-2","text-primary","cursor-pointer","icon-20"],["iconClass","icon-20 text-success",1,"ms-2"],[1,"ms-2","icon","icon-cloud-download","text-primary","cursor-pointer","icon-20",3,"ngbTooltip","click"],["class","small"],[1,"text-center","mt-3","mb-2"],[1,"btn","btn-success","rounded","rounded-2","mt-2",3,"click"],[1,"icon","icon-user-plus","me-1"],[1,"text-primary","mb-1"],[1,"text-success","ms-1"],[1,"small","text-muted","mt-1","mb-0"],[1,"icon","icon-info-circle","me-1","text-info"],[1,"icon","icon-trash-alt","text-danger","cursor-pointer","icon-16",3,"click"],[1,"px-3","pt-3","pb-3"],[1,"text-danger","ms-1"],[1,"small","grey-text"],[1,"text-decoration-line-through"],[1,"icon","icon-trash-can-undo","text-danger","cursor-pointer","icon-20",3,"click"],["class","small grey-text"],["data-title","End Date",1,"d-none","d-sm-table-cell"],[1,"position-fixed","bottom-0","button-affiliation","z-index-2","d-flex","justify-content-between","align-items-center"],[1,"col-5","col-md-4","col-lg-2"],["translate","",1,"rounded-2","btn","btn-info","btn-block",3,"disabled","click"],[1,"d-flex","align-items-center","flex-fill","justify-content-center"],[1,"col-5","col-md-4","col-lg-2","ms-auto"],["for","submit-aff","translate","",1,"rounded-2","btn","btn-success","btn-block","ms-auto",3,"disabled","click"]],template:function(n,o){1&n&&e.yuY(0,Sn,3,6,"error-message",0)(1,Zn,10,8),2&n&&e.C0Y(0,o.schoolTeamService.hasError()?0:1)},dependencies:[f.MD,f.QF,d.O0,d.sD,d.eM,P.g,Q.A,_.AF,_.qi,M.s,$.I,rn.W,oe.gb],styles:["[_nghost-%COMP%]{display:block}.fab-add-members[_ngcontent-%COMP%]{position:fixed;bottom:80px;right:20px;z-index:1000;width:56px;height:56px;border-radius:50%;border:none;background-color:var(--bs-success);color:#fff;font-size:1.4rem;box-shadow:0 4px 12px #00000040;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}.fab-add-members[_ngcontent-%COMP%]:hover, .fab-add-members[_ngcontent-%COMP%]:focus{transform:scale(1.08);box-shadow:0 6px 16px #00000059;outline:none}.fab-add-members[_ngcontent-%COMP%]:active{transform:scale(.96)}  .member-avatar{width:36px;height:36px;min-width:36px;object-fit:cover;flex-shrink:0}.icon-empty[_ngcontent-%COMP%]{width:20px;height:20px;display:inline-block}.grey-text[_ngcontent-%COMP%]{color:#999}.member-id[_ngcontent-%COMP%]{font-size:.8em}.table-loader-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;background:#ffffffb3;z-index:10;border-radius:4px}.button-affiliation[_ngcontent-%COMP%]{width:100%;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}@media (min-width: 992px){.button-affiliation[_ngcontent-%COMP%]{width:75%}}"]})}}return i})();const D=[{step:1,title:"Owner",description:"Owner information",component:Yi,unlocked:!0,configuration:{hideEmail:!0,hidePassword:!0}},{step:2,title:"Online presence",description:"Online presence information about your school",component:yi,unlocked:!1,configuration:{}},{step:3,title:"Location",description:"Location information",component:ii,unlocked:!1},{step:4,title:"Gallery, Logo & Title",description:"Gallery information",component:et,unlocked:!1},{step:5,title:"Summary",description:"Summary information",component:sn,unlocked:!1},{step:6,title:"Opened season",description:"Opened season information",component:Ki,unlocked:!1},{step:7,title:"Facilities",description:"Facilities available at your school",component:Qe,unlocked:!1},{step:8,title:"Brands",description:"Brands available at your school",component:Ve,unlocked:!1},{step:9,title:"Team",description:"Manage your school instructors",component:X,unlocked:!1},{step:10,title:"Manager",description:"Who is the manager of the school?",component:_i,unlocked:!1},{step:11,title:"Insurance",description:"Insurance information",component:Vt,unlocked:!1},{step:12,title:"Equipment",description:"Equipment information",component:k,configuration:{title:"Equipment",subtitle:"IKO Centers commit to respect the IKO Standards.",webformName:"school_affiliation_form",fieldsToShow:["safety_information"],subfieldsToShow:{safety_information:{equipment_group:"iko_centers_commit_to_respect_the_iko_standards_tick_the_standar"}},hideFieldTitles:{safety_information:{equipment_group:["iko_centers_commit_to_respect_the_iko_standards_tick_the_standar"]}},fieldsSaveOnly:["safety_information"],submissionId:void 0,hostingClass:"p-3 d-block",extraValidation:i=>{const s=i.value?.safety_information?.equipment_group.iko_centers_commit_to_respect_the_iko_standards_tick_the_standar;if(!s)return"something wrong";for(const t in s)if(!s[t])return"affiliation_form.equipment.required_all_checkboxes";return!0}},unlocked:!1},{step:13,title:"Equipment Inventory",description:"Equipment Inventory information",component:k,configuration:{title:"Equipment Inventory",subtitle:"Add the information about the equipment you have in your inventory.",webformName:"school_affiliation_form",fieldsToShow:["safety_information"],subfieldsToShow:{safety_information:["equipment_inventory_group","equipment_photos_group"]},layout:{equipment_inventory_group:{element:{label:"d-none"}},equipment_inventory_intro:{element:{label:"d-none",container:"text-muted fw-normal small"}},inventory_flexbox_1:{element:{label:"d-none",control:"d-flex flex-column flex-lg-row"}},inventory_kites:{element:{host:"col-12 col-lg-4 px-0 pe-0 pe-lg-2"}},inventory_boards:{element:{host:"col-12 col-lg-4  px-0 px-lg-2"}},inventory_bars:{element:{host:"col-12 col-lg-4 px-0 ps-0 ps-lg-2"}},inventory_flexbox_2:{element:{label:"d-none",control:"d-flex flex-column flex-lg-row"}},inventory_bars_short_lines:{element:{host:"col-12 col-lg-4 px-0 pe-0 pe-lg-2"}},inventory_helmets:{element:{host:"col-12 col-lg-4  px-0 px-lg-2"}},inventory_buoyancy_aids:{element:{host:"col-12 col-lg-4 px-0 ps-0 ps-lg-2"}},inventory_flexbox_3:{element:{label:"d-none",control:"d-flex flex-column flex-lg-row"}},inventory_impact_vests:{element:{host:"col-12 col-lg-4 px-0 pe-0 pe-lg-2"}},inventory_line_cutters:{element:{host:"col-12 col-lg-4  px-0 px-lg-2"}},inventory_wetsuits:{element:{host:"col-12 col-lg-4 px-0 ps-0 ps-lg-2"}},inventory_flexbox_4:{element:{label:"d-none",control:"d-flex flex-column flex-lg-row"}},inventory_rashguards:{element:{host:"col-12 col-lg-4 px-0 pe-0 pe-lg-2"}},inventory_neoprene_shoes:{element:{host:"col-12 col-lg-4 px-0 ps-0 ps-lg-2"}},equipment_photos_group:{element:{host:"border-top border-1 border-muted mt-3 pt-3 d-block",label:"text-primary"}},inventory_photos:{element:{label:"text-muted small"}}},fieldsSaveOnly:["safety_information"],submissionId:void 0,hostingClass:"p-3 d-block",extraValidation:i=>{if(!i.valid)return!0;const s=i.value;return!!s?.safety_information?.equipment_photos_group?.inventory_photos&&(!(s.safety_information.equipment_photos_group.inventory_photos.length<3)||"affiliation_form.equipment_inventory.photos_minimum")}},unlocked:!1},{step:14,title:"Lessons Gallery",description:"Lessons Gallery information",component:k,configuration:{title:"Lessons Gallery",subtitle:"Upload the media about the lessons you offer.",webformName:"school_affiliation_form",fieldsToShow:["safety_information"],subfieldsToShow:{safety_information:{gallery_group:["gallery_intro","video_intermediate_lessons","video_discovery_lessons"]}},layout:{gallery_group:{element:{label:"d-none"}},gallery_intro:{element:{label:"d-none",container:"rounded-1 fw-normal border border-2 border-primary alert alert-info small"}},video_discovery_lessons:{element:{host:"border-top border-1 border-muted mt-3 pt-3 d-block",label:"text-primary"}},video_intermediate_lessons:{element:{host:"border-top border-1 border-muted mt-3 pt-3 d-block",label:"text-primary"}}},fieldsSaveOnly:["safety_information"],submissionId:void 0,hostingClass:"p-3 d-block",extraValidation:i=>{const s=i.value;return s.safety_information?.gallery_group?.video_discovery_lessons?!!s.safety_information?.gallery_group?.video_intermediate_lessons||"affiliation_form.video_intermediate_lessons.required":"affiliation_form.video_discovery_lessons.required"}},unlocked:!1},{step:15,title:"Boat",description:"Boat information",component:k,configuration:{title:"Boat",subtitle:"Enter the details about the lifeguards boat or station.",webformName:"school_affiliation_form",fieldsToShow:["safety_information"],subfieldsToShow:{safety_information:["boat_group"]},subfieldsToHide:{safety_information:{boat_group:["4_online_presence"]}},layout:{boat_group:{element:{label:"d-none"}},rescue_craft_equipped:{element:{label:"d-none"}},attestation_by_owner_of_usage:{element:{host:"border-top border-1 border-muted mt-3 pt-3 d-block",label:"text-primary"}},"3_6_or_upload_pictures_of_the_lifeguards_boats_and_station":{element:{host:"border-top border-1 border-muted mt-3 pt-3 d-block",label:"text-primary"}}},fieldsSaveOnly:["safety_information"],submissionId:void 0,hostingClass:"p-3 d-block",extraValidation:i=>{const s=i.value?.safety_information?.boat_group;return s?.rescue_craft_equipped?.rescue_craft_equipped_with_safety_devices?s?.boat_flexbox?.boat_specification?!!s.boat_flexbox_2?.boat_picture||"affiliation_form.boat.boat_picture.required":"affiliation_form.boat.boat_specification.required":!(!s?.boat_flexbox_2?.attestation_by_owner_of_usage&&!s?.boat_flexbox_2?.["3_6_or_upload_pictures_of_the_lifeguards_boats_and_station"])||"affiliation_form.boat.
1no_data_inserted"}},unlocked:!1},{step:16,title:"Accident Report",description:"Accident report information",component:k,configuration:{title:"Accident Report",subtitle:"Enter the details about the accident report.",webformName:"school_affiliation_form",fieldsToShow:["safety_information"],subfieldsToShow:{safety_information:{accident_report_group:["commits_to_iko_support_dep"]}},layout:{accident_report_group:{element:{label:"d-none"}},commits_to_iko_support_dep:{grid:{label:"d-none"}}},fieldsSaveOnly:["safety_information"],submissionId:void 0,hostingClass:"p-3 d-block",extraValidation:i=>!!i.value?.safety_information?.accident_report_group?.commits_to_iko_support_dep?.commits_to_iko_support_dep||"affiliation_form.accident_report.must_checked"},unlocked:!1},{step:17,title:"Emergency Contacts",description:"Emergency Contacts information",component:k,configuration:{title:"Emergency Contacts",subtitle:"Enter the details about the emergency contacts.",webformName:"school_affiliation_form",fieldsToShow:["emergency_action_plan"],subfieldsToShow:{emergency_action_plan:["contacts_group"]},layout:{contacts_group:{element:{label:"d-none"}},set_safety_and_rescue_procedures:{grid:{label:"d-none"}},displays_emergency_phone_numbers:{grid:{label:"d-none"}}},fieldsSaveOnly:["emergency_action_plan"],submissionId:void 0,hostingClass:"p-3 d-block",extraValidation:i=>{const s=i.value?.emergency_action_plan?.contacts_group;return!!(s.displays_emergency_phone_numbers.displays_emergency_phone_numbers&&s.set_safety_and_rescue_procedures.set_safety_and_rescue_procedures&&s.contacts_flex_1?.case_of_emergency_call&&s.contacts_flex_1?.nearest_hospital_address_phone&&s.contacts_flex_2?.ambulance_address_phone&&s.contacts_flex_2?.lifeguards_coastguards_address_phone)||"affiliation_form.contacts_group.no_data_inserted"}},unlocked:!1},{step:18,title:"Communication Equipment",description:"Communication Equipment information",component:k,configuration:{title:"Communication Equipment",subtitle:"Enter the details about the communication equipment.",webformName:"school_affiliation_form",fieldsToShow:["emergency_action_plan"],subfieldsToShow:{emergency_action_plan:["communication_equipment_group"]},subfieldsToHide:{emergency_action_plan:{communication_equipment_group:["communication_equipments_used"]}},layout:{communication_equipment_group:{element:{label:"d-none"}},set_safety_and_rescue_procedures:{grid:{label:"d-none"}},displays_emergency_phone_numbers:{grid:{label:"d-none"}}},fieldsSaveOnly:["emergency_action_plan"],submissionId:void 0,hostingClass:"p-3 d-block",extraValidation:i=>{const s=i.value?.emergency_action_plan?.communication_equipment_group;for(const t in s.what_communication_devices_are_carried_by_the_instructor_during)if(s.what_communication_devices_are_carried_by_the_instructor_during[t])return!0;return"affiliation_form.communication_equipment_group.missing_communication_devices_carried_by_instructor"}},unlocked:!1},{step:19,title:"First Aid Kit",description:"First Aid Kit information",component:k,configuration:{title:"First Aid Kit",subtitle:"Enter the details about the first aid kit.",webformName:"school_affiliation_form",fieldsToShow:["emergency_action_plan"],subfieldsToShow:{emergency_action_plan:{first_aid_kit_group:["upload_first_aid_kit_picture"]}},layout:{first_aid_kit_group:{element:{label:"d-none"}}},fieldsSaveOnly:["emergency_action_plan"],submissionId:void 0,hostingClass:"p-3 d-block",extraValidation:i=>!!i.value?.emergency_action_plan?.first_aid_kit_group?.upload_first_aid_kit_picture||"affiliation_form.first_aid_kit_group.upload_first_aid_kit_picture.required"},unlocked:!1},{step:20,title:"Spot Risk Assessment",description:"Spot Risk Assessment information",component:k,configuration:{title:"Spot Risk Assessment",subtitle:"Enter the details about the spot risk assessment.",webformName:"school_affiliation_form",fieldsToShow:["spot_risk_assessment"],layout:{spot_risk_assessment:{element:{label:"d-none"}},risk_markup:{element:{label:"d-none",container:"rounded-1 fw-normal border border-2 border-primary alert alert-info small mb-3"}},sopts:{element:{label:"text-primary"}},sopts__specific_danger_title:{grid:{host:"border-top border-1 border-muted mt-5 pt-3 d-block",label:"d-none",control:"text-primary"}},sopts__location_title:{grid:{host:"border-top border-1 border-muted mt-3 pt-3 d-block",label:"d-none",control:"text-primary"}},sopts__in_off_shore_winds:{element:{control:"form-control rounded-textarea"}},sopts__in_on_shore_winds:{element:{control:"form-control rounded-textarea"}},sopts__case_of_submerged_hazard:{element:{control:"form-control rounded-textarea"}},sopts__obstacle_on_near_the_area:{element:{control:"form-control rounded-textarea"}},sopts__other_beach_users:{element:{control:"form-control rounded-textarea"}},sopts__tide_and_currents:{element:{control:"form-control rounded-textarea"}},sopts__wind_weather_conditions:{element:{control:"form-control rounded-textarea"}},sopts__other_situations:{element:{control:"form-control rounded-textarea"}},sopts__local_kiteboarding_rules:{element:{container:"d-none"}}},fieldsSaveOnly:["spot_risk_assessment"],submissionId:void 0,hostingClass:"p-3 d-block",arrays:{s
1opts:{itemLabel:"Spot",addLabel:"Add another spot",removeLabel:"Remove",removeConfirmLabel:"Do you want to remove this spot and all the information entered for it?",minItems:1}},extraValidation:i=>{const s=i.value?.spot_risk_assessment?.sopts;if(!Array.isArray(s)||!s.length)return"affiliation_form.spot_risk_assessment.missing_spots";const t=["sopts__location_title","sopts__local_kiteboarding_rules"],n=/^https:\/\/[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,}(?:[\/?#]\S*)?$/;for(const o of s)for(const[r,a]of Object.entries(o??{}))if(!t.includes(r)){if(!a)return"affiliation_form.spot_risk_assessment.missing_required_fields";if("sopts__location"===r&&!n.test(a))return"affiliation_form.spot_risk_assessment.invalid_google_map_url"}return!0}},unlocked:!1},{step:21,title:"Affiliation submitted",description:"Your school affiliation has been submitted",component:Ae,unlocked:!1,final:!0}],K={step:1,completed:!1,currentData:void 0,configuration:D[0]},co={step:D.length,completed:!1,currentData:void 0,configuration:D[D.length-1]};let mo=(()=>{class i{constructor(){this.steps=(0,e.OCB)([]),this.percentuageProgress=(0,e.OCB)(50),this.authSessionService=(0,e.uUt)(S.i),this.userService=(0,e.uUt)(C.oz),this.loggerService=(0,e.uUt)(q.C),this.toolsService=(0,e.uUt)(ie.q),this.rolesService=(0,e.uUt)(Fe.q)}get currentEditingStep(){return this.currentStep.step}loadCurrentStep(){return this.authSessionService.currentUserProfile$.pipe((0,$e.U)(1),(0,v.k)(t=>{if(!t)throw new Error("User profile not found");return this.rolesService.isSchool&&!this.rolesService.isSchoolPending?(this.currentStep=co,console.log("here")):t.field_school_affiliation_wizard?(this.currentStep=JSON.parse(this.toolsService.encodeHTMLEntities(t.field_school_affiliation_wizard))??K,this.currentStep.configuration=D.find(n=>n.step===this.currentStep.step)):this.currentStep=K,this.setStepsConfiguration(),this.currentStep}))}previousStep(){return this.setStepByIndex(this.currentStep.step-1)}nextStep(){return this.setStepByIndex(this.currentStep.step+1)}setStepByIndex(t){const n=this.steps().find(r=>r.step===t);if(!n)throw new Error("Step not found");this.setProgressPercentage(n.step);const o=this.authSessionService.currentUserProfile?.affiliation_id;return n.configuration&&"submissionId"in n.configuration&&(n.configuration={...n.configuration,submissionId:o}),{step:n.step,completed:n.completed??!1,configuration:n,currentData:void 0}}saveCurrentStep(t){return this.currentStep.currentData=t,this.saveStep(this.currentStep)}confirmToNextStep(){this.currentStep.completed=!0;const t=this.steps().find(o=>o.step===this.currentStep.step+1);if(!t)throw new Error("Next step not found");const n={step:t.step,completed:!1,configuration:t,currentData:void 0};return this.saveStep(n).pipe((0,v.k)(o=>{if(!o)throw new Error("error saving the steps");return this.currentStep=n,this.setStepsConfiguration(),this.currentStep}))}saveStep(t){const n={...t};delete n.configuration;const o={field_school_affiliation_wizard:[{value:JSON.stringify(n)}]};return this.userService.update(C.So.Connection.current_user.uid,o).pipe((0,v.k)(()=>(this.authSessionService.initProfile().subscribe(),!0)),(0,y.a)(r=>(this.loggerService.logError(r),(0,p.of)(!1))))}setProgressPercentage(t){this.percentuageProgress.set(Math.round(t/D.length*100))}setStepsConfiguration(){const t=this.currentStep?.step??100,n=this.authSessionService.currentUserProfile?.affiliation_id,o=[...D].map(r=>(r.unlocked=r.step<=t,r.completed=r.step<t||r.step===t&&this.currentStep?.completed,r.configuration&&"submissionId"in r.configuration&&(r.configuration={...r.configuration,submissionId:n}),r));this.setProgressPercentage(t),this.steps.set(o)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=e.wxM({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const uo=["dynamicContainer"];function fo(i,s){1&i&&e.wR5(0,"wind-guts-loader")}const _o=(i,s)=>s.step;function po(i,s){1&i&&e.wR5(0,"i",21)}function ho(i,s){1&i&&e.wR5(0,"i",22)}const go=(i,s)=>({active:i,"ps-4":s});function Co(i,s){if(1&i){const t=e.KQA();e.I0R(0,"button",19),e.qCj("click",function(){const r=e.usT(t).$implicit,a=e.GaO(3);return e.CGJ(a.moveToStep(r.step))}),e.OEk(1),e.I0R(2,"span",20),e.yuY(3,po,1,0)(4,ho,1,0),e.C$Y(),e.I0R(5,"b"),e.OEk(6),e.wVc(7,"translate"),e.C$Y()()}if(2&i){const t=s.$implicit,n=e.GaO(3);let o;e.E7m("disabled",!t.unlocked)("ngClass",e.IBC(7,go,t.step===n.currentStep().step,t.step<10)),e.yG2(),e.oRS(" ",t.step,". "),e.yG2(2),e.C0Y(3,(o=!0)===t.completed?3:4),e.yG2(3),e.cNF(e.kDX(7,5,t.title))}}function vo(i,s){if(1&i&&(e.I0R(0,"span",4)(1,"a",17),e.OEk(2),e.I0R(3,"b"),e.OEk(4),e.wVc(5,"translate"),e.C$Y()(),e.I0R(6,"div",18),e.c53(7,Co,8,10,"button",23,_o),e.C$Y()()),2&i){const t=e.GaO(2);e.yG2(2),e.oRS("",t.currentStep().step,". "),e.yG2(2),e.cNF(e.kDX(5,2,(null==t.currentStep().configuration?null:t.currentStep().configuration.title)||"")),e.yG2(3),e.oho(t.steps())}}function yo(i,s){if(1&i&&(e.I0R(0,"span",24),e.OEk(1),e.C$Y(),e.I0R(2,"b"),e.OEk(3),e.wVc(4,"translate"),e.C$Y()),2&i){const t=e.GaO(2);e.yG2(),e.oRS("",t.currentStep().step,"."),e.yG2(2),e.cNF(e.kDX(4,2,null==t.currentStep().configuration?null:t.currentStep().configuration.title))}}function bo(i,s){1&i&&(e.I0R(0,"span",26),e.OEk(1,"saving..."),e.C$Y(),e.wR5(2,"circular-spinner"))}function So(i,s){1&i&&e.OEk(0," Save Draft ")}function xo(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div")(1,"button",25),e.qCj("click",function(){e.usT(t);const o=e.GaO(2);return e.CGJ(o.saveCurrentStep())}),e.yuY(2,bo,3,0)(3,So,1,0),e.C$Y()()}if(2&i){const t=e.GaO(2);e.yG2(),e.E7m("disabled",t.isSaving()),e.yG2(),e.C0Y(2,t.isSavingStep()?2:3)}}function wo(i,s){if(1&i){const t=e.KQA();e.I0R(0,"button",27),e.qCj("click",function(){e.usT(t);const o=e.GaO(2);return e.CGJ(o.moveToStep(o.currentStep().step-1))}),e.OEk(1," Previous "),e.C$Y()}if(2&i){const t=e.GaO(2);e.E7m("disabled",t.isSavingStep()||t.isSaving())}}const ko=()=>({path:"/assets/animations/circular-check-ok.json",loop:!1,autoplay:!0,speed:1});function Oo(i,s){if(1&i){const t=e.KQA();e.I0R(0,"span",26),e.OEk(1,"saved!"),e.C$Y(),e.I0R(2,"ng-lottie",28),e.qCj("complete",function(){e.usT(t);const o=e.GaO(2);return e.CGJ(o.closeSaved())}),e.C$Y()}
12&i&&(e.yG2(2),e.E7m("options",e.q4q(1,ko)))}function To(i,s){1&i&&e.wR5(0,"circular-spinner")}function Ro(i,s){1&i&&e.OEk(0," Next ")}function Io(i,s){if(1&i){const t=e.KQA();e.I0R(0,"button",29),e.qCj("click",function(){e.usT(t);const o=e.GaO(2);return e.CGJ(o.confirmCurrentStep())}),e.yuY(1,To,1,0,"circular-spinner")(2,Ro,1,0),e.C$Y()}if(2&i){const t=e.GaO(2);e.E7m("disabled",t.isSavingStep()),e.yG2(),e.C0Y(1,t.isSaving()?1:2)}}function Go(i,s){if(1&i&&(e.I0R(0,"div",0)(1,"h3",1)(2,"span",2),e.OEk(3,"Affiliation Form"),e.C$Y(),e.I0R(4,"span",3),e.OEk(5," - "),e.C$Y(),e.yuY(6,vo,9,4,"span",4)(7,yo,5,4),e.wR5(8,"div",5),e.yuY(9,xo,4,2,"div"),e.C$Y()(),e.I0R(10,"div",6),e.C_f(11,null,7),e.C$Y(),e.I0R(13,"div",8)(14,"div",9),e.wR5(15,"div",10),e.C$Y()(),e.I0R(16,"div",11)(17,"div",12),e.yuY(18,wo,2,1,"button",13),e.C$Y(),e.I0R(19,"div",14),e.yuY(20,Oo,3,2),e.C$Y(),e.I0R(21,"div",15),e.yuY(22,Io,3,2,"button",16),e.C$Y()()),2&i){const t=e.GaO();e.yG2(6),e.C0Y(6,t.steps().length>1?6:7),e.yG2(3),e.C0Y(9,!t.isCurrentEditingStep()||null!=t.currentStep().configuration&&t.currentStep().configuration.final?-1:9),e.yG2(6),e.m4B("width",t.affiliationFormService.percentuageProgress(),"%"),e.yG2(3),e.C0Y(18,t.currentStep().step>1?18:-1),e.yG2(2),e.C0Y(20,t.saved()?20:-1),e.yG2(2),e.C0Y(22,null!=t.currentStep().configuration&&t.currentStep().configuration.final?-1:22)}}let ke=(()=>{class i{constructor(){this.isLoading=(0,e.OCB)(!0),this.saved=(0,e.OCB)(!1),this.isSaving=(0,e.OCB)(!1),this.isSavingStep=(0,e.OCB)(!1),this.currentStep=(0,e.OCB)(K),this.affiliationFormService=(0,e.uUt)(mo),this.navDataService=(0,e.uUt)(Z.G),this.steps=(0,e.OCB)([]),this.isCurrentEditingStep=(0,e.S6b)(()=>this.currentStep().step===this.affiliationFormService.currentEditingStep),this.ngZone=(0,e.uUt)(e.WW2),this.notificationsService=(0,e.uUt)(E.E),this.translateService=(0,e.uUt)(d.qS),this.route=(0,e.uUt)(R.gV),this.router=(0,e.uUt)(R.E5);const t=this.route.snapshot.queryParamMap.get("step");this.affiliationFormService.loadCurrentStep().subscribe(n=>{this.isLoading.set(!1),this.setStep(n),t&&n.step>=+t&&this.moveToStep(+t)})}ngOnInit(){this.navDataService.setPageTitle({title:"Affiliation Form"})}set containerRef(t){this.container!==t&&(this.container=t,this.createComponent())}moveToStep(t){this.setStep(this.affiliationFormService.setStepByIndex(t))}confirmCurrentStep(){const t=this.currentComponentRef.instance.validate();if(t!==m.Handled){if(t===m.Invalid)return void this.notificationsService.notifyError(this.translateService.instant("Oops! Looks like there's some invalid data in the form"));this.isSaving.set(!0),this.currentComponentRef.instance.save().pipe((0,A.m)(n=>{if(!n)throw new Error("couldn't save step data");return this.currentStep().completed?(0,p.of)(this.affiliationFormService.setStepByIndex(this.currentStep().step+1)):this.affiliationFormService.confirmToNextStep()}),(0,v.k)(n=>(this.setStep(n),!0)),(0,y.a)(n=>(this.notificationsService.notifyError("An error curred: "+n),(0,p.of)(!1)))).subscribe(n=>{this.isSaving.set(!1),n&&this.saved.set(n)})}}closeSaved(){this.ngZone.run(()=>{this.saved.set(!1)})}saveCurrentStep(){this.isSavingStep()||(this.isSavingStep.set(!0),this.affiliationFormService.saveCurrentStep(this.currentComponentRef.instance.getData()).subscribe(t=>{this.isSavingStep.set(!1),t?this.notificationsService.notify(this.translateService.instant("Step saved successfully")):this.notificationsService.notifyError(this.translateService.instant("Error saving step"))}))}setStep(t){this.currentStep.set(t),this.steps.set(this.affiliationFormService.steps().filter(n=>n.completed||n.step===this.affiliationFormService.currentEditingStep)),this.container&&this.createComponent(),this.route.snapshot.queryParamMap.get("step")&&this.router.navigate([],{relativeTo:this.route,queryParams:{step:t.step},queryParamsHandling:"merge",preserveFragment:!0,replaceUrl:!0})}createComponent(){const t=this.currentStep();this.container&&t.configuration?.component&&(this.container.clear(),this.currentComponentRef=this.container.createComponent(t.configuration?.component),this.currentComponentRef.instance.setData?.(t.currentData),this.currentComponentRef.instance.setConfiguration?.(t.configuration?.configuration))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.In1({type:i,selectors:[["affiliation-form"]],viewQuery:function(n,o){if(1&n&&e.CC$(uo,5,e.y8U),2&n){let r;
1e.wto(r=e.Gqi())&&(o.containerRef=r.first)}},standalone:!0,features:[e.UHJ],decls:2,vars:1,consts:[[1,"bg-grey","px-4","py-2","text-grey","w-100"],[1,"m-0","d-flex","align-items-center","header-affiliation"],["translate","",1,"fw-bold","d-none","d-lg-block"],[1,"mx-3","d-none","d-lg-block"],["ngbDropdown",""],[1,"flex-fill"],[1,"container-fluid","flex-fill","p-0","overflow-scroll"],["dynamicContainer",""],[1,"progress-container","px-3"],[1,"progress","mt-0"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"progress-bar","bg-secondary"],[1,"r-0","bottom-0","button-affiliation","safe-area-bottom-padding","z-index-2","d-flex","justify-content-between","align-items-center"],[1,"col-5","col-md-4","col-lg-2"],["type","button","class","rounded-2 btn btn-info btn-block","translate","",3,"disabled"],[1,"d-flex","align-items-center","flex-fill","justify-content-center"],[1,"col-5","col-md-4","col-lg-2","ms-auto"],["type","button","for","submit-aff","class","rounded-2 btn btn-success btn-block ms-auto","translate","",3,"disabled"],["ngbDropdownToggle","",1,"text-grey","text-decoration-none"],["ngbDropdownMenu","",1,"rounded-1","overflow-x-hidden","dropdown-wizard"],["type","button","ngbDropdownItem","",3,"disabled","ngClass","click"],[1,"mx-2","d-inline-block"],[1,"icon","icon-check-circle","my-2"],[1,"icon","icon-edit","text-grey"],["type","button","ngbDropdownItem","",3,"disabled","ngClass"],[1,"text-grey"],["type","button","translate","",1,"rounded-3","btn","btn-outline-info","btn-block",3,"disabled","click"],["translate",""],["type","button","translate","",1,"rounded-2","btn","btn-info","btn-block",3,"disabled","click"],[1,"width-20","ms-1",3,"options","complete"],["type","button","for","submit-aff","translate","",1,"rounded-2","btn","btn-success","btn-block","ms-auto",3,"disabled","click"]],template:function(n,o){1&n&&e.yuY(0,fo,1,0,"wind-guts-loader")(1,Go,23,7),2&n&&e.C0Y(0,o.isLoading()?0:1)},dependencies:[M.s,De.om,$.I,d.O0,d.sD,d.eM,_.NP,_.S8,_.qs,_.KA,_.Ku,f.MD,f.QF],styles:[".button-affiliation[_ngcontent-%COMP%]{left:0}@media screen and (min-width: 1200px){.button-affiliation[_ngcontent-%COMP%]{left:25%}}[_nghost-%COMP%]{flex-direction:column}.dropdown-wizard[_ngcontent-%COMP%]{max-height:70vh;overflow-y:auto}.header-affiliation[_ngcontent-%COMP%]{min-height:68px}"]})}}return i})();function Yo(i,s){if(1&i&&(e.I0R(0,"li",10)(1,"a",11),e.OEk(2),e.wVc(3,"translate"),e.C$Y()()),2&i){const t=s.$implicit;e.E7m("ngbNavItem",t.fragment),e.yG2(),e.E7m("fragment",t.fragment),e.yG2(),e.cNF(e.kDX(3,3,t.title))}}function Eo(i,s){1&i&&e.wR5(0,"affiliation-form",12)}function Mo(i,s){1&i&&e.wR5(0,"school-team",13,14),2&i&&e.E7m("mustShowPastTeam",!0)("mustSetManager",!0)("showBottomBar",!0)}function Do(i,s){1&i&&e.wR5(0,"i",46)}function Fo(i,s){1&i&&e.wR5(0,"i",47)}function $o(i,s){1&i&&e.wR5(0,"i",46)}function Ao(i,s){1&i&&e.wR5(0,"i",47)}function Po(i,s){1&i&&e.wR5(0,"i",46)}function Lo(i,s){1&i&&e.wR5(0,"i",47)}function Uo(i,s){if(1&i){const t=e.KQA();e.I0R(0,"div",22)(1,"div",23)(2,"div",18),e.OEk(3,"Subscriptions"),e.C$Y(),e.I0R(4,"div",24)(5,"div",25)(6,"span",26),e.OEk(7,"Courses"),e.C$Y(),e.wR5(8,"i",27),e.wVc(9,"translate"),e.C$Y(),e.I0R(10,"div",28),e.wR5(11,"bSwitch",29),e.C$Y(),e.I0R(12,"div",25)(13,"span",26),e.OEk(14,"Standards & Quality"),e.C$Y(),e.wR5(15,"i",27),e.wVc(16,"translate"),e.C$Y(),e.I0R(17,"div",28),e.wR5(18,"bSwitch",30),e.C$Y(),e.I0R(19,"div",25)(20,"span",26),e.OEk(21,"Newsletter"),e.C$Y(),e.wR5(22,"i",27),e.wVc(23,"translate"),e.C$Y(),e.I0R(24,"div",28),e.wR5(25,"bSwitch",31),e.C$Y()(),e.I0R(26,"div",32)(27,"div",33)(28,"div",34)(29,"div",35),e.wVc(30,"translate"),e.OEk(31," Courses "),e.C$Y(),e.I0R(32,"div",36)(33,"div"),e.yuY(34,Do,1,0,"i",37)(35,Fo,1,0,"i",38),e.C$Y()(),e.I0R(36,"div",39),e.wVc(37,"translate"),e.wR5(38,"bSwitch",29),e.C$Y()()(),e.I0R(39,"div",40)(40,"div",41)(41,"div",35),e.wVc(42,"translate"),e.OEk(43," Standards & Quality "),e.C$Y(),e.I0R(44,"div",36)(45,"div"),e.yuY(46,$o,1,0,"i",37)(47,Ao,1,0,"i",38),e.C$Y()(),e.I0R(48,"div",39),e.wVc(49,"translate"),e.wR5(50,"bSwitch",30),e.C$Y()()(),e.I0R(51,"div",40)(52,"div",41)(53,"div",35),e.wVc(54,"translate"),e.OEk(55," Newsletter "),e.C$Y(),e.I0R(56,"div",36)(57,"div"),e.yuY(58,Po,1,0,"i",37)(59,Lo,1,0,"i",38),e.C$Y()(),e.I0R(60,"div",39),e.wVc(61,"translate"),e.wR5(62,"bSwitch",31),e.C$Y()()()()(),e.I0R(63,"div",18),e.OEk(64,"About Us"),e.C$Y(),e.I0R(65,"div")(66,"a",42),e.qCj("click",function(){e.usT(t);const o=e.GaO(3);return e.CGJ(o.navDataService.navigate("/about-iko",!0))}),e.OEk(67," IKO "),e.C$Y()(),e.I0R(68,"div")(69,"a",43),e.qCj("click",function(){e.usT(t);const o=e.GaO(3);return e.CGJ(o.navDataService.navigate("/gutenberg/367099"))}),e.OEk(70," Terms of Use "),e.C$Y()(),e.I0R(71,"div")(72,"a",43),e.qCj("click",function(){e.usT(t);const o=e.GaO(3);return e.CGJ(o.navDataService.navigate("/gutenberg/305"))}),e.OEk(73," Privacy Policy "),e.C$Y()(),e.I0R(74,"div")(75,"a",44),e.OEk(76," Remove my account "),e.C$Y()(),e.I0R(77,"div",45)(78,"span",26),e.OEk(79,"Version"),e.C$Y(),e.OEk(80),e.C$Y()()}if(2&i){const t=e.GaO(3);e.E7m("formGroup",t.subsForm),e.yG2(8),e._6D("ngbPopover",e.kDX(9,17,"Receive notifications about courses that may interest you.")),e.yG2(7),e._6D("ngbPopover",e.kDX(16,19,"Receive notifications about changes in the IKO Standards.")),e.yG2(7),e._6D("ngbPopover",e.kDX(23,21,"Receive our monthly Newsletter.")),e.yG2(7),e._6D("ngbTooltip",e.kDX(30,23,"Receive notifications about courses that may interest you.")),e.yG2(5),e.E7m("ngIf",t.subsForm.value["5eb2bc25be"]),e.yG2(),e.E7m("ngIf",!t.subsForm.value["5eb2bc25be"]),e.yG2(),e._6D("ngbTooltip",e.kDX(37,25,"Receive notifications about courses that may interest you.")),e.yG2(5),e._6D("ngbTooltip",e.kDX(42,27,"Receive notifications about changes in the IKO Standards.")),e.yG2(5),e.E7m("ngIf",t.subsForm.value["38448b709e"]),e.yG2(),e.E7m("ngIf",!t.subsForm.value["38448b709e"]),e.yG2(),e._6D("ngbTooltip",e.kDX(49,29,"Receive notifications about changes in the IKO Standards.")),e.yG2(5),e._6D("ngbTooltip",e.kDX(54,31,"Receive our monthly Newsletter.")),e.yG2(5),e.E7m("ngIf",t.subsForm.value.aa8cc6a5a5),e.yG2(),e.E7m("ngIf",!t.subsForm.value.aa8cc6a5a5),e.yG2(),e._6D("ngbTooltip",e.kDX(61,33,"Receive our monthly Newsletter.")),e.yG2(20),e.oRS(" ",t.appVersionNumber,"")}}function Bo(i,s){if(1&i&&(e.I0R(0,"div",15)(1,"div",16)(2,"div",17)(3,"div",18),e.OEk(4,"Preferred currency"),e.C$Y(),e.wR5(5,"app-currency-select",19),e.C$Y()(),e.I0R(6,"div",16)(7,"div",17)(8,"div",18),e.OEk(9,"Preferred temperature"),e.C$Y(),e.wR5(10,"profile-user-temperature-unit-measure-picker"),e.C$Y()(),e.I0R(11,"div",20),e.yuY(12,Uo,81,35,"div",21),e.C$Y()()),2&i){const t=e.GaO(2);e.yG2(12),e.E7m("ngIf",t.subsForm)}}function Vo(i,s){if(1&i&&(e.I0R(0,"div",2)(1,"div",3)(2,"div",4,5)(4,"div",6)(5,"ul",7),e.wVc(6,"async"),e.yuY(7,Yo,4,5,"li",8),e.C$Y(),e.I0R(8,"div",9),e.yuY(9,Eo,1,0)(10,Mo,2,3)(11,Bo,13,1),e.C$Y()()()()()),2&i){const t=e.GaO();let n;e.yG2(5),e.E7m("activeId",e.kDX(6,3,t.route.fragment)),e.yG2(2),e.
1E7m("ngForOf",t.links),e.yG2(2),e.C0Y(9,"affiliation"===(n=t.active)?9:"team"===n?10:"settings"===n?11:-1)}}function No(i,s){1&i&&e.wR5(0,"wind-guts-loader")}const qo=[{path:"",component:(()=>{class i{constructor(t,n,o,r,a,u,h,g){this.navDataService=t,this.deviceDetectService=n,this.route=o,this.viewService=r,this.formBuilder=a,this.customService=u,this.appVersion=h,this.router=g,this.active=null,this.appVersionNumber="N/A",this.links=[{title:"Affiliation",fragment:"affiliation"},{title:"Team",fragment:"team"},{title:"Settings",fragment:"settings"}],this.unsubscribeAll=new Y.E,this.router.events.pipe((0,Re.I)(G=>G instanceof R.MT),(0,I.a)(this.unsubscribeAll)).subscribe({next:()=>this.activeNav()})}ngOnInit(){this.navDataService.setPageTitle({title:"School"}),this.getSubsStatus(),this.getDetails().subscribe(),this.deviceDetectService.isNativeDevice?this.appVersion.getVersionNumber().then(t=>{this.appVersionNumber=t}):this.appVersionNumber=Te._.npm_package_version,this.activeNav()}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}getSubsStatus(){this.viewService.get("/api/v1/mailchimp/subscriptions").subscribe(t=>{this.subs=t,this.buildSubsForm()})}buildSubsForm(){const t={};Object.keys(this.subs).forEach(n=>{const o=this.formBuilder.control("subscribed"===this.subs[n].status);t[n]=o,o.valueChanges.subscribe(r=>{this.customService.updateMailChimpSubs({[n]:r}).subscribe(()=>{this.getSubsStatus()})})}),this.subsForm=this.formBuilder.group(t)}activeNav(){this.active=this.route.snapshot.fragment,this.active||(this.active="affiliation",this.navDataService.navigate("/edit-profile/school",!1,{fragment:"affiliation"})),[this.active]=this.active.split("#")}getDetails(){return this.viewService.get("/api/v1/my_school_details.json").pipe((0,N.y)(t=>{0!==t.length?this.profile=t[0]:this.navDataService.navigate("/account/unknown")}))}static{this.\u0275fac=function(n){return new(n||i)(e.GI1(Z.G),e.GI1(Ie.a),e.GI1(R.gV),e.GI1(C._M),e.GI1(c.im),e.GI1(Ge.kP),e.GI1(Ye.m),e.GI1(R.E5))}}static{this.\u0275cmp=e.In1({type:i,selectors:[["app-school-profile"]],decls:3,vars:2,consts:[["class","container-fluid p-0",4,"ngIf","ngIfElse"],["loading",""],[1,"container-fluid","p-0"],[1,"h-100","overflow-scroll","d-flex","flex-column","posiltion-relative"],[1,"d-flex","flex-fill","flex-column","flex-grow-1","overflow-scroll"],["mainScroller",""],[1,"tabs-content-padding-0","d-flex","h-100","flex-column","flex-fill","tabs","hori-tabs","tabs-border-default","tabs-primary","tabs-active-border"],["ngbNav","",1,"nav","nav-fill","nav-tabs","py-1","sticky-top",3,"activeId"],[3,"ngbNavItem",4,"ngFor","ngForOf"],[1,"flex-fill","overflow-scroll","d-flex","flex-column"],[3,"ngbNavItem"],["ngbNavLink","","routerLink",".",1,"text-white",3,"fragment"],[1,"d-flex","h-100","flex-fill"],[1,"h-100",3,"mustShowPastTeam","mustSetManager","showBottomBar"],["teamMembers",""],[1,"row"],[1,"col-12","col-lg-6"],[1,"px-3","mt-3"],["translate","",1,"my-3","text-black","big"],["btnClass","text-primary w-100 btn btn-simple border bg-white btn-round dropdown-toggle m-0 text-start border-light-gray"],[1,"col-12"],["class","text-primary p-3",3,"formGroup",4,"ngIf"],[1,"text-primary","p-3",3,"formGroup"],[1,"hiding-stage"],[1,"row","d-md-none","d-sm-block"],[1,"col-9","mt-2","d-flex","align-items-center","align-self-center"],["translate",""],["placement","right",1,"icon","icon-lg","icon-info-circle","ms-2",3,"ngbPopover"],[1,"col-3","mt-2"],["formControlName","5eb2bc25be",1,"on-green","off-danger"],["formControlName","38448b709e",1,"on-green","off-danger"],["formControlName","aa8cc6a5a5",1,"on-green","off-danger"],[1,"row","d-none","d-md-flex","mt-2"],[1,"d-flex","col-3"],[1,"d-flex","card","card-pricing","m-0"],["placement","bottom","translate","",1,"card-body",3,"ngbTooltip"],[1,"card-category"],["class","icon icon-64 icon-check-circle text-green",4,"ngIf"],["class","icon icon-64 icon-times-circle text-danger",4,"ngIf"],["placement","top",1,"card-title",3,"ngbTooltip"],[1,"col-3"],[1,"card","card-pricing","m-0"],[1,"text-success",3,"click"],["translate","",1,"text-success",3,"click"],["translate","",1,"text-danger"],[1,"text-black","text-center","mb-2"],[1,"icon","icon-64","icon-check-circle","text-green"],[1,"icon","icon-64","icon-times-circle","text-danger"]],template:function(n,o){if(1&n&&e.yuY(0,Vo,12,5,"div",0)(1,No,1,0,"ng-template",null,1,e.gJz),2&n){const r=e.Gew(2);e.E7m("ngIf",o.profile)("ngIfElse",r)}},dependencies:[f.ay,f.u_,R.ER,c.ue,c.u,c.uW,c.Wo,d.eM,ee.J,Ee.S,Me.s,te.w,_.sr,_.iy,_.SG,_.s7,_.qi,ke,M.s,X,f.a,d.sD],styles:[".profile-picture[_ngcontent-%COMP%]{margin-top:-80px;width:120px;height:120px}@media screen and (max-width: 767px){.profile-picture[_ngcontent-%COMP%]{margin-top:0}}.profile-picture[_ngcontent-%COMP%]   .icon-placeholder[_ngcontent-%COMP%]{font-size:121px}.camera-overlay[_ngcontent-%COMP%]   .preview-actions-container[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{width:50px!important;height:50px!important}[_ngcontent-%COMP%]:focus{outline:none}.password-btn[_ngcontent-%COMP%]{right:10px;top:25px}
1.profile-gradient[_ngcontent-%COMP%]{width:120px;height:120px;background:linear-gradient(0deg,#005eb8d9,#fff0 40% 100%)}google-map[_ngcontent-%COMP%]{height:300px}.cover-container[_ngcontent-%COMP%]{height:170px}.cover-container[_ngcontent-%COMP%]   .icon-picker[_ngcontent-%COMP%]{right:20px;bottom:10px}.cover-container[_ngcontent-%COMP%]   .icon-gallery[_ngcontent-%COMP%]{bottom:10px;left:20px}.card[_ngcontent-%COMP%], .bg-primary-gradient-transparent[_ngcontent-%COMP%]{min-height:100px}@media screen and (min-width: 992px){.w-lg-50[_ngcontent-%COMP%]{width:50%!important}}"],data:{animation:[z.sj]}})}}return i})(),data:{discriminantPathKey:"SCHOOL_PROFILE"}}];let jo=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=e.a4G({type:i})}static{this.\u0275inj=e.s3X({imports:[R.qQ.forChild(qo),R.qQ,Oe.Yv]})}}return i})(),Ho=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=e.a4G({type:i})}static{this.\u0275inj=e.s3X({imports:[f.MD,jo,c.sl,O.kT,te.I,_.IB,ke,M.s,X]})}}return i})()}}]);
2//# sourceMappingURL=1112.81c57dfb0b482010.js.map

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.