1import {S}from'./chunk-AvbB3w2y.js';import {P}from'./chunk-pRrHZbYH.js';import {c as ce}from'./chunk-Cha4_V9g.js';import'./chunk-yuXVPJRt.js';import {c8 as Xr,E,D as D$1,H,cY as O$1,aE as lt$1,O as O$2,aN as Rd,h as c$1,b as gr,bQ as P$1,K as Kb,k as Kv,T as Tt,B as Vs,C as zs,P as Pg,V as Vg,l as b0,L as L0,Y as Yx,m as dn,n as Vw,o as nk,t as td,p as tC,q as bC,s as sv,N as NC,X as XC,_ as _D,r as il,u as XD,cj as $D,ck as Bu,gK as QD,cl as Nu,cm as KD,fk as YD,v as rM,F as Fb,w as t1,y as A1,c$ as N_,cS as z_,cT as T1,z as gS,J as NS,Z as ZS,M as EI,Q as us,R as ms,S as HI,U as ZI,$ as Dn,a0 as kE,a1 as Jv,a2 as go,a3 as qd,a4 as YE,a5 as OT,a6 as lA,cA as zM,a7 as mt$1,a8 as cy,aa as Xs,aB as Qm,ab as my,ac as V_,ad as hd,ae as fS,a9 as qT,ai as ay,bC as tS,ag as _C,aj as ky,al as hS,ah as ZT,ak as Dd,af as KT,aV as QT,am as XT,aT as l_,aR as o_,aS as Pp,aU as Lp,bg as gS$1}from'./main-CTPND76J.js';import {R as Ri}from'./chunk-CLFEoJNz.js';import'./chunk-CAH8VGMK.js';var We=()=>["Review each pending suggestion and either publish it or reject it.","Published suggestions become visible to every client and open for voting.","Move a suggestion to Developed once it has actually shipped \u2014 that closes voting on it."],D=()=>[1,2,3,4,5,6],O=(e,r)=>r.id,$=(e,r)=>r.fileName;function Xe(e,r){e&1&&(Xs(0,"div",10)(1,"mat-icon"),V_(2,"pending_actions"),hd()(),V_(3),fS(4,"translate")),e&2&&(_C(3),Dd(" ",hS(4,1,"Pending suggestions")," "));}function Ye(e,r){e&1&&cy(0,"app-skeleton-loader",11),e&2&&ay("rounded",true);}function Ze(e,r){e&1&&(Xs(0,"div",5),KT(1,Ye,1,1,"app-skeleton-loader",11,QT),hd()),e&2&&(_C(),XT(tS(0,D)));}function et(e,r){e&1&&(Xs(0,"div",6),V_(1),fS(2,"translate"),hd()),e&2&&(_C(),Dd(" ",hS(2,1,"No pending suggestions")," "));}function tt(e,r){e&1&&(Xs(0,"mat-icon"),V_(1,"attach_file"),hd());}function it(e,r){if(e&1){let t=o_();Xs(0,"button",19),my("click",function(){let l=Pp(t).$implicit,p=l_(2).$implicit,_=l_(2);return Lp(_.downloadAttachment(p.id,l))}),Xs(1,"mat-icon",20),V_(2,"attachment"),hd(),V_(3),hd();}if(e&2){let t=r.$implicit;_C(3),Dd(" ",t.fileName," ");}}function nt(e,r){if(e&1&&(Xs(0,"div",15),KT(1,it,4,1,"button",18,$),hd()),e&2){let t=l_().$implicit;_C(),XT(t.attachments);}}function ot(e,r){if(e&1){let t=o_();Xs(0,"mat-expansion-panel")(1,"mat-expansion-panel-header")(2,"mat-panel-title",12),V_(3),hd(),Xs(4,"mat-panel-description",13)(5,"span"),V_(6),hd(),qT(7,tt,2,0,"mat-icon"),hd()(),Xs(8,"div",14),V_(9),hd(),qT(10,nt,3,0,"div",15),Xs(11,"mat-action-row")(12,"button",16),my("click",function(){let l=Pp(t).$implicit,p=l_(2);return Lp(p.moderate(l,false))}),Xs(13,"mat-icon"),V_(14,"close"),hd(),V_(15),fS(16,"translate"),hd(),Xs(17,"button",17),my("click",function(){let l=Pp(t).$implicit,p=l_(2);return Lp(p.moderate(l,true))}),Xs(18,"mat-icon"),V_(19,"check"),hd(),V_(20),fS(21,"translate"),hd()()();}if(e&2){let t=r.$implicit,d=l_(2);_C(3),Dd(" ",t.title," "),_C(3),ky(t.categoryName),_C(),ZT(t.attachments?.length?7:-1),_C(2),Dd(" ",t.description," "),_C(),ZT(t.attachments?.length?10:-1),_C(2),ay("disabled",d.busyId===t.id),_C(3),Dd(" ",hS(16,9,"Reject")," "),_C(2),ay("disabled",d.busyId===t.id),_C(3),Dd(" ",hS(21,11,"Approve & publish")," ");}}function at(e,r){if(e&1&&(Xs(0,"div",5)(1,"mat-accordion"),KT(2,ot,22,13,"mat-expansion-panel",null,O),hd()()),e&2){let t=l_();_C(2),XT(t.pending);}}function rt(e,r){e&1&&(Xs(0,"div",10)(1,"mat-icon"),V_(2,"public"),hd(),Xs(3,"span"),V_(4),fS(5,"translate"),hd()()),e&2&&(_C(4),ky(hS(5,1,"Published on the board")));}function lt(e,r){e&1&&cy(0,"app-skeleton-loader",11),e&2&&ay("rounded",true);}function dt(e,r){e&1&&(Xs(0,"div",5),KT(1,lt,1,1,"app-skeleton-loader",11,QT),hd()),e&2&&(_C(),XT(tS(0,D)));}function pt(e,r){e&1&&(Xs(0,"mat-icon"),V_(1,"attach_file"),hd());}function st(e,r){if(e&1){let t=o_();Xs(0,"button",19),my("click",function(){let l=Pp(t).$implicit,p=l_(2).$implicit,_=l_(2);return Lp(_.downloadAttachment(p.id,l))}),Xs(1,"mat-icon",20),V_(2,"attachment"),hd(),V_(3),hd();}if(e&2){let t=r.$implicit;_C(3),Dd(" ",t.fileName," ");}}function ct(e,r){if(e&1&&(Xs(0,"div",15),KT(1,st,4,1,"button",18,$),hd()),e&2){let t=l_().$implicit;_C(),XT(t.attachments);}}
1function mt(e,r){if(e&1){let t=o_();Xs(0,"mat-expansion-panel")(1,"mat-expansion-panel-header")(2,"mat-panel-title",12),V_(3),hd(),Xs(4,"mat-panel-description",13)(5,"div",10)(6,"span"),V_(7),fS(8,"translate"),hd(),Xs(9,"span",21)(10,"mat-icon"),V_(11,"thumb_up"),hd(),V_(12),hd(),Xs(13,"span",22)(14,"mat-icon"),V_(15,"thumb_down"),hd(),V_(16),hd()(),qT(17,pt,2,0,"mat-icon"),hd()(),Xs(18,"div",14),V_(19),hd(),qT(20,ct,3,0,"div",15),Xs(21,"mat-action-row")(22,"button",16),my("click",function(l){let p=Pp(t).$implicit,_=l_(2);return l.stopPropagation(),Lp(_.removeFromBoard(p))}),Xs(23,"mat-icon"),V_(24,"delete"),hd(),V_(25),fS(26,"translate"),hd()()();}if(e&2){let t=r.$implicit,d=l_(2);_C(3),Dd(" ",t.title," "),_C(4),ky(hS(8,9,t.categoryName)),_C(5),Dd(" ",t.upvoteCount," "),_C(4),Dd(" ",t.downvoteCount," "),_C(),ZT(t.attachments?.length?17:-1),_C(2),Dd(" ",t.description," "),_C(),ZT(t.attachments?.length?20:-1),_C(2),ay("disabled",d.busyId===t.id),_C(3),Dd(" ",hS(26,11,"Remove from board")," ");}}function ut(e,r){if(e&1&&(Xs(0,"div",7)(1,"mat-accordion"),KT(2,mt,27,13,"mat-expansion-panel",null,O),hd()()),e&2){let t=l_();_C(2),XT(t.published);}}function _t(e,r){e&1&&(Xs(0,"div",6),V_(1),fS(2,"translate"),hd()),e&2&&(_C(),ky(hS(2,1,"No published suggestions")));}function ft(e,r){e&1&&(Xs(0,"div",10)(1,"mat-icon"),V_(2,"task_alt"),hd(),Xs(3,"span"),V_(4),fS(5,"translate"),hd()()),e&2&&(_C(4),ky(hS(5,1,"Developed")));}function xt(e,r){e&1&&cy(0,"app-skeleton-loader",11),e&2&&ay("rounded",true);}function gt(e,r){e&1&&(Xs(0,"div",5),KT(1,xt,1,1,"app-skeleton-loader",11,QT),hd()),e&2&&(_C(),XT(tS(0,D)));}function ht(e,r){if(e&1&&(Xs(0,"span",23),V_(1),fS(2,"date"),hd()),e&2){let t=l_().$implicit;_C(),ky(gS$1(2,1,t.developedOn,"mediumDate"));}}function Ct(e,r){e&1&&(Xs(0,"mat-icon"),V_(1,"attach_file"),hd());}function vt(e,r){if(e&1){let t=o_();Xs(0,"button",19),my("click",function(){let l=Pp(t).$implicit,p=l_(2).$implicit,_=l_(2);return Lp(_.downloadAttachment(p.id,l))}),Xs(1,"mat-icon",20),V_(2,"attachment"),hd(),V_(3),hd();}if(e&2){let t=r.$implicit;_C(3),Dd(" ",t.fileName," ");}}function Mt(e,r){if(e&1&&(Xs(0,"div",15),KT(1,vt,4,1,"button",18,$),hd()),e&2){let t=l_().$implicit;_C(),XT(t.attachments);}}function bt(e,r){if(e&1){let t=o_();Xs(0,"mat-expansion-panel")(1,"mat-expansion-panel-header")(2,"mat-panel-title",12),V_(3),hd(),Xs(4,"mat-panel-description",13)(5,"div",10)(6,"span"),V_(7),fS(8,"translate"),hd(),Xs(9,"span",21)(10,"mat-icon"),V_(11,"thumb_up"),hd(),V_(12),hd(),Xs(13,"span",22)(14,"mat-icon"),V_(15,"thumb_down"),hd(),V_(16),hd(),qT(17,ht,3,4,"span",23),hd(),qT(18,Ct,2,0,"mat-icon"),hd()(),Xs(19,"div",14),V_(20),hd(),qT(21,Mt,3,0,"div",15),Xs(22,"mat-action-row")(23,"button",16),my("click",function(l){let p=Pp(t).$implicit,_=l_(2);return l.stopPropagation(),Lp(_.removeFromBoard(p))}),Xs(24,"mat-icon"),V_(25,"delete"),hd(),V_(26),fS(27,"translate"),hd()()();}if(e&2){let t=r.$implicit,d=l_(2);_C(3),Dd(" ",t.title," "),_C(4),ky(hS(8,10,t.categoryName)),_C(5),Dd(" ",t.upvoteCount," "),_C(4),Dd(" ",t.downvoteCount," "),_C(),ZT(t.developedOn?17:-1),_C(),ZT(t.attachments?.length?18:-1),_C(2),Dd(" ",t.description," "),_C(),ZT(t.attachments?.length?21:-1),_C(2),ay("disabled",d.busyId===t.id),_C(3),Dd(" ",hS(27,12,"Remove from board")," ");}}function St(e,r){if(e&1&&(Xs(0,"div",7)(1,"mat-accordion"),KT(2,bt,28,14,"mat-expansion-panel",null,O),hd()()),e&2){let t=l_();_C(2),XT(t.developed);}}function Et(e,r){e&1&&(Xs(0,"div",6),V_(1),fS(2,"translate"),hd()),e&2&&(_C(),ky(hS(2,1,"No developed suggestions")));}var Ei=(()=>{class e{constructor(t,d,l,p,_,B,I,Qe){this.service=t,this.support=d,this.toast=l,this.translate=p,this.cdr=_,this.dialogConfigService=B,this.dialog=I,this.loadingService=Qe,this.pending=[],this.published=[],this.developed=[],this.loading=false,this.loadingPublished=false,this.loadingDeveloped=false,this.busyId=null;}downloadAttachment(t,d){this.support.downloadAttachment(t,d.id).subscribe({next:l=>{let p=URL.createObjectURL(l),_=document.createElement("a");_.href=p,_.download=d.fileName,_.click(),URL.revokeObjectURL(p);},error:l=>this.toast.error(l?.message)});}ngOnInit(){this.load(),this.loadPublished(),this.loadDeveloped();}load(){this.loading=true,this.loadingService.beginSuppress(),this.service.getPending().pipe(Xr(()=>{this.loading=false,this.loadingService.endSuppress(),this.cdr.detectChanges();})).subscribe({next:t=>{this.pending=t?.succeeded?t.data||[]:[],this.cdr.detectChanges();},error:()=>{this.pending=[];}});}loadPublished(){this.loadingPublished=true,this.loadingService.beginSuppress(),this.service.getPublicSuggestions(1,100).pipe(Xr(()=>{this.loadingPublished=false,this.loadingService.endSuppress(),this.cdr.detectChanges();})).subscribe({next:t=>{this.published=t?.succeeded?t.data||[]:[],this.cdr.detectChanges();},error:()=>{this.published=[];}});}loadDeveloped(){this.loadingDeveloped=true,this.loadingService.beginSuppress(),this.service.getPublicSuggestions(1,100,true).pipe(Xr(()=>{this.loadingDeveloped=false,this.loadingService.endSuppress(),this.cdr.detectChanges();})).subscribe({next:t=>{this.developed=t?.succeeded?t.data||[]:[],this.cdr.detectChanges();},error:()=>{this.developed=[];}});}moderate(t,d){this.busyId||(this.busyId=t.id,this.service.moderate(t.id,d).pipe(Xr(()=>{this.busyId=null,this.cdr.detectChanges();})).subscribe({next:l=>{l?.succeeded&&(this.pending=this.pending.filter(p=>p.id!==t.id),d&&this.loadPublished(),this.toast.success("Completed Successfully"),this.cdr.detectChanges());}}
1));}removeFromBoard(t){let d=this.dialogConfigService.getDefaultDialogConfig();this.dialog.open(Ri,E(D$1({data:true},d),{width:"400px"})).afterClosed().subscribe(p=>{if(p){this.busyId=t.id,this.cdr.detectChanges();this.service.moderate(t.id,false).pipe(Xr(()=>{this.busyId=null,this.cdr.detectChanges();})).subscribe({next:B=>{B?.succeeded&&(this.published=this.published.filter(I=>I.id!==t.id),this.developed=this.developed.filter(I=>I.id!==t.id),this.toast.success("Completed Successfully"),this.cdr.detectChanges());}});}});}static{this.\u0275fac=function(d){return new(d||e)(H(P),H(O$1),H(lt$1),H(O$2),H(Rd),H(c$1),H(gr),H(P$1))};}static{this.\u0275cmp=Kb({type:e,selectors:[["app-support-moderation"]],decls:42,vars:17,consts:[["helpKey","admin-support-moderation","intro","Suggestions submitted by clients, waiting for you to decide whether they go on the public board.","warning","Publishing is public to all clients immediately. Check for customer names or private details before approving.",3,"steps"],[1,"st-mod-page"],["mat-tab-label",""],[1,"d-flex","justify-content-end","mt-4","mb-3"],["mat-flat-button","","color","primary",3,"click"],[1,"st-mod-list","mt-3"],[1,"st-empty"],[1,"st-mod-list"],[1,"d-flex","align-items-center","justify-content-space-between","mt-4","mb-3"],[1,"st-mod-desc"],[1,"d-flex","align-items-center","gap-8"],["type","custom","width","100%","height","48px",3,"rounded"],[2,"font-weight","500","font-size","16px"],[1,"d-flex","align-items-center","justify-content-space-between"],[1,"st-mod-desc","mt-2","mb-3"],[1,"st-att-list","mb-3"],["mat-stroked-button","","color","warn",3,"click","disabled"],["mat-flat-button","","color","primary",3,"click","disabled"],["mat-stroked-button","",1,"me-2","mb-2"],["mat-stroked-button","",1,"me-2","mb-2",3,"click"],[2,"font-size","18px"],[1,"d-flex","align-items-center","gap-4",2,"color","#2e7d32"],[1,"d-flex","align-items-center","gap-4",2,"color","#c62828"],[2,"color","#14633a"]],template:function(d,l){d&1&&(cy(0,"app-page-help",0),Xs(1,"div",1)(2,"mat-tab-group")(3,"mat-tab"),Qm(4,Xe,5,3,"ng-template",2),Xs(5,"div",3)(6,"button",4),my("click",function(){return l.load()}),Xs(7,"mat-icon"),V_(8,"sync"),hd(),Xs(9,"span"),V_(10),fS(11,"translate"),hd()()(),qT(12,Ze,3,1,"div",5)(13,et,3,3,"div",6)(14,at,4,0,"div",5),hd(),Xs(15,"mat-tab"),Qm(16,rt,6,3,"ng-template",2),Xs(17,"div",3)(18,"button",4),my("click",function(){return l.loadPublished()}),Xs(19,"mat-icon"),V_(20,"sync"),hd(),Xs(21,"span"),V_(22),fS(23,"translate"),hd()()(),qT(24,dt,3,1,"div",5)(25,ut,4,0,"div",7)(26,_t,3,3,"div",6),hd(),Xs(27,"mat-tab"),Qm(28,ft,6,3,"ng-template",2),Xs(29,"div",8)(30,"span",9),V_(31),fS(32,"translate"),hd(),Xs(33,"button",4),my("click",function(){return l.loadDeveloped()}),Xs(34,"mat-icon"),V_(35,"sync"),hd(),Xs(36,"span"),V_(37),fS(38,"translate"),hd()()(),qT(39,gt,3,1,"div",5)(40,St,4,0,"div",7)(41,Et,3,3,"div",6),hd()()()),d&2&&(ay("steps",tS(16,We)),_C(10),ky(hS(11,8,"Refresh")),_C(2),ZT(l.loading?12:l.pending.length?14:13),_C(10),ky(hS(23,10,"Refresh")),_C(2),ZT(l.loadingPublished?24:l.published.length?25:26),_C(7),ky(hS(32,12,"A suggestion moves here automatically when its ticket is resolved or closed")),_C(6),ky(hS(38,14,"Refresh")),_C(2),ZT(l.loadingDeveloped?39:l.developed.length?40:41));},dependencies:[ce,Kv,Tt,Vs,zs,S,Pg,Vg,b0,L0,Yx,dn,Vw,nk,td,tC,bC,sv,NC,XC,_D,il,XD,$D,Bu,QD,Nu,KD,YD,rM,Fb,t1,A1,N_,z_,T1,gS,NS,ZS,EI,us,ms,HI,ZI,Dn,kE,Jv,go,qd,YE,OT,lA,zM,mt$1],styles:[".st-mod-page[_ngcontent-%COMP%]{padding:16px}.st-mod-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.st-mod-head[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:var(--font-size-xl);font-weight:600}.st-mod-head-2[_ngcontent-%COMP%]{margin-top:28px;border-top:1px solid rgba(0,0,0,.08);padding-top:20px}.st-center[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:40px 0}.st-empty[_ngcontent-%COMP%]{padding:40px;text-align:center;color:var(--mat-sys-on-surface-variant, var(--color-text-muted))}.st-mod-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.st-mod-card[_ngcontent-%COMP%]{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;padding:16px;border:1px solid rgba(0,0,0,.08);border-radius:var(--radius-lg);background:#fff}.st-mod-main[_ngcontent-%COMP%]{flex:1;min-width:0}.st-mod-title[_ngcontent-%COMP%]{font-weight:600;margin-bottom:4px}.st-mod-cat[_ngcontent-%COMP%]{font-size:var(--font-size-xs);color:var(--color-primary);margin-bottom:8px}.st-mod-desc[_ngcontent-%COMP%]{font-size:var(--font-size-sm);color:#555;white-space:pre-wrap;line-height:1.6}.st-mod-actions[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;flex-shrink:0}.st-att-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.st-att[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.12);background:var(--color-surface-2);border-radius:var(--radius-card);padding:4px 10px;font-size:var(--font-size-xs);cursor:pointer;color:#333}.st-att[_ngcontent-%COMP%]:hover{background:var(--color-border)}"],changeDetection:1});}}return e})();export{Ei as SupportModerationComponent};
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.