1import{c as $,h as U,i as k,j as z}from"./chunk-CZM4UFBR.js";import"./chunk-43KYR6QU.js";import"./chunk-YTKSQ5GZ.js";import{a as P}from"./chunk-FGIBIY72.js";import"./chunk-7BG55KHW.js";import"./chunk-HC4D7PDY.js";import"./chunk-NKN25BH3.js";import"./chunk-WQXF4LYG.js";import"./chunk-FP36IVGY.js";import{b as F}from"./chunk-4LWTBYA2.js";import"./chunk-V4HSB2UK.js";import"./chunk-KRYKJWVK.js";import"./chunk-RDAUFBOA.js";import"./chunk-ULENN4EC.js";import"./chunk-AYUMU3FA.js";import"./chunk-LFPLW6Q2.js";import"./chunk-2TBSRX74.js";import"./chunk-N2HOWMLB.js";import{b as E}from"./chunk-LTUIDJBQ.js";import"./chunk-TTS5XZBB.js";import"./chunk-VK27PNQX.js";import"./chunk-3QMFSVTF.js";import{E as N}from"./chunk-IJPJQ6VW.js";import"./chunk-FD7FCE3T.js";import{Ea as J,Va as R,ra as Q,ub as G}from"./chunk-L6QVANHB.js";import{Bb as x,Gb as j,Ha as f,Hb as I,Hd as T,I as b,Ib as D,Jb as w,Lc as L,Mc as V,Qb as y,Sb as S,Ub as d,X as m,Xa as A,eb as a,hb as _,ib as l,ke as B,oe as H,pa as c,re as v,xa as u,ya as h,zb as C,zd as M}from"./chunk-CUJEUYRS.js";import{a as g}from"./chunk-5BGJS47I.js";function ee(i,s){i&1&&w(0,"yn-loader",0)}function se(i,s){if(i&1){let o=y();I(0,"lib-jat-assessment",2),L(1,"async"),S("handleGetQuestions",function(e){u(o);let n=d();return h(n.handleGetAssessmentQuestions(e))})("handleSubmit",function(e){u(o);let n=d();return h(n.handleSubmit(e))})("handleSaveDraft",function(e){u(o);let n=d();return h(n.handleSubmit(e))}),D()}if(i&2){let o=d();j("assessmentData",o.currentAssessment)("childData",V(1,5,o.currentStudent$))("isViewMode",o.isViewMode)("isLoading",o.isLoadingQuestions())("groups",o.groups)}}var W=(()=>{let s=class s{beforeUnloadHandler(t){t.returnValue="..."}get currentAssessment(){return this.assessmentService.currentAssessment}constructor(t,e,n,r,p,q,K,X,Z){this.activatedRoute=t,this.assessmentService=e,this.router=n,this.studentService=r,this.toaster=p,this.translate=q,this.sharedService=K,this.assessmentExecutionService=X,this.jatAssessmentService=Z,this.currentStudent$=this.studentService.currentStudent$,this.isViewMode=this.assessmentService.isCenterAssessmentView(),this.isLoadingAssessmentGroups=!1,this.isLoading=f(!1),this.groups=null,this.isLoadingQuestions=f(!1),this.studentId=parseInt(this.activatedRoute.snapshot.params.id,10),this.id=parseInt(this.activatedRoute.snapshot.params.assessmentId,10),this.assessmentService.checkHasRunAssessmentPermission(this.studentId)}ngOnInit(){this.handleViewAssessment(this.id),this.isViewMode||this.getStudentBasicInfo()}handleViewAssessment(t){this.isLoading.set(!0),this.assessmentService.view("child",g({id:t},this.isViewMode&&{center_assessment:!0})).pipe(b(e=>!!e)).pipe(m(()=>{this.isLoading.set(!1)})).subscribe(e=>{this.assessmentService.currentAssessment=e.body})}handleGetAssessmentQuestions({assessmentId:t}){this.isLoadingQuestions.set(!0),this.assessmentService.getAssessmentQuestions("child",{id:t}).pipe(m(()=>{this.isLoadingQuestions.set(!1)})).subscribe({next:e=>{e&&e.body&&(this.groups=e.body)}})}handleSubmit(t){let{isDraft:e,data:n,childId:r}=t;e?this.handleSaveDraft(n,r):this.handleSubmitAssessment(n,r)}handleSaveDraft(t,e){this.jatAssessmentService.setState({isSubmitting:!0}),this.assessmentService.saveDraftAssessmentExecution("child",t).pipe(m(()=>{this.jatAssessmentService.setState({isSubmitting:!1})})).subscribe({next:n=>{this.toaster.setToasterData({type:"success",messageTitle:this.translate.instant("studentDashboard.assessments.assessmentToaster.saveSuccess")}),this.router.navigate(["/benficiaries","dashboard",e,"assessments"])}})}handleSubmitAssessment(t,e){this.jatAssessmentService.setState({isSubmitting:!0}),this.assessmentService.submitAssessmentExecution("child",t).pipe(m(()=>{this.jatAssessmentService.setState({isSubmitting:!1})})).subscribe({next:n=>{this.toaster.setToasterData({type:"success",messageTitle:this.translate.instant("studentDashboard.assessments.assessmentToaster.submitSuccess")}),this.router.navigate(["/benficiaries","dashboard",e,"assessments",this.id,"result"])}})}getStudentBasicInfo(){this.studentService.getStudentBasicInfo({id:this.studentId}).subscribe(t=>{t&&this.studentService.setStudentBasicInfo(t.body)})}};s.\u0275fac=function(e){return new(e||s)(a(B),a(P),a(H),a(F),a(N),a(J),a(E),a($),a(U))},s.\u0275cmp=_({type:s,selectors:[["app-jat-assessment"]],hostBindings:function(e,n){e&1&&S("beforeunload",function(p){return n.beforeUnloadHandler(p)},A)}
1,standalone:!1,decls:2,vars:1,consts:[["extraClasses","h-screen"],[3,"assessmentData","childData","isViewMode","isLoading","groups"],[3,"handleGetQuestions","handleSubmit","handleSaveDraft","assessmentData","childData","isViewMode","isLoading","groups"]],template:function(e,n){e&1&&C(0,ee,1,0,"yn-loader",0)(1,se,2,7,"lib-jat-assessment",1),e&2&&x(n.isLoading()?0:1)},dependencies:[k,R,M],encapsulation:2,changeDetection:0});let i=s;return i})();var te=[{path:"",component:W}],Y=(()=>{let s=class s{};s.\u0275fac=function(e){return new(e||s)},s.\u0275mod=l({type:s}),s.\u0275inj=c({imports:[v.forChild(te),v]});let i=s;return i})();var Me=(()=>{let s=class s{};s.\u0275fac=function(e){return new(e||s)},s.\u0275mod=l({type:s}),s.\u0275inj=c({imports:[T,z,Y,Q,G]});let i=s;return i})();export{Me as JatAssessmentModule};
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.