1"use strict";(self.webpackChunkprivacypillar_sfo3=self.webpackChunkprivacypillar_sfo3||[]).push([["src_app_assessments_assessments_module_ts","src_app_guards_dirty-check_guards_ts"],{71322:(Ue,G,x)=>{x.r(G),x.d(G,{AssessmentsModule:()=>Ga});var v=x(36895),y=x(51692),J=x(96923),I=x(38611),H=x(82778),f=x(24006),R=x(22833),K=x(70713),V=x(36358),$=x(18178),le=x(74146),Fe=x(33169),W=x(74642),Qe=x(97392),De=x(35569),z=x(79723),Ne=x(34466),Je=x(22962),Re=x(3848),$e=x(86257),Be=x(46162),ce=x(51572),Ye=x(28255),Ee=x(63961),Q=x(42111),je=x(24028),ze=x(90717),Le=x(45221),Ge=x(548),He=x(676),Ke=x(41277),X=x(66606),Ve=x(3868),de=x(30567),B=x(87545),Y=x(40537),b=x(92340),e=x(94650),D=x(80529),k=x(61737),T=x(27221),L=x(24850),ee=x(46262);let We=(()=>{const a=class{constructor(t,n){this.http=t,this.loki=n,this.dpaiBasePath="/dpia"}getTemplates(t){return this.http.get(`${b.N.keyStoneUrl}${this.dpaiBasePath}/get-all-templates/${t}`).pipe((0,T.K)(n=>(0,k._)(()=>n)))}getUsers(t){return this.http.get(`${b.N.keyStoneUrl}/entity-users/${t}`).pipe((0,L.U)(n=>(n||[]).map(i=>({id:i.id,email:i.email}))),(0,T.K)(n=>(0,k._)(()=>n)))}getTeamUsers(t){const n=(new D.LE).set("orgid",t);return this.http.get(`${b.N.apiUrl}/team_member`,{params:n}).pipe((0,L.U)(i=>(i.response||[]).map(r=>({id:r.id,email:r.user_email}))),(0,T.K)(i=>(0,k._)(()=>i)))}sendAssessment(t,n){return this.http.post(`${b.N.keyStoneUrl}${this.dpaiBasePath}/send-assesment/${t}`,n).pipe((0,T.K)(i=>(0,k._)(()=>i)))}getAllDefaultTemplates(){return this.http.get(`${b.N.keyStoneUrl}${this.dpaiBasePath}/get-all-default-templates`).pipe((0,T.K)(t=>(0,k._)(()=>t)))}getDefaultTemplateById(t){return this.http.get(`${b.N.keyStoneUrl}${this.dpaiBasePath}/get-defaulte-template/${t}`).pipe((0,T.K)(n=>(0,k._)(()=>n)))}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(D.eN),e.LFG(ee.L))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),s})();var te=x(62430);let Xe=(()=>{const a=class extends te.a{constructor(){super({oid:"",pid:"",templates:[],loading:!1,draftCount:0,publishCount:0,users:[],teamUsers:[],sendAssessmentForm:null,isSendAssessmentModalOpen:!1,isSendingAssessment:!1,defaultTemplates:[],isDefaultTemplateModalOpen:!1,isLoadingDefaultTemplates:!1,selectedDefaultTemplateId:null})}};let s=a;return a.\u0275fac=function(n){return new(n||a)},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),s})();var N=x(11481),pe=x(29175),_e=x(55089);function ue(s){return(s.value||"").trim().length>0?null:{whitespaceOnly:!0}}let ge=(()=>{const a=class{constructor(t,n,i,r,l,c,d,p,_){this.activatedRouter=t,this.router=n,this.assessmentsDashboardApiService=i,this.assessmentsDashboardStateService=r,this.fb=l,this.messageService=c,this.titleService=d,this.permissionService=p,this.userService=_}init(){this.titleService.setTitle("DPIA Templates - "+b.N.portalPrefix),this.assessmentsDashboardStateService.updateState({loading:!0}),this.activatedRouter.queryParams.pipe((0,B.w)(t=>{this.assessmentsDashboardStateService.updateState({oid:t.oid,pid:t.pid});const n=this.assessmentsDashboardStateService.getState().oid;return(0,de.D)({templates:this.assessmentsDashboardApiService.getTemplates(n),users:this.assessmentsDashboardApiService.getUsers(n),teamUsers:this.assessmentsDashboardApiService.getTeamUsers(n),currentUser:this.userService.getLoggedInUserDetails("AssessmentsDashboardActionService","AssessmentsDashboard")})}
1)).subscribe({next:({templates:t,users:n,teamUsers:i,currentUser:r})=>{console.log(r);const l=t.map(_=>({id:_.id,title:_.title,description:_.description,status:_.status||"draft",sections:_.sections?.length||0,modified:_.updated_at})),c=r?.response||r,p=[...c?.uid&&c?.email?[{id:String(c.uid),email:c.email}]:[],...(i||[]).filter(_=>_.email!==c?.email)];this.assessmentsDashboardStateService.updateState({templates:l,draftCount:l.filter(_=>"draft"===(_?.status||"").toLowerCase()).length,publishCount:l.filter(_=>"publish"===(_?.status||"").toLowerCase()||"published"===(_?.status||"").toLowerCase()).length,users:n,teamUsers:p,loading:!1})},error:()=>{this.assessmentsDashboardStateService.updateState({loading:!1})}})}getState(){return this.assessmentsDashboardStateService.getState()}getStateObs(){return this.assessmentsDashboardStateService.getStateObs()}canCreate(){return this.permissionService.getPermissionsByModuleName("DPIA")?.access.includes("create")}canEdit(){return this.permissionService.getPermissionsByModuleName("DPIA")?.access.includes("edit")}canSend(){return this.permissionService.getPermissionsByModuleName("DPIA")?.access.includes("create")}navigateToCreateTemplate(){this.canCreate()&&this.router.navigate(["/assessment/template-builder/create"],{queryParams:{oid:this.assessmentsDashboardStateService.getState().oid,pid:this.assessmentsDashboardStateService.getState().pid}})}editTemplate(t){this.canEdit()&&this.router.navigate(["/assessment/template-builder/edit",t.id],{queryParams:{oid:this.assessmentsDashboardStateService.getState().oid,pid:this.assessmentsDashboardStateService.getState().pid}})}buildSendAssessmentForm(){const t=this.fb.group({assessment_name:this.fb.control("",{nonNullable:!0,validators:[f.kI.required,ue]}),description:this.fb.control("",{nonNullable:!0,validators:[f.kI.required,ue]}),template_id:this.fb.control("",{nonNullable:!0,validators:[f.kI.required]}),responsible_id:this.fb.control("",{nonNullable:!0,validators:[f.kI.required]}),assignees:this.fb.control([],{nonNullable:!0,validators:[f.kI.required]})});return t.get("responsible_id").valueChanges.subscribe(()=>{t.get("assignees").updateValueAndValidity({emitEvent:!1})}),t.get("assignees").valueChanges.subscribe(()=>{t.get("responsible_id").updateValueAndValidity({emitEvent:!1})}),t}hasAssigneeResponsibleConflict(){const t=this.assessmentsDashboardStateService.getState(),n=t.sendAssessmentForm;if(!n)return!1;const i=n.get("responsible_id")?.value||"",r=n.get("assignees")?.value||[];if(!i||!r.length)return!1;const l=(t.teamUsers||[]).find(c=>c.id===i)?.email||"";return!!l&&r.some(c=>((t.users||[]).find(p=>p.id===c)?.email||"")===l)}openSendAssessmentModal(t){let n=this.assessmentsDashboardStateService.getState().sendAssessmentForm;n||(n=this.buildSendAssessmentForm()),n.reset({assessment_name:t?.title||"",description:"",template_id:t?.id||"",responsible_id:"",assignees:[]}),this.assessmentsDashboardStateService.updateState({sendAssessmentForm:n,isSendAssessmentModalOpen:!0})}closeSendAssessmentModal(){this.assessmentsDashboardStateService.updateState({isSendAssessmentModalOpen:!1})}sendAssessment(){if(!this.canSend())return;const t=this.assessmentsDashboardStateService.getState(),n=t.sendAssessmentForm;if(!n)return;if(n.markAllAsTouched(),n.updateValueAndValidity(),n.invalid)return void this.messageService.add({severity:"error",summary:"Validation error",detail:"Please fill all required fields before sending the assessment."});if(this.hasAssigneeResponsibleConflict())return void this.messageService.add({severity:"error",summary:"Invalid Selection",detail:"The responsible person cannot also be an assignee. Please select different users.",life:5e3});if(this.hasAssigneeResponsibleConflict())return void this.messageService.add({severity:"error",summary:"Invalid Selection",detail:"The responsible person cannot also be an assignee. Please select different users.",life:5e3});const i=n.getRawValue(),r=new Map((t.users||[]).map(d=>[d.id,d.email])),l=new Map((t.teamUsers||[]).map(d=>[d.id,d.email])),c={assessment_name:i.assessment_name.trim(),description:i.description.trim(),template_id:i.template_id,person_responsible:{id:i.responsible_id,email:l.get(i.responsible_id)||""},assignees:(i.assignees||[]).map(d=>({id:d,email:r.get(d)||""})),pid:t.pid};this.assessmentsDashboardStateService.updateState({isSendingAssessment:!0}),this.assessmentsDashboardApiService.sendAssessment(t.oid,c).pipe((0,Y.x)(()=>this.assessmentsDashboardStateService.updateState({isSendingAssessment:!1}))).subscribe({next:()=>{this.messageService.add({severity:"success",summary:"Assessment Sent",detail:"Assessment has been sent successfully."}),this.assessmentsDashboardStateService.updateState({isSendAssessmentModalOpen:!1})},error:()=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to send assessment. Please try again."})}})}openDefaultTemplateModal(){const t=this.assessmentsDashboardStateService.getState();t.defaultTemplates&&t.defaultTemplates.length>0?this.assessmentsDashboardStateService.updateState({isDefaultTemplateModalOpen:!0}):(this.assessmentsDashboardStateService.updateState({isDefaultTemplateModalOpen:!0,isLoadingDefaultTemplates:!0}),this.assessmentsDashboardApiService.getAllDefaultTemplates().subscribe({next:n=>{this.assessmentsDashboardStateService.updateState({defaultTemplates:n||[],isLoadingDefaultTemplates:!1})},error:()=>{this.assessmentsDashboardStateService.updateState({defaultTemplates:[],isLoadingDefaultTemplates:!1})}}))}closeDefaultTemplateModal(){this.assessmentsDashboardStateService.updateState({isDefaultTemplateModalOpen:!1})}selectDefaultTemplate(t){this.assessmentsDashboardStateService.updateState({selectedDefaultTemplateId:t})}continueWithoutDefault(){const{oid:t,pid:n}=this.assessmentsDashboardStateService.getState();this.closeDefaultTemplateModal(),this.router.navigate(["/assessment/template-builder/create"],{queryParams:{oid:t,pid:n}})}continueWithSelectedDefault(){const t=this.assessmentsDashboardStateService.getState(),{oid:n,pid:i,selectedDefaultTemplateId:r}=t;r&&(this.closeDefaultTemplateModal(),this.router.navigate(["/assessment/template-builder/create/default",r],{queryParams:{oid:n,pid:i}}))}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(y.gz),e.LFG
1(y.F0),e.LFG(We),e.LFG(Xe),e.LFG(f.qu),e.LFG(Q.ez),e.LFG(N.Dx),e.LFG(pe.$),e.LFG(_e.KD))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac}),s})();function et(s,a){1&s&&(e.ynx(0),e._uU(1,"s"),e.BQk())}function tt(s,a){if(1&s&&(e.TgZ(0,"span",55),e._uU(1),e.YNc(2,et,2,0,"ng-container",56),e.qZA()),2&s){const o=e.oxw().ngIf,t=e.oxw();e.xp6(1),e.hij(" ",t.getFilteredTemplates(o).length," template"),e.xp6(1),e.Q6J("ngIf",1!==t.getFilteredTemplates(o).length)}}function nt(s,a){if(1&s){const o=e.EpF();e.O4$(),e.kcU(),e.TgZ(0,"button",79),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(3);return e.KtG(i.openSendAssessmentDialog(n))}),e.O4$(),e.TgZ(1,"svg",75),e._UZ(2,"path",14)(3,"path",15),e.qZA(),e._uU(4," Send "),e.qZA()}if(2&s){const o=e.oxw(4);e.Q6J("disabled",!o.canSend),e.uIk("title",o.getDisabledTitle(o.canSend))}}const ot=function(s,a,o){return{"accent-green":s,"accent-gold":a,"accent-gray":o}},it=function(s,a,o){return{"badge-published":s,"badge-draft":a,"badge-archived":o}};function st(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"article",59),e._UZ(1,"div",60),e.TgZ(2,"div",61)(3,"div",62)(4,"span",63),e._uU(5),e.ALo(6,"titlecase"),e.qZA(),e.TgZ(7,"span",64),e.O4$(),e.TgZ(8,"svg",65),e._UZ(9,"path",66),e.qZA(),e._uU(10),e.qZA()(),e.kcU(),e.TgZ(11,"h3",67),e._uU(12),e.qZA(),e._UZ(13,"div",68),e.TgZ(14,"p",69),e.O4$(),e.TgZ(15,"svg",70),e._UZ(16,"circle",71)(17,"path",72),e.qZA(),e._uU(18),e.ALo(19,"date"),e.qZA()(),e.kcU(),e.TgZ(20,"div",73)(21,"button",74),e.NdJ("click",function(){const i=e.CHM(o).$implicit,r=e.oxw(3);return e.KtG(r.editTemplate(i))}),e.O4$(),e.TgZ(22,"svg",75),e._UZ(23,"path",76)(24,"path",77),e.qZA(),e._uU(25," Edit "),e.qZA(),e.YNc(26,nt,5,2,"button",78),e.qZA()()}if(2&s){const o=a.$implicit,t=e.oxw(3);e.xp6(1),e.Q6J("ngClass",e.kEZ(14,ot,"publish"===o.status||"published"===o.status,"draft"===o.status,"archived"===o.status)),e.xp6(3),e.Q6J("ngClass",e.kEZ(18,it,"publish"===o.status||"published"===o.status,"draft"===o.status,"archived"===o.status)),e.xp6(1),e.hij(" ",e.lcZ(6,10,o.status)," "),e.xp6(5),e.hij(" ",o.sections," sections "),e.xp6(2),e.Oqu(o.title),e.xp6(1),e.Q6J("innerHTML",o.description||"No description provided.",e.oJD),e.xp6(5),e.hij(" Modified ",e.lcZ(19,12,o.modified)," "),e.xp6(3),e.Q6J("disabled",!t.canEdit),e.uIk("title",t.getDisabledTitle(t.canEdit)),e.xp6(5),e.Q6J("ngIf","publish"===o.status||"published"===o.status)}}function rt(s,a){if(1&s&&(e.TgZ(0,"div",57),e.YNc(1,st,27,22,"article",58),e.qZA()),2&s){const o=e.oxw().ngIf,t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.getFilteredTemplates(o))}}function at(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",80)(1,"div",81),e.O4$(),e.TgZ(2,"svg",82),e._UZ(3,"circle",83)(4,"rect",84)(5,"path",85),e.qZA()(),e.kcU(),e.TgZ(6,"h3",86),e._uU(7,"No templates found"),e.qZA(),e.TgZ(8,"p",87),e._uU(9,"Get started by creating your first DPIA template"),e.qZA(),e.TgZ(10,"button",88),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.openDefaultTemplateSelector())}),e.O4$(),e.TgZ(11,"svg",10),e._UZ(12,"path",17),e.qZA(),e._uU(13," Create Template "),e.qZA()()}if(2&s){const o=e.oxw(2);e.xp6(10),e.Q6J("disabled",!o.canCreate),e.uIk("title",o.getDisabledTitle(o.canCreate))}}function lt(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",89)(1,"span",90),e._uU(2,"Send Assessment"),e.qZA(),e.TgZ(3,"button",91),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.closeSendAssessmentDialog())}),e.O4$(),e.TgZ(4,"svg",28),e._UZ(5,"path",92),e.qZA()()()}}function ct(s,a){1&s&&(e.TgZ(0,"small",115),e._uU(1,"Assessment name is required."),e.qZA())}function dt(s,a){1&s&&(e.TgZ(0,"small",115),e._uU(1,"Description is required."),e.qZA())}function pt(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",116),e.NdJ("click",function(n){e.CHM(o);const i=e.oxw(2).ngIf,r=e.oxw();return e.KtG(r.clearTemplate(i,n))}),e._uU(1," \u2715 "),e.qZA()}}function _t(s,a){1&s&&(e.O4$(),e.TgZ(0,"svg",128),e._UZ(1,"polyline",129),e.qZA())}function ut(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",126),e.NdJ("click",function(){const i=e.CHM(o).$implicit,r=e.oxw(3).ngIf,l=e.oxw();return e.KtG(l.selectTemplate(i.id,r))}),e.YNc(1,_t,2,0,"svg",127),e._uU(2),e.qZA()}if(2&s){const o=a.$implicit,t=e.oxw(3).ngIf;let n,i;e.ekj("sa-dropdown__option--selected",(null==(n=t.sendAssessmentForm.get("template_id"))?null:n.value)===o.id),e.xp6(1),e.Q6J("ngIf",(null==(i=t.sendAssessmentForm.get("template_id"))?null:i.value)===o.id),e.xp6(1),e.hij(" ",o.title," ")}}function gt(s,a){1&s&&(e.TgZ(0,"div",130),e._uU(1," No templates found "),e.qZA())}const ne=function(){return{standalone:!0}};function mt(s,a){if(1&s){const o=e.EpF();e.O4$(),e.kcU(),e.TgZ(0,"div",117)(1,"div",118),e.O4$(),e.TgZ(2,"svg",119),e._UZ(3,"circle",120)(4,"path",121),e.qZA(),e.kcU(),e.TgZ(5,"input",122),e.NdJ("ngModelChange",function(n){e.CHM(o);const i=e.oxw(3);return e.KtG(i.templateSearch=n)})("click",function(n){return n.stopPropagation()}),e.qZA()(),e.TgZ(6,"div",123),e.YNc(7,ut,3,4,"div",124),e.YNc(8,gt,2,0,"div",125),e.qZA()()}if(2&s){const o=e.oxw(2).ngIf,t=e.oxw();e.xp6(5),e.Q6J("ngModel",t.templateSearch)("ngModelOptions",e.DdM(4,ne)),e.xp6(2),e.Q6J("ngForOf",t.getFilteredTemplateOptions(o)),e.xp6(1),e.Q6J("ngIf",0===t.getFilteredTemplateOptions(o).length)}}function ft(s,a){1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"small",115),e._uU(1," Template is required. "),e.qZA())}function xt(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",116),e.NdJ("click",function(n){e.CHM(o);const i=e.oxw(2).ngIf,r=e.oxw();return e.KtG(r.clearResponsible(i,n))}),e._uU(1," \u2715 "),e.qZA()}}function ht(s,a){1&s&&(e.O4$(),e.TgZ(0,"svg",128),e._UZ(1,"polyline",129),e.qZA())}function vt(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",126),e.NdJ("click",function(){const i=e.CHM(o).$implicit,r=e.oxw(3).ngIf,l=e.oxw();return e.KtG(l.selectResponsible(i.id,r))}),e.YNc(1,ht,2,0,"svg",127),e._uU(2),e.qZA()}if(2&s){const o=a.$implicit,t=e.oxw(3).ngIf;let n,i;e.ekj("sa-dropdown__option--selected",(null==(n=t.sendAssessmentForm.get("responsible_id"))?null:n.value)===o.id),e.xp6(1),e.Q6J("ngIf",(null==(i=t.sendAssessmentForm.get("responsible_id"))?null:i.value)===o.id),e.xp6(1),e.hij(" ",o.email," ")}}function bt(s,a){1&s&&(e.TgZ(0,"div",130),e._uU(1," No users found "),e.qZA())}function wt(s,a){if(1&s){const o=e.EpF();e.O4$(),e.kcU(),e.TgZ(0,"div",117)(1,"div",118),e.O4$(),e.TgZ(2,"svg",119),e._UZ(3,"circle",120)(4,"path",121),e.qZA(),e.kcU(),e.TgZ(5,"input",131),e.NdJ("ngModelChange",function(n){e.CHM(o);const i=e.oxw(3);return e.KtG(i.responsibleSearch=n)})("click",function(n){return n.stopPropagation()}),e.qZA()(),e.TgZ(6,"div",123),e.YNc(7,vt,3,4,"div",124),e.YNc(8,bt,2,0,"div",125),e.qZA()()}if(2&s){const o=e.oxw(2).ngIf,t=e.oxw();e.xp6(5),e.Q6J("ngModel",t.responsibleSearch)("ngModelOptions",e.DdM(4,ne)),e.xp6(2),e.Q6J("ngForOf",t.getFilteredResponsibleOptions(o)),e.xp6(1),e.Q6J("ngIf",0===t.getFilteredResponsibleOptions(o).length)}}function Ct(s,a){1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"small",115),e._uU(1," Responsible user is required. "),e.qZA())}function Tt(s,a){1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"small",115),e._uU(1," Responsible person cannot also be an assignee. "),e.qZA())}function yt(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"span",132)(1,"span",133),e._uU(2),e.qZA(),e.TgZ(3,"button",134),e.NdJ("click",function(n){const r=e.CHM(o).$implicit,l=e.oxw(2).ngIf,c=e.oxw();return e.KtG(c.removeAssignee(r,l,n))}),e._uU(4," \u2715 "),e.qZA()()}if(2&s){const o=a.$implicit,t=e.oxw(2).ngIf,n=e.oxw();e.xp6(2),e.Oqu(n.getAssigneeEmail(o,t))}}function kt(s,a){1&s&&(e.TgZ(0,"span",135),e._uU(1," Select assignees "),e.qZA())}function Ot(s,a){1&s&&(e.O4$(),e.TgZ(0,"svg",141),e._UZ(1,"polyline",142),e.qZA())}function Mt(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"label",138),e.NdJ("click",function(n){const r=e.CHM(o).$implicit,l=e.oxw(3).ngIf,c=e.oxw();return n.stopPropagation(),e.KtG(c.toggleAssignee(r.id,l))}),e.TgZ(1,"span",139),e.YNc(2,Ot,2,0,"svg",140),e.qZA(),e._uU(3),e.qZA()}if(2&s){const o=a.$implicit,t=e.oxw(3).ngIf,n=e.oxw();e.xp6(1),e.ekj("sa-checkbox--checked",n.isAssigneeSelected(o.id,t)),e.xp6(1),e.Q6J("ngIf",n.isAssigneeSelected(o.id,t)),e.xp6(1),e.hij(" ",o.email," ")}}function Pt(s,a){1&s&&(e.TgZ(0,"div",130),e._uU(1," No users found "),e.qZA())}function At(s,a){if(1&s){const o=e.EpF();e.O4$(),e.kcU(),e.TgZ(0,"div",117)(1,"div",118),e.O4$(),e.TgZ(2,"svg",119),e._UZ(3,"circle",120)(4,"path",121),e.qZA(),e.kcU(),e.TgZ(5,"input",136),e.NdJ("ngModelChange",function(n){e.CHM(o);const i=e.oxw(3);return e.KtG(i.assigneeSearch=n)})("click",function(n){return n.stopPropagation()}),e.qZA()(),e.TgZ(6,"div",123),e.YNc(7,Mt,4,4,"label",137),e.YNc(8,Pt,2,0,"div",125),e.qZA()()}if(2&s){const o=e.oxw(2).ngIf,t=e.oxw();e.xp6(5),e.Q6J("ngModel",t.assigneeSearch)("ngModelOptions",e.DdM(4,ne)),e.xp6(2),e.Q6J("ngForOf",t.getFilteredAssigneeOptions(o)),e.xp6(1),e.Q6J("ngIf",0===t.getFilteredAssigneeOptions(o).length)}}function Zt(s,a){1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"small",115),e._uU(1," Select at least one assignee. "),e.qZA())}function qt(s,a){1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"small",115),e._uU(1," One or more assignees are the same as the responsible person. "),e.qZA())}const St=function(){return[]};function It(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"form",93),e.NdJ("ngSubmit",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.sendAssessment())}),e.TgZ(1,"div",94)(2,"div",95)(3,"label",96),e._uU(4,"Assessment Name "),e.TgZ(5,"span",97),e._uU(6,"*"),e.qZA()(),e._UZ(7,"input",98),e.YNc(8,ct,2,0,"small",99),e.qZA(),e.TgZ(9,"div",95)(10,"label",96),e._uU(11,"Description "),e.TgZ(12,"span",97),e._uU(13,"*"),e.qZA()(),e._UZ(14,"textarea",100),e.YNc(15,dt,2,0,"small",99),e.qZA(),e.TgZ(16,"div",95)(17,"label",96),e._uU(18,"Template "),e.TgZ(19,"span",97),e._uU(20,"*"),e.qZA()(),e.TgZ(21,"div",101)(22,"div",102),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.toggleDropdown("template"))}),e.TgZ(23,"span",103),e._uU(24),e.qZA(),e.TgZ(25,"span",104),e.YNc(26,pt,2,0,"button",105),e.O4$(),e.TgZ(27,"svg",106),e._UZ(28,"path",107),e.qZA()()(),e.YNc(29,mt,9,5,"div",108),e.qZA(),e.YNc(30,ft,2,0,"small",99),e.qZA(),e.kcU(),e.TgZ(31,"div",95)(32,"label",96),e._uU(33,"Responsible "),e.TgZ(34,"span",97),e._uU(35,"*"),e.qZA()(),e.TgZ(36,"div",101)(37,"div",102),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.toggleDropdown("responsible"))}),e.TgZ(38,"span",103),e._uU(39),e.qZA(),e.TgZ(40,"span",104),e.YNc(41,xt,2,0,"button",105),e.O4$(),e.TgZ(42,"svg",106),e._UZ(43,"path",107),e.qZA()()(),e.YNc(44,wt,9,5,"div",108),e.qZA(),e.YNc(45,Ct,2,0,"small",99),e.YNc(46,Tt,2,0,"small",99),e.qZA(),e.kcU(),e.TgZ(47,"div",95)(48,"label",96),e._uU(49,"Assignees "),e.TgZ(50,"span",97),e._uU(51,"*"),e.qZA()(),e.TgZ(52,"div",109)(53,"div",110),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.toggleDropdown("assignees"))}),e.TgZ(54,"div",111),e.YNc(55,yt,5,1,"span",112),e.YNc(56,kt,2,0,"span",113),e.qZA(),e.O4$(),e.TgZ(57,"svg",114),e._UZ(58,"path",107),e.qZA()(),e.YNc(59,At,9,5,"div",108),e.qZA(),e.YNc(60,Zt,2,0,"small",99),e.YNc(61,qt,2,0,"small",99),e.qZA()()()}if(2&s){const o=e.oxw().ngIf,t=e.oxw();let n,i,r,l,c,d,p,_,u,m;e.Q6J("formGroup",o.sendAssessmentForm),e.xp6(8),e.Q6J("ngIf",(null==(n=o.sendAssessmentForm.get("assessment_name"))?null:n.touched)&&(null==(n=o.sendAssessmentForm.get("assessment_name"))?null:n.invalid)),e.xp6(7),e.Q6J("ngIf",(null==(i=o.sendAssessmentForm.get("description"))?null:i.touched)&&(null==(i=o.sendAssessmentForm.get("description"))?null:i.invalid)),e.xp6(6),e.ekj("sa-dropdown--open","template"===t.openDropdown),e.xp6(1),e.ekj("sa-dropdown__trigger--error",(null==(r=o.sendAssessmentForm.get("template_id"))?null:r.touched)&&(null==(r=o.sendAssessmentForm.get("template_id"))?null:r.invali
1d)),e.xp6(1),e.ekj("sa-dropdown__placeholder",!t.getTemplateLabel(o)),e.xp6(1),e.hij(" ",t.getTemplateLabel(o)||"Select template"," "),e.xp6(2),e.Q6J("ngIf",t.getTemplateLabel(o)),e.xp6(3),e.Q6J("ngIf","template"===t.openDropdown),e.xp6(1),e.Q6J("ngIf",(null==(l=o.sendAssessmentForm.get("template_id"))?null:l.touched)&&(null==(l=o.sendAssessmentForm.get("template_id"))?null:l.invalid)),e.xp6(6),e.ekj("sa-dropdown--open","responsible"===t.openDropdown),e.xp6(1),e.ekj("sa-dropdown__trigger--error",(null==(c=o.sendAssessmentForm.get("responsible_id"))?null:c.touched)&&(null==(c=o.sendAssessmentForm.get("responsible_id"))?null:c.invalid)),e.xp6(1),e.ekj("sa-dropdown__placeholder",!t.getResponsibleLabel(o)),e.xp6(1),e.hij(" ",t.getResponsibleLabel(o)||"Select responsible user"," "),e.xp6(2),e.Q6J("ngIf",t.getResponsibleLabel(o)),e.xp6(3),e.Q6J("ngIf","responsible"===t.openDropdown),e.xp6(1),e.Q6J("ngIf",(null==(d=o.sendAssessmentForm.get("responsible_id"))?null:d.touched)&&(null==(d=o.sendAssessmentForm.get("responsible_id"))?null:d.invalid)),e.xp6(1),e.Q6J("ngIf",t.hasAssigneeResponsibleConflict()),e.xp6(6),e.ekj("sa-multiselect--open","assignees"===t.openDropdown),e.xp6(1),e.ekj("sa-multiselect__trigger--error",(null==(p=o.sendAssessmentForm.get("assignees"))?null:p.touched)&&(null==(p=o.sendAssessmentForm.get("assignees"))?null:p.invalid)),e.xp6(2),e.Q6J("ngForOf",(null==(_=o.sendAssessmentForm.get("assignees"))?null:_.value)||e.DdM(33,St)),e.xp6(1),e.Q6J("ngIf",!(null!=(u=o.sendAssessmentForm.get("assignees"))&&null!=u.value&&u.value.length)),e.xp6(3),e.Q6J("ngIf","assignees"===t.openDropdown),e.xp6(1),e.Q6J("ngIf",(null==(m=o.sendAssessmentForm.get("assignees"))?null:m.touched)&&(null==(m=o.sendAssessmentForm.get("assignees"))?null:m.invalid)),e.xp6(1),e.Q6J("ngIf",t.hasAssigneeResponsibleConflict())}}function Ut(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",143)(1,"button",144),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.sendAssessment())}),e._uU(2),e.qZA()()}if(2&s){const o=e.oxw().ngIf;e.xp6(1),e.Q6J("disabled",o.isSendingAssessment),e.xp6(1),e.hij(" ",o.isSendingAssessment?"Sending\u2026":"Send Assessment"," ")}}function Ft(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",89)(1,"span",90),e._uU(2,"Choose a starting template"),e.qZA(),e.TgZ(3,"button",91),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.closeDefaultTemplateModal())}),e.O4$(),e.TgZ(4,"svg",28),e._UZ(5,"path",92),e.qZA()()()}}function Qt(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"label",153)(1,"div",154)(2,"p-radioButton",155),e.NdJ("ngModelChange",function(n){e.CHM(o);const i=e.oxw(2).ngIf;return e.KtG(i.selectedDefaultTemplateId=n)}),e.qZA()(),e.TgZ(3,"div",156)(4,"div",157)(5,"span",158),e._uU(6),e.qZA(),e.TgZ(7,"span",159),e._uU(8,"Default"),e.qZA()(),e.TgZ(9,"p",160),e._uU(10),e.qZA(),e.TgZ(11,"div",161)(12,"span",162),e._uU(13,"Category"),e.qZA(),e.TgZ(14,"span",163),e._uU(15),e.qZA()()()()}if(2&s){const o=a.$implicit,t=e.oxw(2).ngIf;e.ekj("st-item--selected",o.id===t.selectedDefaultTemplateId),e.xp6(2),e.Q6J("value",o.id)("ngModel",t.selectedDefaultTemplateId)("inputId",o.id),e.xp6(4),e.Oqu(o.title),e.xp6(4),e.hij(" ",o.description||"No description provided."," "),e.xp6(5),e.Oqu(o.category||"Uncategorized")}}function Dt(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",145)(1,"header",146)(2,"p",147),e._uU(3," Start from a default DPIA template or skip to create a blank template. "),e.qZA()(),e.TgZ(4,"div",148),e.YNc(5,Qt,16,8,"label",149),e.qZA(),e.TgZ(6,"footer",150)(7,"button",151),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.continueWithoutDefault())}),e._uU(8," Skip \u2014 start from blank "),e.qZA(),e.TgZ(9,"button",152),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.continueWithSelectedDefault())}),e._uU(10," Use selected template "),e.qZA()()()}if(2&s){const o=e.oxw().ngIf;e.xp6(5),e.Q6J("ngForOf",o.defaultTemplates),e.xp6(4),e.Q6J("disabled",!o.selectedDefaultTemplateId)}}function Nt(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",145)(1,"header",146)(2,"p",147),e._uU(3," No default templates are available. You can still create a blank template. "),e.qZA()(),e.TgZ(4,"footer",164)(5,"button",165),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.continueWithoutDefault())}),e._uU(6," Start from blank "),e.qZA()()()}}const me=function(s,a){return{oid:s,pid:a}},Jt=function(){return["/assessment/my-assessments"]},Rt=function(){return{width:"620px"}},$t=function(){return{"overflow-y":"auto",padding:"1.75rem 2rem 1rem"}},Bt=function(){return{width:"640px"}},Yt=function(){return{overflow:"visible",padding:"0"}};function Et(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",1)(1,"div",2)(2,"nav",3)(3,"ol",4)(4,"li",5)(5,"a",6),e._uU(6,"Home"),e.qZA()(),e.TgZ(7,"li",7),e._uU(8,"DPIA Templates"),e.qZA()()(),e.TgZ(9,"div",8)(10,"button",9),e.O4$(),e.TgZ(11,"svg",10),e._UZ(12,"rect",11)(13,"path",12),e.qZA(),e._uU(14," My Assessments "),e.qZA(),e.kcU(),e.TgZ(15,"button",13),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.openSendAssessmentDialog())}),e.O4$(),e.TgZ(16,"svg",10),e._UZ(17,"path",14)(18,"path",15),e.qZA(),e._uU(19," Send Assessment "),e.qZA(),e.kcU(),e.TgZ(20,"button",16),e.NdJ("click",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.openDefaultTemplateSelector())}),e.O4$(),e.TgZ(21,"svg",10),e._UZ(22,"path",17),e.qZA(),e._uU(23," New Template "),e.qZA()()(),e.kcU(),e.TgZ(24,"div",18)(25,"div",19)(26,"h1",20),e._uU(27,"DPIA Templates"),e.qZA(),e.TgZ(28,"p",21),e._uU(29," Create and manage Data Protection Impact Assessment templates "),e.qZA()()(),e.TgZ(30,"div",22)(31,"div",23)(32,"div",24)(33,"div",25),e._uU(34,"Total Templates"),e.qZA(),e.TgZ(35,"div",26),e._uU(36),e.qZA()(),e.TgZ(37,"div",27),e.O4$(),e.TgZ(38,"svg",28),e._UZ(39,"path",29),e.qZA()()(),e.kcU(),e.TgZ(40,"div",30)(41,"div",24)(42,"div",25),e._uU(43,"Published"),e.qZA(),e.TgZ(44,"div",26),e._uU(45),e.qZA()(),e.TgZ(46,"div",27),e.O4$(),e.TgZ(47,"svg",28),e._UZ(48,"path",31),e.qZA()()(),e.kcU(),e.TgZ(49,"div",32)(50,"div",24)(51,"div",25),e._uU(52,"Draft"),e.qZA(),e.TgZ(53,"div",26),e._uU(54),e.qZA()(),e.TgZ(55,"div",27),e.O4$(),e.TgZ(56,"svg",28),e._UZ(57,"path",33)(58,"path",34),e.qZA()()()(),e.kcU(),e.TgZ(59,"div",35)(60,"div",36)(61,"h2",37),e._uU(62,"All Templates"),e.qZA(),e.YNc(63,tt,3,2,"span",38),e.qZA(),e.TgZ(64,"div",39)(65,"div",40),e.O4$(),e.TgZ(66,"svg",41),e._UZ(67,"circle",42)(68,"path",43),e.qZA(),e.kcU(),e.TgZ(69,"input",44),e.NdJ("ngModelChange",function(n){e.CHM(o);const i=e.oxw();return e.KtG(i.onSearch(n))}),e.qZA()()()(),e.YNc(70,rt,2,1,"div",45),e.YNc(71,at,14,2,"ng-template",null,46,e.W1O),e.TgZ(73,"p-dialog",47),e.NdJ("visibleChange",function(n){const r=e.CHM(o).ngIf;return e.KtG(r.isSendAssessmentModalOpen=n)})("onHide",function(){e.CHM(o);const n=e.oxw();return e.KtG(n.closeSendAssessmentDialog())}),e.YNc(74,lt,6,0,"ng-template",48),e.YNc(75,It,62,34,"form",49),e.YNc(76,Ut,3,2,"ng-template",50),e.qZA(),e.TgZ(77,"p-dialog",51),e.NdJ("visibleChange",function(n){const r=e.CHM(o).ngIf;return e.KtG(r.isDefaultTemplateModalOpen=n)})("onHide",function(){const i=e.CHM(o).ngIf;return e.KtG(i.isStartTemplateDialogOpen=!1)}),e.YNc(78,Ft,6,0,"ng-template",48),e.YNc(79,Dt,11,2,"div",52),e.YNc(80,Nt,7,0,"ng-template",null,53,e.W1O),e.qZA(),e._UZ(82,"p-toast",54),e.qZA()}if(2&s){const o=a.ngIf,t=e.MAs(72),n=e.MAs(81),i=e.oxw();let r,l;
1e.xp6(5),e.Q6J("queryParams",e.WLB(31,me,o.oid,o.pid)),e.xp6(5),e.Q6J("routerLink",e.DdM(34,Jt))("queryParams",e.WLB(35,me,o.oid,o.pid)),e.xp6(5),e.Q6J("disabled",!i.canSend),e.uIk("title",i.getDisabledTitle(i.canSend)),e.xp6(5),e.Q6J("disabled",!i.canCreate),e.uIk("title",i.getDisabledTitle(i.canCreate)),e.xp6(16),e.Oqu(o.templates.length),e.xp6(9),e.Oqu(o.publishCount),e.xp6(9),e.Oqu(o.draftCount),e.xp6(9),e.Q6J("ngIf",null==(r=i.getFilteredTemplates(o))?null:r.length),e.xp6(6),e.Q6J("ngModel",i.searchTerm),e.xp6(1),e.Q6J("ngIf",null==(l=i.getFilteredTemplates(o))?null:l.length)("ngIfElse",t),e.xp6(3),e.Akn(e.DdM(38,Rt)),e.Q6J("visible",o.isSendAssessmentModalOpen)("modal",!0)("closable",!1)("dismissableMask",!0)("contentStyle",e.DdM(39,$t)),e.xp6(2),e.Q6J("ngIf",o.sendAssessmentForm),e.xp6(2),e.Akn(e.DdM(40,Bt)),e.Q6J("visible",o.isDefaultTemplateModalOpen)("modal",!0)("closable",!1)("dismissableMask",!0)("contentStyle",e.DdM(41,Yt)),e.xp6(2),e.Q6J("ngIf",null==o.defaultTemplates?null:o.defaultTemplates.length)("ngIfElse",n)}}let jt=(()=>{const a=class{constructor(t){this.assessmentsDashboardActionService=t,this.stateObs=this.assessmentsDashboardActionService.getStateObs(),this.searchTerm="",this.openDropdown=null,this.templateSearch="",this.responsibleSearch="",this.assigneeSearch=""}ngOnInit(){this.assessmentsDashboardActionService.init()}toggleDropdown(t){this.openDropdown=this.openDropdown===t?null:t,this.openDropdown===t&&("template"===t&&(this.templateSearch=""),"responsible"===t&&(this.responsibleSearch=""),"assignees"===t&&(this.assigneeSearch=""))}closeAllDropdowns(){this.openDropdown=null}onDocClick(t){const n=t.target;!n.closest(".sa-dropdown")&&!n.closest(".sa-multiselect")&&(this.openDropdown=null)}getFilteredTemplateOptions(t){const n=this.getPublishedTemplates(t);if(!this.templateSearch.trim())return n;const i=this.templateSearch.toLowerCase();return n.filter(r=>(r.title||"").toLowerCase().includes(i))}selectTemplate(t,n){n.sendAssessmentForm.get("template_id")?.setValue(t),n.sendAssessmentForm.get("template_id")?.markAsTouched(),this.openDropdown=null}clearTemplate(t,n){n.stopPropagation(),t.sendAssessmentForm.get("template_id")?.setValue(""),t.sendAssessmentForm.get("template_id")?.markAsTouched()}getTemplateLabel(t){const n=t.sendAssessmentForm.get("template_id")?.value;return n&&this.getPublishedTemplates(t).find(i=>i.id===n)?.title||""}getFilteredResponsibleOptions(t){if(!this.responsibleSearch.trim())return t.teamUsers||[];const n=this.responsibleSearch.toLowerCase();return(t.teamUsers||[]).filter(i=>(i.email||"").toLowerCase().includes(n))}selectResponsible(t,n){n.sendAssessmentForm.get("responsible_id")?.setValue(t),n.sendAssessmentForm.get("responsible_id")?.markAsTouched(),this.openDropdown=null}clearResponsible(t,n){n.stopPropagation(),t.sendAssessmentForm.get("responsible_id")?.setValue(""),t.sendAssessmentForm.get("responsible_id")?.markAsTouched()}getResponsibleLabel(t){const n=t.sendAssessmentForm.get("responsible_id")?.value;return n&&(t.teamUsers||[]).find(i=>i.id===n)?.email||""}getFilteredAssigneeOptions(t){if(!this.assigneeSearch.trim())return t.users||[];const n=this.assigneeSearch.toLowerCase();return(t.users||[]).filter(i=>(i.email||"").toLowerCase().includes(n))}isAssigneeSelected(t,n){return(n.sendAssessmentForm.get("assignees")?.value||[]).includes(t)}toggleAssignee(t,n){const i=n.sendAssessmentForm.get("assignees"),r=i?.value||[],l=r.includes(t)?r.filter(c=>c!==t):[...r,t];i?.setValue(l),i?.markAsTouched()}removeAssignee(t,n,i){i.stopPropagation();const r=n.sendAssessmentForm.get("assignees");r?.setValue((r.value||[]).filter(l=>l!==t)),r?.markAsTouched()}getAssigneeEmail(t,n){return(n.users||[]).find(i=>i.id===t)?.email||t}createNewTemplate(){this.assessmentsDashboardActionService.navigateToCreateTemplate()}editTemplate(t){this.assessmentsDashboardActionService.editTemplate(t)}onSearch(t){this.searchTerm=(t||"").toLowerCase()}getFilteredTemplates(t){return this.searchTerm?(t.templates||[]).filter(n=>{const i=(n.title||"").toLowerCase(),r=(n.description||"").toLowerCase();return i.includes(this.searchTerm)||r.includes(this.searchTerm)}):t.templates}getPublishedTemplates(t){return(t.templates||[]).filter(n=>{const i=(n.status||"").toLowerCase();return"publish"===i||"published"===i})}openSendAssessmentDialog(t){this.openDropdown=null,this.assessmentsDashboardActionService.openSendAssessmentModal(t)}closeSendAssessmentDialog(){this.openDropdown=null,this.assessmentsDashboardActionService.closeSendAssessmentModal()}sendAssessment(){this.assessmentsDashboardActionService.sendAssessment()}hasAssigneeResponsibleConflict(){return this.assessmentsDashboardActionService.hasAssigneeResponsibleConflict()}openDefaultTemplateSelector(){this.assessmentsDashboardActionService.openDefaultTemplateModal()}closeDefaultTemplateModal(){this.assessmentsDashboardActionService.closeDefaultTemplateModal()}selectDefaultTemplate(t){this.assessmentsDashboardActionService.selectDefaultTemplate(t)}
1continueWithoutDefault(){this.assessmentsDashboardActionService.continueWithoutDefault()}continueWithSelectedDefault(){this.assessmentsDashboardActionService.continueWithSelectedDefault()}get canCreate(){return this.assessmentsDashboardActionService.canCreate()}get canEdit(){return this.assessmentsDashboardActionService.canEdit()}get canSend(){return this.assessmentsDashboardActionService.canSend()}getDisabledTitle(t){return t?null:"You don't have permission"}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.Y36(ge))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-assessments-dashboard-page"]],hostBindings:function(n,i){1&n&&e.NdJ("click",function(l){return i.onDocClick(l)},!1,e.evT)},features:[e._Bn([ge])],decls:2,vars:3,consts:[["class","dash-root",4,"ngIf"],[1,"dash-root"],[1,"topbar"],["aria-label","breadcrumb",1,"bredcrub-row"],[1,"breadcrumb","breadcrumb-style1","mg-b-10"],[1,"breadcrumb-item"],["routerLink","/home/welcome",3,"queryParams"],[1,"breadcrumb-item","active"],[1,"topbar-actions"],[1,"tbtn","tbtn-ghost",3,"routerLink","queryParams"],["viewBox","0 0 24 24","fill","none",1,"tbtn-icon"],["x","3","y","3","width","18","height","18","rx","3","stroke","currentColor","stroke-width","1.6"],["d","M7 8h10M7 12h7M7 16h5","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],[1,"tbtn","tbtn-outline",3,"disabled","click"],["d","M22 2L11 13","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],["d","M22 2L15 22l-4-9-9-4 20-7z","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],[1,"tbtn","tbtn-primary",3,"disabled","click"],["d","M12 5v14M5 12h14","stroke","currentColor","stroke-width","1.8","stroke-linecap","round"],[1,"page-hero"],[1,"hero-text"],[1,"hero-title"],[1,"hero-sub"],[1,"stats-grid"],[1,"stat-tile","stat-tile--navy"],[1,"stat-tile-inner"],[1,"stat-tile-label"],[1,"stat-tile-value"],[1,"stat-tile-icon"],["viewBox","0 0 24 24","fill","none"],["d","M4 6h16M4 10h16M4 14h10","stroke","currentColor","stroke-width","1.8","stroke-linecap","round"],[1,"stat-tile","stat-tile--green"],["d","M5 13l4 4L19 7","stroke","currentColor","stroke-width","1.8","stroke-linecap","round","stroke-linejoin","round"],[1,"stat-tile","stat-tile--gold"],["d","M12 2a10 10 0 11-.001 20.001A10 10 0 0112 2z","stroke","currentColor","stroke-width","1.6"],["d","M12 7v5l3 3","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],[1,"toolbar"],[1,"toolbar-left"],[1,"section-heading"],["class","templates-count",4,"ngIf"],[1,"toolbar-right"],[1,"searchbox"],["viewBox","0 0 24 24","fill","none",1,"search-ico"],["cx","11","cy","11","r","7","stroke","currentColor","stroke-width","1.6"],["d","M21 21l-4.35-4.35","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["type","search","placeholder","Search templates\u2026","aria-label","Search templates",1,"search-input",3,"ngModel","ngModelChange"],["class","cards-grid",4,"ngIf","ngIfElse"],["noTemplates",""],["styleClass","send-assessment-dialog",3,"visible","modal","closable","dismissableMask","contentStyle","visibleChange","onHide"],["pTemplate","header"],["id","sendAssessmentForm","class","send-assessment-form",3,"formGroup","ngSubmit",4,"ngIf"],["pTemplate","footer"],["styleClass","start-template-dialog",3,"visible","modal","closable","dismissableMask","contentStyle","visibleChange","onHide"],["class","st-wrap",4,"ngIf","ngIfElse"],["noDefaults",""],["position","bottom-right"],[1,"templates-count"],[4,"ngIf"],[1,"cards-grid"],["class","tpl-card",4,"ngFor","ngForOf"],[1,"tpl-card"],[1,"card-accent",3,"ngClass"],[1,"card-body"],[1,"card-meta-row"],[1,"status-badge",3,"ngClass"],[1,"sections-chip"],["viewBox","0 0 24 24","fill","none",1,"chip-icon"],["d","M4 6h16M4 11h16M4 16h10","stroke","currentColor","stroke-width","1.5","stroke-linecap","round"],[1,"card-title"],[1,"card-desc",3,"innerHTML"],[1,"card-modified"],["viewBox","0 0 24 24","fill","none",1,"mod-icon"],["cx","12","cy","12","r","9","stroke","currentColor","stroke-width","1.4"],["d","M12 7v5l3 3","stroke","currentColor","stroke-width","1.4","stroke-linecap","round"],[1,"card-footer"],[1,"cta-btn","cta-edit",3,"disabled","click"],["viewBox","0 0 24 24","fill","none",1,"cta-icon"],["d","M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["d","M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],["class","cta-btn cta-send","type","button",3,"disabled","click",4,"ngIf"],["type","button",1,"cta-btn","cta-send",3,"disabled","click"],[1,"empty-state"],[1,"empty-illustration"],["viewBox","0 0 120 120","fill","none","xmlns","http://www.w3.org/2000/svg"],["cx","60","cy","60","r","56","fill","#F0F4FF","stroke","#CBD5E1","stroke-width","2"],["x","35","y","38","width","50","height","44","rx","6","fill","#fff","stroke","#CBD5E1","stroke-width","2"],["d","M44 52h32M44 61h24M44 70h16","stroke","#94A3B8","stroke-width","2.5","
1stroke-linecap","round"],[1,"empty-title"],[1,"empty-sub"],["type","button",1,"tbtn","tbtn-primary","empty-cta",3,"disabled","click"],[1,"modal-header-custom"],[1,"modal-title"],["type","button","aria-label","Close",1,"modal-close-btn",3,"click"],["d","M18 6L6 18M6 6l12 12","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["id","sendAssessmentForm",1,"send-assessment-form",3,"formGroup","ngSubmit"],[1,"p-fluid"],[1,"p-field"],[1,"label"],[1,"req"],["pInputText","","formControlName","assessment_name","placeholder","Vendor Security Audit Q1",1,"input"],["class","error",4,"ngIf"],["pInputTextarea","","rows","4","formControlName","description","placeholder","Complete the vendor risk questionnaire",1,"textarea"],[1,"sa-dropdown"],[1,"sa-dropdown__trigger",3,"click"],[1,"sa-dropdown__value"],[1,"sa-dropdown__actions"],["type","button","class","sa-clear-btn",3,"click",4,"ngIf"],["viewBox","0 0 20 20","width","14","height","14","fill","none","stroke","currentColor","stroke-width","2"],["d","M5 8l5 5 5-5","stroke-linecap","round","stroke-linejoin","round"],["class","sa-dropdown__panel",4,"ngIf"],[1,"sa-multiselect"],[1,"sa-multiselect__trigger",3,"click"],[1,"sa-multiselect__chips"],["class","sa-chip",4,"ngFor","ngForOf"],["class","sa-dropdown__placeholder",4,"ngIf"],["viewBox","0 0 20 20","width","14","height","14","fill","none","stroke","currentColor","stroke-width","2",2,"flex-shrink","0"],[1,"error"],["type","button",1,"sa-clear-btn",3,"click"],[1,"sa-dropdown__panel"],[1,"sa-dropdown__search"],["viewBox","0 0 20 20","width","14","height","14","fill","none","stroke","#94a3b8","stroke-width","2"],["cx","8","cy","8","r","5"],["d","M13 13l3 3","stroke-linecap","round"],["type","text","placeholder","Search templates...",3,"ngModel","ngModelOptions","ngModelChange","click"],[1,"sa-dropdown__options"],["class","sa-dropdown__option",3,"sa-dropdown__option--selected","click",4,"ngFor","ngForOf"],["class","sa-dropdown__empty",4,"ngIf"],[1,"sa-dropdown__option",3,"click"],["viewBox","0 0 20 20","width","14","height","14","fill","none","stroke","#16bf5e","stroke-width","2.5",4,"ngIf"],["viewBox","0 0 20 20","width","14","height","14","fill","none","stroke","#16bf5e","stroke-width","2.5"],["points","4 10 8 14 16 6","stroke-linecap","round","stroke-linejoin","round"],[1,"sa-dropdown__empty"],["type","text","placeholder","Search users...",3,"ngModel","ngModelOptions","ngModelChange","click"],[1,"sa-chip"],[1,"sa-chip__text"],["type","button",1,"sa-chip__remove",3,"click"],[1,"sa-dropdown__placeholder"],["type","text","placeholder","Search assignees...",3,"ngModel","ngModelOptions","ngModelChange","click"],["class","sa-dropdown__option sa-dropdown__option--check",3,"click",4,"ngFor","ngForOf"],[1,"sa-dropdown__option","sa-dropdown__option--check",3,"click"],[1,"sa-checkbox"],["viewBox","0 0 12 12","width","10","height","10","fill","none","stroke","#fff","stroke-width","2.5",4,"ngIf"],["viewBox","0 0 12 12","width","10","height","10","fill","none","stroke","#fff","stroke-width","2.5"],["points","2 6 5 9 10 3","stroke-linecap","round","stroke-linejoin","round"],[1,"dialog-footer"],["pButton","","type","button",1,"pp-btn","pp-btn-primary",3,"disabled","click"],[1,"st-wrap"],[1,"st-header"],[1,"st-sub"],[1,"st-list"],["class","st-item",3,"st-item--selected",4,"ngFor","ngForOf"],[1,"st-footer"],["type","button",1,"st-btn","st-btn--ghost",3,"click"],["type","button",1,"st-btn","st-btn--primary",3,"disabled","click"],[1,"st-item"],[1,"st-radio"],["name","defaultTemplate",3,"value","ngModel","inputId","ngModelChange"],[1,"st-body"],[1,"st-title-row"],[1,"st-item-title"],[1,"st-chip"],[1,"st-desc"],[1,"st-meta"],[1,"st-meta-label"],[1,"st-meta-value"],[1,"st-footer","st-footer--single"],["type","button",1,"st-btn","st-btn--primary",3,"click"]],template:function(n,i){1&n&&(e.YNc(0,Et,83,42,"div",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,i.stateObs))},dependencies:[v.mk,v.sg,v.O5,y.rH,Q.jx,I.Hq,H.o,f._Y,f.Fj,f.JJ,f.JL,f.On,f.sg,f.u,R.EU,le.g,W.V,z.FN,v.Ov,v.rS,v.uU],styles:['*[_ngcontent-%COMP%]{box-sizing:border-box}.dash-root[_ngcontent-%COMP%]{background:#f5f6fa;min-height:100%;padding:0 28px 60px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial;color:#2c3a4e;-webkit-font-smoothing:antialiased}.topbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:18px 0 14px;flex-wrap:wrap;gap:12px}.topbar-actions[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.tbtn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:7px;border-radius:10px;padding:9px 16px;font-size:13.5px;font-weight:500;cursor:pointer;border:1.5px solid transparent;transition:background .18s,border-color .18s,box-shadow .18s,transform .12s,color .18s;white-space:nowrap}.tbtn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.tbtn[_ngcontent-%COMP%]:active:not(:disabled){transform:translateY(1px)}.tbtn-icon[_ngcontent-%COMP%]{width:15px;height:15px;flex-shrink:0}.tbtn-ghost[_ngcontent-%COMP%]{background:transparent;border-color:transparent;color:#6b7280}.tbtn-ghost[_ngcontent-%COMP%]:hover{background:#eef3f9;color:#2d4a6e}.tbtn-outline[_ngcontent-%COMP%]{background:#ffffff;border-color:#e2e6ee;color:#2d4a6e;box-shadow:0 1px 3px #2d4a6e0f}.tbtn-outline[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#5bc2e7;color:#5bc2e7;box-shadow:0 0 0 3px #5bc2e726}.tbtn-primary[_ngcontent-%COMP%]{background:#16bf5e;border-color:#16bf5e;color:#fff;box-shadow:0 4px 12px #16bf5e38}.tbtn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#13a450;box-shadow:0 6px 16px #16bf5e4d}.page-hero[_ngcontent-%COMP%]{background:linear-gradient(120deg,#e8eef6 0%,#edf2f9 100%);border:1px solid #d4dde9;border-radius:20px;padding:28px 32px;margin-bottom:24px;display:flex;align-items:center;justify-content:space-between;overflow:hidden;position:relative}.page-hero[_ngcontent-%COMP%]:after{content:"";position:absolute;right:-30px;top:-30px;width:160px;height:160px;border-radius:50%;background:rgba(240,179,35,.08);pointer-events:none}.hero-text[_ngcontent-%COMP%]{position:relative;z-index:1}.hero-title[_ngcontent-%COMP%]{margin:0 0 6px;font-size:22px;font-weight:700;color:#2d4a6e;letter-spacing:-.3px}.hero-sub[_ngcontent-%COMP%]{margin:0;font-size:13.5px;color:#6b7280}.stats-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:24px}.stat-tile[_ngcontent-%COMP%]{background:#ffffff;border-radius:14px;padding:20px 22px;display:flex;justify-content:space-between;align-items:center;box-shadow:0 1px 6px #2d4a6e0f,0 0 0 1px #e2e6ee;min-height:96px;border-top:4px solid transparent;
1transition:box-shadow .18s,transform .18s}.stat-tile[_ngcontent-%COMP%]:hover{box-shadow:0 4px 14px #2d4a6e1a;transform:translateY(-2px)}.stat-tile--navy[_ngcontent-%COMP%]{border-top-color:#2d4a6e}.stat-tile--green[_ngcontent-%COMP%]{border-top-color:#16bf5e}.stat-tile--gold[_ngcontent-%COMP%]{border-top-color:#f0b323}.stat-tile-inner[_ngcontent-%COMP%]{flex:1}.stat-tile-label[_ngcontent-%COMP%]{font-size:12.5px;font-weight:500;color:#6b7280;text-transform:uppercase;letter-spacing:.5px}.stat-tile-value[_ngcontent-%COMP%]{font-size:28px;font-weight:800;color:#2c3a4e;line-height:1.1;margin-top:6px}.stat-tile-icon[_ngcontent-%COMP%]{width:42px;height:42px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-left:14px}.stat-tile-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:20px;height:20px}.stat-tile--navy[_ngcontent-%COMP%] .stat-tile-icon[_ngcontent-%COMP%]{background:#eef3f9;color:#2d4a6e}.stat-tile--green[_ngcontent-%COMP%] .stat-tile-icon[_ngcontent-%COMP%]{background:#eaf7f0;color:#16bf5e}.stat-tile--gold[_ngcontent-%COMP%] .stat-tile-icon[_ngcontent-%COMP%]{background:#fef9ec;color:#d2980e}.toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;flex-wrap:wrap;gap:12px}.toolbar-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.section-heading[_ngcontent-%COMP%]{margin:0;font-size:15px;font-weight:700;color:#2c3a4e}.templates-count[_ngcontent-%COMP%]{display:inline-flex;align-items:center;background:#eef3f9;color:#2d4a6e;font-size:12px;font-weight:600;padding:2px 9px;border-radius:999px}.searchbox[_ngcontent-%COMP%]{position:relative;width:280px}.search-ico[_ngcontent-%COMP%]{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:#9ca3af;pointer-events:none}.search-input[_ngcontent-%COMP%]{width:100%;padding:10px 14px 10px 38px;border:1.5px solid #e2e6ee;border-radius:10px;background:#ffffff;font-size:13.5px;color:#2c3a4e;transition:border-color .18s,box-shadow .18s}.search-input[_ngcontent-%COMP%]::placeholder{color:#9ca3af}.search-input[_ngcontent-%COMP%]:focus{outline:none;border-color:#5bc2e7;box-shadow:0 0 0 4px #5bc2e726}.cards-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.tpl-card[_ngcontent-%COMP%]{background:#ffffff;border-radius:14px;box-shadow:0 1px 6px #2d4a6e0f,0 0 0 1px #e2e6ee;display:flex;flex-direction:column;overflow:hidden;transition:box-shadow .2s,transform .2s;border:1px solid #e2e6ee}.tpl-card[_ngcontent-%COMP%]:hover{box-shadow:0 4px 14px #2d4a6e1a;transform:translateY(-3px)}.card-accent[_ngcontent-%COMP%]{height:4px;width:100%;flex-shrink:0}.accent-green[_ngcontent-%COMP%]{background:#16bf5e}.accent-gold[_ngcontent-%COMP%]{background:#f0b323}.accent-gray[_ngcontent-%COMP%]{background:#d1d5db}.card-body[_ngcontent-%COMP%]{padding:18px 18px 14px;flex:1;display:flex;flex-direction:column}.card-meta-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.status-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;font-size:11.5px;font-weight:600;letter-spacing:.2px}.badge-published[_ngcontent-%COMP%]{background:#eaf7f0;color:#16bf5e}.badge-draft[_ngcontent-%COMP%]{background:#fef9ec;color:#bf8a0d}.badge-archived[_ngcontent-%COMP%]{background:#f3f4f6;color:#6b7280}.sections-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;color:#9ca3af}.chip-icon[_ngcontent-%COMP%]{width:12px;height:12px}.card-title[_ngcontent-%COMP%]{margin:0 0 8px;font-size:14.5px;font-weight:700;color:#2c3a4e;line-height:1.35}.card-desc[_ngcontent-%COMP%]{color:#6b7280;font-size:13px;line-height:1.5;max-height:92px;overflow-y:auto;padding-right:4px;word-break:break-word;overflow-wrap:anywhere;flex:1;margin-bottom:10px}.card-desc[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.card-desc[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:999px}.card-modified[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;font-size:11.5px;color:#9ca3af;margin:0 0 4px}.mod-icon[_ngcontent-%COMP%]{width:13px;height:13px;flex-shrink:0}.card-footer[_ngcontent-%COMP%]{display:flex;gap:10px;padding:12px 18px 16px;border-top:1px solid #e2e6ee}.cta-btn[_ngcontent-%COMP%]{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;border-radius:10px;font-size:13px;font-weight:500;cursor:pointer;border:1.5px solid transparent;transition:background .15s,border-color .15s,color .15s,box-shadow .15s}.cta-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.cta-icon[_ngcontent-%COMP%]{width:14px;
1height:14px;flex-shrink:0}.cta-edit[_ngcontent-%COMP%]{background:#ffffff;border-color:#e2e6ee;color:#2c3a4e}.cta-edit[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#2d4a6e;color:#2d4a6e}.cta-send[_ngcontent-%COMP%]{background:#16bf5e;border-color:#16bf5e;color:#fff}.cta-send[_ngcontent-%COMP%]:hover:not(:disabled){background:#13a450;box-shadow:0 4px 10px #16bf5e47}.empty-state[_ngcontent-%COMP%]{text-align:center;padding:72px 24px;border:2px dashed #e2e6ee;border-radius:20px;background:#ffffff;margin-top:4px}.empty-illustration[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:100px;height:100px}.empty-title[_ngcontent-%COMP%]{margin:20px 0 8px;font-size:18px;font-weight:700;color:#2c3a4e}.empty-sub[_ngcontent-%COMP%]{margin:0 0 24px;font-size:14px;color:#6b7280}.empty-cta[_ngcontent-%COMP%]{padding:10px 26px;font-size:14px;border-radius:999px}.modal-header-custom[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%}.modal-title[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:#2d4a6e}.modal-close-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;border:none;background:transparent;cursor:pointer;color:#6b7280;transition:background .15s,color .15s;flex-shrink:0;padding:0}.modal-close-btn[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:16px;height:16px}.modal-close-btn[_ngcontent-%COMP%]:hover{background:#fee2e2;color:#dc2626}.send-assessment-dialog[_ngcontent-%COMP%] .p-dialog-header[_ngcontent-%COMP%]{background:#eef3f9;border-bottom:1px solid #e2e6ee;border-radius:14px 14px 0 0;padding:1rem 1.5rem}.send-assessment-dialog[_ngcontent-%COMP%] .p-dialog-content[_ngcontent-%COMP%]{padding:1.75rem 2rem 1rem}.send-assessment-dialog[_ngcontent-%COMP%] .p-dialog-footer[_ngcontent-%COMP%]{padding:.85rem 2rem;border-top:1px solid #e2e6ee;background:#ffffff;border-radius:0 0 14px 14px}.send-assessment-form[_ngcontent-%COMP%] .p-field[_ngcontent-%COMP%]{margin-bottom:1rem}.send-assessment-form[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;color:#2c3a4e;margin-bottom:.3rem;display:flex;align-items:center}.send-assessment-form[_ngcontent-%COMP%] .req[_ngcontent-%COMP%]{color:#e53935;margin-left:3px}.send-assessment-form[_ngcontent-%COMP%] .error[_ngcontent-%COMP%]{color:#e53935;font-size:.75rem;margin-top:.15rem;display:block}.send-assessment-form[_ngcontent-%COMP%] .w-100[_ngcontent-%COMP%]{width:100%}.send-assessment-form[_ngcontent-%COMP%] .input[_ngcontent-%COMP%], .send-assessment-form[_ngcontent-%COMP%] .textarea[_ngcontent-%COMP%]{border-radius:10px;border:1.5px solid #e2e6ee;font-size:13.5px;transition:border-color .15s,box-shadow .15s}.send-assessment-form[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]:focus, .send-assessment-form[_ngcontent-%COMP%] .textarea[_ngcontent-%COMP%]:focus{border-color:#5bc2e7;box-shadow:0 0 0 3px #5bc2e726;outline:none}.dialog-footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.75rem;margin:0}.pp-btn[_ngcontent-%COMP%]{border-radius:999px;padding:.55rem 1.6rem;font-size:.875rem;font-weight:500;border:1.5px solid transparent;cursor:pointer;transition:background .15s,box-shadow .15s,transform .1s}.pp-btn[_ngcontent-%COMP%]:active{transform:translateY(1px)}.pp-btn-primary[_ngcontent-%COMP%]{background:#16bf5e;color:#fff;border-color:#16bf5e;box-shadow:0 4px 10px #16bf5e38}.pp-btn-primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#13a450;box-shadow:0 6px 14px #16bf5e4d}.pp-btn-primary[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.start-template-dialog[_ngcontent-%COMP%] .p-dialog-header[_ngcontent-%COMP%]{background:#eef3f9;border-bottom:1px solid #e2e6ee;border-radius:14px 14px 0 0;padding:1rem 1.5rem}.start-template-dialog[_ngcontent-%COMP%] .p-dialog-content[_ngcontent-%COMP%]{padding:0}.st-wrap[_ngcontent-%COMP%]{padding:24px 28px 22px}.st-header[_ngcontent-%COMP%]{margin-bottom:18px}.st-sub[_ngcontent-%COMP%]{margin:0;font-size:13px;color:#6b7280}.st-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;max-height:260px;overflow:auto;padding-right:4px}.st-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;padding:14px 16px;border-radius:14px;border:1.5px solid #e2e6ee;background:#f9fafb;cursor:pointer;transition:border-color .15s,background .15s,box-shadow .15s}.st-item[_ngcontent-%COMP%]:hover{border-color:#5bc2e7;background:#eaf8fd}.st-item--selected[_ngcontent-%COMP%]{border-color:#2d4a6e;background:#eef3f9;box-shadow:0 0 0 1px #1b365d33}.st-radio[_ngcontent-%COMP%]{margin-right:12px;padding-top:4px}.st-body[_ngcontent-%COMP%]{flex:1}.st-title-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:4px}.st-item-title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:#2c3a4e}.st-chip[_ngcontent-%COMP%]{font-size:11px;padding:2px 8px;border-radius:999px;background:#eef3f9;color:#2d4a6e;font-weight:600}.st-desc[_ngcontent-%COMP%]{margin:2px 0 6px;font-size:13px;color:#4b5563}.st-meta[_ngcontent-%COMP%]{display:flex;gap:4px;font-size:12px;color:#6b7280}.st-meta-label[_ngcontent-%COMP%]{font-weight:500}.st-footer[_ngcontent-%COMP%]{margin-top:22px;padding-top:12px;border-top:1px solid #e2e6ee;display:flex;justify-content:flex-end;
1gap:12px}.st-footer--single[_ngcontent-%COMP%]{justify-content:center}.st-btn[_ngcontent-%COMP%]{border-radius:999px;padding:10px 22px;font-size:14px;font-weight:500;border:1.5px solid transparent;cursor:pointer;min-width:170px;text-align:center;transition:background .15s,box-shadow .15s,transform .1s}.st-btn[_ngcontent-%COMP%]:active{transform:translateY(1px)}.st-btn--primary[_ngcontent-%COMP%]{background:#16bf5e;color:#fff;border-color:#16bf5e;box-shadow:0 6px 14px #16bf5e38}.st-btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#13a450;box-shadow:0 8px 18px #16bf5e4d}.st-btn--primary[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}.st-btn--ghost[_ngcontent-%COMP%]{background:transparent;color:#6b7280;border-color:#d1d5db}.st-btn--ghost[_ngcontent-%COMP%]:hover:not(:disabled){background:#f3f4f6;border-color:#9ca3af;color:#374151}button[disabled][_ngcontent-%COMP%]{cursor:not-allowed;opacity:.55}@media (max-width: 1100px){.cards-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}}@media (max-width: 980px){.stats-grid[_ngcontent-%COMP%], .cards-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}@media (max-width: 640px){.dash-root[_ngcontent-%COMP%]{padding:0 16px 48px}.topbar[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}.topbar-actions[_ngcontent-%COMP%]{width:100%;justify-content:flex-end}.page-hero[_ngcontent-%COMP%]{padding:22px 20px}.hero-title[_ngcontent-%COMP%]{font-size:18px}.searchbox[_ngcontent-%COMP%]{width:100%}.toolbar[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}.toolbar-right[_ngcontent-%COMP%]{width:100%}.st-footer[_ngcontent-%COMP%]{flex-direction:column-reverse;align-items:stretch}.st-btn[_ngcontent-%COMP%]{width:100%;min-width:0}.st-wrap[_ngcontent-%COMP%]{padding:18px 18px 16px}}.sa-dropdown[_ngcontent-%COMP%], .sa-multiselect[_ngcontent-%COMP%]{position:relative;width:100%}.sa-dropdown__trigger[_ngcontent-%COMP%], .sa-multiselect__trigger[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;min-height:42px;padding:8px 12px;border:1px solid #d1d5db;border-radius:8px;background:#fff;cursor:pointer;font-size:13.5px;color:#0f172a;transition:border-color .15s,box-shadow .15s;-webkit-user-select:none;user-select:none;box-sizing:border-box;overflow:hidden}.sa-dropdown__trigger[_ngcontent-%COMP%]:hover, .sa-multiselect__trigger[_ngcontent-%COMP%]:hover{border-color:#94a3b8}.sa-dropdown__trigger--error[_ngcontent-%COMP%], .sa-multiselect__trigger--error[_ngcontent-%COMP%]{border-color:#ef4444!important;background:#fff8f8}.sa-dropdown--open[_ngcontent-%COMP%] .sa-dropdown__trigger[_ngcontent-%COMP%], .sa-multiselect--open[_ngcontent-%COMP%] .sa-multiselect__trigger[_ngcontent-%COMP%]{border-color:#6366f1;box-shadow:0 0 0 3px #6366f11f}.sa-dropdown__value[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sa-dropdown__placeholder[_ngcontent-%COMP%]{color:#9ca3af}.sa-dropdown__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-shrink:0;margin-left:auto}.sa-clear-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border:none;background:#e5e7eb;border-radius:50%;font-size:9px;color:#6b7280;cursor:pointer;padding:0;line-height:1}.sa-clear-btn[_ngcontent-%COMP%]:hover{background:#d1d5db;color:#111}.sa-dropdown__panel[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:1200;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 8px 24px #0000001f;overflow:hidden}.sa-dropdown__search[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid #f1f5f9}.sa-dropdown__search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;font-size:13px;color:#0f172a;background:transparent}.sa-dropdown__search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#9ca3af}.sa-dropdown__options[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto}.sa-dropdown__option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:9px 14px;font-size:13px;color:#374151;cursor:pointer;transition:background .1s}.sa-dropdown__option[_ngcontent-%COMP%]:hover{background:#f8fafc}.sa-dropdown__option--selected[_ngcontent-%COMP%]{background:#f0fdf4;color:#166534;font-weight:600}.sa-dropdown__option--check[_ngcontent-%COMP%]{gap:10px}.sa-dropdown__empty[_ngcontent-%COMP%]{padding:12px 14px;font-size:13px;color:#9ca3af;text-align:center}.sa-multiselect__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:5px;flex:1;min-width:0;min-height:24px}.sa-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:3px 4px 3px 8px;background:#eff6ff;border:1px solid #bfdbfe;border-radius:999px;font-size:12px;color:#1d4ed8;max-width:180px;min-width:0}.sa-chip[_ngcontent-%COMP%] span.sa-chip__text[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}.sa-chip__remove[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:14px;
1height:14px;border:none;background:#bfdbfe;border-radius:50%;font-size:8px;color:#1e40af;cursor:pointer;padding:0;flex-shrink:0}.sa-chip__remove[_ngcontent-%COMP%]:hover{background:#93c5fd}.sa-checkbox[_ngcontent-%COMP%]{width:16px;height:16px;border:1.5px solid #d1d5db;border-radius:4px;background:#fff;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;transition:all .12s}.sa-checkbox--checked[_ngcontent-%COMP%]{background:#16bf5e;border-color:#16bf5e}']}),s})(),zt=(()=>{const a=class{constructor(t){this.http=t,this.dpiaBasePath="/dpia"}getDashboard(t){const n=`${b.N.keyStoneUrl}${this.dpiaBasePath}`;return this.tryDashboardEndpoints([`${n}/dashboard/${t}`,`${n}/assessment/dashboard/${t}`,`${n}/assesment/dashboard/${t}`],0)}tryDashboardEndpoints(t,n){return this.http.get(t[n]).pipe((0,T.K)(i=>n<t.length-1&&(404===i?.status||0===i?.status)?this.tryDashboardEndpoints(t,n+1):(0,k._)(()=>i)))}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(D.eN))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),s})();function Lt(s,a){if(1&s&&(e.TgZ(0,"div",35)(1,"span",36),e._uU(2),e.qZA(),e.TgZ(3,"div",37),e._UZ(4,"div",38),e.qZA()()),2&s){const o=a.$implicit,t=e.oxw(2);e.xp6(1),e.Q6J("title",o.label),e.xp6(1),e.Oqu(o.label),e.xp6(2),e.Udp("width",t.getBarWidthPercent(o.value,t.stageAxisMax),"%")("background",t.getStageBarColor(o.label))}}function Gt(s,a){if(1&s&&(e.TgZ(0,"div",39),e._UZ(1,"span",40),e.TgZ(2,"span",41),e._uU(3),e.qZA()()),2&s){const o=a.$implicit,t=e.oxw(2);e.Udp("left",t.getTickOffsetPercent(o,t.stageAxisMax),"%"),e.xp6(3),e.Oqu(t.formatChartNumber(o))}}function Ht(s,a){if(1&s&&(e.ynx(0),e.TgZ(1,"div",27)(2,"div",28),e.YNc(3,Lt,5,6,"div",29),e.qZA(),e.TgZ(4,"div",30),e._UZ(5,"div",31),e.TgZ(6,"div",32),e.YNc(7,Gt,4,3,"div",33),e.qZA()(),e.TgZ(8,"p",34),e._uU(9,"No. Of Assessments"),e.qZA()(),e.BQk()),2&s){const o=e.oxw();e.xp6(3),e.Q6J("ngForOf",o.assessmentsByStage)("ngForTrackBy",o.trackByLabel),e.xp6(4),e.Q6J("ngForOf",o.stageTicks)}}function Kt(s,a){1&s&&(e.TgZ(0,"div",42)(1,"div",43)(2,"div",44),e._UZ(3,"i",45),e.qZA(),e._UZ(4,"div",46),e.TgZ(5,"p",47),e._uU(6,"No assessment data available"),e.qZA(),e._UZ(7,"div",46),e.qZA()())}function Vt(s,a){if(1&s&&(e.TgZ(0,"div",35)(1,"span",36),e._uU(2),e.qZA(),e.TgZ(3,"div",37),e._UZ(4,"div",49),e.qZA()()),2&s){const o=a.$implicit,t=e.oxw(2);e.xp6(1),e.Q6J("title",o.label),e.xp6(1),e.Oqu(o.label),e.xp6(2),e.Udp("width",t.getBarWidthPercent(o.value,t.templateAxisMax),"%")}}function Wt(s,a){if(1&s&&(e.TgZ(0,"div",39),e._UZ(1,"span",40),e.TgZ(2,"span",41),e._uU(3),e.qZA()()),2&s){const o=a.$implicit,t=e.oxw(2);e.Udp("left",t.getTickOffsetPercent(o,t.templateAxisMax),"%"),e.xp6(3),e.Oqu(t.formatChartNumber(o))}}function Xt(s,a){if(1&s&&(e.ynx(0),e.TgZ(1,"div",48)(2,"div",28),e.YNc(3,Vt,5,4,"div",29),e.qZA(),e.TgZ(4,"div",30),e._UZ(5,"div",31),e.TgZ(6,"div",32),e.YNc(7,Wt,4,3,"div",33),e.qZA()(),e.TgZ(8,"p",34),e._uU(9,"No. Of Assessments"),e.qZA()(),e.BQk()),2&s){const o=e.oxw();e.xp6(3),e.Q6J("ngForOf",o.openByTemplate)("ngForTrackBy",o.trackByLabel),e.xp6(4),e.Q6J("ngForOf",o.templateTicks)}}function en(s,a){1&s&&(e.TgZ(0,"div",42)(1,"div",43)(2,"div",44),e._UZ(3,"i",45),e.qZA(),e._UZ(4,"div",46),e.TgZ(5,"p",47),e._uU(6,"No assessment data available"),e.qZA(),e._UZ(7,"div",46),e.qZA()())}function tn(s,a){if(1&s&&(e.O4$(),e.ynx(0),e.TgZ(1,"text",55),e._uU(2),e.qZA(),e.BQk()),2&s){const o=a.$implicit,t=e.oxw(2);e.xp6(1),e.uIk("y",t.getLineGridY(o)+4),e.xp6(1),e.hij(" ",t.formatChartNumber(o)," ")}}function nn(s,a){if(1&s&&(e.O4$(),e.ynx(0),e._UZ(1,"line",56),e.BQk()),2&s){const o=a.$implicit,t=e.oxw(2);e.xp6(1),e.uIk("x1",t.overtimePlotLeft)("y1",t.getLineGridY(o))("x2",t.overtimeSvgWidth-t.overtimePlotRight)("y2",t.getLineGridY(o))}}function on(s,a){if(1&s&&(e.O4$(),e._UZ(0,"polyline",57)),2&s){const o=e.oxw(2);e.uIk("points",o.linePoints)}}function sn(s,a){if(1&s&&(e.O4$(),e._UZ(0,"line",57)),2&s){const o=e.oxw(2);e.uIk("x1",o.singlePointLine.x1)("y1",o.singlePointLine.y)("x2",o.singlePointLine.x2)("y2",o.singlePointLine.y)}}function rn(s,a){if(1&s&&(e.O4$(),e.ynx(0),e._UZ(1,"line",58)(2,"circle",59)(3,"rect",60),e.TgZ(4,"text",61),e._uU(5),e.qZA(),e.TgZ(6,"text",62),e._uU(7),e.qZA(),e.BQk()),2&s){const o=a.$implicit,t=a.index,n=e.oxw(2);
1e.xp6(1),e.uIk("x1",o.x)("y1",n.overtimeChartHeight-n.overtimePlotBottom)("x2",o.x)("y2",n.overtimeChartHeight-n.overtimePlotBottom+12),e.xp6(1),e.uIk("cx",o.x)("cy",o.y),e.xp6(1),e.uIk("x",n.getLinePointBadgeX(o.x,o.label))("y",o.y-20)("width",n.getLinePointBadgeWidth(o.label)),e.xp6(1),e.uIk("x",o.x)("y",o.y-9),e.xp6(1),e.hij(" ",o.label," "),e.xp6(1),e.uIk("x",o.x)("y",n.overtimeChartHeight-10)("text-anchor",n.getLineLabelAnchor(t)),e.xp6(1),e.hij(" ",n.completedOverTime[t].label," ")}}function an(s,a){if(1&s&&(e.ynx(0),e.TgZ(1,"div",50),e.O4$(),e.TgZ(2,"svg",51),e.YNc(3,tn,3,2,"ng-container",52),e.YNc(4,nn,2,4,"ng-container",52),e._UZ(5,"line",53),e.YNc(6,on,1,1,"polyline",54),e.YNc(7,sn,1,4,"line",54),e.YNc(8,rn,8,16,"ng-container",52),e.qZA()(),e.BQk()),2&s){const o=e.oxw();e.xp6(2),e.Udp("width",o.overtimeSvgWidth,"px"),e.uIk("viewBox","0 0 "+o.overtimeSvgWidth+" "+o.overtimeChartHeight),e.xp6(1),e.Q6J("ngForOf",o.lineTicks),e.xp6(1),e.Q6J("ngForOf",o.lineGridValues),e.xp6(1),e.uIk("x1",o.overtimePlotLeft)("y1",o.overtimeChartHeight-o.overtimePlotBottom)("x2",o.overtimeSvgWidth-o.overtimePlotRight)("y2",o.overtimeChartHeight-o.overtimePlotBottom),e.xp6(1),e.Q6J("ngIf",o.completedOverTime.length>1),e.xp6(1),e.Q6J("ngIf",o.singlePointLine),e.xp6(1),e.Q6J("ngForOf",o.getLinePlotPoints())}}function ln(s,a){1&s&&(e.TgZ(0,"div",42)(1,"div",43)(2,"div",44),e._UZ(3,"i",45),e.qZA(),e._UZ(4,"div",46),e.TgZ(5,"p",47),e._uU(6,"No assessment data available"),e.qZA(),e._UZ(7,"div",46),e.qZA()())}function cn(s,a){1&s&&(e.TgZ(0,"div",63)(1,"span"),e._uU(2,"Loading dashboard..."),e.qZA()())}const dn=function(s,a){return{oid:s,pid:a}},fe=[{label:"Under Review",value:0},{label:"In Progress",value:0},{label:"Not Started",value:0},{label:"Completed",value:0}];let pn=(()=>{const a=class{constructor(t,n,i){this.route=t,this.titleService=n,this.dpiaDashboardApiService=i,this.overtimeChartMinWidth=620,this.overtimeChartHeight=240,this.overtimePlotLeft=60,this.overtimePlotRight=60,this.overtimePlotTop=18,this.overtimePlotBottom=48,this.loading=!1,this.oid="",this.pid="",this.summary={completed:0,toComplete:0,highRiskFlagged:0},this.assessmentsByStage=[...fe],this.openByTemplate=[],this.completedOverTime=[]}ngOnInit(){this.titleService.setTitle("DPIA Dashboard - "+b.N.portalPrefix),this.paramsSub=this.route.queryParams.subscribe(t=>{this.oid=t.oid||"",this.pid=t.pid||"",this.oid?this.loadDashboard():this.resetDashboard()})}ngOnDestroy(){this.paramsSub?.unsubscribe()}get assessmentsByStageMax(){return Math.max(...this.assessmentsByStage.map(t=>t.value),1)}get openByTemplateMax(){return Math.max(...this.openByTemplate.map(t=>t.value),1)}get stageAxisMax(){return this.stageAxisConfig.max}get templateAxisMax(){return this.templateAxisConfig.max}get stageTicks(){return this.stageAxisConfig.ticks}get templateTicks(){return this.templateAxisConfig.ticks}get stageAxisConfig(){return this.buildNiceAxisConfig(this.assessmentsByStageMax,4,5)}get templateAxisConfig(){return this.buildNiceAxisConfig(this.openByTemplateMax,5,5)}get hasStageData(){return this.assessmentsByStage.some(t=>this.toNumber(t.value)>0)}get hasTemplateData(){return this.openByTemplate.length>0}get hasOvertimeData(){return this.completedOverTime.length>0}get hasSingleOvertimePoint(){return 1===this.completedOverTime.length}get linePoints(){return this.getLinePlotPoints().map(n=>`${n.x},${n.y}`).join(" ")}get lineMax(){return Math.max(...this.completedOverTime.map(t=>t.value),1)}get lineAxisMax(){return this.lineAxisConfig.max}get lineTicks(){return this.lineAxisConfig.ticks}get lineGridValues(){return this.lineTicks.slice(1)}get singlePointLine(){const[t]=this.getLinePlotPoints();return t&&1===this.completedOverTime.length?{x1:Math.max(this.overtimePlotLeft,t.x-70),x2:Math.min(this.overtimeSvgWidth-this.overtimePlotRight,t.x+70),y:t.y}:null}getLinePlotPoints(){if(!this.completedOverTime.length)return[];const t=this.lineAxisMax,n=this.overtimeChartHeight-this.overtimePlotTop-this.overtimePlotBottom,i=this.overtimeSvgWidth-this.overtimePlotLeft-this.overtimePlotRight,r=this.completedOverTime.length>1?i/(this.completedOverTime.length-1):i/2;return this.completedOverTime.map((l,c)=>({x:this.completedOverTime.length>1?this.overtimePlotLeft+c*r:this.overtimePlotLeft+r,y:this.overtimeChartHe
1ight-this.overtimePlotBottom-(t>0?l.value/t:0)*n,value:l.value,label:this.formatLinePointValue(l.value)}))}get lineAxisConfig(){return this.buildNiceAxisConfig(this.lineMax,4,4)}get overtimeSvgWidth(){return Math.max(this.overtimeChartMinWidth,78*this.completedOverTime.length+140)}getLineGridY(t){return this.overtimeChartHeight-this.overtimePlotBottom-(this.lineAxisMax>0?t/this.lineAxisMax:0)*(this.overtimeChartHeight-this.overtimePlotTop-this.overtimePlotBottom)}trackByLabel(t,n){return n.label}formatCompactNumber(t){const n=this.toNumber(t),i=Math.abs(n);return i>=1e9?`${this.formatCompactUnit(n/1e9)}B`:i>=1e6?`${this.formatCompactUnit(n/1e6)}M`:i>=1e3?`${this.formatCompactUnit(n/1e3)}K`:`${Math.round(n)}`}getLineLabelAnchor(t){return"middle"}formatChartNumber(t){return`${Math.round(this.toNumber(t))}`}getLinePointBadgeWidth(t){return Math.max(28,8*t.length+8)}getLinePointBadgeX(t,n){return t-this.getLinePointBadgeWidth(n)/2}getStageBarColor(t){const n=(t||"").toLowerCase().trim();return n.includes("under review")?"#8fb0d1":n.includes("in progress")?"#e7ce93":n.includes("not started")?"#f56f64":n.includes("completed")?"#8fcd7f":"#8fb0d1"}getBarWidthPercent(t,n){return n?Math.max(0,Math.min(100,t/n*100)):0}getTickOffsetPercent(t,n){return n?t/n*100:0}loadDashboard(){this.loading=!0,this.dpiaDashboardApiService.getDashboard(this.oid).pipe((0,Y.x)(()=>this.loading=!1)).subscribe({next:t=>this.mapResponse(t),error:()=>this.resetDashboard()})}mapResponse(t){const n=t?.response||t||{},i=n?.summary||{};this.summary={completed:this.toNumber(i.completed),toComplete:this.toNumber(i.to_complete),highRiskFlagged:this.toNumber(i.high_risk_flagged)};const r=this.mapBarItems(n?.assessments_by_stage),l=this.mapBarItems(n?.open_by_template);this.assessmentsByStage=this.buildStageItems(r),this.openByTemplate=this.buildTemplateItems(l),this.completedOverTime=this.mapLineItems(n?.completed_over_time)}mapBarItems(t){return Array.isArray(t)?t.map(n=>({label:String(n?.label||n?.name||n?.stage||n?.template||n?.title||n?.month||"").trim()||"--",value:this.toNumber(n?.value??n?.count??n?.total??n?.y)})).filter(n=>!!n.label):[]}mapLineItems(t){return Array.isArray(t)?t.map(n=>({label:String(n?.label||n?.name||n?.month||n?.date||n?.x||"").trim()||"--",value:this.toNumber(n?.value??n?.count??n?.total??n?.y)})).filter(n=>!!n.label):[]}toNumber(t){const n=Number(t);return Number.isFinite(n)?n:0}buildNiceAxisConfig(t,n,i){const r=Math.max(this.toNumber(t),n,1),l=r/Math.max(1,i),c=Math.pow(10,Math.floor(Math.log10(l))),d=l/c;let p=1;p=d<=1?1:d<=2?2:d<=5?5:10;const _=Math.max(1,p*c),u=Math.max(n,Math.ceil(r/_)*_),m=[];for(let g=0;g<=u;g+=_)m.push(g);return m[m.length-1]!==u&&m.push(u),{max:u,ticks:m}}formatLinePointValue(t){return this.formatChartNumber(t)}formatCompactUnit(t){const i=Math.abs(t)<10?1:0;return t.toFixed(i).replace(/\.0$/,"")}resetDashboard(){this.summary={completed:0,toComplete:0,highRiskFlagged:0},this.assessmentsByStage=[...fe],this.openByTemplate=[],this.completedOverTime=[]}buildStageItems(t){const n=new Map;return t.forEach(d=>{const p=(d.label||"").toLowerCase().trim(),_=n.get(p)||0;n.set(p,_+this.toNumber(d.value))}),[{label:"Under Review",value:n.get("under review")||n.get("under_review")||0},{label:"In Progress",value:n.get("in progress")||n.get("in_progress")||n.get("pending")||0},{label:"Not Started",value:n.get("not started")||n.get("not_started")||0},{label:"Completed",value:n.get("completed")||0}]}buildTemplateItems(t){const n=new Map;return t.forEach(i=>{const r=(i.label||"--").trim()||"--",l=this.normalizeTemplateLabel(r),c=n.get(l);c?c.value+=this.toNumber(i.value):n.set(l,{label:r,value:this.toNumber(i.value)})}),Array.from(n.values())}normalizeTemplateLabel(t){return(t||"").toLowerCase().replace(/\./g,"").replace(/\s+/g," ").trim()}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.Y36(y.gz),e.Y36(N.Dx),e.Y36(zt))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-dpia-dashboard"]],decls:51,vars:13,consts:[[1,"dpia-dashboard"],[1,"col-md-12",2,"margin-bottom","25px","margin-top","15px","margin-left","6.5px"],[1,"d-sm-flex","align-items-center","justify-content-between"],["aria-label","breadcrumb",1,"bredcrub-row",2,"margin-left","-14px"],[1,"breadcrumb","breadcrumb-style1","mg-b-10"],[1,"breadcrumb-item"],["routerLink","/home/welcome",3,"queryParams"],[1,"breadcrumb-item","active"],[1,"dashboard-container"],[1,"page-header"],[1,"page-title"],[1,"page-subtitle"],[1,"summary-grid"],[1,"summary-card"],[1,"summary-label"],[1,"summary-value"],[1,"charts-grid"],[1,"chart-card"],[1,"chart-title"],[1,"chart-body"],[4,"ngIf","ngIfElse"],["noStageData",""],["noTemplateData",""],[1,"chart-card","chart-card-full"],[1,"chart-body","chart-body-line"],["noOvertimeData",""],["class","loading-overlay",4,"ngIf"],[1,"ref-hbar-chart","ref-hbar-chart-stage"],[1,"ref-hbar-rows"],["class","ref-hbar-row",4,"ngFor","ngForOf","ngForTrackBy"],[1,"ref-axis-wrap"],[1,"ref-axis-line"],[1,"ref-axis-ticks"],["class","ref-axis-tick",3,"left",4,"ngFor","ngForOf"],[1,"ref-axis-title"],[1,"ref-hbar-row"],[1,"ref-hbar-label",3,"title"],[1,"ref-hbar-plot"],[1,"ref-hbar-fill"],[1,"ref-axis-tick"],[1,"ref-axis-mark"],[1,"ref-axis-number"],[1,"empty-state-wrap"],[1,"empty-state"],["aria-hidden","true",1,"empty-state-icon"],[1,"fa","fa-bar-chart"],["aria-hidden","true",1,"empty-state-divider"],[1,"empty-state-text"],[1,"ref-hbar-chart","ref-hbar-chart-template"],[1,"ref-hbar-fill","ref-hbar-fill-template"],[1,"line-chart-shell"],[1,"line-chart"],[4,"ngFor","ngForOf"],[1,"axis-line"],["class","line-path",4,"ngIf"],["x","18",1,"line-axis-value"],[1,"grid-line"],[1,"line-path"],[1,"x-axis-tick"],["r","4.5",1,"line-dot"],["height","14",1,"line-point-badge"],["text-anchor","middle",1,"line-point-value"],[1,"line-x-label"],[1,"loading-overlay"]],template:function(n,i){if
1(1&n&&(e.TgZ(0,"section",0)(1,"div",1)(2,"div",2)(3,"div")(4,"nav",3)(5,"ol",4)(6,"li",5)(7,"a",6),e._uU(8,"Home"),e.qZA()(),e.TgZ(9,"li",7),e._uU(10,"Dashboard"),e.qZA()()()()()(),e.TgZ(11,"main",8)(12,"section",9)(13,"h1",10),e._uU(14,"DPIA Dashboard"),e.qZA(),e.TgZ(15,"p",11),e._uU(16," Monitor completed assessments and pending workload. "),e.qZA()(),e.TgZ(17,"section",12)(18,"article",13)(19,"p",14),e._uU(20,"No. of assessments completed"),e.qZA(),e.TgZ(21,"p",15),e._uU(22),e.qZA()(),e.TgZ(23,"article",13)(24,"p",14),e._uU(25,"No. of assessments to be completed"),e.qZA(),e.TgZ(26,"p",15),e._uU(27),e.qZA()()(),e.TgZ(28,"section",16)(29,"article",17)(30,"h2",18),e._uU(31,"Assessments By Stage"),e.qZA(),e.TgZ(32,"div",19),e.YNc(33,Ht,10,3,"ng-container",20),e.YNc(34,Kt,8,0,"ng-template",null,21,e.W1O),e.qZA()(),e.TgZ(36,"article",17)(37,"h2",18),e._uU(38,"Open Assessments By Template"),e.qZA(),e.TgZ(39,"div",19),e.YNc(40,Xt,10,3,"ng-container",20),e.YNc(41,en,8,0,"ng-template",null,22,e.W1O),e.qZA()(),e.TgZ(43,"article",23)(44,"h2",18),e._uU(45,"Assessments Completed Overtime"),e.qZA(),e.TgZ(46,"div",24),e.YNc(47,an,9,12,"ng-container",20),e.YNc(48,ln,8,0,"ng-template",null,25,e.W1O),e.qZA()()(),e.YNc(50,cn,3,0,"div",26),e.qZA()()),2&n){const r=e.MAs(35),l=e.MAs(42),c=e.MAs(49);e.xp6(7),e.Q6J("queryParams",e.WLB(10,dn,i.oid,i.pid)),e.xp6(15),e.Oqu(i.formatCompactNumber(i.summary.completed)),e.xp6(5),e.Oqu(i.formatCompactNumber(i.summary.toComplete)),e.xp6(6),e.Q6J("ngIf",i.hasStageData)("ngIfElse",r),e.xp6(7),e.Q6J("ngIf",i.hasTemplateData)("ngIfElse",l),e.xp6(7),e.Q6J("ngIf",i.hasOvertimeData)("ngIfElse",c),e.xp6(3),e.Q6J("ngIf",i.loading)}},dependencies:[v.sg,v.O5,y.rH],styles:['.dpia-dashboard[_ngcontent-%COMP%]{position:relative}.dashboard-container[_ngcontent-%COMP%]{max-width:1240px;margin:0 auto;padding:8px 20px 32px;position:relative}.page-header[_ngcontent-%COMP%]{margin-bottom:18px}.page-title[_ngcontent-%COMP%]{margin:0;font-size:28px;line-height:1.2;font-weight:700;color:#0f172a}.page-subtitle[_ngcontent-%COMP%]{margin:8px 0 0;color:#64748b;font-size:14px}.summary-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:16px;margin-bottom:20px}.summary-card[_ngcontent-%COMP%]{background:#ffffff;border:1px solid #dbe1ea;border-radius:12px;padding:18px 20px;min-height:118px;box-shadow:0 2px 8px #0f172a0d}.summary-label[_ngcontent-%COMP%]{margin:0;font-size:14px;color:#1e293b;font-weight:600}.summary-value[_ngcontent-%COMP%]{margin:14px 0 0;font-size:34px;line-height:1;font-weight:600;color:#0f172a;overflow-wrap:anywhere}.charts-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(320px,1fr));gap:16px}.chart-card[_ngcontent-%COMP%]{background:#ffffff;border:1px solid #dbe1ea;border-radius:12px;padding:16px;min-height:320px;display:flex;flex-direction:column}.chart-card-full[_ngcontent-%COMP%]{grid-column:1/-1;min-height:360px}.chart-title[_ngcontent-%COMP%]{margin:0 0 14px;font-size:22px;color:#0f172a;font-weight:700}.chart-body[_ngcontent-%COMP%]{flex:1;min-height:244px;display:flex}.chart-body-line[_ngcontent-%COMP%]{min-height:284px}.ref-hbar-chart[_ngcontent-%COMP%]{--label-col-width: 150px;--plot-left-gap: 0px;margin-top:8px;width:100%;height:100%;display:flex;flex-direction:column}.ref-hbar-chart-template[_ngcontent-%COMP%]{--label-col-width: 132px}.ref-hbar-chart-stage[_ngcontent-%COMP%]{--label-col-width: 130px}.ref-hbar-rows[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;justify-content:flex-end;gap:8px;position:relative}.ref-hbar-chart-template[_ngcontent-%COMP%] .ref-hbar-rows[_ngcontent-%COMP%]{max-height:226px;overflow-y:auto;padding-right:6px}.ref-hbar-rows[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;bottom:-10px;left:var(--label-col-width);width:1px;background:#bcc4cf;pointer-events:none}.ref-hbar-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:var(--label-col-width) 1fr;align-items:center;min-height:34px}.ref-hbar-label[_ngcontent-%COMP%]{font-size:12px;color:#111827;font-weight:600;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ref-hbar-plot[_ngcontent-%COMP%]{padding-left:var(--plot-left-gap);height:100%;display:flex;align-items:center}.ref-hbar-fill[_ngcontent-%COMP%]{height:22px;min-width:2px;border-radius:0;background:#8fb0d1}.ref-hbar-fill-template[_ngcontent-%COMP%]{background:#8fb0d1}.ref-axis-wrap[_ngcontent-%COMP%]{margin-left:calc(var(--label-col-width) + var(--plot-left-gap));margin-top:auto;padding-top:10px}.ref-axis-line[_ngcontent-%COMP%]{border-top:1px solid #bcc4cf;width:100%;height:0}.ref-axis-ticks[_ngcontent-%COMP%]{position:relative;width:100%;height:22px}.ref-axis-tick[_ngcontent-%COMP%]{position:absolute;top:0;min-height:22px}.ref-axis-mark[_ngcontent-%COMP%]{position:absolute;top:-1px;left:0;width:1px;height:8px;background:#bcc4cf}.ref-axis-number[_ngcontent-%COMP%]{position:absolute;top:8px;left:0;transform:translate(-50%);font-size:10px;color:#7a8595;white-space:nowrap}.ref-axis-title[_ngcontent-%COMP%]{margin:8px 0 0;text-align:center;font-size:12px;font-weight:600;color:#0f172a;padding-left:var(--label-col-width)}.line-chart-shell[_ngcontent-%COMP%]{width:100%;margin:0 auto;overflow-x:auto}.line-chart[_ngcontent-%COMP%]{width:auto;min-width:100%;height:auto;display:block}.axis-line[_ngcontent-%COMP%]{stroke:#94a3b8;stroke-width:1}.grid-line[_ngcontent-%COMP%]{stroke:#e2e8f0;stroke-width:1}.line-path[_ngcontent-%COMP%]{fill:none;stroke:#ef4444;stroke-width:2}
1.line-dot[_ngcontent-%COMP%]{fill:#3b82f6;stroke:#fff;stroke-width:2}.line-point-badge[_ngcontent-%COMP%]{fill:#c9dbef}.line-point-value[_ngcontent-%COMP%]{fill:#111827;font-size:11px;font-weight:700}.line-axis-value[_ngcontent-%COMP%]{fill:#64748b;font-size:11px;font-weight:500}.x-axis-tick[_ngcontent-%COMP%]{stroke:#94a3b8;stroke-width:1}.line-x-label[_ngcontent-%COMP%]{fill:#64748b;font-size:11px;font-weight:500}.empty-state-wrap[_ngcontent-%COMP%]{width:100%;height:100%;min-height:240px;display:flex;align-items:center;justify-content:center}.empty-state[_ngcontent-%COMP%]{width:min(420px,94%);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}.empty-state-icon[_ngcontent-%COMP%]{font-size:26px;color:#94a3b8;line-height:1}.empty-state-divider[_ngcontent-%COMP%]{width:min(320px,100%);height:1px;background:linear-gradient(90deg,rgba(148,163,184,0),rgba(148,163,184,.7),rgba(148,163,184,0))}.empty-state-text[_ngcontent-%COMP%]{margin:0;color:#64748b;font-size:14px;font-weight:600;text-align:center}.loading-overlay[_ngcontent-%COMP%]{position:absolute;inset:0;background:rgba(255,255,255,.58);-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);display:flex;align-items:center;justify-content:center;color:#334155;font-size:14px;font-weight:600;border-radius:12px}@media (max-width: 1100px){.charts-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}@media (max-width: 960px){.summary-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}.ref-hbar-chart[_ngcontent-%COMP%]{--label-col-width: 110px}.line-chart-shell[_ngcontent-%COMP%]{width:100%}}']}),s})();var oe=x(8929),S=x(53977),ie=x(21086);let _n=(()=>{const a=class extends te.a{constructor(){super({oid:"",pid:"",templateId:"",form:null,currentStep:0,collapsedSections:[],collapsedQuestions:{},openTypeMenu:null,openRulePanel:null,pendingRuleIdx:null,mode:"create",loading:!1,snapshotPayload:"",submitted:!1,defaultTemplateId:null})}};let s=a;return a.\u0275fac=function(n){return new(n||a)},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),s})(),un=(()=>{const a=class{constructor(t,n){this.http=t,this.loki=n,this.dpiaBasePath="/dpia"}getTemplateById(t,n){return this.http.get(`${b.N.keyStoneUrl}${this.dpiaBasePath}/get-template/${n}/${t}`).pipe((0,T.K)(i=>(0,k._)(()=>i)))}createTemplate(t,n){return this.http.post(`${b.N.keyStoneUrl}${this.dpiaBasePath}/create-template/${n}`,t).pipe((0,T.K)(i=>(0,k._)(()=>i)))}editTemplate(t,n,i){return this.http.put(`${b.N.keyStoneUrl}${this.dpiaBasePath}/update-template/${n}/${t}`,i).pipe((0,T.K)(r=>(0,k._)(()=>r)))}getDefaultTemplateById(t){return this.http.get(`${b.N.keyStoneUrl}${this.dpiaBasePath}/get-defaulte-template/${t}`).pipe((0,T.K)(n=>(0,k._)(()=>n)))}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(D.eN),e.LFG(ee.L))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),s})();var gn=x(37407);function A(s="id"){return`${s}_${Math.random().toString(36).slice(2,10)}`}const xe=s=>"free_text"===s||"text"===s?"short_text":s,mn=s=>s&&"short_text"!==s?s:"free_text";let he=(()=>{const a=class{constructor(t,n,i,r,l,c,d,p,_){this.fb=t,this.state=n,this.templateBuilderApiService=i,this.activatedRouter=r,this.messageService=l,this.router=c,this.titleService=d,this.permissionService=p,this.loading=_,this.state$=this.state.getStateObs(),this.typeList=[{key:"short_text",label:"Short Text"},{key:"long_text",label:"Long Text"},{key:"dropdown",label:"Dropdown"},{key:"radio",label:"Radio Buttons"},{key:"checkbox",label:"Multi Select"},{key:"date",label:"Date"},{key:"number",label:"Number"},{key:"email",label:"Email"},{key:"file",label:"File Upload"}],this.ruleActionList=[{key:"show_question",label:"Show Question",icon:"\u{1f441}"},{key:"hide_question",label:"Hide Question",icon:"\u{1f648}"},{key:"show_followup",label:"Ask Follow-up",icon:"\u{1f4ac}"}],this.followupTypeList=[{key:"short_text",label:"Short Text",icon:"\u{1f4dd}"},{key:"long_text",label:"Long Text",icon:"\u{1f4c4}"},{key:"number",label:"Number",icon:"\u{1f522}"},{key:"date",label:"Date",icon:"\u{1f4c5}"},{key:"file",label:"File Upload",icon:"\u{1f4ce}"}],this.trackByGroupId=(u,m)=>m.get("id")?.value||m}init(){this.titleService.setTitle("Template Builder - "+b.N.portalPrefix),this.state.updateState({loading:!0}),this.activatedRouter.queryParams.pipe((0,B.w)(t=>(this.state.updateState({oid:t.oid,pid:t.pid}),this.activatedRouter.params.pipe((0,L.U)(n=>
1({routeParams:n,query:t}))))),(0,B.w)(({routeParams:t})=>{this.state.updateState({mode:t?.mode,templateId:t?.id,defaultTemplateId:t?.defaultId||null});const i=this.state.getState();return"edit"===i.mode&&i.templateId?this.templateBuilderApiService.getTemplateById(i.templateId,i.oid).pipe((0,L.U)(r=>({source:"edit",data:r}))):"create"===i.mode&&this.state.getState().defaultTemplateId?this.templateBuilderApiService.getDefaultTemplateById(this.state.getState().defaultTemplateId).pipe((0,L.U)(r=>({source:"default",data:r}))):(0,ie.of)({source:"none",data:null})})).subscribe(t=>{this.state.updateState({loading:!1}),"edit"===t.source&&t.data?this.initEdit(t.data):"default"===t.source&&t.data?(this.initEdit(t.data),this.state.updateState({mode:"create",templateId:""})):this.initCreate()})}initCreate(){const t=this.fb.group({title:this.fb.control("",{nonNullable:!0,validators:[f.kI.required]}),description:this.fb.control("",{nonNullable:!0}),sections:this.fb.array([])});this.state.updateState({form:t,currentStep:0,collapsedSections:[],collapsedQuestions:{},openTypeMenu:null,openRulePanel:null,mode:"create"}),setTimeout(()=>{const n=this.state.getState().form;n&&this.state.updateState({snapshotPayload:JSON.stringify(n.getRawValue())})},0)}setActiveSection(t){}initEdit(t){const n=this.fb.group({title:this.fb.control(t.title??"",{nonNullable:!0,validators:[f.kI.required]}),description:this.fb.control(t.description??"",{nonNullable:!0}),sections:this.fb.array([])}),i=n.get("sections"),r=[],l={},c=[...t.sections||[]].sort((_,u)=>(_.order??0)-(u.order??0)),d=new Map;c.forEach(_=>{[..._.questions||[]].sort((u,m)=>(u.order??0)-(m.order??0)).forEach(u=>{const m=u.uid||A("q");u.uid&&d.set(u.uid,m)}),[..._.sub_sections||[]].sort((u,m)=>(u.order??0)-(m.order??0)).forEach(u=>{[...u.questions||[]].sort((m,g)=>(m.order??0)-(g.order??0)).forEach(m=>{const g=m.uid||A("q");m.uid&&d.set(m.uid,g)})})});const p=_=>_?d.get(_)??_:"";c.forEach((_,u)=>{const m=this.fb.group({id:this.fb.control(A("sec"),{nonNullable:!0}),title:this.fb.control(_.title??`Section ${u+1}`,{nonNullable:!0,validators:[f.kI.required]}),description:this.fb.control(_.description??"",{nonNullable:!0}),questions:this.fb.array([]),sub_sections:this.fb.array([])});i.push(m),r[u]=!1;const g=m.get("questions"),C=[..._.questions||[]].sort((h,w)=>(h.order??0)-(w.order??0));l[u]=[],C.forEach((h,w)=>{const q=h.uid||A("q"),P=this.newQuestion({question_text:h.question_text??`Question ${w+1}`,question_type:xe(h.question_type),help_text:h.help_text??"",is_mandatory:!!h.is_mandatory,uid:q});g.push(P),l[u][w]=!1;const E=P.get("options"),F=("dropdown"===h.question_type||"radio"===h.question_type||"checkbox"===h.question_type)&&h.options||[];F.forEach(U=>this.pushOptionToArray(E,U));const j=P.get("rules");this.restoreQuestionRules(j,F,p)});const O=m.get("sub_sections");[..._.sub_sections||[]].sort((h,w)=>(h.order??0)-(w.order??0)).forEach((h,w)=>{const q=this.fb.group({id:this.fb.control(A("ss"),{nonNullable:!0}),title:this.fb.control(h.title??`Subsection ${u+1}.${w+1}`,{nonNullable:!0,validators:[f.kI.required]}),description:this.fb.control(h.description??"",{nonNullable:!0}),questions:this.fb.array([])});O.push(q);const P=q.get("questions");[...h.questions||[]].sort((M,F)=>(M.order??0)-(F.order??0)).forEach((M,F)=>{const j=M.uid||A("q"),U=this.newQuestion({question_text:M.question_text??`Question ${F+1}`,question_type:xe(M.question_type),help_text:M.help_text??"",is_mandatory:!!M.is_mandatory,uid:j});P.push(U);const Ha=U.get("options"),Ie=("dropdown"===M.question_type||"radio"===M.question_type||"checkbox"===M.question_type)&&M.options||[];Ie.forEach(Va=>this.pushOptionToArray(Ha,Va));const Ka=U.get("rules");this.restoreQuestionRules(Ka,Ie,p)})})}),this.state.updateState({form:n,currentStep:0,collapsedSections:r,collapsedQuestions:l,openTypeMenu:null,openRulePanel:null,mode:this.state.getState().mode||"edit"}),setTimeout(()=>{const _=this.state.getState().form;_&&this.state.updateState({snapshotPayload:JSON.stringify(_.getRawValue())})},0)}getState(){return this.state.getState()}getStateObs(){return this.state.getStateObs()}canCreate(){return this.permissionService.getPermissionsByModuleName("DPIA")?.access.includes("create")}canEdit(){return this.permissionService.getPermissionsByModuleName("DPIA")?.access.includes("edit")}
1rootForm(){const t=this.state.getState().form;if(!t)throw new Error("Form not initialized.");return t}sectionsFA(){return this.rootForm().get("sections")}subSectionsFA(t){return this.sectionsFA().at(t).get("sub_sections")}questionsFA(t){return this.sectionsFA().at(t).get("questions")}subQuestionsFA(t,n){return this.subSectionsFA(t).at(n).get("questions")}questionArray(t,n){return null==n?this.questionsFA(t):this.subQuestionsFA(t,n)}optionsFA(t,n,i){return this.questionArray(t,i).at(n).get("options")}questionRulesFA(t,n,i){return this.questionArray(t,i).at(n).get("rules")}setCurrentStep(t){this.state.updateState({currentStep:t})}toggleSection(t){const n=[...this.state.getState().collapsedSections];n[t]=!n[t],this.state.updateState({collapsedSections:n})}toggleQuestion(t,n){const r={...this.state.getState().collapsedQuestions},l=[...r[t]||[]];l[n]=!l[n],r[t]=l,this.state.updateState({collapsedQuestions:r})}toggleTypeMenu(t,n,i){const r=this.state.getState().openTypeMenu;this.state.updateState({openTypeMenu:r&&r.s===t&&r.q===n&&r.ss===i?null:{s:t,q:n,ss:i}})}toggleRulePanel(t,n,i){const r=this.state.getState().openRulePanel;this.state.updateState({openRulePanel:r&&r.s===t&&r.q===n&&(void 0===i&&void 0===r.ss||r.ss===i)?null:{s:t,q:n,ss:i},pendingRuleIdx:null})}isRulePanelOpen(t,n,i){const r=this.state.getState().openRulePanel;return!!r&&r.s===t&&r.q===n&&(void 0===i&&void 0===r.ss||r.ss===i)}closeRulePanel(){const t=this.state.getState(),n=t.openRulePanel;null!==n&&null!==t.pendingRuleIdx&&(this.questionRulesFA(n.s,n.q,n.ss).removeAt(t.pendingRuleIdx),this.messageService.add({severity:"warn",summary:"Condition Not Saved",detail:"The unsaved condition was discarded. Click 'Save' on a condition to keep it.",life:4e3})),this.state.updateState({openRulePanel:null,pendingRuleIdx:null})}newOption(t=""){return this.fb.group({id:this.fb.control(A("opt"),{nonNullable:!0}),value:this.fb.control(t,{nonNullable:!0})})}newRule(t=""){return this.fb.group({id:this.fb.control(A("rule"),{nonNullable:!0}),when_option:this.fb.control(t,{nonNullable:!0}),action:this.fb.control("hide_question",{nonNullable:!0}),target_question_id:this.fb.control("",{nonNullable:!0}),followup_type:this.fb.control("long_text",{nonNullable:!0}),followup_label:this.fb.control("",{nonNullable:!0}),followup_mandatory:this.fb.control(!1,{nonNullable:!0})})}newQuestion(t){const n=t?.uid||A("q");return this.fb.group({id:this.fb.control(n,{nonNullable:!0}),uid:this.fb.control(n,{nonNullable:!0}),question_text:this.fb.control(t?.question_text??"",{nonNullable:!0,validators:[f.kI.required]}),question_type:this.fb.control(t?.question_type??null),help_text:this.fb.control(t?.help_text??"",{nonNullable:!0}),is_mandatory:this.fb.control(!!t?.is_mandatory,{nonNullable:!0}),options:this.fb.array([]),rules:this.fb.array([])})}newSubSection(){return this.fb.group({id:this.fb.control(A("ss"),{nonNullable:!0}),title:this.fb.control("",{nonNullable:!0,validators:[f.kI.required]}),description:this.fb.control("",{nonNullable:!0}),questions:this.fb.array([])})}newSection(){return this.fb.group({id:this.fb.control(A("sec"),{nonNullable:!0}),title:this.fb.control("",{nonNullable:!0,validators:[f.kI.required]}),description:this.fb.control("",{nonNullable:!0}),questions:this.fb.array([]),sub_sections:this.fb.array([])})}pushOptionToArray(t,n){const i="string"==typeof n?n:n.value;t.push(this.fb.group({id:this.fb.control(A("opt"),{nonNullable:!0}),value:this.fb.control(i,{nonNullable:!0})}))}restoreQuestionRules(t,n,i){n.forEach(r=>{const l="string"==typeof r?r:r.value;("string"==typeof r?[]:r.rules||[]).forEach(d=>{t.push(this.fb.group({id:this.fb.control(d.id||A("rule"),{nonNullable:!0}),when_option:this.fb.control(l,{nonNullable:!0}),action:this.fb.control(d.action||"hide_question",{nonNullable:!0}),target_question_id:this.fb.control(i(d.target_question_id),{nonNullable:!0}),followup_type:this.fb.control(d.followup_type||"long_text",{nonNullable:!0}),followup_label:this.fb.control(d.followup_label||"",{nonNullable:!0}),followup_mandatory:this.fb.control(!!d.followup_mandatory,{nonNullable:!0})}
1))})})}addSection(){const t=this.sectionsFA();t.push(this.newSection());const n=this.state.getState(),i=[...n.collapsedSections];i[t.length-1]=!1;const r={...n.collapsedQuestions,[t.length-1]:[]};this.state.updateState({collapsedSections:i,collapsedQuestions:r})}removeSection(t){const n=this.sectionsFA(),i=this.collectSectionQuestionIds(t);n.removeAt(t);const r=this.state.getState(),l=[...r.collapsedSections];l.splice(t,1);const c={};Object.keys(r.collapsedQuestions).map(Number).filter(d=>d!==t).sort((d,p)=>d-p).forEach((d,p)=>{c[p]=r.collapsedQuestions[d]}),this.state.updateState({collapsedSections:l,collapsedQuestions:c}),i.forEach(d=>this.cleanupRulesForQuestion(d))}addSubSection(t){this.subSectionsFA(t).push(this.newSubSection())}removeSubSection(t,n){const i=this.subQuestionsFA(t,n),r=[];for(let c=0;c<i.length;c++){const d=i.at(c).get("id")?.value;d&&r.push(d)}this.subSectionsFA(t).removeAt(n);const l=this.state.getState();l.openTypeMenu&&l.openTypeMenu.s===t&&l.openTypeMenu.ss===n&&this.state.updateState({openTypeMenu:null}),r.forEach(c=>this.cleanupRulesForQuestion(c))}dropSubSections(t,n){const i=this.subSectionsFA(t);(0,S.bA)(i.controls,n.previousIndex,n.currentIndex)}dropSections(t){const n=this.sectionsFA();(0,S.bA)(n.controls,t.previousIndex,t.currentIndex);const i=this.state.getState(),r=[...i.collapsedSections];(0,S.bA)(r,t.previousIndex,t.currentIndex);const l=Object.keys(i.collapsedQuestions).map(Number).sort((d,p)=>d-p).map(d=>i.collapsedQuestions[d]);(0,S.bA)(l,t.previousIndex,t.currentIndex);const c={};l.forEach((d,p)=>c[p]=d),this.state.updateState({collapsedSections:r,collapsedQuestions:c})}addQuestion(t,n){const i=this.questionArray(t,n);i.push(this.newQuestion());const l={...this.state.getState().collapsedQuestions},c=[...l[t]||[]];c[i.length-1]=!1,l[t]=c,this.state.updateState({collapsedQuestions:l})}removeQuestion(t,n,i){const r=this.questionArray(t,i),l=r.at(n).get("id")?.value;if(r.removeAt(n),null==i){const d={...this.state.getState().collapsedQuestions},p=[...d[t]||[]];p.splice(n,1),d[t]=p,this.state.updateState({collapsedQuestions:d})}l&&this.cleanupRulesForQuestion(l)}dropSubQuestions(t,n,i){this.dropQuestions(t,i,n)}dropQuestions(t,n,i){const r=this.questionArray(t,i),c=r.at(n.previousIndex).get("id")?.value;if(c&&this.questionHasIncomingRules(c))this.messageService.add({severity:"warn",summary:"Cannot Reorder",detail:"This question is referenced by rules in other questions and cannot be moved.",life:4e3});else if((0,S.bA)(r.controls,n.previousIndex,n.currentIndex),null==i){const p={...this.state.getState().collapsedQuestions},_=[...p[t]||[]];(0,S.bA)(_,n.previousIndex,n.currentIndex),p[t]=_,this.state.updateState({collapsedQuestions:p})}}addOption(t,n,i){this.optionsFA(t,n,i).push(this.fb.group({id:this.fb.control(A("opt"),{nonNullable:!0}),value:this.fb.control("",{nonNullable:!0})}))}removeOption(t,n,i,r){const c=this.optionsFA(t,n,r).at(i).get("value")?.value||"";this.optionsFA(t,n,r).removeAt(i),c&&this.cleanupRulesForOptionValue(t,n,c,r)}dropOptions(t,n,i,r){const l=this.optionsFA(t,n,r);(0,S.bA)(l.controls,i.previousIndex,i.currentIndex)}addRule(t,n,i,r){const l=r||this.getOptionValues(t,n,i)[0]||"",c=this.questionRulesFA(t,n,i);c.push(this.newRule(l)),this.state.updateState({pendingRuleIdx:c.length-1})}isRuleComplete(t,n,i,r){const l=this.getRuleFormGroup(t,n,i,r);if(!l||!(l.get("when_option")?.value||"").trim())return!1;const d=l.get("action")?.value;return!!d&&("show_question"===d||"hide_question"===d?!!(l.get("target_question_id")?.value||"").trim():"show_followup"!==d||!!(l.get("followup_type")?.value||"").trim())}saveRule(t,n,i,r){return this.isRuleComplete(t,n,i,r)?(this.state.updateState({pendingRuleIdx:null}),this.messageService.add({severity:"success",summary:"Condition Saved",detail:"The condition has been saved successfully.",life:2e3}),!0):(this.messageService.add({severity:"warn",summary:"Incomplete Condition",detail:"Please fill in all required fields: When option, Action, and Target/Follow-up type.",life:4e3}),!1)}removeRule(t,n,i,r){this.questionRulesFA(t,n,r).removeAt(i);const l=this.state.getState();
1l.pendingRuleIdx===i?this.state.updateState({pendingRuleIdx:null}):null!==l.pendingRuleIdx&&i<l.pendingRuleIdx&&this.state.updateState({pendingRuleIdx:l.pendingRuleIdx-1})}getQuestionTotalRuleCount(t,n,i){try{return this.questionRulesFA(t,n,i).length}catch{return 0}}getOptionValues(t,n,i){try{return this.optionsFA(t,n,i).controls.map(r=>r.get("value")?.value||"").filter(r=>r.trim().length>0)}catch{return[]}}getRuleActionLabel(t){return this.ruleActionList.find(n=>n.key===t)?.label??t}getFollowupTypeLabel(t){return this.followupTypeList.find(n=>n.key===t)?.label??t}setQuestionType(t,n,i,r){this.questionArray(t,r).at(n).get("question_type")?.setValue(i??null);const c=this.optionsFA(t,n,r);if("dropdown"===i||"radio"===i||"checkbox"===i)0===c.length&&(c.push(this.fb.group({id:this.fb.control(A("opt"),{nonNullable:!0}),value:this.fb.control("Option 1",{nonNullable:!0})})),c.push(this.fb.group({id:this.fb.control(A("opt"),{nonNullable:!0}),value:this.fb.control("Option 2",{nonNullable:!0})})));else{c.clear(),this.questionRulesFA(t,n,r).clear();const p=this.state.getState().openRulePanel;p&&p.s===t&&p.q===n&&p.ss===r&&this.state.updateState({openRulePanel:null})}this.state.updateState({openTypeMenu:null})}isChoiceType(t){return"dropdown"===t||"radio"===t||"checkbox"===t}getTypeLabel(t){if(!t)return"Select field type";const n=this.typeList.find(i=>i.key===t);return n?n.label:"Select field type"}getSameSectionQuestionsFlat(t,n){const i=[];try{const r=this.questionsFA(t);for(let c=0;c<r.length;c++){const d=r.at(c),p=d.get("id")?.value;p&&p!==n&&i.push({id:p,label:`${t+1}.${c+1}`,question_text:d.get("question_text")?.value||`Question ${t+1}.${c+1}`})}const l=this.subSectionsFA(t);for(let c=0;c<l.length;c++){const d=this.subQuestionsFA(t,c);for(let p=0;p<d.length;p++){const _=d.at(p),u=_.get("id")?.value;u&&u!==n&&i.push({id:u,label:`${t+1}.${c+1}.${p+1}`,question_text:_.get("question_text")?.value||`Question ${t+1}.${c+1}.${p+1}`})}}}catch{}return i}getAllQuestionsFlat(t){const n=[];try{const i=this.sectionsFA();for(let r=0;r<i.length;r++)n.push(...this.getSameSectionQuestionsFlat(r,t))}catch{}return n}questionHasIncomingRules(t){if(!t)return!1;try{const n=this.sectionsFA();for(let i=0;i<n.length;i++){const r=this.questionsFA(i);for(let c=0;c<r.length;c++){const d=this.questionRulesFA(i,c);for(let p=0;p<d.length;p++)if(d.at(p).get("target_question_id")?.value===t)return!0}const l=this.subSectionsFA(i);for(let c=0;c<l.length;c++){const d=this.subQuestionsFA(i,c);for(let p=0;p<d.length;p++){const _=this.questionRulesFA(i,p,c);for(let u=0;u<_.length;u++)if(_.at(u).get("target_question_id")?.value===t)return!0}}}}catch{}return!1}getQuestionById(t){return this.getAllQuestionsFlat().find(n=>n.id===t)}cleanupRulesForQuestion(t){if(t)try{const n=this.sectionsFA();for(let i=0;i<n.length;i++){const r=this.questionsFA(i);for(let c=0;c<r.length;c++)this.removeRulesTargeting(this.questionRulesFA(i,c),t);const l=this.subSectionsFA(i);for(let c=0;c<l.length;c++){const d=this.subQuestionsFA(i,c);for(let p=0;p<d.length;p++)this.removeRulesTargeting(this.questionRulesFA(i,p,c),t)}}}catch{}}cleanupRulesForOptionValue(t,n,i,r){const l=this.questionRulesFA(t,n,r);for(let c=l.length-1;c>=0;c--)l.at(c).get("when_option")?.value===i&&l.removeAt(c)}removeRulesTargeting(t,n){for(let i=t.length-1;i>=0;i--)t.at(i).get("target_question_id")?.value===n&&t.removeAt(i)}collectSectionQuestionIds(t){const n=[];try{const i=this.questionsFA(t);for(let l=0;l<i.length;l++){const c=i.at(l).get("id")?.value;c&&n.push(c)}const r=this.subSectionsFA(t);for(let l=0;l<r.length;l++){const c=this.subQuestionsFA(t,l);for(let d=0;d<c.length;d++){const p=c.at(d).get("id")?.value;p&&n.push(p)}}}catch{}return n}exportPayload(t){const n=this.rootForm().getRawValue(),i=new Map;(n.sections||[]).forEach(d=>{(d.questions||[]).forEach(p=>{i.set(p.id,p.uid||p.id)}),(d.sub_sections||[]).forEach(p=>{(p.questions||[]).forEach(_=>{i.set(_.id,_.uid||_.id)})})});let r=1;const c=(d,p)=>{const _=(d.options||[]).filter(m=>(m?.value??"").trim().length>0),u={};return(d.rules||[]).forEach(m=>{const g=m.when_option||"";g&&(u[g]||(u[g]=[]),u[g].push(m))}),{uid:d.uid,question_no:r++,question_text:d.question_text,question_type:mn(d.question_type),help_text:d.help_text,is_mandatory:d.is_mandatory,options:_.map(m=>{const g=(m?.value??"").trim(),C=(d=>(d||[]).filter(p=>"show_question"===p.action||"hide_question"===p.action?!!p.target_question_id:"show_followup"===p.action&&!!p.followup_type).map(p=>{const _={id:p.id,action:p.action};return"show_question"===p.action||"hide_question"===p.action?{..._,target_question_id:i.get(p.target_question_id)??p.target_question_id}:{..._,followup_type:p.followup_type,...p.followup_label?{followup_label:p.followup_label}:{},followup_mandatory:!!p.followup_mandatory}}))(u[g]||[]);return{value:g,rules:C}}),order:p}};
1return{title:n.title,description:n.description,status:t??"draft",sections:(n.sections||[]).map((d,p)=>({number:p+1,title:d.title,description:d.description??"",order:p+1,questions:(d.questions||[]).map((_,u)=>c(_,u+1)),sub_sections:(d.sub_sections||[]).map((_,u)=>({number:u+1,title:_.title,description:_.description??"",order:u+1,questions:(_.questions||[]).map((m,g)=>c(m,g+1))}))}))}}resetSnapshot(){const t=this.state.getState().form;t&&this.state.updateState({snapshotPayload:JSON.stringify(t.getRawValue())})}hasUnsavedChanges(){const t=this.state.getState().snapshotPayload,n=this.state.getState().form;if(!t||!n)return!1;try{return JSON.stringify(n.getRawValue())!==t}catch{return!!n.dirty}}saveDraftSilent(){const t=new oe.xQ;if(!this.isDraftValid())return this.state.updateState({submitted:!0}),this.messageService.add({severity:"warn",summary:"Cannot Save Draft",detail:"Template title and description are required to save a draft.",life:4e3}),t.next(!1),t.complete(),t.asObservable();this.state.getState().form?.markAsPristine(),this.loading.start();const n=this.exportPayload("draft"),i=this.state.getState();return("edit"===i.mode?this.templateBuilderApiService.editTemplate(i.templateId,i.oid,n):this.templateBuilderApiService.createTemplate(n,i.oid)).subscribe({next:()=>{this.messageService.add({severity:"success",summary:"Draft Saved",detail:"Template saved as draft successfully."}),this.loading.stop();const l=this.state.getState().form;l&&this.state.updateState({snapshotPayload:JSON.stringify(l.getRawValue())}),t.next(!0),t.complete()},error:()=>{this.messageService.add({severity:"error",summary:"Save Failed",detail:"Could not save the draft. Please try again.",life:4e3}),this.loading.stop(),t.next(!1),t.complete()}}),t.asObservable()}saveDraft(){if(!this.isDraftValid())return this.state.updateState({submitted:!0}),void this.messageService.add({severity:"warn",summary:"Cannot Save Draft",detail:"Template title and description are required to save a draft.",life:4e3});const t=this.state.getState().form;t?.markAsPristine(),t&&this.state.updateState({snapshotPayload:JSON.stringify(t.getRawValue())}),this.loading.start();const n=this.exportPayload("draft");"edit"===this.state.getState().mode?this.templateBuilderApiService.editTemplate(this.state.getState().templateId,this.state.getState().oid,n).subscribe(()=>{this.messageService.add({severity:"success",summary:"Draft Saved",detail:"Template saved as draft successfully."}),this.loading.stop(),setTimeout(()=>this.router.navigate(["/assessment/templates"],{queryParams:{oid:this.state.getState().oid,pid:this.state.getState().pid}}),2e3)}):this.templateBuilderApiService.createTemplate(n,this.state.getState().oid).subscribe(()=>{this.messageService.add({severity:"success",summary:"Draft Saved",detail:"Template saved as draft successfully."}),this.loading.stop(),setTimeout(()=>this.router.navigate(["/assessment/templates"],{queryParams:{oid:this.state.getState().oid,pid:this.state.getState().pid}}),2e3)})}publish(){if(!this.triggerValidation())return void this.messageService.add({severity:"warn",summary:"Incomplete Form",detail:"Please fill in all required fields before publishing.",life:4e3});const t=this.state.getState().form;t?.markAsPristine(),t&&this.state.updateState({snapshotPayload:JSON.stringify(t.getRawValue())}),this.loading.start();const n=this.exportPayload("publish");"edit"===this.state.getState().mode?this.templateBuilderApiService.editTemplate(this.state.getState().templateId,this.state.getState().oid,n).subscribe(()=>{this.messageService.add({severity:"success",summary:"Template Published",detail:"Template published successfully."}),this.loading.stop(),setTimeout(()=>this.router.navigate(["/assessment/templates"],{queryParams:{oid:this.state.getState().oid,pid:this.state.getState().pid}}),2e3)}):this.templateBuilderApiService.createTemplate(n,this.state.getState().oid).subscribe(()=>{this.messageService.add({severity:"success",summary:"Template Published",detail:"Template published successfully."}),this.loading.stop(),setTimeout(()=>this.router.navigate(["/assessment/templates"],{queryParams:{oid:this.state.getState().oid,pid:this.state.getState().pid}}),2e3)})}getValidationErrors(){const t=[],i=this.getState().form;if(!i)return t;const r=(i.get("title")?.value||"").trim(),l=i.get("description")?.value||"";r||t.push("Template title is required."),this.hasRichTextContent(l)||t.push("Template description is required.");const c=this.sectionsFA();if(!c.length)return t.push("Add at least one section."),t;for(let d=0;d<c.length;d++){const p=`Section ${d+1}`,_=this.questionsFA(d),u=this.subSectionsFA(d);_.length>0||u.controls.some(g=>g.get("questions").length>0)||t.push(`${p}: Add at least one question.`);for(let g=0;g<_.length;g++){const C=_.at(g),O=`${p}, Q${g+1}`;if(!(C.get("question_text")?.value||"").trim()){t.push(`${O}: Question text is required.`);continue}const h=C.get("question_type")?.value;if(["dropdown","radio","checkbox","yes_no"].includes(h)){const w=this.optionsFA(d,g),q="checkbox"===h||"radio"===h?2:1;if(w.length<q){const P="checkbox"===h?"Multi Select":"radio"===h?"Radio Button":null;t.push(`${O}: Add at least ${q} options${P?` (${P} requires at least 2)`:""}.`)}else w.controls.some(P=>
1!(P.get("value")?.value||"").trim())&&t.push(`${O}: All options must have a value.`)}}for(let g=0;g<u.length;g++){const O=`${p}, Sub-section ${g+1}`;(u.at(g).get("title")?.value||"").trim()||t.push(`${O}: Title is required.`);const h=this.subQuestionsFA(d,g);if(h.length)for(let w=0;w<h.length;w++){const q=h.at(w),P=`${O}, Q${w+1}`;if(!(q.get("question_text")?.value||"").trim()){t.push(`${P}: Question text is required.`);continue}const M=q.get("question_type")?.value;if(["dropdown","radio","checkbox","yes_no"].includes(M)){const F=this.optionsFA(d,w,g),j="checkbox"===M||"radio"===M?2:1;if(F.length<j){const U="checkbox"===M?"Multi Select":"radio"===M?"Radio Button":null;t.push(`${P}: Add at least ${j} options${U?` (${U} requires at least 2)`:""}.`)}else F.controls.some(U=>!(U.get("value")?.value||"").trim())&&t.push(`${P}: All options must have a value.`)}}else t.push(`${O}: Add at least one question.`)}}return t}isDraftValid(){const t=this.getState().form;if(!t)return!1;const n=(t.get("title")?.value||"").trim(),i=t.get("description")?.value||"";return!!n&&this.hasRichTextContent(i)}isDirty(){return!!this.getState().form?.dirty}isTemplateValid(){const n=this.getState().form;if(!n)return!1;const i=(n.get("title")?.value||"").trim(),r=n.get("description")?.value||"";if(!i||!this.hasRichTextContent(r))return!1;const l=this.sectionsFA();if(!l.length)return!1;for(let c=0;c<l.length;c++){if(!(l.at(c).get("title")?.value||"").trim())return!1;const _=this.questionsFA(c),u=this.subSectionsFA(c);if(!(_.length>0||u.controls.some(g=>g.get("questions").length>0)))return!1;for(let g=0;g<_.length;g++){const C=_.at(g);if(!this.isQuestionValid(C,c,g))return!1}for(let g=0;g<u.length;g++){if(!(u.at(g).get("title")?.value||"").trim())return!1;const Z=this.subQuestionsFA(c,g);if(!Z.length)return!1;for(let h=0;h<Z.length;h++){const w=Z.at(h);if(!this.isQuestionValid(w,c,h,g))return!1}}}return!0}isQuestionValid(t,n,i,r){if(!(t.get("question_text")?.value||"").trim())return!1;const c=t.get("question_type")?.value;if(!c)return!1;if("dropdown"===c||"radio"===c||"checkbox"===c||"yes_no"===c){const d=this.optionsFA(n,i,r);if(d.length<("checkbox"===c||"radio"===c?2:1)||d.controls.some(u=>!(u.get("value")?.value||"").trim()))return!1}return!0}getSectionQuestionLabel(t,n){return`${t+1}.${n+1}`}getSubSectionLabel(t,n){return`${t+1}.${n+1}`}getSubSectionQuestionLabel(t,n,i){return`${t+1}.${n+1}.${i+1}`}hasRichTextContent(t){return(t||"").replace(/<p><br><\/p>/g,"").replace(/<[^>]*>/g,"").replace(/ /g," ").trim().length>0}get v(){return this.state.getState().submitted}isTitleInvalid(){const t=this.getState().form?.get("title");return(this.v||!!t?.dirty)&&!(t?.value||"").trim()}isDescInvalid(){const t=this.getState().form?.get("description");return(this.v||!!t?.dirty)&&!this.hasRichTextContent(t?.value)}isSectionTitleInvalid(t){const n=this.sectionsFA().at(t)?.get("title");return(this.v||!!n?.dirty)&&!(n?.value||"").trim()}isSectionNoQuestion(t){const n=this.questionsFA(t),i=this.subSectionsFA(t);return!(n.length>0||i.controls.some(r=>r.get("questions").length>0))}isQuestionTextInvalid(t,n,i){const r=null==i?this.questionsFA(t).at(n)?.get("question_text"):this.subQuestionsFA(t,i).at(n)?.get("question_text");return(this.v||!!r?.dirty)&&!(r?.value||"").trim()}isQuestionTypeInvalid(t,n,i){const r=null==i?this.questionsFA(t).at(n)?.get("question_type"):this.subQuestionsFA(t,i).at(n)?.get("question_type");return this.v&&!r?.value}isSubSectionTitleInvalid(t,n){const i=this.subSectionsFA(t).at(n)?.get("title");return(this.v||!!i?.dirty)&&!(i?.value||"").trim()}isSubSectionNoQuestion(t,n){return 0===this.subQuestionsFA(t,n).length}hasEmptyOptions(t,n,i){const r=null==i?this.questionsFA(t).at(n)?.get("question_type")?.value:this.subQuestionsFA(t,i).at(n)?.get("question_type")?.value;if(!["dropdown","radio","checkbox","yes_no"].includes(r))return!1;const l=this.optionsFA(t,n,i);return l.length<("checkbox"===r||"radio"===r?2:1)||l.controls.some(d=>!(d.get("value")?.value||"").trim())}isOptionValueInvalid(t,n,i,r){const l=this.optionsFA(t,n,r).at(i)?.get("value");return(this.v||!!l?.dirty)&&!(l?.value||"").trim()}triggerValidation(){return this.state.updateState({submitted:!0}),this.isTemplateValid()}getQuestionText(t,n,i){try{return(null==i?this.questionsFA(t):this.subQuestionsFA(t,i)).at(n).get("question_text")?.value||"this question"}catch{return"this question"}}getRuleFormGroup(t,n,i,r){return this.questionRulesFA(t,n,r).at(i)}getQuestionId(t,n,i){try{return(null==i?this.questionsFA(t):this.subQuestionsFA(t,i)).at(n).get("id")?.value||""}catch{return""}}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(f.qu),e.LFG(_n),e.LFG(un),e.LFG(y.gz),e.LFG
1(Q.ez),e.LFG(y.F0),e.LFG(N.Dx),e.LFG(pe.$),e.LFG(gn.LA))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac}),s})();var se=x(591);let fn=(()=>{const a=class{constructor(){this._state=new se.X({form:null,view:"section",currentIndex:0,templateTitle:"",templateDescription:"",openSingle:null,singleActiveIndex:0,openMulti:null,expandedIds:[],pendingScroll:null,hiddenQuestionIds:[],followupValues:{},followupTouched:{}}),this.state$=this._state.asObservable()}getState(){return this._state.getValue()}updateState(t){this._state.next({...this.getState(),...t})}sectionsFA(){return this.getState().form?.get("sections")??new f.Oe([])}isExpanded(t){return this.getState().expandedIds.includes(t)}toggleExpand(t){const n=new Set(this.getState().expandedIds);n.has(t)?n.delete(t):n.add(t),this.updateState({expandedIds:Array.from(n)})}};let s=a;return a.\u0275fac=function(n){return new(n||a)},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),s})(),ve=(()=>{const a=class{constructor(t,n,i){this.fb=t,this.stateService=n,this.titleService=i,this.state$=this.stateService.state$,this.trackByIndex=r=>r}initFromTemplate(t){this.titleService.setTitle("Template Builder - "+b.N.portalPrefix);const n=this.fb.group({sections:this.fb.array([])});if(this.stateService.updateState({form:n,view:"section",currentIndex:0,templateTitle:t?.title??"",templateDescription:t?.description??"",openSingle:null,singleActiveIndex:0,openMulti:null,expandedIds:[],pendingScroll:null,hiddenQuestionIds:[],followupValues:{},followupTouched:{}}),t){this.hydrate(t);const i=this.computeInitialHiddenQuestions();this.stateService.updateState({hiddenQuestionIds:i}),this.applyValidationToHiddenQuestions(i)}}hydrate(t){const i=this.stateService.getState().form.get("sections");i.clear(),[...t.sections||[]].sort((l,c)=>(l.order??0)-(c.order??0)).forEach(l=>{const c=this.fb.group({title:this.fb.control(l.title),description:this.fb.control(l.description??""),questions:this.fb.array([]),sub_sections:this.fb.array([])});i.push(c);const d=c.get("questions");[...l.questions||[]].sort((m,g)=>(m.order??0)-(g.order??0)).forEach(m=>d.push(this.createQuestionGroup(m)));const _=c.get("sub_sections");[...l.sub_sections||[]].sort((m,g)=>(m.order??0)-(g.order??0)).forEach(m=>{const g=this.fb.group({title:this.fb.control(m.title),description:this.fb.control(m.description??""),questions:this.fb.array([])});_.push(g);const C=g.get("questions");[...m.questions||[]].sort((Z,h)=>(Z.order??0)-(h.order??0)).forEach(Z=>C.push(this.createQuestionGroup(Z)))})})}createQuestionGroup(t){const n=this.normalizeType(t.question_type),i=[],r=[];return(t.options||[]).forEach(l=>{"string"==typeof l?i.push(l):(i.push(l.value),(l.rules||[]).forEach(c=>{r.push({...c,when_option:l.value})}))}),this.fb.group({uid:this.fb.control(t.uid??""),question_text:this.fb.control(t.question_text),question_type:this.fb.control(n),help_text:this.fb.control(t.help_text??""),is_mandatory:this.fb.control(!!t.is_mandatory),options:this.fb.control(i),rules_list:this.fb.control(r),value:this.buildValueControl(n,t.is_mandatory)})}normalizeType(t){return"free_text"===t||"text"===t?"short_text":t}buildValueControl(t,n){const i=n?[f.kI.required]:[];switch(t){case"short_text":case"email":case"number":case"date":case"file":case"long_text":case"dropdown":case"radio":return this.fb.control(null,i);case"checkbox":return this.fb.control([],n?[f.kI.required]:[]);default:return this.fb.control(null)}}sectionsFA(){return this.stateService.sectionsFA()}sectionGroup(t){const n=t??this.stateService.getState().currentIndex;return this.sectionsFA().at(n)}questionsFA(t){return this.sectionGroup(t).get("questions")}subSectionsFA(t){return this.sectionGroup(t).get("sub_sections")}subQuestionsFA(t,n){return this.subSectionsFA(t).at(n).get("questions")}questionGroup(t,n,i){return null==i?this.questionsFA(t).at(n):this.subQuestionsFA(t,i).at(n)}total(){return this.sectionsFA().length}qId(t,n){return`q-${t}-${n}`}subQId(t,n,i){return`q-${t}-${n}-${i}`}sectionQuestionLabel(t,n){return`${t+1}.${n+1}`}subSectionLabel(t,n){return`${t+1}.${n+1}`}subSectionQuestionLabel(t,n,i){return`${t+1}.${n+1}.${i+1}`}hasContent(t){return(t||"").replace(/<p><br><\/p>/g,"").replace(/<[^>]*>/g,"").replace(/ /g," ").trim().length>0}computeInitialHiddenQuestions(){const t=[];try{const n=this.sectionsFA();for(let i=0;i<n.length;i++){const r=this.questionsFA(i);for(let c=0;c<r.length;c++)this.collectShowTargets(r.at(c),t);const l=this.subSectionsFA(i);for(let c=0;c<l.length;c++){const d=this.subQuestionsFA(i,c);for(let p=0;p<d.length;p++)this.collectShowTargets(d.at(p),t)}}}catch{}return t}collectShowTargets(t,n){const i=t.get("rules_list")?.value||[];for(const r of i)"show_question"===r.action&&r.target_question_id&&!n.includes(r.target_question_id)&&n.push(r.target_question_id)}reEvaluateAllRules(){const t=[...this.computeInitialHiddenQuestions()],n=new Set,i=this.sectionsFA();for(let p=0;p<i.length;p++){const _=this.questionsFA(p);for(let m=0;m<_.length;m++)this.applyRulesFromQuestion(_.at(m),t,n);const u=this.subSectionsFA(p);for(let m=0;m<u.length;m++){const g=this.subQuestionsFA(p,m);for(let C=0;C<g.length;C++)this.applyRulesFromQuestion(g.at(C),t,n)}}const r=this.stateService.getState().followupValues,l=this.stateService.getState().followupTouched,c={},d={};
1n.forEach(p=>{p in r&&(c[p]=r[p]),p in l&&(d[p]=l[p])}),this.stateService.updateState({hiddenQuestionIds:t,followupValues:c,followupTouched:d}),this.applyValidationToHiddenQuestions(t)}applyRulesFromQuestion(t,n,i){const r=t.get("rules_list")?.value||[],l=t.get("question_type")?.value,c=t.get("value")?.value;let d=[];"checkbox"===l?d=Array.isArray(c)?c:[]:null!=c&&""!==c&&(d=[c]);for(const p of r)if(p.when_option&&d.includes(p.when_option))if("hide_question"===p.action&&p.target_question_id)n.includes(p.target_question_id)||n.push(p.target_question_id);else if("show_question"===p.action&&p.target_question_id){const _=n.indexOf(p.target_question_id);_>-1&&n.splice(_,1)}else"show_followup"===p.action&&p.id&&i.add(p.id)}applyValidationToHiddenQuestions(t){try{const n=this.sectionsFA();for(let i=0;i<n.length;i++){const r=this.questionsFA(i);for(let c=0;c<r.length;c++)this.syncQuestionValidation(r.at(c),t);const l=this.subSectionsFA(i);for(let c=0;c<l.length;c++){const d=this.subQuestionsFA(i,c);for(let p=0;p<d.length;p++)this.syncQuestionValidation(d.at(p),t)}}}catch{}}syncQuestionValidation(t,n){const i=t.get("uid")?.value;if(!i)return;const r=t.get("value");if(r)if(n.includes(i)){const d="checkbox"===t.get("question_type")?.value?[]:null;r.setValue(d,{emitEvent:!1}),r.clearValidators(),r.updateValueAndValidity({emitEvent:!1})}else t.get("is_mandatory")?.value?r.setValidators([f.kI.required]):r.clearValidators(),r.updateValueAndValidity({emitEvent:!1})}getActiveFollowups(t){const n=t,i=n.get("rules_list")?.value||[],r=n.get("question_type")?.value,l=n.get("value")?.value;let c=[];return"checkbox"===r?c=Array.isArray(l)?l:[]:null!=l&&""!==l&&(c=[l]),i.filter(d=>"show_followup"===d.action&&d.followup_type&&d.when_option&&c.includes(d.when_option)).map(d=>({ruleId:d.id||`${d.when_option}_fu`,optionValue:d.when_option,followup_type:d.followup_type,followup_label:d.followup_label||`Please provide more details about "${d.when_option}"`,followup_mandatory:!!d.followup_mandatory}))}getFollowupValue(t,n){return n[t]??null}setFollowupValue(t,n){const i=this.stateService.getState();this.stateService.updateState({followupValues:{...i.followupValues,[t]:n},followupTouched:{...i.followupTouched,[t]:!0}})}touchFollowup(t){const n={...this.stateService.getState().followupTouched};n[t]=!0,this.stateService.updateState({followupTouched:n})}onFollowupFileSelect(t,n){const r=n.target.files?.[0];this.setFollowupValue(t,r?r.name:null)}isFollowupInvalid(t,n,i,r){return!!n&&!!r[t]&&!i[t]}isHidden(t,n){const i=t.get("uid")?.value;return!!i&&n.includes(i)}areFollowupsValid(){try{const t=this.stateService.getState(),n=t.currentIndex,i=c=>!!this.isHidden(c,t.hiddenQuestionIds)||this.getActiveFollowups(c).every(d=>!d.followup_mandatory||!!t.followupValues[d.ruleId]),r=this.questionsFA(n);for(let c=0;c<r.length;c++)if(!i(r.at(c)))return!1;const l=this.subSectionsFA(n);for(let c=0;c<l.length;c++){const d=this.subQuestionsFA(n,c);for(let p=0;p<d.length;p++)if(!i(d.at(p)))return!1}}catch{return!0}return!0}markCurrentSectionFollowupsTouched(){try{const t=this.stateService.getState(),n=t.currentIndex,i={...t.followupTouched},r=d=>{this.isHidden(d,t.hiddenQuestionIds)||this.getActiveFollowups(d).forEach(p=>{i[p.ruleId]=!0})},l=this.questionsFA(n);for(let d=0;d<l.length;d++)r(l.at(d));const c=this.subSectionsFA(n);for(let d=0;d<c.length;d++){const p=this.subQuestionsFA(n,d);for(let _=0;_<p.length;_++)r(p.at(_))}this.stateService.updateState({followupTouched:i})}catch{}}canNext(){return this.sectionGroup().valid&&this.areFollowupsValid()}prev(){const t=this.stateService.getState();t.currentIndex>0&&this.stateService.updateState({currentIndex:t.currentIndex-1})}next(){const t=this.sectionGroup();if(t.markAllAsTouched(),this.markCurrentSectionFollowupsTouched(),!t.valid||!this.areFollowupsValid())return;const n=this.stateService.getState();n.currentIndex<this.total()-1?this.stateService.updateState({currentIndex:n.currentIndex+1}):this.finish()}finish(){const t=this.getSubmissionPayload();console.log("Submission payload:",JSON.stringify(t,null,2))}getSubmissionPayload(){const t=this.stateService.getState(),n=t.hiddenQuestionIds,i=t.followupValues,r=[],l=this.sectionsFA();for(let c=0;c<l.length;c++){const d=this.questionsFA(c);for(let _=0;_<d.length;_++){const u=d.at(_);this.collectAnswer(u,n,i,r)}const p=this.subSectionsFA(c);for(let _=0;_<p.length;_++){const u=this.subQuestionsFA(c,_);for(let m=0;m<u.length;m++){const g=u.at(m);this.collectAnswer(g,n,i,r)}}}return r}collectAnswer(t,n,i,r){const l=t.get("uid")?.value||"";if(!l||n.includes(l))return;r.push({question_id:l,answer:t.get("value")?.value??null});const c=t.get("rules_list")?.value||[],d=t.get("value")?.value,p=t.get("question_type")?.value;let _=[];"checkbox"===p?_=Array.isArray(d)?d:[]:null!=d&&""!==d&&(_=[d]);for(const u of c)"show_followup"===u.action&&u.id&&u.when_option&&_.includes(u.when_option)&&r.push({question_id:u.id,answer:i[u.id]??null})}goOverview(){this.stateService.updateState({view:"overview",openSingle:null,openMulti:null})}goSection(t){this.stateService.updateState({view:"section",currentIndex:t,pendingScroll:null})}goQuestion(t,n,i){this.stateService.updateState({view:"section",currentIndex:t,pendingScroll:{s:t,q:n,ss:i}})}isExpanded(t){return this.stateService.isExpanded(t)}toggleExpand(t){this.stateService.toggleExpand(t)}startFromOverview(){const t=this.findFirstInvalidSection()??0;this.goSection(t)}findFirstInvalidSection(){const t=this.sectionsFA();for(let n=0;n<t.length;n++)if(!t.at(n).valid)return n;return null}isInvalid(t){return!!t&&t.touched&&t.invalid}onFileSelect(t,n){const r=t.target.files?.[0]??null;n.get("value")?.setValue(r),n.get("value")?.markAsTouched()}isSingleOpen(t,n,i){const r=this.stateService.getState().openSingle;return!!r&&r.s===t&&r.q===n&&(void 0===i&&void 0===r.ss||r.ss===i)}toggleSingle(t,n,i){if(this.isSingleOpen(t,n,i))return void this.stateService.updateState({openSingle:null});const r=this.questionGroup(t,n,i),l=r.get("options")?.value||[],c=r.get("value")?.value,d=Math.max(0,l.indexOf(c));this.stateService.updateState({openSingle:{s:t,q:n,ss:i},singleActiveIndex:d})}selectSingle(t,n,i,r,l){const c=this.questionGroup(t,n,l);c.get("value")?.setValue(i),c.get("value")?.markAsTouched(),this.stateService.updateState({singleActiveIndex:r,openSingle:null}),this.reEvaluateAllRules()}onRadioValueChange(){this.reEvaluateAllRules()}onSingleKeydown(t,n,i,r){const c=this.questionGroup(n,i,r).get("options")?.value||[];if(!c.length)return;const d=this.stateService.getState();if(!this.isSingleOpen(n,i,r))return void(("ArrowDown"===t.key||"Enter"===t.key||" "===t.key)&&(t.preventDefault(),this.toggleSingle(n,i,r)));let p=d.singleActiveIndex;switch(t.key){case"Escape":t.preventDefault(),this.stateService.updateState({openSingle:null});break;case"ArrowDown":t.preventDefault(),p=(p+1)%c.length,this.stateService.updateState({singleActiveIndex:p});break;case"ArrowUp":t.preventDefault(),p=(p-1+c.length)%c.length,this.stateService.updateState({singleActiveIndex:p});break;case"Home":t.preventDefault(),this.stateService.updateState({singleActiveIndex:0});break;case"End":t.preventDefault(),this.stateService.updateState({singleActiveIndex:c.length-1});break;case"Enter":case" ":t.preventDefault(),this.selectSingle(n,i,c[p],p,r)}}isMultiOpen(t,n,i){const r=this.stateService.getState().openMulti;return!!r&&r.s===t&&r.q===n&&(void 0===i&&void 0===r.ss||r.ss===i)}toggleMulti(t,n,i){this.stateService.updateState({openMulti:this.isMultiOpen(t,n,i)?null:{s:t,q:n,ss:i}})}isChecked(t,n){const i=t.get("value")?.value;return Array.isArray(i)&&i.includes(n)}toggleOption(t,n){const i=t.get("value"),r=Array.isArray(i.value)?[...i.value]:[],l=r.indexOf(n);l>-1?r.splice(l,1):r.push(n),i.setValue(r),i.markAsTouched(),this.reEvaluateAllRules()}closeAllPopups(){this.stateService.updateState({openSingle:null,openMulti:null})}consumePendingScroll(){const t=this.stateService.getState().pendingScroll;
1return t&&this.stateService.updateState({pendingScroll:null}),t}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(f.qu),e.LFG(fn),e.LFG(N.Dx))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac}),s})();function xn(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",11),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goOverview())}),e.O4$(),e.TgZ(1,"svg",12),e._UZ(2,"path",13),e.qZA()()}}function hn(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"a",17),e.NdJ("click",function(n){e.CHM(o);const i=e.oxw(3);return n.stopPropagation(),e.KtG(i.toggleDesc("template-desc",0))}),e._uU(1),e.qZA()}if(2&s){const o=e.oxw(3);e.xp6(1),e.hij(" ",o.isDescExpanded("template-desc",0)?"Show Less":"Show More"," ")}}function vn(s,a){if(1&s&&(e.TgZ(0,"div",14),e._UZ(1,"div",15),e.YNc(2,hn,2,1,"a",16),e.qZA()),2&s){const o=e.oxw().ngIf,t=e.oxw();e.xp6(1),e.ekj("ql-display--clamped",!t.isDescExpanded("template-desc",0)),e.Q6J("innerHTML",o.templateDescription,e.oJD),e.xp6(1),e.Q6J("ngIf",t.isLongDescription(o.templateDescription))}}function bn(s,a){if(1&s&&(e.TgZ(0,"div",18),e._uU(1),e.qZA()),2&s){const o=e.oxw().ngIf,t=e.oxw();e.xp6(1),e.AsE(" Section ",o.currentIndex+1," of ",t.total()," ")}}function wn(s,a){if(1&s&&(e.TgZ(0,"div",19),e._UZ(1,"div",20),e.qZA()),2&s){const o=e.oxw().ngIf,t=e.oxw();e.xp6(1),e.Udp("width",(o.currentIndex+1)/(t.total()||1)*100,"%")}}function Cn(s,a){1&s&&(e.O4$(),e.TgZ(0,"svg",12),e._UZ(1,"path",37),e.qZA())}function Tn(s,a){1&s&&(e.O4$(),e.TgZ(0,"svg",12),e._UZ(1,"path",38),e.qZA())}function yn(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"a",17),e.NdJ("click",function(n){e.CHM(o);const i=e.oxw(2).index,r=e.oxw(3);return n.stopPropagation(),e.KtG(r.toggleDesc("overview-section",i))}),e._uU(1),e.qZA()}if(2&s){const o=e.oxw(2).index,t=e.oxw(3);e.xp6(1),e.hij(" ",t.isDescExpanded("overview-section",o)?"Read Less":"Read More"," ")}}function kn(s,a){if(1&s&&(e.TgZ(0,"div",39),e._UZ(1,"div",15),e.YNc(2,yn,2,1,"a",16),e.qZA()),2&s){const o=e.oxw(),t=o.index,n=o.$implicit,i=e.oxw(3);let r,l;e.xp6(1),e.ekj("ql-display--clamped",!i.isDescExpanded("overview-section",t)),e.Q6J("innerHTML",null==(r=n.get("description"))?null:r.value,e.oJD),e.xp6(1),e.Q6J("ngIf",i.isLongDescription(null==(l=n.get("description"))?null:l.value))}}function On(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",43),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(2).index,l=e.oxw(3);return e.KtG(l.goQuestion(r,i))}),e.TgZ(1,"span",44),e._uU(2),e.qZA(),e.TgZ(3,"span",45),e._uU(4),e.qZA()()}if(2&s){const o=a.$implicit,t=a.index,n=e.oxw(2).index,i=e.oxw(3);let r;e.xp6(2),e.hij("Q ",i.sectionQuestionLabel(n,t),""),e.xp6(2),e.Oqu(null==(r=o.get("question_text"))?null:r.value)}}function Mn(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"a",17),e.NdJ("click",function(n){e.CHM(o);const i=e.oxw(2).index,r=e.oxw(2).index,l=e.oxw(3);return n.stopPropagation(),e.KtG(l.toggleDesc("overview-sub",r,i))}),e._uU(1),e.qZA()}if(2&s){const o=e.oxw(2).index,t=e.oxw(2).index,n=e.oxw(3);e.xp6(1),e.hij(" ",n.isDescExpanded("overview-sub",t,o)?"Read Less":"Read More"," ")}}function Pn(s,a){if(1&s&&(e.TgZ(0,"div",39),e._UZ(1,"div",15),e.YNc(2,Mn,2,1,"a",16),e.qZA()),2&s){const o=e.oxw(),t=o.index,n=o.$implicit,i=e.oxw(2).index,r=e.oxw(3);let l,c;e.xp6(1),e.ekj("ql-display--clamped",!r.isDescExpanded("overview-sub",i,t)),e.Q6J("innerHTML",null==(l=n.get("description"))?null:l.value,e.oJD),e.xp6(1),e.Q6J("ngIf",r.isLongDescription(null==(c=n.get("description"))?null:c.value))}}function An(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",43),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw().index,l=e.oxw(2).index,c=e.oxw(3);return e.KtG(c.goQuestion(l,i,r))}),e.TgZ(1,"span",44),e._uU(2),e.qZA(),e.TgZ(3,"span",45),e._uU(4),e.qZA()()}if(2&s){const o=a.$implicit,t=a.index,n=e.oxw().index,i=e.oxw(2).index,r=e.oxw(3);let l;e.xp6(2),e.hij("Q ",r.subSectionQuestionLabel(i,n,t),""),e.xp6(2),e.Oqu(null==(l=o.get("question_text"))?null:l.value)}}function Zn(s,a){if(1&s&&(e.TgZ(0,"div",46)(1,"div",47)(2,"span",48),e._uU(3),e.qZA(),e.TgZ(4,"span",49),e._uU(5),e.qZA()(),e.YNc(6,Pn,3,4,"div",35),e.YNc(7,An,5,2,"button",41),e.qZA()),2&s){const o=a.$implicit,t=a.index,n=e.oxw(2).index,i=e.oxw(3);let r,l;e.xp6(3),e.hij("Sub ",i.subSectionLabel(n,t),""),e.xp6(2),e.Oqu(null==(r=o.get("title"))?null:r.value),e.xp6(1),e.Q6J("ngIf",i.hasContent(null==(l=o.get("description"))?null:l.value)),e.xp6(1),e.Q6J("ngForOf",i.subQuestionsFA(n,t).controls)}}function qn(s,a){if(1&s&&(e.TgZ(0,"div",40),e.YNc(1,On,5,2,"button",41),e.YNc(2,Zn,8,4,"div",42),e.qZA()),2&s){const o=e.oxw().index,t=e.oxw(3);e.xp6(1),e.Q6J("ngForOf",t.questionsFA(o).controls),e.xp6(1),e.Q6J("ngForOf",t.subSectionsFA(o).controls)}}function Sn(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",30)(1,"button",31),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(3);return e.KtG(r.toggleExpand(i))}),e.TgZ(2,"span",32),e._uU(3),e.qZA(),e.TgZ(4,"span",33),e.YNc(5,Cn,2,0,"svg",34),e.YNc(6,Tn,2,0,"svg",34),e.qZA()(),e.YNc(7,kn,3,4,"div",35),e.YNc(8,qn,3,2,"div",36),e.qZA()}if(2&s){const o=a.$implicit,t=a.index,n=e.oxw(3);let i,r;e.xp6(3),e.AsE("Section ",t+1,": ",null==(i=o.get("title"))?null:i.value,""),e.xp6(2),e.Q6J("ngIf",!n.isExpanded(t)),e.xp6(1),e.Q6J("ngIf",n.isExpanded(t)),e.xp6(1),e.Q6J("ngIf",n.isExpanded(t)&&n.hasContent(null==(r=o.get("description"))?null:r.value)),e.xp6(1),e.Q6J("ngIf",n.isExpanded(t))}}function In(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"section",21)(1,"div",22)(2,"h2",23),e._uU(3,"Questions"),e.qZA(),e.TgZ(4,"div",24),e.YNc(5,Sn,9,6,"div",25),e.qZA(),e.TgZ(6,"footer",26)(7,"button",27),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.startFromOverview())}),e._uU(8," Start "),e.O4$(),e.TgZ(9,"svg",28),e._UZ(10,"path",29),e.qZA()()()()()}if(2&s){const o=e.oxw(2);e.xp6(5),e.Q6J("ngForOf",o.sectionsFA().controls)}}function Un(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"a",17),e.NdJ("click",function(n){e.CHM(o);const i=e.oxw(3).ngIf,r=e.oxw();return n.stopPropagation(),e.KtG(r.toggleDesc("section-banner",i.currentIndex))}),e._uU(1),e.qZA()}if(2&s){const o=e.oxw(3).ngIf,t=e.oxw();e.xp6(1),e.hij(" ",t.isDescExpanded("section-banner",o.currentIndex)?"Read Less":"Read More"," ")}}function Fn(s,a){if(1&s&&(e.TgZ(0,"div",62),e._UZ(1,"div",15),e.YNc(2,Un,2,1,"a",16),e.qZA()),2&s){const o=e.oxw(2).ngIf,t=e.oxw();let n,i;e.xp6(1),e.ekj("ql-display--clamped",!t.isDescExpanded("section-banner",o.currentIndex)),e.Q6J("innerHTML",null==(n=t.sectionGroup(o.currentIndex).get("description"))?null:n.value,e.oJD),e.xp6(1),e.Q6J("ngIf",t.isLongDescription(null==(i=t.sectionGroup(o.currentIndex).get("description"))?null:i.value))}}function Qn(s,a){1&s&&(e.TgZ(0,"span",78),e._uU(1,"*"),e.qZA())}function Dn(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"a",17),e.NdJ("click",function(n){e.CHM(o);const i=e.oxw(3).index,r=e.oxw(2).ngIf,l=e.oxw();return n.stopPropagation(),e.KtG(l.toggleDesc("q-help",r.currentIndex,i))}),e._uU(1),e.qZA()}if(2&s){const o=e.oxw(3).index,t=e.oxw(2).ngIf,n=e.oxw();e.xp6(1),e.hij(" ",n.isDescExpanded("q-help",t.currentIndex,o)?"Show Less":"Show More"," ")}}function Nn(s,a){if(1&s&&(e.TgZ(0,"div",79),e._UZ(1,"div",15),e.YNc(2,Dn,2,1,"a",16),e.qZA()),2&s){const o=e.oxw(2),t=
1o.index,n=o.$implicit,i=e.oxw(2).ngIf,r=e.oxw();let l,c;e.xp6(1),e.ekj("ql-display--clamped",!r.isDescExpanded("q-help",i.currentIndex,t)),e.Q6J("innerHTML",null==(l=n.get("help_text"))?null:l.value,e.oJD),e.xp6(1),e.Q6J("ngIf",r.isLongDescription(null==(c=n.get("help_text"))?null:c.value))}}function Jn(s,a){1&s&&e._UZ(0,"input",80)}function Rn(s,a){1&s&&e._UZ(0,"textarea",81)}function $n(s,a){1&s&&(e.TgZ(0,"span",94),e._uU(1,"Select an option..."),e.qZA())}function Bn(s,a){if(1&s&&(e.TgZ(0,"span",95),e._uU(1),e.qZA()),2&s){const o=e.oxw(3).$implicit;let t;e.xp6(1),e.Oqu(null==(t=o.get("value"))?null:t.value)}}function Yn(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",96),e.NdJ("mouseenter",function(){const i=e.CHM(o).index,r=e.oxw(5).ngIf;return e.KtG(r.singleActiveIndex=i)})("click",function(){const n=e.CHM(o),i=n.$implicit,r=n.index,l=e.oxw(3).index,c=e.oxw(2).ngIf,d=e.oxw();return e.KtG(d.selectSingle(c.currentIndex,l,i,r))}),e._uU(1),e.qZA()}if(2&s){const o=a.$implicit,t=a.index,n=e.oxw(3).$implicit,i=e.oxw(2).ngIf;let r;e.ekj("active",(null==(r=n.get("value"))?null:r.value)===o)("focus",i.singleActiveIndex===t),e.xp6(1),e.hij(" ",o," ")}}function En(s,a){if(1&s&&(e.TgZ(0,"option",91),e._uU(1),e.qZA()),2&s){const o=a.$implicit;e.Q6J("ngValue",o),e.xp6(1),e.hij(" ",o," ")}}function jn(s,a){1&s&&(e.TgZ(0,"div",97),e._uU(1," This field is required. "),e.qZA())}function zn(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",82)(1,"button",83),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).index,i=e.oxw(2).ngIf,r=e.oxw();return e.KtG(r.toggleSingle(i.currentIndex,n))})("keydown",function(n){e.CHM(o);const i=e.oxw(2).index,r=e.oxw(2).ngIf,l=e.oxw();return e.KtG(l.onSingleKeydown(n,r.currentIndex,i))}),e.YNc(2,$n,2,0,"span",84),e.YNc(3,Bn,2,1,"span",85),e.O4$(),e.TgZ(4,"svg",86),e._UZ(5,"path",87),e.qZA()(),e.kcU(),e.TgZ(6,"div",88),e.YNc(7,Yn,2,5,"button",89),e.qZA(),e.TgZ(8,"select",90),e._UZ(9,"option",91),e.YNc(10,En,2,2,"option",92),e.qZA(),e.YNc(11,jn,2,0,"div",93),e.qZA()}if(2&s){const o=e.oxw(2),t=o.index,n=o.$implicit,i=e.oxw(2).ngIf,r=e.oxw();let l,c,d,p;e.ekj("open",r.isSingleOpen(i.currentIndex,t))("invalid",r.isInvalid(n.get("value"))),e.xp6(2),e.Q6J("ngIf",!(null!=(l=n.get("value"))&&l.value)),e.xp6(1),e.Q6J("ngIf",null==(c=n.get("value"))?null:c.value),e.xp6(4),e.Q6J("ngForOf",null==(d=n.get("options"))?null:d.value),e.xp6(2),e.Q6J("ngValue",null),e.xp6(1),e.Q6J("ngForOf",null==(p=n.get("options"))?null:p.value),e.xp6(1),e.Q6J("ngIf",r.isInvalid(n.get("value")))}}function Ln(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"label",100)(1,"input",101),e.NdJ("change",function(){e.CHM(o);const n=e.oxw(6);return e.KtG(n.svc.onRadioValueChange())}),e.qZA(),e.TgZ(2,"span"),e._uU(3),e.qZA()()}if(2&s){const o=a.$implicit;e.xp6(1),e.Q6J("value",o),e.xp6(2),e.Oqu(o)}}function Gn(s,a){if(1&s&&(e.TgZ(0,"div",98),e.YNc(1,Ln,4,2,"label",99),e.qZA()),2&s){const o=e.oxw(2).$implicit;let t;e.xp6(1),e.Q6J("ngForOf",null==(t=o.get("options"))?null:t.value)}}function Hn(s,a){if(1&s&&(e.TgZ(0,"span",108),e._uU(1),e.qZA()),2&s){const o=a.$implicit;e.xp6(1),e.Oqu(o)}}function Kn(s,a){if(1&s&&(e.ynx(0),e.YNc(1,Hn,2,1,"span",107),e.BQk()),2&s){const o=e.oxw(3).$implicit,t=e.oxw(3);let n;e.xp6(1),e.Q6J("ngForOf",null==(n=o.get("value"))?null:n.value)("ngForTrackBy",t.trackByIndex)}}function Vn(s,a){1&s&&(e.TgZ(0,"span",94),e._uU(1,"Select one or more..."),e.qZA())}function Wn(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",109),e.NdJ("click",function(){const i=e.CHM(o).$implicit,r=e.oxw(3).$implicit,l=e.oxw(3);return e.KtG(l.toggleOption(r,i))}),e.TgZ(1,"span"),e._uU(2),e.qZA()()}if(2&s){const o=a.$implicit,t=e.oxw(3).$implicit,n=e.oxw(3);e.ekj("active",n.isChecked(t,o)),e.xp6(2),e.Oqu(o)}}function Xn(s,a){1&s&&(e.TgZ(0,"div",97),e._uU(1," Please select at least one option. "),e.qZA())}const be=function(){return[]};function eo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",82)(1,"button",102),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).index,i=e.oxw(2).ngIf,r=e.oxw();return e.KtG(r.toggleMulti(i.currentIndex,n))}),e.YNc(2,Kn,2,2,"ng-container",103),e.YNc(3,Vn,2,0,"ng-template",null,104,e.W1O),e.O4$(),e.TgZ(5,"svg",86),e._UZ(6,"path",87),e.qZA()(),e.kcU(),e.TgZ(7,"div",105),e.YNc(8,Wn,3,3,"div",106),e.qZA(),e.YNc(9,Xn,2,0,"div",93),e.qZA()}if(2&s){const o=e.MAs(4),t=e.oxw(2),n=t.index,i=t.$implicit,r=e.oxw(2).ngIf,l=e.oxw();let c,d;e.ekj("open",l.isMultiOpen(r.currentIndex,n))("invalid",l.isInvalid(i.get("value"))),e.xp6(2),e.Q6J("ngIf",((null==(c=i.get("value"))?null:c.value)||e.DdM(8,be)).length)("ngIfElse",o),e.xp6(6),e.Q6J("ngForOf",null==(d=i.get("options"))?null:d.value),e.xp6(1),e.Q6J("ngIf",l.isInvalid(i.get("value")))}}function to(s,a){1&s&&e._UZ(0,"input",110)}function no(s,a){1&s&&e._UZ(0,"input",111)}function oo(s,a){1&s&&e._UZ(0,"input",112)}function io(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"label",113)(1,"input",114),e.NdJ("change",function(n){e.CHM(o);const i=e.oxw(2).$implicit,r=e.oxw(3);return e.KtG(r.onFileSelect(n,i))}),e.qZA(),e.TgZ(2,"span",115),e._uU(3),e.qZA()()}if(2&s){const o=e.oxw(2).$implicit;let t;e.xp6(3),e.Oqu((null==(t=o.get("value"))||null==t.value?null:t.value.name)||"Choose a file...")}}function so(s,a){1&s&&(e.TgZ(0,"span",78),e._uU(1,"*"),e.qZA())}function ro(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"input",128),e.NdJ("input",function(n){e.CHM(o);const i=e.oxw().$implicit,r=e.oxw(5);return e.KtG(r.svc.setFollowupValue(i.ruleId,n.target.value))})("blur",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(5);return e.KtG(i.svc.touchFollowup(n.ruleId))}),e.qZA()}if(2&s){const o=e.oxw().$implicit,t=e.oxw(4).ngIf,n=e.oxw();e.ekj("inp--error",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.Q6J("value",n.svc.getFollowupValue(o.ruleId,t.followupValues)||"")}}function ao(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"textarea",129),e.NdJ("input",function(n){e.CHM(o);const i=e.oxw().$implicit,r=e.oxw(5);return e.KtG(r.svc.setFollowupValue(i.ruleId,n.target.value))})("blur",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(5);return e.KtG(i.svc.touchFollowup(n.ruleId))}),e.qZA()}if(2&s){const o=e.oxw().$implicit,t=e.oxw(4).ngIf,n=e.oxw();e.ekj("area--error",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.Q6J("value",n.svc.getFollowupValue(o.ruleId,t.followupValues)||"")}}function lo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"input",130),e.NdJ("input",function(n){e.CHM(o);const i=e.oxw().$implicit,r=e.oxw(5);return e.KtG(r.svc.setFollowupValue(i.ruleId,n.target.value))})("blur",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(5);return e.KtG(i.svc.touchFollowup(n.ruleId))}),e.qZA()}if(2&s){const o=e.oxw().$implicit,t=e.oxw(4).ngIf,n=e.oxw();e.ekj("inp--error",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.Q6J("value",n.svc.getFollowupValue(o.ruleId,t.followupValues)||"")}}function co(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"input",131),e.NdJ("input",function(n){e.CHM(o);const i=e.oxw().$implicit,r=e.oxw(5);return e.KtG(r.svc.setFollowupValue(i.ruleId,n.target.value))})("blur",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(5);return e.KtG(i.svc.touchFollowup(n.ruleId))}),e.qZA()}if(2&s){const o=e.oxw().$implicit,t=e.oxw(4).ngIf,n=e.oxw();e.ekj("inp--error",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.Q6J("value",n.svc.getFollowupValue(o.ruleId,t.followupValues)||"")}}function po(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"label",132)(1,"input",133),e.NdJ("change",function(n){e.CHM(o);const i=e.oxw().$implicit,r=e.oxw(5);return e.KtG(r.svc.onFollowupFileSelect(i.ruleId,n))})("blur",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(5);return e.KtG(i.svc.touchFollowup(n.ruleId))}),e.qZA(),e.TgZ(2,"span",115),e._uU(3),e.qZA()()}if(2&s){const o=e.oxw().$implicit,t=e.oxw(4).ngIf,n=e.oxw();e.ekj("followup-file--error",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.xp6(3),e.Oqu(n.svc.getFollowupValue(o.ruleId,t.followupValues)||"Choose a file...")}}function _o(s,a){1&s&&(e.TgZ(0,"div",134),e._uU(1," This field is required. "),e.qZA())}function uo(s,a){if(1&s&&(e.ynx(0),e.TgZ(1,"div",116)(2,"div",117),e.O4$(),e.TgZ(3,"svg",118),e._UZ(4,"polyline",119),e.qZA(),e.kcU(),e.TgZ(5,"span",120),e._uU(6,"Because you selected "),e.TgZ(7,"strong"),e._uU(8),e.qZA()()(),e.TgZ(9,"label",121),e._uU(10),e.YNc(11,so,2,0,"span",67),e.qZA(),e.ynx(12,69),e.YNc(13,ro,1,3,"input",122),e.YNc(14,ao,1,3,"textarea",123),e.YNc(15,lo,1,3,"input",124),e.YNc(16,co,1,3,"input",125),e.YNc(17,po,4,3,"label",126),e.BQk(),e.YNc(18,_o,2,0,"div",127),e.qZA(),e.BQk()),2&s){const o=a.$implicit,t=e.oxw(4).ngIf,n=e.oxw();e.xp6(1),e.ekj("followup-wrap--invalid",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.xp6(7),e.hij('"',o.optionValue,'"'),e.xp6(2),e.hij(" ",o.followup_label," "),e.xp6(1),e.Q6J("ngIf",o.followup_mandatory),e.xp6(1),e.Q6J("ngSwitch",o.followup_type),e.xp6(1),e.Q6J("ngSwitchCase","short_text"),e.xp6(1),e.Q6J("ngSwitchCase","long_text"),e.xp6(1),e.Q6J("ngSwitchCase","number"),e.xp6(1),e.Q6J("ngSwitchCase","date"),e.xp6(1),e.Q6J("ngSwitchCase","file"),e.xp6(1),e.Q6J("ngIf",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched))}}function go(s,a){if(1&s&&(e.TgZ(0,"div",64)(1,"label",65)(2,"span",66),e._uU(3),e.qZA(),e.TgZ(4,"span"),e._uU(5),e.qZA(),e.YNc(6,Qn,2,0,"span",67),e.qZA(),e.YNc(7,Nn,3,4,"div",68),e.ynx(8,69),e.YNc(9,Jn,1,0,"input",70),e.YNc(10,Rn,1,0,"textarea",71),e.YNc(11,zn,12,10,"div",72),e.YNc(12,Gn,2,1,"div",73),e.YNc(13,eo,10,9,"div",72),e.YNc(14,to,1,0,"input",74),e.YNc(15,no,1,0,"input",75),e.YNc(16,oo,1,0,"input",76),e.YNc(17,io,4,1,"label",77),e.BQk(),e.YNc(18,uo,19,12,"ng-container",57),e.qZA()),2&s){const o=e.oxw(),t=o.index,n=o.$implicit,i=e.oxw(2).ngIf,r=e.oxw();let l,c,d,p;e.Q6J("formGroupName",t),e.uIk("id",r.qId(i.currentIndex,t)),e.xp6(3),e.hij("Q ",r.sectionQuestionLabel(i.currentIndex,t),""),e.xp6(2),e.Oqu(null==(l=n.get("question_text"))?null:l.value),e.xp6(1),e.Q6J("ngIf",null==(c=n.get("is_mandatory"))?null:c.value),e.xp6(1),e.Q6J("ngIf",r.hasContent(null==(d=n.get("help_text"))?null:d.value)),e.xp6(1),e.Q6J("ngSwitch",null==(p=n.get("question_type"))?null:p.value),e.xp6(1),e.Q6J("ngSwitchCase","short_text"),e.xp6(1),e.Q6J("ngSwitchCase","long_text"),e.xp6(1),e.Q6J("ngSwitchCase","dropdown"),e.xp6(1),e.Q6J("ngSwitchCase","radio"),e.xp6(1),e.Q6J("ngSwitchCase","checkbox"),e.xp6(1),e.Q6J("ngSwitchCase","date"),e.xp6(1),e.Q6J("ngSwitchCase","number"),e.xp6(1),e.Q6J("ngSwitchCase","email"),e.xp6(1),e.Q6J("ngSwitchCase","file"),e.xp6(1),e.Q6J("ngForOf",r.svc.getActiveFollowups(n))("ngForTrackBy",r.trackByIndex)}}function mo(s,a){if(1&s&&(e.ynx(0),e.YNc(1,go,19,18,"div",63),e.BQk()),2&s){const o=a.$implicit,t=e.oxw(2).ngIf,n=e.oxw();e.xp6(1),e.Q6J("ngIf",!n.svc.isHidden(o,t.hiddenQuestionIds))}}function fo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"a",17),e.NdJ("click",function(n){e.CHM(o);const i=e.oxw(3).index,r=e.oxw(3).ngIf,l=e.oxw();return n.stopPropagation(),e.KtG(l.toggleDesc("section-sub",r.currentIndex,i))}),e._uU(1),e.qZA()}if(2&s){const o=e.oxw(3).index,t=e.oxw(3).ngIf,n=e.oxw();e.xp6(1),e.hij(" ",n.isDescExpanded("section-sub",t.currentIndex,o)?"Read Less":"Read More"," ")}}function xo(s,a){if(1&s&&(e.TgZ(0,"div",145),e._UZ(1,"div",15),e.YNc(2,fo,2,1,"a",16),e.qZA()),2&s){const o=e.oxw(2),t=
1o.index,n=o.$implicit,i=e.oxw(3).ngIf,r=e.oxw();let l,c;e.xp6(1),e.ekj("ql-display--clamped",!r.isDescExpanded("section-sub",i.currentIndex,t)),e.Q6J("innerHTML",null==(l=n.get("description"))?null:l.value,e.oJD),e.xp6(1),e.Q6J("ngIf",r.isLongDescription(null==(c=n.get("description"))?null:c.value))}}function ho(s,a){1&s&&(e.TgZ(0,"span",78),e._uU(1,"*"),e.qZA())}function vo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"a",17),e.NdJ("click",function(n){e.CHM(o);const i=e.oxw(3).index,r=e.oxw(5).ngIf,l=e.oxw();return n.stopPropagation(),e.KtG(l.toggleDesc("q-help",r.currentIndex,i))}),e._uU(1),e.qZA()}if(2&s){const o=e.oxw(3).index,t=e.oxw(5).ngIf,n=e.oxw();e.xp6(1),e.hij(" ",n.isDescExpanded("q-help",t.currentIndex,o)?"Show Less":"Show More"," ")}}function bo(s,a){if(1&s&&(e.TgZ(0,"div",79),e._UZ(1,"div",15),e.YNc(2,vo,2,1,"a",16),e.qZA()),2&s){const o=e.oxw(2),t=o.index,n=o.$implicit,i=e.oxw(5).ngIf,r=e.oxw();let l,c;e.xp6(1),e.ekj("ql-display--clamped",!r.isDescExpanded("q-help",i.currentIndex,t)),e.Q6J("innerHTML",null==(l=n.get("help_text"))?null:l.value,e.oJD),e.xp6(1),e.Q6J("ngIf",r.isLongDescription(null==(c=n.get("help_text"))?null:c.value))}}function wo(s,a){1&s&&e._UZ(0,"input",80)}function Co(s,a){1&s&&e._UZ(0,"textarea",81)}function To(s,a){1&s&&(e.TgZ(0,"span",94),e._uU(1,"Select an option..."),e.qZA())}function yo(s,a){if(1&s&&(e.TgZ(0,"span",95),e._uU(1),e.qZA()),2&s){const o=e.oxw(3).$implicit;let t;e.xp6(1),e.Oqu(null==(t=o.get("value"))?null:t.value)}}function ko(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",96),e.NdJ("mouseenter",function(){const i=e.CHM(o).index,r=e.oxw(8).ngIf;return e.KtG(r.singleActiveIndex=i)})("click",function(){const n=e.CHM(o),i=n.$implicit,r=n.index,l=e.oxw(3).index,c=e.oxw(2).index,d=e.oxw(3).ngIf,p=e.oxw();return e.KtG(p.selectSingle(d.currentIndex,l,i,r,c))}),e._uU(1),e.qZA()}if(2&s){const o=a.$implicit,t=a.index,n=e.oxw(3).$implicit,i=e.oxw(5).ngIf;let r;e.ekj("active",(null==(r=n.get("value"))?null:r.value)===o)("focus",i.singleActiveIndex===t),e.xp6(1),e.hij(" ",o," ")}}function Oo(s,a){if(1&s&&(e.TgZ(0,"option",91),e._uU(1),e.qZA()),2&s){const o=a.$implicit;e.Q6J("ngValue",o),e.xp6(1),e.hij(" ",o," ")}}function Mo(s,a){1&s&&(e.TgZ(0,"div",97),e._uU(1," This field is required. "),e.qZA())}function Po(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",82)(1,"button",83),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).index,i=e.oxw(2).index,r=e.oxw(3).ngIf,l=e.oxw();return e.KtG(l.toggleSingle(r.currentIndex,n,i))})("keydown",function(n){e.CHM(o);const i=e.oxw(2).index,r=e.oxw(2).index,l=e.oxw(3).ngIf,c=e.oxw();return e.KtG(c.onSingleKeydown(n,l.currentIndex,i,r))}),e.YNc(2,To,2,0,"span",84),e.YNc(3,yo,2,1,"span",85),e.O4$(),e.TgZ(4,"svg",86),e._UZ(5,"path",87),e.qZA()(),e.kcU(),e.TgZ(6,"div",88),e.YNc(7,ko,2,5,"button",89),e.qZA(),e.TgZ(8,"select",90),e._UZ(9,"option",91),e.YNc(10,Oo,2,2,"option",92),e.qZA(),e.YNc(11,Mo,2,0,"div",93),e.qZA()}if(2&s){const o=e.oxw(2),t=o.index,n=o.$implicit,i=e.oxw(2).index,r=e.oxw(3).ngIf,l=e.oxw();let c,d,p,_;e.ekj("open",l.isSingleOpen(r.currentIndex,t,i))("invalid",l.isInvalid(n.get("value"))),e.xp6(2),e.Q6J("ngIf",!(null!=(c=n.get("value"))&&c.value)),e.xp6(1),e.Q6J("ngIf",null==(d=n.get("value"))?null:d.value),e.xp6(4),e.Q6J("ngForOf",null==(p=n.get("options"))?null:p.value),e.xp6(2),e.Q6J("ngValue",null),e.xp6(1),e.Q6J("ngForOf",null==(_=n.get("options"))?null:_.value),e.xp6(1),e.Q6J("ngIf",l.isInvalid(n.get("value")))}}function Ao(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"label",100)(1,"input",101),e.NdJ("change",function(){e.CHM(o);const n=e.oxw(9);return e.KtG(n.svc.onRadioValueChange())}),e.qZA(),e.TgZ(2,"span"),e._uU(3),e.qZA()()}if(2&s){const o=a.$implicit;e.xp6(1),e.Q6J("value",o),e.xp6(2),e.Oqu(o)}}function Zo(s,a){if(1&s&&(e.TgZ(0,"div",98),e.YNc(1,Ao,4,2,"label",99),e.qZA()),2&s){const o=e.oxw(2).$implicit;let t;e.xp6(1),e.Q6J("ngForOf",null==(t=o.get("options"))?null:t.value)}}function qo(s,a){if(1&s&&(e.TgZ(0,"span",108),e._uU(1),e.qZA()),2&s){const o=a.$implicit;e.xp6(1),e.Oqu(o)}}function So(s,a){if(1&s&&(e.ynx(0),e.YNc(1,qo,2,1,"span",107),e.BQk()),2&s){const o=e.oxw(3).$implicit,t=e.oxw(6);let n;e.xp6(1),e.Q6J("ngForOf",null==(n=o.get("value"))?null:n.value)("ngForTrackBy",t.trackByIndex)}}function Io(s,a){1&s&&(e.TgZ(0,"span",94),e._uU(1,"Select one or more..."),e.qZA())}function Uo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",109),e.NdJ("click",function(){const i=e.CHM(o).$implicit,r=e.oxw(3).$implicit,l=e.oxw(6);return e.KtG(l.toggleOption(r,i))}),e.TgZ(1,"span"),e._uU(2),e.qZA()()}if(2&s){const o=a.$implicit,t=e.oxw(3).$implicit,n=e.oxw(6);e.ekj("active",n.isChecked(t,o)),e.xp6(2),e.Oqu(o)}}function Fo(s,a){1&s&&(e.TgZ(0,"div",97),e._uU(1," Please select at least one option. "),e.qZA())}function Qo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",82)(1,"button",102),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).index,i=e.oxw(2).index,r=e.oxw(3).ngIf,l=e.oxw();return e.KtG(l.toggleMulti(r.currentIndex,n,i))}),e.YNc(2,So,2,2,"ng-container",103),e.YNc(3,Io,2,0,"ng-template",null,146,e.W1O),e.O4$(),e.TgZ(5,"svg",86),e._UZ(6,"path",87),e.qZA()(),e.kcU(),e.TgZ(7,"div",105),e.YNc(8,Uo,3,3,"div",106),e.qZA(),e.YNc(9,Fo,2,0,"div",93),e.qZA()}if(2&s){const o=e.MAs(4),t=e.oxw(2),n=t.index,i=t.$implicit,r=e.oxw(2).index,l=e.oxw(3).ngIf,c=e.oxw();let d,p;e.ekj("open",c.isMultiOpen(l.currentIndex,n,r))("invalid",c.isInvalid(i.get("value"))),e.xp6(2),e.Q6J("ngIf",((null==(d=i.get("value"))?null:d.value)||e.DdM(8,be)).length)("ngIfElse",o),e.xp6(6),e.Q6J("ngForOf",null==(p=i.get("options"))?null:p.value),e.xp6(1),e.Q6J("ngIf",c.isInvalid(i.get("value")))}}function Do(s,a){1&s&&e._UZ(0,"input",110)}function No(s,a){1&s&&e._UZ(0,"input",111)}function Jo(s,a){1&s&&e._UZ(0,"input",112)}function Ro(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"label",113)(1,"input",114),e.NdJ("change",function(n){e.CHM(o);const i=e.oxw(2).$implicit,r=e.oxw(6);return e.KtG(r.onFileSelect(n,i))}),e.qZA(),e.TgZ(2,"span",115),e._uU(3),e.qZA()()}if(2&s){const o=e.oxw(2).$implicit;let t;e.xp6(3),e.Oqu((null==(t=o.get("value"))||null==t.value?null:t.value.name)||"Choose a file...")}}function $o(s,a){1&s&&(e.TgZ(0,"span",78),e._uU(1,"*"),e.qZA())}function Bo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"input",128),e.NdJ("input",function(n){e.CHM(o);const i=e.oxw().$implicit,r=e.oxw(8);return e.KtG(r.svc.setFollowupValue(i.ruleId,n.target.value))})("blur",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(8);return e.KtG(i.svc.touchFollowup(n.ruleId))}),e.qZA()}if(2&s){const o=e.oxw().$implicit,t=e.oxw(7).ngIf,n=e.oxw();e.ekj("inp--error",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.Q6J("value",n.svc.getFollowupValue(o.ruleId,t.followupValues)||"")}}function Yo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"textarea",129),e.NdJ("input",function(n){e.CHM(o);const i=e.oxw().$implicit,r=e.oxw(8);return e.KtG(r.svc.setFollowupValue(i.ruleId,n.target.value))})("blur",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(8);return e.KtG(i.svc.touchFollowup(n.ruleId))}),e.qZA()}if(2&s){const o=e.oxw().$implicit,t=e.oxw(7).ngIf,n=e.oxw();e.ekj("area--error",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.Q6J("value",n.svc.getFollowupValue(o.ruleId,t.followupValues)||"")}}function Eo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"input",130),e.NdJ("input",function(n){e.CHM(o);const i=e.oxw().$implicit,r=e.oxw(8);return e.KtG(r.svc.setFollowupValue(i.ruleId,n.target.value))})("blur",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(8);return e.KtG(i.svc.touchFollowup(n.ruleId))}),e.qZA()}if(2&s){const o=e.oxw().$implicit,t=e.oxw(7).ngIf,n=e.oxw();e.ekj("inp--error",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.Q6J("value",n.svc.getFollowupValue(o.ruleId,t.followupValues)||"")}}function jo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"input",131),e.NdJ("input",function(n){e.CHM(o);const i=e.oxw().$implicit,r=e.oxw(8);return e.KtG(r.svc.setFollowupValue(i.ruleId,n.target.value))})("blur",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(8);return e.KtG(i.svc.touchFollowup(n.ruleId))}),e.qZA()}if(2&s){const o=e.oxw().$implicit,t=e.oxw(7).ngIf,n=e.oxw();e.ekj("inp--error",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.Q6J("value",n.svc.getFollowupValue(o.ruleId,t.followupValues)||"")}}function zo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"label",132)(1,"input",133),e.NdJ("change",function(n){e.CHM(o);const i=e.oxw().$implicit,r=e.oxw(8);return e.KtG(r.svc.onFollowupFileSelect(i.ruleId,n))})("blur",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(8);return e.KtG(i.svc.touchFollowup(n.ruleId))}),e.qZA(),e.TgZ(2,"span",115),e._uU(3),e.qZA()()}if(2&s){const o=e.oxw().$implicit,t=e.oxw(7).ngIf,n=e.oxw();e.ekj("followup-file--error",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.xp6(3),e.Oqu(n.svc.getFollowupValue(o.ruleId,t.followupValues)||"Choose a file...")}}function Lo(s,a){1&s&&(e.TgZ(0,"div",134),e._uU(1," This field is required. "),e.qZA())}function Go(s,a){if(1&s&&(e.ynx(0),e.TgZ(1,"div",116)(2,"div",117),e.O4$(),e.TgZ(3,"svg",118),e._UZ(4,"polyline",119),e.qZA(),e.kcU(),e.TgZ(5,"span",120),e._uU(6,"Because you selected "),e.TgZ(7,"strong"),e._uU(8),e.qZA()()(),e.TgZ(9,"label",121),e._uU(10),e.YNc(11,$o,2,0,"span",67),e.qZA(),e.ynx(12,69),e.YNc(13,Bo,1,3,"input",122),e.YNc(14,Yo,1,3,"textarea",123),e.YNc(15,Eo,1,3,"input",124),e.YNc(16,jo,1,3,"input",125),e.YNc(17,zo,4,3,"label",126),e.BQk(),e.YNc(18,Lo,2,0,"div",127),e.qZA(),e.BQk()),2&s){const o=a.$implicit,t=e.oxw(7).ngIf,n=e.oxw();e.xp6(1),e.ekj("followup-wrap--invalid",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched)),e.xp6(7),e.hij('"',o.optionValue,'"'),e.xp6(2),e.hij(" ",o.followup_label," "),e.xp6(1),e.Q6J("ngIf",o.followup_mandatory),e.xp6(1),e.Q6J("ngSwitch",o.followup_type),e.xp6(1),e.Q6J("ngSwitchCase","short_text"),e.xp6(1),e.Q6J("ngSwitchCase","long_text"),e.xp6(1),e.Q6J("ngSwitchCase","number"),e.xp6(1),e.Q6J("ngSwitchCase","date"),e.xp6(1),e.Q6J("ngSwitchCase","file"),e.xp6(1),e.Q6J("ngIf",n.svc.isFollowupInvalid(o.ruleId,o.followup_mandatory,t.followupValues,t.followupTouched))}}function Ho(s,a){if(1&s&&(e.TgZ(0,"div",64)(1,"label",65)(2,"span",66),e._uU(3),e.qZA(),e.TgZ(4,"span"),e._uU(5),e.qZA(),e.YNc(6,ho,2,0,"span",67),e.qZA(),e.YNc(7,bo,3,4,"div",68),e.ynx(8,69),e.YNc(9,wo,1,0,"input",70),e.YNc(10,Co,1,0,"textarea",71),e.YNc(11,Po,12,10,"div",72),e.YNc(12,Zo,2,1,"div",73),e.YNc(13,Qo,10,9,"div",72),e.YNc(14,Do,1,0,"input",74),e.YNc(15,No,1,0,"input",75),e.YNc(16,Jo,1,0,"input",76),e.YNc(17,Ro,4,1,"label",77),e.BQk(),e.YNc(18,Go,19,12,"ng-container",57),e.qZA()),2&s){const o=e.oxw(),t=o.index,n=o.$implicit,i=e.oxw(2).index,r=e.oxw(3).ngIf,l=e.oxw();let c,d,p,_;e.Q6J("formGroupName",t),e.uIk("id",l.subQId(r.currentIndex,i,t)),e.xp6(3),e.hij("Q ",l.subSectionQuestionLabel(r.currentIndex,i,t),""),e.xp6(2),e.Oqu(null==(c=n.get("question_text"))?null:c.value),e.xp6(1),e.Q6J("ngIf",null==(d=n.get("is_mandatory"))?null:d.value),e.xp6(1),e.Q6J("ngIf",l.hasContent(null==(p=n.get("help_text"))?null:p.value)),e.xp6(1),e.Q6J("ngSwitch",null==(_=n.get("question_type"))?null:_.value),e.xp6(1),e.Q6J("ngSwitchCase","short_text"),e.xp6(1),e.Q6J("ngSwitchCase","long_text"),e.xp6(1),e.Q6J("ngSwitchCase","dropdown"),e.xp6(1),e.Q6J("ngSwitchCase","radio"),e.xp6(1),e.Q6J("ngSwitchCase","checkbox"),e.xp6(1),e.Q6J("ngSwitchCase","date"),e.xp6(1),e.Q6J("ngSwitchCase","number"),e.xp6(1),e.Q6J("ngSwitchCase","email"),e.xp6(1),e.Q6J("ngSwitchCase","file"),e.xp6(1),e.Q6J("ngForOf",l.svc.getActiveFollowups(n))("ngForTrackBy",l.trackByIndex)}}function Ko(s,a){if(1&s&&(e.ynx(0),e.YNc(1,Ho,19,18,"div",63),e.BQk()),2&s){const o=a.$implicit,t=e.oxw(5).ngIf,n=e.oxw();e.xp6(1),e.Q6J("ngIf",!n.svc.isHidden(o,t.hiddenQuestionIds))}}function Vo(s,a){if(1&s&&(e.TgZ(0,"div"),e.YNc(1,xo,3,4,"div",144),e.TgZ(2,"div",56),e.YNc(3,Ko,2,1,"ng-container",57),e.qZA()()),2&s){const o=e.oxw(),t=o.$implicit,n=o.index,i=e.oxw(3).ngIf,r=e.oxw();let l;e.xp6(1),e.Q6J("ngIf",r.hasContent(null==(l=t.get("description"))?null:l.value)),e.xp6(2),e.Q6J("ngForOf",r.subQuestionsFA(i.currentIndex,n).controls)("ngForTrackBy",r.trackByIndex)}}function Wo(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",137)(1,"div",138)(2,"button",139),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(3).ngIf,l=e.oxw();return e.KtG(l.toggleSubSectionCollapse(r.currentIndex,i))}),e.O4$(),e.TgZ(3,"svg",12),e._UZ(4,"path",140),e.qZA()(),e.kcU(),e.TgZ(5,"span",141),e._uU(6),e.qZA(),e.TgZ(7,"span",142),e._uU(8),e.qZA()(),e.YNc(9,Vo,4,3,"div",143),e.qZA()}if(2&s){const o=a.$implicit,t=a.index,n=e.oxw(3).ngIf,i=e.oxw();let r;e.Q6J("formGroupName",t),e.xp6(3),e.Udp("transform",i.isSubSectionCollapsed(n.currentIndex,t)?"rotate(-90deg)":""),e.xp6(3),e.hij("Sub ",i.subSectionLabel(n.currentIndex,t),""),e.xp6(2),e.Oqu(null==(r=o.get("title"))?null:r.value),e.xp6(1),e.Q6J("ngIf",!i.isSubSectionCollapsed(n.currentIndex,t))}}
1function Xo(s,a){if(1&s&&(e.TgZ(0,"div",135),e.YNc(1,Wo,10,6,"div",136),e.qZA()),2&s){const o=e.oxw(2).ngIf,t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.subSectionsFA(o.currentIndex).controls)}}function ei(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"section",50)(1,"div",51)(2,"div")(3,"div",52),e._uU(4),e.qZA(),e.YNc(5,Fn,3,4,"div",53),e.qZA(),e.TgZ(6,"div",54),e._uU(7),e.qZA()(),e.TgZ(8,"div",55)(9,"div",56),e.YNc(10,mo,2,1,"ng-container",57),e.qZA(),e.YNc(11,Xo,2,1,"div",58),e.qZA(),e.TgZ(12,"footer",59)(13,"button",60),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.prev())}),e._uU(14," Previous "),e.qZA(),e.TgZ(15,"button",61),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.next())}),e._uU(16),e.O4$(),e.TgZ(17,"svg",28),e._UZ(18,"path",29),e.qZA()()()()}if(2&s){const o=e.oxw().ngIf,t=e.oxw();let n,i;e.xp6(4),e.hij(" ",null==(n=t.sectionGroup(o.currentIndex).get("title"))?null:n.value," "),e.xp6(1),e.Q6J("ngIf",t.hasContent(null==(i=t.sectionGroup(o.currentIndex).get("description"))?null:i.value)),e.xp6(2),e.Oqu(o.currentIndex+1),e.xp6(1),e.Q6J("formGroup",t.sectionGroup(o.currentIndex)),e.xp6(2),e.Q6J("ngForOf",t.questionsFA(o.currentIndex).controls)("ngForTrackBy",t.trackByIndex),e.xp6(1),e.Q6J("ngIf",t.subSectionsFA(o.currentIndex).length),e.xp6(2),e.Q6J("disabled",0===o.currentIndex),e.xp6(2),e.Q6J("disabled",!t.canNext()),e.xp6(1),e.hij(" ",o.currentIndex===t.total()-1?"Finish":"Next Section"," ")}}function ti(s,a){if(1&s&&(e.TgZ(0,"div",1)(1,"header",2)(2,"div",3),e.YNc(3,xn,3,0,"button",4),e.TgZ(4,"div")(5,"h1",5),e._uU(6),e.qZA(),e.YNc(7,vn,3,4,"div",6),e.YNc(8,bn,2,2,"div",7),e.qZA()()(),e.YNc(9,wn,2,2,"div",8),e.YNc(10,In,11,1,"section",9),e.YNc(11,ei,19,10,"section",10),e.qZA()),2&s){const o=a.ngIf,t=e.oxw();e.xp6(3),e.Q6J("ngIf","section"===o.view),e.xp6(3),e.hij(" ",o.templateTitle||"Template Preview"," "),e.xp6(1),e.Q6J("ngIf",t.hasContent(o.templateDescription)),e.xp6(1),e.Q6J("ngIf","section"===o.view),e.xp6(1),e.Q6J("ngIf","section"===o.view),e.xp6(1),e.Q6J("ngIf","overview"===o.view),e.xp6(1),e.Q6J("ngIf","section"===o.view&&t.sectionsFA().length)}}let ni=(()=>{const a=class{constructor(t){this.actions=t,this.state$=this.actions.state$,this.descriptionExpanded={},this.subSectionCollapsed={},this.trackByIndex=this.actions.trackByIndex}get svc(){return this.actions}ngOnInit(){this.actions.initFromTemplate(this.template)}onDocClick(t){t.target.closest(".pp-select")||this.actions.closeAllPopups()}onEsc(){this.actions.closeAllPopups()}ngAfterViewChecked(){const t=this.actions.consumePendingScroll();t&&document.getElementById(void 0===t.ss?this.actions.qId(t.s,t.q):this.actions.subQId(t.s,t.ss,t.q))?.scrollIntoView({behavior:"smooth",block:"start"})}key(t,n){return`${t}-${n}`}descKey(t,n,i){return`${t}-${n}-${i??"root"}`}isDescExpanded(t,n,i){return!!this.descriptionExpanded[this.descKey(t,n,i)]}toggleDesc(t,n,i){const r=this.descKey(t,n,i);this.descriptionExpanded[r]=!this.descriptionExpanded[r]}isSubSectionCollapsed(t,n){return!!this.subSectionCollapsed[this.key(t,n)]}toggleSubSectionCollapse(t,n){const i=this.key(t,n);this.subSectionCollapsed[i]=!this.subSectionCollapsed[i]}isLongDescription(t,n=200){return(t||"").replace(/<[^>]*>/g,"").replace(/ /g," ").trim().length>n}sectionsFA(){return this.actions.sectionsFA()}sectionGroup(t){return this.actions.sectionGroup(t)}questionsFA(t){return this.actions.questionsFA(t)}subSectionsFA(t){return this.actions.subSectionsFA(t)}subQuestionsFA(t,n){return this.actions.subQuestionsFA(t,n)}total(){return this.actions.total()}qId(t,n){return this.actions.qId(t,n)}subQId(t,n,i){return this.actions.subQId(t,n,i)}sectionQuestionLabel(t,n){return this.actions.sectionQuestionLabel(t,n)}subSectionLabel(t,n){return this.actions.subSectionLabel(t,n)}subSectionQuestionLabel(t,n,i){return this.actions.subSectionQuestionLabel(t,n,i)}hasContent(t){return this.actions.hasContent(t)}canNext(){return this.actions.canNext()}prev(){this.actions.prev()}next(){this.actions.next()}finish(){this.actions.finish()}getSubmissionPayload(){return this.actions.getSubmissionPayload()}touchFollowup(t){this.actions.touchFollowup(t)}goOverview(){this.actions.goOverview()}goSection(t){this.actions.goSection(t)}goQuestion(t,n,i){this.actions.goQuestion(t,n,i)}toggleExpand(t){this.actions.toggleExpand(t)}isExpanded(t){return this.actions.isExpanded(t)}startFromOverview(){this.actions.startFromOverview()}isInvalid(t){return this.actions.isInvalid(t)}onFileSelect(t,n){this.actions.onFileSelect(t,n)}isSingleOpen(t,n,i){return this.actions.isSingleOpen(t,n,i)}toggleSingle(t,n,i){this.actions.toggleSingle(t,n,i)}selectSingle(t,n,i,r,l){this.actions.selectSingle(t,n,i,r,l)}onSingleKeydown(t,n,i,r){this.actions.onSingleKeydown(t,n,i,r)}isMultiOpen(t,n,i){return this.actions.isMultiOpen(t,n,i)}toggleMulti(t,n,i){this.actions.toggleMulti(t,n,i)}isChecked(t,n){return this.actions.isChecked(t,n)}toggleOption(t,n){this.actions.toggleOption(t,n)}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.Y36(ve))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-template-preview"]],hostBindings:function(n,i){1&n&&e.NdJ("click",function(l){return i.onDocClick(l)},!1,e.evT)("keydown.escape",function(){return i.onEsc()},!1,e.evT)},inputs:{template:"template"},features:[e._Bn([ve])],decls:2,vars:3,consts:[["class","preview-page",4,"ngIf"],[1,"preview-page"],[1,"pv-head"],[1,"pv-head-left"],["class","head-back","type","button","aria-label","Back to overview",3,"click",4,"ngIf"],[1,"pv-title"],["class","pv-template-desc",4,"ngIf"],["class","pv-sub",4,"ngIf"],["class","pv-progress",4,"ngIf"],["class","pv-card overview",4,"ngIf"],["class","pv-card",4,"ngIf"],["type","button","aria-label","Back to overview",1,"head-back",3,"click"],["viewBox","0 0 20 20"],["d","M12 4l-6 6 6 6","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],[1,"pv-template-desc"],[1,"ql-display",3,"innerHTML"],["class","read-more-link",3,"click",4,"ngIf"],[1,"read-more-link",3,"click"],[1,"pv-sub"],[1,"pv-progress"],[1,"pv-bar"],[1,"pv-card","overview"],[1,"ov-wrap"],[1,"ov-title"],[1,"ov-list"],["class","ov-step",4,"ngFor","ngForOf"],[1,"ov-footer"],["type","button",1,"btn","primary",3,"click"],["viewBox","0 0 20 20",1,"ico"],["d","M7 5l5 5-5 5","fill","none","stroke","currentColor","stroke-width","1.8","stroke-linecap","round","stroke-linejoin","round"],[1,"ov-step"],["type","button",1,"ov-step-head",3,"click"],[1,"ov-step-title"],[1,"ov-icon"],["viewBox","0 0 20 20",4,"ngIf"],["class","ov-desc",4,"ngIf"],["class","ov-qs",4,"ngIf"],["d","M10 4v12M4 10h12","stroke","currentColor","stroke-width","2","stroke-linecap","round"],["d","M4 10h12","stroke","currentColor","stroke-width","2","stroke-linecap","round"],[1,"ov-desc"],[1,"ov-qs"],["type","button","class","ov-q",3,"click",4,"ngFor","ngForOf"],["class","ov-subsection",4,"ngFor","ngForOf"],["type","button",1,"ov-q",3,"click"],[1,"ov-q-no"],[1,"ov-q-text"],[1,"ov-subsection"],[1,"ov-subsection-head"],[1,"ov-sub-chip"],[1,"ov-sub-title"],[1,"pv-card"],[1,"pv-banner"],[1,"pv-banner-title"],["class","pv-banner-sub",4,"ngIf"],[1,"pv-chip"],[1,"pv-body",3,"formGroup"],["formArrayName","questions"],[4,"ngFor","ngForOf","ngForTrackBy"],["formArrayName","sub_sections",4,"ngIf"],[1,"pv-footer","sticky"],["type","button",1,"btn","ghost",3,"disabled","click"],["type","button",1,"btn","primary",3,"disabled","click"],[1,"pv-banner-sub"],["class","q-wrap",3,"formGroupName",4,"ngIf"],[1,"q-wrap",3,"formGroupName"],[1,"q-label"],[1,"q-no"],["class","req",4,"ngIf"],["class","q-help",4,"ngIf"],[3,"ngSwitch"],["class","inp pretty","type","text","formControlName","value","placeholder","Enter the value",4,"ngSwitchCase"],["class","area pretty","rows","5","formControlName","value","placeholder","Describe here...",4,"ngSwitchCase"],["class","pp-select",3,"open","invali
1d",4,"ngSwitchCase"],["class","pp-choice-row",4,"ngSwitchCase"],["class","inp pretty","type","date","formControlName","value",4,"ngSwitchCase"],["class","inp pretty","type","number","formControlName","value","placeholder","Enter a number",4,"ngSwitchCase"],["class","inp pretty","type","email","formControlName","value","placeholder","[email protected]",4,"ngSwitchCase"],["class","pp-file",4,"ngSwitchCase"],[1,"req"],[1,"q-help"],["type","text","formControlName","value","placeholder","Enter the value",1,"inp","pretty"],["rows","5","formControlName","value","placeholder","Describe here...",1,"area","pretty"],[1,"pp-select"],["type","button",1,"pp-trigger",3,"click","keydown"],["class","pp-placeholder",4,"ngIf"],["class","pp-value",4,"ngIf"],["viewBox","0 0 20 20",1,"pp-caret"],["d","M6 8l4 4 4-4","fill","none","stroke","currentColor","stroke-width","1.8","stroke-linecap","round","stroke-linejoin","round"],["role","listbox",1,"pp-menu","anim"],["type","button","class","pp-option",3,"active","focus","mouseenter","click",4,"ngFor","ngForOf"],["formControlName","value","tabindex","-1","aria-hidden","true",1,"visually-hidden"],[3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["class","pp-error",4,"ngIf"],[1,"pp-placeholder"],[1,"pp-value"],["type","button",1,"pp-option",3,"mouseenter","click"],[1,"pp-error"],[1,"pp-choice-row"],["class","pp-chip",4,"ngFor","ngForOf"],[1,"pp-chip"],["type","radio","formControlName","value",3,"value","change"],["type","button",1,"pp-trigger",3,"click"],[4,"ngIf","ngIfElse"],["emptyMs",""],[1,"pp-menu","anim"],["class","pp-option",3,"active","click",4,"ngFor","ngForOf"],["class","pp-chip-mini",4,"ngFor","ngForOf","ngForTrackBy"],[1,"pp-chip-mini"],[1,"pp-option",3,"click"],["type","date","formControlName","value",1,"inp","pretty"],["type","number","formControlName","value","placeholder","Enter a number",1,"inp","pretty"],["type","email","formControlName","value","placeholder","[email protected]",1,"inp","pretty"],[1,"pp-file"],["type","file",3,"change"],[1,"pp-file-label"],[1,"followup-wrap"],[1,"followup-header"],["viewBox","0 0 24 24","width","14","height","14","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round"],["points","9 18 15 12 9 6"],[1,"followup-option-label"],[1,"followup-prompt"],["class","inp pretty","type","text","placeholder","Enter your answer...",3,"inp--error","value","input","blur",4,"ngSwitchCase"],["class","area pretty followup-area","rows","4","placeholder","Please explain...",3,"area--error","value","input","blur",4,"ngSwitchCase"],["class","inp pretty","type","number","placeholder","Enter a number...",3,"inp--error","value","input","blur",4,"ngSwitchCase"],["class","inp pretty","type","date",3,"inp--error","value","input","blur",4,"ngSwitchCase"],["class","pp-file followup-file",3,"followup-file--error",4,"ngSwitchCase"],["class","followup-error-msg",4,"ngIf"],["type","text","placeholder","Enter your answer...",1,"inp","pretty",3,"value","input","blur"],["rows","4","placeholder","Please explain...",1,"area","pretty","followup-area",3,"value","input","blur"],["type","number","placeholder","Enter a number...",1,"inp","pretty",3,"value","input","blur"],["type","date",1,"inp","pretty",3,"value","input","blur"],[1,"pp-file","followup-file"],["type","file",3,"change","blur"],[1,"followup-error-msg"],["formArrayName","sub_sections"],["class","subsection-wrap",3,"formGroupName",4,"ngFor","ngForOf"],[1,"subsection-wrap",3,"formGroupName"],[1,"subsection-header"],["type","button",1,"sub-collapse",3,"click"],["d","M6 8l4 4 4-4","fill","none","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],[1,"sub-chip-inline"],[1,"sub-title-inline"],[4,"ngIf"],["class","subsection-desc",4,"ngIf"],[1,"subsection-desc"],["emptySubMs",""]],template:function(n,i){1&n&&(e.YNc(0,ti,12,7,"div",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,i.state$))},dependencies:[v.sg,v.O5,v.RF,v.n9,f.YN,f.Kr,f.Fj,f.wV,f.EJ,f._,f.JJ,f.JL,f.sg,f.u,f.x0,f.CE,v.Ov],styles:['@charset "UTF-8";[_nghost-%COMP%] .ql-display{line-height:1.6;word-break:break-word;overflow-wrap:anywhere}[_nghost-%COMP%] .ql-display p{margin:0 0 .4em}[_nghost-%COMP%] .ql-display p:last-child{margin-bottom:0}[_nghost-%COMP%] .ql-display strong, [_nghost-%COMP%] .ql-display b{font-weight:700}[_nghost-%COMP%] .ql-display em, [_nghost-%COMP%] .ql-display i{font-style:italic}[_nghost-%COMP%] .ql-display u{text-decoration:underline}[_nghost-%COMP%] .ql-display s{text-decoration:line-through}[_nghost-%COMP%] .ql-display h1{font-size:2em;font-weight:700;margin:.4em 0}[_nghost-%COMP%] .ql-display h2{font-size:1.5em;font-weight:700;margin:.4em 0}[_nghost-%COMP%] .ql-display h3{font-size:1.17em;font-weight:700;margin:.4em 0}[_nghost-%COMP%] .ql-display ul, [_nghost-%COMP%] .ql-display ol{margin:.4em 0;padding-left:1.5em}[_nghost-%COMP%] .ql-display ul{list-style-type:disc}[_nghost-%COMP%] .ql-display ol{list-style-type:decimal}[_nghost-%COMP%] .ql-display li{margin-bottom:.2em}[_nghost-%COMP%] .ql-display .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}[_nghost-%COMP%] .ql-display .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}[_nghost-%COMP%] .ql-display .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}[_nghost-%COMP%] .ql-display .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}[_nghost-%COMP%] .ql-display .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}[_nghost-%COMP%] .ql-display .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}[_nghost-%COMP%] .ql-display .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}[_nghost-%COMP%] .ql-display .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}[_nghost-%COMP%] .ql-display blockquote{border-left:4px solid #ccc;margin:.5em 0;padding-left:1em;color:#555}[_nghost-%COMP%] .ql-display pre{background:#f3f3f3;border-radius:4px;padding:.5em 1em;font-family:monospace;white-space:pre-wrap;margin:.4em 0}[_nghost-%COMP%] .ql-display a{color:#06c;text-decoration:underline}[_nghost-%COMP%] .ql-display a:hover{color:#0050b3}[_nghost-%COMP%] .ql-display .ql-align-center{text-align:center}[_nghost-%COMP%] .ql-display .ql-align-right{text-align:right}[_nghost-%COMP%] .ql-display .ql-align-justify{text-align:justify}[_nghost-%COMP%] .ql-display--clamped{max-height:4.8em;overflow:hidden}.preview-page[_ngcontent-%COMP%]{background:#f6f8fb;min-height:100vh;padding:20px 0 80px;color:#0f172a;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial}.head-back[_ngcontent-%COMP%]{width:34px;height:34px;border-radius:10px;border:1px solid #e6eaf2;background:#fff;display:flex;align-items:center;justify-content:center}.head-back[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:16px;height:16px}.pv-head[_ngcontent-%COMP%]{width:min(980px,100% - 24px);margin:0 auto 10px;display:flex;align-items:center;justify-content:space-between}.pv-head-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.pv-title[_ngcontent-%COMP%]{font-size:25px;margin:0 0 2px;font-weight:600}.pv-template-desc[_ngcontent-%COMP%]{margin:6px 0 4px;color:#475569;font-size:13.5px;line-height:1.6;word-break:break-word}.pv-template-desc[_ngcontent-%COMP%] .read-more-link[_ngcontent-%COMP%]{display:inline-block;margin-top:4px;font-size:12px;font-weight:600;color:#2563eb;
1cursor:pointer}.pv-template-desc[_ngcontent-%COMP%] .read-more-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.pv-sub[_ngcontent-%COMP%]{color:#6b7280;font-size:13px}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:10px;font-weight:700;cursor:pointer;border:1px solid transparent}.btn.ghost[_ngcontent-%COMP%]{background:#fff;border:1px solid #e9edf3}.btn.primary[_ngcontent-%COMP%]{background:linear-gradient(135deg,#16bf5e,#16bf5e);color:#fff}.btn[disabled][_ngcontent-%COMP%]{opacity:.55;cursor:not-allowed}.ico[_ngcontent-%COMP%]{width:16px;height:16px}.pv-progress[_ngcontent-%COMP%]{width:min(980px,100% - 24px);margin:6px auto 18px;height:6px;background:#edf2fb;border-radius:50px;overflow:hidden}.pv-bar[_ngcontent-%COMP%]{height:100%;background:#16bf5e}.pv-card[_ngcontent-%COMP%]{width:min(980px,100% - 24px);margin:0 auto;background:#fff;border:1px solid #e9edf3;border-radius:12px;overflow:visible;box-shadow:0 16px 36px #0c14280f}.pv-banner[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;padding:18px 22px;color:#fff;background:linear-gradient(135deg,#16bf5e,#16bf5e);border-top-left-radius:12px;border-top-right-radius:12px}.pv-banner-title[_ngcontent-%COMP%]{font-weight:600;font-size:1.25rem;margin-bottom:4px;line-height:1.75rem}.pv-banner-sub[_ngcontent-%COMP%]{opacity:.95;font-size:13px;line-height:1.55;margin-right:12px;max-width:min(100%,760px);word-break:break-word;overflow-wrap:anywhere}.pv-chip[_ngcontent-%COMP%]{min-width:36px;height:36px;border-radius:999px;background:rgba(255,255,255,.22);display:flex;align-items:center;justify-content:center;font-weight:800}.pv-body[_ngcontent-%COMP%]{padding:18px 22px 6px}.q-wrap[_ngcontent-%COMP%]{margin-bottom:16px}.q-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-weight:500;margin-bottom:6px;font-size:1rem;line-height:1.5rem}.q-no[_ngcontent-%COMP%]{color:#111827;font-weight:700}.req[_ngcontent-%COMP%]{color:#ef4444;margin-left:4px}.q-help[_ngcontent-%COMP%]{color:#6b7280;font-size:13px;margin:4px 0 10px;word-break:break-word;overflow-wrap:anywhere}.q-help[_ngcontent-%COMP%] .read-more-link[_ngcontent-%COMP%]{margin-top:3px;font-size:12px;font-weight:600;color:#2563eb;cursor:pointer;display:inline-block}.q-help[_ngcontent-%COMP%] .read-more-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.inp.pretty[_ngcontent-%COMP%], .area.pretty[_ngcontent-%COMP%]{width:100%;border:1px solid #e9edf3;background:#f6f8fc;border-radius:12px;padding:12px 14px;font-size:14px;color:#0f172a;transition:border-color .15s,box-shadow .15s,background .15s;box-shadow:0 1px #10182805}.inp.pretty[_ngcontent-%COMP%]:focus, .area.pretty[_ngcontent-%COMP%]:focus{outline:none;border-color:#6b8cff;box-shadow:0 0 0 4px #6875f526;background:#fff}.pp-select[_ngcontent-%COMP%]{position:relative;width:100%}.pp-select.invalid[_ngcontent-%COMP%] .pp-trigger[_ngcontent-%COMP%]{border-color:#ef4444;box-shadow:0 0 0 4px #ef44441f}.pp-trigger[_ngcontent-%COMP%]{width:100%;background:#f6f8fc;border:1px solid #e9edf3;border-radius:12px;padding:12px 14px;text-align:left;color:#0f172a;font-size:14px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;cursor:pointer;transition:border-color .15s,box-shadow .15s,background .15s}.pp-trigger[_ngcontent-%COMP%]:hover{background:#f9fbff}.pp-select.open[_ngcontent-%COMP%] .pp-trigger[_ngcontent-%COMP%], .pp-trigger[_ngcontent-%COMP%]:focus{border-color:#6b8cff;box-shadow:0 0 0 4px #6875f526;background:#fff}.pp-placeholder[_ngcontent-%COMP%]{color:#9aa4b2}.pp-value[_ngcontent-%COMP%]{font-weight:700}.pp-caret[_ngcontent-%COMP%]{margin-left:auto;width:16px;height:16px;color:#64748b}.pp-menu[_ngcontent-%COMP%]{position:absolute;top:calc(100% + 8px);left:0;right:0;z-index:1000;background:#fff;border:1px solid #e9edf3;border-radius:12px;box-shadow:0 30px 60px #1018281f;padding:6px;display:none;max-height:280px;overflow:auto}.pp-select.open[_ngcontent-%COMP%] .pp-menu[_ngcontent-%COMP%]{display:block}.pp-menu.anim[_ngcontent-%COMP%]{transform-origin:top;animation:_ngcontent-%COMP%_ppFade .14s ease-out}@keyframes _ngcontent-%COMP%_ppFade{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.pp-option[_ngcontent-%COMP%]{width:100%;text-align:left;padding:12px 16px;margin-bottom:6px;border-radius:10px;background:#fff;border:1px solid transparent;cursor:pointer;color:#0f172a;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:14px;transition:all .18s}.pp-option[_ngcontent-%COMP%]:hover:not(.active){border-color:#d4caff;background:#faf8ff}.pp-option.active[_ngcontent-%COMP%]{background:#f5f0ff;border:1px solid #b9a8ff;font-weight:600;color:#4e2cd9}.pp-option.focus[_ngcontent-%COMP%]:not(.active){outline:2px solid #c9d4ff;outline-offset:-2px;background:#f6f8ff}.pp-chip-mini[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;background:#f3f5ff;color:#1f2937;font-weight:700;font-size:12px;border:1px solid #e1e7ff}.pp-choice-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:10px}.pp-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;padding:10px 12px;border-radius:12px;background:#f6f8fc;border:1px solid #e9edf3;cursor:pointer}.pp-chip[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{margin:0}.pp-file[_ngcontent-%COMP%]{display:flex;align-items:center;border:1px dashed #d7dff1;background:#f9fbff;border-radius:12px;padding:12px 14px;cursor:pointer;width:100%;transition:border-color .15s,background .15s}.pp-file[_ngcontent-%COMP%]:hover{border-color:#6b8cff;background:#fff}.pp-file[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:none}.pp-file-label[_ngcontent-%COMP%]{color:#1f2937}.pp-error[_ngcontent-%COMP%]{margin-top:6px;color:#e11d48;font-size:12px;font-weight:600}.pv-footer[_ngcontent-%COMP%]{padding:16px 22px 22px;display:flex;align-items:center;justify-content:space-between}.pv-footer.sticky[_ngcontent-%COMP%]{position:sticky;bottom:0;background:linear-gradient(180deg,rgba(246,248,251,.4),#fff);border-top:1px solid #eef2f7;padding-top:12px;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);z-index:5}.visually-hidden[_ngcontent-%COMP%]{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap;border:0;padding:0;margin:-1px}.pv-card.overview[_ngcontent-%COMP%]{padding:28px}.ov-wrap[_ngcontent-%COMP%]{margin:0 auto}.ov-title[_ngcontent-%COMP%]{font-size:25px;font-weight:600;margin:0 0 18px;color:#16bf5e}.ov-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.ov-step[_ngcontent-%COMP%]{padding:4px 0 0}.ov-step-head[_ngcontent-%COMP%]{width:100%;background:transparent;border:0;border-radius:0;padding:8px 0;display:flex;align-items:center;justify-content:space-between;cursor:pointer;color:#334155;font-weight:600;font-size:15px}.ov-step-title[_ngcontent-%COMP%]{color:#1e40af}.ov-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:18px;height:18px}.ov-qs[_ngcontent-%COMP%]{padding:8px 0 6px 14px;display:flex;flex-direction:column;gap:10px;border-left:1px dashed #d9e3f0}.ov-q[_ngcontent-%COMP%]{background:transparent;border:0;border-radius:0;text-align:left;padding:2px 0;display:flex;gap:12px;align-items:center;cursor:pointer;transition:color .15s}.ov-q[_ngcontent-%COMP%]:hover{color:#1e40af}.ov-q-no[_ngcontent-%COMP%]{color:#2563eb;min-width:74px;font-weight:700;font-size:12px;background:#edf4ff;border-radius:999px;padding:4px 10px;text-align:center}.ov-q-text[_ngcontent-%COMP%]{color:#111827;line-height:1.35}.ov-footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;padding-top:16px;margin-top:10px;border-top:1px solid #eef2f7}.ov-desc[_ngcontent-%COMP%], .subsection-desc[_ngcontent-%COMP%]{color:#64748b;font-size:13px;margin:6px 0;padding:0;word-break:break-word;overflow-wrap:anywhere}.read-more-link[_ngcontent-%COMP%]{display:inline-block;margin-top:4px;color:#2563eb;font-size:12px;font-weight:600;cursor:pointer}.pv-banner-sub[_ngcontent-%COMP%] .read-more-link[_ngcontent-%COMP%]{color:#fff;text-decoration:underline}.clamp[_ngcontent-%COMP%]{max-height:4.8em;overflow:hidden}.ov-subsection[_ngcontent-%COMP%]{border-left:2px solid #dce8f8;padding-left:12px;margin-left:2px;margin-top:6px}.ov-subsection-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:4px}.ov-sub-chip[_ngcontent-%COMP%], .sub-chip-inline[_ngcontent-%COMP%]{background:#eef4ff;color:#3b82f6;border-radius:999px;padding:2px 8px;font-size:11px;font-weight:700}.sub-title-inline[_ngcontent-%COMP%], .ov-sub-title[_ngcontent-%COMP%]{font-weight:600}.subsection-wrap[_ngcontent-%COMP%]{border:1px solid #eef2f7;border-radius:10px;padding:10px;margin:12px 0;background:#fcfdff}.subsection-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:8px}.sub-collapse[_ngcontent-%COMP%]{width:28px;height:28px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.sub-collapse[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:14px;
1height:14px;transition:transform .15s}.tree-root[_ngcontent-%COMP%]{position:relative;margin-left:8px;padding-left:12px}.tree-root[_ngcontent-%COMP%]:before{content:"";position:absolute;left:3px;top:0;bottom:8px;border-left:1px dashed #d9e3f0}.tree-node[_ngcontent-%COMP%]{position:relative}.tree-node[_ngcontent-%COMP%]:before{content:"";position:absolute;left:-12px;top:16px;width:10px;border-top:1px dashed #d9e3f0}.followup-wrap[_ngcontent-%COMP%]{margin-top:14px;padding:14px 16px 14px 20px;border-left:3px solid #a78bfa;background:linear-gradient(135deg,#faf7ff 0%,#f5f3ff 100%);border-radius:0 10px 10px 0;animation:_ngcontent-%COMP%_fuSlide .2s ease}@keyframes _ngcontent-%COMP%_fuSlide{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.followup-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-bottom:8px}.followup-header[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{stroke:#7c3aed;flex-shrink:0}.followup-option-label[_ngcontent-%COMP%]{font-size:12px;color:#6d28d9;font-weight:500}.followup-option-label[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:700;color:#4c1d95;background:#ede9fe;padding:1px 6px;border-radius:4px}.followup-prompt[_ngcontent-%COMP%]{display:block;font-size:13px;font-weight:600;color:#374151;margin-bottom:8px}.followup-area[_ngcontent-%COMP%]{min-height:90px;resize:vertical}.followup-file[_ngcontent-%COMP%]{background:#fff;border:1.5px dashed #c4b5fd;border-radius:10px}.followup-file[_ngcontent-%COMP%]:hover{border-color:#7c3aed;background:#faf7ff}'],changeDetection:0}),s})();function oi(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1,"Template title is required."),e.qZA())}function ii(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1,"Description is required."),e.qZA())}function si(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"section",51)(1,"div",52),e.O4$(),e.TgZ(2,"svg",53),e._UZ(3,"path",54),e.qZA(),e.kcU(),e.TgZ(4,"span"),e._uU(5,"Your template needs at least one section. Add a section to get started."),e.qZA()(),e.TgZ(6,"div",55),e._uU(7,"+"),e.qZA(),e.TgZ(8,"div",56),e._uU(9,"No sections created yet"),e.qZA(),e.TgZ(10,"button",57),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(4);return e.KtG(n.onAddSection())}),e._uU(11," + Create First Section "),e.qZA()()}}function ri(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1,"Section name is required."),e.qZA())}function ai(s,a){1&s&&(e.TgZ(0,"div",81),e.O4$(),e.TgZ(1,"svg",82),e._UZ(2,"path",54),e.qZA(),e._uU(3," Add at least one question to this section. "),e.qZA())}function li(s,a){1&s&&(e.TgZ(0,"div",99),e.O4$(),e.TgZ(1,"svg",100),e._UZ(2,"rect",101)(3,"path",102),e.qZA(),e._uU(4," Rule dependency \u2014 reorder locked "),e.qZA())}function ci(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1,"Question text is required."),e.qZA())}function di(s,a){1&s&&(e.TgZ(0,"span",103),e._uU(1,"Required"),e.qZA())}function pi(s,a){if(1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"span",108),e._uU(1),e.qZA()),2&s){const o=e.oxw(2).index,t=e.oxw(2).index,n=e.oxw(4);e.xp6(1),e.Oqu(n.actionsService.getQuestionTotalRuleCount(t,o))}}function _i(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",104),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().index,i=e.oxw(2).index,r=e.oxw(4);return e.KtG(r.onOpenRulePanel(i,n))}),e.O4$(),e.TgZ(1,"svg",105),e._UZ(2,"path",106),e.qZA(),e.YNc(3,pi,2,1,"span",107),e.qZA()}if(2&s){const o=e.oxw().index,t=e.oxw(2).index,n=e.oxw(4);e.ekj("rule-toggle-btn--active",n.actionsService.isRulePanelOpen(t,o))("rule-toggle-btn--has-rules",n.actionsService.getQuestionTotalRuleCount(t,o)>0),e.xp6(3),e.Q6J("ngIf",n.actionsService.getQuestionTotalRuleCount(t,o)>0)}}function ui(s,a){1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"small",50),e._uU(1,"Select a field type."),e.qZA())}function gi(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",111),e.NdJ("click",function(){const i=e.CHM(o).$implicit,r=e.oxw(2).index,l=e.oxw(2).index,c=e.oxw(4);return e.KtG(c.actionsService.setQuestionType(l,r,i.key))}),e._uU(1),e.qZA()}if(2&s){const o=a.$implicit;e.xp6(1),e.hij(" ",o.label," ")}}function mi(s,a){if(1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"div",109),e.YNc(1,gi,2,1,"button",110),e.qZA()),2&s){const o=e.oxw(7);e.xp6(1),e.Q6J("ngForOf",o.actionsService.typeList)}}function fi(s,a){1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"small",131),e._uU(1," Option text is required. "),e.qZA())}function xi(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",124)(1,"div",125)(2,"div",126),e._uU(3,"\u22ee\u22ee"),e.qZA(),e._UZ(4,"input",127),e.TgZ(5,"button",128),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(3).index,l=e.oxw(2).index,c=e.oxw(4);return e.KtG(c.onDeleteOption(l,r,i))}),e.O4$(),e.TgZ(6,"svg",129),e._UZ(7,"path",70),e.qZA()()(),e.YNc(8,fi,2,0,"small",130),e.qZA()}if(2&s){const o=a.index,t=e.oxw(3).index,n=e.oxw(2).index,i=e.oxw(4);e.Q6J("formGroupName",o),e.xp6(4),e.ekj("input--error",i.actionsService.isOptionValueInvalid(n,t,o)),e.xp6(4),e.Q6J("ngIf",i.actionsService.isOptionValueInvalid(n,t,o))}}function hi(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1," Multi Select requires at least 2 options. "),e.qZA())}function vi(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1," Radio Button requires at least 2 options. "),e.qZA())}function bi(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1," Add at least one option. "),e.qZA())}function wi(s,a){if(1&s){const o=e.EpF();e.ynx(0),e.TgZ(1,"div",119)(2,"label",113),e._uU(3,"Options"),e.qZA(),e.TgZ(4,"div",120),e.NdJ("cdkDropListDropped",function(n){e.CHM(o);const i=e.oxw(2).index,r=e.oxw(2).index,l=e.oxw(4);return e.KtG(l.actionsService.dropOptions(r,i,n))}),e.YNc(5,xi,9,4,"div",121),e.qZA(),e.YNc(6,hi,2,0,"small",42),e.YNc(7,vi,2,0,"small",42),e.YNc(8,bi,2,0,"small",42),e.TgZ(9,"div",122)(10,"button",123),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).index,i=e.oxw(2).index,r=e.oxw(4);return e.KtG(r.actionsService.addOption(i,n))}),e._uU(11," + Add option "),e.qZA()()(),e.BQk()}if(2&s){const o=e.oxw(2).index,t=e.oxw(2).index,n=e.oxw(4);let i,r,l;e.xp6(4),e.Q6J("cdkDropListData",n.actionsService.optionsFA(t,o).controls),e.xp6(1),e.Q6J("ngForOf",n.actionsService.optionsFA(t,o).controls)("ngForTrackBy",n.actionsService.trackByGroupId),e.xp6(1),e.Q6J("ngIf","checkbox"===(null==(i=n.actionsService.questionsFA(t).at(o).get("question_type"))?null:i.value)&&n.actionsService.optionsFA(t,o).length<2),e.xp6(1),e.Q6J("ngIf","radio"===(null==(r=n.actionsService.questionsFA(t).at(o).get("question_type"))?null:r.value)&&n.actionsService.optionsFA(t,o).length<2),e.xp6(1),e.Q6J("ngIf","checkbox"!==(null==(l=n.actionsService.questionsFA(t).at(o).get("question_type"))?null:l.value)&&"radio"!==(null==(l=n.actionsService.questionsFA(t).at(o).get("question_type"))?null:l.value)&&0===n.actionsService.optionsFA(t,o).length)}}const we=function(){return{height:"130px"}};function Ci(s,a){if(1&s&&(e.O4$(),e.kcU(),e.ynx(0),e._UZ(1,"hr",112),e.TgZ(2,"label",113),e._uU(3,"Description (optional)"),e.qZA(),e._UZ(4,"p-editor",114),e.TgZ(5,"div",115)(6,"span",113),e._uU(7,"Required field"),e.qZA(),e.TgZ(8,"label",116),e._UZ(9,"
1input",117)(10,"span",118),e.qZA()(),e.YNc(11,wi,12,6,"ng-container",31),e.BQk()),2&s){const o=e.oxw().index,t=e.oxw(2).index,n=e.oxw(4);let i;e.xp6(4),e.Akn(e.DdM(5,we)),e.Q6J("formControl",n.actionsService.questionsFA(t).at(o).get("help_text")),e.xp6(5),e.Q6J("formControl",n.actionsService.questionsFA(t).at(o).get("is_mandatory")),e.xp6(2),e.Q6J("ngIf",n.actionsService.isChoiceType(null==(i=n.actionsService.questionsFA(t).at(o).get("question_type"))?null:i.value))}}function Ti(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",83),e.YNc(1,li,5,0,"div",84),e.TgZ(2,"div",85)(3,"div",86)(4,"div",87),e._uU(5," \u22ee\u22ee "),e.qZA(),e.TgZ(6,"span",88),e._uU(7),e.qZA(),e.TgZ(8,"div",89),e._UZ(9,"input",90),e.YNc(10,ci,2,0,"small",42),e.qZA()(),e.TgZ(11,"div",91),e.YNc(12,di,2,0,"span",92),e.YNc(13,_i,4,5,"button",93),e.TgZ(14,"div",94)(15,"button",95),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(2).index,l=e.oxw(4);return e.KtG(l.actionsService.toggleTypeMenu(r,i))}),e._uU(16),e.O4$(),e.TgZ(17,"svg",96),e._UZ(18,"path",67),e.qZA()(),e.YNc(19,ui,2,0,"small",42),e.YNc(20,mi,2,1,"div",97),e.qZA(),e.kcU(),e.TgZ(21,"button",65),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(2).index,l=e.oxw(4);return e.KtG(l.actionsService.toggleQuestion(r,i))}),e.O4$(),e.TgZ(22,"svg",66),e._UZ(23,"path",67),e.qZA()(),e.kcU(),e.TgZ(24,"button",98),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(2).index,l=e.oxw(4);return e.KtG(l.onDeleteQuestion(r,i))}),e.O4$(),e.TgZ(25,"svg",69),e._UZ(26,"path",70),e.qZA()()()(),e.YNc(27,Ci,12,6,"ng-container",31),e.qZA()}if(2&s){const o=a.index,t=e.oxw(2).index,n=e.oxw(3).ngIf,i=e.oxw();let r,l,c,d,p,_;e.Q6J("formGroupName",o)("cdkDragDisabled",i.actionsService.questionHasIncomingRules(null==(r=i.actionsService.questionsFA(t).at(o).get("id"))?null:r.value)),e.xp6(1),e.Q6J("ngIf",i.actionsService.questionHasIncomingRules(null==(l=i.actionsService.questionsFA(t).at(o).get("id"))?null:l.value)),e.xp6(3),e.ekj("drag-handle--locked",i.actionsService.questionHasIncomingRules(null==(c=i.actionsService.questionsFA(t).at(o).get("id"))?null:c.value)),e.xp6(3),e.Oqu(i.actionsService.getSectionQuestionLabel(t,o)),e.xp6(2),e.ekj("input--error",i.actionsService.isQuestionTextInvalid(t,o)),e.Q6J("formControl",i.actionsService.questionsFA(t).at(o).get("question_text")),e.xp6(1),e.Q6J("ngIf",i.actionsService.isQuestionTextInvalid(t,o)),e.xp6(2),e.Q6J("ngIf",null==(d=i.actionsService.questionsFA(t).at(o).get("is_mandatory"))?null:d.value),e.xp6(1),e.Q6J("ngIf",i.actionsService.isChoiceType(null==(p=i.actionsService.questionsFA(t).at(o).get("question_type"))?null:p.value)),e.xp6(1),e.ekj("open",(null==n.openTypeMenu?null:n.openTypeMenu.s)===t&&(null==n.openTypeMenu?null:n.openTypeMenu.q)===o&&void 0===(null==n.openTypeMenu?null:n.openTypeMenu.ss)),e.xp6(1),e.ekj("q-type--error",i.actionsService.isQuestionTypeInvalid(t,o)),e.xp6(1),e.hij(" ",i.actionsService.getTypeLabel(null==(_=i.actionsService.questionsFA(t).at(o).get("question_type"))?null:_.value)," "),e.xp6(3),e.Q6J("ngIf",i.actionsService.isQuestionTypeInvalid(t,o)),e.xp6(1),e.Q6J("ngIf",(null==n.openTypeMenu?null:n.openTypeMenu.s)===t&&(null==n.openTypeMenu?null:n.openTypeMenu.q)===o&&void 0===(null==n.openTypeMenu?null:n.openTypeMenu.ss)),e.xp6(2),e.Udp("transform",null!=n.collapsedQuestions[t]&&n.collapsedQuestions[t][o]?"rotate(-90deg)":""),e.xp6(5),e.Q6J("ngIf",!(null!=n.collapsedQuestions[t]&&n.collapsedQuestions[t][o]))}}function yi(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1,"Subsection title is required."),e.qZA())}function ki(s,a){1&s&&(e.TgZ(0,"div",81),e.O4$(),e.TgZ(1,"svg",82),e._UZ(2,"path",54),e.qZA(),e._uU(3," Add at least one question to this subsection. "),e.qZA())}function Oi(s,a){1&s&&(e.TgZ(0,"div",99),e.O4$(),e.TgZ(1,"svg",100),e._UZ(2,"rect",101)(3,"path",102),e.qZA(),e._uU(4," Rule dependency \u2014 reorder locked "),e.qZA())}function Mi(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1,"Question text is required."),e.qZA())}function Pi(s,a){1&s&&(e.TgZ(0,"span",103),e._uU(1,"Required"),e.qZA())}function Ai(s,a){if(1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"span",108),e._uU(1),e.qZA()),2&s){const o=e.oxw(2).index,t=e.oxw().index,n=e.oxw(2).index,i=e.oxw(4);e.xp6(1),e.Oqu(i.actionsService.getQuestionTotalRuleCount(n,o,t))}}function Zi(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",104),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().index,i=e.oxw().index,r=e.oxw(2).index,l=e.oxw(4);return e.KtG(l.onOpenRulePanel(r,n,i))}),e.O4$(),e.TgZ(1,"svg",105),e._UZ(2,"path",106),e.qZA(),e.YNc(3,Ai,2,1,"span",107),e.qZA()}if(2&s){const o=e.oxw().index,t=e.oxw().index,n=e.oxw(2).index,i=e.oxw(4);e.ekj("rule-toggle-btn--active",i.actionsService.isRulePanelOpen(n,o,t))("rule-toggle-btn--has-rules",i.actionsService.getQuestionTotalRuleCount(n,o,t)>0),e.xp6(3),e.Q6J("ngIf",i.actionsService.getQuestionTotalRuleCount(n,o,t)>0)}}function qi(s,a){1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"small",50),e._uU(1,"Select a field type."),e.qZA())}function Si(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",111),e.NdJ("click",function(){const i=e.CHM(o).$implicit,r=e.oxw(2).index,l=e.oxw().index,c=e.oxw(2).index,d=e.oxw(4);return e.KtG(d.actionsService.setQuestionType(c,r,i.key,l))}),e._uU(1),e.qZA()}if(2&s){const o=a.$implicit;e.xp6(1),e.hij(" ",o.label," ")}}function Ii(s,a){if(1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"div",109),e.YNc(1,Si,2,1,"button",110),e.qZA()),2&s){const o=e.oxw(8);e.xp6(1),e.Q6J("ngForOf",o.actionsService.typeList)}}function Ui(s,a){1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"small",131),e._uU(1," Option text is required. "),e.qZA())}function Fi(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",124)(1,"div",125)(2,"div",126),e._uU(3,"\u22ee\u22ee"),e.qZA(),e._UZ(4,"input",127),e.TgZ(5,"button",128),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(2).index,l=e.oxw().index,c=e.oxw(2).index,d=e.oxw(4);return e.KtG(d.onDeleteOption(c,r,i,l))}),e.O4$(),e.TgZ(6,"svg",129),e._UZ(7,"path",70),e.qZA()()(),e.YNc(8,Ui,2,0,"small",130),e.qZA()}if(2&s){const o=a.index,t=e.oxw(2).index,n=e.oxw().index,i=e.oxw(2).index,r=e.oxw(4);e.Q6J("formGroupName",o),e.xp6(4),e.ekj("input--error",r.actionsService.isOptionValueInvalid(i,t,o,n)),e.xp6(4),e.Q6J("ngIf",r.actionsService.isOptionValueInvalid(i,t,o,n))}}function Qi(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1," Multi Select requires at least 2 options. "),e.qZA())}function Di(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1," Radio Button requires at least 2 options. "),e.qZA())}function Ni(s,a){1&s&&(e.TgZ(0,"small",50),e._uU(1," Add at least one option. "),e.qZA())}function Ji(s,a){if(1&s){const o=e.EpF();e.ynx(0),e.TgZ(1,"div",119)(2,"label",113),e._uU(3,"Options"),e.qZA(),e.TgZ(4,"div",120),e.NdJ("cdkDropListDropped",function(n){e.CHM(o);const i=e.oxw().index,r=e.oxw().index,l=e.oxw(2).index,c=e.oxw(4);return e.KtG(c.actionsService.dropOptions(l,i,n,r))}),e.YNc(5,Fi,9,4,"div",121),e.qZA(),e.YNc(6,Qi,2,0,"small",42),e.YNc(7,Di,2,0,"small",42),e.YNc(8,Ni,2,0,"small",42),e.TgZ(9,"div",122)(10,"button",123),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().index,i=e.oxw().index,r=e.oxw(2).index,l=e.oxw(4);return e.KtG(l.actionsService.addOption(r,n,i))}),e._uU(11," + Add option "),e.qZA()()(),e.BQk()}if(2&s){const o=e.oxw().index,t=e.oxw().index,n=e.oxw(2).index,i=e.oxw(4);let r,l,c;e.xp6(4),e.Q6J("cdkDropListData",i.actionsService.optionsFA(n,o,t).controls),e.xp6(1),e.Q6J("ngForOf",i.actionsService.optionsFA(n,o,t).controls)("ngForTrackBy",i.actionsService.trackByGroupId),e.xp6(1),e.Q6J("ngIf","checkbox"===(null==(r=i.actionsService.subQuestionsFA(n,t).at(o).get("question_type"))?null:r.value)&&i.actionsService.optionsFA(n,o,t).length<2),e.xp6(1),e.Q6J("ngIf","radio"===(null==(l=i.actionsService.subQuestionsFA(n,t).at(o).get("question_type"))?null:l.value)&&i.actionsService.optionsFA(n,o,t).length<2),e.xp6(1),e.Q6J("ngIf","checkbox"!==(null==(c=i.actionsService.subQuestionsFA(n,t).at(o).get("question_type"))?null:c.value)&&"radio"!==(null==(c=i.actionsService.subQuestionsFA(n,t).at(o).get("question_type"))?null:c.value)&&0===i.actionsService.optionsFA(n,o,t).length)}}function Ri(s,a){if(1&s){const o=e.EpF();
1e.TgZ(0,"div",140),e.YNc(1,Oi,5,0,"div",84),e.TgZ(2,"div",85)(3,"div",86)(4,"div",87),e._uU(5," \u22ee\u22ee "),e.qZA(),e.TgZ(6,"span",88),e._uU(7),e.qZA(),e.TgZ(8,"div",89),e._UZ(9,"input",90),e.YNc(10,Mi,2,0,"small",42),e.qZA()(),e.TgZ(11,"div",91),e.YNc(12,Pi,2,0,"span",92),e.YNc(13,Zi,4,5,"button",93),e.TgZ(14,"div",94)(15,"button",95),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw().index,l=e.oxw(2).index,c=e.oxw(4);return e.KtG(c.actionsService.toggleTypeMenu(l,i,r))}),e._uU(16),e.O4$(),e.TgZ(17,"svg",96),e._UZ(18,"path",67),e.qZA()(),e.YNc(19,qi,2,0,"small",42),e.YNc(20,Ii,2,1,"div",97),e.qZA(),e.kcU(),e.TgZ(21,"button",98),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw().index,l=e.oxw(2).index,c=e.oxw(4);return e.KtG(c.onDeleteQuestion(l,i,r))}),e.O4$(),e.TgZ(22,"svg",69),e._UZ(23,"path",70),e.qZA()()()(),e.kcU(),e._UZ(24,"hr",112),e.TgZ(25,"label",113),e._uU(26,"Description (optional)"),e.qZA(),e._UZ(27,"p-editor",114),e.TgZ(28,"div",115)(29,"span",113),e._uU(30,"Required field"),e.qZA(),e.TgZ(31,"label",116),e._UZ(32,"input",117)(33,"span",118),e.qZA()(),e.YNc(34,Ji,12,6,"ng-container",31),e.qZA()}if(2&s){const o=a.index,t=e.oxw().index,n=e.oxw(2).index,i=e.oxw(3).ngIf,r=e.oxw();let l,c,d,p,_,u,m;e.Q6J("formGroupName",o)("cdkDragDisabled",r.actionsService.questionHasIncomingRules(null==(l=r.actionsService.subQuestionsFA(n,t).at(o).get("id"))?null:l.value)),e.xp6(1),e.Q6J("ngIf",r.actionsService.questionHasIncomingRules(null==(c=r.actionsService.subQuestionsFA(n,t).at(o).get("id"))?null:c.value)),e.xp6(3),e.ekj("drag-handle--locked",r.actionsService.questionHasIncomingRules(null==(d=r.actionsService.subQuestionsFA(n,t).at(o).get("id"))?null:d.value)),e.xp6(3),e.Oqu(r.actionsService.getSubSectionQuestionLabel(n,t,o)),e.xp6(2),e.ekj("input--error",r.actionsService.isQuestionTextInvalid(n,o,t)),e.Q6J("formControl",r.actionsService.subQuestionsFA(n,t).at(o).get("question_text")),e.xp6(1),e.Q6J("ngIf",r.actionsService.isQuestionTextInvalid(n,o,t)),e.xp6(2),e.Q6J("ngIf",null==(p=r.actionsService.subQuestionsFA(n,t).at(o).get("is_mandatory"))?null:p.value),e.xp6(1),e.Q6J("ngIf",r.actionsService.isChoiceType(null==(_=r.actionsService.subQuestionsFA(n,t).at(o).get("question_type"))?null:_.value)),e.xp6(1),e.ekj("open",(null==i.openTypeMenu?null:i.openTypeMenu.s)===n&&(null==i.openTypeMenu?null:i.openTypeMenu.q)===o&&(null==i.openTypeMenu?null:i.openTypeMenu.ss)===t),e.xp6(1),e.ekj("q-type--error",r.actionsService.isQuestionTypeInvalid(n,o,t)),e.xp6(1),e.hij(" ",r.actionsService.getTypeLabel(null==(u=r.actionsService.subQuestionsFA(n,t).at(o).get("question_type"))?null:u.value)," "),e.xp6(3),e.Q6J("ngIf",r.actionsService.isQuestionTypeInvalid(n,o,t)),e.xp6(1),e.Q6J("ngIf",(null==i.openTypeMenu?null:i.openTypeMenu.s)===n&&(null==i.openTypeMenu?null:i.openTypeMenu.q)===o&&(null==i.openTypeMenu?null:i.openTypeMenu.ss)===t),e.xp6(7),e.Akn(e.DdM(24,we)),e.Q6J("formControl",r.actionsService.subQuestionsFA(n,t).at(o).get("help_text")),e.xp6(5),e.Q6J("formControl",r.actionsService.subQuestionsFA(n,t).at(o).get("is_mandatory")),e.xp6(2),e.Q6J("ngIf",r.actionsService.isChoiceType(null==(m=r.actionsService.subQuestionsFA(n,t).at(o).get("question_type"))?null:m.value))}}const $i=function(){return{height:"150px"}};function Bi(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",132)(1,"div",133)(2,"div",60),e._uU(3," \u22ee\u22ee "),e.qZA(),e.TgZ(4,"span",134),e._uU(5),e.qZA(),e.TgZ(6,"div",62),e._UZ(7,"input",135),e.YNc(8,yi,2,0,"small",42),e.qZA(),e.TgZ(9,"div",64)(10,"button",136),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(2).index,l=e.oxw(4);return e.KtG(l.onDeleteSubSection(r,i))}),e.O4$(),e.TgZ(11,"svg",69),e._UZ(12,"path",70),e.qZA()()()(),e.kcU(),e.TgZ(13,"div",71),e._UZ(14,"p-editor",137),e.qZA(),e.TgZ(15,"div",73),e.NdJ("cdkDropListDropped",function(n){const r=e.CHM(o).index,l=e.oxw(2).index,c=e.oxw(4);return e.KtG(c.actionsService.dropSubQuestions(l,r,n))}),e.YNc(16,ki,4,0,"div",74),e.YNc(17,Ri,35,25,"div",138),e.qZA(),e.TgZ(18,"button",139),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(2).index,l=e.oxw(4);return e.KtG(l.actionsService.addQuestion(r,i))}),e.TgZ(19,"span",46),e._uU(20,"+"),e.qZA(),e._uU(21," Add Subsection Question "),e.qZA()()}if(2&s){const o=a.index,t=e.oxw(2).index,n=e.oxw(4);e.Q6J("formGroupName",o),e.uIk("id","builder-subsection-"+t+"-"+
1o),e.xp6(5),e.Oqu(n.actionsService.getSubSectionLabel(t,o)),e.xp6(2),e.ekj("input--error",n.actionsService.isSubSectionTitleInvalid(t,o)),e.Q6J("formControl",n.actionsService.subSectionsFA(t).at(o).get("title")),e.xp6(1),e.Q6J("ngIf",n.actionsService.isSubSectionTitleInvalid(t,o)),e.xp6(6),e.Akn(e.DdM(16,$i)),e.Q6J("formControl",n.actionsService.subSectionsFA(t).at(o).get("description")),e.xp6(1),e.ekj("q-list--warn",n.actionsService.isSubSectionNoQuestion(t,o)),e.Q6J("cdkDropListData",n.actionsService.subQuestionsFA(t,o).controls),e.xp6(1),e.Q6J("ngIf",n.actionsService.isSubSectionNoQuestion(t,o)),e.xp6(1),e.Q6J("ngForOf",n.actionsService.subQuestionsFA(t,o).controls)("ngForTrackBy",n.actionsService.trackByGroupId)}}const Yi=function(){return{height:"160px"}};function Ei(s,a){if(1&s){const o=e.EpF();e.O4$(),e.kcU(),e.ynx(0),e.TgZ(1,"div",71),e._UZ(2,"p-editor",72),e.qZA(),e.TgZ(3,"div",73),e.NdJ("cdkDropListDropped",function(n){e.CHM(o);const i=e.oxw().index,r=e.oxw(4);return e.KtG(r.actionsService.dropQuestions(i,n))}),e.YNc(4,ai,4,0,"div",74),e.YNc(5,Ti,28,22,"div",75),e.qZA(),e.TgZ(6,"div",76)(7,"button",77),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().index,i=e.oxw(4);return e.KtG(i.actionsService.addQuestion(n))}),e.TgZ(8,"span",46),e._uU(9,"+"),e.qZA(),e._uU(10," Add Section Question "),e.qZA(),e.TgZ(11,"button",78),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().index,i=e.oxw(4);return e.KtG(i.onAddSubSection(n))}),e.TgZ(12,"span",46),e._uU(13,"+"),e.qZA(),e._uU(14," Add Subsection "),e.qZA()(),e.TgZ(15,"div",79),e.NdJ("cdkDropListDropped",function(n){e.CHM(o);const i=e.oxw().index,r=e.oxw(4);return e.KtG(r.actionsService.dropSubSections(i,n))}),e.YNc(16,Bi,22,17,"div",80),e.qZA(),e.BQk()}if(2&s){const o=e.oxw().index,t=e.oxw(4);e.xp6(2),e.Akn(e.DdM(12,Yi)),e.Q6J("formControl",t.actionsService.sectionsFA().at(o).get("description")),e.xp6(1),e.ekj("q-list--warn",t.actionsService.isSectionNoQuestion(o)),e.Q6J("cdkDropListData",t.actionsService.questionsFA(o).controls),e.xp6(1),e.Q6J("ngIf",t.actionsService.isSectionNoQuestion(o)),e.xp6(1),e.Q6J("ngForOf",t.actionsService.questionsFA(o).controls)("ngForTrackBy",t.actionsService.trackByGroupId),e.xp6(10),e.Q6J("cdkDropListData",t.actionsService.subSectionsFA(o).controls),e.xp6(1),e.Q6J("ngForOf",t.actionsService.subSectionsFA(o).controls)("ngForTrackBy",t.actionsService.trackByGroupId)}}function ji(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",58)(1,"div",59)(2,"div",60),e._uU(3,"\u22ee\u22ee"),e.qZA(),e.TgZ(4,"span",61),e._uU(5),e.qZA(),e.TgZ(6,"div",62),e._UZ(7,"input",63),e.YNc(8,ri,2,0,"small",42),e.qZA(),e.TgZ(9,"div",64)(10,"button",65),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(4);return e.KtG(r.actionsService.toggleSection(i))}),e.O4$(),e.TgZ(11,"svg",66),e._UZ(12,"path",67),e.qZA()(),e.kcU(),e.TgZ(13,"button",68),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(4);return e.KtG(r.onDeleteSection(i))}),e.O4$(),e.TgZ(14,"svg",69),e._UZ(15,"path",70),e.qZA()()()(),e.YNc(16,Ei,17,13,"ng-container",31),e.qZA()}if(2&s){const o=a.index,t=e.oxw(3).ngIf,n=e.oxw();e.Q6J("formGroupName",o),e.uIk("id","builder-section-"+o),e.xp6(5),e.Oqu(o+1),e.xp6(2),e.ekj("input--error",n.actionsService.isSectionTitleInvalid(o)),e.Q6J("formControl",n.actionsService.sectionsFA().at(o).get("title")),e.xp6(1),e.Q6J("ngIf",n.actionsService.isSectionTitleInvalid(o)),e.xp6(3),e.Udp("transform",t.collapsedSections[o]?"rotate(-90deg)":""),e.xp6(5),e.Q6J("ngIf",!t.collapsedSections[o])}}const zi=function(){return{height:"180px"}};function Li(s,a){if(1&s){const o=e.EpF();e.ynx(0),e.TgZ(1,"section",34)(2,"div",35)(3,"h2"),e._uU(4,"Template Settings"),e.qZA(),e.TgZ(5,"p",36),e._uU(6,"Configure your DPIA template details"),e.qZA()(),e.TgZ(7,"div",37)(8,"div",38)(9,"label",39),e._uU(10,"Template Title "),e.TgZ(11,"span",40),e._uU(12,"*"),e.qZA()(),e._UZ(13,"input",41),e.YNc(14,oi,2,0,"small",42),e.qZA(),e.TgZ(15,"div",38)(16,"label",39),e._uU(17,"Description"),e.TgZ(18,"span",40),e._uU(19,"*"),e.qZA()(),e.TgZ(20,"div"),e._UZ(21,"p-editor",43),e.qZA(),e.YNc(22,ii,2,0,"small",42),e.qZA()()(),e.TgZ(23,"div",44)(24,"div")(25,"h3"),e._uU(26,"Template Sections"),e.qZA(),e.TgZ(27,"p",36),e._uU(28,"Add and organize sections with questions"),e.qZA()(),e.TgZ(29,"button",45),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.onAddSection())}),e.TgZ(30,"span",46),e._uU(31,"+"),e.qZA(),e._uU(32," Add Section "),e.qZA()(),e.YNc(33,si,12,0,"section",47),e.TgZ(34,"div",48),e.NdJ("cdkDropListDropped",function(n){e.CHM(o);const i=e.oxw(3);return e.KtG(i.actionsService.dropSections(n))}),e.YNc(35,ji,17,10,"div",49),e.qZA(),e.BQk()}if(2&s){const o=e.oxw(3);e.xp6(13),e.ekj("input--error",o.actionsService.isTitleInvalid()),e.xp6(1),e.Q6J("ngIf",o.actionsService.isTitleInvalid()),e.xp6(6),e.ekj("editor--error",o.actionsService.isDescInvalid()),e.xp6(1),e.Akn(e.DdM(12,zi)),e.xp6(1),e.Q6J("ngIf",o.actionsService.isDescInvalid()),e.xp6(11),e.Q6J("ngIf",0===o.actionsService.sectionsFA().length),e.xp6(1),e.Q6J("cdkDropListData",o.actionsService.sectionsFA().controls),e.xp6(1),e.Q6J("ngForOf",o.actionsService.sectionsFA().controls)("ngForTrackBy",o.actionsService.trackByGroupId)}}function Gi(s,a){if(1&s&&(e.ynx(0),e._UZ(1,"app-template-preview",141),e.BQk()),2&s){const o=e.oxw(3);e.xp6(1),e.Q6J("template",o.actionsService.exportPayload())}}function Hi(s,a){if(1&s&&(e.TgZ(0,"div",146)(1,"div",147),e.O4$(),e.TgZ(2,"svg",148),e._UZ(3,"path",106),e.qZA()(),e.kcU(),e.TgZ(4,"div",149)(5,"div",150),e._uU(6,"Conditions for question"),e.qZA(),e.TgZ(7,"div",151),e._uU(8),e.qZA()()()),2&s){const o=a.ngIf,t=e.oxw(4);e.xp6(8),e.hij(" ",t.actionsService.getQuestionText(o.s,o.q,o.ss)," ")}}function Ki(s,a){if(1&s){const o=e.EpF();e.YNc(0,Hi,9,1,"div",142),e.TgZ(1,"button",143),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.actionsService.closeRulePanel())}),e.O4$(),e.TgZ(2,"svg",144),e._UZ(3,"path",145),e.qZA()()}if(2&s){const o=e.oxw(2).ngIf;e.Q6J("ngIf",o.openRulePanel)}}function Vi(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",161),e.NdJ("click",function(){const i=e.CHM(o).$implicit,r=e.oxw(5);return e.KtG(r.filterWhenOption=i)}),e._uU(1),e.TgZ(2,"span",162),e._uU(3),e.qZA()()}if(2&s){const o=a.$implicit,t=e.oxw(2).ngIf,n=e.oxw(3);e.ekj("rmd-filter-chip--active",n.filterWhenOption===o),e.xp6(1),e.hij(" ",o," "),e.xp6(2),e.Oqu(n.getRuleCountForOption(t.s,t.q,o,t.ss))}}function Wi(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",159)(1,"span",160),e._uU(2,"Filter:"),e.qZA(),e.TgZ(3,"button",161),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(4);return e.KtG(n.filterWhenOption="")}),e._uU(4," All "),e.TgZ(5,"span",162),e._uU(6),e.qZA()(),e.YNc(7,Vi,4,4,"button",163),e.qZA()}if(2&s){const o=e.oxw().ngIf,t=e.oxw(3);e.xp6(3),e.ekj("rmd-filter-chip--active",""===t.filterWhenOption),e.xp6(3),e.Oqu(t.actionsService.questionRulesFA(o.s,o.q,o.ss).length),e.xp6(1),e.Q6J("ngForOf",t.actionsService.getOptionValues(o.s,o.q,o.ss))}}function Xi(s,a){if(1&s&&(e.TgZ(0,"div",164),e.O4$(),e.TgZ(1,"svg",165),e._UZ(2,"path",106),e.qZA(),e.kcU(),e.TgZ(3,"p",166),e._uU(4,"No conditions yet"),e.qZA(),e.TgZ(5,"p",167),e._uU(6," Define what happens when each option of "),e.TgZ(7,"strong"),e._uU(8),e.qZA(),e._uU(9," is selected."),e._UZ(10,"br"),e._uU(11," You can show/hide a question in this section, or ask a follow-up input. "),e.qZA()()),2&s){const o=e.oxw().ngIf,t=e.oxw(3);e.xp6(8),e.hij('"',t.actionsService.getQuestionText(o.s,o.q,o.ss),'"')}}function es(s,a){1&s&&(e.TgZ(0,"span",182),e._uU(1," Unsaved "),e.qZA())}function ts(s,a){1&s&&(e.TgZ(0,"span"),e._uU(1,"\u{1f441} Show question"),e.qZA())}function ns(s,a){1&s&&(e.TgZ(0,"span"),e._uU(1,"\u{1f648} Hide question"),e.qZA())}function os(s,a){1&s&&(e.TgZ(0,"span",189),e._uU(1,"\xb7 Required"),e.qZA())}function is(s,a){if(1&s&&(e.TgZ(0,"span"),e._uU(1),e.YNc(2,os,2,0,"span",188),e.qZA()),2&s){const o=e.oxw(2).$implicit,t=e.oxw(4);let n,i;e.xp6(1),e.hij(" \u{1f4ac} ",t.actionsService.getFollowupTypeLabel(null==(n=o.get("followup_type"))?null:n.value)," follow-up "),e.xp6(1),e.Q6J("ngIf",null==(i=o.get("followup_mandatory"))?null:i.value)}}function ss(s,a){1&s&&(e.TgZ(0,"span",190),e._uU(1,"Not configured"),e.qZA())}function rs(s,a){if(1&s&&(e.TgZ(0,"span",191),e._uU(1,' \u2014 when "'),e.TgZ(2,"strong"),e._uU(3),e.qZA(),e._uU(4,'" '),e.qZA()),2&s){const o=e.oxw(2).$implicit;let t;e.xp6(3),e.Oqu(null==(t=o.get("when_option"))?null:t.value)}}function as(s,a){if(1&s&&(e.TgZ(0,"span",183),e.ynx(1,184),e.YNc(2,ts,2,0,"span",185),e.YNc(3,ns,2,0,"span",185),e.YNc(4,is,3,2,"span",185),e.YNc(5,ss,2,0,"span",186),e.BQk(),e.YNc(6,rs,5,1,"span",187),e.qZA()),2&s){const o=e.oxw().$implicit;let t,n;e.xp6(1),e.Q6J("ngSwitch",null==(t=o.get("action"))?null:t.value),e.xp6(1),e.Q6J("ngSwitchCase","show_question"),e.xp6(1),e.Q6J("ngSwitchCase","hide_question"),e.xp6(1),e.Q6J("ngSwitchCase","show_followup"),e.xp6(2),e.Q6J("ngIf",null==(n=o.get("when_option"))?null:n.value)}}function ls(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",192),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().index,i=e.oxw().ngIf,r=e.oxw(3);return e.KtG(r.onSaveRule(i.s,i.q,n,i.ss))}),e.O4$(),e.TgZ(1,"svg",180),e._UZ(2,"polyline",193),e.qZA(),e._uU(3," Save "),e.qZA()}if(2&s){const o=e.oxw().index,t=e.oxw().ngIf,n=e.oxw(3);e.Q6J("disabled",!n.actionsService.isRuleComplete(t.s,t.q,o,t.ss))}}function cs(s,a){if(1&s&&(e.TgZ(0,"option",211),e._uU(1),e.qZA()),2&s){const o=a.$implicit;e.Q6J("ngValue",o),e.xp6(1),e.hij(" ",o," ")}}function ds(s,a){if(1&s&&(e.TgZ(0,"option",211),e._uU(1),e.ALo(2,"slice"),e.qZA()),2&s){const o=a.$implicit;e.Q6J("ngValue",o.id),e.xp6(1),e.AsE(" Q",o.label," \u2014 ",o.question_text.length>52?e.Dn7(2,3,o.question_text,0,52)+"\u2026":o.question_text," ")}}function ps(s,a){1&s&&(e.TgZ(0,"div",216),e._uU(1," No other questions in this section. "),e.qZA())}function _s(s,a){if(1&s&&(e.TgZ(0,"div",212)(1,"label",197),e._uU(2,"Target Question "),e.TgZ(3,"span",213),e._uU(4,"(same section)"),e.qZA()(),e.TgZ(5,"select",214)(6,"option",211),e._uU(7,"\u2014 Select question \u2014"),e.qZA(),e.YNc(8,ds,3,7,"option",200),e.qZA(),e.YNc(9,ps,2,0,"div",215),e.qZA()),2&s){const o=e.oxw(3).ngIf,t=e.oxw(3);e.xp6(6),e.Q6J("ngValue",""),e.xp6(2),e.Q6J("ngForOf",t.actionsService.getSameSectionQuestionsFlat(o.s,t.actionsService.getQuestionId(o.s,o.q,o.ss))),e.xp6(1),e.Q6J("ngIf",0===t.actionsService.getSameSectionQuestionsFlat(o.s,t.actionsService.getQuestionId(o.s,o.q,o.ss)).length)}}function us(s,a){1&s&&(e.ynx(0),e.TgZ(1,"div",196)(2,"label",197),e._uU(3,"Input Type "),e.TgZ(4,"span",217),e._uU(5,"*"),e.qZA()(),e.TgZ(6,"select",218)(7,"option",199),e._uU(8,"\u2014 Select type \u2014"),e.qZA(),e.TgZ(9,"o
1ption",219),e._uU(10,"Short Text"),e.qZA(),e.TgZ(11,"option",220),e._uU(12,"Long Text"),e.qZA(),e.TgZ(13,"option",221),e._uU(14,"Number"),e.qZA(),e.TgZ(15,"option",222),e._uU(16,"Date"),e.qZA(),e.TgZ(17,"option",223),e._uU(18,"File Upload"),e.qZA()()(),e.TgZ(19,"div",212)(20,"label",197),e._uU(21,"Custom Prompt "),e.TgZ(22,"span",213),e._uU(23,"(optional)"),e.qZA()(),e._UZ(24,"input",224),e.qZA(),e.BQk())}function gs(s,a){1&s&&(e.TgZ(0,"div",225),e.O4$(),e.TgZ(1,"svg",226),e._UZ(2,"circle",227)(3,"path",228),e.qZA(),e._uU(4," Hidden by default \u2014 appears only when this option is selected. "),e.qZA())}function ms(s,a){1&s&&(e.TgZ(0,"div",229),e.O4$(),e.TgZ(1,"svg",226),e._UZ(2,"circle",227)(3,"path",228),e.qZA(),e._uU(4," Will be hidden and its value cleared when this option is chosen. "),e.qZA())}function fs(s,a){if(1&s&&(e.TgZ(0,"div",230)(1,"span",231),e._uU(2,"Required follow-up?"),e.qZA(),e.TgZ(3,"label",116),e._UZ(4,"input",232)(5,"span",118),e.qZA(),e.TgZ(6,"span",233),e._uU(7),e.qZA()()),2&s){const o=e.oxw(2).$implicit;let t,n;e.xp6(6),e.ekj("rmd-mandatory-text--on",null==(t=o.get("followup_mandatory"))?null:t.value),e.xp6(1),e.hij(" ",null!=(n=o.get("followup_mandatory"))&&n.value?"Yes \u2014 user must fill this before proceeding":"No \u2014 optional"," ")}}function xs(s,a){1&s&&(e.TgZ(0,"span",238),e._uU(1,"Required"),e.qZA())}function hs(s,a){if(1&s&&(e.TgZ(0,"div",234),e.O4$(),e.TgZ(1,"svg",235),e._UZ(2,"polyline",236),e.qZA(),e._uU(3," In preview: shows a "),e.kcU(),e.TgZ(4,"strong"),e._uU(5),e.qZA(),e._uU(6," input below this question when "),e.TgZ(7,"strong"),e._uU(8),e.qZA(),e._uU(9," is selected "),e.YNc(10,xs,2,0,"span",237),e._uU(11,". "),e.qZA()),2&s){const o=e.oxw(2).$implicit,t=e.oxw(4);let n,i,r;e.xp6(5),e.Oqu(t.actionsService.getFollowupTypeLabel(null==(n=o.get("followup_type"))?null:n.value)),e.xp6(3),e.hij('"',null==(i=o.get("when_option"))?null:i.value,'"'),e.xp6(2),e.Q6J("ngIf",null==(r=o.get("followup_mandatory"))?null:r.value)}}function vs(s,a){if(1&s&&(e.O4$(),e.kcU(),e.TgZ(0,"div",194)(1,"div",195)(2,"div",196)(3,"label",197),e._uU(4,"When option"),e.qZA(),e.TgZ(5,"select",198)(6,"option",199),e._uU(7,"\u2014 Select option \u2014"),e.qZA(),e.YNc(8,cs,2,2,"option",200),e.qZA()(),e.TgZ(9,"span",201),e._uU(10,"\u2192 then"),e.qZA(),e.TgZ(11,"div",196)(12,"label",197),e._uU(13,"Action"),e.qZA(),e.TgZ(14,"select",202)(15,"option",203),e._uU(16,"Show Question"),e.qZA(),e.TgZ(17,"option",204),e._uU(18,"Hide Question"),e.qZA(),e.TgZ(19,"option",205),e._uU(20,"Ask Follow-up"),e.qZA()()(),e.YNc(21,_s,10,3,"div",206),e.YNc(22,us,25,0,"ng-container",31),e.qZA(),e.YNc(23,gs,5,0,"div",207),e.YNc(24,ms,5,0,"div",208),e.YNc(25,fs,8,3,"div",209),e.YNc(26,hs,12,3,"div",210),e.qZA()),2&s){const o=e.oxw().$implicit,t=e.oxw().ngIf,n=e.oxw(3);let i,r,l,c,d,p;e.xp6(8),e.Q6J("ngForOf",n.actionsService.getOptionValues(t.s,t.q,t.ss)),e.xp6(13),e.Q6J("ngIf","show_question"===(null==(i=o.get("action"))?null:i.value)||"hide_question"===(null==(i=o.get("action"))?null:i.value)),e.xp6(1),e.Q6J("ngIf","show_followup"===(null==(r=o.get("action"))?null:r.value)),e.xp6(1),e.Q6J("ngIf","show_question"===(null==(l=o.get("action"))?null:l.value)),e.xp6(1),e.Q6J("ngIf","hide_question"===(null==(c=o.get("action"))?null:c.value)),e.xp6(1),e.Q6J("ngIf","show_followup"===(null==(d=o.get("action"))?null:d.value)),e.xp6(1),e.Q6J("ngIf","show_followup"===(null==(p=o.get("action"))?null:p.value)&&(null==(p=o.get("followup_type"))?null:p.value))}}function bs(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",168)(1,"div",169),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(4);return e.KtG(r.toggleRuleExpand(i))}),e.TgZ(2,"div",170)(3,"span",171),e.O4$(),e.TgZ(4,"svg",172),e._UZ(5,"path",173),e.qZA()(),e.kcU(),e.TgZ(6,"span",174),e._uU(7),e.qZA(),e.YNc(8,es,2,0,"span",175),e.YNc(9,as,7,5,"span",176),e.qZA(),e.TgZ(10,"div",177),e.NdJ("click",function(n){return n.stopPropagation()}),e.YNc(11,ls,4,1,"button",178),e.TgZ(12,"button",179),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw().ngIf,l=e.oxw(3);return e.KtG(l.actionsService.removeRule(r.s,r.q,i,r.ss))}),e.O4$(),e.TgZ(13,"svg",180),e._UZ(14,"path",145),e.qZA(),e._uU(15," Remove "),e.qZA()()(),e.YNc(16,vs,27,7,"div",181),e.qZA()}if(2&s){const o=a.$implicit,t=a.index,n=e.oxw().ngIf,i=e.oxw(2).ngIf,r=e.oxw();let l;e.ekj("rmd-rule-card--collapsed",!r.isRuleExpanded(t)),e.Q6J("formGroup",r.actionsService.getRuleFormGroup(n.s,n.q,t,n.ss))("hidden",""!==r.filterWhenOption&&(null==(l=o.get("when_option"))?null:l.value)!==r.filterWhenOption),e.xp6(3),e.ekj("rmd-rule-chevron--open",r.isRuleExpanded(t)),e.xp6(4),e.hij("Condition ",t+1,""),e.xp6(1),e.Q6J("ngIf",i.pendingRuleIdx===t),e.xp6(1),e.Q6J("ngIf",!r.isRuleExpanded(t)&&i.pendingRuleIdx!==t),e.xp6(2),e.Q6J("ngIf",i.pendingRuleIdx===t),e.xp6(5),e.Q6J("ngIf",r.isRuleExpanded(t))}}function ws(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",152),e.YNc(1,Wi,8,4,"div",153),e.YNc(2,Xi,12,1,"div",154),e.YNc(3,bs,17,11,"div",155),e.TgZ(4,"button",156),e.NdJ("click",function(){const i=e.CHM(o).ngIf,r=e.oxw(3);return e.KtG(r.onAddRule(i.s,i.q,i.ss))}),e.O4$(),e.TgZ(5,"svg",157),e._UZ(6,"path",158),e.qZA(),e._uU(7," Add Condition "),e.qZA()()}if(2&s){const o=a.ngIf,t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",t.actionsService.questionRulesFA(o.s,o.q,o.ss).length>0),e.xp6(1),e.Q6J("ngIf",0===t.actionsService.questionRulesFA(o.s,o.q,o.ss).length),e.xp6(1),e.Q6J("ngForOf",t.actionsService.questionRulesFA(o.s,o.q,o.ss).controls),e.xp6(1),e.Q6J("disabled",0===t.actionsService.getOptionValues(o.s,o.q,o.ss).length)}}const Ce=function(s,a){return{oid:s,pid:a}},Cs=function(){return{width:"960px",maxWidth:"98vw"}};function Ts(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div")(1,"div",9)(2,"div",10)(3,"div")(4,"nav",11)(5,"ol",12)(6,"li",13)(7,"a",14),e._uU(8,"Home"),e.qZA()(),e.TgZ(9,"li",13)(10,"a",15),e._uU(11,"DPIA Templates"),e.qZA()(),e.TgZ(12,"li",16),e._uU(13,"Template Builder"),e.qZA()()()()()(),e.TgZ(14,"form",17),e.NdJ("ngSubmit",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.actionsService.publish())}),e.TgZ(15,"header",18)(16,"div",19)(17,"h1",20),e._uU(18,"Template Builder"),e.qZA(),e.TgZ(19,"nav",21)(20,"button",22),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.actionsService.setCurrentStep(0))}),e._uU(21," Builder "),e.qZA(),e.TgZ(22,"button",22),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.actionsService.setCurrentStep(1))}),e._uU(23," Preview "),e.qZA()()(),e.TgZ(24,"div",23)(25,"div",24)(26,"span",25),e._uU(27,"Status"),e.qZA(),e.TgZ(28,"span",26),e._uU(29),e.qZA()(),e.TgZ(30,"button",27),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.actionsService.saveDraft())}),e.O4$(),e.TgZ(31,"svg",28),e._UZ(32,"path",29),e.qZA(),e._uU(33," Save Draft "),e.qZA(),e.kcU(),e.TgZ(34,"button",30),e._uU(35," Publish Template "),e.qZA()()(),e.YNc(36,Li,36,13,"ng-container",31),e.YNc(37,Gi,2,1,"ng-container",31),e.qZA(),e.TgZ(38,"p-dialog",32),e.YNc(39,Ki,4,1,"ng-template",6),e.YNc(40,ws,8,4,"div",33),e.qZA()()}if(2&s){const o=e.oxw().ngIf,t=e.oxw();e.xp6(7),e.Q6J("queryParams",e.WLB(22,Ce,o.oid,o.pid)),e.xp6(3),e.Q6J("queryParams",e.WLB(25,Ce,o.oid,o.pid)),e.xp6(4),e.Q6J("formGroup",o.form),e.xp6(6),e.ekj("tb2-tab--active",0===o.currentStep),e.xp6(2),e.ekj("tb2-tab--active",1===o.currentStep),e.xp6(7),e.Oqu("edit"===o.mode?"Editing":"Draft"),e.xp6(1),e.Q6J("disabled",!t.canCreate),e.uIk("title",t.getDisabledTitle(t.canCreate)),e.xp6(4),e.Q6J("disabled",!t.canCreate),e.uIk("title",t.getDisabledTitle(t.canCreate)),e.xp6(2),e.Q6J("ngIf",0===o.currentStep),e.xp6(1),e.Q6J("ngIf",1===o.currentStep),e.xp6(1),e.Akn(e.DdM(28,Cs)),e.Q6J("visible",!!o.openRulePanel)("modal",!0)("closable",!1)("draggable",!1)("resizable",!1),e.xp6(2),e.Q6J("ngIf",o.openRulePanel)}}function ys(s,a){1&s&&(e.TgZ(0,"div",239),e._UZ(1,"mat-spinner",240),e.qZA()),2&s&&(e.xp6(1),e.Q6J("strokeWidth",4))}function ks(s,a){if(1&s&&(e.TgZ(0,"div",241)(1,"div",242),e.O4$(),e.TgZ(2,"svg",243),e._UZ(3,"polyline",244)(4,"path",245)(5,"path",246),e.qZA()(),e.kcU(),e.TgZ(6,"span",247),e._uU(7),e.qZA()()),2&s){const o=e.oxw(2);e.xp6(7),e.hij("Delete ",o.deleteDialogLabel,"?")}}function Os(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",248)(1,"button",249),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onDeleteCancel())}),e._uU(2," Cancel "),e.qZA(),e.TgZ(3,"button",250),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onDeleteConfirm())}),e._uU(4," Delete "),e.qZA()()}}function Ms(s,a){1&s&&(e.TgZ(0,"div",241)(1,"div",251),e.O4$(),e.TgZ(2,"svg",243),e._UZ(3,"path",252)(4,"line",253)(5,"line",254),e.qZA()(),e.kcU(),e.TgZ(6,"span",247),e._uU(7,"Unsaved Changes"),e.qZA()())}function Ps(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",248)(1,"button",249),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onUnsavedCancel())}),e._uU(2," Stay on Page "),e.qZA(),e.TgZ(3,"button",255),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onUnsavedDiscard())}),e._uU(4," Discard "),e.qZA(),e.TgZ(5,"button",256),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.onUnsavedSaveDraft())}),e._uU(6," Save as Draft "),e.qZA()()}}const As=function(){return{width:"420px"}},Zs=function(){return{width:"480px"}};function qs(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",1),e.YNc(1,Ts,41,29,"div",2),e.YNc(2,ys,2,1,"ng-template",null,3,e.W1O),e._UZ(4,"p-toast",4),e.TgZ(5,"p-dialog",5),e.NdJ("visibleChange",function(n){e.CHM(o);const i=e.oxw();return e.KtG(i.showDeleteDialog=n)}),e.YNc(6,ks,8,1,"ng-template",6),e.TgZ(7,"p",7),e._uU(8),e.qZA(),e.YNc(9,Os,5,0,"ng-template",8),e.qZA(),e.TgZ(10,"p-dialog",5),e.NdJ("visibleChange",function(n){e.CHM(o);const i=e.oxw();return e.KtG(i.showUnsavedDialog=n)}),e.YNc(11,Ms,8,0,"ng-template",6),e.TgZ(12,"p",7),e._uU(13," You have unsaved changes. What would you like to do before leaving? "),e.qZA(),e.YNc(14,Ps,7,0,"ng-template",8),e.qZA()()}if(2&s){const o=a.ngIf,t=e.MAs(3),n=e.oxw();e.xp6(1),e.Q6J("ngIf",!o.loading)("ngIfElse",t),e.xp6(4),e.Akn(e.DdM(17,As)),e.Q6J("visible",n.showDeleteDialog)("modal",!0)("closable",!1)("draggable",!1)("resizable",!1),e.xp6(3),e.hij(" Are you sure you want to delete this ",n.deleteDialogLabel,"? This action cannot be undone. "),e.xp6(2),e.Akn(e.DdM(18,Zs)),e.Q6J("visible",n.showUnsavedDialog)("modal",!0)("closable",!1)("draggable",!1)("resizable",!1)}}let re=(()=>{const a=class{constructor(t,n){this.actionsService=t,this.router=n,this.state$=this.actionsService.getStateObs(),this.expandedRuleIndex=0,this.filterWhenOption="",this.showUnsavedDialog=!1,this._deactivateSubject=null,this._nextUrl=null,this.showDeleteDialog=!1,this.deleteDialogLabel="",this._pendingDelete=null}ngOnInit(){this.actionsService.init()}onDeleteConfirm(){this._pendingDelete?.(),this._pendingDelete=null,this.showDeleteDialog=!1}onDeleteCancel(){this._pendingDelete=null,this.showDeleteDialog=!1}onDeleteSection(t){this.deleteDialogLabel="section",this._pendingDelete=()=>this.actionsService.removeSection(t),this.showDeleteDialog=!0}onDeleteQuestion(t,n,i){this.deleteDialogLabel="question",this._pendingDelete=()=>this.actionsService.removeQuestion(t,n,i),this.showDeleteDialog=!0}onDeleteOption(t,n,i,r){this.deleteDialogLabel="option",this._pendingDelete=()=>this.actionsService.removeOption(t,n,i,r),this.showDeleteDialog=!0}onDeleteSubSection(t,n){this.deleteDialogLabel="subsection",this._pendingDelete=()=>this.actionsService.removeSubSection(t,n),this.showDeleteDialog=!0}canDeactivate(t,n,i,r){return!this.actionsService.hasUnsavedChanges()||(this._nextUrl=r?.url??null,this._deactivateSubject=ne
1w oe.xQ,this.showUnsavedDialog=!0,this._deactivateSubject.asObservable())}onUnsavedSaveDraft(){this.showUnsavedDialog=!1;const t=this._nextUrl;this.actionsService.saveDraftSilent().subscribe(n=>{n&&t?(this._deactivateSubject?.next(!0),this._deactivateSubject?.complete(),this._deactivateSubject=null,this.router.navigateByUrl(t)):(this._deactivateSubject?.next(!1),this._deactivateSubject?.complete(),this._deactivateSubject=null)}),this._nextUrl=null}onUnsavedDiscard(){this.showUnsavedDialog=!1;const t=this._nextUrl;this._nextUrl=null,this.actionsService.getState().form?.markAsPristine(),this.actionsService.resetSnapshot(),this._deactivateSubject?.next(!0),this._deactivateSubject?.complete(),this._deactivateSubject=null,t&&this.router.navigateByUrl(t)}onUnsavedCancel(){this.showUnsavedDialog=!1,this._nextUrl=null,this._deactivateSubject?.next(!1),this._deactivateSubject?.complete(),this._deactivateSubject=null}toggleRuleExpand(t){this.expandedRuleIndex=this.expandedRuleIndex===t?null:t}isRuleExpanded(t){return this.expandedRuleIndex===t}onOpenRulePanel(t,n,i){this.expandedRuleIndex=0,this.filterWhenOption="",this.actionsService.toggleRulePanel(t,n,i)}onAddRule(t,n,i){this.actionsService.addRule(t,n,i,this.filterWhenOption||void 0);const l=this.actionsService.questionRulesFA(t,n,i).length;this.expandedRuleIndex=l-1}onSaveRule(t,n,i,r){this.actionsService.saveRule(t,n,i,r)}getRuleCountForOption(t,n,i,r){try{return this.actionsService.questionRulesFA(t,n,r).controls.filter(l=>l.get("when_option")?.value===i).length}catch{return 0}}onDocClick(t){if(!t.target.closest(".type-select")){const i=this.actionsService.getState();i.openTypeMenu&&this.actionsService.toggleTypeMenu(i.openTypeMenu.s,i.openTypeMenu.q,i.openTypeMenu.ss)}}onEsc(){const t=this.actionsService.getState();t.openTypeMenu&&this.actionsService.toggleTypeMenu(t.openTypeMenu.s,t.openTypeMenu.q,t.openTypeMenu.ss)}get canCreate(){return this.actionsService.canCreate()}get canEdit(){return this.actionsService.canEdit()}getDisabledTitle(t){return t?null:"You don't have permission"}onAddSection(){this.actionsService.addSection();const t=this.actionsService.sectionsFA().length-1;this.scrollToElement(`builder-section-${t}`)}onAddSubSection(t){this.actionsService.addSubSection(t);const n=this.actionsService.subSectionsFA(t).length-1;this.scrollToElement(`builder-subsection-${t}-${n}`)}scrollToElement(t){setTimeout(()=>{document.getElementById(t)?.scrollIntoView({behavior:"smooth",block:"center"})},0)}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.Y36(he),e.Y36(y.F0))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-assessments-template-page"]],hostBindings:function(n,i){1&n&&e.NdJ("click",function(l){return i.onDocClick(l)},!1,e.evT)("keydown.escape",function(){return i.onEsc()},!1,e.evT)},features:[e._Bn([he])],decls:2,vars:3,consts:[["class","page",4,"ngIf"],[1,"page"],[4,"ngIf","ngIfElse"],["loader",""],["position","bottom-right"],["styleClass","tb-confirm-dialog","appendTo","body",3,"visible","modal","closable","draggable","resizable","visibleChange"],["pTemplate","header"],[1,"tb-dialog-body"],["pTemplate","footer"],[1,"col-md-12",2,"margin-bottom","25px","margin-top","15px","margin-left","6.5px"],[1,"d-sm-flex","align-items-center","justify-content-between"],["aria-label","breadcrumb",1,"bredcrub-row",2,"margin-left","-14px"],[1,"breadcrumb","breadcrumb-style1","mg-b-10"],[1,"breadcrumb-item"],["routerLink","/home/welcome",3,"queryParams"],["routerLink","/assessment/templates",3,"queryParams"],[1,"breadcrumb-item","active"],[1,"wrap",3,"formGroup","ngSubmit"],[1,"tb2-header"],[1,"tb2-header__left"],[1,"tb2-title"],[1,"tb2-tabs"],["type","button",1,"tb2-tab",3,"click"],[1,"tb2-header__right"],[1,"tb2-status"],[1,"tb2-status__label"],[1,"tb2-status__badge"],["type","button",1,"btn","white",3,"disabled","click"],["viewBox","0 0 24 24","aria-hidden","true",1,"tb2-ico"],["d","M5 4h10l4 4v12H5V4Zm10 0v6H7V4","fill","none","stroke","currentColor","stroke-width","1.6","stroke-linejoin","round"],["type","submit",1,"btn","primary",3,"disabled"],[4,"ngIf"],["styleClass","rule-modal-dialog","appendTo","body",3,"visible","modal","closable","draggable","resizable"],["class","rmd-body",4,"ngIf"],[1,"settings-card"],[1,"settings-head"],[1,"muted"],[1,"settings-body"],[1,"row"],[1,"label"],[1,"req"],["formControlName","title","placeholder","e.g., GDPR Compliance Assessment",1,"input"],["class","field-error-msg",4,"ngIf"],["formControlName","description","placeholder","Describe the purpose and scope..."],[1,"sections-head"],["type","button",1,"btn","primary",3,"click"],[1,"plus"],["class","empty",4,"ngIf"],["formArrayName","sections","cdkDropList","",1,"sections",3,"cdkDropListData","cdkDropListDropped"],["class","sec-card","cdkDrag","","cdkDragLockAxis","y",3,"formGroupName",4,"ngFor","ngForOf","ngForTrackBy"],[1,"field-error-msg"],[1,"empty"],[1,"n
1o-sections-warn"],["viewBox","0 0 20 20","fill","currentColor","width","18","height","18"],["fill-rule","evenodd","d","M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z","clip-rule","evenodd"],[1,"big-plus"],[1,"empty-text"],["type","button",1,"btn","white",3,"click"],["cdkDrag","","cdkDragLockAxis","y",1,"sec-card",3,"formGroupName"],[1,"sec-head"],["cdkDragHandle","","aria-hidden","true",1,"sec-drag"],[1,"sec-chip"],[1,"sec-title-wrap"],["placeholder","Section name *",1,"input",3,"formControl"],[1,"sec-tools"],["type","button","title","Collapse/Expand",1,"ico-btn",3,"click"],["viewBox","0 0 20 20"],["d","M6 8l4 4 4-4","fill","none","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],["type","button","title","Delete section",1,"ico-btn","danger",3,"click"],["viewBox","0 0 24 24","width","16","height","16"],["d","M3 6h18M9 6V4h6v2m-8 0l1 14a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-14","fill","none","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],[1,"sec-desc-wrap"],["placeholder","Add section description (optional)...",1,"sec-desc-editor",3,"formControl"],["formArrayName","questions","cdkDropList","",1,"q-list",3,"cdkDropListData","cdkDropListDropped"],["class","sec-no-q-banner",4,"ngIf"],["class","q-card","cdkDrag","","cdkDragLockAxis","y",3,"formGroupName","cdkDragDisabled",4,"ngFor","ngForOf","ngForTrackBy"],[1,"section-actions"],["type","button",1,"row-action",3,"click"],["type","button",1,"row-action","secondary",3,"click"],["formArrayName","sub_sections","cdkDropList","",1,"subsections",3,"cdkDropListData","cdkDropListDropped"],["class","subsec-card","cdkDrag","","cdkDragLockAxis","y",3,"formGroupName",4,"ngFor","ngForOf","ngForTrackBy"],[1,"sec-no-q-banner"],["viewBox","0 0 20 20","fill","currentColor","width","15","height","15"],["cdkDrag","","cdkDragLockAxis","y",1,"q-card",3,"formGroupName","cdkDragDisabled"],["class","rule-lock-bar",4,"ngIf"],[1,"q-top"],[1,"q-left"],["cdkDragHandle","",1,"drag-handle"],[1,"q-no"],[1,"q-input-wrap"],["placeholder","New Question",1,"input",3,"formControl"],[1,"q-right"],["class","req-badge",4,"ngIf"],["type","button","class","rule-toggle-btn","title","Manage conditions for this question",3,"rule-toggle-btn--active","rule-toggle-btn--has-rules","click",4,"ngIf"],[1,"type-select"],["type","button",1,"q-type",3,"click"],["viewBox","0 0 20 20",1,"chev"],["class","type-menu",4,"ngIf"],["type","button","title","Delete question",1,"ico-btn","danger",3,"click"],[1,"rule-lock-bar"],["viewBox","0 0 24 24","width","13","height","13"],["x","3","y","11","width","18","height","11","rx","2","fill","none","stroke","currentColor","stroke-width","2"],["d","M7 11V7a5 5 0 0 1 10 0v4","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round"],[1,"req-badge"],["type","button","title","Manage conditions for this question",1,"rule-toggle-btn",3,"click"],["viewBox","0 0 24 24","width","13","height","13","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","M13 2L3 14h9l-1 8 10-12h-9l1-8z"],["class","rule-count-badge",4,"ngIf"],[1,"rule-count-badge"],[1,"type-menu"],["class","type-item","type","button",3,"click",4,"ngFor","ngForOf"],["type","button",1,"type-item",3,"click"],[1,"q-sep"],[1,"field-label"],["placeholder","Helper text or additional information...",1,"q-help-editor",3,"formControl"],[1,"req-row"],[1,"switch"],["type","checkbox",3,"formControl"],[1,"slider","red"],[1,"stack"],["formArrayName","options","cdkDropList","",1,"opt-list",3,"cdkDropListData","cdkDropListDropped"],["class","opt-item","cdkDrag","",3,"formGroupName",4,"ngFor","ngForOf","ngForTrackBy"],[1,"add-opt"],["type","button",1,"btn","small",3,"click"],["cdkDrag","",1,"opt-item",3,"formGroupName"],[1,"opt-row"],["cdkDragHandle","",1,"opt-drag"],["formControlName","value","placeholder","Add option...",1,"input"],["type","button","title","Remove option",1,"ico-btn","danger",3,"click"],["viewBox","0 0 24 24","width","14","height","14"],["class","field-error-msg field-error-msg--opt",4,"ngIf"],[1,"field-error-msg","field-error-msg--opt"],["cdkDrag","","cdkDragLockAxis","y",1,"subsec-card",3,"formGroupName"],[1,"subsec-head"],[1,"subsec-chip"],["placeholder","Subsection title",1,"input",3,"formControl"],["type","button","title","Delete subsection",1,"ico-btn","danger",3,"click"],["placeholder","Add subsection description (optional)...",1,"sec-desc-editor",3,"formControl"],["class","q-card sub-q","cdkDrag","","cdkDragLockAxis","y",3,"formGroupName","cdkDragDisabled",4,"ngFor","ngForOf","ngForTrackBy"],["type","button",1,"row-action","tert
1iary",3,"click"],["cdkDrag","","cdkDragLockAxis","y",1,"q-card","sub-q",3,"formGroupName","cdkDragDisabled"],[3,"template"],["class","rmd-header",4,"ngIf"],["type","button","aria-label","Close",1,"rmd-close-abs",3,"click"],["viewBox","0 0 24 24","width","18","height","18","fill","none","stroke","currentColor","stroke-width","2.5","stroke-linecap","round"],["d","M18 6L6 18M6 6l12 12"],[1,"rmd-header"],[1,"rmd-icon"],["viewBox","0 0 24 24","width","20","height","20","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],[1,"rmd-meta"],[1,"rmd-pretitle"],[1,"rmd-title"],[1,"rmd-body"],["class","rmd-filter-bar",4,"ngIf"],["class","rmd-empty",4,"ngIf"],["class","rmd-rule-card",3,"formGroup","rmd-rule-card--collapsed","hidden",4,"ngFor","ngForOf"],["type","button",1,"rmd-add-btn",3,"disabled","click"],["viewBox","0 0 24 24","width","15","height","15","fill","none","stroke","currentColor","stroke-width","2.5","stroke-linecap","round"],["d","M12 5v14M5 12h14"],[1,"rmd-filter-bar"],[1,"rmd-filter-label"],["type","button",1,"rmd-filter-chip",3,"click"],[1,"rmd-filter-count"],["type","button","class","rmd-filter-chip",3,"rmd-filter-chip--active","click",4,"ngFor","ngForOf"],[1,"rmd-empty"],["viewBox","0 0 24 24","width","40","height","40","fill","none","stroke","#a78bfa","stroke-width","1.3"],[1,"rmd-empty-title"],[1,"rmd-empty-sub"],[1,"rmd-rule-card",3,"formGroup","hidden"],[1,"rmd-rule-head",3,"click"],[1,"rmd-rule-head-left"],[1,"rmd-rule-chevron"],["viewBox","0 0 20 20","width","14","height","14","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round"],["d","M6 8l4 4 4-4"],[1,"rmd-rule-num"],["class","rmd-unsaved-badge",4,"ngIf"],["class","rmd-rule-summary",4,"ngIf"],[1,"rmd-rule-head-actions",3,"click"],["type","button","class","rmd-rule-save","title","Save this condition",3,"disabled","click",4,"ngIf"],["type","button","title","Remove condition",1,"rmd-rule-del",3,"click"],["viewBox","0 0 24 24","width","13","height","13","fill","none","stroke","currentColor","stroke-width","2.5","stroke-linecap","round"],["class","rmd-rule-body",4,"ngIf"],[1,"rmd-unsaved-badge"],[1,"rmd-rule-summary"],[3,"ngSwitch"],[4,"ngSwitchCase"],["class","rmd-rule-summary--empty",4,"ngSwitchDefault"],["class","rmd-summary-when",4,"ngIf"],["class","rmd-summary-req",4,"ngIf"],[1,"rmd-summary-req"],[1,"rmd-rule-summary--empty"],[1,"rmd-summary-when"],["type","button","title","Save this condition",1,"rmd-rule-save",3,"disabled","click"],["points","20 6 9 17 4 12"],[1,"rmd-rule-body"],[1,"rmd-main-row"],[1,"rmd-field"],[1,"rmd-label"],["formControlName","when_option",1,"rmd-select"],["value",""],[3,"ngValue",4,"ngFor","ngForOf"],[1,"rmd-then"],["formControlName","action",1,"rmd-select"],["value","show_question"],["value","hide_question"],["value","show_followup"],["class","rmd-field rmd-field--grow",4,"ngIf"],["class","rmd-action-info",4,"ngIf"],["class","rmd-action-info rmd-action-info--warn",4,"ngIf"],["class","rmd-required-row",4,"ngIf"],["class","rmd-followup-preview",4,"ngIf"],[3,"ngValue"],[1,"rmd-field","rmd-field--grow"],[1,"rmd-scope-hint"],["formControlName","target_question_id",1,"rmd-select","rmd-select--target"],["class","rmd-field-hint",4,"ngIf"],[1,"rmd-field-hint"],[1,"rmd-req-star"],["formControlName","followup_type",1,"rmd-select"],["value","short_text"],["value","long_text"],["value","number"],["value","date"],["value","file"],["formControlName","followup_label","placeholder","e.g. Please explain why...",1,"rmd-input"],[1,"rmd-action-info"],["viewBox","0 0 24 24","width","13","height","13","fill","none","stroke","currentColor","stroke-width","2"],["cx","12","cy","12","r","10"],["d","M12 8v4l3 3"],[1,"rmd-action-info","rmd-action-info--warn"],[1,"rmd-required-row"],[1,"rmd-required-label"],["type","checkbox","formControlName","followup_mandatory"],[1,"rmd-mandatory-text"],[1,"rmd-followup-preview"],["viewBox","0 0 24 24","width","12","height","12","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round"],["points","9 18 15 12 9 6"],["class","rmd-mandatory-badge",4,"ngIf"],[1,"rmd-mandatory-badge"],[2,"display","flex","justify-content","center","height","100vh","align-items","center"],["diameter","50",3,"strokeWidth"],[1,"tb-dialog-header"],[1,"tb-dialog-header__icon","tb-dialog-header__icon--danger"],["viewBox","0 0 24 24","width","18","height","18","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["points","3 6 5 6 21 6"],["d","M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6"],["d","M10 11v6M14 11v6M9 6V4h6v2"],[1,"tb-dialog-header__title"],[1,"tb-dialog-footer"],["type","button",1,"tb-btn","tb-btn--ghost",3,"click"],["type","button",1,"tb-btn","tb-btn--danger",3,"click"],[1,"tb-dialog-header__icon","tb-dialog-header__icon--warn"],["d","M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"],["x1","12","y1","9","x2","12","y2","13"],["x1","12","y1","17","x2","12.01","y2","17"],["type","button",1,"tb-btn","tb-btn--outline-danger",3,"click"],["type","button",1,"tb-btn","tb-btn--primary",3,"click"]],template:function(n,i){1&n&&(e.YNc(0,qs,15,19,"div",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,i.state$))},dependencies:[v.sg,v.O5,v.RF,v.n9,v.ED,y.rH,Q.jx,f._Y,f.YN,f.Kr,f.Fj,f.Wl,f.EJ,f.JJ,f.JL,f.oH,f.sg,f.u,f.x0,f.CE,W.V,z.FN,ce.Ou,X.ML,S.Wj,S.Zt,S.Bh,ni,v.Ov,v.OU],styles:["@charset \"UTF-8\";.page[_ngcontent-%COMP%]{background:#f6f8fb;min-height:100vh;padding:26px 0 80px;color:#111827;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial}.wrap[_ngcontent-%COMP%]{max-width:1180px;margin:0 auto;padding:0 22px}.settings-card[_ngcontent-%COMP%]{background:white;border:1px solid #e9edf3;border-radius:10px;overflow:visible;box-shadow:0 8px 20px #0f172a0a}.settings-head[_ngcontent-%COMP%]{background:#fff;padding:16px 18px;border-bottom:1px solid #e9edf3;border-radius:10px 10px 0 0}.settings-head[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 4px;font-size:18px;font-weight:600}.muted[_ngcontent-%COMP%]{color:#6b7280;font-size:13px}.settings-body[_ngcontent-%COMP%]{margin:40px}.row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}.label[_ngcontent-%COMP%]{font-weight:700;font-size:13px;color:#22303f}.req[_ngcontent-%COMP%]{color:#e11d48;margin-left:6px}.input[_ngcontent-%COMP%], .textarea[_ngcontent-%COMP%]{width:100%;padding:12px 14px;border-radius:10px;border:1px solid #e9edf3;background:#f6f8fc;color:#111827;font-size:14px;transition:border-color .15s,box-shadow .15s,background .12s}.input[_ngcontent-%COMP%]:hover, .textarea[_ngcontent-%COMP%]:hover{background:#f3f6ff}.input[_ngcontent-%COMP%]:focus, .textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:#16bf5e;box-shadow:0 0 0 3px #16bf5e26;background:#fff}.sections-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:18px 0 10px}.sections-head[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:16px;font-weight:600}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:10px;border:1px solid transparent;cursor:pointer;font-weight:700}.btn.primary[_ngcontent-%COMP%]{background:#16bf5e;color:#fff}.btn.white[_ngcontent-%COMP%]{background:#fff;border:1px solid #e9edf3}.btn.small[_ngcontent-%COMP%]{padding:8px 12px;font-size:13px}.plus[_ngcontent-%COMP%]{font-weight:900}.empty[_ngcontent-%COMP%]{background:#fff;border:1px solid #e9edf3;border-radius:10px;padding:40px 18px;text-align:center}.big-plus[_ngcontent-%COMP%]{width:72px;height:72px;border-radius:50%;border:1px solid #e9edf3;display:flex;align-items:center;justify-content:center;margin:0 auto 10px;color:#6b7280;font-weight:900;font-size:32px}.empty-text[_ngcontent-%COMP%]{color:#6b7280;margin:6px 0 10px}.sections[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.sec-card[_ngcontent-%COMP%]{background:#fff;border:1px solid #e9edf3;border-radius:12px;padding:16px;position:relative;box-shadow:0 10px 26px #0f172a0d}.sec-card[_ngcontent-%COMP%]:before{content:\"\";position:absolute;
1left:0;top:10px;bottom:10px;width:4px;background:#16bf5e;border-radius:4px}.sec-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.sec-drag[_ngcontent-%COMP%]{color:#a8b1bd;font-size:18px;width:18px;text-align:center;cursor:grab}.sec-chip[_ngcontent-%COMP%]{background:#16bf5e;color:#fff;font-weight:800;border-radius:12px;min-width:28px;height:28px;line-height:28px;text-align:center;display:inline-block}.sec-title[_ngcontent-%COMP%]{flex:1;border:0;background:transparent;font-weight:600;font-size:1rem;outline:none;padding:6px 8px;border-radius:8px}.sec-title[_ngcontent-%COMP%]:hover{background:#f3f6ff}.sec-title[_ngcontent-%COMP%]:focus{background:#fff;box-shadow:0 0 0 3px #16bf5e26}.sec-tools[_ngcontent-%COMP%]{display:flex;gap:8px}.ico-btn[_ngcontent-%COMP%]{width:34px;height:34px;border-radius:8px;border:1px solid #e9edf3;background:#fff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.ico-btn.danger[_ngcontent-%COMP%]{color:#ef4444;border-color:#f5cfcf}.ico-btn[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:16px;height:16px}.sec-desc-wrap[_ngcontent-%COMP%]{margin:12px 0 6px}.sec-desc-editor[_ngcontent-%COMP%]{display:block}.sec-desc[_ngcontent-%COMP%]{width:100%;background:#f5f7fb;border:1px solid #e9edf3;border-radius:12px;min-height:68px;padding:14px;font-size:14px;color:#111827;resize:vertical}.sec-desc[_ngcontent-%COMP%]:hover{background:#f3f6ff}.sec-desc[_ngcontent-%COMP%]:focus{border-color:#16bf5e;box-shadow:0 0 0 3px #16bf5e26;background:#fff}.q-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px}.q-card[_ngcontent-%COMP%]{background:#fff;border:1px solid #eef2f7;border-radius:12px;padding:14px}.q-top[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:10px}.q-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;flex:1;min-width:0}.q-left[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{flex:1;width:100%;min-width:0}.drag-handle[_ngcontent-%COMP%]{color:#a8b1bd;cursor:grab}.q-no[_ngcontent-%COMP%]{font-weight:700}.q-title-input[_ngcontent-%COMP%]{border:0;background:transparent;outline:none;padding:8px 10px;border-radius:8px;font-weight:600}.q-title-input[_ngcontent-%COMP%]:hover{background:#f3f6ff}.q-title-input[_ngcontent-%COMP%]:focus{background:#fff;box-shadow:0 0 0 3px #16bf5e26}.q-right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;position:relative}.req-badge[_ngcontent-%COMP%]{background:#fdecec;color:#e54848;font-weight:700;font-size:12px;padding:4px 8px;border-radius:6px;border:1px solid rgba(229,72,72,.15)}.type-select[_ngcontent-%COMP%]{position:relative}.q-type[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;border:1px solid #e9edf3;background:#fff;padding:6px 10px;border-radius:10px;font-weight:600;cursor:pointer}.q-type--error[_ngcontent-%COMP%]{border-color:#ef4444!important;background:#fff8f8!important;color:#dc2626;box-shadow:0 0 0 3px #ef44441f}.q-type[_ngcontent-%COMP%] .chev[_ngcontent-%COMP%]{width:14px;height:14px}.type-menu[_ngcontent-%COMP%]{position:absolute;top:110%;right:0;background:#fff;border:1px solid #e9edf3;border-radius:10px;box-shadow:0 10px 30px #0c142814;display:flex;flex-direction:column;min-width:190px;z-index:5;padding:6px}.type-item[_ngcontent-%COMP%]{text-align:left;background:#fff;border:none;padding:9px 12px;border-radius:8px;cursor:pointer}.type-item[_ngcontent-%COMP%]:hover{background:#f2f6ff}.q-sep[_ngcontent-%COMP%]{border:0;border-top:1px solid #f1f4f8;margin:12px 0}.field-label[_ngcontent-%COMP%]{font-size:12px;font-weight:700;color:#2c3b52;margin:4px 0 6px}.field-input[_ngcontent-%COMP%]{width:100%;border-radius:10px;border:1px solid #e9edf3;background:#f5f7fb;padding:12px 14px;color:#111827;font-size:14px}.field-input[_ngcontent-%COMP%]:hover{background:#f3f6ff}.field-input[_ngcontent-%COMP%]:focus{border-color:#16bf5e;box-shadow:0 0 0 3px #16bf5e26;background:#fff}.req-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-top:12px}.switch[_ngcontent-%COMP%]{position:relative;width:46px;height:26px}.switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{display:none}.slider[_ngcontent-%COMP%]{position:absolute;inset:0;background:#e6e9ef;border-radius:999px;transition:.2s}.slider[_ngcontent-%COMP%]:before{content:\"\";position:absolute;
1left:3px;top:3px;width:20px;height:20px;background:#fff;border-radius:50%;box-shadow:0 2px 6px #10182826;transition:.2s}.slider.red[_ngcontent-%COMP%]{background:#cbd5e1}.switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked + .slider.red[_ngcontent-%COMP%]{background:#fecaca}.switch[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked + .slider.red[_ngcontent-%COMP%]:before{transform:translate(20px);box-shadow:0 0 0 2px #ef444459}.stack[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;margin-top:12px}.opt-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.opt-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.opt-drag[_ngcontent-%COMP%]{color:#a8b1bd;cursor:grab}.add-opt[_ngcontent-%COMP%]{margin-top:6px}.section-actions[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}.subsections[_ngcontent-%COMP%]{margin-top:14px;display:flex;flex-direction:column;gap:12px}.subsec-card[_ngcontent-%COMP%]{border:1px solid #e6edf8;border-radius:12px;padding:12px;background:#f8fbff}.subsec-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.subsec-chip[_ngcontent-%COMP%]{background:#0ea5e9;color:#fff;font-weight:700;border-radius:999px;padding:4px 10px;font-size:12px}.sub-q[_ngcontent-%COMP%]{background:#ffffff}.q-help-editor[_ngcontent-%COMP%]{display:block}.row-action[_ngcontent-%COMP%]{width:100%;background:#fff;border:2px dashed #e8edf6;color:#0f1724;font-weight:700;padding:14px 16px;border-radius:10px;margin-top:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px}.row-action.secondary[_ngcontent-%COMP%]{border-style:solid;border-color:#d9e6fb;background:#f5f9ff}.row-action.tertiary[_ngcontent-%COMP%]{margin-top:10px;background:#ffffff;border-color:#dbe6f5}.row-action[_ngcontent-%COMP%] .plus[_ngcontent-%COMP%]{font-weight:900}.row-action[_ngcontent-%COMP%]:hover{background:#f9fbff}.builder-bar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:10px 0 50px}.builder-left[_ngcontent-%COMP%]{display:flex;gap:10px}.builder-right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.pill[_ngcontent-%COMP%]{padding:9px 14px;border-radius:999px;background:#fff;border:1px solid rgba(10,14,20,.06);color:#374151;font-weight:700;cursor:pointer;min-width:92px;text-align:center;box-shadow:0 6px 18px #0c142808;transition:transform .12s}.pill[_ngcontent-%COMP%]:hover{transform:translateY(-1px)}.pill-active[_ngcontent-%COMP%]{outline:2px solid rgba(37,99,235,.6);outline-offset:2px;border-color:#2563eb33;color:#0f172a}.status-txt[_ngcontent-%COMP%]{color:#6b7280;font-size:13px}.status-badge[_ngcontent-%COMP%]{background:#fff7dc;color:#7b5a00;padding:6px 10px;border-radius:8px;border:1px solid rgba(245,158,11,.18);font-weight:700;font-size:13px}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:10px;font-weight:700;cursor:pointer;border:1px solid transparent;transition:transform .12s,box-shadow .12s}.btn[_ngcontent-%COMP%]:hover{transform:translateY(-1px)}.btn.ghost[_ngcontent-%COMP%]{background:#fff;border:1px solid #e9edf3;color:#111827}.btn.primary[_ngcontent-%COMP%]{background:linear-gradient(180deg,#16bf5e,#16bf5e);color:#fff;border:1px solid rgba(10,14,20,.04);box-shadow:0 12px 34px #2563eb1a}.ico[_ngcontent-%COMP%]{width:16px;height:16px}html[_ngcontent-%COMP%]{scroll-behavior:smooth}.builder-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:300px 1fr;gap:18px;align-items:start;margin-top:18px}.sidebar[_ngcontent-%COMP%]{position:sticky;top:16px;align-self:start;background:#fff;border:1px solid #e9edf3;border-radius:12px;padding:12px;box-shadow:0 10px 26px #0f172a0d}.sidebar-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.sidebar-head[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:14px;font-weight:700}.side-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px;max-height:calc(100vh - 170px);overflow:auto;padding-right:2px}.side-item[_ngcontent-%COMP%]{display:grid;grid-template-columns:18px 28px 1fr auto;align-items:center;gap:8px;padding:8px;border:1px solid #eef2f7;border-radius:10px;background:#fafcff}.side-item[_ngcontent-%COMP%]:hover{background:#f7f9ff}.grip[_ngcontent-%COMP%]{color:#a8b1bd;cursor:grab;text-align:center;font-size:16px}.side-chip[_ngcontent-%COMP%]{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:10px;background:#16bf5e;color:#fff;font-weight:800;text-decoration:none}.side-input[_ngcontent-%COMP%]{border:1px solid #e9edf3;padding:8px 10px;border-radius:8px;width:100%;font-size:13px;background:#f6f8fc}.side-input[_ngcontent-%COMP%]:focus{outline:none;border-color:#16bf5e;box-shadow:0 0 0 3px #16bf5e26;background:#fff}.side-tools[_ngcontent-%COMP%]{display:inline-flex;gap:6px}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.tb2-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px}.tb2-title[_ngcontent-%COMP%]{font-size:20px;font-weight:700;margin:0 14px 0 0}.tb2-header__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.tb2-header__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.tb2-tabs[_ngcontent-%COMP%]{background:#fff;border:1px solid #e9edf3;padding:4px;border-radius:999px;display:flex;gap:4px}.tb2-tab[_ngcontent-%COMP%]{border:0;background:transparent;cursor:pointer;padding:8px 14px;font-weight:700;color:#475569;border-radius:999px}.tb2-tab[_ngcontent-%COMP%]:hover{background:#f1f5fe}.tb2-tab--active[_ngcontent-%COMP%]{background:#eef3ff;color:#0f172a;outline:2px solid rgba(22,191,94,.35);outline-offset:0}.tb2-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.tb2-status__label[_ngcontent-%COMP%]{color:#6b7280;font-size:13px}.tb2-status__badge[_ngcontent-%COMP%]{background:#fff7dc;color:#7b5a00;padding:6px 10px;border-radius:8px;border:1px solid rgba(245,158,11,.2);font-weight:700}[_nghost-%COMP%] .p-editor-container{border:1px solid #e9edf3;border-radius:10px;overflow:hidden}[_nghost-%COMP%] .p-editor-toolbar{border:0;border-bottom:1px solid #e9edf3;background:#f8fafc}[_nghost-%COMP%] .p-editor-content{border:0;background:#fff}[_nghost-%COMP%] .p-editor-content .ql-editor{min-height:110px;font-size:14px;color:#0f172a;word-break:break-word;overflow-wrap:break-word;white-space:pre-wrap;overflow-x:hidden}button[disabled][_ngcontent-%COMP%]{cursor:not-allowed;opacity:.6}.input--error[_ngcontent-%COMP%]{border-color:#ef4444!important;background:#fff8f8!important;box-shadow:0 0 0 3px #ef44441f!important}.editor--error[_ngcontent-%COMP%]{display:block;width:100%;border-radius:10px;outline:2px solid #ef4444;outline-offset:0;box-shadow:0 0 0 3px #ef44441a}.editor--error [_nghost-%COMP%] .p-editor-container{border-color:#ef4444}.field-error-msg[_ngcontent-%COMP%]{display:block;margin-top:4px;font-size:11.5px;color:#dc2626;font-weight:500}.field-error-msg--section[_ngcontent-%COMP%]{margin:4px 0 6px 12px}.field-error-msg--opt[_ngcontent-%COMP%]{margin:2px 0 2px 30px}.q-input-wrap[_ngcontent-%COMP%], .sec-title-wrap[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column}.q-list--warn[_ngcontent-%COMP%]{border:1.5px dashed #fbbf24;border-radius:10px;min-height:56px}.sec-no-q-banner[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#fffbeb;border-radius:8px;font-size:12.5px;font-weight:500;color:#92400e;margin:8px 0 4px}.sec-no-q-banner[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{flex-shrink:0;color:#d97706}.no-sections-warn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px 16px;background:#fffbeb;border:1px solid #fde68a;border-radius:8px;font-size:13px;font-weight:500;color:#92400e;margin:0 auto 16px;width:100%;max-width:520px}.no-sections-warn[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{flex-shrink:0;color:#d97706}.opt-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;border:1px solid transparent;border-radius:10px;transition:border-color .15s}.opt-item[_ngcontent-%COMP%]:hover{border-color:#e9edf3}.rule-toggle-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:6px 10px;border-radius:8px;border:1px solid #e9edf3;background:#f8fafc;color:#64748b;cursor:pointer;font-size:12px;font-weight:600;transition:all .15s;white-space:nowrap}.rule-toggle-btn[_ngcontent-%COMP%]:hover{background:#f0f4ff;border-color:#c7d7ff;color:#3b5bdb}.rule-toggle-btn--active[_ngcontent-%COMP%]{background:#eef3ff;border-color:#a5b4fc;color:#3730a3}.rule-toggle-btn--has-rules[_ngcontent-%COMP%]{background:#fdf4ff;border-color:#e9d5ff;color:#7c3aed}.rule-toggle-btn--active.rule-toggle-btn--has-rules[_ngcontent-%COMP%]{background:#ede9fe;border-color:#c4b5fd;color:#6d28d9}.rule-count-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;background:#7c3aed;color:#fff;border-radius:999px;font-size:10px;font-weight:800;padding:0 4px}.q-rule-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;background:#fdf4ff;border:1px solid #e9d5ff;color:#7c3aed;border-radius:999px;font-size:11px;font-weight:700}
1.rule-lock-bar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;background:#fff7ed;border:1px solid #fed7aa;border-radius:8px;padding:5px 10px;margin-bottom:8px;font-size:11px;font-weight:600;color:#c2410c}.rule-lock-bar[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{flex-shrink:0;stroke:#c2410c}.drag-handle--locked[_ngcontent-%COMP%]{cursor:not-allowed!important;opacity:.4}.rule-panel[_ngcontent-%COMP%]{margin:6px 0 4px;border:1px solid #e2d9f3;border-radius:12px;background:#faf7ff;overflow:hidden;animation:_ngcontent-%COMP%_ruleSlideIn .18s ease}@keyframes _ngcontent-%COMP%_ruleSlideIn{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}.rule-panel-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:linear-gradient(135deg,#ede9fe 0%,#f0f4ff 100%);border-bottom:1px solid #e2d9f3}.rule-panel-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px;font-size:12.5px;font-weight:700;color:#4c1d95}.rule-panel-title[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{stroke:#7c3aed}.rule-panel-title[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:normal;color:#6d28d9;background:#ede9fe;padding:1px 6px;border-radius:4px;font-weight:800}.rule-panel-close[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border:none;background:transparent;border-radius:6px;color:#7c3aed;cursor:pointer}.rule-panel-close[_ngcontent-%COMP%]:hover{background:#ddd6fe}.rule-empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:20px 18px 14px;color:#64748b;font-size:13px}.rule-empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;line-height:1.6;color:#64748b}.rule-empty-state[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#94a3b8;font-size:12px}.rule-item[_ngcontent-%COMP%]{padding:10px 14px;border-bottom:1px solid #ede9fe}.rule-item[_ngcontent-%COMP%]:last-of-type{border-bottom:none}.rule-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}.rule-connector[_ngcontent-%COMP%]{font-size:11px;font-weight:800;color:#7c3aed;text-transform:uppercase;letter-spacing:.06em;padding-bottom:6px;white-space:nowrap}.rule-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.rule-field-label[_ngcontent-%COMP%]{font-size:10px;font-weight:700;color:#6d28d9;text-transform:uppercase;letter-spacing:.05em}.rule-action-field[_ngcontent-%COMP%]{min-width:170px}.rule-target-field[_ngcontent-%COMP%]{flex:1;
1min-width:200px}.rule-extra-field[_ngcontent-%COMP%]{flex:1;min-width:160px}.rule-select[_ngcontent-%COMP%]{appearance:none;-webkit-appearance:none;background:#fff url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%237c3aed' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") no-repeat right 8px center/16px 16px;border:1px solid #ddd6fe;border-radius:8px;padding:7px 30px 7px 10px;font-size:12.5px;color:#1e1b4b;cursor:pointer;width:100%;transition:border-color .15s,box-shadow .15s}.rule-select[_ngcontent-%COMP%]:focus{outline:none;border-color:#7c3aed;box-shadow:0 0 0 3px #7c3aed26}.rule-target-select[_ngcontent-%COMP%]{font-size:12px}.rule-input[_ngcontent-%COMP%]{width:100%;padding:7px 10px;border:1px solid #ddd6fe;border-radius:8px;background:#fff;font-size:12.5px;color:#1e1b4b;transition:border-color .15s,box-shadow .15s}.rule-input[_ngcontent-%COMP%]::placeholder{color:#a5b4fc}.rule-input[_ngcontent-%COMP%]:focus{outline:none;border-color:#7c3aed;box-shadow:0 0 0 3px #7c3aed26;background:#fff}.rule-del-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid #fecaca;border-radius:7px;background:#fff;color:#ef4444;cursor:pointer;flex-shrink:0;margin-bottom:0;align-self:flex-end;transition:background .12s,border-color .12s}.rule-del-btn[_ngcontent-%COMP%]:hover{background:#fee2e2;border-color:#ef4444}[_nghost-%COMP%] .rule-modal-dialog .p-dialog{border-radius:16px;box-shadow:0 24px 64px #0f172a2e;border:1px solid #e2d9f3}[_nghost-%COMP%] .rule-modal-dialog .p-dialog-header{padding:0;border-bottom:1px solid #e2d9f3;background:linear-gradient(135deg,#ede9fe 0%,#eef2ff 100%);position:relative}[_nghost-%COMP%] .rule-modal-dialog .p-dialog-content{padding:0;background:#faf9ff;overflow:visible}[_nghost-%COMP%] .rule-modal-dialog .p-dialog-footer{display:none}.rmd-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:14px;padding:16px 52px 16px 20px;width:100%;position:relative}.rmd-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:42px;height:42px;background:#7c3aed;border-radius:12px;flex-shrink:0}.rmd-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{stroke:#fff}.rmd-meta[_ngcontent-%COMP%]{flex:1;min-width:0}.rmd-pretitle[_ngcontent-%COMP%]{font-size:11px;font-weight:700;color:#6d28d9;text-transform:uppercase;letter-spacing:.07em;margin-bottom:2px}.rmd-title[_ngcontent-%COMP%]{font-size:15px;font-weight:700;color:#1e1b4b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rmd-close-abs[_ngcontent-%COMP%]{position:absolute;top:12px;right:14px;background:transparent;border:none;color:#9ca3af;cursor:pointer;padding:5px;border-radius:5px;display:flex;align-items:center;justify-content:center;z-index:10;line-height:1;transition:color .15s}.rmd-close-abs[_ngcontent-%COMP%]:hover{color:#1f2937}.rmd-body[_ngcontent-%COMP%]{padding:16px 20px 20px;display:flex;flex-direction:column;gap:12px;max-height:calc(80vh - 72px);min-height:60px;overflow-y:auto;overflow-x:hidden;box-sizing:border-box}.rmd-body[_ngcontent-%COMP%]::-webkit-scrollbar{width:5px}.rmd-body[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#f5f3ff;border-radius:4px}.rmd-body[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#c4b5fd;border-radius:4px}.rmd-body[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#7c3aed}.rmd-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;padding:28px 20px}.rmd-empty-title[_ngcontent-%COMP%]{font-size:15px;font-weight:700;color:#1e1b4b;margin:0}.rmd-empty-sub[_ngcontent-%COMP%]{font-size:13px;color:#64748b;line-height:1.6;margin:0}.rmd-empty-sub[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#4c1d95}.rmd-rule-card[_ngcontent-%COMP%]{background:#fff;border:1px solid #e2d9f3;border-radius:12px;box-shadow:0 2px 8px #6d28d90d}.rmd-rule-num[_ngcontent-%COMP%]{font-size:11px;font-weight:800;color:#6d28d9;text-transform:uppercase;letter-spacing:.06em}
1.rmd-rule-del[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;border:1px solid #fecaca;border-radius:7px;padding:4px 10px;background:#fff;color:#ef4444;font-size:11.5px;font-weight:600;cursor:pointer;transition:all .12s}.rmd-rule-del[_ngcontent-%COMP%]:hover{background:#fee2e2;border-color:#ef4444}.rmd-rule-save[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;border:1px solid #86efac;border-radius:7px;padding:4px 10px;background:#f0fdf4;color:#16a34a;font-size:11.5px;font-weight:600;cursor:pointer;transition:all .12s}.rmd-rule-save[_ngcontent-%COMP%]:hover:not([disabled]){background:#dcfce7;border-color:#4ade80}.rmd-rule-save[disabled][_ngcontent-%COMP%]{opacity:.45;cursor:not-allowed}.rmd-rule-head-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex-shrink:0}.rmd-unsaved-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;background:#fff7ed;border:1px solid #fed7aa;color:#c2410c;font-size:10.5px;font-weight:700;margin-left:4px}.rmd-rule-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:12px 16px}.rmd-main-row[_ngcontent-%COMP%]{display:flex;gap:10px;flex-wrap:nowrap;width:100%}.rmd-then[_ngcontent-%COMP%]{font-size:11px;font-weight:800;color:#7c3aed;text-transform:uppercase;letter-spacing:.07em;white-space:nowrap;flex-shrink:0;padding-bottom:9px;display:flex;align-items:center}.rmd-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;min-width:0;flex-shrink:0}.rmd-field--grow[_ngcontent-%COMP%]{flex:1 1 0;min-width:0}.rmd-field--mandatory[_ngcontent-%COMP%]{flex-direction:column;gap:4px;min-width:80px;flex-shrink:0}.rmd-field-hint--block[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;font-size:11px;color:#ef4444}.rmd-label[_ngcontent-%COMP%]{font-size:10.5px;font-weight:700;color:#6d28d9;text-transform:uppercase;letter-spacing:.05em}.rmd-scope-hint[_ngcontent-%COMP%]{font-size:9px;font-weight:500;color:#a5b4fc;text-transform:none;letter-spacing:0}.rmd-req-star[_ngcontent-%COMP%]{color:#e11d48;margin-left:3px}.rmd-field-hint[_ngcontent-%COMP%]{font-size:11px;color:#ef4444;margin-top:2px}.rmd-select[_ngcontent-%COMP%]{appearance:none;-webkit-appearance:none;background-color:#fff;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%237c3aed' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:right 9px center;background-size:16px 16px;border:1.5px solid #ddd6fe;border-radius:9px;padding:8px 32px 8px 11px;font-size:13px;color:#1e1b4b;cursor:pointer;width:100%;min-width:0;box-sizing:border-box;transition:border-color .15s,box-shadow .15s}.rmd-select[_ngcontent-%COMP%]:focus{outline:none;border-color:#7c3aed;box-shadow:0 0 0 3px #7c3aed26}.rmd-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{background:#ffffff;color:#1e1b4b}.rmd-select--target[_ngcontent-%COMP%]{font-size:12.5px}.rmd-input[_ngcontent-%COMP%]{width:100%;min-width:0;box-sizing:border-box;padding:8px 11px;border:1.5px solid #ddd6fe;border-radius:9px;font-size:13px;color:#1e1b4b;background:#ffffff;transition:border-color .15s,box-shadow .15s}.rmd-input[_ngcontent-%COMP%]::placeholder{color:#a5b4fc}.rmd-input[_ngcontent-%COMP%]:focus{outline:none;border-color:#7c3aed;box-shadow:0 0 0 3px #7c3aed26}.rmd-action-info[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:5px;font-size:11.5px;color:#4338ca;background:#eef2ff;border:1px solid #c7d2fe;border-radius:7px;padding:6px 10px;line-height:1.5;margin-top:4px;width:100%}.rmd-action-info[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{stroke:#4338ca;flex-shrink:0;margin-top:2px}.rmd-action-info--warn[_ngcontent-%COMP%]{color:#92400e;background:#fffbeb;border-color:#fde68a}.rmd-action-info--warn[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{stroke:#92400e}.rmd-mandatory-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px;height:34px}.rmd-required-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:8px 12px;background:#f5f3ff;border:1px solid #ede9fe;border-radius:8px}.rmd-required-label[_ngcontent-%COMP%]{font-size:12px;font-weight:700;color:#4c1d95;white-space:nowrap}.rmd-mandatory-text[_ngcontent-%COMP%]{font-size:12px;color:#64748b;font-weight:500}.rmd-mandatory-text--on[_ngcontent-%COMP%]{color:#dc2626;font-weight:600}.rmd-followup-preview[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;font-size:11.5px;color:#6d28d9;background:#f5f3ff;border:1px solid #ddd6fe;border-radius:7px;padding:6px 10px;margin-top:4px;width:100%}.rmd-followup-preview[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{stroke:#7c3aed;flex-shrink:0}.rmd-followup-preview[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:700}.rmd-mandatory-badge[_ngcontent-%COMP%]{display:inline-block;background:#fef2f2;color:#dc2626;border:1px solid #fecaca;border-radius:999px;padding:1px 7px;font-size:10px;font-weight:700;margin-left:4px;vertical-align:middle}.rmd-no-q-warn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#fffbeb;border:1px solid #fde68a;border-radius:10px;font-size:12.5px;color:#92400e}.rmd-no-q-warn[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{stroke:#d97706;flex-shrink:0}.rmd-add-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:11px 18px;border:2px dashed #a5b4fc;border-radius:10px;background:transparent;color:#4338ca;font-size:13px;font-weight:700;cursor:pointer;width:100%;justify-content:center;transition:all .15s}.rmd-add-btn[_ngcontent-%COMP%]:hover{background:#eef2ff;border-color:#6366f1;border-style:solid}.rmd-add-btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.rmd-add-btn[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{stroke:#6366f1}.rmd-filter-bar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding-bottom:10px;border-bottom:1px solid #ede9fe;margin-bottom:4px}.rmd-filter-label[_ngcontent-%COMP%]{font-size:11px;font-weight:700;color:#6d28d9;text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;flex-shrink:0}.rmd-filter-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:4px 12px;border:1.5px solid #e2d9f3;border-radius:999px;background:#fff;color:#4c1d95;font-size:12px;font-weight:600;cursor:pointer;transition:all .12s}.rmd-filter-chip[_ngcontent-%COMP%]:hover{background:#f5f3ff;border-color:#a78bfa}.rmd-filter-chip--active[_ngcontent-%COMP%]{background:#7c3aed;border-color:#7c3aed;color:#fff}.rmd-filter-chip--active[_ngcontent-%COMP%]:hover{background:#6d28d9;border-color:#6d28d9;color:#fff}.rmd-filter-chip--active[_ngcontent-%COMP%] .rmd-filter-count[_ngcontent-%COMP%]{background:rgba(255,255,255,.25);color:#fff}.rmd-filter-count[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:16px;background:#ede9fe;color:#6d28d9;border-radius:999px;font-size:10px;font-weight:800;padding:0 4px}.rmd-rule-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:linear-gradient(90deg,#f5f3ff,#eef2ff);border-bottom:1px solid #e2d9f3;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .15s}.rmd-rule-head[_ngcontent-%COMP%]:hover{background:linear-gradient(90deg,#ede9fe,#e0e7ff)}.rmd-rule-card--collapsed[_ngcontent-%COMP%] .rmd-rule-head[_ngcontent-%COMP%]{border-bottom:none;border-radius:12px}.rmd-rule-head-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.rmd-rule-chevron[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:6px;background:rgba(124,58,237,.1);flex-shrink:0;transition:transform .2s}.rmd-rule-chevron[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{stroke:#7c3aed}.rmd-rule-chevron--open[_ngcontent-%COMP%]{transform:rotate(0)}.rmd-rule-chevron[_ngcontent-%COMP%]:not(.rmd-rule-chevron--open){transform:rotate(-90deg)}.rmd-rule-summary[_ngcontent-%COMP%]{font-size:12px;color:#4c1d95;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:300px}.rmd-rule-summary[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#4c1d95}.rmd-rule-summary--empty[_ngcontent-%COMP%]{color:#94a3b8;font-style:italic;font-weight:400}
1.rmd-summary-req[_ngcontent-%COMP%]{font-size:11px;color:#dc2626;font-weight:600;margin-left:4px}.rmd-summary-when[_ngcontent-%COMP%]{font-size:11.5px;color:#6d28d9;font-weight:500;margin-left:4px}.rmd-summary-when[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:700}.rule-scope-hint[_ngcontent-%COMP%]{color:#a5b4fc;font-weight:500;font-size:9px;text-transform:none;letter-spacing:0;margin-left:2px}[_nghost-%COMP%] .tb-confirm-dialog .p-dialog{border-radius:14px;box-shadow:0 20px 60px #0000002e;overflow:hidden}[_nghost-%COMP%] .tb-confirm-dialog .p-dialog-header{padding:20px 24px 16px;border-bottom:1px solid #f1f5f9;background:#fff}[_nghost-%COMP%] .tb-confirm-dialog .p-dialog-content{padding:0 24px 4px;background:#fff}[_nghost-%COMP%] .tb-confirm-dialog .p-dialog-footer{padding:16px 24px 20px;border-top:1px solid #f1f5f9;background:#fff}.tb-dialog-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;width:100%}.tb-dialog-header__icon[_ngcontent-%COMP%]{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tb-dialog-header__icon--danger[_ngcontent-%COMP%]{background:#fef2f2;color:#ef4444}.tb-dialog-header__icon--warn[_ngcontent-%COMP%]{background:#fffbeb;color:#d97706}.tb-dialog-header__title[_ngcontent-%COMP%]{font-size:15px;font-weight:700;color:#0f172a}.tb-dialog-body[_ngcontent-%COMP%]{margin:12px 0 8px;font-size:14px;color:#475569;line-height:1.6}.tb-dialog-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:nowrap}.tb-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;padding:9px 18px;border-radius:8px;font-size:13.5px;font-weight:600;cursor:pointer;border:1.5px solid transparent;white-space:nowrap;transition:background .15s,box-shadow .15s}.tb-btn--ghost[_ngcontent-%COMP%]{background:#f8fafc;border-color:#e2e8f0;color:#475569}.tb-btn--ghost[_ngcontent-%COMP%]:hover{background:#f1f5f9}.tb-btn--primary[_ngcontent-%COMP%]{background:#16bf5e;border-color:#16bf5e;color:#fff}.tb-btn--primary[_ngcontent-%COMP%]:hover{background:#13a852;border-color:#13a852}.tb-btn--danger[_ngcontent-%COMP%]{background:#ef4444;border-color:#ef4444;color:#fff}.tb-btn--danger[_ngcontent-%COMP%]:hover{background:#dc2626;border-color:#dc2626}.tb-btn--outline-danger[_ngcontent-%COMP%]{background:transparent;border-color:#ef4444;color:#ef4444}.tb-btn--outline-danger[_ngcontent-%COMP%]:hover{background:#fef2f2}"]}),s})();var Ss=x(72986),Is=x(80013),Us=x(75778),Te=x(2994);let Fs=(()=>{const a=class{constructor(t,n){this.http=t,this.loki=n,this.dpiaBasePath="/dpia"}getMyAssessments(t,n,i=1,r=10,l=""){let c=(new D.LE).set("page",i.toString()).set("limit",r.toString());return l?.trim()&&(c=c.set("search",l.trim())),this.http.post(`${b.N.keyStoneUrl}${this.dpiaBasePath}/assesment/get-all-assesments/${t}`,{email:n},{params:c}).pipe((0,T.K)(d=>(0,k._)(d)))}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(D.eN),e.LFG(ee.L))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),s})();const Qs=[{key:"name",label:"Assessment Name",columnType:"Text"},{key:"template_title",label:"Template",columnType:"Text"},{key:"assignee_email",label:"Assignee",columnType:"Text"},{key:"status",label:"Status",columnType:"Status"},{key:"created_at",label:"Created",columnType:"Date"},{key:"response",label:"View Response",columnType:"ViewResponse"},{key:"review",label:"Review",columnType:"Review"}];let Ds=(()=>{const a=class extends te.a{constructor(){super({oid:"",pid:"",assessments:[],totalRecords:0,currentPage:1,pageSize:10,searchText:"",columnList:Qs})}};let s=a;return a.\u0275fac=function(n){return new(n||a)},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),s})(),ye=(()=>{const a=class{constructor(t,n,i,r,l,c){this.activatedRouter=t,this.myAssessmentsApiService=n,this.myAssessmentsStateService=i,this.router=r,this.titleService=l,this.userService=c,this.searchSubject=new oe.xQ,this.currentEmail=""}init(){this.titleService.setTitle("My Assessments - "+b.N.portalPrefix),this.activatedRouter.queryParams.pipe((0,B.w)(t=>(this.myAssessmentsStateService.updateState({oid:t.oid,pid:t.pid}),this.userService.getLoggedInUserDetails("MyAssessmentsActionService","MyAssessments").pipe((0,Ss.q)(1)))),(0,B.w)(t=>(this.currentEmail=t?.response?.email||t?.email||"",this.refreshList()))).subscribe(),this.initializeSearch()}initializeSearch(){this.searchSubject.pipe((0,Is.b)(500),(0,Us.x)(),(0,Te.b)(t=>{this.myAssessmentsStateService.updateState({searchText:t,currentPage:1})}),(0,B.w)(()=>this.refreshList())).subscribe()}refreshList(){const t=this.myAssessmentsStateService.getState();return this.myAssessmentsApiService.getMyAssessments(t.oid,this.currentEmail,t.currentPage,t.pageSize,t.searchText).pipe((0,Te.b)(n=>this.applyResponseToState(n)))}applyResponseToState(t){const n=t?.assessments||[];this.myAssessmentsStateService.updateState({assessments:n,totalRecords:t?.total??n.length})}onSearch(t){this.searchSubject.next(t)}loadPage(t,n){this.myAssessmentsStateService.updateState({currentPage:t,pageSize:n}),this.refreshList().subscribe()}getState(){return this.myAssessmentsStateService.getState()}getStateObs(){return this.myAssessmentsStateService.getStateObs()}navigate(t,n){const i=this.myAssessmentsStateService.getState();this.router.navigate([t,n.id||n._id||n.assessment_id||"mock"],{queryParams:{oid:i.oid,pid:i.pid}})}viewTemplate(t){this.navigate("/assessment/response",t)}viewDpoReview(t){this.navigate("/assessment/dpo-review",t)}viewUserReview(t){this.navigate("/assessment/user-review",t)}openFillLink(t){const n=t.unique_link;n&&window.open(n,"_blank")}ngOnDestroy(){this.myAssessmentsStateService.updateState({currentPage:1,pageSize:10,searchText:"",totalRecords:0,assessments:[]}),this.searchSubject?.complete()}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(y.gz),e.LFG
1(Fs),e.LFG(Ds),e.LFG(y.F0),e.LFG(N.Dx),e.LFG(_e.KD))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac}),s})();function Ns(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",17)(1,"h5",18),e._uU(2,"My Assessments"),e.qZA(),e.TgZ(3,"span",19),e._UZ(4,"i",20),e.TgZ(5,"input",21),e.NdJ("input",function(n){e.CHM(o);const i=e.oxw(2);return e.KtG(i.onSearch(n))}),e.qZA()()()}}function Js(s,a){1&s&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Assessment Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Assignee"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"Status"),e.qZA(),e.TgZ(7,"th"),e._uU(8,"Created"),e.qZA(),e.TgZ(9,"th",22),e._uU(10,"View Response"),e.qZA(),e.TgZ(11,"th",22),e._uU(12,"Review"),e.qZA()())}function Rs(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"tr")(1,"td",23)(2,"span",24),e._uU(3),e.qZA()(),e.TgZ(4,"td",25)(5,"span",26)(6,"span",27),e._uU(7),e.qZA(),e._uU(8),e.qZA()(),e.TgZ(9,"td",28)(10,"span",29),e._UZ(11,"i",30),e._uU(12),e.qZA()(),e.TgZ(13,"td",31),e._uU(14),e.ALo(15,"date"),e.qZA(),e.TgZ(16,"td",32)(17,"button",33),e.NdJ("click",function(){const i=e.CHM(o).$implicit,r=e.oxw(2);return e.KtG(r.viewTemplate(i))}),e._UZ(18,"i",34),e.TgZ(19,"span"),e._uU(20,"View"),e.qZA()()(),e.TgZ(21,"td",32)(22,"button",35),e.NdJ("click",function(){const i=e.CHM(o).$implicit,r=e.oxw(2);return e.KtG(r.viewDpoReview(i))}),e._UZ(23,"i",36),e.TgZ(24,"span"),e._uU(25,"Review"),e.qZA()()()()}if(2&s){const o=a.$implicit,t=e.oxw(2);e.xp6(3),e.Oqu(o.name||o.assessment_name||"\u2014"),e.xp6(4),e.Oqu((o.assignee_email||o.email||"?")[0].toUpperCase()),e.xp6(1),e.hij(" ",o.assignee_email||o.email||"\u2014"," "),e.xp6(2),e.Q6J("ngClass",t.statusClass(o.status)),e.xp6(1),e.Q6J("ngClass",t.statusIcon(o.status)),e.xp6(1),e.hij(" ",o.status||"\u2014"," "),e.xp6(2),e.hij(" ",e.xi3(15,7,o.created_at||o.submitted_at,"MMM d, y")," ")}}function $s(s,a){1&s&&(e.TgZ(0,"tr")(1,"td",37),e._UZ(2,"i",38),e.TgZ(3,"p",39),e._uU(4," No assessments found. "),e.qZA()()())}function Bs(s,a){if(1&s&&(e.TgZ(0,"div",40),e._uU(1),e.qZA()),2&s){const o=e.oxw().ngIf;e.xp6(1),e.hij(" In total there are ",o.totalRecords||0," assessments. ")}}const Ys=function(s,a){return{oid:s,pid:a}},Es=function(){return[10,20,50,100]};function js(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",1),e._UZ(1,"p-toast",2),e.TgZ(2,"div",3)(3,"nav",4)(4,"ol",5)(5,"li",6)(6,"a",7),e._uU(7,"Home"),e.qZA()(),e.TgZ(8,"li",8),e._uU(9,"My Assessments"),e.qZA()()()(),e.TgZ(10,"div",9)(11,"p-table",10,11),e.NdJ("onPage",function(n){e.CHM(o);const i=e.oxw();return e.KtG(i.onPageChange(n))}),e.YNc(13,Ns,6,0,"ng-template",12),e.YNc(14,Js,13,0,"ng-template",13),e.YNc(15,Rs,26,10,"ng-template",14),e.YNc(16,$s,5,0,"ng-template",15),e.YNc(17,Bs,2,1,"ng-template",16),e.qZA()()()}if(2&s){const o=a.ngIf;e.xp6(6),e.Q6J("queryParams",e.WLB(10,Ys,o.oid,o.pid)),e.xp6(5),e.Q6J("value",o.assessments)("lazy",!0)("paginator",!0)("rows",o.pageSize)("totalRecords",o.totalRecords)("rowsPerPageOptions",e.DdM(13,Es))("paginatorDropdownAppendTo","body")("showCurrentPageReport",!0)("rowHover",!0)}}let zs=(()=>{const a=class{constructor(t){this.svc=t,this.stateObs=this.svc.getStateObs()}ngOnInit(){this.svc.init()}ngOnDestroy(){this.svc.ngOnDestroy()}onPageChange(t){const n=Math.floor(t.first/t.rows)+1;this.svc.loadPage(n,t.rows)}onSearch(t){this.svc.onSearch(t.target.value)}viewTemplate(t){this.svc.viewTemplate(t)}viewDpoReview(t){this.svc.viewDpoReview(t)}viewUserReview(t){this.svc.viewUserReview(t)}openFillLink(t){this.svc.openFillLink(t)}statusClass(t){switch((t||"").toLowerCase()){case"submitted":return"ma-chip--submitted";case"approved":case"completed":return"ma-chip--approved";case"rejected":case"expired":return"ma-chip--rejected";default:return"ma-chip--pending"}}statusIcon(t){switch((t||"").toLowerCase()){case"approved":case"completed":return"pi-check-circle";case"rejected":case"expired":return"pi-times-circle";case"submitted":return"pi-send";default:return"pi-clock"}}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.Y36(ye))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-my-assessments-page"]],features:[e._Bn([ye])],decls:2,vars:3,consts:[["class","ma-page",4,"ngIf"],[1,"ma-page"],["position","bottom-right"],[1,"ma-page-header"],["aria-label","breadcrumb"],[1,"breadcrumb","breadcrumb-style1","mg-b-10"],[1,"breadcrumb-item"],["routerLink","/home/welcome",3,"queryParams"],[1,"breadcrumb-item","active"],[1,"ma-card"],["currentPageReportTemplate","Showing {first} to {last} of {totalRecords} assessments","dataKey","id",3,"value","lazy","paginator","rows","totalRecords","rowsPerPageOptions","paginatorDropdownAppendTo","showCurrentPageReport","rowHover","onPage"],["dt",""],["pTemplate","caption"],["pTemplate","header"],["pTemplate","body"],["pTemplate","emptymessage"],["pTemplate","summary"],[1,"pp-flex","align-items-center","justify-content-between"],[1,"m-0"],[1,"p-input-icon-left"],[1,"pi","pi-search"],["pInputText","","type","text","placeholder","Search assessments\u2026",3,"input"],[1,"ma-th-center"],[1,"ma-td-name"],[1,"ma-name"],[1,"ma-td-text"],[1,"ma-assignee"],[1,"ma-avatar"],[1,"ma-td-status"],[1,"ma-chip",3,"ngClass"],[1,"pi",3,"ngClass"],[1,"ma-td-date"],[1,"ma-td-action"],["type","button","title","View submitted responses",1,"ma-btn","ma-btn--ghost",3,"click"],[1,"pi","pi-eye"],["type","button","title","Review",1,"ma-btn","ma-btn--primary",3,"click"],[1,"pi","pi-shield"],["colspan","6",2,"text-align","center","padding","48px 20px"],[1,"pi","pi-inbox","ma-empty__icon"],[2,"color","#94a3b8","font-size","13.5px","margin","0"],[1,"flex","align-items-center","justify-content-between"]],template:function(n,i){1&n&&(e.YNc(0,js,18,14,"div",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,i.stateObs))},dependencies:[v.mk,v.O5,y.rH,J.iA,Q.jx,H.o,z.FN,v.Ov,v.uU],styles:['@charset "UTF-8";.ma-page[_ngcontent-%COMP%]{background:#f6f8fb;min-height:100vh;padding:20px 0 60px;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:13px;color:#0f172a}.ma-page-header[_ngcontent-%COMP%]{width:min(1440px,100% - 32px);margin:0 auto 20px;display:flex;align-items:flex-end;justify-content:space-between;gap:16px}.ma-title[_ngcontent-%COMP%]{font-size:20px;font-weight:700;color:#0f172a;margin:4px 0 2px;line-height:1.3}.ma-subtitle[_ngcontent-%COMP%]{font-size:12.5px;color:#64748b;margin:0}.ma-total-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:5px 14px;background:#fff;border:1px solid #e9edf3;border-radius:999px;font-size:12.5px;font-weight:600;color:#374151;white-space:nowrap}.ma-card[_ngcontent-%COMP%]{width:min(1440px,100% - 32px);margin:0 auto;background:#fff;border:1px solid #e9edf3;border-radius:14px;overflow:hidden;box-shadow:0 2px 12px #0c14280d}.ma-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;padding:14px 20px;border-bottom:1px solid #f1f5f9}.ma-search-wrap[_ngcontent-%COMP%]{position:relative;width:280px}.ma-search-icon[_ngcontent-%COMP%]{position:absolute;
1left:10px;top:50%;transform:translateY(-50%);font-size:13px;color:#94a3b8;pointer-events:none}.ma-search[_ngcontent-%COMP%]{width:100%;border:1px solid #e9edf3;border-radius:8px;padding:7px 12px 7px 32px;font-size:13px;color:#0f172a;background:#f8fafc;transition:border-color .15s,box-shadow .15s;outline:none;font-family:inherit}.ma-search[_ngcontent-%COMP%]:focus{border-color:#6b8cff;background:#fff;box-shadow:0 0 0 3px #6875f51a}.ma-search[_ngcontent-%COMP%]::placeholder{color:#94a3b8}.ma-table-wrap[_ngcontent-%COMP%]{overflow-x:auto}.ma-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:13px}.ma-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background:#f8fafc;border-bottom:1px solid #e9edf3}.ma-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:11px 16px;font-size:11.5px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#64748b;text-align:left;white-space:nowrap}.ma-table[_ngcontent-%COMP%] .ma-th-center[_ngcontent-%COMP%]{text-align:center}.ma-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border-bottom:1px solid #f1f5f9;transition:background .12s}.ma-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child{border-bottom:none}.ma-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:#fafbfd}.ma-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:12px 16px;vertical-align:middle}.ma-td-name[_ngcontent-%COMP%]{max-width:220px}.ma-td-template[_ngcontent-%COMP%]{max-width:180px}.ma-td-text[_ngcontent-%COMP%]{max-width:200px}.ma-td-date[_ngcontent-%COMP%]{white-space:nowrap;color:#64748b;font-size:12.5px}.ma-td-status[_ngcontent-%COMP%]{white-space:nowrap}.ma-td-action[_ngcontent-%COMP%]{text-align:center;white-space:nowrap}.ma-name[_ngcontent-%COMP%]{font-weight:600;color:#0f172a;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.ma-template[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;color:#475569;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ma-template[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:11px;color:#94a3b8;flex-shrink:0}.ma-assignee[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px;font-size:12.5px;color:#374151;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ma-avatar[_ngcontent-%COMP%]{width:24px;height:24px;border-radius:50%;background:#e0f2fe;color:#0369a1;font-size:10px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.ma-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;font-size:11.5px;font-weight:600;white-space:nowrap}.ma-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:10px}.ma-chip--submitted[_ngcontent-%COMP%]{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}.ma-chip--approved[_ngcontent-%COMP%]{background:#f0fdf4;color:#166534;border:1px solid #bbf7d0}.ma-chip--rejected[_ngcontent-%COMP%]{background:#fff1f2;color:#be123c;border:1px solid #fecdd3}.ma-chip--pending[_ngcontent-%COMP%]{background:#fffbeb;color:#b45309;border:1px solid #fde68a}.ma-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:5px 12px;border-radius:7px;font-size:12px;font-weight:600;cursor:pointer;border:1px solid transparent;transition:all .15s;font-family:inherit}.ma-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:11px}.ma-btn--ghost[_ngcontent-%COMP%]{background:#fff;border-color:#e9edf3;color:#374151}.ma-btn--ghost[_ngcontent-%COMP%]:hover{background:#f8fafc;border-color:#c8d0df}.ma-btn--primary[_ngcontent-%COMP%]{background:#fff;border-color:#c7d7fd;color:#3b5bdb}.ma-btn--primary[_ngcontent-%COMP%]:hover{background:#eff3ff;border-color:#748ffc}.ma-empty[_ngcontent-%COMP%]{text-align:center;padding:48px 20px;vertical-align:middle!important}.ma-empty__icon[_ngcontent-%COMP%]{font-size:36px;color:#cbd5e1;display:block;margin-bottom:10px}.ma-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#94a3b8;font-size:13.5px;margin:0} .ma-card .p-datatable-emptymessage td, .ma-card td.ma-empty{text-align:center!important;padding:48px 20px!important;vertical-align:middle!important} .ma-card .p-paginator .p-dropdown-panel{z-index:9999!important}']}),s})(),Ls=(()=>{const a=class{constructor(t){this.http=t,this.base="/dpia"}getSubmission(t,n){return this.http.get(`${b.N.keyStoneUrl}${this.base}/assesment/submission/${t}/${n}`).pipe((0,T.K)(i=>
1(0,k._)(()=>i)))}getTemplate(t,n){return this.http.get(`${b.N.keyStoneUrl}${this.base}/get-template/${t}/${n}`).pipe((0,T.K)(i=>(0,k._)(()=>i)))}resubmit(t,n,i){return this.http.put(`${b.N.keyStoneUrl}${this.base}/assesment/resubmit/${t}/${n}`,i).pipe((0,T.K)(r=>(0,k._)(()=>r)))}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(D.eN))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),s})(),ke=(()=>{const a=class{constructor(t,n,i,r){this.route=t,this.router=n,this.titleService=i,this.api=r,this._state$=new se.X({oid:"",pid:"",assessmentId:"",assessmentName:"",assigneeEmail:"",status:"",submittedAt:"",templateTitle:"",sections:[],loading:!0}),this.state$=this._state$.asObservable()}init(){this.titleService.setTitle("Assessment Response - "+b.N.portalPrefix),this.route.queryParams.subscribe(t=>{const n=t.oid||"",i=t.pid||"";this.route.params.subscribe(r=>{const l=r.id||"";this._state$.next({...this._state$.getValue(),oid:n,pid:i,assessmentId:l,loading:!0}),this.api.getSubmission(n,l).subscribe({next:c=>{const d=this.mapSections(c.sections);this._state$.next({...this._state$.getValue(),oid:n,pid:i,assessmentId:l,assessmentName:c.assessment_name,assigneeEmail:c.assignee_email,status:c.status,submittedAt:c.submitted_at,templateTitle:c.template_title,sections:d,loading:!1})},error:()=>{this._state$.next({...this._state$.getValue(),loading:!1})}})})})}mapSections(t){return[...t||[]].sort((i,r)=>(i.order??i.number??0)-(r.order??r.number??0)).map(i=>{const r=this.buildRuleContextMap(i);return{section_no:i.number??i.section_no,section_title:i.title??i.section_title,direct_items:[...i.questions||[]].sort((l,c)=>(l.order??0)-(c.order??0)).reduce((l,c)=>l.concat(this.mapQuestion(c,i.number??i.section_no,i.title??i.section_title,void 0,void 0,r)),[]),sub_sections:[...i.sub_sections||[]].sort((l,c)=>(l.order??l.number??0)-(c.order??c.number??0)).map(l=>({sub_section_no:l.number??l.sub_section_no,sub_section_title:l.title??l.sub_section_title,items:[...l.questions||[]].sort((c,d)=>(c.order??0)-(d.order??0)).reduce((c,d)=>c.concat(this.mapQuestion(d,i.number??i.section_no,i.title??i.section_title,l.number??l.sub_section_no,l.title??l.sub_section_title,r)),[])}))}})}mapQuestion(t,n,i,r,l,c){const d=t.uid||t.id||t.question_id||"",p=(t.options||[]).map(g=>"string"==typeof g?g:g.value),_={uid:d,answer:t.answer??null,question_text:t.question_text,question_type:this.normalizeType(t.question_type),question_no:t.question_no,options:p,is_mandatory:!!t.is_mandatory,help_text:t.help_text||"",section_no:n,section_title:i,sub_section_no:r,sub_section_title:l,is_followup:!1};if(c){const g=c.get(d);g&&(_.rule_context=g)}const u=[_];return Object.entries(t.rule_answers||{}).forEach(([g,C])=>{if(null==C||""===C)return;let O="Follow-up",Z="";for(const h of t.options||[]){const w=h,P=(w.rules||[]).find(E=>E.id===g&&"show_followup"===E.action);if(P){O=P.followup_label||O,Z=w.value||"";break}}u.push({uid:g,answer:C,question_text:O,question_type:"short_text",question_no:t.question_no,options:[],is_mandatory:!1,section_no:n,section_title:i,sub_section_no:r,sub_section_title:l,is_followup:!0,followup_label:O,triggered_by:Z})}),u}normalizeType(t){return t&&"text"!==t&&"free_text"!==t?"mcq"===t?"radio":t:"short_text"}getState(){return this._state$.getValue()}buildRuleContextMap(t){const n=new Map;return[...t.questions||[],...(t.sub_sections||[]).reduce((r,l)=>
1r.concat(l.questions||[]),[])].forEach(r=>{const l=r.answer,c=new Set(Array.isArray(l)?l.map(String):null!=l&&""!==l?[String(l)]:[]);(r.options||[]).forEach(d=>{const p="string"==typeof d?d:d.value,_="object"==typeof d&&d.rules||[],u=c.has(p);_.forEach(m=>{const g=m.target_question_id;!g||n.has(g)||("hide_question"===m.action&&u?n.set(g,{action:"hide_question",parent_question_no:r.question_no,triggering_option:p,parent_question_text:r.question_text}):"show_question"===m.action&&!u&&n.set(g,{action:"show_question",parent_question_no:r.question_no,triggering_option:p,parent_question_text:r.question_text}))})})}),n}goBack(){const{oid:t,pid:n}=this._state$.getValue();this.router.navigate(["/assessment/my-assessments"],{queryParams:{oid:t,pid:n}})}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(y.gz),e.LFG(y.F0),e.LFG(N.Dx),e.LFG(Ls))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac}),s})();function Gs(s,a){1&s&&(e.ynx(0),e.TgZ(1,"div",12),e._UZ(2,"div",13)(3,"div",14)(4,"div",15)(5,"div",16),e.qZA(),e.BQk())}function Hs(s,a){1&s&&(e.TgZ(0,"div",36),e._UZ(1,"i",37),e.TgZ(2,"p",38),e._uU(3,"No responses recorded for this assessment."),e.qZA()())}function Ks(s,a){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",63),e.qZA())}function Vs(s,a){if(1&s&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&s){const o=e.oxw().index;e.xp6(1),e.Oqu(o+1)}}function Ws(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",62),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(4);return e.KtG(r.goTo(i))}),e.YNc(1,Ks,2,0,"span",11),e.YNc(2,Vs,2,1,"span",11),e.qZA()}if(2&s){const o=a.$implicit,t=a.index,n=e.oxw(4);e.ekj("rv-dot--active",t===n.activeIdx)("rv-dot--done",t<n.activeIdx),e.Q6J("title",o.section_title),e.xp6(1),e.Q6J("ngIf",t<n.activeIdx),e.xp6(1),e.Q6J("ngIf",t>=n.activeIdx)}}function Xs(s,a){1&s&&e.GkF(0)}const Oe=function(s,a){return{item:s,idx:a}};function er(s,a){if(1&s&&(e.ynx(0),e.YNc(1,Xs,1,0,"ng-container",64),e.BQk()),2&s){const o=a.$implicit,t=a.index;e.oxw(4);const n=e.MAs(3);e.xp6(1),e.Q6J("ngTemplateOutlet",n)("ngTemplateOutletContext",e.WLB(2,Oe,o,t))}}function tr(s,a){1&s&&e.GkF(0)}function nr(s,a){if(1&s&&(e.ynx(0),e.YNc(1,tr,1,0,"ng-container",64),e.BQk()),2&s){const o=a.$implicit,t=a.index;e.oxw(6);const n=e.MAs(3);e.xp6(1),e.Q6J("ngTemplateOutlet",n)("ngTemplateOutletContext",e.WLB(2,Oe,o,t))}}function or(s,a){if(1&s&&(e.TgZ(0,"div"),e.YNc(1,nr,2,5,"ng-container",55),e.qZA()),2&s){const o=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",o.items)}}function ir(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",65)(1,"div",66)(2,"button",67),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(4);return e.KtG(r.toggleSubCollapse(r.activeIdx,i))}),e.O4$(),e.TgZ(3,"svg",68),e._UZ(4,"path",69),e.qZA()(),e.kcU(),e.TgZ(5,"span",70),e._uU(6),e.qZA(),e.TgZ(7,"span",71),e._uU(8),e.qZA()(),e.YNc(9,or,2,1,"div",11),e.qZA()}if(2&s){const o=a.$implicit,t=a.index,n=e.oxw(3).ngIf,i=e.oxw();e.xp6(3),e.Udp("transform",i.isSubCollapsed(i.activeIdx,t)?"rotate(-90deg)":""),e.xp6(3),e.hij(" Sub ",i.subSectionLabel(n.sections[i.activeIdx],t)," "),e.xp6(2),e.Oqu(o.sub_section_title),e.xp6(1),e.Q6J("ngIf",!i.isSubCollapsed(i.activeIdx,t))}}function sr(s,a){if(1&s){const o=e.EpF();e.ynx(0),e.TgZ(1,"div",39),e._UZ(2,"div",40),e.qZA(),e.TgZ(3,"div",41)(4,"div",42)(5,"button",43),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.prev())}),e.O4$(),e.TgZ(6,"svg",20),e._UZ(7,"path",21),e.qZA()(),e.kcU(),e.TgZ(8,"div")(9,"div",44),e._uU(10),e.qZA(),e.TgZ(11,"div",45),e._uU(12),e.qZA()()(),e.TgZ(13,"div",46),e.YNc(14,Ws,3,7,"button",47),e.qZA()(),e.TgZ(15,"div",48)(16,"div",49)(17,"div",50)(18,"span",51),e._uU(19),e.qZA(),e.TgZ(20,"span",52),e._uU(21),e.qZA()(),e.TgZ(22,"span",53),e._uU(23),e.qZA()(),e.TgZ(24,"div",54),e.YNc(25,er,2,5,"ng-container",55),e.YNc(26,ir,10,5,"div",56),e.qZA(),e.TgZ(27,"div",57)(28,"button",58),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.prev())}),e._uU(29," Previous "),e.qZA(),e.TgZ(30,"button",59),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2).ngIf,i=e.oxw();return e.KtG(i.next(n.sections.length))}),e._uU(31," Next Section "),e.O4$(),e.TgZ(32,"svg",60),e._UZ(33,"path",61),e.qZA()()()(),e.BQk()}if(2&s){const o=e.oxw(2).ngIf,t=e.oxw();e.xp6(2),e.Udp("width",(t.activeIdx+1)/(o.sections.length||1)*100,"%"),e.xp6(3),e.Q6J("disabled",0===t.activeIdx),e.xp6(
15),e.hij(" ",o.sections[t.activeIdx].section_title," "),e.xp6(2),e.AsE(" Section ",t.activeIdx+1," of ",o.sections.length," "),e.xp6(2),e.Q6J("ngForOf",o.sections),e.xp6(5),e.Oqu(o.sections[t.activeIdx].section_no),e.xp6(2),e.Oqu(o.sections[t.activeIdx].section_title),e.xp6(2),e.AsE(" ",t.answeredCount(o.sections[t.activeIdx]),"/",t.totalQuestions(o.sections[t.activeIdx])," answered "),e.xp6(2),e.Q6J("ngForOf",o.sections[t.activeIdx].direct_items),e.xp6(1),e.Q6J("ngForOf",o.sections[t.activeIdx].sub_sections),e.xp6(2),e.Q6J("disabled",0===t.activeIdx),e.xp6(2),e.Q6J("disabled",t.activeIdx===o.sections.length-1)}}const rr=function(s,a,o){return{"pi-check-circle":s,"pi-clock":a,"pi-times-circle":o}};function ar(s,a){if(1&s){const o=e.EpF();e.ynx(0),e.TgZ(1,"div",17)(2,"div",18)(3,"button",19),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.goBack())}),e.O4$(),e.TgZ(4,"svg",20),e._UZ(5,"path",21),e.qZA(),e._uU(6," My Assessments "),e.qZA(),e.kcU(),e.TgZ(7,"h1",22),e._uU(8),e.qZA(),e.TgZ(9,"p",23),e._UZ(10,"i",24),e._uU(11),e.qZA()(),e.TgZ(12,"div",25)(13,"div",26)(14,"span",27),e._UZ(15,"i",28),e._uU(16),e.qZA(),e._UZ(17,"span",29),e.TgZ(18,"span",27),e._UZ(19,"i",30),e._uU(20),e.ALo(21,"date"),e.qZA()(),e.TgZ(22,"div",31)(23,"span",32),e._UZ(24,"i",33),e._uU(25),e.qZA(),e.TgZ(26,"span",34),e._uU(27),e.qZA()()()(),e.YNc(28,Hs,4,0,"div",35),e.YNc(29,sr,34,15,"ng-container",11),e.BQk()}if(2&s){const o=e.oxw().ngIf,t=e.oxw();e.xp6(8),e.Oqu(o.assessmentName),e.xp6(3),e.hij(" ",o.templateTitle," "),e.xp6(5),e.Oqu(o.assigneeEmail),e.xp6(4),e.Oqu(e.xi3(21,11,o.submittedAt,"MMM d, y")),e.xp6(3),e.Q6J("ngClass",t.statusClass(o.status)),e.xp6(1),e.Q6J("ngClass",e.kEZ(14,rr,"Completed"===o.status,"Pending"===o.status,"Expired"===o.status)),e.xp6(1),e.hij(" ",o.status," "),e.xp6(2),e.AsE(" ",t.totalResponses(o.sections)," response",1!==t.totalResponses(o.sections)?"s":""," "),e.xp6(1),e.Q6J("ngIf",0===o.sections.length),e.xp6(1),e.Q6J("ngIf",o.sections.length>0)}}const Me=function(s,a){return{oid:s,pid:a}};function lr(s,a){if(1&s&&(e.TgZ(0,"div",3)(1,"div",4)(2,"nav",5)(3,"ol",6)(4,"li",7)(5,"a",8),e._uU(6,"Home"),e.qZA()(),e.TgZ(7,"li",7)(8,"a",9),e._uU(9,"My Assessments"),e.qZA()(),e.TgZ(10,"li",10),e._uU(11,"Response"),e.qZA()()()(),e.YNc(12,Gs,6,0,"ng-container",11),e.YNc(13,ar,30,18,"ng-container",11),e.qZA()),2&s){const o=a.ngIf;e.xp6(5),e.Q6J("queryParams",e.WLB(4,Me,o.oid,o.pid)),e.xp6(3),e.Q6J("queryParams",e.WLB(7,Me,o.oid,o.pid)),e.xp6(4),e.Q6J("ngIf",o.loading),e.xp6(1),e.Q6J("ngIf",!o.loading)}}function cr(s,a){1&s&&e.GkF(0)}const Pe=function(s){return{item:s}};function dr(s,a){if(1&s&&(e.TgZ(0,"div",74)(1,"div",75),e.O4$(),e.TgZ(2,"svg",76),e._UZ(3,"polyline",77),e.qZA(),e.kcU(),e.TgZ(4,"span",78),e._uU(5," Because you selected "),e.TgZ(6,"strong"),e._uU(7),e.qZA()()(),e.TgZ(8,"p",79),e._uU(9),e.qZA(),e.YNc(10,cr,1,0,"ng-container",64),e.qZA()),2&s){const o=e.oxw().item;e.oxw();const t=e.MAs(5);e.xp6(7),e.hij('"',o.triggered_by,'"'),e.xp6(2),e.Oqu(o.question_text),e.xp6(1),e.Q6J("ngTemplateOutlet",t)("ngTemplateOutletContext",e.VKq(4,Pe,o))}}function pr(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",90),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3).item,i=e.oxw();return e.KtG(i.toggleHelp(n.uid))}),e._uU(1),e.qZA()}if(2&s){const o=e.oxw(3).item,t=e.oxw();e.xp6(1),e.hij(" ",t.isHelpExpanded(o.uid)?"Show less":"Show more"," ")}}function _r(s,a){if(1&s&&(e.TgZ(0,"div",87),e._UZ(1,"div",88),e.YNc(2,pr,2,1,"button",89),e.qZA()),2&s){const o=e.oxw(2).item,t=e.oxw();e.xp6(1),e.ekj("ql-display--clamped",!t.isHelpExpanded(o.uid)),e.Q6J("innerHTML",o.help_text,e.oJD),e.xp6(1),e.Q6J("ngIf",t.isLongHelp(o.help_text))}}function ur(s,a){1&s&&e.GkF(0)}function gr(s,a){if(1&s&&(e.TgZ(0,"span"),e._uU(1," This question was "),e.TgZ(2,"strong"),e._uU(3,"not applicable"),e.qZA(),e._uU(4," \u2014 it is only shown when "),e.TgZ(5,"strong"),e._uU(6),e.qZA(),e._uU(7," is answered with "),e.TgZ(8,"strong"),e._uU(9),e.qZA(),e._uU(10,", which was not selected. "),e.qZA()),2&s){const o=e.oxw(3).item;e.xp6(6),e.hij("Q",o.rule_context.parent_question_no,""),e.xp6(3),e.hij('"',o.rule_context.triggering_option,'"')}}function mr(s,a){if(1&s&&(e.TgZ(0,"span"),e._uU(1," This question was "),e.TgZ(2,"strong"),e._uU(3,"hidden"),e.qZA(),e._uU(4," because "),e.TgZ(5,"strong"),e._uU(6),e.qZA(),e._uU(7," was answered with "),e.TgZ(8,"strong"),e._uU(9),e.qZA(),e._uU(10,". "),e.qZA()),2&s){const o=e.oxw(3).item;e.xp6(6),e.hij("Q",o.rule_context.parent_question_no,""),e.xp6(3),e.hij('"',o.rule_context.triggering_option,'"')}}function fr(s,a){if(1&s&&(e.TgZ(0,"div",91),e._UZ(1,"i",92),e.YNc(2,gr,11,2,"span",11),e.YNc(3,mr,11,2,"span",11),e.qZA()),2&s){const o=e.oxw(2).item;e.xp6(2),e.Q6J("ngIf","show_question"===o.rule_context.action),e.xp6(1),e.Q6J("ngIf","hide_question"===o.rule_context.action)}}function xr(s,a){if(1&s&&(e.TgZ(0,"div",80)(1,"div",81)(2,"span",82),e._uU(3),e.qZA(),e.TgZ(4,"span"),e._uU(5),e.qZA(),e.TgZ(6,"span",83),e._UZ(7,"i",84),e._uU(8),e.ALo(9,"titlecase"),e.qZA()(),e.YNc(10,_r,3,4,"div",85),e.YNc(11,ur,1,0,"ng-container",64),e.YNc(12,fr,4,2,"div",86),e.qZA()),2&s){const o=e.oxw().item,t=e.oxw(),n=e.MAs(5);e.xp6(3),e.hij("Q",o.question_no,""),e.xp6(2),e.Oqu(o.question_text),e.xp6(2),e.Q6J("ngClass",t.typeIcon(o.question_type)),e.xp6(1),e.hij(" ",e.lcZ(9,8,o.question_type)," "),e.xp6(2),e.Q6J("ngIf",t.hasHelpContent(o.help_text)),e.xp6(1),e.Q6J("ngTemplateOutlet",n)("ngTemplateOutletContext",e.VKq(10,Pe,o)),e.xp6(1),e.Q6J("ngIf",o.rule_context)}}function hr(s,a){if(1&s&&(e.YNc(0,dr,11,6,"div",72),e.YNc(1,xr,13,12,"div",73)),2&s){const o=a.item;e.Q6J("ngIf",o.is_followup),e.xp6(1),e.Q6J("ngIf",!o.is_followup)}}function vr(s,a){1&s&&e._UZ(0,"span",103)}function br(s,a){1&s&&(e.TgZ(0,"span",104),e._UZ(1,"i",63),e.qZA())}function wr(s,a){if(1&s&&(e.TgZ(0,"div",98)(1,"span",99),e.YNc(2,vr,1,0,"span",100),e.qZA(),e.TgZ(3,"span",101),e._uU(4),e.qZA(),e.YNc(5,br,2,0,"span",102),e.qZA()),2&s){const o=a.$implicit,t=e.oxw(2).item;e.ekj("rv-opt--selected",o===t.answer)("rv-opt--unanswered",!t.answer),e.xp6(2),e.Q6J("ngIf",o===t.answer),e.xp6(2),e.Oqu(o),e.xp6(1),e.Q6J("ngIf",o===t.answer)}}function Cr(s,a){1&s&&(e.TgZ(0,"span",105),e._uU(1,"No answer provided"),e.qZA())}function Tr(s,a){if(1&s&&(e.ynx(0),e.TgZ(1,"div",95),e.YNc(2,wr,6,7,"div",96),e.YNc(3,Cr,2,0,"span",97),e.qZA(),e.BQk()),2&s){const o=e.oxw().item;e.xp6(2),e.Q6J("ngForOf",o.options),e.xp6(1),e.Q6J("ngIf",!o.answer)}}function yr(s,a){1&s&&e._UZ(0,"i",63)}function kr(s,a){if(1&s&&(e.TgZ(0,"div",107)(1,"span",108),e.YNc(2,yr,1,0,"i",109),e.qZA(),e.TgZ(3,"span",101),e._uU(4),e.qZA()()),2&s){const o=a.$implicit,t=e.oxw(2).item,n=e.oxw();e.ekj("rv-opt--selected",n.isSelected(t,o))("rv-opt--unanswered",!t.answer||n.isArray(t.answer)&&
10===t.answer.length),e.xp6(2),e.Q6J("ngIf",n.isSelected(t,o)),e.xp6(2),e.Oqu(o)}}function Or(s,a){1&s&&(e.TgZ(0,"span",105),e._uU(1," No answer provided "),e.qZA())}function Mr(s,a){if(1&s&&(e.ynx(0),e.TgZ(1,"div",95),e.YNc(2,kr,5,6,"div",106),e.YNc(3,Or,2,0,"span",97),e.qZA(),e.BQk()),2&s){const o=e.oxw().item,t=e.oxw();e.xp6(2),e.Q6J("ngForOf",o.options),e.xp6(1),e.Q6J("ngIf",!o.answer||t.isArray(o.answer)&&0===o.answer.length)}}function Pr(s,a){1&s&&(e.TgZ(0,"span",105),e._uU(1," No answer provided "),e.qZA())}function Ar(s,a){if(1&s&&(e.TgZ(0,"div",111),e._uU(1),e.qZA()),2&s){const o=e.oxw(2).item;e.xp6(1),e.hij(" ",o.answer," ")}}function Zr(s,a){if(1&s&&(e.ynx(0),e.YNc(1,Pr,2,0,"span",97),e.YNc(2,Ar,2,1,"div",110),e.BQk()),2&s){const o=e.oxw().item;e.xp6(1),e.Q6J("ngIf",null==o.answer||""===o.answer),e.xp6(1),e.Q6J("ngIf",null!=o.answer&&""!==o.answer)}}function qr(s,a){if(1&s&&(e.TgZ(0,"div",93)(1,"span",94),e._uU(2,"Answer"),e.qZA(),e.YNc(3,Tr,4,2,"ng-container",11),e.YNc(4,Mr,4,2,"ng-container",11),e.YNc(5,Zr,3,2,"ng-container",11),e.qZA()),2&s){const o=a.item;e.xp6(3),e.Q6J("ngIf","dropdown"===o.question_type||"radio"===o.question_type),e.xp6(1),e.Q6J("ngIf","checkbox"===o.question_type),e.xp6(1),e.Q6J("ngIf","dropdown"!==o.question_type&&"radio"!==o.question_type&&"checkbox"!==o.question_type)}}let Sr=(()=>{const a=class{constructor(t){this.svc=t,this.state$=this.svc.state$,this.activeIdx=0,this.collapsedSubSections={},this.helpExpanded={}}ngOnInit(){this.svc.init(),this.state$.subscribe(t=>{!t.loading&&t.sections.length>0&&(this.activeIdx=0,this.collapsedSubSections={})})}goBack(){this.svc.goBack()}goTo(t){this.activeIdx=t}prev(){this.activeIdx>0&&this.activeIdx--}next(t){this.activeIdx<t-1&&this.activeIdx++}ssKey(t,n){return`${t}-${n}`}isSubCollapsed(t,n){return!!this.collapsedSubSections[this.ssKey(t,n)]}toggleSubCollapse(t,n){const i=this.ssKey(t,n);this.collapsedSubSections={...this.collapsedSubSections,[i]:!this.collapsedSubSections[i]}}isHelpExpanded(t){return!!this.helpExpanded[t]}toggleHelp(t){this.helpExpanded[t]=!this.helpExpanded[t]}isLongHelp(t,n=200){return!!t&&t.replace(/<[^>]*>/g,"").replace(/ /g," ").trim().length>n}hasHelpContent(t){return!!t&&t.replace(/<[^>]*>/g,"").replace(/ /g," ").trim().length>0}subSectionLabel(t,n){return`${t.section_no}.${t.sub_sections[n].sub_section_no}`}answeredCount(t){const n=i=>i.filter(r=>!r.is_followup&&this.hasAnswer(r)).length;return n(t.direct_items)+t.sub_sections.reduce((i,r)=>i+n(r.items),0)}totalQuestions(t){const n=i=>i.filter(r=>!r.is_followup).length;return n(t.direct_items)+t.sub_sections.reduce((i,r)=>i+n(r.items),0)}totalResponses(t){return(t||[]).reduce((n,i)=>n+i.direct_items.length+i.sub_sections.reduce((r,l)=>r+l.items.length,0),0)}hasAnswer(t){return null!=t.answer&&""!==t.answer&&(!Array.isArray(t.answer)||t.answer.length>0)}isArray(t){return Array.isArray(t)}isSelected(t,n){return!!t.answer&&(Array.isArray(t.answer)?t.answer.includes(n):t.answer===n)}statusClass(t){switch((t||"").toLowerCase()){case"completed":return"chip--completed";case"pending":return"chip--pending";case"expired":return"chip--expired";default:return"chip--default"}}typeIcon(t){switch(t){case"dropdown":return"pi pi-list";case"radio":return"pi pi-circle";case"checkbox":return"pi pi-check-square";case"short_text":case"free_text":case"text":return"pi pi-align-left";case"long_text":return"pi pi-align-justify";case"date":return"pi pi-calendar";case"number":return"pi pi-hashtag";case"email":return"pi pi-envelope";case"file":return"pi pi-paperclip";case"followup":return"pi pi-comment";default:return"pi pi-question-circle"}}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.Y36(ke))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-assessment-response"]],features:[e._Bn([ke])],decls:6,vars:3,consts:[["class","rv-page",4,"ngIf"],["questionRow",""],["answerBlock",""],[1,"rv-page"],[1,"rv-breadcrumb"],["aria-label","breadcrumb"],[1,"breadcrumb","breadcrumb-style1","mg-b-10"],[1,"breadcrumb-item"],["routerLink","/home/welcome",3,"queryParams"],["routerLink","/assessment/my-assessments",3,"queryParams"],[1,"breadcrumb-item","active"],[4,"ngIf"],[1,"rv-sk-wrap"],[1,"rv-sk","rv-sk--banner"],[1,"rv-sk","rv-sk--line",2,"width","50%"],[1,"rv-sk","rv-sk--line",2,"width","34%"],[1,"rv-sk","rv-sk--card"],[1,"rv-card","rv-header"],[1,"rv-header__main"],["type","button",1,"rv-back",3,"click"],["viewBox","0 0 20 20","width","15","height","15"],["d","M12 4l-6 6 6 6","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],[1,"rv-title"],[1,"rv-template-name"],[1,"pi","pi-file",2,"font-size","11px"],[1,"rv-header__meta"],[1,"rv-meta-row"],[1,"rv-meta-item"],[1,"pi","pi-envelope"],[1,"rv-meta-sep"],[1,"pi","pi-calendar"],[1,"rv-meta-right"],[1,"rv-status",3,"ngClass"],[1,"pi",3,"ngClass"],[1,"rv-count-badge"],["class","rv-card rv-empty",4,"ngIf"],[1,"rv-card","rv-empty"],[1,"pi","pi-inbox","rv-empty__icon"],[1,"rv-empty__text"],[1,"rv-progress"],[1,"rv-progress-bar"],[1,"rv-step-head"],[1,"rv-step-head__left"],["type","button",1,"rv-step-back-btn",3,"disabled","click"],[1,"rv-step-title"],[1,"rv-step-sub"],[1,"rv-step-dots"],["class","rv-dot","type","button",3,"rv-d
1ot--active","rv-dot--done","title","click",4,"ngFor","ngForOf"],[1,"rv-card","rv-section-card"],[1,"rv-section-banner"],[1,"rv-section-banner__left"],[1,"rv-section-no"],[1,"rv-section-title"],[1,"rv-section-tally"],[1,"rv-body"],[4,"ngFor","ngForOf"],["class","subsection-wrap",4,"ngFor","ngForOf"],[1,"rv-footer"],["type","button",1,"btn","ghost",3,"disabled","click"],["type","button",1,"btn","primary",3,"disabled","click"],["viewBox","0 0 20 20",1,"ico"],["d","M7 5l5 5-5 5","fill","none","stroke","currentColor","stroke-width","1.8","stroke-linecap","round","stroke-linejoin","round"],["type","button",1,"rv-dot",3,"title","click"],[1,"pi","pi-check"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"subsection-wrap"],[1,"subsection-header"],["type","button",1,"sub-collapse",3,"click"],["viewBox","0 0 20 20"],["d","M6 8l4 4 4-4","fill","none","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],[1,"sub-chip-inline"],[1,"sub-title-inline"],["class","followup-wrap",4,"ngIf"],["class","q-wrap",4,"ngIf"],[1,"followup-wrap"],[1,"followup-header"],["viewBox","0 0 24 24","width","14","height","14","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round"],["points","9 18 15 12 9 6"],[1,"followup-option-label"],[1,"followup-prompt"],[1,"q-wrap"],[1,"q-label"],[1,"q-no"],[1,"rv-q-type-badge"],[3,"ngClass"],["class","q-help",4,"ngIf"],["class","rule-dep-notice",4,"ngIf"],[1,"q-help"],[1,"ql-display","ql-display--help",3,"innerHTML"],["type","button","class","q-help__toggle",3,"click",4,"ngIf"],["type","button",1,"q-help__toggle",3,"click"],[1,"rule-dep-notice"],[1,"pi","pi-info-circle","rule-dep-notice__icon"],[1,"rv-answer"],[1,"rv-answer__label"],[1,"rv-opts"],["class","rv-opt",3,"rv-opt--selected","rv-opt--unanswered",4,"ngFor","ngForOf"],["class","rv-answer__empty",4,"ngIf"],[1,"rv-opt"],[1,"rv-opt__radio"],["class","rv-opt__radio-inner",4,"ngIf"],[1,"rv-opt__label"],["class","rv-opt__tick",4,"ngIf"],[1,"rv-opt__radio-inner"],[1,"rv-opt__tick"],[1,"rv-answer__empty"],["class","rv-opt rv-opt--checkbox",3,"rv-opt--selected","rv-opt--unanswered",4,"ngFor","ngForOf"],[1,"rv-opt","rv-opt--checkbox"],[1,"rv-opt__checkbox"],["class","pi pi-check",4,"ngIf"],["class","rv-answer__value",4,"ngIf"],[1,"rv-answer__value"]],template:function(n,i){1&n&&(e.YNc(0,lr,14,10,"div",0),e.ALo(1,"async"),e.YNc(2,hr,2,2,"ng-template",null,1,e.W1O),e.YNc(4,qr,6,3,"ng-template",null,2,e.W1O)),2&n&&e.Q6J("ngIf",e.lcZ(1,1,i.state$))},dependencies:[v.mk,v.sg,v.O5,v.tP,y.rH,v.Ov,v.rS,v.uU],styles:['@charset "UTF-8";[_nghost-%COMP%] .ql-display{line-height:1.6;word-break:break-word;overflow-wrap:anywhere}[_nghost-%COMP%] .ql-display p{margin:0 0 .4em}[_nghost-%COMP%] .ql-display p:last-child{margin-bottom:0}[_nghost-%COMP%] .ql-display strong, [_nghost-%COMP%] .ql-display b{font-weight:700}[_nghost-%COMP%] .ql-display em, [_nghost-%COMP%] .ql-display i{font-style:italic}[_nghost-%COMP%] .ql-display u{text-decoration:underline}[_nghost-%COMP%] .ql-display s{text-decoration:line-through}[_nghost-%COMP%] .ql-display h1{font-size:2em;font-weight:700;margin:.4em 0}[_nghost-%COMP%] .ql-display h2{font-size:1.5em;font-weight:700;margin:.4em 0}[_nghost-%COMP%] .ql-display h3{font-size:1.17em;font-weight:700;margin:.4em 0}[_nghost-%COMP%] .ql-display ul, [_nghost-%COMP%] .ql-display ol{margin:.4em 0;padding-left:1.5em}[_nghost-%COMP%] .ql-display ul{list-style-type:disc}[_nghost-%COMP%] .ql-display ol{list-style-type:decimal}[_nghost-%COMP%] .ql-display li{margin-bottom:.2em}[_nghost-%COMP%] .ql-display .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}[_nghost-%COMP%] .ql-display .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}[_nghost-%COMP%] .ql-display .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}[_nghost-%COMP%] .ql-display .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}[_nghost-%COMP%] .ql-display .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}[_nghost-%COMP%] .ql-display .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}[_nghost-%COMP%] .ql-display .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}[_nghost-%COMP%] .ql-display .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}[_nghost-%COMP%] .ql-display blockquote{border-left:4px solid #ccc;margin:.5em 0;padding-left:1em;color:#555}[_nghost-%COMP%] .ql-display pre{background:#f3f3f3;border-radius:4px;padding:.5em 1em;font-family:monospace;white-space:pre-wrap;margin:.4em 0}[_nghost-%COMP%] .ql-display a{color:#06c;text-decoration:underline}[_nghost-%COMP%] .ql-display a:hover{color:#0050b3}[_nghost-%COMP%] .ql-display .ql-align-center{text-align:center}[_nghost-%COMP%] .ql-display .ql-align-right{text-align:right}[_nghost-%COMP%] .ql-display .ql-align-justify{text-align:justify}[_nghost-%COMP%] .ql-display--clamped{max-height:4.8em;overflow:hidden}.rv-page[_ngcontent-%COMP%]{background:#f6f8fb;min-height:100vh;padding:14px 0 60px;color:#0f172a;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial;font-size:13px}.rv-breadcrumb[_ngcontent-%COMP%]{width:min(1200px,100% - 32px);margin:0 auto 8px}.rv-sk-wrap[_ngcontent-%COMP%]{width:min(1200px,100% - 32px);margin:0 auto;display:flex;flex-direction:column;gap:12px}.rv-sk[_ngcontent-%COMP%]{background:linear-gradient(90deg,#f1f5f9 25%,#e2e8f0 50%,#f1f5f9 75%);background-size:300% 100%;animation:_ngcontent-%COMP%_rv-shimmer 1.4s ease-in-out infinite;border-radius:12px}.rv-sk--banner[_ngcontent-%COMP%]{height:90px}.rv-sk--line[_ngcontent-%COMP%]{height:16px;border-radius:6px}.rv-sk--card[_ngcontent-%COMP%]{height:340px}@keyframes _ngcontent-%COMP%_rv-shimmer{0%{background-position:100% 0}to{background-position:-100% 0}}.rv-card[_ngcontent-%COMP%]{width:min(1200px,100% - 32px);margin:0 auto;background:#fff;border:1px solid #e9edf3;border-radius:12px;overflow:hidden;box-shadow:0 4px 16px #0c14280d}.rv-header[_ngcontent-%COMP%]{padding:16px 20px 14px;margin-bottom:12px}.rv-header__main[_ngcontent-%COMP%]{margin-bottom:14px}.rv-header__meta[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding-top:12px;border-top:1px solid #eef2f7}.rv-back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;width:auto;padding:5px 10px 5px 8px;border:1px solid #e6eaf2;border-radius:10px;background:#fff;color:#64748b;font-size:12px;font-weight:500;cursor:pointer;margin-bottom:14px;transition:border-color .15s,color .15s}.rv-back[_ngcontent-%COMP%]:hover{border-color:#c8d0df;color:#0f172a}.rv-title[_ngcontent-%COMP%]{font-size:17px;font-weight:700;color:#0f172a;margin:0 0 5px;line-height:1.3}
1.rv-template-name[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;font-size:13px;color:#6b7280;margin:0}.rv-meta-row[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.rv-meta-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;font-size:12.5px;color:#64748b}.rv-meta-item[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:11px;color:#94a3b8}.rv-meta-sep[_ngcontent-%COMP%]{width:1px;height:14px;background:#e2e8f0}.rv-meta-right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.rv-status[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:4px 12px;border-radius:999px;font-size:12px;font-weight:600}.rv-status.chip--completed[_ngcontent-%COMP%]{background:#d1fae5;color:#065f46}.rv-status.chip--pending[_ngcontent-%COMP%]{background:#fef3c7;color:#92400e}.rv-status.chip--expired[_ngcontent-%COMP%]{background:#fee2e2;color:#991b1b}.rv-status.chip--default[_ngcontent-%COMP%]{background:#f1f5f9;color:#475569}.rv-status[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:11px}.rv-count-badge[_ngcontent-%COMP%]{font-size:12px;color:#6b7280;background:#f6f8fb;border:1px solid #e9edf3;border-radius:999px;padding:4px 12px;white-space:nowrap}.rv-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 24px;text-align:center}.rv-empty__icon[_ngcontent-%COMP%]{font-size:40px;color:#d1d5db;margin-bottom:14px}.rv-empty__text[_ngcontent-%COMP%]{font-size:14px;color:#9ca3af;margin:0}.rv-progress[_ngcontent-%COMP%]{width:min(1200px,100% - 32px);margin:0 auto 8px;height:5px;background:#edf2fb;border-radius:50px;overflow:hidden}.rv-progress-bar[_ngcontent-%COMP%]{height:100%;background:#16bf5e;border-radius:50px;transition:width .3s ease}.rv-step-head[_ngcontent-%COMP%]{width:min(1200px,100% - 32px);margin:0 auto 8px;display:flex;align-items:center;justify-content:space-between;gap:12px}.rv-step-head__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.rv-step-back-btn[_ngcontent-%COMP%]{width:34px;height:34px;border-radius:10px;border:1px solid #e6eaf2;background:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:border-color .15s,background .15s}.rv-step-back-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:#f6f8fb;border-color:#c8d0df}.rv-step-back-btn[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}.rv-step-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#0f172a;margin:0 0 2px;line-height:1.3}.rv-step-sub[_ngcontent-%COMP%]{font-size:13px;color:#6b7280}.rv-step-dots[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-shrink:0}.rv-dot[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:50%;border:2px solid #e2e8f0;background:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;color:#94a3b8;cursor:pointer;transition:all .2s}.rv-dot[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{line-height:1}.rv-dot[_ngcontent-%COMP%]:hover:not(.rv-dot--active):not(.rv-dot--done){border-color:#16bf5e;color:#16bf5e;background:#f0fdf6}.rv-dot--done[_ngcontent-%COMP%]{background:#f0fdf6;border-color:#16bf5e;color:#16bf5e}.rv-dot--done[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:10px}.rv-dot--active[_ngcontent-%COMP%]{background:#16bf5e;border-color:#16bf5e;color:#fff;box-shadow:0 4px 12px #16bf5e4d}.rv-section-card[_ngcontent-%COMP%]{overflow:visible}.rv-section-banner[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:11px 18px;background:linear-gradient(135deg,#16bf5e,#16bf5e);color:#fff;border-radius:12px 12px 0 0}.rv-section-banner__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.rv-section-no[_ngcontent-%COMP%]{min-width:32px;height:32px;border-radius:999px;background:rgba(255,255,255,.22);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;padding:0 8px}.rv-section-title[_ngcontent-%COMP%]{font-weight:600;font-size:13.5px;line-height:1.4}.rv-section-tally[_ngcontent-%COMP%]{font-size:11px;opacity:.9;background:rgba(255,255,255,.2);padding:2px 10px;border-radius:999px;white-space:nowrap}.rv-body[_ngcontent-%COMP%]{padding:8px 18px 4px}.subsection-wrap[_ngcontent-%COMP%]{border:1px solid #eef2f7;border-radius:10px;padding:10px;margin:14px 0;background:#fcfdff}.subsection-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:8px}.sub-collapse[_ngcontent-%COMP%]{width:28px;height:28px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0}.sub-collapse[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:14px;
1height:14px;transition:transform .15s}.sub-chip-inline[_ngcontent-%COMP%]{background:#eef4ff;color:#3b82f6;border-radius:999px;padding:2px 8px;font-size:11px;font-weight:700;white-space:nowrap}.sub-title-inline[_ngcontent-%COMP%]{font-weight:600;font-size:13.5px;color:#0f172a}.q-wrap[_ngcontent-%COMP%]{margin-bottom:12px;padding:10px 0;border-bottom:1px solid #f1f5f9}.q-wrap[_ngcontent-%COMP%]:last-child{border-bottom:none}.q-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px;font-weight:500;margin-bottom:8px;font-size:13.5px;line-height:1.5;color:#0f172a;flex-wrap:wrap}.q-help[_ngcontent-%COMP%]{margin-bottom:8px}.q-help__toggle[_ngcontent-%COMP%]{background:none;border:none;padding:0;margin-top:3px;font-size:12px;font-weight:600;color:#2563eb;cursor:pointer;display:inline-block}.q-help__toggle[_ngcontent-%COMP%]:hover{text-decoration:underline}.q-no[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:20px;padding:0 7px;border-radius:999px;background:#edf4ff;color:#2563eb;font-size:10.5px;font-weight:700;flex-shrink:0}.rv-q-type-badge[_ngcontent-%COMP%]{margin-left:auto;display:inline-flex;align-items:center;gap:4px;font-size:10px;font-weight:500;color:#94a3b8;flex-shrink:0}.rv-q-type-badge[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:9px}.followup-wrap[_ngcontent-%COMP%]{margin-top:14px;padding:14px 16px 14px 20px;border-left:3px solid #a78bfa;background:linear-gradient(135deg,#faf7ff 0%,#f5f3ff 100%);border-radius:0 10px 10px 0;animation:_ngcontent-%COMP%_rv-fu-slide .18s ease}@keyframes _ngcontent-%COMP%_rv-fu-slide{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.followup-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-bottom:8px}.followup-header[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{stroke:#7c3aed;flex-shrink:0}.followup-option-label[_ngcontent-%COMP%]{font-size:12px;color:#6d28d9;font-weight:500}.followup-option-label[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:700;color:#4c1d95;background:#ede9fe;padding:1px 6px;border-radius:4px}.followup-prompt[_ngcontent-%COMP%]{display:block;font-size:13.5px;font-weight:600;color:#374151;margin-bottom:10px}.rv-items[_ngcontent-%COMP%]{padding:6px 22px}.rv-opts[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:5px}.rv-opt[_ngcontent-%COMP%]{display:flex;align-items:center;gap:9px;padding:8px 12px;border-radius:9px;border:1px solid #e9edf3;background:#fff;color:#0f172a;font-size:13px;cursor:default;pointer-events:none}.rv-opt--selected[_ngcontent-%COMP%]{background:#f5f0ff;border-color:#b9a8ff;font-weight:600;color:#4e2cd9}.rv-opt__radio[_ngcontent-%COMP%]{width:16px;height:16px;border-radius:50%;border:2px solid #d1d5db;flex-shrink:0;display:flex;align-items:center;justify-content:center}.rv-opt--selected[_ngcontent-%COMP%] .rv-opt__radio[_ngcontent-%COMP%]{border-color:#7c3aed;background:#fff}.rv-opt__radio-inner[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background:#7c3aed}.rv-opt--checkbox[_ngcontent-%COMP%] .rv-opt__checkbox[_ngcontent-%COMP%]{width:16px;height:16px;border-radius:4px;border:2px solid #d1d5db;flex-shrink:0;display:flex;align-items:center;justify-content:center;background:#fff}.rv-opt--checkbox.rv-opt--selected[_ngcontent-%COMP%] .rv-opt__checkbox[_ngcontent-%COMP%]{background:#7c3aed;border-color:#7c3aed}.rv-opt--checkbox.rv-opt--selected[_ngcontent-%COMP%] .rv-opt__checkbox[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:9px;color:#fff}.rv-opt__label[_ngcontent-%COMP%]{flex:1}.rv-opt__tick[_ngcontent-%COMP%]{margin-left:auto}.rv-opt__tick[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:11px;color:#7c3aed}.rv-answer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.rv-answer__label[_ngcontent-%COMP%]{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:#9ca3af}.rv-answer__empty[_ngcontent-%COMP%]{font-size:13px;color:#9ca3af;font-style:italic;padding:9px 12px;background:#f8fafc;border:1px dashed #e2e8f0;border-radius:10px}.rv-answer__value[_ngcontent-%COMP%]{width:100%;background:#f6f8fc;border:1px solid #e9edf3;border-radius:10px;padding:9px 12px;font-size:13px;color:#0f172a;line-height:1.6;white-space:pre-wrap;word-break:break-word}.rv-answer__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px}.rv-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:6px 12px;border-radius:999px;background:#f3f5ff;color:#1f2937;font-size:12.5px;font-weight:600;border:1px solid #e1e7ff}.rv-footer[_ngcontent-%COMP%]{padding:10px 18px 14px;display:flex;align-items:center;justify-content:space-between;position:sticky;bottom:0;background:linear-gradient(180deg,rgba(246,248,251,.4),#fff);border-top:1px solid #eef2f7;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);z-index:5}.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:9px;font-weight:700;font-size:13px;
1cursor:pointer;border:1px solid transparent;transition:opacity .15s}.btn[disabled][_ngcontent-%COMP%]{opacity:.45;cursor:not-allowed}.btn.ghost[_ngcontent-%COMP%]{background:#fff;border-color:#e9edf3;color:#374151}.btn.primary[_ngcontent-%COMP%]{background:linear-gradient(135deg,#16bf5e,#16bf5e);color:#fff}.ico[_ngcontent-%COMP%]{width:14px;height:14px}.rule-dep-notice[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;margin-top:10px;padding:9px 12px;background:#fffbeb;border:1px solid #fde68a;border-radius:6px;font-size:12.5px;color:#92400e;line-height:1.5}.rule-dep-notice__icon[_ngcontent-%COMP%]{font-size:13px;color:#d97706;flex-shrink:0;margin-top:1px}.rule-dep-notice[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600}']}),s})(),Ir=(()=>{const a=class{constructor(t){this.http=t,this.base="/dpia"}getSubmission(t,n){return this.http.get(`${b.N.keyStoneUrl}${this.base}/assesment/submission/${t}/${n}`).pipe((0,T.K)(i=>(0,k._)(()=>i)))}getComments(t,n){return this.http.get(`${b.N.keyStoneUrl}${this.base}/assesment/${t}/${n}/comments`).pipe((0,T.K)(i=>(0,k._)(()=>i)))}postComment(t,n,i,r){return this.http.post(`${b.N.keyStoneUrl}${this.base}/assesment/${t}/${n}/comment`,r).pipe((0,T.K)(l=>(0,k._)(()=>l)))}submitDecision(t,n,i){return this.http.put(`${b.N.keyStoneUrl}${this.base}/assesment/${t}/${n}/review`,{status:"approved"===i?"Approved":"Rejected"}).pipe((0,T.K)(l=>(0,k._)(()=>l)))}editComment(t,n,i){return this.http.put(`${b.N.keyStoneUrl}${this.base}/assesment/${t}/comment/${n}`,i).pipe((0,T.K)(r=>(0,k._)(()=>r)))}deleteComment(t,n){return this.http.delete(`${b.N.keyStoneUrl}${this.base}/assesment/${t}/comment/${n}`).pipe((0,T.K)(i=>(0,k._)(()=>i)))}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(D.eN))}
1,a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),s})(),Ae=(()=>{const a=class{constructor(t,n,i,r,l,c){this.route=t,this.router=n,this.fb=i,this.messageService=r,this.titleService=l,this.api=c,this._state$=new se.X({oid:"",pid:"",assessmentId:"",assessmentName:"",assigneeEmail:"",dpoEmail:"",submittedAt:"",templateTitle:"",sections:[],decision:"pending",threads:{},activeCommentId:null,activeReplyId:null,activeReplyParentId:null,inputForm:null,showConfirmDialog:!1,pendingDecision:null,activeEditId:null,editDraft:"",loading:!0,submitting:!1}),this.state$=this._state$.asObservable()}getState(){return this._state$.getValue()}patch(t){this._state$.next({...this._state$.getValue(),...t})}init(){this.titleService.setTitle("DPO Review - "+b.N.portalPrefix),this.route.queryParams.subscribe(t=>{const n=t.oid||"",i=t.pid||"";this.route.params.subscribe(r=>{const l=r.id||"";this.patch({oid:n,pid:i,assessmentId:l,loading:!0}),(0,de.D)({submission:this.api.getSubmission(n,l),comments:this.api.getComments(n,l).pipe((0,T.K)(()=>(0,ie.of)({assessment_id:l,comments:[],count:0})))}).subscribe({next:({submission:c,comments:d})=>{this.patch({oid:n,pid:i,assessmentId:l,assessmentName:c.assessment_name,assigneeEmail:c.assignee_email,dpoEmail:c.responsible_email,submittedAt:c.submitted_at,templateTitle:c.template_title,sections:this.mapSections(c.sections),decision:this.mapStatus(c.status),threads:this.buildThreads(d.comments||[],this.buildQMeta(c.sections)),inputForm:this.fb.group({text:this.fb.control("",{nonNullable:!0,validators:[f.kI.required,f.kI.minLength(3)]})}),loading:!1})},error:c=>{this.patch({loading:!1}),this.messageService.add({severity:"error",summary:"Failed to load submission",detail:c?.message||"An unexpected error occurred.",life:5e3})}})})})}mapStatus(t){if(!t)return"pending";const n=t.toLowerCase();return"approved"===n?"approved":"rejected"===n?"rejected":"pending"}buildThreads(t,n){const i={};return t.forEach(r=>{const l=r.uid||r.question_id||"";l&&(i[l]||(i[l]={questionId:l,questionText:n[l]?.text||"",questionNo:n[l]?.no,comments:[],replies:{},allMessages:[]}),r.parent_id?(i[l].replies[r.parent_id]||(i[l].replies[r.parent_id]=[]),i[l].replies[r.parent_id].push(r)):i[l].comments.push(r),i[l].allMessages.push(r))}),Object.values(i).forEach(r=>{r.allMessages.sort((l,c)=>new Date(l.created_at).getTime()-new Date(c.created_at).getTime())}),i}buildQMeta(t){const n={};return(t||[]).forEach(i=>{[...i.questions||[],...(i.sub_sections||[]).reduce((l,c)=>
1l.concat(c.questions||[]),[])].forEach(l=>{const c=l.uid||l.id;c&&(n[c]={text:l.question_text,no:l.question_no})})}),n}buildQMetaFromSections(t){const n={};return(t||[]).forEach(i=>{[...i.direct_items,...i.sub_sections.reduce((r,l)=>r.concat(l.items),[])].forEach(r=>{r.uid&&(n[r.uid]={text:r.question_text||"",no:r.question_no})})}),n}reloadComments(){const t=this.getState();this.api.getComments(t.oid,t.assessmentId).pipe((0,T.K)(()=>(0,ie.of)({assessment_id:t.assessmentId,comments:[],count:0}))).subscribe(n=>{const i=this.buildQMetaFromSections(t.sections);this.patch({threads:this.buildThreads(n.comments||[],i)})})}buildRuleContextMap(t){const n=new Map;for(const i of t){const r=i.answer,l=null==r?[]:Array.isArray(r)?r:[r];for(const d of i.options||[]){const p="string"==typeof d?d:d.value,_="object"==typeof d&&d.rules?d.rules:[];for(const u of _){const m=u.target_question_id;if(!m)continue;const g=u.action;"hide_question"===g?l.includes(p)&&n.set(m,{action:"hide_question",parent_question_no:i.question_no,triggering_option:p,parent_question_text:i.question_text}):"show_question"===g&&(l.includes(p)||n.set(m,{action:"show_question",parent_question_no:i.question_no,triggering_option:p,parent_question_text:i.question_text}))}}}return n}mapQuestion(t,n,i,r,l,c){const d=t.uid??t.id,p=t.options.map(g=>"string"==typeof g?g:g.value),u=[{uid:d,answer:t.answer,question_text:t.question_text,question_type:t.question_type,question_no:t.question_no,options:p,is_mandatory:t.is_mandatory,help_text:t.help_text||"",section_no:n,section_title:i,sub_section_no:r,sub_section_title:l,is_followup:!1,rule_context:c.get(d)}],m=t.rule_answers;if(m)for(const[g,C]of Object.entries(m)){let Z,O="Follow-up";for(const h of t.options||[])if("object"==typeof h&&h.rules){const w=h.rules.find(q=>q.id===g);if(w){O=w.followup_label??w.label??"Follow-up",Z="object"==typeof h?h.value:h;break}}u.push({uid:g,answer:C,question_text:O,question_type:"followup",options:[],section_no:n,section_title:i,sub_section_no:r,sub_section_title:l,is_followup:!0,followup_label:O,triggered_by:Z})}return u}mapSections(t){return(t||[]).map(n=>{const i=n.sub_sections||[],r=[...n.questions||[],...i.reduce((_,u)=>_.concat(u.questions||[]),[])],l=this.buildRuleContextMap(r),c=(_,u,m)=>this.mapQuestion(_,n.number,n.title,u,m,l),d=(n.questions||[]).reduce((_,u)=>_.concat(c(u)),[]),p=i.map(_=>({sub_section_no:_.number,sub_section_title:_.title,items:(_.questions||[]).reduce((u,m)=>u.concat(c(m,_.number,_.title)),[])}));return{section_no:n.number,section_title:n.title,direct_items:d,sub_sections:p}})}openCommentForm(t,n,i){const r=this.getState();if(r.activeCommentId===t&&null===r.activeReplyId)return this.patch({activeCommentId:null}),void r.inputForm?.reset();r.inputForm?.reset(),this.patch({activeCommentId:t,activeReplyId:null})}
1closeCommentForm(){this.getState().inputForm?.reset(),this.patch({activeCommentId:null,activeReplyId:null})}openReplyForm(t,n){const i=this.getState();if(i.activeReplyId===t&&i.activeReplyParentId===n)return this.patch({activeReplyId:null,activeReplyParentId:null}),void i.inputForm?.reset();i.inputForm?.reset(),this.patch({activeReplyId:t,activeReplyParentId:n,activeCommentId:null})}closeReplyForm(){this.getState().inputForm?.reset(),this.patch({activeReplyId:null,activeReplyParentId:null,activeCommentId:null})}submitDpoComment(t,n,i){const r=this.getState();if(!r.inputForm||r.inputForm.invalid)return void r.inputForm?.markAllAsTouched();const l=r.inputForm.get("text")?.value?.trim()||"";if(!l)return;const c={id:t,parent_id:null,comment:l,role:"dpo"};this.patch({submitting:!0}),this.api.postComment(r.oid,r.assessmentId,t,c).pipe((0,Y.x)(()=>this.patch({submitting:!1}))).subscribe({next:d=>{const p=d&&d.id?d:{id:`local_${Date.now()}`,assessment_id:r.assessmentId,organization_id:r.oid,question_id:t,parent_id:null,author_email:r.dpoEmail,author_role:"dpo",comment:l,created_at:(new Date).toISOString()},_=r.threads[t],u=_?{..._,comments:[..._.comments,p],allMessages:[..._.allMessages,p]}:{questionId:t,questionText:n,questionNo:i,comments:[p],replies:{},allMessages:[p]};r.inputForm.reset(),this.patch({threads:{...r.threads,[t]:u},activeCommentId:null}),this.reloadComments(),this.messageService.add({severity:"success",summary:"Comment posted",detail:`${r.assigneeEmail} has been notified.`,life:4e3})},error:()=>{this.messageService.add({severity:"error",summary:"Failed to post comment",detail:"Please try again.",life:4e3})}})}submitUserReply(t,n){const i=this.getState();
1if(!i.inputForm||i.inputForm.invalid)return void i.inputForm?.markAllAsTouched();const r=i.inputForm.get("text")?.value?.trim()||"";if(!r)return;const l=i.threads[t];if(!l)return;const c={id:t,parent_id:n,comment:r,role:"dpo"};this.patch({submitting:!0}),this.api.postComment(i.oid,i.assessmentId,t,c).pipe((0,Y.x)(()=>this.patch({submitting:!1}))).subscribe({next:d=>{const p=d&&d.id?d:{id:`local_${Date.now()}`,assessment_id:i.assessmentId,organization_id:i.oid,question_id:t,parent_id:n,author_email:i.dpoEmail,author_role:"dpo",comment:r,created_at:(new Date).toISOString()},_=l.replies[n]||[],u={...l,replies:{...l.replies,[n]:[..._,p]},allMessages:[...l.allMessages,p]};i.inputForm.reset(),this.patch({threads:{...i.threads,[t]:u},activeReplyId:null,activeReplyParentId:null}),this.reloadComments(),this.messageService.add({severity:"success",summary:"Comment posted",detail:`${i.assigneeEmail} has been notified.`,life:4e3})},error:()=>{this.messageService.add({severity:"error",summary:"Failed to send reply",detail:"Please try again.",life:4e3})}})}startEditComment(t,n){this.patch({activeEditId:t,editDraft:n})}cancelEditComment(){this.patch({activeEditId:null,editDraft:""})}patchEditDraft(t){this._state$.getValue().editDraft=t}saveEditComment(t,n){const i=this.getState(),r=i.editDraft.trim();if(!r)return;const c=i.threads[n]?.allMessages.find(p=>p.id===t);if(!c)return;const d={id:n,parent_id:c.parent_id,comment:r,role:c.author_role};this.patch({submitting:!0}),this.api.editComment(i.oid,t,d).pipe((0,Y.x)(()=>this.patch({submitting:!1}))).subscribe({next:()=>{this.patch({activeEditId:null,editDraft:""}),this.reloadComments(),this.messageService.add({severity:"success",summary:"Comment updated",life:3e3})},error:()=>{this.messageService.add({severity:"error",summary:"Failed to update comment",detail:"Please try again.",life:4e3})}})}deleteComment(t){const n=this.getState();this.api.deleteComment(n.oid,t).subscribe({next:()=>{this.reloadComments(),this.messageService.add({severity:"success",summary:"Comment deleted",life:3e3})},error:()=>{this.messageService.add({severity:"error",summary:"Failed to delete comment",detail:"Please try again.",life:4e3})}})}requestDecision(t){this.patch({pendingDecision:t,showConfirmDialog:!0})}cancelDecision(){this.patch({pendingDecision:null,showConfirmDialog:!1})}confirmDecision(){const t=this.getState();if(!t.pendingDecision||"pending"===t.pendingDecision)return;const n=t.pendingDecision;this.patch({submitting:!0}),this.api.submitDecision(t.oid,t.assessmentId,n).pipe((0,Y.x)(()=>this.patch({submitting:!1}))).subscribe({next:()=>{this.patch({decision:n,showConfirmDialog:!1,pendingDecision:null});const i="approved"===n;this.messageService.add({severity:i?"success":"warn",summary:i?"Assessment Approved":"Assessment Rejected",detail:i?"The assessment has been approved. The submitter has been notified.":"The assessment has been rejected. The submitter has been asked to resubmit.",life:5e3})},error:()=>{this.patch({showConfirmDialog:!1,pendingDecision:null}),this.messageService.add({severity:"error",summary:"Action failed",detail:"Could not submit the decision. Please try again.",life:4e3})}})}threadCount(t){return Object.values(t).filter(n=>n.comments.length>0).length}hasComments(t,n){return!!t[n]?.comments?.length}goBack(){const{oid:t,pid:n}=this.getState();this.router.navigate(["/assessment/my-assessments"],{queryParams:{oid:t,pid:n}})}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.LFG(y.gz),e.LFG(y.F0),e.LFG(f.qu),e.LFG(Q.ez),e.LFG(N.Dx),e.LFG(Ir))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac}),s})();function Ur(s,a){1&s&&(e.ynx(0),e.TgZ(1,"div",13),e._UZ(2,"div",14)(3,"div",15)(4,"div",16),e.qZA(),e.BQk())}function Fr(s,a){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",72),e.qZA())}function Qr(s,a){if(1&s&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&s){const o=e.oxw().index;e.xp6(1),e.Oqu(o+1)}}function Dr(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",71),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(3);return e.KtG(r.goTo(i))}),e.YNc(1,Fr,2,0,"span",12),e.YNc(2,Qr,2,1,"span",12),e.qZA()}if(2&s){const o=a.$implicit,t=a.index,n=e.oxw(3);e.ekj("dpr-dot--active",t===n.activeIdx)("dpr-dot--done",t<n.activeIdx),e.Q6J("title",o.section_title),e.xp6(1),e.Q6J("ngIf",t<n.activeIdx),e.xp6(1),e.Q6J("ngIf",t>=n.activeIdx)}}function Nr(s,a){if(1&s&&(e.TgZ(0,"span",73),e._UZ(1,"i",74),e._uU(2),e.qZA()),2&s){const o=e.oxw(2).ngIf,t=e.oxw();e.xp6(2),e.hij(" ",t.sectionThreadCount(o.threads,o.sections[t.activeIdx])," ")}}function Jr(s,a){1&s&&e.GkF(0)}const Ze=function(s,a){return{item:s,state:a}};function Rr(s,a){if(1&s&&(e.ynx(0),e.YNc(1,Jr,1,0,"ng-container",75),e.BQk()),2&s){const o=a.$implicit,t=e.oxw(2).ngIf;e.oxw();const n=e.MAs(3);e.xp6(1),e.Q6J("ngTemplateOutlet",n)("ngTemplateOutletContext",e.WLB(2,Ze,o,t))}}function $r(s,a){1&s&&e.GkF(0)}function Br(s,a){if(1&s&&(e.ynx(0),e.YNc(1,$r,1,0,"ng-container",75),e.BQk()),2&s){const o=a.$implicit,t=e.oxw(4).ngIf;e.oxw();const n=e.MAs(3);e.xp6(1),e.Q6J("ngTemplateOutlet",n)("ngTemplateOutletContext",e.WLB(2,Ze,o,t))}}function Yr(s,a){if(1&s&&(e.TgZ(0,"div"),e.YNc(1,Br,2,5,"ng-container",56),e.qZA()),2&s){const o=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",o.items)}}function Er(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",76)(1,"div",77)(2,"button",78),e.NdJ("click",function(){const i=e.CHM(o).index,r=e.oxw(3);return e.KtG(r.toggleSubCollapse(r.activeIdx,i))}),e.O4$(),e.TgZ(3,"svg",79),e._UZ(4,"path",80),e.qZA()(),e.kcU(),e.TgZ(5,"span",81),e._uU(6),e.qZA(),e.TgZ(7,"span",82),e._uU(8),e.qZA()(),e.YNc(9,Yr,2,1,"div",12),e.qZA()}if(2&s){const o=a.$implicit,t=a.index,n=e.oxw(2).ngIf,i=e.oxw();e.xp6(3),e.Udp("transform",i.isSubCollapsed(i.activeIdx,t)?"rotate(-90deg)":""),e.xp6(3),e.hij("Sub ",i.subSectionLabel(n.sections[i.activeIdx],t),""),e.xp6(2),e.Oqu(o.sub_section_title),e.xp6(1),e.Q6J("ngIf",!i.isSubCollapsed(i.activeIdx,t))}}function jr(s,a){if(1&s){const o=e.EpF();e.ynx(0),e.TgZ(1,"p",83),e._uU(2," Review all sections then record your decision. "),e.qZA(),e.TgZ(3,"div",84)(4,"button",85),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.requestDecision("approved"))}),e._UZ(5,"i",86),e._uU(6," Approve "),e.qZA(),e.TgZ(7,"button",87),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.requestDecision("rejected"))}),e._UZ(8,"i",88),e._uU(9," Reject "),e.qZA()(),e.BQk()}}function zr(s,a){1&s&&(e.ynx(0),e.TgZ(1,"div",89),e._UZ(2,"i",88),e.TgZ(3,"div")(4,"strong"),e._uU(5,"Assessment Rejected"),e.qZA(),e.TgZ(6,"p"),e._uU(7," The submitter has been asked to resubmit. You can approve only after they resubmit their response. "),e.qZA()()(),e.TgZ(8,"div",84)(9,"button",90),e._UZ(10,"i",86),e._uU(11," Approve "),e.qZA(),e.TgZ(12,"button",91),e._UZ(13,"i",88),e._uU(14," Rejected "),e.qZA()(),e.BQk())}function Lr(s,a){1&s&&(e.ynx(0),e.TgZ(1,"p",83),e._uU(2," Assessment approved. The submitter has been notified. "),e.qZA(),e.BQk())}
1function Gr(s,a){if(1&s&&(e.TgZ(0,"div",95)(1,"span",96),e._uU(2),e.qZA(),e.TgZ(3,"span",97),e._uU(4),e.ALo(5,"slice"),e.qZA(),e.TgZ(6,"span",98),e._uU(7),e.qZA()()),2&s){const o=a.$implicit,t=e.oxw(3).ngIf;e.xp6(2),e.hij("Q",t.threads[o].questionNo,""),e.xp6(2),e.AsE("",e.Dn7(5,4,t.threads[o].questionText,0,50),"",t.threads[o].questionText.length>50?"\u2026":"",""),e.xp6(3),e.Oqu(t.threads[o].comments.length)}}function Hr(s,a){if(1&s&&(e.TgZ(0,"div",64)(1,"div",65),e._UZ(2,"i",74),e._uU(3," Comment Threads "),e.TgZ(4,"span",92),e._uU(5),e.qZA()(),e.TgZ(6,"div",93),e.YNc(7,Gr,8,8,"div",94),e.qZA()()),2&s){const o=e.oxw(2).ngIf,t=e.oxw();e.xp6(5),e.Oqu(t.threadCount(o.threads)),e.xp6(2),e.Q6J("ngForOf",t.objectKeys(o.threads))}}function Kr(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",99),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.cancelDecision())}),e.qZA()}}function Vr(s,a){1&s&&(e.ynx(0),e._uU(1," You are about to "),e.TgZ(2,"strong"),e._uU(3,"approve"),e.qZA(),e._uU(4," this DPIA. The submitter will be notified by email. "),e.BQk())}function Wr(s,a){1&s&&(e.ynx(0),e._uU(1," You are about to "),e.TgZ(2,"strong"),e._uU(3,"reject"),e.qZA(),e._uU(4," this DPIA. The submitter will be asked to resubmit with corrections. "),e.BQk())}function Xr(s,a){1&s&&e._UZ(0,"i",107)}function ea(s,a){if(1&s&&(e.ynx(0),e._uU(1),e.BQk()),2&s){const o=e.oxw(3).ngIf;e.xp6(1),e.hij(" ","approved"===o.pendingDecision?"Yes, Approve":"Yes, Reject"," ")}}function ta(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",100)(1,"div",101),e._UZ(2,"i",27),e.qZA(),e.TgZ(3,"h3",102),e._uU(4),e.qZA(),e.TgZ(5,"p",103),e.YNc(6,Vr,5,0,"ng-container",12),e.YNc(7,Wr,5,0,"ng-container",12),e.qZA(),e.TgZ(8,"div",104)(9,"button",59),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.cancelDecision())}),e._uU(10," Cancel "),e.qZA(),e.TgZ(11,"button",105),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3);return e.KtG(n.confirmDecision())}),e.YNc(12,Xr,1,0,"i",106),e.YNc(13,ea,2,1,"ng-container",12),e.qZA()()()}if(2&s){const o=e.oxw(2).ngIf;e.xp6(1),e.ekj("dpr-confirm-dialog__icon--approve","approved"===o.pendingDecision)("dpr-confirm-dialog__icon--reject","rejected"===o.pendingDecision),e.xp6(1),e.Q6J("ngClass","approved"===o.pendingDecision?"pi-check-circle":"pi-times-circle"),e.xp6(2),e.hij(" ","approved"===o.pendingDecision?"Approve Assessment?":"Reject Assessment?"," "),e.xp6(2),e.Q6J("ngIf","approved"===o.pendingDecision),e.xp6(1),e.Q6J("ngIf","rejected"===o.pendingDecision),e.xp6(2),e.Q6J("disabled",o.submitting),e.xp6(2),e.Tol("approved"===o.pendingDecision?"btn btn-approve":"btn btn-reject"),e.Q6J("disabled",o.submitting),e.xp6(1),e.Q6J("ngIf",o.submitting),e.xp6(1),e.Q6J("ngIf",!o.submitting)}}function na(s,a){if(1&s){const o=e.EpF();e.ynx(0),e.TgZ(1,"div",17)(2,"div",18)(3,"div",19)(4,"div",20)(5,"div",21)(6,"div",22)(7,"h1",23),e._uU(8),e.qZA(),e.TgZ(9,"p",24),e._UZ(10,"i",25),e._uU(11),e.qZA()(),e.TgZ(12,"span",26),e._UZ(13,"i",27),e._uU(14),e.qZA()()(),e.TgZ(15,"div",28)(16,"div",29)(17,"span",30),e._UZ(18,"i",31),e.TgZ(19,"span",32),e._uU(20,"Assignee"),e.qZA(),e._uU(21),e.qZA(),e._UZ(22,"span",33),e.TgZ(23,"span",30),e._UZ(24,"i",34),e.TgZ(25,"span",32),e._uU(26,"Submitted"),e.qZA(),e._uU(27),e.ALo(28,"date"),e.qZA(),e._UZ(29,"span",33),e.TgZ(30,"span",30),e._UZ(31,"i",35),e.TgZ(32,"span",32),e._uU(33,"Responses"),e.qZA(),e._uU(34),e.qZA()()()(),e.TgZ(35,"div",36),e._UZ(36,"div",37),e.qZA(),e.TgZ(37,"div",38)(38,"div",39)(39,"button",40),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.prev())}),e.O4$(),e.TgZ(40,"svg",41),e._UZ(41,"path",42),e.qZA()(),e.kcU(),e.TgZ(42,"div")(43,"div",43),e._uU(44),e.qZA(),e.TgZ(45,"div",44),e._uU(46),e.qZA()()(),e.TgZ(47,"div",45),e.YNc(48,Dr,3,7,"button",46),e.qZA()(),e.TgZ(49,"div",47)(50,"div",48)(51,"div",49)(52,"span",50),e._uU(53),e.qZA(),e.TgZ(54,"span",51),e._uU(55),e.qZA()(),e.TgZ(56,"div",52)(57,"span",53),e._uU(58),e.qZA(),e.YNc(59,Nr,3,1,"span",54),e.qZA()(),e.TgZ(60,"div",55),e.YNc(61,Rr,2,5,"ng-container",56),e.YNc(62,Er,10,5,"div",57),e.qZA(),e.TgZ(63,"div",58)(64,"button",59),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(2);return e.KtG(n.prev())}),e._uU(65," Previous "),e.qZA(),e.TgZ(66,"button",60),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().ngIf,i=e.oxw();return e.KtG(i.next(n.sections.length))}),e._uU(67," Next Section "),e.O4$(),e.TgZ(68,"svg",61),e._UZ(69,"path",62),e.qZA()()()()(),e.kcU(),e.TgZ(70,"div",63)(71,"div",64)(72,"div",65),e._UZ(73,"i",66),e._uU(74," Reviewer Decision "),e.qZA(),e.TgZ(75,"div",67),e._UZ(76,"i",27),e.TgZ(77,"span"),e._uU(78),e.qZA()(),e.YNc(79,jr,10,0,"ng-container",12),e.YNc(80,zr,15,0,"ng-container",12),e.YNc(81,Lr,3,0,"ng-container",12),e.qZA(),e.YNc(82,Hr,8,2,"div",68),e.qZA()(),e.YNc(83,Kr,1,0,"div",69),e.YNc(84,ta,14,14,"div",70),e.BQk()}if(2&s){const o=e.oxw().ngIf,t=e.oxw();e.xp6(8),e.Oqu(o.assessmentName),e.xp6(3),e.hij(" ",o.templateTitle," "),e.xp6(1),e.Q6J("ngClass",t.decisionClass(o.decision)),e.xp6(1),e.Q6J("ngClass","pi-"+t.decisionIcon(o.decision)),e.xp6(1),e.hij(" ",t.decisionLabel(o.decision)," "),e.xp6(7),e.hij(" ",o.assigneeEmail," "),e.xp6(6),e.hij(" ",e.xi3(28,33,o.submittedAt,"MMM d, y")," "),e.xp6(7),e.hij(" ",t.totalResponses(o.sections)," "),e.xp6(2),e.Udp("width",(t.activeIdx+1)/(o.sections.length||1)*100,"%"),e.xp6(3),e.Q6J("disabled",0===t.activeIdx),e.xp6(
15),e.hij(" ",o.sections[t.activeIdx].section_title," "),e.xp6(2),e.AsE(" Section ",t.activeIdx+1," of ",o.sections.length," "),e.xp6(2),e.Q6J("ngForOf",o.sections),e.xp6(5),e.Oqu(o.sections[t.activeIdx].section_no),e.xp6(2),e.Oqu(o.sections[t.activeIdx].section_title),e.xp6(3),e.AsE(" ",t.answeredCount(o.sections[t.activeIdx]),"/",t.totalQuestions(o.sections[t.activeIdx])," answered "),e.xp6(1),e.Q6J("ngIf",t.sectionThreadCount(o.threads,o.sections[t.activeIdx])>0),e.xp6(2),e.Q6J("ngForOf",o.sections[t.activeIdx].direct_items),e.xp6(1),e.Q6J("ngForOf",o.sections[t.activeIdx].sub_sections),e.xp6(2),e.Q6J("disabled",0===t.activeIdx),e.xp6(2),e.Q6J("disabled",t.activeIdx===o.sections.length-1),e.xp6(9),e.Q6J("ngClass",t.decisionClass(o.decision)),e.xp6(1),e.Q6J("ngClass","pi-"+t.decisionIcon(o.decision)),e.xp6(2),e.Oqu(t.decisionLabel(o.decision)),e.xp6(1),e.Q6J("ngIf","pending"===o.decision),e.xp6(1),e.Q6J("ngIf","rejected"===o.decision),e.xp6(1),e.Q6J("ngIf","approved"===o.decision),e.xp6(1),e.Q6J("ngIf",t.threadCount(o.threads)>0),e.xp6(1),e.Q6J("ngIf",o.showConfirmDialog),e.xp6(1),e.Q6J("ngIf",o.showConfirmDialog)}}const qe=function(s,a){return{oid:s,pid:a}};function oa(s,a){if(1&s&&(e.TgZ(0,"div",3),e._UZ(1,"p-toast",4),e.TgZ(2,"div",5)(3,"nav",6)(4,"ol",7)(5,"li",8)(6,"a",9),e._uU(7,"Home"),e.qZA()(),e.TgZ(8,"li",8)(9,"a",10),e._uU(10,"My Assessments"),e.qZA()(),e.TgZ(11,"li",11),e._uU(12,"Reviewer"),e.qZA()()()(),e.YNc(13,Ur,5,0,"ng-container",12),e.YNc(14,na,85,36,"ng-container",12),e.qZA()),2&s){const o=a.ngIf;e.xp6(6),e.Q6J("queryParams",e.WLB(4,qe,o.oid,o.pid)),e.xp6(3),e.Q6J("queryParams",e.WLB(7,qe,o.oid,o.pid)),e.xp6(4),e.Q6J("ngIf",o.loading),e.xp6(1),e.Q6J("ngIf",!o.loading)}}function ia(s,a){1&s&&e.GkF(0)}const Se=function(s){return{item:s}};function sa(s,a){if(1&s&&(e.TgZ(0,"div",110)(1,"div",111),e.O4$(),e.TgZ(2,"svg",112),e._UZ(3,"polyline",113),e.qZA(),e.kcU(),e.TgZ(4,"span",114),e._uU(5,"Because you selected "),e.TgZ(6,"strong"),e._uU(7),e.qZA()()(),e.TgZ(8,"p",115),e._uU(9),e.qZA(),e.YNc(10,ia,1,0,"ng-container",75),e.qZA()),2&s){const o=e.oxw().item;e.oxw();const t=e.MAs(5);e.xp6(7),e.hij('"',o.triggered_by,'"'),e.xp6(2),e.Oqu(o.question_text),e.xp6(1),e.Q6J("ngTemplateOutlet",t)("ngTemplateOutletContext",e.VKq(4,Se,o))}}function ra(s,a){1&s&&(e.TgZ(0,"span",125),e._uU(1,"*"),e.qZA())}function aa(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",129),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3).item,i=e.oxw();return e.KtG(i.toggleHelp(n.uid))}),e._uU(1),e.qZA()}if(2&s){const o=e.oxw(3).item,t=e.oxw();e.xp6(1),e.hij(" ",t.isHelpExpanded(o.uid)?"Show less":"Show more"," ")}}function la(s,a){if(1&s&&(e.TgZ(0,"div",126),e._UZ(1,"div",127),e.YNc(2,aa,2,1,"button",128),e.qZA()),2&s){const o=e.oxw(2).item,t=e.oxw();e.xp6(1),e.ekj("ql-display--clamped",!t.isHelpExpanded(o.uid)),e.Q6J("innerHTML",o.help_text,e.oJD),e.xp6(1),e.Q6J("ngIf",t.isLongHelp(o.help_text))}}function ca(s,a){1&s&&e.GkF(0)}function da(s,a){if(1&s&&(e.TgZ(0,"span"),e._uU(1," This question was "),e.TgZ(2,"strong"),e._uU(3,"not applicable"),e.qZA(),e._uU(4," \u2014 it is only shown when "),e.TgZ(5,"strong"),e._uU(6),e.qZA(),e._uU(7," is answered with "),e.TgZ(8,"strong"),e._uU(9),e.qZA(),e._uU(10,", which was not selected. "),e.qZA()),2&s){const o=e.oxw(3).item;e.xp6(6),e.hij("Q",o.rule_context.parent_question_no,""),e.xp6(3),e.hij('"',o.rule_context.triggering_option,'"')}}function pa(s,a){if(1&s&&(e.TgZ(0,"span"),e._uU(1," This question was "),e.TgZ(2,"strong"),e._uU(3,"hidden"),e.qZA(),e._uU(4," because "),e.TgZ(5,"strong"),e._uU(6),e.qZA(),e._uU(7," was answered with "),e.TgZ(8,"strong"),e._uU(9),e.qZA(),e._uU(10,". "),e.qZA()),2&s){const o=e.oxw(3).item;e.xp6(6),e.hij("Q",o.rule_context.parent_question_no,""),e.xp6(3),e.hij('"',o.rule_context.triggering_option,'"')}}function _a(s,a){if(1&s&&(e.TgZ(0,"div",130),e._UZ(1,"i",131),e.YNc(2,da,11,2,"span",12),e.YNc(3,pa,11,2,"span",12),e.qZA()),2&s){const o=e.oxw(2).item;e.xp6(2),e.Q6J("ngIf","show_question"===o.rule_context.action),e.xp6(1),e.Q6J("ngIf","hide_question"===o.rule_context.action)}}function ua(s,a){if(1&s){const o=e.EpF();e.ynx(0),e.TgZ(1,"button",145),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(4);return e.KtG(i.startEditComment(n.id,n.comment))}),e._UZ(2,"i",146),e.qZA(),e.TgZ(3,"button",147),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(4);return e.KtG(i.deleteComment(n.id))}),e._UZ(4,"i",148),e.qZA(),e.BQk()}}function ga(s,a){if(1&s&&(e.TgZ(0,"p",149),e._uU(1),e.qZA()),2&s){const o=e.oxw().$implicit;e.xp6(1),e.hij(" ",o.comment," ")}}function ma(s,a){1&s&&e._UZ(0,"i",107)}function fa(s,a){1&s&&e._UZ(0,"i",72)}function xa(s,a){if(1&s){const o=e.EpF();e.ynx(0),e.TgZ(1,"textarea",150),e.NdJ("input",function(n){e.CHM(o);const i=e.oxw(5);return e.KtG(i.patchEditDraft(n.target.value))}),e._uU(2," "),e.qZA(),e.TgZ(3,"div",151)(4,"button",152),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(5);return e.KtG(n.cancelEditComment())}),e._uU(5," Cancel "),e.qZA(),e.TgZ(6,"button",153),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().$implicit,i=e.oxw(3).item,r=e.oxw();return e.KtG(r.saveEditComment(n.id,i.uid))}),e.YNc(7,ma,1,0,"i",106),e.YNc(8,fa,1,0,"i",154),e._uU(9),e.qZA()(),e.BQk()}if(2&s){const o=e.oxw(4).state;e.xp6(1),e.Q6J("value",o.editDraft),e.xp6(5),e.Q6J("disabled",o.submitting),e.xp6(1),e.Q6J("ngIf",o.submitting),e.xp6(1),e.Q6J("ngIf",!o.submitting),e.xp6(1),e.hij(" ",o.submitting?"Saving\u2026":"Save"," ")}}function ha(s,a){if(1&s&&(e.TgZ(0,"div",136)(1,"div",137),e._uU(2),e.qZA(),e.TgZ(3,"div",138)(4,"div",139)(5,"div",140)(6,"span",141),e._uU(7),e.qZA(),e.TgZ(8,"span",142),e._uU(9),e.qZA()(),e.TgZ(10,"div",143)(11,"span"),e._uU(12),e.qZA(),e.YNc(13,ua,5,0,"ng-container",12),e.qZA()(),e.YNc(14,ga,2,1,"p",144),e.YNc(15,xa,10,5,"ng-container",12),e.qZA()()),2&s){const o=a.$implicit,t=e.oxw(3).state,n=e.oxw();
1e.ekj("dpr-msg--dpo","dpo"===o.author_role)("dpr-msg--user","assignee"===o.author_role),e.xp6(1),e.ekj("dpr-msg__avatar--dpo","dpo"===o.author_role),e.xp6(1),e.hij(" ",null==o.author_email[0]?null:o.author_email[0].toUpperCase()," "),e.xp6(5),e.Oqu(o.author_email),e.xp6(1),e.ekj("dpr-msg__role-chip--dpo",o.author_email===t.dpoEmail),e.xp6(1),e.hij(" ",o.author_email===t.dpoEmail?"You":"Submitter"," "),e.xp6(3),e.Oqu(n.formatDate(o.created_at)),e.xp6(1),e.Q6J("ngIf",o.author_email===t.dpoEmail&&t.activeEditId!==o.id),e.xp6(1),e.Q6J("ngIf",t.activeEditId!==o.id),e.xp6(1),e.Q6J("ngIf",t.activeEditId===o.id)}}function va(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",155)(1,"button",156),e.NdJ("click",function(){e.CHM(o);const n=e.oxw().ngIf,i=e.oxw(2).item,r=e.oxw();return e.KtG(r.openReplyForm(i.uid,n.allMessages[n.allMessages.length-1].id))}),e._UZ(2,"i",157),e._uU(3," Reply as Reviewer "),e.qZA()()}}function ba(s,a){1&s&&(e.TgZ(0,"div",165),e._uU(1," Please enter at least 3 characters. "),e.qZA())}function wa(s,a){1&s&&e._UZ(0,"i",107)}function Ca(s,a){1&s&&e._UZ(0,"i",166)}function Ta(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",158)(1,"div",159),e._UZ(2,"i",157),e._uU(3," Reply as "),e.TgZ(4,"strong"),e._uU(5),e.qZA(),e.TgZ(6,"span",160),e._UZ(7,"i",31),e._uU(8),e.qZA()(),e.TgZ(9,"textarea",161),e.NdJ("blur",function(){e.CHM(o);const n=e.oxw(3).state;return e.KtG(n.inputForm.get("text").markAsTouched())}),e._uU(10," "),e.qZA(),e.YNc(11,ba,2,0,"div",162),e.TgZ(12,"div",163)(13,"button",152),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(4);return e.KtG(n.closeReplyForm())}),e._uU(14," Cancel "),e.qZA(),e.TgZ(15,"button",153),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3),i=n.item,r=n.state,l=e.oxw();return e.KtG(l.submitUserReply(i.uid,r.activeReplyParentId))}),e.YNc(16,wa,1,0,"i",106),e.YNc(17,Ca,1,0,"i",164),e._uU(18),e.qZA()()()}if(2&s){const o=e.oxw(3).state;e.xp6(5),e.Oqu(o.dpoEmail),e.xp6(3),e.hij(" ",o.assigneeEmail," will be notified "),e.xp6(1),e.Q6J("formControl",o.inputForm.get("text")),e.xp6(2),e.Q6J("ngIf",o.inputForm.get("text").touched&&o.inputForm.get("text").invalid),e.xp6(4),e.Q6J("disabled",o.submitting),e.xp6(1),e.Q6J("ngIf",o.submitting),e.xp6(1),e.Q6J("ngIf",!o.submitting),e.xp6(1),e.hij(" ",o.submitting?"Sending\u2026":"Send Reply"," ")}}function ya(s,a){if(1&s&&(e.ynx(0),e.TgZ(1,"div",132),e.YNc(2,ha,16,15,"div",133),e.YNc(3,va,4,0,"div",134),e.YNc(4,Ta,19,8,"div",135),e.qZA(),e.BQk()),2&s){const o=a.ngIf,t=e.oxw(2),n=t.state,i=t.item;e.xp6(2),e.Q6J("ngForOf",o.allMessages),e.xp6(1),e.Q6J("ngIf","approved"!==n.decision&&o.allMessages.length>0&&n.activeReplyId!==i.uid),e.xp6(1),e.Q6J("ngIf",n.activeReplyId===i.uid&&n.inputForm)}}function ka(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"button",169),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3).item,i=e.oxw();return e.KtG(i.openCommentForm(n.uid,n.question_text,n.question_no))}),e._UZ(1,"i",170),e._uU(2," Add comment "),e.qZA()}}function Oa(s,a){1&s&&(e.TgZ(0,"div",165),e._uU(1," Please enter at least 3 characters. "),e.qZA())}function Ma(s,a){1&s&&e._UZ(0,"i",107)}function Pa(s,a){1&s&&e._UZ(0,"i",166)}function Aa(s,a){if(1&s){const o=e.EpF();e.TgZ(0,"div",171)(1,"div",159),e._UZ(2,"i",170),e._uU(3," Comment as "),e.TgZ(4,"strong"),e._uU(5),e.qZA(),e.TgZ(6,"span",160),e._UZ(7,"i",31),e._uU(8),e.qZA()(),e.TgZ(9,"textarea",172),e.NdJ("blur",function(){e.CHM(o);const n=e.oxw(3).state;return e.KtG(n.inputForm.get("text").markAsTouched())}),e._uU(10," "),e.qZA(),e.YNc(11,Oa,2,0,"div",162),e.TgZ(12,"div",163)(13,"button",152),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(4);
1return e.KtG(n.closeCommentForm())}),e._uU(14," Cancel "),e.qZA(),e.TgZ(15,"button",153),e.NdJ("click",function(){e.CHM(o);const n=e.oxw(3).item,i=e.oxw();return e.KtG(i.submitDpoComment(n.uid,n.question_text,n.question_no))}),e.YNc(16,Ma,1,0,"i",106),e.YNc(17,Pa,1,0,"i",164),e._uU(18),e.qZA()()()}if(2&s){const o=e.oxw(3).state;e.xp6(5),e.Oqu(o.dpoEmail),e.xp6(3),e.hij(" ",o.assigneeEmail," will be notified "),e.xp6(1),e.Q6J("formControl",o.inputForm.get("text")),e.xp6(2),e.Q6J("ngIf",o.inputForm.get("text").touched&&o.inputForm.get("text").invalid),e.xp6(4),e.Q6J("disabled",o.submitting),e.xp6(1),e.Q6J("ngIf",o.submitting),e.xp6(1),e.Q6J("ngIf",!o.submitting),e.xp6(1),e.hij(" ",o.submitting?"Sending\u2026":"Send & Notify"," ")}}function Za(s,a){if(1&s&&(e.ynx(0),e.YNc(1,ka,3,0,"button",167),e.YNc(2,Aa,19,8,"div",168),e.BQk()),2&s){const o=e.oxw(2),t=o.state,n=o.item;e.xp6(1),e.Q6J("ngIf",t.activeCommentId!==n.uid),e.xp6(1),e.Q6J("ngIf",t.activeCommentId===n.uid&&t.inputForm)}}function qa(s,a){if(1&s&&(e.TgZ(0,"div",116)(1,"div",117)(2,"span",118),e._uU(3),e.qZA(),e.TgZ(4,"span"),e._uU(5),e.qZA(),e.YNc(6,ra,2,0,"span",119),e.TgZ(7,"span",120),e._UZ(8,"i",121),e._uU(9),e.ALo(10,"titlecase"),e.qZA()(),e.YNc(11,la,3,4,"div",122),e.YNc(12,ca,1,0,"ng-container",75),e.YNc(13,_a,4,2,"div",123),e.TgZ(14,"div",124),e.YNc(15,ya,5,3,"ng-container",12),e.YNc(16,Za,3,2,"ng-container",12),e.qZA()()),2&s){const o=e.oxw(),t=o.item,n=o.state,i=e.oxw(),r=e.MAs(5);e.xp6(3),e.hij("Q",t.question_no,""),e.xp6(2),e.Oqu(t.question_text),e.xp6(1),e.Q6J("ngIf",t.is_mandatory),e.xp6(2),e.Q6J("ngClass",i.typeIcon(t.question_type)),e.xp6(1),e.hij(" ",e.lcZ(10,11,t.question_type)," "),e.xp6(2),e.Q6J("ngIf",i.hasHelpContent(t.help_text)),e.xp6(1),e.Q6J("ngTemplateOutlet",r)("ngTemplateOutletContext",e.VKq(13,Se,t)),e.xp6(1),e.Q6J("ngIf",t.rule_context),e.xp6(2),e.Q6J("ngIf",i.getThread(n.threads,t.uid)),e.xp6(1),e.Q6J("ngIf",!i.getThread(n.threads,t.uid)&&"approved"!==n.decision)}}function Sa(s,a){if(1&s&&(e.YNc(0,sa,11,6,"div",108),e.YNc(1,qa,17,15,"div",109)),2&s){const o=a.item;e.Q6J("ngIf",o.is_followup),e.xp6(1),e.Q6J("ngIf",!o.is_followup&&!o.rule_context)}}function Ia(s,a){1&s&&e._UZ(0,"span",183)}function Ua(s,a){1&s&&(e.TgZ(0,"span",184),e._UZ(1,"i",72),e.qZA())}function Fa(s,a){if(1&s&&(e.TgZ(0,"div",178)(1,"span",179),e.YNc(2,Ia,1,0,"span",180),e.qZA(),e.TgZ(3,"span",181),e._uU(4),e.qZA(),e.YNc(5,Ua,2,0,"span",182),e.qZA()),2&s){const o=a.$implicit,t=e.oxw(2).item;e.ekj("rv-opt--selected",o===t.answer),e.xp6(2),e.Q6J("ngIf",o===t.answer),e.xp6(2),e.Oqu(o),e.xp6(1),e.Q6J("ngIf",o===t.answer)}}function Qa(s,a){1&s&&(e.TgZ(0,"span",185),e._uU(1,"No answer provided"),e.qZA())}function Da(s,a){if(1&s&&(e.ynx(0),e.TgZ(1,"div",175),e.YNc(2,Fa,6,5,"div",176),e.YNc(3,Qa,2,0,"span",177),e.qZA(),e.BQk()),2&s){const o=e.oxw().item;e.xp6(2),e.Q6J("ngForOf",o.options),e.xp6(1),e.Q6J("ngIf",!o.answer)}}function Na(s,a){1&s&&e._UZ(0,"i",72)}function Ja(s,a){if(1&s&&(e.TgZ(0,"div",187)(1,"span",188),e.YNc(2,Na,1,0,"i",154),e.qZA(),e.TgZ(3,"span",181),e._uU(4),e.qZA()()),2&s){const o=a.$implicit,t=e.oxw(2).item,n=e.oxw();e.ekj("rv-opt--selected",n.isSelected(t,o)),e.xp6(2),e.Q6J("ngIf",n.isSelected(t,o)),e.xp6(2),e.Oqu(o)}}function Ra(s,a){1&s&&(e.TgZ(0,"span",185),e._uU(1,"No answer provided"),e.qZA())}function $a(s,a){if(1&s&&(e.ynx(0),e.TgZ(1,"div",175),e.YNc(2,Ja,5,4,"div",186),e.YNc(3,Ra,2,0,"span",177),e.qZA(),e.BQk()),2&s){const o=e.oxw().item,t=e.oxw();e.xp6(2),e.Q6J("ngForOf",o.options),e.xp6(1),e.Q6J("ngIf",!o.answer||t.isArray(o.answer)&&0===o.answer.length)}}function Ba(s,a){1&s&&(e.TgZ(0,"span",185),e._uU(1,"No answer provided"),e.qZA())}function Ya(s,a){if(1&s&&(e.TgZ(0,"div",190),e._uU(1),e.qZA()),2&s){const o=e.oxw(2).item;e.xp6(1),e.hij(" ",o.answer," ")}}function Ea(s,a){if(1&s&&(e.ynx(0),e.YNc(1,Ba,2,0,"span",177),e.YNc(2,Ya,2,1,"div",189),e.BQk()),2&s){const o=e.oxw().item;e.xp6(1),e.Q6J("ngIf",null==o.answer||""===o.answer),e.xp6(1),e.Q6J("ngIf",null!=o.answer&&""!==o.answer)}}function ja(s,a){if(1&s&&(e.TgZ(0,"div",173)(1,"span",174),e._uU(2,"Answer"),e.qZA(),e.YNc(3,Da,4,2,"ng-container",12),e.YNc(4,$a,4,2,"ng-container",12),e.YNc(5,Ea,3,2,"ng-container",12),e.qZA()),2&s){const o=a.item;e.xp6(3),e.Q6J("ngIf","dropdown"===o.question_type||"radio"===o.question_type),e.xp6(1),e.Q6J("ngIf","checkbox"===o.question_type),e.xp6(1),e.Q6J("ngIf","dropdown"!==o.question_type&&"radio"!==o.question_type&&"checkbox"!==o.question_type)}}let za=(()=>{const a=class{constructor(t){this.svc=t,this.state$=this.svc.state$,this.activeIdx=0,this.collapsedSubSections={},this.helpExpanded={}}ngOnInit(){this.svc.init(),this.state$.subscribe(t=>{!t.loading&&t.sections.length>
10&&0===this.activeIdx&&(this.collapsedSubSections={})})}goBack(){this.svc.goBack()}goTo(t){this.activeIdx=t}prev(){this.activeIdx>0&&this.activeIdx--}next(t){this.activeIdx<t-1&&this.activeIdx++}ssKey(t,n){return`${t}-${n}`}isSubCollapsed(t,n){return!!this.collapsedSubSections[this.ssKey(t,n)]}toggleSubCollapse(t,n){const i=this.ssKey(t,n);this.collapsedSubSections={...this.collapsedSubSections,[i]:!this.collapsedSubSections[i]}}subSectionLabel(t,n){return`${t.section_no}.${t.sub_sections[n].sub_section_no}`}isHelpExpanded(t){return!!this.helpExpanded[t]}toggleHelp(t){this.helpExpanded[t]=!this.helpExpanded[t]}isLongHelp(t,n=200){return!!t&&t.replace(/<[^>]*>/g,"").replace(/ /g," ").trim().length>n}hasHelpContent(t){return!!t&&t.replace(/<[^>]*>/g,"").replace(/ /g," ").trim().length>0}answeredCount(t){const n=i=>i.filter(r=>!r.is_followup&&this.hasAnswer(r)).length;return n(t.direct_items)+t.sub_sections.reduce((i,r)=>i+n(r.items),0)}totalQuestions(t){const n=i=>i.filter(r=>!r.is_followup).length;return n(t.direct_items)+t.sub_sections.reduce((i,r)=>i+n(r.items),0)}totalResponses(t){return(t||[]).reduce((n,i)=>n+i.direct_items.length+i.sub_sections.reduce((r,l)=>r+l.items.length,0),0)}hasAnswer(t){return null!=t.answer&&""!==t.answer&&(!Array.isArray(t.answer)||t.answer.length>0)}getThread(t,n){return t[n]??null}threadCount(t){return this.svc.threadCount(t)}sectionThreadCount(t,n){return this.getSectionQuestionIds(n).filter(r=>!!t[r]).length}getSectionQuestionIds(t){const n=[];return t.direct_items.forEach(i=>{!i.is_followup&&i.uid&&n.push(i.uid)}),t.sub_sections.forEach(i=>i.items.forEach(r=>{!r.is_followup&&r.uid&&n.push(r.uid)})),n}openCommentForm(t,n,i){this.svc.openCommentForm(t,n,i)}
1closeCommentForm(){this.svc.closeCommentForm()}submitDpoComment(t,n,i){this.svc.submitDpoComment(t,n,i)}openReplyForm(t,n){this.svc.openReplyForm(t,n)}closeReplyForm(){this.svc.closeReplyForm()}submitUserReply(t,n){this.svc.submitUserReply(t,n)}startEditComment(t,n){this.svc.startEditComment(t,n)}cancelEditComment(){this.svc.cancelEditComment()}patchEditDraft(t){this.svc.patchEditDraft(t)}saveEditComment(t,n){this.svc.saveEditComment(t,n)}deleteComment(t){this.svc.deleteComment(t)}decisionClass(t){return"approved"===t?"decision--approved":"rejected"===t?"decision--rejected":"decision--pending"}decisionLabel(t){return"approved"===t?"Approved":"rejected"===t?"Rejected":"Pending Review"}decisionIcon(t){return"approved"===t?"pi-check-circle":"rejected"===t?"pi-times-circle":"pi-clock"}requestDecision(t){this.svc.requestDecision(t)}cancelDecision(){this.svc.cancelDecision()}confirmDecision(){this.svc.confirmDecision()}isArray(t){return Array.isArray(t)}isSelected(t,n){return!!t.answer&&(Array.isArray(t.answer)?t.answer.includes(n):t.answer===n)}typeIcon(t){switch(t){case"dropdown":return"pi pi-list";case"radio":return"pi pi-circle";case"checkbox":return"pi pi-check-square";case"short_text":case"free_text":case"text":return"pi pi-align-left";case"long_text":return"pi pi-align-justify";case"date":return"pi pi-calendar";case"number":return"pi pi-hashtag";case"email":return"pi pi-envelope";case"file":return"pi pi-paperclip";case"followup":return"pi pi-comment";default:return"pi pi-question-circle"}}objectKeys(t){return Object.keys(t)}formatDate(t){return t?new Date(t).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}):""}};let s=a;return a.\u0275fac=function(n){return new(n||a)(e.Y36(Ae))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-dpo-review"]],features:[e._Bn([Ae])],decls:6,vars:3,consts:[["class","dpr-page",4,"ngIf"],["questionRow",""],["answerBlock",""],[1,"dpr-page"],["position","bottom-right"],[1,"dpr-breadcrumb"],["aria-label","breadcrumb"],[1,"breadcrumb","breadcrumb-style1","mg-b-10"],[1,"breadcrumb-item"],["routerLink","/home/welcome",3,"queryParams"],["routerLink","/assessment/my-assessments",3,"queryParams"],[1,"breadcrumb-item","active"],[4,"ngIf"],[1,"dpr-sk-wrap"],[1,"dpr-sk","dpr-sk--banner"],[1,"dpr-sk","dpr-sk--line",2,"width","50%"],[1,"dpr-sk","dpr-sk--card"],[1,"dpr-layout"],[1,"dpr-left"],[1,"dpr-card","dpr-header"],[1,"dpr-header__main"],[1,"dpr-header-top"],[1,"dpr-header-title-block"],[1,"dpr-title"],[1,"dpr-template-name"],[1,"pi","pi-file-o"],[1,"dpr-decision-chip",3,"ngClass"],[1,"pi",3,"ngClass"],[1,"dpr-header__meta"],[1,"dpr-meta-row"],[1,"dpr-meta-item"],[1,"pi","pi-envelope"],[1,"dpr-meta-label"],[1,"dpr-meta-sep"],[1,"pi","pi-calendar"],[1,"pi","pi-list"],[1,"dpr-progress"],[1,"dpr-progress-bar"],[1,"dpr-step-head"],[1,"dpr-step-head__left"],["type","button",1,"dpr-step-back-btn",3,"disabled","click"],["viewBox","0 0 20 20","width","15","height","15"],["d","M12 4l-6 6 6 6","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],[1,"dpr-step-title"],[1,"dpr-step-sub"],[1,"dpr-step-dots"],["class","dpr-dot","type","button",3,"dpr-dot--active","dpr-dot--done","title","click",4,"ngFor","ngForOf"],[1,"dpr-card","dpr-section-card"],[1,"dpr-section-banner"],[1,"dpr-section-banner__left"],[1,"dpr-section-no"],[1,"dpr-section-title"],[1,"dpr-section-banner__right"],[1,"dpr-section-tally"],["class","dpr-thread-badge",4,"ngIf"],[1,"dpr-body"],[4,"ngFor","ngForOf"],["class","subsection-wrap",4,"ngFor","ngForOf"],[1,"dpr-footer"],["type","button",1,"btn","ghost",3,"disabled","click"],["type","button",1,"btn","primary",3,"disabled","click"],["viewBox","0 0 20 20",1,"ico"],["d","M7 5l5 5-5 5","fill","none","stroke","currentColor","stroke-width","1.8","stroke-linecap","round","stroke-linejoin","round"],[1,"dpr-right"],[1,"dpr-panel-card"],[1,"dpr-panel-title"],[1,"pi","pi-shield"],[1,"dpr-current-decision",3,"ngClass"],["class","dpr-panel-card",4,"ngIf"],["class","dpr-overlay",3,"click",4,"ngIf"],["class","dpr-confirm-dialog",4,"ngIf"],["type","button",1,"dpr-dot",3,"title","click"],[1,"pi","pi-check"],[1,"dpr-thread-badge"],[1,"pi","pi-comments"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"subsection-wrap"],[1,"subsection-header"],["type","button",1,"sub-collapse",3,"click"],["viewBox","0 0 20 20"],["d","M6 8l4 4 4-4","fill","none","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],[1,"sub-chip-inline"],[1,"sub-title-inline"],[1,"dpr-panel-hint"],[1,"dpr-decision-btns"],["type","button",1,"btn","btn-approve",3,"click"],[1,"pi","pi-check-circle"],["type","button",1,"btn","btn-reject",3,"click"],[1,"pi","pi-times-circle"],[1,"dpr-decision-status","dpr-decision-status--rejected"],["type","button","disabled","","title","Cannot approve \u2014 waiting for the submitter to resubmit.",1,"btn","btn-approve"],["type","button","disabled","",1,"btn","btn-reject"],[1,"dpr-badge"],[1,"dpr-thread-summary"],["class","dpr-ts-row",4,"ngFor","ngForOf"],[1,"dpr-ts-row"],[1,"dpr-ts-qno"],[1,"dpr-ts-text"],[1,"dpr-badge","dpr-ts-count"],[1,"dpr-overlay",3,"click"],[1,"dpr-confirm-dialog"],[1,"dpr-confirm-dialog__icon"],[1,"dpr-confirm-dialog__title"],[1,"dpr-confirm-dialog__body"],[1,"dpr-confirm-dialog__actions"],["type","button",3,"disabled","click"],["class","pi pi-spin pi-spinner",4,"ngIf"],[1,"pi","pi-spin","pi-spinner"],["class","followup-wrap",4,"ngIf"],["class","q-wrap",4,"ngIf"],[1,"followup-wrap"],[1,"followup-header"],["viewBox","0 0 24 24","width","14","height","14","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round"],["points","9 18 15 12 9 6"],[1,"followup-option-label"],[1,"followup-prompt"],[1,"q-wrap"],[1,"q-label"],[1,"q-no"],["class","req",4,"ngIf"],[1,"dpr-q-type-badge"],[3,"ngClass"],["class","q-help",4,"ngIf"],["class","rule-dep-notice",4,"ngIf"],[1,"dpr-thread-block"],[1,"req"],[1,"q-help"],[1,"ql-display","ql-display--help",3,"innerHTML"],["type","button","class","q-help__toggle",3,"click",4,"ngIf"],["type","button",1,"q-help__toggle",3,"click"],[1,"rule-dep-notice"],[1,"pi","pi-info-circle","rule-dep-notice__icon"],[1,"dpr-thread"],["class","dpr-msg",3,"dpr-msg--dpo","d
1pr-msg--user",4,"ngFor","ngForOf"],["class","dpr-thread__actions",4,"ngIf"],["class","dpr-input-form dpr-input-form--reply",4,"ngIf"],[1,"dpr-msg"],[1,"dpr-msg__avatar"],[1,"dpr-msg__body"],[1,"dpr-msg__head"],[1,"dpr-msg__left"],[1,"dpr-msg__author"],[1,"dpr-msg__role-chip"],[1,"dpr-msg__time"],["class","dpr-msg__text",4,"ngIf"],["type","button","title","Edit",1,"dpr-msg-action",3,"click"],[1,"pi","pi-pencil"],["type","button","title","Delete",1,"dpr-msg-action","dpr-msg-action--delete",3,"click"],[1,"pi","pi-trash"],[1,"dpr-msg__text"],["rows","3",1,"dpr-comment-textarea","dpr-comment-textarea--edit",3,"value","input"],[1,"dpr-input-form__actions",2,"margin-top","6px"],["type","button",1,"btn","ghost","btn-sm",3,"click"],["type","button",1,"btn","primary","btn-sm",3,"disabled","click"],["class","pi pi-check",4,"ngIf"],[1,"dpr-thread__actions"],["type","button",1,"dpr-reply-btn",3,"click"],[1,"pi","pi-reply"],[1,"dpr-input-form","dpr-input-form--reply"],[1,"dpr-input-form__label"],[1,"dpr-email-hint"],["rows","3","placeholder","Write your reply\u2026",1,"dpr-comment-textarea",3,"formControl","blur"],["class","dpr-comment-form-error",4,"ngIf"],[1,"dpr-input-form__actions"],["class","pi pi-send",4,"ngIf"],[1,"dpr-comment-form-error"],[1,"pi","pi-send"],["class","dpr-comment-trigger","type","button",3,"click",4,"ngIf"],["class","dpr-input-form",4,"ngIf"],["type","button",1,"dpr-comment-trigger",3,"click"],[1,"pi","pi-comment"],[1,"dpr-input-form"],["rows","3","placeholder","Write your review comment\u2026",1,"dpr-comment-textarea",3,"formControl","blur"],[1,"rv-answer"],[1,"rv-answer__label"],[1,"rv-opts"],["class","rv-opt",3,"rv-opt--selected",4,"ngFor","ngForOf"],["class","rv-answer__empty",4,"ngIf"],[1,"rv-opt"],[1,"rv-opt__radio"],["class","rv-opt__radio-inner",4,"ngIf"],[1,"rv-opt__label"],["class","rv-opt__tick",4,"ngIf"],[1,"rv-opt__radio-inner"],[1,"rv-opt__tick"],[1,"rv-answer__empty"],["class","rv-opt rv-opt--checkbox",3,"rv-opt--selected",4,"ngFor","ngForOf"],[1,"rv-opt","rv-opt--checkbox"],[1,"rv-opt__checkbox"],["class","rv-answer__value",4,"ngIf"],[1,"rv-answer__value"]],template:function(n,i){1&n&&(e.YNc(0,oa,15,10,"div",0),e.ALo(1,"async"),e.YNc(2,Sa,2,2,"ng-template",null,1,e.W1O),e.YNc(4,ja,6,3,"ng-template",null,2,e.W1O)),2&n&&e.Q6J("ngIf",e.lcZ(1,1,i.state$))},dependencies:[v.mk,v.sg,v.O5,v.tP,y.rH,f.Fj,f.JJ,f.oH,z.FN,v.Ov,v.OU,v.rS,v.uU],styles:['@charset "UTF-8";[_nghost-%COMP%] .ql-display{line-height:1.6;word-break:break-word;overflow-wrap:anywhere}[_nghost-%COMP%] .ql-display p{margin:0 0 .4em}[_nghost-%COMP%] .ql-display p:last-child{margin-bottom:0}[_nghost-%COMP%] .ql-display strong, [_nghost-%COMP%] .ql-display b{font-weight:700}[_nghost-%COMP%] .ql-display em, [_nghost-%COMP%] .ql-display i{font-style:italic}[_nghost-%COMP%] .ql-display u{text-decoration:underline}[_nghost-%COMP%] .ql-display s{text-decoration:line-through}[_nghost-%COMP%] .ql-display h1{font-size:2em;font-weight:700;margin:.4em 0}[_nghost-%COMP%] .ql-display h2{font-size:1.5em;font-weight:700;margin:.4em 0}[_nghost-%COMP%] .ql-display h3{font-size:1.17em;font-weight:700;margin:.4em 0}[_nghost-%COMP%] .ql-display ul, [_nghost-%COMP%] .ql-display ol{margin:.4em 0;padding-left:1.5em}[_nghost-%COMP%] .ql-display ul{list-style-type:disc}[_nghost-%COMP%] .ql-display ol{list-style-type:decimal}[_nghost-%COMP%] .ql-display li{margin-bottom:.2em}[_nghost-%COMP%] .ql-display .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}[_nghost-%COMP%] .ql-display .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}[_nghost-%COMP%] .ql-display .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}[_nghost-%COMP%] .ql-display .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}[_nghost-%COMP%] .ql-display .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}[_nghost-%COMP%] .ql-display .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}[_nghost-%COMP%] .ql-display .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}[_nghost-%COMP%] .ql-display .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}[_nghost-%COMP%] .ql-display blockquote{border-left:4px solid #ccc;margin:.5em 0;padding-left:1em;color:#555}[_nghost-%COMP%] .ql-display pre{background:#f3f3f3;border-radius:4px;padding:.5em 1em;font-family:monospace;white-space:pre-wrap;margin:.4em 0}[_nghost-%COMP%] .ql-display a{color:#06c;text-decoration:underline}[_nghost-%COMP%] .ql-display a:hover{color:#0050b3}[_nghost-%COMP%] .ql-display .ql-align-center{text-align:center}[_nghost-%COMP%] .ql-display .ql-align-right{text-align:right}[_nghost-%COMP%] .ql-display .ql-align-justify{text-align:justify}[_nghost-%COMP%] .ql-display--clamped{max-height:4.8em;overflow:hidden}.dpr-page[_ngcontent-%COMP%]{background:#f6f8fb;min-height:100vh;padding:14px 0 60px;color:#0f172a;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial;font-size:13px}.dpr-breadcrumb[_ngcontent-%COMP%]{width:min(1440px,100% - 32px);margin:0 auto 8px}.dpr-sk-wrap[_ngcontent-%COMP%]{width:min(1440px,100% - 32px);margin:0 auto;display:flex;flex-direction:column;gap:12px}.dpr-sk[_ngcontent-%COMP%]{background:linear-gradient(90deg,#f1f5f9 25%,#e2e8f0 50%,#f1f5f9 75%);background-size:300% 100%;animation:_ngcontent-%COMP%_dpr-shimmer 1.4s ease-in-out infinite;border-radius:12px}.dpr-sk--banner[_ngcontent-%COMP%]{height:90px}.dpr-sk--line[_ngcontent-%COMP%]{height:16px;border-radius:6px}.dpr-sk--card[_ngcontent-%COMP%]{height:300px}@keyframes _ngcontent-%COMP%_dpr-shimmer{0%{background-position:100% 0}to{background-position:-100% 0}}.dpr-layout[_ngcontent-%COMP%]{width:min(1440px,100% - 32px);margin:0 auto;display:grid;grid-template-columns:1fr 280px;gap:16px;align-items:flex-start}.dpr-left[_ngcontent-%COMP%]{min-width:0}.dpr-card[_ngcontent-%COMP%]{background:#fff;border:1px solid #e9edf3;border-radius:12px;overflow:hidden;box-shadow:0 2px 8px #0c14280d}.dpr-header[_ngcontent-%COMP%]{padding:0;margin-bottom:12px;border-left:4px solid #2d4a6e;overflow:hidden}.dpr-header__main[_ngcontent-%COMP%]{padding:20px 22px 16px;background:linear-gradient(120deg,#eef3f9 0%,#f5f8fc 100%);border-bottom:1px solid #e2e8f2}.dpr-header__meta[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding:12px 22px;background:#fff}.dpr-header-top[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap}.dpr-header-title-block[_ngcontent-%COMP%]{flex:1;min-width:0}.dpr-title[_ngcontent-%COMP%]{font-size:19px;font-weight:700;color:#1e2d40;margin:0 0 5px;line-height:1.3}
1.dpr-template-name[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#64748b;margin:0}.dpr-template-name[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:14px;color:#2d4a6e}.dpr-meta-row[_ngcontent-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.dpr-meta-item[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:#475569}.dpr-meta-item[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:14px;color:#2d4a6e}.dpr-meta-label[_ngcontent-%COMP%]{font-weight:600;color:#94a3b8;font-size:11px;text-transform:uppercase;letter-spacing:.4px;margin-right:1px}.dpr-meta-sep[_ngcontent-%COMP%]{width:1px;height:14px;background:#e2e8f0;flex-shrink:0}.dpr-decision-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:5px 14px;border-radius:999px;font-size:12px;font-weight:600;border:1.5px solid transparent;white-space:nowrap;flex-shrink:0}.dpr-decision-chip.decision--pending[_ngcontent-%COMP%]{background:#f8fafc;color:#64748b;border-color:#e2e8f0}.dpr-decision-chip.decision--approved[_ngcontent-%COMP%]{background:#f0fdf4;color:#166534;border-color:#bbf7d0}.dpr-decision-chip.decision--rejected[_ngcontent-%COMP%]{background:#fff1f2;color:#9f1239;border-color:#fecdd3}.dpr-decision-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:14px}.dpr-progress[_ngcontent-%COMP%]{margin-bottom:10px;height:4px;background:#edf2fb;border-radius:50px;overflow:hidden}.dpr-progress-bar[_ngcontent-%COMP%]{height:100%;background:#16bf5e;border-radius:50px;transition:width .3s ease}.dpr-step-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.dpr-step-head__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.dpr-step-back-btn[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:8px;border:1px solid #e6eaf2;background:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:border-color .15s,background .15s}.dpr-step-back-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:#f6f8fb;border-color:#c8d0df}.dpr-step-back-btn[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:not-allowed}.dpr-step-title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#0f172a;margin:0 0 2px}.dpr-step-sub[_ngcontent-%COMP%]{font-size:12px;color:#6b7280}.dpr-step-dots[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px;flex-shrink:0}.dpr-dot[_ngcontent-%COMP%]{width:30px;height:30px;border-radius:50%;border:1.5px solid #e2e8f0;background:#fff;display:flex;align-items:center;justify-content:center;font-size:11.5px;font-weight:700;color:#94a3b8;cursor:pointer;transition:all .2s}.dpr-dot[_ngcontent-%COMP%]:hover:not(.dpr-dot--active):not(.dpr-dot--done){border-color:#16bf5e;color:#16bf5e}.dpr-dot--done[_ngcontent-%COMP%]{background:#f0fdf6;border-color:#16bf5e;color:#16bf5e}.dpr-dot--done[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:10px}.dpr-dot--active[_ngcontent-%COMP%]{background:#16bf5e;border-color:#16bf5e;color:#fff;box-shadow:0 4px 12px #16bf5e40}.dpr-section-card[_ngcontent-%COMP%]{overflow:visible}.dpr-section-banner[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:11px 18px;background:linear-gradient(135deg,#16bf5e,#16bf5e);color:#fff;border-radius:12px 12px 0 0}.dpr-section-banner__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.dpr-section-no[_ngcontent-%COMP%]{min-width:28px;height:28px;border-radius:999px;background:rgba(255,255,255,.15);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:12px;padding:0 7px}.dpr-section-title[_ngcontent-%COMP%]{font-weight:600;font-size:13.5px}.dpr-section-tally[_ngcontent-%COMP%]{font-size:11px;opacity:.85;background:rgba(255,255,255,.12);padding:2px 9px;border-radius:999px;white-space:nowrap}.dpr-section-comment-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;background:rgba(255,255,255,.15);padding:2px 9px;border-radius:999px;font-size:11px;font-weight:600}.dpr-section-comment-badge[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:10px}.dpr-body[_ngcontent-%COMP%]{padding:8px 18px 4px}.dpr-thread-block[_ngcontent-%COMP%]{margin-top:10px;padding-top:10px;border-top:1px dashed #e9edf3}.dpr-thread[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;margin-bottom:8px}.dpr-msg[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:flex-start;animation:dpr-slide-in .15s ease;padding:0;border:none;background:transparent}.dpr-msg--user[_ngcontent-%COMP%]{margin-left:42px}
1.dpr-msg__avatar[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:50%;background:#e2e8f0;color:#475569;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:2px}.dpr-msg__avatar--dpo[_ngcontent-%COMP%]{background:#16bf5e;color:#fff}.dpr-msg__body[_ngcontent-%COMP%]{flex:1;min-width:0;width:0}.dpr-msg__head[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0;margin-bottom:6px;width:100%}.dpr-msg__left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;min-width:0;overflow:hidden}.dpr-msg__author[_ngcontent-%COMP%]{font-size:12.5px;font-weight:700;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex-shrink:1}.dpr-msg__role-chip[_ngcontent-%COMP%]{font-size:11px;font-weight:600;padding:2px 8px;border-radius:999px;background:#f1f5f9;color:#475569;white-space:nowrap;flex-shrink:0;border:1px solid #e2e8f0}.dpr-msg__role-chip--dpo[_ngcontent-%COMP%]{background:#dcfce7;color:#166534;border-color:#bbf7d0}.dpr-msg__time[_ngcontent-%COMP%]{font-size:11px;color:#94a3b8;white-space:nowrap;display:flex;align-items:center;gap:4px;justify-content:flex-end;padding-left:12px}.dpr-msg__text[_ngcontent-%COMP%]{font-size:13px;color:#374151;margin:0;line-height:1.6;padding:8px 12px;border-radius:8px;word-break:break-word;display:block;width:100%;box-sizing:border-box;background:#fff;border:1px solid #e2e8f0}.dpr-msg--dpo[_ngcontent-%COMP%] .dpr-msg__text[_ngcontent-%COMP%]{background:#f0fdf4;border-color:#bbf7d0}.dpr-msg--user[_ngcontent-%COMP%] .dpr-msg__text[_ngcontent-%COMP%]{background:#fff;border:1px solid #e2e8f0}.dpr-msg--reply[_ngcontent-%COMP%]{margin-left:0}.dpr-msg-action[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border:none;border-radius:5px;background:transparent;color:#94a3b8;cursor:pointer;margin-left:2px;transition:background .15s,color .15s}.dpr-msg-action[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:10px}.dpr-msg-action[_ngcontent-%COMP%]:hover{background:#f1f5f9;color:#374151}.dpr-msg-action--delete[_ngcontent-%COMP%]:hover{background:#fee2e2;color:#dc2626}.dpr-comment-textarea--edit[_ngcontent-%COMP%]{width:100%;border:1px solid #6b8cff;border-radius:8px;padding:8px 10px;font-size:13px;font-family:inherit;color:#0f172a;background:#fff;resize:vertical;outline:none;box-shadow:0 0 0 3px #6875f51f}.dpr-thread__actions[_ngcontent-%COMP%]{padding-top:4px}.dpr-reply-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:4px 11px;border:1px solid #e2e8f0;border-radius:7px;background:#fff;color:#6b7280;font-size:11.5px;font-weight:500;cursor:pointer;transition:border-color .15s,color .15s,background .15s}.dpr-reply-btn[_ngcontent-%COMP%]:hover{border-color:#94a3b8;color:#334155;background:#f8fafc}.dpr-reply-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:10px}.dpr-comment-trigger[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;padding:4px 11px;border:1px solid #e2e8f0;border-radius:7px;background:#fff;color:#6b7280;font-size:11.5px;font-weight:500;cursor:pointer;transition:border-color .15s,color .15s,background .15s}.dpr-comment-trigger[_ngcontent-%COMP%]:hover{border-color:#16bf5e;color:#16bf5e;background:#f0fdf6}.dpr-comment-trigger[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:10px}.dpr-input-form[_ngcontent-%COMP%]{margin-top:8px;padding:11px 12px;background:#f8fafc;border:1px solid #e9edf3;border-radius:10px;animation:dpr-slide-in .15s ease}.dpr-input-form--reply[_ngcontent-%COMP%]{margin-left:14px;border-left:2px solid #16bf5e;border-radius:0 10px 10px 0;background:#f0fdf6}.dpr-input-form__label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;color:#374151;margin-bottom:7px;flex-wrap:wrap}.dpr-input-form__label[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#16bf5e;font-size:11px}.dpr-input-form__label[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#0f172a}.dpr-input-form__actions[_ngcontent-%COMP%]{display:flex;gap:7px;justify-content:flex-end;margin-top:7px}.dpr-email-hint[_ngcontent-%COMP%]{margin-left:auto;font-size:10.5px;color:#94a3b8;font-weight:400;display:flex;align-items:center;gap:3px}.dpr-email-hint[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:9px}.dpr-comment-form-error[_ngcontent-%COMP%]{font-size:11px;color:#b91c1c;font-weight:600;margin-top:4px}.dpr-thread-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;background:rgba(255,255,255,.18);padding:2px 9px;border-radius:999px;font-size:11px;font-weight:600;white-space:nowrap}.dpr-thread-badge[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:10px}.dpr-thread-summary[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.dpr-ts-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px;padding:5px 0;border-bottom:1px solid #f1f5f9}.dpr-ts-row[_ngcontent-%COMP%]:last-child{border-bottom:none}.dpr-ts-qno[_ngcontent-%COMP%]{background:#edf4ff;color:#2563eb;border-radius:999px;padding:1px 7px;font-size:10.5px;font-weight:700;white-space:nowrap;flex-shrink:0}.dpr-ts-text[_ngcontent-%COMP%]{font-size:11.5px;color:#374151;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dpr-ts-count[_ngcontent-%COMP%]{margin-left:0;flex-shrink:0}.dpr-footer[_ngcontent-%COMP%]{padding:10px 18px 14px;display:flex;align-items:center;justify-content:space-between;position:sticky;bottom:0;background:linear-gradient(180deg,rgba(246,248,251,.4),#fff);border-top:1px solid #eef2f7;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);z-index:5}.dpr-right[_ngcontent-%COMP%]{position:sticky;top:20px;
1display:flex;flex-direction:column;gap:12px}.dpr-panel-card[_ngcontent-%COMP%]{background:#fff;border:1px solid #e9edf3;border-radius:12px;padding:16px 16px 14px;box-shadow:0 2px 8px #0c14280a}.dpr-panel-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:700;color:#0f172a;margin-bottom:12px}.dpr-panel-title[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:12px;color:#16bf5e}.dpr-badge[_ngcontent-%COMP%]{margin-left:auto;background:#f1f5f9;color:#475569;font-size:11px;font-weight:700;padding:1px 7px;border-radius:999px}.dpr-panel-hint[_ngcontent-%COMP%]{font-size:12px;color:#6b7280;margin:0 0 10px;line-height:1.5}.dpr-decision-status[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border-radius:8px;margin-bottom:12px;font-size:12.5px;line-height:1.5}.dpr-decision-status[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:16px;flex-shrink:0;margin-top:1px}.dpr-decision-status[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;font-size:13px;font-weight:700;margin-bottom:2px}.dpr-decision-status[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:#7f1d1d}.dpr-decision-status--rejected[_ngcontent-%COMP%]{background:#fff1f2;border:1px solid #fecdd3;color:#be123c}.dpr-decision-status--rejected[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#e11d48}.dpr-current-decision[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:9px 12px;border-radius:8px;border:1px solid transparent;font-size:13.5px;font-weight:600;margin-bottom:12px}.dpr-current-decision.decision--pending[_ngcontent-%COMP%]{background:#f8fafc;color:#64748b;border-color:#e2e8f0}.dpr-current-decision.decision--pending[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#94a3b8;font-size:15px}.dpr-current-decision.decision--approved[_ngcontent-%COMP%]{background:#f0fdf4;color:#166534;border-color:#bbf7d0}.dpr-current-decision.decision--approved[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#16a34a;font-size:15px}.dpr-current-decision.decision--rejected[_ngcontent-%COMP%]{background:#fff1f2;color:#9f1239;border-color:#fecdd3}.dpr-current-decision.decision--rejected[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#e11d48;font-size:15px}.dpr-decision-btns[_ngcontent-%COMP%]{display:flex;gap:8px}.btn-approve[disabled][_ngcontent-%COMP%], .btn-reject[disabled][_ngcontent-%COMP%]{opacity:.4;cursor:not-allowed;pointer-events:none}.btn-approve[_ngcontent-%COMP%]{background:#fff;border:1.5px solid #86efac;color:#166534;font-weight:600;font-size:13px}.btn-approve[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:13px;color:#16a34a}.btn-approve[_ngcontent-%COMP%]:hover{background:#f0fdf4;border-color:#4ade80}.btn-reject[_ngcontent-%COMP%]{background:#fff;border:1.5px solid #fda4af;color:#9f1239;font-weight:600;font-size:13px}.btn-reject[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:13px;color:#e11d48}.btn-reject[_ngcontent-%COMP%]:hover{background:#fff1f2;border-color:#fb7185}.dpr-comment-textarea[_ngcontent-%COMP%]{width:100%;border:1px solid #e9edf3;background:#f6f8fc;border-radius:10px;padding:9px 12px;font-size:13px;color:#0f172a;resize:vertical;font-family:inherit;transition:border-color .15s,background .15s,box-shadow .15s}.dpr-comment-textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:#6b8cff;background:#fff;box-shadow:0 0 0 3px #6875f51f}.dpr-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;background:rgba(15,23,42,.3);z-index:100;animation:_ngcontent-%COMP%_dpr-fade-in .15s ease}@keyframes _ngcontent-%COMP%_dpr-fade-in{0%{opacity:0}to{opacity:1}}.dpr-confirm-dialog[_ngcontent-%COMP%]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:101;width:min(420px,100vw - 32px);background:#fff;border-radius:14px;padding:28px 24px 22px;box-shadow:0 8px 40px #0f172a24;text-align:center;animation:_ngcontent-%COMP%_dpr-dialog-in .18s ease}.dpr-confirm-dialog__icon[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 14px}.dpr-confirm-dialog__icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:22px}.dpr-confirm-dialog__icon--approve[_ngcontent-%COMP%]{background:#f0fdf4}.dpr-confirm-dialog__icon--approve[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#16a34a}.dpr-confirm-dialog__icon--reject[_ngcontent-%COMP%]{background:#fff1f2}.dpr-confirm-dialog__icon--reject[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#e11d48}.dpr-confirm-dialog__title[_ngcontent-%COMP%]{font-size:17px;font-weight:700;color:#0f172a;margin:0 0 8px}.dpr-confirm-dialog__body[_ngcontent-%COMP%]{font-size:13.5px;color:#64748b;margin:0 0 22px;line-height:1.6}.dpr-confirm-dialog__body[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#0f172a}.dpr-confirm-dialog__actions[_ngcontent-%COMP%]{display:flex;gap:10px;justify-content:flex-end}@keyframes _ngcontent-%COMP%_dpr-dialog-in{0%{opacity:0;transform:translate(-50%,-46%)}to{opacity:1;transform:translate(-50%,-50%)}}
1.btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:8px;font-weight:600;font-size:12.5px;cursor:pointer;border:1px solid transparent;transition:background .15s,border-color .15s,opacity .15s}.btn[disabled][_ngcontent-%COMP%]{opacity:.4;cursor:not-allowed}.btn.ghost[_ngcontent-%COMP%]{background:#fff;border-color:#e9edf3;color:#374151}.btn.ghost[_ngcontent-%COMP%]:hover{background:#f8fafc}.btn.primary[_ngcontent-%COMP%]{background:linear-gradient(135deg,#16bf5e,#16bf5e);border-color:transparent;color:#fff}.btn-sm[_ngcontent-%COMP%]{padding:5px 11px;font-size:12px}.ico[_ngcontent-%COMP%]{width:14px;height:14px}.req[_ngcontent-%COMP%]{color:#ef4444;margin-left:2px;font-weight:700}.q-wrap[_ngcontent-%COMP%]{margin-bottom:12px;padding:10px 0;border-bottom:1px solid #f1f5f9}.q-wrap[_ngcontent-%COMP%]:last-child{border-bottom:none}.q-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:7px;font-weight:500;margin-bottom:8px;font-size:13.5px;line-height:1.5;color:#0f172a;flex-wrap:wrap}.q-help[_ngcontent-%COMP%]{margin-bottom:8px}.q-help__toggle[_ngcontent-%COMP%]{background:none;border:none;padding:0;margin-top:3px;font-size:12px;font-weight:600;color:#2563eb;cursor:pointer;display:inline-block}.q-help__toggle[_ngcontent-%COMP%]:hover{text-decoration:underline}.q-no[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:20px;padding:0 7px;border-radius:999px;background:#edf4ff;color:#2563eb;font-size:10.5px;font-weight:700;flex-shrink:0}.dpr-q-type-badge[_ngcontent-%COMP%]{margin-left:auto;display:inline-flex;align-items:center;gap:4px;font-size:10px;color:#94a3b8;flex-shrink:0}.dpr-q-type-badge[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:9px}.subsection-wrap[_ngcontent-%COMP%]{border:1px solid #eef2f7;border-radius:10px;padding:10px;margin:14px 0;background:#fcfdff}.subsection-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:8px}.sub-collapse[_ngcontent-%COMP%]{width:28px;height:28px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0}.sub-collapse[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:14px;height:14px;transition:transform .15s}.sub-chip-inline[_ngcontent-%COMP%]{background:#eef4ff;color:#3b82f6;border-radius:999px;padding:2px 8px;font-size:11px;font-weight:700;white-space:nowrap}.sub-title-inline[_ngcontent-%COMP%]{font-weight:600;font-size:13.5px;color:#0f172a}.followup-wrap[_ngcontent-%COMP%]{margin-top:14px;padding:14px 16px 14px 20px;border-left:3px solid #a78bfa;background:linear-gradient(135deg,#faf7ff 0%,#f5f3ff 100%);border-radius:0 10px 10px 0;animation:_ngcontent-%COMP%_dpr-fu-slide .18s ease}@keyframes _ngcontent-%COMP%_dpr-fu-slide{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.followup-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-bottom:8px}.followup-header[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{stroke:#7c3aed;flex-shrink:0}.followup-option-label[_ngcontent-%COMP%]{font-size:12px;color:#6d28d9;font-weight:500}.followup-option-label[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:700;color:#4c1d95;background:#ede9fe;padding:1px 6px;border-radius:4px}.followup-prompt[_ngcontent-%COMP%]{display:block;font-size:13.5px;font-weight:600;color:#374151;margin-bottom:10px}.rv-answer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:5px}.rv-answer__label[_ngcontent-%COMP%]{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:#9ca3af}.rv-answer__empty[_ngcontent-%COMP%]{font-size:12.5px;color:#9ca3af;font-style:italic;padding:7px 11px;background:#f8fafc;border:1px dashed #e2e8f0;border-radius:9px}.rv-answer__value[_ngcontent-%COMP%]{width:100%;background:#f6f8fc;border:1px solid #e9edf3;border-radius:10px;padding:9px 12px;font-size:13px;color:#0f172a;line-height:1.6;white-space:pre-wrap;word-break:break-word}.rv-opts[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:5px}.rv-opt[_ngcontent-%COMP%]{display:flex;align-items:center;gap:9px;padding:8px 12px;border-radius:9px;border:1px solid #e9edf3;background:#fff;color:#0f172a;font-size:13px;
1cursor:default;pointer-events:none}.rv-opt--selected[_ngcontent-%COMP%]{background:#f5f0ff;border-color:#b9a8ff;font-weight:600;color:#4e2cd9}.rv-opt__radio[_ngcontent-%COMP%]{width:16px;height:16px;border-radius:50%;border:2px solid #d1d5db;flex-shrink:0;display:flex;align-items:center;justify-content:center}.rv-opt--selected[_ngcontent-%COMP%] .rv-opt__radio[_ngcontent-%COMP%]{border-color:#7c3aed;background:#fff}.rv-opt__radio-inner[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background:#7c3aed}.rv-opt--checkbox[_ngcontent-%COMP%] .rv-opt__checkbox[_ngcontent-%COMP%]{width:16px;height:16px;border-radius:4px;border:2px solid #d1d5db;flex-shrink:0;display:flex;align-items:center;justify-content:center;background:#fff}.rv-opt--checkbox.rv-opt--selected[_ngcontent-%COMP%] .rv-opt__checkbox[_ngcontent-%COMP%]{background:#7c3aed;border-color:#7c3aed}.rv-opt--checkbox.rv-opt--selected[_ngcontent-%COMP%] .rv-opt__checkbox[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:9px;color:#fff}.rv-opt__label[_ngcontent-%COMP%]{flex:1}.rv-opt__tick[_ngcontent-%COMP%]{margin-left:auto}.rv-opt__tick[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:11px;color:#7c3aed}.rule-dep-notice[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px;margin-top:10px;padding:9px 12px;background:#fffbeb;border:1px solid #fde68a;border-radius:6px;font-size:12.5px;color:#92400e;line-height:1.5}.rule-dep-notice__icon[_ngcontent-%COMP%]{font-size:13px;color:#d97706;flex-shrink:0;margin-top:1px}.rule-dep-notice[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600}']}),s})();var ae=x(19688);const La=[{path:"dashboard",component:pn},{path:"templates",component:jt},{path:"template-builder/:mode",component:re,canDeactivate:[ae.c]},{path:"template-builder/:mode/default/:defaultId",component:re,canDeactivate:[ae.c]},{path:"template-builder/:mode/:id",component:re,canDeactivate:[ae.c]},{path:"my-assessments",component:zs},{path:"response/:id",component:Sr},{path:"dpo-review/:id",component:za},{path:"",redirectTo:"dashboard",pathMatch:"full"}];let Ga=(()=>{const a=class{};let s=a;return a.\u0275fac=function(n){return new(n||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({providers:[Q.ez,Q.YP,ze.xA],imports:[v.ez,y.Bz.forChild(La),J.U$,I.hJ,H.j,f.u5,f.UX,R.cc,K.LU,V.nD,$.kW,le.A,Fe.L$,W.S,Ye.Tx,Qe.Ps,De.KZ,z.EV,Ne.D,Je.q4,Re.Nh,$e.T5,Be.V,ce.Cq,Ee.xc,je.d,Le.Gg,Ge.fx,He.gz,Ke.Iu,X.Z_,S._t,Ve.uH,X.Z_]}),s})()},19688:(Ue,G,x)=>{x.d(G,{c:()=>y});var v=x(94650);let y=(()=>{const I=class{canDeactivate(f,R,K,V){const $=f.canDeactivate(f,R,K,V);return!0!==$&&!1!==$?$:!0===$||confirm("You have unsaved changes. If you leave, your changes will be lost.")}};let J=I;return I.\u0275fac=function(R){return new(R||I)},I.\u0275prov=v.Yz7({token:I,factory:I.\u0275fac,providedIn:"root"}),J})()}}]);
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.