@knoflows/engine 0.1.0-alpha.10 → 0.1.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine.js +12 -12
- package/package.json +1 -1
- package/static/assets/i18n/en.json +18 -0
- package/static/assets/i18n/es.json +18 -0
- package/static/{chunk-BFkZ796p.js → chunk-03U2wfYJ.js} +1 -1
- package/static/{chunk-jct1_zOr.js → chunk-6rAx_awr.js} +1 -1
- package/static/{chunk-3mppll1n.js → chunk-BGEuPXoV.js} +1 -1
- package/static/{chunk-hZzW00VR.js → chunk-BLVF0pVH.js} +1 -1
- package/static/{chunk-CJRNatUw.js → chunk-BfWasMGf.js} +1 -1
- package/static/{chunk-B8MrNxxk.js → chunk-Bvpl_AF9.js} +1 -1
- package/static/{chunk-CEcbtdnK.js → chunk-C2eCmH-q.js} +1 -1
- package/static/{chunk-DjibVmY7.js → chunk-CAjGF9LB.js} +1 -1
- package/static/{chunk-BAc0DRm8.js → chunk-CT8olEiD.js} +1 -1
- package/static/chunk-CUsAuTTX.js +1 -0
- package/static/chunk-CgXl_TS9.js +1 -0
- package/static/{chunk-BbcTWKT2.js → chunk-CqGGDoIh.js} +1 -1
- package/static/{chunk-tYnBYi0l.js → chunk-Crj-4pl_.js} +1 -1
- package/static/{chunk-DNOjVPY0.js → chunk-Ct30cLzT.js} +1 -1
- package/static/{chunk-wbdetocK.js → chunk-Cw0wBuEr.js} +3 -3
- package/static/chunk-CxICQyU8.js +1 -0
- package/static/{chunk-B2hO-qT3.js → chunk-DGHakffX.js} +1 -1
- package/static/chunk-DIakbH9x.js +1 -0
- package/static/{chunk-BjZIiizu.js → chunk-DIntI-KR.js} +1 -1
- package/static/{chunk-W5GAgssE.js → chunk-DPWE5cPY.js} +1 -1
- package/static/{chunk-Cd8F2jeN.js → chunk-DU6MKU0d.js} +1 -1
- package/static/{chunk-Cf_xd8ER.js → chunk-DUR5PalP.js} +1 -1
- package/static/{chunk-2KSNHCgb.js → chunk-DWLHaSHg.js} +1 -1
- package/static/{chunk-CDWIMt6y.js → chunk-D_R_EFd2.js} +1 -1
- package/static/{chunk-Ojn34cvU.js → chunk-DinAvqzQ.js} +1 -1
- package/static/{chunk-CWbxWv5I.js → chunk-DlsGU_Dk.js} +1 -1
- package/static/{chunk-DblClAqu.js → chunk-DwA32gts.js} +1 -1
- package/static/{chunk-DQnMulwi.js → chunk-IOVwMLns.js} +1 -1
- package/static/{chunk-cHfOiAJm.js → chunk-L_FnMwpH.js} +1 -1
- package/static/{chunk-XLpSkczx.js → chunk-NAyA7aWR.js} +1 -1
- package/static/{chunk-eSxb3-OU.js → chunk-TNH96m0D.js} +1 -1
- package/static/{chunk-CJDp11v5.js → chunk-Vz5kd858.js} +1 -1
- package/static/{chunk-BUuwGTt7.js → chunk-dUlsh7QS.js} +6 -6
- package/static/{chunk-A4AkMf2s.js → chunk-h3oyPsBC.js} +1 -1
- package/static/{chunk-BVw7xkK9.js → chunk-hKpVm95g.js} +1 -1
- package/static/chunk-qYK5KaAK.js +1 -0
- package/static/{chunk-mzyds3TS.js → chunk-qwukwlIj.js} +1 -1
- package/static/{chunk-CgqRVtSF.js → chunk-vPa4eOmU.js} +1 -1
- package/static/index.html +1 -1
- package/static/{main-MNK6ZYDO.js → main-HV5WDK2F.js} +1 -1
- package/static/chunk-6BQlxALO.js +0 -1
- package/static/chunk-BNOYZq-b.js +0 -1
- package/static/chunk-BhGgxvgu.js +0 -1
- package/static/chunk-D6YfO72h.js +0 -1
- package/static/chunk-DoXxOh8j.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {U}from'./chunk-Cf_xd8ER.js';import {B as Bt}from'./chunk-BjZIiizu.js';import'./chunk-DNOjVPY0.js';import {L as Lt,u as ut$1,D as Di,m as mn}from'./chunk-3mppll1n.js';import'./chunk-CEcbtdnK.js';import {C,$,a as ae,V as Ve,b as at$1,q as qo,H as Hw,u as ue,s,r,o,Q as QE,M as Mi,n as n8,J as J6,k as k3,L as Ln,d as dd,z as zc,c as t7,X as Xb,e as V5,D as D5,K as Kt,f as _i,v as vw,R as Rw,g as Kc,h as gh,j as oE,l as lh,N as ND,m as bD,S as SD,p as gI,P as Ph,O as Ow,w as nl,x as ch,y as sE,A as xD,B as _D,E as VD,F as LD,G as Pu,I as Lu}from'./main-MNK6ZYDO.js';import'./chunk-CxBYhrEj.js';var st=(e,d)=>d.id;function lt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function at(e,d){e&1&&(_i(0,"p",11),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function dt(e,d){if(e&1&&(_i(0,"p",12),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.runningError());}}function pt(e,d){e&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.runningEmpty")," "));}function ht(e,d){if(e&1&&lh(0,"app-job-status-table",14),e&2){let t=VD();ch("jobs",t.runningJobs());}}function gt(e,d){if(e&1&&(lh(0,"nz-option",10),Rw(1,"transloco"),Rw(2,"transloco")),e&2){let t=d.$implicit,s=VD();ch("nzValue",t)("nzLabel",t==="all"?Ow(1,2,"jobs.list.filterAll"):Ow(2,4,s.statusKey(t)));}}function mt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function ct(e,d){e&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ut(e,d){if(e&1&&(_i(0,"p",19),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.historyError());}}function ft(e,d){e&1&&(_i(0,"p",20),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.historyEmpty")," "));}function yt(e,d){if(e&1){let t=LD();_i(0,"nz-pagination",22),gh("nzPageIndexChange",function(n){Pu(t);let c=VD(2);return Lu(c.setHistoryPage(n))}),Kc();}if(e&2){let t=VD(2);ch("nzPageIndex",t.historyPageIndex())("nzPageSize",t.pageSize)("nzTotal",t.historyTotal());}}function bt(e,d){if(e&1&&(lh(0,"app-job-status-table",14),bD(1,yt,1,3,"nz-pagination",21)),e&2){let t=VD();ch("jobs",t.historyJobs()),gI(),_D(t.historyTotal()>t.pageSize||t.historyPageIndex()>1?1:-1);}}var _t=20,Ct=50,xt=3e3,rt=["completed","failed","cancelled"],Vt=(()=>{class e{constructor(){this.jobsApi=C($),this.workflowsApi=C(U),this.route=C(ae),this.transloco=C(Ve),this.destroyRef=C(at$1),this.pageSize=_t,this.historyStatusOptions=["all",...rt],this.runningJobs=qo([]),this.historyJobs=qo([]),this.workflows=qo([]),this.runningLoading=qo(true),this.historyLoading=qo(true),this.runningError=qo(null),this.historyError=qo(null),this.runningWorkflowId=qo(""),this.historyWorkflowId=qo(""),this.historyStatusFilter=qo("all"),this.showChildJobs=qo(false),this.historyPageIndex=qo(1),this.polling=qo(false),this.historyTotal=Hw(()=>{let t=(this.historyPageIndex()-1)*this.pageSize,s=this.historyJobs().length;return s<this.pageSize?t+s:t+s+1}),this.pollHandle=null,this.onVisibility=()=>{if(document.hidden){this.stopPolling();return}this.loadRunning({silent:true}),this.loadHistory({silent:true}),this.startPolling();},this.destroyRef.onDestroy(()=>{this.stopPolling(),document.removeEventListener("visibilitychange",this.onVisibility);}),this.loadWorkflows(),this.route.queryParamMap.pipe(ue(this.destroyRef)).subscribe(t=>{let s=t.get("status");s&&rt.includes(s)?this.historyStatusFilter.set(s):this.historyStatusFilter.set("all"),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}),document.addEventListener("visibilitychange",this.onVisibility),this.startPolling();}statusKey(t){return `jobs.status.${t}`}isPolling(){return this.polling()}setHistoryStatusFilter(t){this.historyStatusFilter.set(t),this.historyPageIndex.set(1),this.loadHistory();}setRunningWorkflowId(t){this.runningWorkflowId.set(t),this.loadRunning();}setHistoryWorkflowId(t){this.historyWorkflowId.set(t),this.historyPageIndex.set(1),this.loadHistory();}setShowChildJobs(t){this.showChildJobs.set(t),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}setHistoryPage(t){this.historyPageIndex.set(t),this.loadHistory();}loadWorkflows(){this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.workflows.set(t);},error:()=>{this.workflows.set([]);}});}loadRunning(t={}){let s$1=this.runningWorkflowId();t.silent||(this.runningLoading.set(true),this.runningError.set(null)),this.jobsApi.list(s(r({terminal:false,topLevelOnly:!this.showChildJobs()},s$1?{workflowId:s$1}:{}),{limit:Ct,offset:0})).pipe(ue(this.destroyRef)).subscribe({next:n=>{this.runningJobs.set(n),this.runningLoading.set(false);},error:n=>{this.runningLoading.set(false),!t.silent&&this.runningError.set(this.errorMessage(n,this.transloco.translate("jobs.list.loadFailed")));}});}loadHistory(t={}){let s$1=this.historyStatusFilter(),n=this.historyWorkflowId();t.silent||(this.historyLoading.set(true),this.historyError.set(null)),this.jobsApi.list(s(r(r({terminal:true,topLevelOnly:!this.showChildJobs()},s$1==="all"?{}:{status:s$1}),n?{workflowId:n}:{}),{limit:this.pageSize,offset:(this.historyPageIndex()-1)*this.pageSize})).pipe(ue(this.destroyRef)).subscribe({next:c=>{this.historyJobs.set(c),this.historyLoading.set(false);},error:c=>{this.historyLoading.set(false),!t.silent&&this.historyError.set(this.errorMessage(c,this.transloco.translate("jobs.list.loadFailed")));}});}startPolling(){this.pollHandle!=null||document.hidden||(this.pollHandle=setInterval(()=>{this.loadRunning({silent:true}),this.loadHistory({silent:true});},xt),this.polling.set(true));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}errorMessage(t,s){return t instanceof o||t instanceof Error?t.message:s}static{this.\u0275fac=function(s){return new(s||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-job-list"]],decls:56,vars:36,consts:[["data-testid","jobs-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/jobs/new","data-testid","start-job"],["nz-checkbox","","data-testid","show-child-jobs",1,"child-toggle",3,"ngModelChange","ngModel"],["data-testid","jobs-running",1,"section"],[1,"section-header"],[1,"filters"],[1,"field"],["data-testid","running-workflow-filter",3,"ngModelChange","ngModel"],["nzValue","",3,"nzLabel"],[3,"nzValue","nzLabel"],["data-testid","running-loading"],["data-testid","running-error",1,"error"],["data-testid","running-empty",1,"section-empty"],[3,"jobs"],["data-testid","jobs-history",1,"section","section-history"],["data-testid","history-status-filter",3,"ngModelChange","ngModel"],["data-testid","history-workflow-filter",3,"ngModelChange","ngModel"],["data-testid","history-loading"],["data-testid","history-error",1,"error"],["data-testid","history-empty",1,"section-empty"],["data-testid","jobs-pagination",3,"nzPageIndex","nzPageSize","nzTotal"],["data-testid","jobs-pagination",3,"nzPageIndexChange","nzPageIndex","nzPageSize","nzTotal"]],template:function(s,n){s&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"label",3),gh("ngModelChange",function(y){return n.setShowChildJobs(y)}),vw(9),Rw(10,"transloco"),Kc(),oE(),_i(11,"section",4)(12,"header",5)(13,"h2"),vw(14),Rw(15,"transloco"),Kc()(),_i(16,"div",6)(17,"div",7)(18,"span"),vw(19),Rw(20,"transloco"),Kc(),_i(21,"nz-select",8),gh("ngModelChange",function(y){return n.setRunningWorkflowId(y)}),lh(22,"nz-option",9),Rw(23,"transloco"),ND(24,lt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(26,at,3,3,"p",11)(27,dt,2,1,"p",12)(28,pt,3,3,"p",13)(29,ht,1,1,"app-job-status-table",14),Kc(),_i(30,"section",15)(31,"header",5)(32,"h2"),vw(33),Rw(34,"transloco"),Kc()(),_i(35,"div",6)(36,"div",7)(37,"span"),vw(38),Rw(39,"transloco"),Kc(),_i(40,"nz-select",16),gh("ngModelChange",function(y){return n.setHistoryStatusFilter(y)}),ND(41,gt,3,6,"nz-option",10,SD),Kc(),oE(),Kc(),_i(43,"div",7)(44,"span"),vw(45),Rw(46,"transloco"),Kc(),_i(47,"nz-select",17),gh("ngModelChange",function(y){return n.setHistoryWorkflowId(y)}),lh(48,"nz-option",9),Rw(49,"transloco"),ND(50,mt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(52,ct,3,3,"p",18)(53,ut,2,1,"p",19)(54,ft,3,3,"p",20)(55,bt,2,2),Kc()()),s&2&&(gI(3),Ph(Ow(4,16,"jobs.list.title")),gI(3),nl(" ",Ow(7,18,"jobs.list.startButton")," "),gI(2),ch("ngModel",n.showChildJobs()),sE(),gI(),nl(" ",Ow(10,20,"jobs.list.showChildJobs")," "),gI(5),Ph(Ow(15,22,"jobs.list.running")),gI(5),Ph(Ow(20,24,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.runningWorkflowId()),sE(),gI(),ch("nzLabel",Ow(23,26,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.runningLoading()?26:n.runningError()?27:n.runningJobs().length===0?28:29),gI(7),Ph(Ow(34,28,"jobs.list.history")),gI(5),Ph(Ow(39,30,"jobs.list.filterByStatus")),gI(2),ch("ngModel",n.historyStatusFilter()),sE(),gI(),xD(n.historyStatusOptions),gI(4),Ph(Ow(46,32,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.historyWorkflowId()),sE(),gI(),ch("nzLabel",Ow(49,34,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.historyLoading()?52:n.historyError()?53:n.historyJobs().length===0?54:55));},dependencies:[Mi,n8,J6,k3,Ln,dd,zc,t7,Lt,ut$1,Di,mn,Xb,V5,D5,Bt,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.child-toggle[_ngcontent-%COMP%]{align-self:flex-start}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.section-history[_ngcontent-%COMP%]{padding-top:1.25rem;border-top:1px solid #e7e5e4}.section-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:12rem;max-width:18rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.section-empty[_ngcontent-%COMP%]{margin:0;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return e})();export{_t as JOB_LIST_PAGE_SIZE,Ct as JOB_RUNNING_LIMIT,xt as JOB_RUNNING_POLL_MS,Vt as JobListComponent,rt as TERMINAL_JOB_STATUSES};
|
|
1
|
+
import {U}from'./chunk-DUR5PalP.js';import {B as Bt}from'./chunk-DIntI-KR.js';import'./chunk-Ct30cLzT.js';import {L as Lt,u as ut$1,D as Di,m as mn}from'./chunk-BGEuPXoV.js';import'./chunk-C2eCmH-q.js';import {C,$,a as ae,V as Ve,b as at$1,q as qo,H as Hw,u as ue,s,r,o,Q as QE,M as Mi,n as n8,J as J6,k as k3,L as Ln,d as dd,z as zc,c as t7,X as Xb,e as V5,D as D5,K as Kt,f as _i,v as vw,R as Rw,g as Kc,h as gh,j as oE,l as lh,N as ND,m as bD,S as SD,p as gI,P as Ph,O as Ow,w as nl,x as ch,y as sE,A as xD,B as _D,E as VD,F as LD,G as Pu,I as Lu}from'./main-HV5WDK2F.js';import'./chunk-CxBYhrEj.js';var st=(e,d)=>d.id;function lt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function at(e,d){e&1&&(_i(0,"p",11),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function dt(e,d){if(e&1&&(_i(0,"p",12),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.runningError());}}function pt(e,d){e&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.runningEmpty")," "));}function ht(e,d){if(e&1&&lh(0,"app-job-status-table",14),e&2){let t=VD();ch("jobs",t.runningJobs());}}function gt(e,d){if(e&1&&(lh(0,"nz-option",10),Rw(1,"transloco"),Rw(2,"transloco")),e&2){let t=d.$implicit,s=VD();ch("nzValue",t)("nzLabel",t==="all"?Ow(1,2,"jobs.list.filterAll"):Ow(2,4,s.statusKey(t)));}}function mt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function ct(e,d){e&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ut(e,d){if(e&1&&(_i(0,"p",19),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.historyError());}}function ft(e,d){e&1&&(_i(0,"p",20),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.historyEmpty")," "));}function yt(e,d){if(e&1){let t=LD();_i(0,"nz-pagination",22),gh("nzPageIndexChange",function(n){Pu(t);let c=VD(2);return Lu(c.setHistoryPage(n))}),Kc();}if(e&2){let t=VD(2);ch("nzPageIndex",t.historyPageIndex())("nzPageSize",t.pageSize)("nzTotal",t.historyTotal());}}function bt(e,d){if(e&1&&(lh(0,"app-job-status-table",14),bD(1,yt,1,3,"nz-pagination",21)),e&2){let t=VD();ch("jobs",t.historyJobs()),gI(),_D(t.historyTotal()>t.pageSize||t.historyPageIndex()>1?1:-1);}}var _t=20,Ct=50,xt=3e3,rt=["completed","failed","cancelled"],Vt=(()=>{class e{constructor(){this.jobsApi=C($),this.workflowsApi=C(U),this.route=C(ae),this.transloco=C(Ve),this.destroyRef=C(at$1),this.pageSize=_t,this.historyStatusOptions=["all",...rt],this.runningJobs=qo([]),this.historyJobs=qo([]),this.workflows=qo([]),this.runningLoading=qo(true),this.historyLoading=qo(true),this.runningError=qo(null),this.historyError=qo(null),this.runningWorkflowId=qo(""),this.historyWorkflowId=qo(""),this.historyStatusFilter=qo("all"),this.showChildJobs=qo(false),this.historyPageIndex=qo(1),this.polling=qo(false),this.historyTotal=Hw(()=>{let t=(this.historyPageIndex()-1)*this.pageSize,s=this.historyJobs().length;return s<this.pageSize?t+s:t+s+1}),this.pollHandle=null,this.onVisibility=()=>{if(document.hidden){this.stopPolling();return}this.loadRunning({silent:true}),this.loadHistory({silent:true}),this.startPolling();},this.destroyRef.onDestroy(()=>{this.stopPolling(),document.removeEventListener("visibilitychange",this.onVisibility);}),this.loadWorkflows(),this.route.queryParamMap.pipe(ue(this.destroyRef)).subscribe(t=>{let s=t.get("status");s&&rt.includes(s)?this.historyStatusFilter.set(s):this.historyStatusFilter.set("all"),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}),document.addEventListener("visibilitychange",this.onVisibility),this.startPolling();}statusKey(t){return `jobs.status.${t}`}isPolling(){return this.polling()}setHistoryStatusFilter(t){this.historyStatusFilter.set(t),this.historyPageIndex.set(1),this.loadHistory();}setRunningWorkflowId(t){this.runningWorkflowId.set(t),this.loadRunning();}setHistoryWorkflowId(t){this.historyWorkflowId.set(t),this.historyPageIndex.set(1),this.loadHistory();}setShowChildJobs(t){this.showChildJobs.set(t),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}setHistoryPage(t){this.historyPageIndex.set(t),this.loadHistory();}loadWorkflows(){this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.workflows.set(t);},error:()=>{this.workflows.set([]);}});}loadRunning(t={}){let s$1=this.runningWorkflowId();t.silent||(this.runningLoading.set(true),this.runningError.set(null)),this.jobsApi.list(s(r({terminal:false,topLevelOnly:!this.showChildJobs()},s$1?{workflowId:s$1}:{}),{limit:Ct,offset:0})).pipe(ue(this.destroyRef)).subscribe({next:n=>{this.runningJobs.set(n),this.runningLoading.set(false);},error:n=>{this.runningLoading.set(false),!t.silent&&this.runningError.set(this.errorMessage(n,this.transloco.translate("jobs.list.loadFailed")));}});}loadHistory(t={}){let s$1=this.historyStatusFilter(),n=this.historyWorkflowId();t.silent||(this.historyLoading.set(true),this.historyError.set(null)),this.jobsApi.list(s(r(r({terminal:true,topLevelOnly:!this.showChildJobs()},s$1==="all"?{}:{status:s$1}),n?{workflowId:n}:{}),{limit:this.pageSize,offset:(this.historyPageIndex()-1)*this.pageSize})).pipe(ue(this.destroyRef)).subscribe({next:c=>{this.historyJobs.set(c),this.historyLoading.set(false);},error:c=>{this.historyLoading.set(false),!t.silent&&this.historyError.set(this.errorMessage(c,this.transloco.translate("jobs.list.loadFailed")));}});}startPolling(){this.pollHandle!=null||document.hidden||(this.pollHandle=setInterval(()=>{this.loadRunning({silent:true}),this.loadHistory({silent:true});},xt),this.polling.set(true));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}errorMessage(t,s){return t instanceof o||t instanceof Error?t.message:s}static{this.\u0275fac=function(s){return new(s||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-job-list"]],decls:56,vars:36,consts:[["data-testid","jobs-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/jobs/new","data-testid","start-job"],["nz-checkbox","","data-testid","show-child-jobs",1,"child-toggle",3,"ngModelChange","ngModel"],["data-testid","jobs-running",1,"section"],[1,"section-header"],[1,"filters"],[1,"field"],["data-testid","running-workflow-filter",3,"ngModelChange","ngModel"],["nzValue","",3,"nzLabel"],[3,"nzValue","nzLabel"],["data-testid","running-loading"],["data-testid","running-error",1,"error"],["data-testid","running-empty",1,"section-empty"],[3,"jobs"],["data-testid","jobs-history",1,"section","section-history"],["data-testid","history-status-filter",3,"ngModelChange","ngModel"],["data-testid","history-workflow-filter",3,"ngModelChange","ngModel"],["data-testid","history-loading"],["data-testid","history-error",1,"error"],["data-testid","history-empty",1,"section-empty"],["data-testid","jobs-pagination",3,"nzPageIndex","nzPageSize","nzTotal"],["data-testid","jobs-pagination",3,"nzPageIndexChange","nzPageIndex","nzPageSize","nzTotal"]],template:function(s,n){s&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"label",3),gh("ngModelChange",function(y){return n.setShowChildJobs(y)}),vw(9),Rw(10,"transloco"),Kc(),oE(),_i(11,"section",4)(12,"header",5)(13,"h2"),vw(14),Rw(15,"transloco"),Kc()(),_i(16,"div",6)(17,"div",7)(18,"span"),vw(19),Rw(20,"transloco"),Kc(),_i(21,"nz-select",8),gh("ngModelChange",function(y){return n.setRunningWorkflowId(y)}),lh(22,"nz-option",9),Rw(23,"transloco"),ND(24,lt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(26,at,3,3,"p",11)(27,dt,2,1,"p",12)(28,pt,3,3,"p",13)(29,ht,1,1,"app-job-status-table",14),Kc(),_i(30,"section",15)(31,"header",5)(32,"h2"),vw(33),Rw(34,"transloco"),Kc()(),_i(35,"div",6)(36,"div",7)(37,"span"),vw(38),Rw(39,"transloco"),Kc(),_i(40,"nz-select",16),gh("ngModelChange",function(y){return n.setHistoryStatusFilter(y)}),ND(41,gt,3,6,"nz-option",10,SD),Kc(),oE(),Kc(),_i(43,"div",7)(44,"span"),vw(45),Rw(46,"transloco"),Kc(),_i(47,"nz-select",17),gh("ngModelChange",function(y){return n.setHistoryWorkflowId(y)}),lh(48,"nz-option",9),Rw(49,"transloco"),ND(50,mt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(52,ct,3,3,"p",18)(53,ut,2,1,"p",19)(54,ft,3,3,"p",20)(55,bt,2,2),Kc()()),s&2&&(gI(3),Ph(Ow(4,16,"jobs.list.title")),gI(3),nl(" ",Ow(7,18,"jobs.list.startButton")," "),gI(2),ch("ngModel",n.showChildJobs()),sE(),gI(),nl(" ",Ow(10,20,"jobs.list.showChildJobs")," "),gI(5),Ph(Ow(15,22,"jobs.list.running")),gI(5),Ph(Ow(20,24,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.runningWorkflowId()),sE(),gI(),ch("nzLabel",Ow(23,26,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.runningLoading()?26:n.runningError()?27:n.runningJobs().length===0?28:29),gI(7),Ph(Ow(34,28,"jobs.list.history")),gI(5),Ph(Ow(39,30,"jobs.list.filterByStatus")),gI(2),ch("ngModel",n.historyStatusFilter()),sE(),gI(),xD(n.historyStatusOptions),gI(4),Ph(Ow(46,32,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.historyWorkflowId()),sE(),gI(),ch("nzLabel",Ow(49,34,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.historyLoading()?52:n.historyError()?53:n.historyJobs().length===0?54:55));},dependencies:[Mi,n8,J6,k3,Ln,dd,zc,t7,Lt,ut$1,Di,mn,Xb,V5,D5,Bt,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.child-toggle[_ngcontent-%COMP%]{align-self:flex-start}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.section-history[_ngcontent-%COMP%]{padding-top:1.25rem;border-top:1px solid #e7e5e4}.section-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:12rem;max-width:18rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.section-empty[_ngcontent-%COMP%]{margin:0;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return e})();export{_t as JOB_LIST_PAGE_SIZE,Ct as JOB_RUNNING_LIMIT,xt as JOB_RUNNING_POLL_MS,Vt as JobListComponent,rt as TERMINAL_JOB_STATUSES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {an as YE,ao as uu,C,
|
|
1
|
+
import {an as YE,ao as uu,C,c3 as XI,ar as _r,aw as Le,bM as Le$1,cc as N7,cd as B7,Q as QE,aA as pt,aB as Se,aE as ly,aF as Z0,b9 as BD,bn as $D,m as bD,p as gI,B as _D,h as gh,ag as _h,a4 as Mh,ce as fr,cf as pr,F as LD,f as _i,g as Kc,G as Pu,E as VD,I as Lu}from'./main-HV5WDK2F.js';var V=["*"];function x(o,A){if(o&1){let n=LD();_i(0,"nz-icon",1),gh("click",function(e){Pu(n);let i=VD();return Lu(i.closeTag(e))}),Kc();}}var I=(()=>{class o{renderer=C(XI);el=C(_r).nativeElement;dir=C(Le).valueSignal;nzMode="default";nzColor;nzChecked=false;nzBordered=true;nzOnClose=new Le$1;nzCheckedChange=new Le$1;isPresetColor=false;updateCheckedStatus(){this.nzMode==="checkable"&&(this.nzChecked=!this.nzChecked,this.nzCheckedChange.emit(this.nzChecked));}closeTag(n){this.nzOnClose.emit(n),n.defaultPrevented||this.renderer.removeChild(this.renderer.parentNode(this.el),this.el);}clearPresetColor(){let n=new RegExp(`(ant-tag-(?:${[...fr,...pr].join("|")}))`,"g"),t=this.el.classList.toString(),e=[],i=n.exec(t);for(;i!==null;)e.push(i[1]),i=n.exec(t);this.el.classList.remove(...e);}setPresetColor(){this.clearPresetColor(),this.nzColor?this.isPresetColor=N7(this.nzColor)||B7(this.nzColor):this.isPresetColor=false,this.isPresetColor&&this.el.classList.add(`ant-tag-${this.nzColor}`);}ngOnChanges(n){let{nzColor:t}=n;t&&this.setPresetColor();}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=QE({type:o,selectors:[["nz-tag"]],hostAttrs:[1,"ant-tag"],hostVars:12,hostBindings:function(t,e){t&1&&gh("click",function(){return e.updateCheckedStatus()}),t&2&&(_h("background-color",e.isPresetColor?"":e.nzColor),Mh("ant-tag-has-color",e.nzColor&&!e.isPresetColor)("ant-tag-checkable",e.nzMode==="checkable")("ant-tag-checkable-checked",e.nzChecked)("ant-tag-rtl",e.dir()==="rtl")("ant-tag-borderless",!e.nzBordered));},inputs:{nzMode:"nzMode",nzColor:"nzColor",nzChecked:[2,"nzChecked","nzChecked",Z0],nzBordered:[2,"nzBordered","nzBordered",Z0]},outputs:{nzOnClose:"nzOnClose",nzCheckedChange:"nzCheckedChange"},exportAs:["nzTag"],features:[ly],ngContentSelectors:V,decls:2,vars:1,consts:[["nzType","close","tabindex","-1",1,"ant-tag-close-icon"],["nzType","close","tabindex","-1",1,"ant-tag-close-icon",3,"click"]],template:function(t,e){t&1&&(BD(),$D(0),bD(1,x,1,0,"nz-icon",0)),t&2&&(gI(),_D(e.nzMode==="closeable"?1:-1));},dependencies:[pt,Se],encapsulation:2})}return o})(),W=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=YE({type:o});static \u0275inj=uu({imports:[I]})}return o})();export{I,W};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {T}from'./chunk-
|
|
1
|
+
import {T}from'./chunk-CqGGDoIh.js';import {$ as $$1,B}from'./chunk-h3oyPsBC.js';import {T as Tx,J as Jm,m as my,p as py,L as L_}from'./chunk-dUlsh7QS.js';import {a as ai,z}from'./chunk-DlsGU_Dk.js';import {C,a as ae,T as Ie$1,ah as U,aj as $,b as at,V as Ve$1,aS as O$1,aT as de,al as Se$1,q as qo,H as Hw,u as ue,s,r,o,Q as QE,M as Mi,n as n8,am as S4,J as J6,k as k3,L as Ln,d as dd,z as zc,c as t7,Z as y7,X as Xb,e as V5,D as D5,K as Kt,f as _i,v as vw,g as Kc,R as Rw,h as gh,m as bD,p as gI,P as Ph,O as Ow,x as ch,w as nl,B as _D,E as VD,F as LD,j as oE,N as ND,y as sE,A as xD,S as SD,l as lh,G as Pu,I as Lu,a4 as Mh,a5 as ah,a6 as Nw}from'./main-HV5WDK2F.js';import {U as U$1}from'./chunk-DUR5PalP.js';import'./chunk-C2eCmH-q.js';var be=()=>[],O=(t,a)=>a.id,Me=(t,a)=>a.name;function Ie(t,a){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Ee(t,a){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function Ve(t,a){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=a.$implicit;gI(),Ph(e);}}function ze(t,a){if(t&1&&(_i(0,"section",7)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,Ve,2,1,"li",null,SD),Kc()()),t&2){let e=VD(2);gI(2),Ph(Ow(3,1,"views.editor.validation")),gI(3),xD(e.validationErrors());}}function ke(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function Pe(t,a){t&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"views.editor.noEligibleInstances")," "));}function Se(t,a){t&1&&(_i(0,"p",16),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"views.editor.instanceNeeded")," "));}function Ne(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.displayName);}}function qe(t,a){if(t&1){let e=LD();_i(0,"div",15),bD(1,Se,3,3,"p",16),_i(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"nz-select",17),Rw(6,"transloco"),gh("ngModelChange",function(n){Pu(e);let s=VD(3);return Lu(s.onInstanceChange(n))}),ND(7,Ne,1,2,"nz-option",11,O),Kc(),oE(),Kc();}if(t&2){let e=VD(3);Mh("field-attention",e.needsInstanceAttention()),gI(),_D(e.needsInstanceAttention()?1:-1),gI(2),Ph(Ow(4,6,"views.editor.instance")),gI(2),ch("nzPlaceHolder",Ow(6,8,"views.editor.instancePlaceholder"))("ngModel",e.providerInstanceId()),sE(),gI(2),xD(e.eligibleInstances());}}function De(t,a){if(t&1&&bD(0,Pe,3,3,"p",13)(1,qe,9,10,"div",14),t&2){let e=VD(2);_D(e.eligibleInstances().length===0?0:1);}}function Ae(t,a){if(t&1){let e=LD();_i(0,"div",12)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",18)(5,"button",19),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("template"))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",20),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("raw"))}),vw(9),Rw(10,"transloco"),Kc()()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,5,"views.editor.queryMode")),gI(3),ch("nzType",e.queryMode()==="template"?"primary":"default"),gI(),nl(" ",Ow(7,7,"views.editor.queryMode.template")," "),gI(2),ch("nzType",e.queryMode()==="raw"?"primary":"default"),gI(),nl(" ",Ow(10,9,"views.editor.queryMode.raw")," ");}}function Fe(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.label);}}function je(t,a){t&1&&(_i(0,"span",22),vw(1,"*"),Kc());}function Oe(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e)("nzLabel",e);}}function Be(t,a){if(t&1){let e=LD();_i(0,"nz-select",25),gh("ngModelChange",function(n){Pu(e);let s=VD().$implicit,g=VD(4);return Lu(g.setTemplateParam(s.name,n))}),ND(1,Oe,1,2,"nz-option",11,SD),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE(),gI(),xD(e.options??Nw(2,be));}}function $e(t,a){if(t&1){let e=LD();_i(0,"input",26),gh("ngModelChange",function(n){Pu(e);let s=VD().$implicit,g=VD(4);return Lu(g.setTemplateParam(s.name,n))}),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE();}}function Le(t,a){if(t&1&&(_i(0,"label",8)(1,"span"),vw(2),bD(3,je,2,0,"span",22),Kc(),bD(4,Be,3,3,"nz-select",23)(5,$e,1,2,"input",24),Kc()),t&2){let e=a.$implicit;gI(2),nl(" ",e.label," "),gI(),_D(e.required?3:-1),gI(),_D(e.type==="select"?4:5);}}function We(t,a){t&1&&ND(0,Le,6,3,"label",8,Me),t&2&&xD(a.params);}function Re(t,a){if(t&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",21),gh("ngModelChange",function(n){Pu(e);let s=VD(2);return Lu(s.selectTemplate(n))}),ND(5,Fe,1,2,"nz-option",11,O),Kc(),oE(),Kc(),bD(7,We,2,0);}if(t&2){let e,i=VD(2);gI(2),Ph(Ow(3,3,"views.editor.template")),gI(2),ch("ngModel",i.selectedTemplateId()),sE(),gI(),xD(i.templates()),gI(2),_D((e=i.selectedTemplate())?7:-1,e);}}function Je(t,a){if(t&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",27),gh("ngModelChange",function(n){Pu(e);let s=VD(2);return Lu(s.queryText.set(n))}),Kc(),oE(),_i(5,"span",28),vw(6),Rw(7,"transloco"),Kc()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,3,"views.editor.query")),gI(2),ch("ngModel",e.queryText()),sE(),gI(2),Ph(Ow(7,5,"views.editor.queryHint"));}}function Qe(t,a){if(t&1){let e=LD();bD(0,ze,7,3,"section",7),_i(1,"label",8)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",9),gh("ngModelChange",function(n){Pu(e);let s=VD();return Lu(s.name.set(n))}),Kc(),oE(),Kc(),_i(6,"div",8)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",10),gh("ngModelChange",function(n){Pu(e);let s=VD();return Lu(s.onWorkflowChange(n))}),ND(11,ke,1,2,"nz-option",11,O),Kc(),oE(),Kc(),bD(13,De,2,1),bD(14,Ae,11,11,"div",12),bD(15,Re,8,5)(16,Je,8,7,"label",8);}if(t&2){let e=VD();_D(e.validationErrors().length>0?0:-1),gI(3),Ph(Ow(4,8,"views.editor.name")),gI(2),ch("ngModel",e.name()),sE(),gI(3),Ph(Ow(9,10,"views.editor.workflow")),gI(2),ch("ngModel",e.workflowId()),sE(),gI(),xD(e.bindableWorkflows()),gI(2),_D(e.selectedWorkflow()&&e.settings()?13:-1),gI(),_D(e.hasTemplates()?14:-1),gI(),_D(e.queryMode()==="template"&&e.hasTemplates()?15:16);}}function Ue(t){let a=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return a.length>0?`${a}-${e}`:`view-${e}`}function Te(t){let a={};for(let e of t.params)a[e.name]=e.type==="select"?e.options?.[0]??"":"";return a}function He(t){let a=t?.trim()??"";return a.length>0?a:null}var bt=(()=>{class t{constructor(){this.route=C(ae),this.router=C(Ie$1),this.viewsApi=C(U),this.workflowsApi=C(U$1),this.settingsApi=C($),this.providersApi=C($$1),this.message=C(Tx),this.destroyRef=C(at),this.transloco=C(Ve$1),this.language=C(O$1),this.routeId=de(this.route.paramMap.pipe(Se$1(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.providerInstanceId=qo(null),this.workflows=qo([]),this.subjectType=qo(null),this.queryText=qo(`{
|
|
2
2
|
|
|
3
|
-
}`),this.queryMode=qo("template"),this.templates=qo([]),this.selectedTemplateId=qo(null),this.templateParams=qo({}),this.settings=qo(null),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.bindableWorkflows=Hw(()=>this.workflows().filter(e=>e.appliesTo!=="none")),this.selectedWorkflow=Hw(()=>this.bindableWorkflows().find(e=>e.id===this.workflowId())??null),this.subjectTypeOptions=Hw(()=>
|
|
3
|
+
}`),this.queryMode=qo("template"),this.templates=qo([]),this.selectedTemplateId=qo(null),this.templateParams=qo({}),this.settings=qo(null),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.bindableWorkflows=Hw(()=>this.workflows().filter(e=>e.appliesTo!=="none")),this.selectedWorkflow=Hw(()=>this.bindableWorkflows().find(e=>e.id===this.workflowId())??null),this.subjectTypeOptions=Hw(()=>Jm(this.selectedWorkflow()?.appliesTo??"none")),this.eligibleInstances=Hw(()=>B(this.settings(),this.subjectTypeOptions())),this.selectedInstance=Hw(()=>this.eligibleInstances().find(e=>e.id===this.providerInstanceId())??null),this.needsInstanceAttention=Hw(()=>this.selectedWorkflow()!=null&&this.settings()!=null&&this.eligibleInstances().length>0&&this.selectedInstance()==null),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("views.editor.titleNew"):this.transloco.translate("views.editor.titleEdit",{id:this.routeId()}))),this.selectedTemplate=Hw(()=>this.templates().find(e=>e.id===this.selectedTemplateId())??null),this.hasTemplates=Hw(()=>this.templates().length>0),this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.workflows.set(e),error:e=>{this.workflows.set([]),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.settingsApi.getSettings().pipe(ue(this.destroyRef)).subscribe({next:e=>{this.settings.set(e),this.refreshTemplates();},error:e=>{this.settings.set(my),this.refreshTemplates(),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(e=>{let i=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),this.pendingProvenance=void 0,!i){this.name.set(""),this.workflowId.set(""),this.providerInstanceId.set(null),this.subjectType.set(null),this.queryText.set(`{
|
|
4
4
|
|
|
5
|
-
}`),this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),this.loading.set(false),this.refreshTemplates();return}this.loading.set(true),this.viewsApi.get(i).subscribe({next:n=>{this.name.set(n.name),this.workflowId.set(n.workflowId),this.providerInstanceId.set(He(n.providerInstanceId)),this.subjectType.set(n.subjectType),this.queryText.set(JSON.stringify(n.query,null,2)),this.pendingProvenance=n.queryTemplate,this.queryMode.set(n.queryTemplate?"template":"raw"),this.loading.set(false),this.refreshTemplates();},error:n=>{this.loading.set(false),this.loadError.set(this.errorMessage(n,this.transloco.translate("views.editor.loadFailed")));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}onWorkflowChange(e){this.workflowId.set(e);let i=
|
|
5
|
+
}`),this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),this.loading.set(false),this.refreshTemplates();return}this.loading.set(true),this.viewsApi.get(i).subscribe({next:n=>{this.name.set(n.name),this.workflowId.set(n.workflowId),this.providerInstanceId.set(He(n.providerInstanceId)),this.subjectType.set(n.subjectType),this.queryText.set(JSON.stringify(n.query,null,2)),this.pendingProvenance=n.queryTemplate,this.queryMode.set(n.queryTemplate?"template":"raw"),this.loading.set(false),this.refreshTemplates();},error:n=>{this.loading.set(false),this.loadError.set(this.errorMessage(n,this.transloco.translate("views.editor.loadFailed")));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}onWorkflowChange(e){this.workflowId.set(e);let i=Jm(this.bindableWorkflows().find(s=>s.id===e)?.appliesTo??"none");this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({});let n=B(this.settings(),i);if(n.length===1)this.applyInstance(n[0]);else {let s=this.providerInstanceId(),g=n.find(S=>S.id===s);g?this.applyInstance(g):(this.providerInstanceId.set(null),this.subjectType.set(null));}this.refreshTemplates();}onInstanceChange(e){let i=this.eligibleInstances().find(n=>n.id===e);this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),i&&this.applyInstance(i),this.refreshTemplates();}applyInstance(e){this.providerInstanceId.set(e.id),py(e)&&this.subjectType.set(e.subjectType);}setQueryMode(e){this.queryMode.set(e),e==="template"&&!this.selectedTemplateId()&&this.templates()[0]&&this.selectTemplate(this.templates()[0].id);}selectTemplate(e){let i=this.templates().find(n=>n.id===e);this.selectedTemplateId.set(e),this.templateParams.set(i?Te(i):{});}templateParamValue(e){let i=this.templateParams()[e];return i==null?"":String(i)}setTemplateParam(e,i){this.templateParams.set(s(r({},this.templateParams()),{[e]:i}));}save(){if(!this.selectedInstance()){this.validationErrors.set([this.transloco.translate("views.editor.pickInstance")]);return}if(this.queryMode()==="template"&&this.hasTemplates()){this.saveFromTemplate();return}this.saveFromRawJson();}saveFromTemplate(){let e=this.selectedTemplate(),i=this.providerInstanceId();if(!e||!i){this.validationErrors.set([this.transloco.translate("views.editor.pickTemplate")]);return}let n=e.params.filter(s=>{if(!s.required)return false;let g=this.templateParams()[s.name];return g==null||String(g).trim()===""});if(n.length>0){this.validationErrors.set(n.map(s=>this.transloco.translate("views.editor.missingParam",{label:s.label})));return}this.validationErrors.set([]),this.saving.set(true),this.providersApi.resolveQueryTemplate(i,e.id,this.templateParams()).subscribe({next:s=>{this.persist({query:s.query,queryTemplate:{templateId:e.id,params:this.templateParams()}});},error:s=>{this.saving.set(false),this.message.error(this.errorMessage(s,this.transloco.translate("views.editor.resolveFailed")));}});}saveFromRawJson(){let e;try{e=JSON.parse(this.queryText());}catch(i){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}if(e===null||typeof e!="object"||Array.isArray(e)){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}this.persist({query:e});}persist(e){let i=this.routeId(),n=this.subjectType(),s=r({id:i??Ue(this.name()),name:this.name().trim(),subjectType:n??"",providerInstanceId:this.providerInstanceId()??"",workflowId:this.workflowId(),query:e.query},e.queryTemplate?{queryTemplate:e.queryTemplate}:{}),g=L_.safeParse(s);if(!g.success){this.saving.set(false),this.validationErrors.set(T(g.error));return}this.validationErrors.set([]),this.saving.set(true);let S=g.data;(this.isNew()||!i?this.viewsApi.create(S):this.viewsApi.update(i,S)).subscribe({next:q=>{this.saving.set(false),this.message.success(this.transloco.translate(this.isNew()?"views.editor.created":"views.editor.saved")),this.isNew()&&this.router.navigate(["/views",q.id,"edit"]);},error:q=>{this.saving.set(false),this.message.error(this.errorMessage(q,this.transloco.translate("views.editor.saveFailed")));}});}refreshTemplates(){let e=this.providerInstanceId();if(!e){this.templates.set([]),this.applyLoadedTemplates([]);return}this.providersApi.listQueryTemplates(e).subscribe({next:i=>{this.templates.set(i),this.applyLoadedTemplates(i);},error:()=>{this.templates.set([]),this.applyLoadedTemplates([]);}});}applyLoadedTemplates(e){let i=this.pendingProvenance;if(i){let n=e.find(s=>s.id===i.templateId);n?(this.queryMode.set("template"),this.selectedTemplateId.set(n.id),this.templateParams.set(r(r({},Te(n)),i.params))):(this.queryMode.set("raw"),this.selectedTemplateId.set(null)),this.pendingProvenance=void 0;return}if(this.queryMode()!=="raw"){if(e.length===0){this.queryMode.set("raw"),this.selectedTemplateId.set(null),this.templateParams.set({});return}e.some(n=>n.id===this.selectedTemplateId())||this.selectTemplate(e[0].id);}}errorMessage(e,i){return e instanceof o||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-view-editor"]],decls:15,vars:10,consts:[["data-testid","view-editor",1,"editor"],[1,"header"],[1,"header-actions"],["routerLink","/views"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","validation-errors",1,"errors"],[1,"field"],["nz-input","","data-testid","view-name",3,"ngModelChange","ngModel"],["data-testid","view-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","query-mode-toggle",1,"field"],["data-testid","view-instance-empty",1,"error"],["data-testid","view-instance-field",1,"field",3,"field-attention"],["data-testid","view-instance-field",1,"field"],["data-testid","view-instance-needed",1,"attention"],["data-testid","view-instance",3,"ngModelChange","nzPlaceHolder","ngModel"],[1,"mode-toggle"],["nz-button","","type","button","data-testid","query-mode-template",3,"click","nzType"],["nz-button","","type","button","data-testid","query-mode-raw",3,"click","nzType"],["data-testid","view-template",3,"ngModelChange","ngModel"],[1,"required"],[3,"ngModel"],["nz-input","",3,"ngModel"],[3,"ngModelChange","ngModel"],["nz-input","",3,"ngModelChange","ngModel"],["nz-input","","rows","8","data-testid","view-query",3,"ngModelChange","ngModel"],[1,"hint"]],template:function(i,n){i&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),vw(4),Kc()(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",4),gh("click",function(){return n.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,Ie,3,3,"p",5)(13,Ee,2,1,"p",6)(14,Qe,17,12),Kc()),i&2&&(gI(4),Ph(n.pageTitle()),gI(3),Ph(Ow(8,6,"views.editor.backToList")),gI(2),ch("nzLoading",n.saving())("disabled",n.loading()||!!n.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(n.loading()?12:n.loadError()?13:14));},dependencies:[Mi,n8,S4,J6,k3,Ln,dd,zc,t7,y7,ai,z,Xb,V5,D5,Kt],styles:[".editor[_ngcontent-%COMP%]{max-width:40rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{font-size:.8rem;color:#78716c}.field-attention[_ngcontent-%COMP%]{border:1px solid #f59e0b;background:#fffbeb;padding:.75rem 1rem;border-radius:.35rem}.attention[_ngcontent-%COMP%]{margin:0;color:#b45309;font-size:.85rem}.mode-toggle[_ngcontent-%COMP%]{display:flex;gap:.5rem}.required[_ngcontent-%COMP%]{color:#9f1239}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}textarea[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace}"]});}}return t})();export{bt as ViewEditorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {o as ot}from'./chunk-qYK5KaAK.js';import'./chunk-D_R_EFd2.js';import {a as ai,z}from'./chunk-DlsGU_Dk.js';import {_ as _n,C as Cn}from'./chunk-DinAvqzQ.js';import {Q as QE,l as lh,C,V as Ve,b as at,q as qo,r,u as ue$1,o,M as Mi,n as n8,am as S4,J as J6,k as k3,d as dd,z as zc,c as t7,Z as y7,K as Kt,f as _i,v as vw,R as Rw,g as Kc,h as gh,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,E as VD,F as LD,j as oE,x as ch,y as sE,N as ND,A as xD,a5 as ah,G as Pu,I as Lu}from'./main-HV5WDK2F.js';import {f}from'./chunk-DWLHaSHg.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BGEuPXoV.js';import'./chunk-C2eCmH-q.js';var ce=(t,_)=>_.id;function de(t,_){t&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function me(t,_){if(t&1&&(_i(0,"p",4),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function fe(t,_){if(t&1&&(_i(0,"p",5),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.deleteError());}}function _e(t,_){if(t&1&&(_i(0,"p",9),vw(1),Kc()),t&2){let e=VD(3);gI(),Ph(e.saveError());}}function he(t,_){if(t&1){let e=LD();_i(0,"section",6),bD(1,_e,2,1,"p",9),_i(2,"label",10)(3,"span"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"input",11),gh("ngModelChange",function(l){Pu(e);let d=VD(2);return Lu(d.formName.set(l))}),Kc(),oE(),Kc(),_i(7,"div",10)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"app-path-picker",12),gh("pathChange",function(l){Pu(e);let d=VD(2);return Lu(d.formLocalPath.set(l))}),Kc()(),_i(12,"div",10)(13,"span"),vw(14),Rw(15,"transloco"),Kc(),_i(16,"p",13),vw(17),Rw(18,"transloco"),Kc(),_i(19,"app-path-picker",12),gh("pathChange",function(l){Pu(e);let d=VD(2);return Lu(d.formWorktreeBasePath.set(l))}),Kc()(),_i(20,"div",14)(21,"button",15),gh("click",function(){Pu(e);let l=VD(2);return Lu(l.submitForm())}),vw(22),Rw(23,"transloco"),Kc(),_i(24,"button",16),gh("click",function(){Pu(e);let l=VD(2);return Lu(l.cancelForm())}),vw(25),Rw(26,"transloco"),Kc()()();}if(t&2){let e=VD(2);gI(),_D(e.saveError()?1:-1),gI(3),Ph(Ow(5,11,"local-repos.form.name")),gI(2),ch("ngModel",e.formName()),sE(),gI(3),Ph(Ow(10,13,"local-repos.form.localPath")),gI(2),ch("path",e.formLocalPath()),gI(3),Ph(Ow(15,15,"local-repos.form.worktreeBasePath")),gI(3),Ph(Ow(18,17,"local-repos.form.worktreeBaseHint")),gI(2),ch("path",e.formWorktreeBasePath()),gI(2),ch("disabled",e.saving()),gI(),nl(" ",Ow(23,19,"common.save")," "),gI(3),nl(" ",Ow(26,21,"common.cancel")," ");}}function ue(t,_){t&1&&(_i(0,"p",7),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"local-repos.emptyState")));}function Ce(t,_){if(t&1){let e=LD();_i(0,"tr")(1,"td"),vw(2),Kc(),_i(3,"td",17),vw(4),Kc(),_i(5,"td",17),vw(6),Kc(),_i(7,"td",18)(8,"button",19),gh("click",function(){let l=Pu(e).$implicit,d=VD(3);return Lu(d.openEditForm(l))}),vw(9),Rw(10,"transloco"),Kc(),_i(11,"button",20),Rw(12,"transloco"),gh("nzOnConfirm",function(){let l=Pu(e).$implicit,d=VD(3);return Lu(d.deleteRepo(l))}),vw(13),Rw(14,"transloco"),Kc()()();}if(t&2){let e=_.$implicit;ah("data-testid","local-repo-row-"+e.id),gI(2),Ph(e.name),gI(2),Ph(e.localPath),gI(2),Ph(e.worktreeBasePath||"\u2014"),gI(2),ah("data-testid","edit-local-repo-"+e.id),gI(),nl(" ",Ow(10,9,"local-repos.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(12,11,"local-repos.deleteConfirm")),ah("data-testid","delete-local-repo-"+e.id),gI(2),nl(" ",Ow(14,13,"local-repos.delete")," ");}}function ge(t,_){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc()()(),_i(15,"tbody"),ND(16,Ce,15,15,"tr",null,ce),Kc()()),t&2){let e=VD(2);ch("nzData",e.repos())("nzShowPagination",false),gI(4),Ph(Ow(5,6,"local-repos.column.name")),gI(3),Ph(Ow(8,8,"local-repos.column.localPath")),gI(3),Ph(Ow(11,10,"local-repos.column.worktreeBasePath")),gI(3),Ph(Ow(14,12,"local-repos.column.actions")),gI(3),xD(e.repos());}}function xe(t,_){if(t&1&&(bD(0,fe,2,1,"p",5),bD(1,he,27,23,"section",6),bD(2,ue,3,3,"p",7)(3,ge,18,14,"nz-table",8)),t&2){let e=VD();_D(e.deleteError()?0:-1),gI(),_D(e.formOpen()?1:-1),gI(),_D(e.repos().length===0&&!e.formOpen()?2:e.repos().length>0?3:-1);}}var ae=(()=>{class t{constructor(){this.reposApi=C(f),this.transloco=C(Ve),this.destroyRef=C(at),this.repos=qo([]),this.loading=qo(true),this.loadError=qo(null),this.saveError=qo(null),this.deleteError=qo(null),this.saving=qo(false),this.formOpen=qo(false),this.editingId=qo(null),this.formName=qo(""),this.formLocalPath=qo(""),this.formWorktreeBasePath=qo(""),this.reload();}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formLocalPath.set(e.localPath),this.formWorktreeBasePath.set(e.worktreeBasePath??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r({name:this.formName().trim(),localPath:this.formLocalPath().trim()},this.formWorktreeBasePath().trim()?{worktreeBasePath:this.formWorktreeBasePath().trim()}:{worktreeBasePath:void 0}),r$1=this.editingId();(r$1?this.reposApi.update(r$1,e):this.reposApi.create(e)).pipe(ue$1(this.destroyRef)).subscribe({next:d=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.repos.update(le=>[...le.filter(M=>M.id!==d.id),d].sort((M,se)=>M.name.localeCompare(se.name))),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set("");},error:d=>{this.saving.set(false),this.saveError.set(this.errorMessage(d,this.transloco.translate("local-repos.saveFailed")));}});}deleteRepo(e){this.deleteError.set(null),this.reposApi.delete(e.id).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.repos.update(r=>r.filter(l=>l.id!==e.id));},error:r=>{this.deleteError.set(this.errorMessage(r,this.transloco.translate("local-repos.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.reposApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>{this.repos.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("local-repos.loadFailed")));}});}errorMessage(e,r){return e instanceof o||e instanceof Error?e.message:r}static{this.\u0275fac=function(r){return new(r||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-local-repository-list"]],decls:11,vars:7,consts:[["data-testid","local-repos-manage",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","type","button","data-testid","create-local-repo",3,"click"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","local-repo-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","local-repo-table",3,"nzData","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","local-repo-name",3,"ngModelChange","ngModel"],["mode","directories",3,"pathChange","path"],[1,"hint"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","save-local-repo",3,"click","disabled"],["nz-button","","type","button","data-testid","cancel-local-repo",3,"click"],[1,"path-cell"],[1,"actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle"]],template:function(r,l){r&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"button",2),gh("click",function(){return l.openCreateForm()}),vw(6),Rw(7,"transloco"),Kc()(),bD(8,de,3,3,"p",3)(9,me,2,1,"p",4)(10,xe,4,3),Kc()),r&2&&(gI(3),Ph(Ow(4,3,"local-repos.title")),gI(3),nl(" ",Ow(7,5,"local-repos.create")," "),gI(2),_D(l.loading()?8:l.loadError()?9:10));},dependencies:[Mi,n8,S4,J6,k3,dd,zc,t7,y7,ai,z,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return t})();var qe=(()=>{class t{static{this.\u0275fac=function(r){return new(r||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-local-repositories-manage"]],decls:1,vars:0,template:function(r,l){r&1&&lh(0,"app-local-repository-list");},dependencies:[ae],encapsulation:2});}}return t})();export{qe as LocalRepositoriesManageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {_ as _n,C as Cn}from'./chunk-
|
|
1
|
+
import {_ as _n,C as Cn}from'./chunk-DinAvqzQ.js';import {C,ah as U,ai as u,V as Ve,b as at,q as qo,u as ue,a9 as Ng,o,Q as QE,M as Mi,L as Ln,d as dd,z as zc,c as t7,K as Kt,f as _i,v as vw,R as Rw,g as Kc,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,E as VD,N as ND,x as ch,A as xD,F as LD,h as gh,a5 as ah,G as Pu,I as Lu}from'./main-HV5WDK2F.js';import {U as U$1}from'./chunk-DUR5PalP.js';import {W,I}from'./chunk-Ct30cLzT.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BGEuPXoV.js';import'./chunk-C2eCmH-q.js';function Z(t,p){return [...t.map(i=>({type:"view",id:i.id,name:i.name,workflowId:i.workflowId,subjectType:i.subjectType})),...p.map(i=>({type:"shortcut",id:i.id,name:i.name,workflowId:i.workflowId,subjectType:null}))].sort((i,c)=>i.name.localeCompare(c.name))}var ee=(t,p)=>p.type+p.id;function te(t,p){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ie(t,p){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function ne(t,p){if(t&1&&(_i(0,"p",7),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.deleteError());}}function oe(t,p){t&1&&(_i(0,"section",8)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",2)(5,"a",10),vw(6),Rw(7,"transloco"),Kc(),_i(8,"a",11),vw(9),Rw(10,"transloco"),Kc()()()),t&2&&(gI(2),Ph(Ow(3,3,"manage.views.emptyState")),gI(4),nl(" ",Ow(7,5,"manage.views.createView")," "),gI(3),nl(" ",Ow(10,7,"manage.views.createShortcut")," "));}function ae(t,p){if(t&1&&(vw(0),Rw(1,"transloco")),t&2){let e=VD().$implicit,i=VD(3);nl(" ",Ow(1,1,i.subjectTypeKey(e.subjectType))," ");}}function re(t,p){t&1&&(vw(0),Rw(1,"transloco")),t&2&&nl(" ",Ow(1,1,"manage.views.noSubjectType")," ");}function se(t,p){if(t&1){let e=LD();_i(0,"tr")(1,"td"),vw(2),Kc(),_i(3,"td")(4,"nz-tag"),vw(5),Rw(6,"transloco"),Kc()(),_i(7,"td"),vw(8),Kc(),_i(9,"td"),bD(10,ae,2,3)(11,re,2,3),Kc(),_i(12,"td",12)(13,"a",13),vw(14),Rw(15,"transloco"),Kc(),_i(16,"button",14),Rw(17,"transloco"),Rw(18,"transloco"),Rw(19,"transloco"),gh("nzOnConfirm",function(){let c=Pu(e).$implicit,v=VD(3);return Lu(v.deleteItem(c))}),vw(20),Rw(21,"transloco"),Kc()()();}if(t&2){let e=p.$implicit,i=VD(3);ah("data-testid","item-"+e.type+"-"+e.id),gI(),ah("data-testid","name-"+e.type+"-"+e.id),gI(),Ph(e.name),gI(2),ah("data-testid","type-"+e.type+"-"+e.id),gI(),Ph(Ow(6,17,i.typeKey(e.type))),gI(2),ah("data-testid","workflow-"+e.type+"-"+e.id),gI(),nl(" ",i.workflowName(e)," "),gI(),ah("data-testid","subject-type-"+e.type+"-"+e.id),gI(),_D(e.subjectType?10:11),gI(3),ch("routerLink",i.editLink(e)),ah("data-testid","edit-"+e.type+"-"+e.id),gI(),nl(" ",Ow(15,19,"manage.views.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(17,21,i.deleteConfirmKey(e)))("nzOkText",Ow(18,23,"manage.views.delete"))("nzCancelText",Ow(19,25,"common.cancel")),ah("data-testid","delete-"+e.type+"-"+e.id),gI(4),nl(" ",Ow(21,27,"manage.views.delete")," ");}}function de(t,p){if(t&1&&(_i(0,"nz-table",9)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc()()(),_i(18,"tbody"),ND(19,se,22,29,"tr",null,ee),Kc()()),t&2){let e=VD(2);ch("nzData",e.items())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Ph(Ow(5,8,"manage.views.column.name")),gI(3),Ph(Ow(8,10,"manage.views.column.type")),gI(3),Ph(Ow(11,12,"manage.views.column.workflow")),gI(3),Ph(Ow(14,14,"manage.views.column.subjectType")),gI(3),Ph(Ow(17,16,"manage.views.column.actions")),gI(3),xD(e.items());}}function pe(t,p){if(t&1&&(bD(0,ne,2,1,"p",7),bD(1,oe,11,9,"section",8)(2,de,21,18,"nz-table",9)),t&2){let e=VD();_D(e.deleteError()?0:-1),gI(),_D(e.items().length===0?1:2);}}var Ne=(()=>{class t{constructor(){this.viewsApi=C(U),this.shortcutsApi=C(u),this.workflowsApi=C(U$1),this.transloco=C(Ve),this.destroyRef=C(at),this.items=qo([]),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.load();}typeKey(e){return `manage.views.type.${e}`}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}workflowName(e){return this.workflows().find(i=>i.id===e.workflowId)?.name??e.workflowId}editLink(e){return e.type==="view"?["/views",e.id,"edit"]:["/shortcuts",e.id,"edit"]}deleteConfirmKey(e){return e.type==="view"?"manage.views.deleteConfirmView":"manage.views.deleteConfirmShortcut"}deleteItem(e){this.deleteError.set(null),(e.type==="view"?this.viewsApi.delete(e.id):this.shortcutsApi.delete(e.id)).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.items.update(c=>c.filter(v=>!(v.type===e.type&&v.id===e.id)));},error:c=>{this.deleteError.set(this.errorMessage(c,this.transloco.translate("manage.views.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({views:this.viewsApi.list(),shortcuts:this.shortcutsApi.list(),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({views:e,shortcuts:i,workflows:c})=>{this.items.set(Z(e,i)),this.workflows.set(c),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("manage.views.loadFailed")));}});}errorMessage(e,i){return e instanceof o||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-views-and-shortcuts-manage"]],decls:15,vars:10,consts:[["data-testid","views-shortcuts-manage",1,"list-page"],[1,"header"],[1,"header-actions"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","create-view"],["nz-button","","routerLink","/shortcuts/new","data-testid","create-shortcut"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","managed-items",3,"nzData","nzFrontPagination","nzShowPagination"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","empty-create-view"],["nz-button","","routerLink","/shortcuts/new","data-testid","empty-create-shortcut"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(i,c){i&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"a",4),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,te,3,3,"p",5)(13,ie,2,1,"p",6)(14,pe,3,2),Kc()),i&2&&(gI(3),Ph(Ow(4,4,"manage.views.title")),gI(4),nl(" ",Ow(8,6,"manage.views.createView")," "),gI(3),nl(" ",Ow(11,8,"manage.views.createShortcut")," "),gI(2),_D(c.loading()?12:c.loadError()?13:14));},dependencies:[Mi,Ln,dd,zc,t7,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return t})();export{Ne as ViewsAndShortcutsManageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {S as St}from'./chunk-CgXl_TS9.js';import'./chunk-qYK5KaAK.js';import'./chunk-D_R_EFd2.js';import'./chunk-DlsGU_Dk.js';import'./chunk-DinAvqzQ.js';import {Q as QE,l as lh}from'./main-HV5WDK2F.js';import'./chunk-Ct30cLzT.js';import'./chunk-BGEuPXoV.js';import'./chunk-C2eCmH-q.js';var c=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-context-files-manage"]],decls:1,vars:0,template:function(t,a){t&1&&lh(0,"app-context-file-list");},dependencies:[St],encapsulation:2});}}return e})();export{c as ContextFilesManageComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {u,f}from'./chunk-CxBYhrEj.js';import {W,I}from'./chunk-
|
|
1
|
+
import {u,f}from'./chunk-CxBYhrEj.js';import {W,I}from'./chunk-Ct30cLzT.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BGEuPXoV.js';import {C,$,T as Ie,V as Ve,b as at,a0 as $0,q as qo,W as rd,Y as Bw,a9 as Ng,aa as Xi,ab as Dg,u as ue,o,s,r,Q as QE,M as Mi,L as Ln,d as dd,z as zc,c as t7,K as Kt,m as bD,B as _D,f as _i,v as vw,R as Rw,g as Kc,p as gI,P as Ph,O as Ow,E as VD,N as ND,x as ch,A as xD,a5 as ah,a3 as xw,w as nl,F as LD,h as gh,G as Pu,I as Lu}from'./main-HV5WDK2F.js';var st=n=>["/jobs",n],lt=(n,m)=>m.id;function dt(n,m){n&1&&(_i(0,"p",0),vw(1),Rw(2,"transloco"),Kc()),n&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ct(n,m){if(n&1&&(_i(0,"p",1),vw(1),Kc()),n&2){let t=VD();gI(),Ph(t.loadError());}}function pt(n,m){if(n&1){let t=LD();_i(0,"button",6),gh("click",function(e){Pu(t);let d=VD().$implicit,g=VD(2);return Lu(g.retryJob(d,e))}),vw(1),Rw(2,"transloco"),Kc();}if(n&2){let t=VD().$implicit,i=VD(2);ch("disabled",i.retryingJobId()===t.id),ah("data-testid","job-retry-"+t.id),gI(),nl(" ",Ow(2,3,i.retryingJobId()===t.id?"jobs.detail.retrying":"jobs.table.retry")," ");}}function bt(n,m){if(n&1){let t=LD();_i(0,"button",7),gh("click",function(e){Pu(t);let d=VD().$implicit,g=VD(2);return Lu(g.cancelJob(d,e))}),vw(1),Rw(2,"transloco"),Kc();}if(n&2){let t=VD().$implicit,i=VD(2);ch("disabled",i.cancellingJobId()===t.id),ah("data-testid","job-cancel-"+t.id),gI(),nl(" ",Ow(2,3,i.cancellingJobId()===t.id?"jobs.detail.cancelling":"jobs.table.cancel")," ");}}function ut(n,m){if(n&1&&(_i(0,"tr")(1,"td")(2,"a",3),vw(3),Kc()(),_i(4,"td")(5,"nz-tag"),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"td")(9,"span"),vw(10),Kc()(),_i(11,"td")(12,"span"),vw(13),Kc()(),_i(14,"td")(15,"span"),vw(16),Kc()(),_i(17,"td"),bD(18,pt,3,5,"button",4),bD(19,bt,3,5,"button",5),Kc()()),n&2){let t=m.$implicit,i=VD(2);ah("data-testid","job-row-"+t.id),gI(2),ch("routerLink",xw(16,st,t.id)),ah("data-testid","job-link-"+t.id),gI(),nl(" ",t.id," "),gI(2),ah("data-testid","job-status-"+t.id),gI(),Ph(Ow(7,14,i.statusKey(t.status))),gI(3),ah("data-testid","job-subject-"+t.id),gI(),Ph(i.subjectText(t)),gI(2),ah("data-testid","job-started-"+t.id),gI(),Ph(t.createdAt),gI(2),ah("data-testid","job-completed-"+t.id),gI(),Ph(t.completedAt??"\u2014"),gI(2),_D(t.status==="failed"?18:-1),gI(),_D(i.isTerminalStatus(t.status)?-1:19);}}function mt(n,m){if(n&1&&(_i(0,"nz-table",2)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc(),_i(18,"th"),vw(19),Rw(20,"transloco"),Kc()()(),_i(21,"tbody"),ND(22,ut,20,18,"tr",null,lt),Kc()()),n&2){let t=VD();ch("nzData",t.displayJobs())("nzFrontPagination",false)("nzShowPagination",false)("nzSize","middle"),gI(4),Ph(Ow(5,10,"jobs.table.column.id")),gI(3),Ph(Ow(8,12,"jobs.table.column.status")),gI(3),Ph(Ow(11,14,"jobs.table.column.subject")),gI(3),Ph(Ow(14,16,"jobs.table.column.started")),gI(3),Ph(Ow(17,18,"jobs.table.column.completed")),gI(3),Ph(Ow(20,20,"jobs.table.column.actions")),gI(3),xD(t.displayJobs());}}var Bt=(()=>{class n{constructor(){this.jobsApi=C($),this.router=C(Ie),this.transloco=C(Ve),this.destroyRef=C(at),this.jobs=$0(null),this.jobIds=$0([]),this.loaded=qo([]),this.loading=qo(false),this.loadError=qo(null),this.retryingJobId=qo(null),this.cancellingJobId=qo(null),this.patched=qo({}),rd(()=>{let t=this.jobs(),i=this.jobIds();if(t!=null){Bw(()=>{this.loaded.set([]),this.loading.set(false),this.loadError.set(null),this.patched.set({});});return}if(i.length===0){Bw(()=>{this.loaded.set([]),this.loading.set(false);});return}Bw(()=>{this.loading.set(true),this.loadError.set(null),Ng(i.map(e=>this.jobsApi.get(e).pipe(Xi(()=>Dg(null))))).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.loaded.set(e.filter(d=>d!=null)),this.loading.set(false);},error:()=>{this.loading.set(false),this.loadError.set("Failed to load jobs");}});});});}displayJobs(){let t=this.jobs(),i=t??this.loaded(),e=this.patched();return i.map(d=>e[d.id]??d)}isTerminalStatus(t){return u(t)}statusKey(t){return `jobs.status.${t}`}subjectText(t){return f(t.subjectContext)??"\u2014"}retryJob(t,i){i.preventDefault(),i.stopPropagation(),!(t.status!=="failed"||this.retryingJobId()===t.id)&&(this.retryingJobId.set(t.id),this.loadError.set(null),this.jobsApi.retry(t.id).subscribe({next:e=>{this.retryingJobId.set(null),this.router.navigate(["/jobs",e.id]);},error:e=>{this.retryingJobId.set(null),this.loadError.set(e instanceof o||e instanceof Error?e.message:this.transloco.translate("jobs.errors.retryFailed"));}}));}cancelJob(t,i){i.preventDefault(),i.stopPropagation(),!(u(t.status)||this.cancellingJobId()===t.id)&&(this.cancellingJobId.set(t.id),this.loadError.set(null),this.jobsApi.cancel(t.id).subscribe({next:e=>{this.cancellingJobId.set(null),this.patched.update(d=>s(r({},d),{[e.id]:e})),this.loaded.update(d=>d.map(g=>g.id===e.id?e:g));},error:e=>{this.cancellingJobId.set(null),this.loadError.set(e instanceof o||e instanceof Error?e.message:this.transloco.translate("jobs.errors.cancelFailed"));}}));}static{this.\u0275fac=function(i){return new(i||n)};}static{this.\u0275cmp=QE({type:n,selectors:[["app-job-status-table"]],inputs:{jobs:[1,"jobs"],jobIds:[1,"jobIds"]},decls:3,vars:1,consts:[["data-testid","job-status-loading"],["data-testid","job-status-error",1,"error"],["data-testid","job-status-table",3,"nzData","nzFrontPagination","nzShowPagination","nzSize"],[3,"routerLink"],["nz-button","","nzType","link","type","button",3,"disabled"],["nz-button","","nzType","link","nzDanger","","type","button",3,"disabled"],["nz-button","","nzType","link","type","button",3,"click","disabled"],["nz-button","","nzType","link","nzDanger","","type","button",3,"click","disabled"]],template:function(i,e){i&1&&bD(0,dt,3,3,"p",0)(1,ct,2,1,"p",1)(2,mt,24,22,"nz-table",2),i&2&&_D(e.loading()&&e.jobs()==null?0:e.loadError()?1:2);},dependencies:[Mi,Ln,dd,zc,t7,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt],styles:[".error[_ngcontent-%COMP%]{color:#9f1239}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return n})();export{Bt as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,ae as Zi,a8 as a,
|
|
1
|
+
import {C,ae as Zi,a8 as a,cg as u,af as E,i as ie}from'./main-HV5WDK2F.js';var U=(()=>{class r{constructor(){this.http=C(Zi),this.baseUrl=`${a.apiBaseUrl}/batches`;}list(t){return this.http.get(this.baseUrl,{params:u(t)}).pipe(E())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(E())}jobs(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/jobs`).pipe(E())}launch(t){return this.http.post(this.baseUrl,t).pipe(E())}cancel(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/cancel`,{}).pipe(E())}static{this.\u0275fac=function(a){return new(a||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{U};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {U}from'./chunk-
|
|
1
|
+
import {U}from'./chunk-DPWE5cPY.js';import {f as f$1}from'./chunk-BfWasMGf.js';import {B as Bt}from'./chunk-DIntI-KR.js';import {W,I}from'./chunk-Ct30cLzT.js';import'./chunk-BGEuPXoV.js';import'./chunk-C2eCmH-q.js';import {C,a as ae,$,V as Ve,b as at,q as qo,u as ue,W as rd,Y as Bw,o,Q as QE,M as Mi,L as Ln,d as dd,z as zc,c as t7,Z as y7,K as Kt,f as _i,m as bD,g as Kc,p as gI,B as _D,v as vw,R as Rw,P as Ph,O as Ow,E as VD,l as lh,a2 as Pw,a3 as xw,x as ch,F as LD,h as gh,w as nl,G as Pu,I as Lu}from'./main-HV5WDK2F.js';import'./chunk-CxBYhrEj.js';var G=i=>({count:i});function Q(i,p){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function X(i,p){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function Y(i,p){if(i&1){let t=LD();_i(0,"button",15),gh("click",function(){Pu(t);let u=VD(2);return Lu(u.cancelBatch())}),vw(1),Rw(2,"transloco"),Kc();}if(i&2){let t=VD(2);ch("disabled",t.cancelling()),gI(),nl(" ",Ow(2,2,t.cancelling()?"batches.detail.cancelling":"batches.detail.cancel")," ");}}function Z(i,p){if(i&1&&(_i(0,"p",12),vw(1),Kc()),i&2){let t=VD(2);gI(),Ph(t.actionError());}}function tt(i,p){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"p",6)(8,"nz-tag",7),vw(9),Rw(10,"transloco"),Kc(),_i(11,"span",8),vw(12),Kc(),vw(13," \xB7 "),_i(14,"span",9),vw(15),Rw(16,"transloco"),Kc(),vw(17," \xB7 "),_i(18,"span",10),vw(19),Rw(20,"transloco"),Kc()()(),bD(21,Y,3,4,"button",11),Kc(),bD(22,Z,2,1,"p",12),_i(23,"section",13)(24,"h2"),vw(25),Rw(26,"transloco"),Kc(),lh(27,"app-job-status-table",14),Kc()),i&2){let t=p,e=VD();gI(3),Ph(Ow(4,10,"batches.detail.backHint")),gI(3),Ph(t.id),gI(3),Ph(Ow(10,12,e.statusKey(t.status))),gI(3),Ph(t.workflowId),gI(3),Ph(Pw(16,14,"batches.detail.subjectCount",xw(21,G,t.resolvedSubjects.length))),gI(4),Ph(Ow(20,17,e.triggeredByKey(t.triggeredBy))),gI(2),_D(t.status==="running"?21:-1),gI(),_D(e.actionError()?22:-1),gI(3),Ph(Ow(26,19,"batches.detail.membersHeading")),gI(2),ch("jobs",e.memberJobs());}}var et=3e3;function f(i){return i!=="running"}var _t=(()=>{class i{constructor(){this.route=C(ae),this.batchesApi=C(U),this.jobsApi=C($),this.eventsService=C(f$1),this.transloco=C(Ve),this.destroyRef=C(at),this.batch=qo(null),this.memberJobs=qo([]),this.loading=qo(true),this.loadError=qo(null),this.polling=qo(false),this.cancelling=qo(false),this.actionError=qo(null),this.eventStream=qo(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),rd(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();e&&(e.type!=="batch_completed"&&e.type!=="batch_cancelled"||e.batchId===this.batchId&&Bw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();}));});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}cancelBatch(){let t=this.batch();!t||t.status!=="running"||this.cancelling()||(this.actionError.set(null),this.cancelling.set(true),this.batchesApi.cancel(t.id).subscribe({next:e=>{this.cancelling.set(false),this.batch.set(e),this.refreshMembers(),f(e.status)&&(this.stopPolling(),this.closeStream());},error:e=>{this.cancelling.set(false),this.actionError.set(this.errorMessage(e,this.transloco.translate("batches.errors.cancelFailed")));}}));}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),f(e.status)||(this.startPolling(),this.eventStream.set(this.eventsService.connect({batchId:t})));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("batches.detail.loadFailed")));}});}refreshBatch(){let t=this.batchId;t&&this.batchesApi.get(t).subscribe({next:e=>{this.batch.set(e),f(e.status)&&this.stopPolling();},error:()=>{}});}refreshMembers(){let t=this.batchId;t&&this.jobsApi.list({batchId:t}).subscribe({next:e=>this.memberJobs.set(e),error:()=>{}});}startPolling(){this.pollHandle==null&&(this.polling.set(true),this.pollHandle=setInterval(()=>{let t=this.batch();if(!t||f(t.status)){this.stopPolling();return}this.refreshMembers();},et));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}closeStream(){let t=this.eventStream();t&&(t.close(),this.eventStream.set(null));}errorMessage(t,e){return t instanceof o||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"disabled"],["data-testid","action-error",1,"error"],["data-testid","batch-members",1,"members"],[3,"jobs"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"click","disabled"]],template:function(e,u){if(e&1&&(_i(0,"main",0),bD(1,Q,3,3,"p",1)(2,X,2,1,"p",2)(3,tt,28,23),Kc()),e&2){let _;gI(),_D(u.loading()?1:u.loadError()?2:(_=u.batch())?3:-1,_);}},dependencies:[Mi,Ln,dd,zc,t7,y7,W,I,Bt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem;word-break:break-all}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.members[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{_t as BatchDetailComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,ae as Zi,a8 as a,
|
|
1
|
+
import {C,ae as Zi,a8 as a,cg as u,af as E,i as ie}from'./main-HV5WDK2F.js';var U=(()=>{class r{constructor(){this.http=C(Zi),this.baseUrl=`${a.apiBaseUrl}/workflows`;}list(t){return this.http.get(this.baseUrl,{params:u(t)}).pipe(E())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(E())}create(t){return this.http.post(this.baseUrl,t).pipe(E())}update(t,i){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(t)}`,i).pipe(E())}delete(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(E())}static{this.\u0275fac=function(i){return new(i||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{U};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,ae as Zi,a8 as a,af as E,i as ie}from'./main-
|
|
1
|
+
import {C,ae as Zi,a8 as a,af as E,i as ie}from'./main-HV5WDK2F.js';var f=(()=>{class r{constructor(){this.http=C(Zi),this.baseUrl=`${a.apiBaseUrl}/local-repositories`;}list(){return this.http.get(this.baseUrl).pipe(E())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(E())}create(t){return this.http.post(this.baseUrl,t).pipe(E())}update(t,i){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(t)}`,i).pipe(E())}delete(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(E())}static{this.\u0275fac=function(i){return new(i||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,aY as Ee,aq as kt,aw as Le,bx as re,by as Vg,bz as Gl,bA as Rt$1,bB as Bu,bC as pn,bD as Ga,bE as Na,bF as t2,bG as K1,bH as A1,bI as G1,a_ as j3,bJ as A,i as ie$1,an as YE,ao as uu,r,bK as Le$1,bL as Sy,Q as QE,aA as pt,aB as Se$1,aC as Tt,aD as Ie,bM as Z4,bN as Da,d as dd,z as zc,c as t7,Z as y7,bO as Ky,bP as eh,f as _i,R as Rw,m as bD,l as lh,aN as nh,g as Kc,bq as sw,be as cw,ag as _h,O as Ow,p as gI,B as _D,x as ch,bc as rD,bQ as on,h as gh,a4 as Mh,aJ as Ih,aK as qD,aL as WD,bR as W,bS as We,bT as Ge,bU as on$1,bV as yt$1,bW as im,bX as Pa,bY as v,bZ as wr,at as z0,a0 as $0,a1 as B0,b_ as G4,b$ as Uo,as as oe,ar as _r,c0 as i0,c1 as XI,c2 as Gm,b as at,bp as Vt$1,c3 as s9,c4 as x1,ay as St$1,u as ue,bt as XE,c5 as eD,F as LD,aO as el,aP as tl,E as VD,v as vw,a5 as ah,w as nl,G as Pu,I as Lu,c6 as h9,c7 as d9,c8 as Aw,N as ND,S as SD,A as xD,c9 as vv}from'./main-MNK6ZYDO.js';(class n{static formats={B:{max:1024},kB:{max:Math.pow(1024,2),prev:"B"},KB:{max:Math.pow(1024,2),prev:"B"},MB:{max:Math.pow(1024,3),prev:"kB"},GB:{max:Math.pow(1024,4),prev:"MB"},TB:{max:Number.MAX_SAFE_INTEGER,prev:"GB"}};transform(o,e=0,t="B",i){if(!(h9(o)&&h9(e)&&e%1===0&&e>=0))return o;let a=o,r=t;for(;r!=="B";)a*=1024,r=n.formats[r].prev;if(i){let m=n.formats[i],k=d9(n.calculateResult(m,a),e);return n.formatResult(k,i)}for(let m in n.formats)if(n.formats.hasOwnProperty(m)){let k=n.formats[m];if(a<k.max){let kt=d9(n.calculateResult(k,a),e);return n.formatResult(kt,m)}}}static formatResult(o,e){return `${o} ${e}`}static calculateResult(o,e){let t=o.prev?n.formats[o.prev]:void 0;return t?e/t.max:e}static \u0275fac=function(e){return new(e||n)};static \u0275pipe=eD({name:"nzBytes",type:n,pure:true})});var Se=(()=>{class n{transform(e,t="px"){return typeof e=="number"?`${e}${t}`:e}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=eD({name:"nzToCssUnit",type:n,pure:true})}return n})();var Fe=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=YE({type:n});static \u0275inj=uu({})}return n})();function Ot(n,o){if(n&1&&(el(0),lh(1,"nz-icon",2),tl()),n&2){let e=o.$implicit;gI(),ch("nzType",e);}}var gt=["modalElement"];function Dt(n,o){if(n&1){let e=LD();_i(0,"button",16),gh("click",function(){Pu(e);let i=VD();return Lu(i.onCloseClick())}),Kc();}}function xt(n,o){if(n&1&&(el(0),lh(1,"span",12),tl()),n&2){let e=VD();gI(),ch("innerHTML",e.config.nzTitle,vv);}}function Et(n,o){}function Nt(n,o){if(n&1&&lh(0,"div",12),n&2){let e=VD();ch("innerHTML",e.config.nzContent,vv);}}function At(n,o){if(n&1){let e=LD();_i(0,"button",17),gh("click",function(){Pu(e);let i=VD();return Lu(i.onCancel())}),vw(1),Rw(2,"nzI18n"),Kc();}if(n&2){let e=VD();ch("nzLoading",e.config.nzCancelLoading)("disabled",e.config.nzCancelDisabled),ah("cdkFocusInitial",e.config.nzAutofocus==="cancel"||null),gI(),nl(" ",e.config.nzCancelText||Ow(2,4,"Modal.cancelText")," ");}}function St(n,o){if(n&1){let e=LD();_i(0,"button",18),gh("click",function(){Pu(e);let i=VD();return Lu(i.onOk())}),vw(1),Rw(2,"nzI18n"),Kc();}if(n&2){let e=VD();ch("nzType",e.config.nzOkType)("nzLoading",e.config.nzOkLoading)("disabled",e.config.nzOkDisabled)("nzDanger",e.config.nzOkDanger),ah("cdkFocusInitial",e.config.nzAutofocus==="ok"||null),gI(),nl(" ",e.config.nzOkText||Ow(2,6,"Modal.okText")," ");}}var Ft=(n,o)=>({$implicit:n,modalRef:o});function Rt(n,o){if(n&1){let e=LD();_i(0,"button",3),gh("click",function(){let i=Pu(e).$implicit,a=VD(4);return Lu(a.onButtonClick(i))}),vw(1),Kc();}if(n&2){let e=o.$implicit,t=VD(4);ch("hidden",!t.getButtonCallableProp(e,"show"))("nzLoading",t.getButtonCallableProp(e,"loading"))("disabled",t.getButtonCallableProp(e,"disabled"))("nzType",e.type)("nzDanger",e.danger)("nzShape",e.shape)("nzSize",e.size)("nzGhost",e.ghost),gI(),nl(" ",e.label," ");}}function wt(n,o){if(n&1&&ND(0,Rt,2,9,"button",2,SD),n&2){let e=VD(3);xD(e.buttons);}}function Lt(n,o){if(n&1&&lh(0,"div",1),n&2){let e=VD(3);ch("innerHTML",e.config.nzFooter,vv);}}function It(n,o){if(n&1&&(el(0),bD(1,wt,2,0)(2,Lt,1,1,"div",1),tl()),n&2){let e=VD(2);gI(),_D(e.buttons?1:2);}}function Bt(n,o){if(n&1&&nh(0,It,3,1,"ng-container",0),n&2){let e=VD();ch("nzStringTemplateOutlet",e.config.nzFooter)("nzStringTemplateOutletContext",Aw(2,Ft,e.config.nzData,e.modalRef()));}}function Pt(n,o){if(n&1){let e=LD();_i(0,"button",6),gh("click",function(){Pu(e);let i=VD(2);return Lu(i.onCancel())}),vw(1),Rw(2,"nzI18n"),Kc();}if(n&2){let e=VD(2);ch("nzLoading",e.config.nzCancelLoading)("disabled",e.config.nzCancelDisabled),ah("cdkFocusInitial",e.config.nzAutofocus==="cancel"||null),gI(),nl(" ",e.config.nzCancelText||Ow(2,4,"Modal.cancelText")," ");}}function Vt(n,o){if(n&1){let e=LD();_i(0,"button",7),gh("click",function(){Pu(e);let i=VD(2);return Lu(i.onOk())}),vw(1),Rw(2,"nzI18n"),Kc();}if(n&2){let e=VD(2);ch("nzType",e.config.nzOkType)("nzDanger",e.config.nzOkDanger)("nzLoading",e.config.nzOkLoading)("disabled",e.config.nzOkDisabled),ah("cdkFocusInitial",e.config.nzAutofocus==="ok"||null),gI(),nl(" ",e.config.nzOkText||Ow(2,6,"Modal.okText")," ");}}function Wt(n,o){if(n&1&&(bD(0,Pt,3,6,"button",4),bD(1,Vt,3,8,"button",5)),n&2){let e=VD();_D(e.config.nzCancelText!==null?0:-1),gI(),_D(e.config.nzOkText!==null?1:-1);}}function jt(n,o){if(n&1&&(el(0),lh(1,"div",2),tl()),n&2){let e=VD();gI(),ch("innerHTML",e.config.nzTitle,vv);}}function Ht(n,o){if(n&1){let e=LD();_i(0,"button",9),gh("click",function(){Pu(e);let i=VD();return Lu(i.onCloseClick())}),Kc();}}function $t(n,o){if(n&1&&lh(0,"div",10),n&2){let e=VD();_h("cursor",e.config.nzDraggable?"move":"auto");}}function Zt(n,o){}function Kt(n,o){if(n&1&&lh(0,"div",7),n&2){let e=VD();ch("innerHTML",e.config.nzContent,vv);}}function Qt(n,o){if(n&1){let e=LD();_i(0,"div",11),gh("cancelTriggered",function(){Pu(e);let i=VD();return Lu(i.onCloseClick())})("okTriggered",function(){Pu(e);let i=VD();return Lu(i.onOkClick())}),Kc();}if(n&2){let e=VD();ch("modalRef",e.modalRef);}}var zt=()=>{},T=class{nzCentered=false;nzClosable=true;nzOkLoading=false;nzOkDisabled=false;nzCancelDisabled=false;nzCancelLoading=false;nzDraggable=false;nzNoAnimation=false;nzAutofocus="auto";nzMask;nzMaskClosable;nzKeyboard=true;nzZIndex=1e3;nzWidth=520;nzCloseIcon="close";nzOkType="primary";nzOkDanger=false;nzModalType="default";nzOnCancel=zt;nzOnOk=zt;nzData;nzMaskStyle;nzBodyStyle;nzWrapClassName;nzClassName;nzStyle;nzTitle;nzFooter;nzCancelText;nzOkText;nzContent;nzCloseOnNavigation;nzViewContainerRef;nzAfterOpen;nzAfterClose;nzIconType="question-circle";nzDirection},_={enter:"ant-zoom-enter",enterActive:"ant-zoom-enter-active",leave:"ant-zoom-leave",leaveActive:"ant-zoom-leave-active"},I={enter:"ant-fade-enter",enterActive:"ant-fade-enter-active",leave:"ant-fade-leave",leaveActive:"ant-fade-leave-active"},te="ant-modal-mask",ne="modal",Ut=new A(""),we=(()=>{class n{config=C(T);static \u0275fac=function(t){return new(t||n)};static \u0275cmp=QE({type:n,selectors:[["button","nz-modal-close",""]],hostAttrs:["aria-label","Close",1,"ant-modal-close"],exportAs:["nzModalCloseBuiltin"],decls:2,vars:1,consts:[[1,"ant-modal-close-x"],[4,"nzStringTemplateOutlet"],[1,"ant-modal-close-icon",3,"nzType"]],template:function(t,i){t&1&&(_i(0,"span",0),nh(1,Ot,2,1,"ng-container",1),Kc()),t&2&&(gI(),ch("nzStringTemplateOutlet",i.config.nzCloseIcon));},dependencies:[pt,Se$1,Tt,Ie],encapsulation:2})}return n})();function qt(n,o){return r(r({},o),n)}function q(n,o,e){return typeof n>"u"?typeof o>"u"?e:o:n}function Ct(){throw Error("Attempting to attach modal content after content is already attached")}var ht=(()=>{class n extends G4{document=C(Uo);cdr=C(z0);config=C(T);ngZone=C(oe);host=C(_r);focusTrapFactory=C(i0);renderer=C(XI);overlayRef=C(t2);nzConfigService=C(kt);animationType=C(Gm,{optional:true});destroyRef=C(at);portalOutlet;modalElementRef;animationStateChanged=new Le$1;containerClick=new Le$1;cancelTriggered=new Le$1;okTriggered=new Le$1;modalRef;isStringContent=false;dir="ltr";elementFocusedBeforeModalWasOpened=null;focusTrap;mouseDown=false;oldMaskStyle=null;get showMask(){let e=this.nzConfigService.getConfigForComponent(ne)||{};return !!q(this.config.nzMask,e.nzMask,true)}get maskClosable(){let e=this.nzConfigService.getConfigForComponent(ne)||{};return !!q(this.config.nzMaskClosable,e.nzMaskClosable,true)}constructor(){super(),this.dir=this.overlayRef.getDirection(),this.isStringContent=typeof this.config.nzContent=="string",Vt$1(ne,()=>this.updateMaskClassname()),this.destroyRef.onDestroy(()=>{this.setMaskExitAnimationClass(true);});}onContainerClick(e){e.target===e.currentTarget&&!this.mouseDown&&this.showMask&&this.maskClosable&&this.containerClick.emit();}onCloseClick(){this.cancelTriggered.emit();}onOkClick(){this.okTriggered.emit();}markForCheck(){this.cdr.markForCheck();}attachComponentPortal(e){this.portalOutlet.hasAttached()&&Ct(),this.savePreviouslyFocusedElement(),this.setZIndexForBackdrop();let t=this.portalOutlet.attachComponentPortal(e);return this._startEnterAnimation(),t}attachTemplatePortal(e){this.portalOutlet.hasAttached()&&Ct(),this.savePreviouslyFocusedElement(),this.setZIndexForBackdrop();let t=this.portalOutlet.attachTemplatePortal(e);return this._startEnterAnimation(),t}attachStringContent(){this.savePreviouslyFocusedElement(),this.setZIndexForBackdrop(),this._startEnterAnimation();}getNativeElement(){return this.host.nativeElement}animationDisabled(){return this.config.nzNoAnimation||this.animationType==="NoopAnimations"}setModalTransformOrigin(){let e=this.modalElementRef.nativeElement;if(this.elementFocusedBeforeModalWasOpened){let t=this.elementFocusedBeforeModalWasOpened.getBoundingClientRect(),i=s9(this.elementFocusedBeforeModalWasOpened),a=i.left+t.width/2,r=i.top+t.height/2,m=`${a-e.offsetLeft}px ${r-e.offsetTop}px 0px`;this.renderer.setStyle(e,"transform-origin",m);}}savePreviouslyFocusedElement(){this.focusTrap||(this.focusTrap=this.focusTrapFactory.create(this.host.nativeElement)),this.document&&(this.elementFocusedBeforeModalWasOpened=this.document.activeElement,this.host.nativeElement.focus&&this.ngZone.runOutsideAngular(()=>x1(()=>this.host.nativeElement.focus())));}trapFocus(){let e=this.host.nativeElement;if(this.config.nzAutofocus)this.focusTrap.focusInitialElementWhenReady();else {let t=this.document.activeElement;t!==e&&!e.contains(t)&&e.focus();}}restoreFocus(){this.elementFocusedBeforeModalWasOpened?.focus(),this.focusTrap?.destroy();}setEnterInitialClass(){if(this.animationDisabled())return;let e=this.modalElementRef.nativeElement,t=this.overlayRef.backdropElement;e.classList.add(_.enter),t&&t.classList.add(I.enter);}setEnterActiveClass(){if(this.animationDisabled())return;this.setModalTransformOrigin();let e=this.modalElementRef.nativeElement,t=this.overlayRef.backdropElement;e.classList.add(_.enterActive),t&&t.classList.add(I.enterActive);}setExitAnimationClass(){let e=this.modalElementRef.nativeElement;e.classList.add(_.leave),e.classList.add(_.leaveActive),this.setMaskExitAnimationClass();}setMaskExitAnimationClass(e=false){let t=this.overlayRef.backdropElement;if(t){if(this.animationDisabled()||e){t.classList.remove(te);return}t.classList.add(I.leave),t.classList.add(I.leaveActive);}}cleanAnimationClass(){if(this.animationDisabled())return;let e=this.overlayRef.backdropElement,t=this.modalElementRef.nativeElement;e&&(e.classList.remove(I.enter),e.classList.remove(I.enterActive)),t.classList.remove(_.enter),t.classList.remove(_.enterActive),t.classList.remove(_.leave),t.classList.remove(_.leaveActive);}setZIndexForBackdrop(){let e=this.overlayRef.backdropElement;e&&j3(this.config.nzZIndex)&&this.renderer.setStyle(e,"z-index",this.config.nzZIndex);}bindBackdropStyle(){let e=this.overlayRef.backdropElement;if(e){if(this.oldMaskStyle){let t=this.oldMaskStyle;Object.keys(t).forEach(i=>{this.renderer.removeStyle(e,i);}),this.oldMaskStyle=null;}if(this.setZIndexForBackdrop(),typeof this.config.nzMaskStyle=="object"&&Object.keys(this.config.nzMaskStyle).length){let t=r({},this.config.nzMaskStyle);Object.keys(t).forEach(i=>{this.renderer.setStyle(e,i,t[i]);}),this.oldMaskStyle=t;}}}updateMaskClassname(){let e=this.overlayRef.backdropElement;e&&(this.showMask?e.classList.add(te):e.classList.remove(te));}_startEnterAnimation(){if(this.bindBackdropStyle(),this.animationStateChanged.emit("enter-start"),this.animationDisabled())this.trapFocus(),this.animationStateChanged.emit("enter-active");else {this.setEnterInitialClass(),x1(()=>this.setEnterActiveClass());let e=this.modalElementRef.nativeElement,t=()=>{e.removeEventListener("animationend",t),this.trapFocus(),this.cleanAnimationClass(),this.animationStateChanged.emit("enter-active");};e.addEventListener("animationend",t);}}_startLeaveAnimation(e){if(this.animationStateChanged.emit("leave-start"),this.animationDisabled())this.restoreFocus(),e?.(),this.animationStateChanged.emit("leave-active");else {this.setExitAnimationClass();let t=this.modalElementRef.nativeElement,i=()=>{t.removeEventListener("animationend",i),this.restoreFocus(),this.cleanAnimationClass(),e?.(),this.animationStateChanged.emit("leave-active");};t.addEventListener("animationend",i);}}setupMouseListeners(e){St$1(this.host.nativeElement,"mouseup").pipe(ue(this.destroyRef)).subscribe(()=>{this.mouseDown&&setTimeout(()=>{this.mouseDown=false;});}),St$1(e.nativeElement,"mousedown").pipe(ue(this.destroyRef)).subscribe(()=>{this.mouseDown=true;});}static \u0275fac=function(t){return new(t||n)};static \u0275dir=XE({type:n,features:[eh]})}return n})(),yt=(()=>{class n extends ht{set _portalOutlet(e){this.portalOutlet=e;}set _modalElementRef(e){this.modalElementRef=e;}cancelTriggered=new Le$1;okTriggered=new Le$1;ngOnInit(){this.setupMouseListeners(this.modalElementRef);}onCancel(){this.cancelTriggered.emit();}onOk(){this.okTriggered.emit();}static \u0275fac=(()=>{let e;return function(i){return (e||(e=Sy(n)))(i||n)}})();static \u0275cmp=QE({type:n,selectors:[["nz-modal-confirm-container"]],viewQuery:function(t,i){if(t&1&&Ih(Da,7)(gt,7),t&2){let a;qD(a=WD())&&(i._portalOutlet=a.first),qD(a=WD())&&(i._modalElementRef=a.first);}},hostAttrs:["tabindex","-1","role","dialog"],hostVars:8,hostBindings:function(t,i){t&1&&gh("click",function(r){return i.onContainerClick(r)}),t&2&&(cw(i.config.nzWrapClassName?"ant-modal-wrap "+i.config.nzWrapClassName:"ant-modal-wrap"),_h("z-index",i.config.nzZIndex),Mh("ant-modal-wrap-rtl",i.dir==="rtl")("ant-modal-centered",i.config.nzCentered));},outputs:{cancelTriggered:"cancelTriggered",okTriggered:"okTriggered"},exportAs:["nzModalConfirmContainer"],features:[rD([on]),eh],decls:17,vars:16,consts:[["modalElement",""],["role","document",1,"ant-modal"],[1,"ant-modal-content"],["nz-modal-close",""],[1,"ant-modal-body"],[1,"ant-modal-confirm-body-wrapper"],[1,"ant-modal-confirm-body"],[3,"nzType"],[1,"ant-modal-confirm-title"],[4,"nzStringTemplateOutlet"],[1,"ant-modal-confirm-content"],["cdkPortalOutlet",""],[3,"innerHTML"],[1,"ant-modal-confirm-btns"],["nz-button","",3,"nzLoading","disabled"],["nz-button","",3,"nzType","nzLoading","disabled","nzDanger"],["nz-modal-close","",3,"click"],["nz-button","",3,"click","nzLoading","disabled"],["nz-button","",3,"click","nzType","nzLoading","disabled","nzDanger"]],template:function(t,i){t&1&&(_i(0,"div",1,0),Rw(2,"nzToCssUnit"),_i(3,"div",2),bD(4,Dt,1,0,"button",3),_i(5,"div",4)(6,"div",5)(7,"div",6),lh(8,"nz-icon",7),_i(9,"span",8),nh(10,xt,2,1,"ng-container",9),Kc(),_i(11,"div",10),nh(12,Et,0,0,"ng-template",11),bD(13,Nt,1,1,"div",12),Kc()(),_i(14,"div",13),bD(15,At,3,6,"button",14),bD(16,St,3,8,"button",15),Kc()()()()()),t&2&&(sw(i.config.nzStyle),cw(i.config.nzClassName),_h("width",Ow(2,14,i.config?.nzWidth)),gI(4),_D(i.config.nzClosable?4:-1),gI(),sw(i.config.nzBodyStyle),gI(3),ch("nzType",i.config.nzIconType),gI(2),ch("nzStringTemplateOutlet",i.config.nzTitle),gI(3),_D(i.isStringContent?13:-1),gI(2),_D(i.config.nzCancelText!==null?15:-1),gI(),_D(i.config.nzOkText!==null?16:-1));},dependencies:[Fe,pt,Se$1,we,Tt,Ie,Z4,Da,dd,zc,t7,y7,Se,Ky],encapsulation:2})}return n})(),Re=(()=>{class n{cdr=C(z0);config=C(T);modalRef=$0.required();cancelTriggered=B0();okTriggered=B0();buttons=Array.isArray(this.config.nzFooter)?this.config.nzFooter.map(Gt):null;onCancel(){this.cancelTriggered.emit();}onOk(){this.okTriggered.emit();}markForCheck(){this.cdr.markForCheck();}getButtonCallableProp(e,t){let i=e[t],a=this.modalRef().getContentComponent();return typeof i=="function"?i.apply(e,a&&[a]):i}onButtonClick(e){if(!this.getButtonCallableProp(e,"loading")){let i=this.getButtonCallableProp(e,"onClick");e.autoLoading&&wr(i)&&(e.loading=true,i.then(()=>e.loading=false).catch(a=>{throw e.loading=false,a}));}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=QE({type:n,selectors:[["div","nz-modal-footer",""]],hostAttrs:[1,"ant-modal-footer"],inputs:{modalRef:[1,"modalRef"]},outputs:{cancelTriggered:"cancelTriggered",okTriggered:"okTriggered"},exportAs:["nzModalFooterBuiltin"],decls:2,vars:1,consts:[[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"],[3,"innerHTML"],["nz-button","",3,"hidden","nzLoading","disabled","nzType","nzDanger","nzShape","nzSize","nzGhost"],["nz-button","",3,"click","hidden","nzLoading","disabled","nzType","nzDanger","nzShape","nzSize","nzGhost"],["nz-button","",3,"nzLoading","disabled"],["nz-button","",3,"nzType","nzDanger","nzLoading","disabled"],["nz-button","",3,"click","nzLoading","disabled"],["nz-button","",3,"click","nzType","nzDanger","nzLoading","disabled"]],template:function(t,i){t&1&&bD(0,Bt,1,5,"ng-container")(1,Wt,2,2),t&2&&_D(i.config.nzFooter?0:1);},dependencies:[Tt,Ie,dd,zc,t7,y7,Ky],encapsulation:2})}return n})();function Gt(n){return r({type:null,size:"default",autoLoading:true,show:true,loading:false,disabled:false},n)}var vt=(()=>{class n{config=C(T);static \u0275fac=function(t){return new(t||n)};static \u0275cmp=QE({type:n,selectors:[["div","nz-modal-title",""]],hostAttrs:[1,"ant-modal-header"],exportAs:["nzModalTitleBuiltin"],decls:2,vars:1,consts:[[1,"ant-modal-title"],[4,"nzStringTemplateOutlet"],[3,"innerHTML"]],template:function(t,i){t&1&&(_i(0,"div",0),nh(1,jt,2,1,"ng-container",1),Kc()),t&2&&(gI(),ch("nzStringTemplateOutlet",i.config.nzTitle));},dependencies:[Tt,Ie],encapsulation:2})}return n})(),Mt=(()=>{class n extends ht{set _portalOutlet(e){this.portalOutlet=e;}set _modalElementRef(e){this.modalElementRef=e;}modalFooter;markForCheck(){super.markForCheck(),this.modalFooter?.markForCheck();}ngOnInit(){this.setupMouseListeners(this.modalElementRef);}onDragEnded(e){let t=this.modalElementRef.nativeElement,i=e.source.getFreeDragPosition(),{top:a,left:r}=getComputedStyle(t);this.renderer.setStyle(t,"top",W((parseFloat(a)||0)+i.y)),this.renderer.setStyle(t,"left",W((parseFloat(r)||0)+i.x)),e.source.reset();}static \u0275fac=(()=>{let e;return function(i){return (e||(e=Sy(n)))(i||n)}})();static \u0275cmp=QE({type:n,selectors:[["nz-modal-container"]],viewQuery:function(t,i){if(t&1&&Ih(Da,7)(gt,7)(Re,5),t&2){let a;qD(a=WD())&&(i._portalOutlet=a.first),qD(a=WD())&&(i._modalElementRef=a.first),qD(a=WD())&&(i.modalFooter=a.first);}},hostAttrs:["tabindex","-1","role","dialog"],hostVars:8,hostBindings:function(t,i){t&1&&gh("click",function(r){return i.onContainerClick(r)}),t&2&&(cw(i.config.nzWrapClassName?"ant-modal-wrap "+i.config.nzWrapClassName:"ant-modal-wrap"),_h("z-index",i.config.nzZIndex),Mh("ant-modal-wrap-rtl",i.dir==="rtl")("ant-modal-centered",i.config.nzCentered));},exportAs:["nzModalContainer"],features:[rD([on]),eh],decls:10,vars:15,consts:[["modalElement",""],["cdkDrag","","cdkDragBoundary",".cdk-overlay-container","role","document",1,"ant-modal",3,"cdkDragEnded","cdkDragDisabled"],[1,"ant-modal-content"],["nz-modal-close",""],["nz-modal-title","","cdkDragHandle","",3,"cursor"],[1,"ant-modal-body"],["cdkPortalOutlet",""],[3,"innerHTML"],["nz-modal-footer","",3,"modalRef"],["nz-modal-close","",3,"click"],["nz-modal-title","","cdkDragHandle",""],["nz-modal-footer","",3,"cancelTriggered","okTriggered","modalRef"]],template:function(t,i){t&1&&(_i(0,"div",1,0),Rw(2,"nzToCssUnit"),gh("cdkDragEnded",function(r){return i.onDragEnded(r)}),_i(3,"div",2),bD(4,Ht,1,0,"button",3),bD(5,$t,1,2,"div",4),_i(6,"div",5),nh(7,Zt,0,0,"ng-template",6),bD(8,Kt,1,1,"div",7),Kc(),bD(9,Qt,1,1,"div",8),Kc()()),t&2&&(sw(i.config.nzStyle),cw(i.config.nzClassName),_h("width",Ow(2,13,i.config?.nzWidth)),ch("cdkDragDisabled",!i.config.nzDraggable),gI(4),_D(i.config.nzClosable?4:-1),gI(),_D(i.config.nzTitle?5:-1),gI(),sw(i.config.nzBodyStyle),gI(2),_D(i.isStringContent?8:-1),gI(),_D(i.config.nzFooter!==null?9:-1));},dependencies:[we,vt,Z4,Da,Re,Fe,We,Ge,Se],encapsulation:2})}return n})(),U={OPEN:0,CLOSING:1,CLOSED:2},b={CANCEL:"cancel",OK:"ok"},ie=class{overlayRef;config;containerInstance;componentInstance=null;componentRef=null;result;state=U.OPEN;afterClose=new re;afterOpen=new re;destroy$=new re;constructor(o,e,t){this.overlayRef=o,this.config=e,this.containerInstance=t,t.animationStateChanged.pipe(on$1(i=>i==="enter-active"),yt$1(1)).subscribe(()=>{this.afterOpen.next(),this.afterOpen.complete(),e.nzAfterOpen instanceof Le$1&&e.nzAfterOpen.emit();}),t.animationStateChanged.pipe(on$1(i=>i==="leave-active"),yt$1(1)).subscribe(()=>this._finishDialogClose()),t.containerClick.pipe(im(this.destroy$)).subscribe(()=>{!this.config.nzCancelLoading&&!this.config.nzOkLoading&&this.trigger(b.CANCEL);}),o.keydownEvents().pipe(on$1(()=>this.config.nzKeyboard&&!this.config.nzCancelLoading&&!this.config.nzOkLoading),on$1(i=>i.keyCode===27&&!Pa(i))).subscribe(i=>{i.preventDefault(),this.trigger(b.CANCEL);}),t.cancelTriggered.pipe(im(this.destroy$)).subscribe(()=>this.trigger(b.CANCEL)),t.okTriggered.pipe(im(this.destroy$)).subscribe(()=>this.trigger(b.OK)),o.detachments().subscribe(()=>{this.afterClose.next(this.result),this.afterClose.complete(),e.nzAfterClose instanceof Le$1&&e.nzAfterClose.emit(this.result),this.componentInstance=null,this.componentRef=null,this.overlayRef.dispose();});}getContentComponent(){return this.componentInstance}getContentComponentRef(){return this.componentRef}getElement(){return this.containerInstance.getNativeElement()}destroy(o){this.close(o);}triggerOk(){return this.trigger(b.OK)}triggerCancel(){return this.trigger(b.CANCEL)}close(o){this.state===U.OPEN&&(this.result=o,this.state=U.CLOSING,this.containerInstance._startLeaveAnimation(()=>{this.overlayRef.detachBackdrop(),this._finishDialogClose();}));}updateConfig(o){Object.assign(this.config,o),this.containerInstance.bindBackdropStyle(),this.containerInstance.markForCheck();}getState(){return this.state}getConfig(){return this.config}getBackdropElement(){return this.overlayRef.backdropElement}trigger(o){return v(this,null,function*(){if(this.state===U.CLOSING)return;let e={[b.OK]:{trigger:this.config.nzOnOk,loadingKey:"nzOkLoading"},[b.CANCEL]:{trigger:this.config.nzOnCancel,loadingKey:"nzCancelLoading"}},{trigger:t,loadingKey:i}=e[o];if(!this.config[i]){if(t instanceof Le$1)t.emit(this.getContentComponent());else if(typeof t=="function"){let a=t(this.getContentComponent());if(wr(a)){this.config[i]=true,this.updateConfig(this.config);let r=false;try{r=yield a;}finally{this.config[i]=false,this.updateConfig(this.config),this.closeWhitResult(r);}}else this.closeWhitResult(a);}}})}closeWhitResult(o){o!==false&&this.close(o);}_finishDialogClose(){this.state=U.CLOSED,this.overlayRef.dispose(),this.destroy$.next();}},Xt=(()=>{class n{injector=C(Ee);nzConfigService=C(kt);directionality=C(Le);parentModal=C(n,{skipSelf:true,optional:true});openModalsAtThisLevel=[];afterAllClosedAtThisLevel=new re;get openModals(){return this.parentModal?this.parentModal.openModals:this.openModalsAtThisLevel}get _afterAllClosed(){let e=this.parentModal;return e?e._afterAllClosed:this.afterAllClosedAtThisLevel}afterAllClose=Vg(()=>this.openModals.length?this._afterAllClosed:this._afterAllClosed.pipe(Gl(void 0)));create(e){return this.open(e.nzContent,e)}closeAll(){this.closeModals(this.openModals);}confirm(e={},t="confirm"){return "nzFooter"in e&&Rt$1(`The Confirm-Modal doesn't support "nzFooter", this property will be ignored.`),"nzWidth"in e||(e.nzWidth=416),"nzMaskClosable"in e||(e.nzMaskClosable=false),e.nzModalType="confirm",e.nzClassName=`ant-modal-confirm ant-modal-confirm-${t} ${e.nzClassName||""}`,this.create(e)}info(e={}){return this.confirmFactory(e,"info")}success(e={}){return this.confirmFactory(e,"success")}error(e={}){return this.confirmFactory(e,"error")}warning(e={}){return this.confirmFactory(e,"warning")}open(e,t){let i=qt(t||{},new T),a=this.createOverlay(i),r=this.attachModalContainer(a,i),m=this.attachModalContent(e,r,a,i);return r.modalRef=m,Bu(a,t?.nzZIndex),this.openModals.push(m),m.afterClose.subscribe(()=>this.removeOpenModal(m)),m}removeOpenModal(e){let t=this.openModals.indexOf(e);t>-1&&(this.openModals.splice(t,1),this.openModals.length||this._afterAllClosed.next());}closeModals(e){let t=e.length;for(;t--;)e[t].close(),this.openModals.length||this._afterAllClosed.next();}createOverlay(e){let t=this.nzConfigService.getConfigForComponent(ne)||{};return pn(this.injector,{hasBackdrop:true,scrollStrategy:Na(this.injector),backdropClass:q(e.nzMask,t.nzMask,true)?te:"",positionStrategy:Ga(this.injector),disposeOnNavigation:q(e.nzCloseOnNavigation,t.nzCloseOnNavigation,true),direction:q(e.nzDirection,t.nzDirection,this.directionality.valueSignal())})}attachModalContainer(e,t){let i=t&&t.nzViewContainerRef&&t.nzViewContainerRef.injector,a=Ee.create({parent:i||this.injector,providers:[{provide:t2,useValue:e},{provide:T,useValue:t}]}),r=t.nzModalType==="confirm"?yt:Mt,m=new K1(r,t.nzViewContainerRef,a);return e.attach(m).instance}attachModalContent(e,t,i,a){let r=new ie(i,a,t);if(A1(e))t.attachTemplatePortal(new G1(e,null,{$implicit:a.nzData,modalRef:r}));else if(j3(e)&&typeof e!="string"){let m=this.createInjector(r,a),k=t.attachComponentPortal(new K1(e,a.nzViewContainerRef,m));r.componentRef=k,r.componentInstance=k.instance;}else t.attachStringContent();return r}createInjector(e,t){let i=t&&t.nzViewContainerRef&&t.nzViewContainerRef.injector;return Ee.create({parent:i||this.injector,providers:[{provide:ie,useValue:e},{provide:Ut,useValue:t.nzData}]})}confirmFactory(e={},t){let i={info:"info-circle",success:"check-circle",error:"close-circle",warning:"exclamation-circle"};return "nzIconType"in e||(e.nzIconType=i[t]),"nzCancelText"in e||(e.nzCancelText=null),this.confirm(e,t)}ngOnDestroy(){this.closeModals(this.openModalsAtThisLevel),this.afterAllClosedAtThisLevel.complete();}static \u0275fac=function(t){return new(t||n)};static \u0275prov=ie$1({token:n,factory:n.\u0275fac})}return n})();var Zn=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=YE({type:n});static \u0275inj=uu({providers:[Xt],imports:[we,Re,vt,Mt,yt]})}return n})();export{Ut as U,Xt as X,Zn as Z,ie as i};
|
|
1
|
+
import {C,aY as Ee,aq as kt,aw as Le,bz as re,bA as Vg,bB as Gl,bC as Rt$1,bD as Bu,bE as pn,bF as Ga,bG as Na,bH as t2,bI as K1,bJ as A1,bK as G1,a_ as j3,bL as A,i as ie$1,an as YE,ao as uu,r,bM as Le$1,bN as Sy,Q as QE,aA as pt,aB as Se$1,aC as Tt,aD as Ie,bO as Z4,bP as Da,d as dd,z as zc,c as t7,Z as y7,bQ as Ky,bR as eh,f as _i,R as Rw,m as bD,l as lh,aN as nh,g as Kc,br as sw,be as cw,ag as _h,O as Ow,p as gI,B as _D,x as ch,bc as rD,bS as on,h as gh,a4 as Mh,aJ as Ih,aK as qD,aL as WD,bT as W,bU as We,bV as Ge,bW as on$1,bX as yt$1,bY as im,bZ as Pa,b_ as v,b$ as wr,at as z0,a0 as $0,a1 as B0,c0 as G4,c1 as Uo,as as oe,ar as _r,c2 as i0,c3 as XI,c4 as Gm,b as at,bq as Vt$1,c5 as s9,c6 as x1,ay as St$1,u as ue,bu as XE,c7 as eD,F as LD,aO as el,aP as tl,E as VD,v as vw,a5 as ah,w as nl,G as Pu,I as Lu,c8 as h9,c9 as d9,ca as Aw,N as ND,S as SD,A as xD,cb as vv}from'./main-HV5WDK2F.js';(class n{static formats={B:{max:1024},kB:{max:Math.pow(1024,2),prev:"B"},KB:{max:Math.pow(1024,2),prev:"B"},MB:{max:Math.pow(1024,3),prev:"kB"},GB:{max:Math.pow(1024,4),prev:"MB"},TB:{max:Number.MAX_SAFE_INTEGER,prev:"GB"}};transform(o,e=0,t="B",i){if(!(h9(o)&&h9(e)&&e%1===0&&e>=0))return o;let a=o,r=t;for(;r!=="B";)a*=1024,r=n.formats[r].prev;if(i){let m=n.formats[i],k=d9(n.calculateResult(m,a),e);return n.formatResult(k,i)}for(let m in n.formats)if(n.formats.hasOwnProperty(m)){let k=n.formats[m];if(a<k.max){let kt=d9(n.calculateResult(k,a),e);return n.formatResult(kt,m)}}}static formatResult(o,e){return `${o} ${e}`}static calculateResult(o,e){let t=o.prev?n.formats[o.prev]:void 0;return t?e/t.max:e}static \u0275fac=function(e){return new(e||n)};static \u0275pipe=eD({name:"nzBytes",type:n,pure:true})});var Se=(()=>{class n{transform(e,t="px"){return typeof e=="number"?`${e}${t}`:e}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=eD({name:"nzToCssUnit",type:n,pure:true})}return n})();var Fe=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=YE({type:n});static \u0275inj=uu({})}return n})();function Ot(n,o){if(n&1&&(el(0),lh(1,"nz-icon",2),tl()),n&2){let e=o.$implicit;gI(),ch("nzType",e);}}var gt=["modalElement"];function Dt(n,o){if(n&1){let e=LD();_i(0,"button",16),gh("click",function(){Pu(e);let i=VD();return Lu(i.onCloseClick())}),Kc();}}function xt(n,o){if(n&1&&(el(0),lh(1,"span",12),tl()),n&2){let e=VD();gI(),ch("innerHTML",e.config.nzTitle,vv);}}function Et(n,o){}function Nt(n,o){if(n&1&&lh(0,"div",12),n&2){let e=VD();ch("innerHTML",e.config.nzContent,vv);}}function At(n,o){if(n&1){let e=LD();_i(0,"button",17),gh("click",function(){Pu(e);let i=VD();return Lu(i.onCancel())}),vw(1),Rw(2,"nzI18n"),Kc();}if(n&2){let e=VD();ch("nzLoading",e.config.nzCancelLoading)("disabled",e.config.nzCancelDisabled),ah("cdkFocusInitial",e.config.nzAutofocus==="cancel"||null),gI(),nl(" ",e.config.nzCancelText||Ow(2,4,"Modal.cancelText")," ");}}function St(n,o){if(n&1){let e=LD();_i(0,"button",18),gh("click",function(){Pu(e);let i=VD();return Lu(i.onOk())}),vw(1),Rw(2,"nzI18n"),Kc();}if(n&2){let e=VD();ch("nzType",e.config.nzOkType)("nzLoading",e.config.nzOkLoading)("disabled",e.config.nzOkDisabled)("nzDanger",e.config.nzOkDanger),ah("cdkFocusInitial",e.config.nzAutofocus==="ok"||null),gI(),nl(" ",e.config.nzOkText||Ow(2,6,"Modal.okText")," ");}}var Ft=(n,o)=>({$implicit:n,modalRef:o});function Rt(n,o){if(n&1){let e=LD();_i(0,"button",3),gh("click",function(){let i=Pu(e).$implicit,a=VD(4);return Lu(a.onButtonClick(i))}),vw(1),Kc();}if(n&2){let e=o.$implicit,t=VD(4);ch("hidden",!t.getButtonCallableProp(e,"show"))("nzLoading",t.getButtonCallableProp(e,"loading"))("disabled",t.getButtonCallableProp(e,"disabled"))("nzType",e.type)("nzDanger",e.danger)("nzShape",e.shape)("nzSize",e.size)("nzGhost",e.ghost),gI(),nl(" ",e.label," ");}}function wt(n,o){if(n&1&&ND(0,Rt,2,9,"button",2,SD),n&2){let e=VD(3);xD(e.buttons);}}function Lt(n,o){if(n&1&&lh(0,"div",1),n&2){let e=VD(3);ch("innerHTML",e.config.nzFooter,vv);}}function It(n,o){if(n&1&&(el(0),bD(1,wt,2,0)(2,Lt,1,1,"div",1),tl()),n&2){let e=VD(2);gI(),_D(e.buttons?1:2);}}function Bt(n,o){if(n&1&&nh(0,It,3,1,"ng-container",0),n&2){let e=VD();ch("nzStringTemplateOutlet",e.config.nzFooter)("nzStringTemplateOutletContext",Aw(2,Ft,e.config.nzData,e.modalRef()));}}function Pt(n,o){if(n&1){let e=LD();_i(0,"button",6),gh("click",function(){Pu(e);let i=VD(2);return Lu(i.onCancel())}),vw(1),Rw(2,"nzI18n"),Kc();}if(n&2){let e=VD(2);ch("nzLoading",e.config.nzCancelLoading)("disabled",e.config.nzCancelDisabled),ah("cdkFocusInitial",e.config.nzAutofocus==="cancel"||null),gI(),nl(" ",e.config.nzCancelText||Ow(2,4,"Modal.cancelText")," ");}}function Vt(n,o){if(n&1){let e=LD();_i(0,"button",7),gh("click",function(){Pu(e);let i=VD(2);return Lu(i.onOk())}),vw(1),Rw(2,"nzI18n"),Kc();}if(n&2){let e=VD(2);ch("nzType",e.config.nzOkType)("nzDanger",e.config.nzOkDanger)("nzLoading",e.config.nzOkLoading)("disabled",e.config.nzOkDisabled),ah("cdkFocusInitial",e.config.nzAutofocus==="ok"||null),gI(),nl(" ",e.config.nzOkText||Ow(2,6,"Modal.okText")," ");}}function Wt(n,o){if(n&1&&(bD(0,Pt,3,6,"button",4),bD(1,Vt,3,8,"button",5)),n&2){let e=VD();_D(e.config.nzCancelText!==null?0:-1),gI(),_D(e.config.nzOkText!==null?1:-1);}}function jt(n,o){if(n&1&&(el(0),lh(1,"div",2),tl()),n&2){let e=VD();gI(),ch("innerHTML",e.config.nzTitle,vv);}}function Ht(n,o){if(n&1){let e=LD();_i(0,"button",9),gh("click",function(){Pu(e);let i=VD();return Lu(i.onCloseClick())}),Kc();}}function $t(n,o){if(n&1&&lh(0,"div",10),n&2){let e=VD();_h("cursor",e.config.nzDraggable?"move":"auto");}}function Zt(n,o){}function Kt(n,o){if(n&1&&lh(0,"div",7),n&2){let e=VD();ch("innerHTML",e.config.nzContent,vv);}}function Qt(n,o){if(n&1){let e=LD();_i(0,"div",11),gh("cancelTriggered",function(){Pu(e);let i=VD();return Lu(i.onCloseClick())})("okTriggered",function(){Pu(e);let i=VD();return Lu(i.onOkClick())}),Kc();}if(n&2){let e=VD();ch("modalRef",e.modalRef);}}var zt=()=>{},T=class{nzCentered=false;nzClosable=true;nzOkLoading=false;nzOkDisabled=false;nzCancelDisabled=false;nzCancelLoading=false;nzDraggable=false;nzNoAnimation=false;nzAutofocus="auto";nzMask;nzMaskClosable;nzKeyboard=true;nzZIndex=1e3;nzWidth=520;nzCloseIcon="close";nzOkType="primary";nzOkDanger=false;nzModalType="default";nzOnCancel=zt;nzOnOk=zt;nzData;nzMaskStyle;nzBodyStyle;nzWrapClassName;nzClassName;nzStyle;nzTitle;nzFooter;nzCancelText;nzOkText;nzContent;nzCloseOnNavigation;nzViewContainerRef;nzAfterOpen;nzAfterClose;nzIconType="question-circle";nzDirection},_={enter:"ant-zoom-enter",enterActive:"ant-zoom-enter-active",leave:"ant-zoom-leave",leaveActive:"ant-zoom-leave-active"},I={enter:"ant-fade-enter",enterActive:"ant-fade-enter-active",leave:"ant-fade-leave",leaveActive:"ant-fade-leave-active"},te="ant-modal-mask",ne="modal",Ut=new A(""),we=(()=>{class n{config=C(T);static \u0275fac=function(t){return new(t||n)};static \u0275cmp=QE({type:n,selectors:[["button","nz-modal-close",""]],hostAttrs:["aria-label","Close",1,"ant-modal-close"],exportAs:["nzModalCloseBuiltin"],decls:2,vars:1,consts:[[1,"ant-modal-close-x"],[4,"nzStringTemplateOutlet"],[1,"ant-modal-close-icon",3,"nzType"]],template:function(t,i){t&1&&(_i(0,"span",0),nh(1,Ot,2,1,"ng-container",1),Kc()),t&2&&(gI(),ch("nzStringTemplateOutlet",i.config.nzCloseIcon));},dependencies:[pt,Se$1,Tt,Ie],encapsulation:2})}return n})();function qt(n,o){return r(r({},o),n)}function q(n,o,e){return typeof n>"u"?typeof o>"u"?e:o:n}function Ct(){throw Error("Attempting to attach modal content after content is already attached")}var ht=(()=>{class n extends G4{document=C(Uo);cdr=C(z0);config=C(T);ngZone=C(oe);host=C(_r);focusTrapFactory=C(i0);renderer=C(XI);overlayRef=C(t2);nzConfigService=C(kt);animationType=C(Gm,{optional:true});destroyRef=C(at);portalOutlet;modalElementRef;animationStateChanged=new Le$1;containerClick=new Le$1;cancelTriggered=new Le$1;okTriggered=new Le$1;modalRef;isStringContent=false;dir="ltr";elementFocusedBeforeModalWasOpened=null;focusTrap;mouseDown=false;oldMaskStyle=null;get showMask(){let e=this.nzConfigService.getConfigForComponent(ne)||{};return !!q(this.config.nzMask,e.nzMask,true)}get maskClosable(){let e=this.nzConfigService.getConfigForComponent(ne)||{};return !!q(this.config.nzMaskClosable,e.nzMaskClosable,true)}constructor(){super(),this.dir=this.overlayRef.getDirection(),this.isStringContent=typeof this.config.nzContent=="string",Vt$1(ne,()=>this.updateMaskClassname()),this.destroyRef.onDestroy(()=>{this.setMaskExitAnimationClass(true);});}onContainerClick(e){e.target===e.currentTarget&&!this.mouseDown&&this.showMask&&this.maskClosable&&this.containerClick.emit();}onCloseClick(){this.cancelTriggered.emit();}onOkClick(){this.okTriggered.emit();}markForCheck(){this.cdr.markForCheck();}attachComponentPortal(e){this.portalOutlet.hasAttached()&&Ct(),this.savePreviouslyFocusedElement(),this.setZIndexForBackdrop();let t=this.portalOutlet.attachComponentPortal(e);return this._startEnterAnimation(),t}attachTemplatePortal(e){this.portalOutlet.hasAttached()&&Ct(),this.savePreviouslyFocusedElement(),this.setZIndexForBackdrop();let t=this.portalOutlet.attachTemplatePortal(e);return this._startEnterAnimation(),t}attachStringContent(){this.savePreviouslyFocusedElement(),this.setZIndexForBackdrop(),this._startEnterAnimation();}getNativeElement(){return this.host.nativeElement}animationDisabled(){return this.config.nzNoAnimation||this.animationType==="NoopAnimations"}setModalTransformOrigin(){let e=this.modalElementRef.nativeElement;if(this.elementFocusedBeforeModalWasOpened){let t=this.elementFocusedBeforeModalWasOpened.getBoundingClientRect(),i=s9(this.elementFocusedBeforeModalWasOpened),a=i.left+t.width/2,r=i.top+t.height/2,m=`${a-e.offsetLeft}px ${r-e.offsetTop}px 0px`;this.renderer.setStyle(e,"transform-origin",m);}}savePreviouslyFocusedElement(){this.focusTrap||(this.focusTrap=this.focusTrapFactory.create(this.host.nativeElement)),this.document&&(this.elementFocusedBeforeModalWasOpened=this.document.activeElement,this.host.nativeElement.focus&&this.ngZone.runOutsideAngular(()=>x1(()=>this.host.nativeElement.focus())));}trapFocus(){let e=this.host.nativeElement;if(this.config.nzAutofocus)this.focusTrap.focusInitialElementWhenReady();else {let t=this.document.activeElement;t!==e&&!e.contains(t)&&e.focus();}}restoreFocus(){this.elementFocusedBeforeModalWasOpened?.focus(),this.focusTrap?.destroy();}setEnterInitialClass(){if(this.animationDisabled())return;let e=this.modalElementRef.nativeElement,t=this.overlayRef.backdropElement;e.classList.add(_.enter),t&&t.classList.add(I.enter);}setEnterActiveClass(){if(this.animationDisabled())return;this.setModalTransformOrigin();let e=this.modalElementRef.nativeElement,t=this.overlayRef.backdropElement;e.classList.add(_.enterActive),t&&t.classList.add(I.enterActive);}setExitAnimationClass(){let e=this.modalElementRef.nativeElement;e.classList.add(_.leave),e.classList.add(_.leaveActive),this.setMaskExitAnimationClass();}setMaskExitAnimationClass(e=false){let t=this.overlayRef.backdropElement;if(t){if(this.animationDisabled()||e){t.classList.remove(te);return}t.classList.add(I.leave),t.classList.add(I.leaveActive);}}cleanAnimationClass(){if(this.animationDisabled())return;let e=this.overlayRef.backdropElement,t=this.modalElementRef.nativeElement;e&&(e.classList.remove(I.enter),e.classList.remove(I.enterActive)),t.classList.remove(_.enter),t.classList.remove(_.enterActive),t.classList.remove(_.leave),t.classList.remove(_.leaveActive);}setZIndexForBackdrop(){let e=this.overlayRef.backdropElement;e&&j3(this.config.nzZIndex)&&this.renderer.setStyle(e,"z-index",this.config.nzZIndex);}bindBackdropStyle(){let e=this.overlayRef.backdropElement;if(e){if(this.oldMaskStyle){let t=this.oldMaskStyle;Object.keys(t).forEach(i=>{this.renderer.removeStyle(e,i);}),this.oldMaskStyle=null;}if(this.setZIndexForBackdrop(),typeof this.config.nzMaskStyle=="object"&&Object.keys(this.config.nzMaskStyle).length){let t=r({},this.config.nzMaskStyle);Object.keys(t).forEach(i=>{this.renderer.setStyle(e,i,t[i]);}),this.oldMaskStyle=t;}}}updateMaskClassname(){let e=this.overlayRef.backdropElement;e&&(this.showMask?e.classList.add(te):e.classList.remove(te));}_startEnterAnimation(){if(this.bindBackdropStyle(),this.animationStateChanged.emit("enter-start"),this.animationDisabled())this.trapFocus(),this.animationStateChanged.emit("enter-active");else {this.setEnterInitialClass(),x1(()=>this.setEnterActiveClass());let e=this.modalElementRef.nativeElement,t=()=>{e.removeEventListener("animationend",t),this.trapFocus(),this.cleanAnimationClass(),this.animationStateChanged.emit("enter-active");};e.addEventListener("animationend",t);}}_startLeaveAnimation(e){if(this.animationStateChanged.emit("leave-start"),this.animationDisabled())this.restoreFocus(),e?.(),this.animationStateChanged.emit("leave-active");else {this.setExitAnimationClass();let t=this.modalElementRef.nativeElement,i=()=>{t.removeEventListener("animationend",i),this.restoreFocus(),this.cleanAnimationClass(),e?.(),this.animationStateChanged.emit("leave-active");};t.addEventListener("animationend",i);}}setupMouseListeners(e){St$1(this.host.nativeElement,"mouseup").pipe(ue(this.destroyRef)).subscribe(()=>{this.mouseDown&&setTimeout(()=>{this.mouseDown=false;});}),St$1(e.nativeElement,"mousedown").pipe(ue(this.destroyRef)).subscribe(()=>{this.mouseDown=true;});}static \u0275fac=function(t){return new(t||n)};static \u0275dir=XE({type:n,features:[eh]})}return n})(),yt=(()=>{class n extends ht{set _portalOutlet(e){this.portalOutlet=e;}set _modalElementRef(e){this.modalElementRef=e;}cancelTriggered=new Le$1;okTriggered=new Le$1;ngOnInit(){this.setupMouseListeners(this.modalElementRef);}onCancel(){this.cancelTriggered.emit();}onOk(){this.okTriggered.emit();}static \u0275fac=(()=>{let e;return function(i){return (e||(e=Sy(n)))(i||n)}})();static \u0275cmp=QE({type:n,selectors:[["nz-modal-confirm-container"]],viewQuery:function(t,i){if(t&1&&Ih(Da,7)(gt,7),t&2){let a;qD(a=WD())&&(i._portalOutlet=a.first),qD(a=WD())&&(i._modalElementRef=a.first);}},hostAttrs:["tabindex","-1","role","dialog"],hostVars:8,hostBindings:function(t,i){t&1&&gh("click",function(r){return i.onContainerClick(r)}),t&2&&(cw(i.config.nzWrapClassName?"ant-modal-wrap "+i.config.nzWrapClassName:"ant-modal-wrap"),_h("z-index",i.config.nzZIndex),Mh("ant-modal-wrap-rtl",i.dir==="rtl")("ant-modal-centered",i.config.nzCentered));},outputs:{cancelTriggered:"cancelTriggered",okTriggered:"okTriggered"},exportAs:["nzModalConfirmContainer"],features:[rD([on]),eh],decls:17,vars:16,consts:[["modalElement",""],["role","document",1,"ant-modal"],[1,"ant-modal-content"],["nz-modal-close",""],[1,"ant-modal-body"],[1,"ant-modal-confirm-body-wrapper"],[1,"ant-modal-confirm-body"],[3,"nzType"],[1,"ant-modal-confirm-title"],[4,"nzStringTemplateOutlet"],[1,"ant-modal-confirm-content"],["cdkPortalOutlet",""],[3,"innerHTML"],[1,"ant-modal-confirm-btns"],["nz-button","",3,"nzLoading","disabled"],["nz-button","",3,"nzType","nzLoading","disabled","nzDanger"],["nz-modal-close","",3,"click"],["nz-button","",3,"click","nzLoading","disabled"],["nz-button","",3,"click","nzType","nzLoading","disabled","nzDanger"]],template:function(t,i){t&1&&(_i(0,"div",1,0),Rw(2,"nzToCssUnit"),_i(3,"div",2),bD(4,Dt,1,0,"button",3),_i(5,"div",4)(6,"div",5)(7,"div",6),lh(8,"nz-icon",7),_i(9,"span",8),nh(10,xt,2,1,"ng-container",9),Kc(),_i(11,"div",10),nh(12,Et,0,0,"ng-template",11),bD(13,Nt,1,1,"div",12),Kc()(),_i(14,"div",13),bD(15,At,3,6,"button",14),bD(16,St,3,8,"button",15),Kc()()()()()),t&2&&(sw(i.config.nzStyle),cw(i.config.nzClassName),_h("width",Ow(2,14,i.config?.nzWidth)),gI(4),_D(i.config.nzClosable?4:-1),gI(),sw(i.config.nzBodyStyle),gI(3),ch("nzType",i.config.nzIconType),gI(2),ch("nzStringTemplateOutlet",i.config.nzTitle),gI(3),_D(i.isStringContent?13:-1),gI(2),_D(i.config.nzCancelText!==null?15:-1),gI(),_D(i.config.nzOkText!==null?16:-1));},dependencies:[Fe,pt,Se$1,we,Tt,Ie,Z4,Da,dd,zc,t7,y7,Se,Ky],encapsulation:2})}return n})(),Re=(()=>{class n{cdr=C(z0);config=C(T);modalRef=$0.required();cancelTriggered=B0();okTriggered=B0();buttons=Array.isArray(this.config.nzFooter)?this.config.nzFooter.map(Gt):null;onCancel(){this.cancelTriggered.emit();}onOk(){this.okTriggered.emit();}markForCheck(){this.cdr.markForCheck();}getButtonCallableProp(e,t){let i=e[t],a=this.modalRef().getContentComponent();return typeof i=="function"?i.apply(e,a&&[a]):i}onButtonClick(e){if(!this.getButtonCallableProp(e,"loading")){let i=this.getButtonCallableProp(e,"onClick");e.autoLoading&&wr(i)&&(e.loading=true,i.then(()=>e.loading=false).catch(a=>{throw e.loading=false,a}));}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=QE({type:n,selectors:[["div","nz-modal-footer",""]],hostAttrs:[1,"ant-modal-footer"],inputs:{modalRef:[1,"modalRef"]},outputs:{cancelTriggered:"cancelTriggered",okTriggered:"okTriggered"},exportAs:["nzModalFooterBuiltin"],decls:2,vars:1,consts:[[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"],[3,"innerHTML"],["nz-button","",3,"hidden","nzLoading","disabled","nzType","nzDanger","nzShape","nzSize","nzGhost"],["nz-button","",3,"click","hidden","nzLoading","disabled","nzType","nzDanger","nzShape","nzSize","nzGhost"],["nz-button","",3,"nzLoading","disabled"],["nz-button","",3,"nzType","nzDanger","nzLoading","disabled"],["nz-button","",3,"click","nzLoading","disabled"],["nz-button","",3,"click","nzType","nzDanger","nzLoading","disabled"]],template:function(t,i){t&1&&bD(0,Bt,1,5,"ng-container")(1,Wt,2,2),t&2&&_D(i.config.nzFooter?0:1);},dependencies:[Tt,Ie,dd,zc,t7,y7,Ky],encapsulation:2})}return n})();function Gt(n){return r({type:null,size:"default",autoLoading:true,show:true,loading:false,disabled:false},n)}var vt=(()=>{class n{config=C(T);static \u0275fac=function(t){return new(t||n)};static \u0275cmp=QE({type:n,selectors:[["div","nz-modal-title",""]],hostAttrs:[1,"ant-modal-header"],exportAs:["nzModalTitleBuiltin"],decls:2,vars:1,consts:[[1,"ant-modal-title"],[4,"nzStringTemplateOutlet"],[3,"innerHTML"]],template:function(t,i){t&1&&(_i(0,"div",0),nh(1,jt,2,1,"ng-container",1),Kc()),t&2&&(gI(),ch("nzStringTemplateOutlet",i.config.nzTitle));},dependencies:[Tt,Ie],encapsulation:2})}return n})(),Mt=(()=>{class n extends ht{set _portalOutlet(e){this.portalOutlet=e;}set _modalElementRef(e){this.modalElementRef=e;}modalFooter;markForCheck(){super.markForCheck(),this.modalFooter?.markForCheck();}ngOnInit(){this.setupMouseListeners(this.modalElementRef);}onDragEnded(e){let t=this.modalElementRef.nativeElement,i=e.source.getFreeDragPosition(),{top:a,left:r}=getComputedStyle(t);this.renderer.setStyle(t,"top",W((parseFloat(a)||0)+i.y)),this.renderer.setStyle(t,"left",W((parseFloat(r)||0)+i.x)),e.source.reset();}static \u0275fac=(()=>{let e;return function(i){return (e||(e=Sy(n)))(i||n)}})();static \u0275cmp=QE({type:n,selectors:[["nz-modal-container"]],viewQuery:function(t,i){if(t&1&&Ih(Da,7)(gt,7)(Re,5),t&2){let a;qD(a=WD())&&(i._portalOutlet=a.first),qD(a=WD())&&(i._modalElementRef=a.first),qD(a=WD())&&(i.modalFooter=a.first);}},hostAttrs:["tabindex","-1","role","dialog"],hostVars:8,hostBindings:function(t,i){t&1&&gh("click",function(r){return i.onContainerClick(r)}),t&2&&(cw(i.config.nzWrapClassName?"ant-modal-wrap "+i.config.nzWrapClassName:"ant-modal-wrap"),_h("z-index",i.config.nzZIndex),Mh("ant-modal-wrap-rtl",i.dir==="rtl")("ant-modal-centered",i.config.nzCentered));},exportAs:["nzModalContainer"],features:[rD([on]),eh],decls:10,vars:15,consts:[["modalElement",""],["cdkDrag","","cdkDragBoundary",".cdk-overlay-container","role","document",1,"ant-modal",3,"cdkDragEnded","cdkDragDisabled"],[1,"ant-modal-content"],["nz-modal-close",""],["nz-modal-title","","cdkDragHandle","",3,"cursor"],[1,"ant-modal-body"],["cdkPortalOutlet",""],[3,"innerHTML"],["nz-modal-footer","",3,"modalRef"],["nz-modal-close","",3,"click"],["nz-modal-title","","cdkDragHandle",""],["nz-modal-footer","",3,"cancelTriggered","okTriggered","modalRef"]],template:function(t,i){t&1&&(_i(0,"div",1,0),Rw(2,"nzToCssUnit"),gh("cdkDragEnded",function(r){return i.onDragEnded(r)}),_i(3,"div",2),bD(4,Ht,1,0,"button",3),bD(5,$t,1,2,"div",4),_i(6,"div",5),nh(7,Zt,0,0,"ng-template",6),bD(8,Kt,1,1,"div",7),Kc(),bD(9,Qt,1,1,"div",8),Kc()()),t&2&&(sw(i.config.nzStyle),cw(i.config.nzClassName),_h("width",Ow(2,13,i.config?.nzWidth)),ch("cdkDragDisabled",!i.config.nzDraggable),gI(4),_D(i.config.nzClosable?4:-1),gI(),_D(i.config.nzTitle?5:-1),gI(),sw(i.config.nzBodyStyle),gI(2),_D(i.isStringContent?8:-1),gI(),_D(i.config.nzFooter!==null?9:-1));},dependencies:[we,vt,Z4,Da,Re,Fe,We,Ge,Se],encapsulation:2})}return n})(),U={OPEN:0,CLOSING:1,CLOSED:2},b={CANCEL:"cancel",OK:"ok"},ie=class{overlayRef;config;containerInstance;componentInstance=null;componentRef=null;result;state=U.OPEN;afterClose=new re;afterOpen=new re;destroy$=new re;constructor(o,e,t){this.overlayRef=o,this.config=e,this.containerInstance=t,t.animationStateChanged.pipe(on$1(i=>i==="enter-active"),yt$1(1)).subscribe(()=>{this.afterOpen.next(),this.afterOpen.complete(),e.nzAfterOpen instanceof Le$1&&e.nzAfterOpen.emit();}),t.animationStateChanged.pipe(on$1(i=>i==="leave-active"),yt$1(1)).subscribe(()=>this._finishDialogClose()),t.containerClick.pipe(im(this.destroy$)).subscribe(()=>{!this.config.nzCancelLoading&&!this.config.nzOkLoading&&this.trigger(b.CANCEL);}),o.keydownEvents().pipe(on$1(()=>this.config.nzKeyboard&&!this.config.nzCancelLoading&&!this.config.nzOkLoading),on$1(i=>i.keyCode===27&&!Pa(i))).subscribe(i=>{i.preventDefault(),this.trigger(b.CANCEL);}),t.cancelTriggered.pipe(im(this.destroy$)).subscribe(()=>this.trigger(b.CANCEL)),t.okTriggered.pipe(im(this.destroy$)).subscribe(()=>this.trigger(b.OK)),o.detachments().subscribe(()=>{this.afterClose.next(this.result),this.afterClose.complete(),e.nzAfterClose instanceof Le$1&&e.nzAfterClose.emit(this.result),this.componentInstance=null,this.componentRef=null,this.overlayRef.dispose();});}getContentComponent(){return this.componentInstance}getContentComponentRef(){return this.componentRef}getElement(){return this.containerInstance.getNativeElement()}destroy(o){this.close(o);}triggerOk(){return this.trigger(b.OK)}triggerCancel(){return this.trigger(b.CANCEL)}close(o){this.state===U.OPEN&&(this.result=o,this.state=U.CLOSING,this.containerInstance._startLeaveAnimation(()=>{this.overlayRef.detachBackdrop(),this._finishDialogClose();}));}updateConfig(o){Object.assign(this.config,o),this.containerInstance.bindBackdropStyle(),this.containerInstance.markForCheck();}getState(){return this.state}getConfig(){return this.config}getBackdropElement(){return this.overlayRef.backdropElement}trigger(o){return v(this,null,function*(){if(this.state===U.CLOSING)return;let e={[b.OK]:{trigger:this.config.nzOnOk,loadingKey:"nzOkLoading"},[b.CANCEL]:{trigger:this.config.nzOnCancel,loadingKey:"nzCancelLoading"}},{trigger:t,loadingKey:i}=e[o];if(!this.config[i]){if(t instanceof Le$1)t.emit(this.getContentComponent());else if(typeof t=="function"){let a=t(this.getContentComponent());if(wr(a)){this.config[i]=true,this.updateConfig(this.config);let r=false;try{r=yield a;}finally{this.config[i]=false,this.updateConfig(this.config),this.closeWhitResult(r);}}else this.closeWhitResult(a);}}})}closeWhitResult(o){o!==false&&this.close(o);}_finishDialogClose(){this.state=U.CLOSED,this.overlayRef.dispose(),this.destroy$.next();}},Xt=(()=>{class n{injector=C(Ee);nzConfigService=C(kt);directionality=C(Le);parentModal=C(n,{skipSelf:true,optional:true});openModalsAtThisLevel=[];afterAllClosedAtThisLevel=new re;get openModals(){return this.parentModal?this.parentModal.openModals:this.openModalsAtThisLevel}get _afterAllClosed(){let e=this.parentModal;return e?e._afterAllClosed:this.afterAllClosedAtThisLevel}afterAllClose=Vg(()=>this.openModals.length?this._afterAllClosed:this._afterAllClosed.pipe(Gl(void 0)));create(e){return this.open(e.nzContent,e)}closeAll(){this.closeModals(this.openModals);}confirm(e={},t="confirm"){return "nzFooter"in e&&Rt$1(`The Confirm-Modal doesn't support "nzFooter", this property will be ignored.`),"nzWidth"in e||(e.nzWidth=416),"nzMaskClosable"in e||(e.nzMaskClosable=false),e.nzModalType="confirm",e.nzClassName=`ant-modal-confirm ant-modal-confirm-${t} ${e.nzClassName||""}`,this.create(e)}info(e={}){return this.confirmFactory(e,"info")}success(e={}){return this.confirmFactory(e,"success")}error(e={}){return this.confirmFactory(e,"error")}warning(e={}){return this.confirmFactory(e,"warning")}open(e,t){let i=qt(t||{},new T),a=this.createOverlay(i),r=this.attachModalContainer(a,i),m=this.attachModalContent(e,r,a,i);return r.modalRef=m,Bu(a,t?.nzZIndex),this.openModals.push(m),m.afterClose.subscribe(()=>this.removeOpenModal(m)),m}removeOpenModal(e){let t=this.openModals.indexOf(e);t>-1&&(this.openModals.splice(t,1),this.openModals.length||this._afterAllClosed.next());}closeModals(e){let t=e.length;for(;t--;)e[t].close(),this.openModals.length||this._afterAllClosed.next();}createOverlay(e){let t=this.nzConfigService.getConfigForComponent(ne)||{};return pn(this.injector,{hasBackdrop:true,scrollStrategy:Na(this.injector),backdropClass:q(e.nzMask,t.nzMask,true)?te:"",positionStrategy:Ga(this.injector),disposeOnNavigation:q(e.nzCloseOnNavigation,t.nzCloseOnNavigation,true),direction:q(e.nzDirection,t.nzDirection,this.directionality.valueSignal())})}attachModalContainer(e,t){let i=t&&t.nzViewContainerRef&&t.nzViewContainerRef.injector,a=Ee.create({parent:i||this.injector,providers:[{provide:t2,useValue:e},{provide:T,useValue:t}]}),r=t.nzModalType==="confirm"?yt:Mt,m=new K1(r,t.nzViewContainerRef,a);return e.attach(m).instance}attachModalContent(e,t,i,a){let r=new ie(i,a,t);if(A1(e))t.attachTemplatePortal(new G1(e,null,{$implicit:a.nzData,modalRef:r}));else if(j3(e)&&typeof e!="string"){let m=this.createInjector(r,a),k=t.attachComponentPortal(new K1(e,a.nzViewContainerRef,m));r.componentRef=k,r.componentInstance=k.instance;}else t.attachStringContent();return r}createInjector(e,t){let i=t&&t.nzViewContainerRef&&t.nzViewContainerRef.injector;return Ee.create({parent:i||this.injector,providers:[{provide:ie,useValue:e},{provide:Ut,useValue:t.nzData}]})}confirmFactory(e={},t){let i={info:"info-circle",success:"check-circle",error:"close-circle",warning:"exclamation-circle"};return "nzIconType"in e||(e.nzIconType=i[t]),"nzCancelText"in e||(e.nzCancelText=null),this.confirm(e,t)}ngOnDestroy(){this.closeModals(this.openModalsAtThisLevel),this.afterAllClosedAtThisLevel.complete();}static \u0275fac=function(t){return new(t||n)};static \u0275prov=ie$1({token:n,factory:n.\u0275fac})}return n})();var Zn=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=YE({type:n});static \u0275inj=uu({providers:[Xt],imports:[we,Re,vt,Mt,yt]})}return n})();export{Ut as U,Xt as X,Zn as Z,ie as i};
|