1import{b as Ce,c as Me,d as xe,e as be,f as Te,g as ye,h as Se}from"./chunk-MQ774EUV.js";import{a as Ve}from"./chunk-ARC56PBP.js";import{a as ge,c as fe,d as _e,e as ke}from"./chunk-5KMSWIXJ.js";import{a as ve}from"./chunk-HZJFYVH7.js";import{a as he}from"./chunk-74GJVQDZ.js";import{a as pe,b as ue}from"./chunk-6ZTL6GFP.js";import{a as ae,b as le}from"./chunk-LJ6K3IYK.js";import{a as ce,b as de}from"./chunk-HXBGSEHQ.js";import{a as me}from"./chunk-UTYLAOFD.js";import{c as re}from"./chunk-HEKBPXP7.js";import{m as se}from"./chunk-C53UORQN.js";import{i as te}from"./chunk-SJPXSUWQ.js";import{b as j,c as W}from"./chunk-HRCH7YTL.js";import{a as oe}from"./chunk-CJEIUXWH.js";import{H as ee,i as Q,p as X}from"./chunk-3QAVFP5S.js";import{b as ie,c as ne}from"./chunk-LS74OHRZ.js";import{i as Y,j as J,l as K}from"./chunk-NKUORADV.js";import{p as Z}from"./chunk-VJLDJJUQ.js";import{l as G}from"./chunk-224PXFJJ.js";import{p as N}from"./chunk-2K5EWLY6.js";import{$c as R,Aa as g,Ec as d,Fb as L,Gc as x,Nd as z,Qc as O,Sc as F,Vc as a,Wc as V,Xc as P,_c as q,ad as U,dc as I,ed as $,fc as D,fd as A,gc as B,ic as y,jb as b,jc as S,kb as T,kc as m,lb as w,lc as t,mc as i,nc as c,pb as r,qa as p,rc as C,rd as u,sc as M,sd as E,td as f,vc as H,xa as _,ya as k,za as v}from"./chunk-QXK5WLZZ.js";var Pe=(l,h)=>h.postTaskCampaignUserId;function Ae(l,h){if(l&1&&(t(0,"div",46),c(1,"div",47),u(2,"emoji"),u(3,"safe"),c(4,"div",48),u(5,"emoji"),u(6,"safe"),i()),l&2){let e=h.$implicit;r(),m("innerHTML",f(3,4,E(2,2,e.text),"html"),b),r(3),m("innerHTML",f(6,9,E(5,7,e.answer),"html"),b)}}function Ee(l,h){if(l&1&&(c(0,"mat-divider",44),t(1,"div",31)(2,"span",45),a(3,"Responses"),i(),y(4,Ae,7,12,"div",46,B),i()),l&2){let e=x().$implicit;r(4),S(e.questions)}}function we(l,h){if(l&1){let e=H();t(0,"mat-expansion-panel",18)(1,"mat-expansion-panel-header",21)(2,"mat-panel-title",22)(3,"div",23),c(4,"ih-image",24),i(),t(5,"div",25)(6,"div",26),a(7),i(),t(8,"div",27),a(9),i()()(),t(10,"mat-panel-description",28)(11,"mat-checkbox",29),U("ngModelChange",function(o){let s=_(e).$implicit;return R(s.selected,o)||(s.selected=o),k(o)}),d("click",function(o){_(e);let s=x();return k(s.checkChanged(o))}),i()()(),t(12,"div",30)(13,"div",31)(14,"div",32)(15,"mat-icon",33),v(),t(16,"svg",34),c(17,"path",35),i()(),g(),t(18,"a",36),a(19),i()(),t(20,"div",32)(21,"mat-icon",33),v(),t(22,"svg",37),c(23,"path",38),i()(),g(),t(24,"a",36),a(25),i()(),t(26,"div",39),u(27,"date"),t(28,"mat-icon",33),v(),t(29,"svg",40),c(30,"path",41),i()(),g(),t(31,"span"),a(32,"Applied "),c(33,"ih-time-ago",42),i()()(),I(34,Ee,6,0),i(),t(35,"mat-action-row")(36,"button",43),d("click",function(){let o=_(e).$implicit,s=x();return k(s.removeSelected(o.postTaskCampaignUserId))}),a(37," Remove "),i()()()}if(l&2){let e=h.$implicit;r(4),m("imageInfo",e.image),r(3),P(" ",e.fullName||"Name unavailable"," "),r(2),P(" ",e.email||"Email unavailable"," "),r(2),m("checked",e.selected),q("ngModel",e.selected),r(7),m("href",A("mailto:",e.email),T),r(),V(e.email),r(5),m("href",A("tel:",e.phone),T),r(),V(e.phone),r(),m("title",$(f(27,15,e.createdAt,"medium"))),r(7),m("value",e.createdAt),r(),D(e.questions.length>0?34:-1)}}var dt=(()=>{class l{hostClass=!0;data=p(ne);dialogRef=p(ie);http=p(N);cd=p(z);snackbar=p(se);time=p(te);constructor(){this.postId=this.data.postId,this.postTaskId=this.data.postTaskId}selectedVolunteers=[];volunteers=[];postId;postTaskId;loading=!1;exportUrl="";query={page:1,limit:20,order:"postTaskCampaignUserId"};ngOnInit(){this.getVolunteers()}selectAll(){this.volunteers.forEach(e=>{e.selected=!0}),this.selectedVolunteers=this.volunteers,this.cd.markForCheck()}removeSelected(e){this.http.delete(`/api/posts/${this.postId}/tasks/${this.postTaskId}/volunteers`,{body:e?[e]:this.selectedVolunteers.map(n=>n.postTaskCampaignUserId)}).subscribe(()=>{this.volunteers=this.volunteers.filter(n=>e?e!==n.postTaskCampaignUserId:!this.selectedVolunteers.find(o=>o.postTaskCampaignUserId===n.postTaskCampaignUserId)),this.volunteers.length===0?this.dialogRef.close():this.selectedVolunteers=e?this.selectedVolunteers.filter(n=>n.postTaskCampaignUserId!==e):[],this.cd.markForCheck(),this.snackbar.open("Volunteer(s) removed")},()=>(this.loading=!1,this.snackbar.open("Unable to delete volunteer(s)","TRY AGAIN").then(n=>n.onAction().subscribe(()=>this.removeSelected()))))}export(){let e=new URLSearchParams;e.set("orderBy",this.query.order.replace("-","")),e.set("desc",(this.query.order.indexOf("-")!==-1).toString()),e.set("d",new Date().toString()),this.exportUrl=`/api/posts/${this.postId}/tasks/${this.postTaskId}/volunteers/export?tz=${this.time.getBrowserTimeZone()}&`+e,this.cd.markForCheck()}getVolunteers(){this.loading=!0,this.cd.markForCheck(),this.http.get(`/api/posts/${this.postId}/tasks/${this.postTaskId}/volunteers`,{params:{skip:(this.query.page-1)*this.query.limit,limit:this.query.limit,orderBy:this.query.order.replace("-",""),desc:this.query.order.indexOf("-")!==-1}}).subscribe(e=>
1{this.loading=!1,this.volunteers=e,this.volunteers.forEach(n=>{n.createdAt=this.time.fromUtc(n.createdAt)}),this.cd.markForCheck()},()=>(this.loading=!1,this.snackbar.open("Unable to get volunteers","TRY AGAIN").then(e=>e.onAction().subscribe(()=>this.getVolunteers()))))}checkChanged(e){e.stopPropagation(),setTimeout(()=>{this.selectedVolunteers=this.volunteers.filter(n=>n.selected),this.cd.markForCheck()})}sortBy(e){this.query.order=e,this.getVolunteers()}cancel(){this.dialogRef.close()}static \u0275fac=function(n){return new(n||l)};static \u0275cmp=L({type:l,selectors:[["ih-post-task-volunteer-list-dialog"]],hostVars:2,hostBindings:function(n,o){n&2&&F("ih-post-task-volunteer-list-dialog",o.hostClass)},decls:32,vars:8,consts:[["volunteerMenu",""],[3,"scrollable"],["ih-header",""],[1,"post-task-volunteer-list-title"],[1,"fx-flex"],["mat-icon-button","","aria-label","Open manage volunteer menu",3,"matMenuTriggerFor"],["id","dots-vertical","viewBox","0 0 24 24"],["fill","currentColor","d","M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"],["xPosition","before"],["mat-menu-item","","aria-label","Select all volunteers",3,"click"],["mat-menu-item","","aria-label","Export volunteer list",3,"click"],["mat-menu-item","","aria-label","Remove selected volunteers",3,"click","disabled"],["mat-menu-item","","aria-label","Sort volunteers by name",3,"click"],["mat-menu-item","","aria-label","Sort volunteers by date",3,"click"],["ih-content",""],["id","export",2,"display","none",3,"src"],["mode","indeterminate",3,"hidden"],[1,"post-task-volunteer-list-accordion"],["hideToggle","",1,"post-task-volunteer-list-user-item"],["ih-footer",""],["mat-button","","type","button",3,"click"],[1,"post-task-volunteer-list-user-item-header","fx-layout-row","fx-layout-align-start-center"],[1,"fx-layout-row","fx-layout-align-start-center"],[1,"volunteer-img-container","fx-layout-column"],[1,"volunteer-img",3,"imageInfo"],[1,"volunteer-detail-row","fx-layout-column"],[1,"volunteer-fullname"],[1,"volunteer-email"],[1,"post-task-volunteer-list-user-item-description","fx-layout-align-end-center"],[1,"",3,"ngModelChange","click","checked","ngModel"],[1,"fx-layout-column"],[1,"volunteer-detail-section"],[1,"volunteer-detail-section-line","fx-layout-align-start-center"],[1,"volunteer-detail-section-icon"],["id","email-outline","viewBox","0 0 24 24"],["d","M22 6C22 4.9 21.1 4 20 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6M20 6L12 11L4 6H20M20 18H4V8L12 13L20 8V18Z"],[3,"href"],["id","phone","viewBox","0 0 24 24"],["d","M6.62,10.79C8.06,13.62 10.38,15.94 13.21,17.38L15.41,15.18C15.69,14.9 16.08,14.82 16.43,14.93C17.55,15.3 18.75,15.5 20,15.5A1,1 0 0,1 21,16.5V20A1,1 0 0,1 20,21A17,17 0 0,1 3,4A1,1 0 0,1 4,3H7.5A1,1 0 0,1 8.5,4C8.5,5.25 8.7,6.45 9.07,7.57C9.18,7.92 9.1,8.31 8.82,8.59L6.62,10.79Z"],[1,"volunteer-detail-section-line","fx-layout-align-start-center",3,"title"],["id","calendar","viewBox","0 0 24 24"],["d","M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z"],[3,"value"],["mat-flat-button","","color","primary",1,"volunteer-edit-btn",3,"click"],[1,"volunteer-info-divider"],[1,"volunteer-detail-section-label"],["dir","auto",1,"volunteer-detail-section-line"],[1,"volunteer-question",3,"innerHTML"],[1,"volunteer-question-answer",3,"innerHTML"]],template:function(n,o){if(n&1&&(t(0,"ih-basic-dialog",1),C(1,2),t(2,"div",3),a(3,"Manage volunteers"),i(),c(4,"div",4),t(5,"button",5)(6,"mat-icon"),v(),t(7,"svg",6),c(8,"path",7),i()()(),g(),t(9,"mat-menu",8,0)(11,"button",9),d("click",function(){return o.selectAll()}),a(12,"Select all"),i(),t(13,"button",10),d("click",function(){return o.export()}),a(14,"Export all"),i(),t(15,"button",11),d("click",function(){return o.removeSelected()}),a(16," Remove selected "),i(),c(17,"mat-divider"),t(18,"button",12),d("click",function(){return o.sortBy("name")}),a(19,"Sort by name"),i(),t(20,"button",13),d("click",function(){return o.sortBy("createdAt")}),a(21,"Sort by date"),i()(),M(),C(22,14),c(23,"iframe",15),u(24,"safe"),c(25,"mat-progress-bar",16),t(26,"mat-accordion",17),y(27,we,38,18,"mat-expansion-panel",18,Pe),i(),M(),C(29,19),t(30,"button",20),d("click",function(){return o.cancel()}),a(31,"Close"),i(),M(),i()),n&2){let s=O(10);m("scrollable",!0),r(5),m("matMenuTriggerFor",s),r(10),m("disabled",o.selectedVolunteers.length===0),r(8),m("src",f(24,5,o.exportUrl,"resourceUrl"),w),r(2),m("hidden",!o.loading),r(2),S(o.volunteers)}},dependencies:[ee,Q,X,K,Z,J,Y,ue,pe,le,ae,Se,ye,Ce,Me,xe,Te,be,W,j,ke,fe,ge,_e,de,ce,re,oe,me,Ve,G,ve,he],styles:[".volunteer-question[_ngcontent-%COMP%]{font-weight:700}.post-task-volunteer-list-user-item-description[_ngcontent-%COMP%]{margin:0}.post-task-volunteer-list-user-item[_ngcontent-%COMP%], .post-task-volunteer-list-user-item-header[_ngcontent-%COMP%]{min-height:64px}.volunteer-img[_ngcontent-%COMP%]{border-radius:28px;height:40px;margin:8px 16px 8px 0;width:40px;overflow:hidden}.volunteer-fullname[_ngcontent-%COMP%]{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1.volunteer-email[_ngcontent-%COMP%]{color:#777;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.volunteer-detail-section[_ngcontent-%COMP%] .volunteer-detail-section-label[_ngcontent-%COMP%]{color:#777}.volunteer-detail-section[_ngcontent-%COMP%] .volunteer-detail-section-line[_ngcontent-%COMP%]:not(:last-of-type){padding-bottom:12px}.volunteer-detail-section[_ngcontent-%COMP%] .volunteer-detail-section-icon[_ngcontent-%COMP%]{margin-right:8px}.volunteer-info-divider[_ngcontent-%COMP%]{margin:12px 0}"],changeDetection:0})}return l})();export{dt as a}; 2/**i18n:c9e569e2ecdb3e0de183c72d8315eadfdcb9da9e09d5ac2d9fef9056c1853e21*/
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.