@knoflows/engine 0.1.0-alpha.15 → 0.1.0-alpha.16

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.
Files changed (76) hide show
  1. package/README.md +5 -10
  2. package/dist/engine.js +41 -20
  3. package/package.json +4 -4
  4. package/static/assets/i18n/en.json +25 -1
  5. package/static/assets/i18n/es.json +25 -1
  6. package/static/chunk-9U0WIegY.js +1 -0
  7. package/static/{chunk-DxZsQqxS.js → chunk-B0kZCuEt.js} +1 -1
  8. package/static/chunk-B2Xol2Un.js +1 -0
  9. package/static/{chunk-CM8oLO7n.js → chunk-B7WkIFy0.js} +1 -1
  10. package/static/{chunk-C5n_oTWP.js → chunk-BW9BdLk-.js} +1 -1
  11. package/static/chunk-Bgl02GNl.js +1 -0
  12. package/static/chunk-BhF-m2HP.js +70 -0
  13. package/static/chunk-BhTujCrk.js +1 -0
  14. package/static/chunk-Bu6_39Nh.js +1 -0
  15. package/static/chunk-C0HCwfa5.js +1 -0
  16. package/static/{chunk-DMAf3Qir.js → chunk-C2BVYtVN.js} +7 -7
  17. package/static/{chunk-BuPc66MS.js → chunk-C7h8oMzu.js} +1 -1
  18. package/static/chunk-CRdEWPUM.js +1 -0
  19. package/static/chunk-CRv0PDB7.js +1 -0
  20. package/static/chunk-CecXf-CU.js +1 -0
  21. package/static/{chunk-B0V1VBvY.js → chunk-CenXuPs5.js} +1 -1
  22. package/static/{chunk-DgEO14wO.js → chunk-CeywzbyD.js} +1 -1
  23. package/static/{chunk-DphMF2VB.js → chunk-Cg2E0vnT.js} +1 -1
  24. package/static/chunk-CsQ_HDGC.js +1 -0
  25. package/static/chunk-D19C8Gcb.js +1 -0
  26. package/static/chunk-DGC4TkAL.js +1 -0
  27. package/static/chunk-DUkiyf7y.js +1 -0
  28. package/static/chunk-DYzSLsNo.js +1 -0
  29. package/static/chunk-DZJZYEZl.js +1 -0
  30. package/static/chunk-DfcFBVF4.js +1 -0
  31. package/static/chunk-DixyYfV_.js +1 -0
  32. package/static/chunk-Dp4H7MY0.js +1 -0
  33. package/static/chunk-DtQtDE8q.js +1 -0
  34. package/static/chunk-Dv5GyY6h.js +1 -0
  35. package/static/chunk-Edaw7VGW.js +1 -0
  36. package/static/{chunk-Cn95hfnf.js → chunk-FOJfn_t9.js} +1 -1
  37. package/static/{chunk-nx1xncBD.js → chunk-Fwpw-z7T.js} +1 -1
  38. package/static/chunk-HUIPNwd9.js +1 -0
  39. package/static/chunk-NZ-CPWJ2.js +1 -0
  40. package/static/{chunk-BnD2l9n3.js → chunk-Th9whP36.js} +1 -1
  41. package/static/chunk-bCuvpgQS.js +1 -0
  42. package/static/{chunk-C4Ee3umI.js → chunk-iE460Kz5.js} +1 -1
  43. package/static/chunk-p6dftaf8.js +5 -0
  44. package/static/chunk-yoe_30RI.js +1 -0
  45. package/static/{chunk-J9qS04nF.js → chunk-z2vvQAle.js} +1 -1
  46. package/static/index.html +1 -1
  47. package/static/main-CHQMTVIP.js +248 -0
  48. package/static/nz-theme-dark.css +1 -1
  49. package/static/nz-theme.css +1 -1
  50. package/static/chunk-1Oqdt_Gp.js +0 -1
  51. package/static/chunk-1eeePIP1.js +0 -1
  52. package/static/chunk-37yFTUcY.js +0 -1
  53. package/static/chunk-7MZQgksi.js +0 -1
  54. package/static/chunk-7VyHTRp_.js +0 -1
  55. package/static/chunk-BH5zvE8A.js +0 -1
  56. package/static/chunk-BZxs3wP7.js +0 -1
  57. package/static/chunk-B_L2A3hm.js +0 -1
  58. package/static/chunk-BbIC5sO2.js +0 -1
  59. package/static/chunk-BeWWb9rm.js +0 -1
  60. package/static/chunk-Bp8u1CCw.js +0 -1
  61. package/static/chunk-BpOumnMU.js +0 -1
  62. package/static/chunk-CF4gc4Im.js +0 -1
  63. package/static/chunk-CXGgR5M1.js +0 -1
  64. package/static/chunk-CiJRU6lo.js +0 -1
  65. package/static/chunk-Cq09TrKP.js +0 -1
  66. package/static/chunk-Cx2n09Ng.js +0 -1
  67. package/static/chunk-DFoFQkTa.js +0 -1
  68. package/static/chunk-DYARU-G0.js +0 -1
  69. package/static/chunk-DZhQ2iEt.js +0 -1
  70. package/static/chunk-D_DUAV49.js +0 -1
  71. package/static/chunk-GQe0l3Uh.js +0 -1
  72. package/static/chunk-dOUa0Vhs.js +0 -1
  73. package/static/chunk-q9oVn_qj.js +0 -5
  74. package/static/chunk-vYeIWxg4.js +0 -1
  75. package/static/chunk-yxqIQom4.js +0 -1
  76. package/static/main-2ZW45HAE.js +0 -248
@@ -1 +0,0 @@
1
- import {b}from'./chunk-CM8oLO7n.js';import {R as Rt}from'./chunk-Cx2n09Ng.js';import'./chunk-DMAf3Qir.js';import'./chunk-C4Ee3umI.js';import {L as Lt,u as ut,D as Di,m as mn}from'./chunk-yxqIQom4.js';import'./chunk-DphMF2VB.js';import {C,$,a as C1,V as Ve,b as at,q as qo,H as Hw,u as ue$1,s,r as r$1,c as bi,Q as QE,d as $8,e as al,f as rl,g as $i,v as v3,h as ex,F as Fm,A as Am,K as Kt,j as _i,k as vw,R as Rw,l as Kc,m as gh,o as oE,n as bD,p as lh,N as ND,S as SD,w as gI,P as Ph,O as Ow,x as ch,y as sE,z as nl,B as _D,D as xD,E as VD,G as ah,I as xw,L as LD,J as Pu,M as Lu}from'./main-2ZW45HAE.js';import'./chunk-D_DUAV49.js';var re=t=>["/jobs",t],oe=(t,a)=>a.id,ae=(t,a)=>a.jobId+a.stepExecutionId;function le(t,a){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function de(t,a){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.queuedError());}}function pe(t,a){t&1&&(_i(0,"p",7),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.queuedEmpty")," "));}function ue(t,a){if(t&1&&(_i(0,"tr")(1,"td")(2,"a",25),vw(3),Kc()(),_i(4,"td",26),vw(5),Kc(),_i(6,"td",27),vw(7),Kc()()),t&2){let e=a.$implicit,s=VD(2);ah("data-testid","queued-row-"+e.jobId),gI(2),ch("routerLink",xw(6,re,e.jobId)),ah("data-testid","queued-job-link-"+e.jobId),gI(),nl(" ",e.jobId," "),gI(2),Ph(e.agentInstanceId),gI(2),Ph(s.queuedWaitLabel(e.enqueuedAt));}}function ce(t,a){if(t&1&&(_i(0,"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,"tbody"),ND(13,ue,8,8,"tr",null,ae),Kc()()),t&2){let e=VD();gI(4),Ph(Ow(5,3,"jobs.table.column.id")),gI(3),Ph(Ow(8,5,"jobs.list.queuedAgent")),gI(3),Ph(Ow(11,7,"jobs.list.queuedWait")),gI(3),xD(e.queuedSteps());}}function he(t,a){if(t&1&&lh(0,"nz-option",14),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.name+" ("+e.id+")");}}function me(t,a){t&1&&(_i(0,"p",15),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ge(t,a){if(t&1&&(_i(0,"p",16),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.runningError());}}function fe(t,a){t&1&&(_i(0,"p",17),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.runningEmpty")," "));}function be(t,a){if(t&1&&lh(0,"app-job-status-table",18),t&2){let e=VD();ch("jobs",e.runningJobs());}}function _e(t,a){if(t&1&&(lh(0,"nz-option",14),Rw(1,"transloco"),Rw(2,"transloco")),t&2){let e=a.$implicit,s=VD();ch("nzValue",e)("nzLabel",e==="all"?Ow(1,2,"jobs.list.filterAll"):Ow(2,4,s.statusKey(e)));}}function ye(t,a){if(t&1&&lh(0,"nz-option",14),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.name+" ("+e.id+")");}}function Ce(t,a){t&1&&(_i(0,"p",22),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function xe(t,a){if(t&1&&(_i(0,"p",23),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.historyError());}}function Me(t,a){t&1&&(_i(0,"p",24),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.historyEmpty")," "));}function ve(t,a){if(t&1){let e=LD();_i(0,"nz-pagination",29),gh("nzPageIndexChange",function(o){Pu(e);let m=VD(2);return Lu(m.setHistoryPage(o))}),Kc();}if(t&2){let e=VD(2);ch("nzPageIndex",e.historyPageIndex())("nzPageSize",e.pageSize)("nzTotal",e.historyTotal());}}function Ie(t,a){if(t&1&&(lh(0,"app-job-status-table",18),bD(1,ve,1,3,"nz-pagination",28)),t&2){let e=VD();ch("jobs",e.historyJobs()),gI(),_D(e.historyTotal()>e.pageSize||e.historyPageIndex()>1?1:-1);}}var we=20,Se=50,Ee=3e3,se=["completed","failed","cancelled"],Qe=(()=>{class t{constructor(){this.jobsApi=C($),this.workflowsApi=C(b),this.route=C(C1),this.transloco=C(Ve),this.destroyRef=C(at),this.pageSize=we,this.historyStatusOptions=["all",...se],this.runningJobs=qo([]),this.queuedSteps=qo([]),this.historyJobs=qo([]),this.workflows=qo([]),this.runningLoading=qo(true),this.queuedLoading=qo(true),this.historyLoading=qo(true),this.runningError=qo(null),this.queuedError=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 e=(this.historyPageIndex()-1)*this.pageSize,s=this.historyJobs().length;return s<this.pageSize?e+s:e+s+1}),this.pollHandle=null,this.onVisibility=()=>{if(document.hidden){this.stopPolling();return}this.loadRunning({silent:true}),this.loadQueued({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$1(this.destroyRef)).subscribe(e=>{let s=e.get("status");s&&se.includes(s)?this.historyStatusFilter.set(s):this.historyStatusFilter.set("all"),this.historyPageIndex.set(1),this.loadRunning(),this.loadQueued(),this.loadHistory();}),document.addEventListener("visibilitychange",this.onVisibility),this.startPolling();}statusKey(e){return `jobs.status.${e}`}isPolling(){return this.polling()}setHistoryStatusFilter(e){this.historyStatusFilter.set(e),this.historyPageIndex.set(1),this.loadHistory();}setRunningWorkflowId(e){this.runningWorkflowId.set(e),this.loadRunning();}setHistoryWorkflowId(e){this.historyWorkflowId.set(e),this.historyPageIndex.set(1),this.loadHistory();}setShowChildJobs(e){this.showChildJobs.set(e),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}setHistoryPage(e){this.historyPageIndex.set(e),this.loadHistory();}loadWorkflows(){this.workflowsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>{this.workflows.set(e);},error:()=>{this.workflows.set([]);}});}loadRunning(e={}){let s$1=this.runningWorkflowId();e.silent||(this.runningLoading.set(true),this.runningError.set(null)),this.jobsApi.list(s(r$1({terminal:false,topLevelOnly:!this.showChildJobs()},s$1?{workflowId:s$1}:{}),{limit:Se,offset:0})).pipe(ue$1(this.destroyRef)).subscribe({next:o=>{this.runningJobs.set(o),this.runningLoading.set(false);},error:o=>{this.runningLoading.set(false),!e.silent&&this.runningError.set(this.errorMessage(o,this.transloco.translate("jobs.list.loadFailed")));}});}queuedWaitLabel(e){let s=Date.now()-Date.parse(e),o=Number.isFinite(s)?Math.max(0,Math.floor(s/1e3)):0;if(o<60)return `${o}s`;let m=Math.floor(o/60);return m<60?`${m}m`:`${Math.floor(m/60)}h`}loadQueued(e={}){e.silent||(this.queuedLoading.set(true),this.queuedError.set(null)),this.jobsApi.listQueued().pipe(ue$1(this.destroyRef)).subscribe({next:s=>{this.queuedSteps.set(s),this.queuedLoading.set(false);},error:s=>{this.queuedLoading.set(false),!e.silent&&this.queuedError.set(this.errorMessage(s,this.transloco.translate("jobs.list.loadFailed")));}});}loadHistory(e={}){let s$1=this.historyStatusFilter(),o=this.historyWorkflowId();e.silent||(this.historyLoading.set(true),this.historyError.set(null)),this.jobsApi.list(s(r$1(r$1({terminal:true,topLevelOnly:!this.showChildJobs()},s$1==="all"?{}:{status:s$1}),o?{workflowId:o}:{}),{limit:this.pageSize,offset:(this.historyPageIndex()-1)*this.pageSize})).pipe(ue$1(this.destroyRef)).subscribe({next:m=>{this.historyJobs.set(m),this.historyLoading.set(false);},error:m=>{this.historyLoading.set(false),!e.silent&&this.historyError.set(this.errorMessage(m,this.transloco.translate("jobs.list.loadFailed")));}});}startPolling(){this.pollHandle!=null||document.hidden||(this.pollHandle=setInterval(()=>{this.loadRunning({silent:true}),this.loadQueued({silent:true}),this.loadHistory({silent:true});},Ee),this.polling.set(true));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}errorMessage(e,s){return e instanceof bi||e instanceof Error?e.message:s}static{this.\u0275fac=function(s){return new(s||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-job-list"]],decls:62,vars:37,consts:[["data-testid","jobs-list",1,"list-page"],[1,"header"],["nz-checkbox","","data-testid","show-child-jobs",1,"child-toggle",3,"ngModelChange","ngModel"],["data-testid","jobs-queued",1,"section"],[1,"section-header"],["data-testid","queued-loading"],["data-testid","queued-error",1,"error"],["data-testid","queued-empty",1,"section-empty"],["data-testid","jobs-queued-table",1,"queued-table"],["data-testid","jobs-running",1,"section"],[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"],[3,"routerLink"],["data-testid","queued-agent"],["data-testid","queued-wait"],["data-testid","jobs-pagination",3,"nzPageIndex","nzPageSize","nzTotal"],["data-testid","jobs-pagination",3,"nzPageIndexChange","nzPageIndex","nzPageSize","nzTotal"]],template:function(s,o){s&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc()(),_i(5,"label",2),gh("ngModelChange",function(b){return o.setShowChildJobs(b)}),vw(6),Rw(7,"transloco"),Kc(),oE(),_i(8,"section",3)(9,"header",4)(10,"h2"),vw(11),Rw(12,"transloco"),Kc()(),bD(13,le,3,3,"p",5)(14,de,2,1,"p",6)(15,pe,3,3,"p",7)(16,ce,15,9,"table",8),Kc(),_i(17,"section",9)(18,"header",4)(19,"h2"),vw(20),Rw(21,"transloco"),Kc()(),_i(22,"div",10)(23,"div",11)(24,"span"),vw(25),Rw(26,"transloco"),Kc(),_i(27,"nz-select",12),gh("ngModelChange",function(b){return o.setRunningWorkflowId(b)}),lh(28,"nz-option",13),Rw(29,"transloco"),ND(30,he,1,2,"nz-option",14,oe),Kc(),oE(),Kc()(),bD(32,me,3,3,"p",15)(33,ge,2,1,"p",16)(34,fe,3,3,"p",17)(35,be,1,1,"app-job-status-table",18),Kc(),_i(36,"section",19)(37,"header",4)(38,"h2"),vw(39),Rw(40,"transloco"),Kc()(),_i(41,"div",10)(42,"div",11)(43,"span"),vw(44),Rw(45,"transloco"),Kc(),_i(46,"nz-select",20),gh("ngModelChange",function(b){return o.setHistoryStatusFilter(b)}),ND(47,_e,3,6,"nz-option",14,SD),Kc(),oE(),Kc(),_i(49,"div",11)(50,"span"),vw(51),Rw(52,"transloco"),Kc(),_i(53,"nz-select",21),gh("ngModelChange",function(b){return o.setHistoryWorkflowId(b)}),lh(54,"nz-option",13),Rw(55,"transloco"),ND(56,ye,1,2,"nz-option",14,oe),Kc(),oE(),Kc()(),bD(58,Ce,3,3,"p",22)(59,xe,2,1,"p",23)(60,Me,3,3,"p",24)(61,Ie,2,2),Kc()()),s&2&&(gI(3),Ph(Ow(4,17,"jobs.list.title")),gI(2),ch("ngModel",o.showChildJobs()),sE(),gI(),nl(" ",Ow(7,19,"jobs.list.showChildJobs")," "),gI(5),Ph(Ow(12,21,"jobs.list.queued")),gI(2),_D(o.queuedLoading()?13:o.queuedError()?14:o.queuedSteps().length===0?15:16),gI(7),Ph(Ow(21,23,"jobs.list.running")),gI(5),Ph(Ow(26,25,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",o.runningWorkflowId()),sE(),gI(),ch("nzLabel",Ow(29,27,"jobs.list.filterAll")),gI(2),xD(o.workflows()),gI(2),_D(o.runningLoading()?32:o.runningError()?33:o.runningJobs().length===0?34:35),gI(7),Ph(Ow(40,29,"jobs.list.history")),gI(5),Ph(Ow(45,31,"jobs.list.filterByStatus")),gI(2),ch("ngModel",o.historyStatusFilter()),sE(),gI(),xD(o.historyStatusOptions),gI(4),Ph(Ow(52,33,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",o.historyWorkflowId()),sE(),gI(),ch("nzLabel",Ow(55,35,"jobs.list.filterAll")),gI(2),xD(o.workflows()),gI(2),_D(o.historyLoading()?58:o.historyError()?59:o.historyJobs().length===0?60:61));},dependencies:[$8,al,rl,$i,v3,Lt,ut,Di,mn,ex,Fm,Am,Rt,Kt],styles:[".list-page[_ngcontent-%COMP%]{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}.queued-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse}.queued-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .queued-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{text-align:left;padding:.5rem .75rem .5rem 0;border-bottom:1px solid #e7e5e4}.queued-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e;font-weight:600}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{we as JOB_LIST_PAGE_SIZE,Se as JOB_RUNNING_LIMIT,Ee as JOB_RUNNING_POLL_MS,Qe as JobListComponent,se as TERMINAL_JOB_STATUSES};
@@ -1 +0,0 @@
1
- import {o as ot}from'./chunk-CXGgR5M1.js';import {a as ai,z}from'./chunk-B_L2A3hm.js';import {_ as _n,C as Cn}from'./chunk-37yFTUcY.js';import {f}from'./chunk-J9qS04nF.js';import {Q as QE,p as lh,C,V as Ve,b as at,q as qo,r as r$1,u as ue$1,c as bi,d as $8,e as al,ax as er,f as rl,g as $i,Z as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,k as vw,R as Rw,l as Kc,m as gh,n as bD,w as gI,P as Ph,O as Ow,z as nl,B as _D,E as VD,L as LD,o as oE,x as ch,y as sE,N as ND,D as xD,G as ah,J as Pu,M as Lu}from'./main-2ZW45HAE.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-yxqIQom4.js';import'./chunk-DphMF2VB.js';var ce=(i,h)=>h.id;function de(i,h){i&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function me(i,h){if(i&1&&(_i(0,"p",4),vw(1),Kc()),i&2){let e=VD();gI(),Ph(e.loadError());}}function fe(i,h){if(i&1&&(_i(0,"p",5),vw(1),Kc()),i&2){let e=VD(2);gI(),Ph(e.deleteError());}}function he(i,h){if(i&1&&(_i(0,"p",9),vw(1),Kc()),i&2){let e=VD(3);gI(),Ph(e.saveError());}}function ue(i,h){if(i&1){let e=LD();_i(0,"section",6),bD(1,he,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,"label",10)(21,"span"),vw(22),Rw(23,"transloco"),Kc(),_i(24,"input",14),gh("ngModelChange",function(l){Pu(e);let d=VD(2);return Lu(d.formDefaultBranch.set(l))}),Kc(),oE(),Kc(),_i(25,"div",15)(26,"button",16),gh("click",function(){Pu(e);let l=VD(2);return Lu(l.submitForm())}),vw(27),Rw(28,"transloco"),Kc(),_i(29,"button",17),gh("click",function(){Pu(e);let l=VD(2);return Lu(l.cancelForm())}),vw(30),Rw(31,"transloco"),Kc()()();}if(i&2){let e=VD(2);gI(),_D(e.saveError()?1:-1),gI(3),Ph(Ow(5,13,"local-repos.form.name")),gI(2),ch("ngModel",e.formName()),sE(),gI(3),Ph(Ow(10,15,"local-repos.form.localPath")),gI(2),ch("path",e.formLocalPath()),gI(3),Ph(Ow(15,17,"local-repos.form.worktreeBasePath")),gI(3),Ph(Ow(18,19,"local-repos.form.worktreeBaseHint")),gI(2),ch("path",e.formWorktreeBasePath()),gI(3),Ph(Ow(23,21,"local-repos.form.defaultBranch")),gI(2),ch("ngModel",e.formDefaultBranch()),sE(),gI(2),ch("disabled",e.saving()),gI(),nl(" ",Ow(28,23,"common.save")," "),gI(3),nl(" ",Ow(31,25,"common.cancel")," ");}}function _e(i,h){i&1&&(_i(0,"p",7),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"local-repos.emptyState")));}function Ce(i,h){if(i&1){let e=LD();_i(0,"tr")(1,"td"),vw(2),Kc(),_i(3,"td",18),vw(4),Kc(),_i(5,"td",18),vw(6),Kc(),_i(7,"td"),vw(8),Kc(),_i(9,"td",19)(10,"button",20),gh("click",function(){let l=Pu(e).$implicit,d=VD(3);return Lu(d.openEditForm(l))}),vw(11),Rw(12,"transloco"),Kc(),_i(13,"button",21),Rw(14,"transloco"),gh("nzOnConfirm",function(){let l=Pu(e).$implicit,d=VD(3);return Lu(d.deleteRepo(l))}),vw(15),Rw(16,"transloco"),Kc()()();}if(i&2){let e=h.$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),Ph(e.defaultBranch||"\u2014"),gI(2),ah("data-testid","edit-local-repo-"+e.id),gI(),nl(" ",Ow(12,10,"local-repos.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(14,12,"local-repos.deleteConfirm")),ah("data-testid","delete-local-repo-"+e.id),gI(2),nl(" ",Ow(16,14,"local-repos.delete")," ");}}function ge(i,h){if(i&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,"th"),vw(16),Rw(17,"transloco"),Kc()()(),_i(18,"tbody"),ND(19,Ce,17,16,"tr",null,ce),Kc()()),i&2){let e=VD(2);ch("nzData",e.repos())("nzShowPagination",false),gI(4),Ph(Ow(5,7,"local-repos.column.name")),gI(3),Ph(Ow(8,9,"local-repos.column.localPath")),gI(3),Ph(Ow(11,11,"local-repos.column.worktreeBasePath")),gI(3),Ph(Ow(14,13,"local-repos.column.defaultBranch")),gI(3),Ph(Ow(17,15,"local-repos.column.actions")),gI(3),xD(e.repos());}}function xe(i,h){if(i&1&&(bD(0,fe,2,1,"p",5),bD(1,ue,32,27,"section",6),bD(2,_e,3,3,"p",7)(3,ge,21,17,"nz-table",8)),i&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 i{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.formDefaultBranch=qo(""),this.reload();}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.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.formDefaultBranch.set(e.defaultBranch??""),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$1(r$1({name:this.formName().trim(),localPath:this.formLocalPath().trim()},this.formWorktreeBasePath().trim()?{worktreeBasePath:this.formWorktreeBasePath().trim()}:{worktreeBasePath:void 0}),this.formDefaultBranch().trim()?{defaultBranch:this.formDefaultBranch().trim()}:{defaultBranch:void 0}),a=this.editingId();(a?this.reposApi.update(a,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(""),this.formDefaultBranch.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(a=>a.filter(l=>l.id!==e.id));},error:a=>{this.deleteError.set(this.errorMessage(a,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,a){return e instanceof bi||e instanceof Error?e.message:a}static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=QE({type:i,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"],["nz-input","","data-testid","local-repo-default-branch",3,"ngModelChange","ngModel"],[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(a,l){a&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()),a&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:[$8,al,er,rl,$i,pf,bd,sp,fp,ai,z,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{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 i})();var qe=(()=>{class i{static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-local-repositories-manage"]],decls:1,vars:0,template:function(a,l){a&1&&lh(0,"app-local-repository-list");},dependencies:[ae],encapsulation:2});}}return i})();export{qe as LocalRepositoriesManageComponent};
@@ -1 +0,0 @@
1
- import {a as ai,z}from'./chunk-B_L2A3hm.js';import {C,aj as jn,V as Ve,bt as U0,a5 as $0,Q as QE,e as al,ax as er,f as rl,g as $i,Z as pf,a0 as bd,a1 as sp,a2 as fp,al as ts,j as _i,m as gh,l as Kc,o as oE,k as vw,w as gI,x as ch,y as sE,z as nl,b as at,an as Wn,q as qo,H as Hw,u as ue,r as r$1,c as bi,d as $8,K as Kt,R as Rw,N as ND,n as bD,O as Ow,D as xD,B as _D,ao as N2,ab as ix,bI as M1,ap as cx,i as ie,P as Ph,E as VD,G as ah,L as LD,a8 as Mh,a9 as Lh,J as Pu,M as Lu}from'./main-2ZW45HAE.js';var fe=(()=>{class t{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/filesystem`;}browse(e,i){let n=new M1;return e!=null&&e.trim()!==""&&(n=n.set("path",e.trim())),i?.mode&&(n=n.set("mode",i.mode)),i?.extensions&&i.extensions.length>0&&(n=n.set("extensions",i.extensions.join(","))),this.http.get(`${this.baseUrl}/browse`,{params:n}).pipe(cx())}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();function L(t){if(!t)return [];if(/^[A-Za-z]:/.test(t)){let r=t.includes("\\")?"\\":"/",h=`${t.slice(0,2)}${r}`,_=t.slice(2).replace(/^[\\/]+/,"").split(/[\\/]/).filter(Boolean),R=[{label:t.slice(0,2),path:h}],f=h;for(let O of _)f=f.endsWith(r)?f+O:f+r+O,R.push({label:O,path:f});return R}if(t.startsWith("/")){let r=t.split("/").filter(Boolean),h=[{label:"/",path:"/"}],z="";for(let _ of r)z+=`/${_}`,h.push({label:_,path:z});return h}let o=t.includes("\\")?"\\":"/",e=t.split(/[\\/]/).filter(Boolean),i=[],n="";for(let r of e)n=n?n+o+r:r,i.push({label:r,path:n});return i}function j(t){let o=L(t);return o.length<2?null:o[o.length-2].path}var be=(t,o)=>o.path;function xe(t,o){if(t&1){let e=LD();_i(0,"button",7),gh("click",function(){Pu(e);let n=VD().$implicit,r=VD();return Lu(r.loadDir(n.path))}),vw(1),Kc(),_i(2,"span",8),vw(3,"/"),Kc();}if(t&2){let e=VD().$implicit;ah("data-testid","file-browser-crumb-"+e.label),gI(),nl(" ",e.label," ");}}function we(t,o){if(t&1&&(_i(0,"span",6),vw(1),Kc()),t&2){let e=VD().$implicit;ah("data-testid","file-browser-crumb-"+e.label),gI(),Ph(e.label);}}function De(t,o){if(t&1&&bD(0,xe,4,2)(1,we,2,2,"span",6),t&2){let e=o.$index,i=o.$count;_D(e!==i-1?0:1);}}function ve(t,o){t&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ye(t,o){if(t&1&&(_i(0,"p",4),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.error());}}function Me(t,o){if(t&1){let e=LD();_i(0,"li")(1,"button",9),gh("click",function(){let n=Pu(e),r=VD(2);return Lu(r.loadDir(n))}),vw(2," ../ "),Kc()();}}function ke(t,o){if(t&1){let e=LD();_i(0,"li")(1,"button",10),gh("click",function(){let n=Pu(e).$implicit,r=VD(2);return Lu(r.onEntry(n))}),vw(2),Kc()();}if(t&2){let e=o.$implicit,i=VD(2);gI(),Mh("dir",e.isDirectory)("selected",i.isSelected(e)),ah("data-testid","file-browser-entry-"+e.name),gI(),Lh(" ",e.name,"",e.isDirectory?"/":""," ");}}function Fe(t,o){if(t&1&&(_i(0,"ul",5),bD(1,Me,3,0,"li"),ND(2,ke,3,7,"li",null,be),Kc()),t&2){let e,i=VD();gI(),_D((e=i.parentDir())?1:-1,e),gI(),xD(i.entries());}}var ge=(()=>{class t{constructor(){this.filesystem=C(fe),this.transloco=C(Ve),this.destroyRef=C(at),this.modalData=C(Wn,{optional:true}),this.path=U0(this.modalData?.path??""),this.mode=$0(this.modalData?.mode??"files"),this.extensions=$0(this.modalData?.extensions??[]),this.currentDir=qo(""),this.entries=qo([]),this.loading=qo(false),this.error=qo(null),this.crumbs=Hw(()=>L(this.currentDir())),this.parentDir=Hw(()=>j(this.currentDir()));}ngOnInit(){this.openAround(this.path());}isSelected(e){return this.mode()==="directories"?e.isDirectory&&e.path===this.path():!e.isDirectory&&e.path===this.path()}onEntry(e){if(e.isDirectory){this.loadDir(e.path);return}this.mode()==="files"&&this.path.set(e.path);}loadDir(e){this.loading.set(true),this.error.set(null),this.filesystem.browse(e,this.browseFilter()).pipe(ue(this.destroyRef)).subscribe({next:i=>this.applyListing(i),error:i=>{this.loading.set(false),this.error.set(this.errorMessage(i,this.transloco.translate("file-browser.loadFailed")));}});}browseFilter(){let e=this.extensions();return r$1({mode:this.mode()},e.length>0?{extensions:e}:{})}openAround(e){let i=e.trim();if(!i){this.loadDir(void 0);return}this.loading.set(true),this.error.set(null),this.filesystem.browse(i,this.browseFilter()).pipe(ue(this.destroyRef)).subscribe({next:n=>this.applyListing(n),error:()=>this.loadDir(j(i)??void 0)});}applyListing(e){this.currentDir.set(e.path),this.entries.set(e.entries),this.mode()==="directories"&&this.path.set(e.path),this.loading.set(false),this.error.set(null);}errorMessage(e,i){return e instanceof bi||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-file-browser"]],inputs:{path:[1,"path"],mode:[1,"mode"],extensions:[1,"extensions"]},outputs:{path:"pathChange"},decls:10,vars:4,consts:[["data-testid","file-browser",1,"file-browser"],["data-testid","file-browser-selected",1,"selected"],["data-testid","file-browser-breadcrumbs",1,"crumbs"],["data-testid","file-browser-loading"],["data-testid","file-browser-error",1,"error"],["data-testid","file-browser-entries",1,"entries"],[1,"current"],["nz-button","","nzType","link","type","button",3,"click"],["aria-hidden","true",1,"sep"],["type","button","data-testid","file-browser-up",1,"entry","dir",3,"click"],["type","button",1,"entry",3,"click"]],template:function(i,n){i&1&&(_i(0,"div",0)(1,"p",1),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nav",2),ND(5,De,2,1,null,null,be),Kc(),bD(7,ve,3,3,"p",3)(8,ye,2,1,"p",4)(9,Fe,4,1,"ul",5),Kc()),i&2&&(gI(2),nl(" ",n.path()||Ow(3,2,n.mode()==="directories"?"file-browser.emptySelectionDirectory":"file-browser.emptySelection")," "),gI(3),xD(n.crumbs()),gI(2),_D(n.loading()?7:n.error()?8:9));},dependencies:[$8,pf,bd,sp,Kt],styles:[".file-browser[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.45rem}.selected[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#44403c;overflow-wrap:anywhere;word-break:break-word}.crumbs[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.1rem;font-size:.85rem}.crumbs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding-inline:.15rem;height:auto}.sep[_ngcontent-%COMP%]{color:#a8a29e}.current[_ngcontent-%COMP%]{color:#1c1917;font-weight:600}.entries[_ngcontent-%COMP%]{list-style:none;margin:0;padding:.2rem 0;max-height:20rem;overflow:auto;border:1px solid #e7e5e4;background:#fff}.entry[_ngcontent-%COMP%]{display:block;width:100%;text-align:left;border:0;background:transparent;padding:.3rem .6rem;cursor:pointer;font:inherit;color:inherit}.entry[_ngcontent-%COMP%]:hover{background:#f5f5f4}.entry.dir[_ngcontent-%COMP%]{font-weight:600}.entry.selected[_ngcontent-%COMP%]{background:#e7e5e4}.error[_ngcontent-%COMP%]{margin:0;color:#9f1239}"]});}}return t})();var ot=(()=>{class t{constructor(){this.modal=C(jn),this.transloco=C(Ve),this.path=U0(""),this.mode=$0("files"),this.extensions=$0([]),this.placeholder=$0(void 0),this.browseLabel=$0(void 0);}placeholderText(){return this.placeholder()||this.transloco.translate(this.mode()==="directories"?"path-picker.placeholderDirectory":"path-picker.placeholderFile")}browseButtonText(){return this.browseLabel()||this.transloco.translate("path-picker.browse")}openBrowse(){let e=this.mode(),i=this.modal.create({nzTitle:this.transloco.translate(e==="directories"?"path-picker.modalTitleDirectory":"path-picker.modalTitleFile"),nzContent:ge,nzData:{path:this.path(),mode:e,extensions:this.extensions()},nzWidth:640,nzOkText:this.transloco.translate(e==="directories"?"file-browser.useFolder":"path-picker.selectFile"),nzCancelText:this.transloco.translate("common.cancel"),nzOnOk:()=>{let n=i.getContentComponent();this.path.set(n.path());}});}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-path-picker"]],inputs:{path:[1,"path"],mode:[1,"mode"],extensions:[1,"extensions"],placeholder:[1,"placeholder"],browseLabel:[1,"browseLabel"]},outputs:{path:"pathChange"},decls:4,vars:3,consts:[["data-testid","path-picker",1,"path-picker"],["nz-input","","data-testid","path-picker-input",3,"ngModelChange","placeholder","ngModel"],["nz-button","","type","button","data-testid","path-picker-browse",3,"click"]],template:function(i,n){i&1&&(_i(0,"div",0)(1,"input",1),gh("ngModelChange",function(h){return n.path.set(h)}),Kc(),oE(),_i(2,"button",2),gh("click",function(){return n.openBrowse()}),vw(3),Kc()()),i&2&&(gI(),ch("placeholder",n.placeholderText())("ngModel",n.path()),sE(),gI(2),nl(" ",n.browseButtonText()," "));},dependencies:[al,er,rl,$i,pf,bd,sp,fp,ai,z,ts],styles:[".path-picker[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.path-picker[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:0}"]});}}return t})();export{ot as o};
@@ -1 +0,0 @@
1
- import {U}from'./chunk-nx1xncBD.js';import {f}from'./chunk-DgEO14wO.js';import {R as Rt}from'./chunk-Cx2n09Ng.js';import {x}from'./chunk-D_DUAV49.js';import'./chunk-DMAf3Qir.js';import {W,I}from'./chunk-C4Ee3umI.js';import'./chunk-yxqIQom4.js';import'./chunk-DphMF2VB.js';import {C,a as C1,$,V as Ve,b as at$1,U as p,q as qo,u as ue,W as rd,X as Bw,c as bi,Q as QE,d as $8,Y as M5,v as v3,Z as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,n as bD,l as Kc,w as gI,B as _D,k as vw,R as Rw,P as Ph,O as Ow,E as VD,p as lh,x as ch,a7 as Pw,I as xw,L as LD,m as gh,z as nl,J as Pu,M as Lu}from'./main-2ZW45HAE.js';var Y=i=>({count:i});function Z(i,p){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function tt(i,p){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function et(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 it(i,p){if(i&1&&(_i(0,"p",12),vw(1),Kc()),i&2){let t=VD(2);gI(),Ph(t.actionError());}}function nt(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,et,3,4,"button",11),Kc(),bD(22,it,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,11,"batches.detail.backHint")),gI(3),Ph(t.id),gI(2),ch("ngClass",e.batchStatusTagClass(t.status,e.theme.theme())),gI(),Ph(Ow(10,13,e.statusKey(t.status))),gI(3),Ph(t.workflowId),gI(3),Ph(Pw(16,15,"batches.detail.subjectCount",xw(22,Y,t.resolvedSubjects.length))),gI(4),Ph(Ow(20,18,e.triggeredByKey(t.triggeredBy))),gI(2),_D(t.status==="running"?21:-1),gI(),_D(e.actionError()?22:-1),gI(3),Ph(Ow(26,20,"batches.detail.membersHeading")),gI(2),ch("jobs",e.memberJobs());}}var at=3e3;function v(i){return i!=="running"}var Bt=(()=>{class i{constructor(){this.route=C(C1),this.batchesApi=C(U),this.jobsApi=C($),this.eventsService=C(f),this.transloco=C(Ve),this.destroyRef=C(at$1),this.theme=C(p),this.batchStatusTagClass=x,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(),v(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(),v(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),v(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||v(t.status)){this.stopPolling();return}this.refreshMembers();},at));}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 bi||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",3,"ngClass"],["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,Z,3,3,"p",1)(2,tt,2,1,"p",2)(3,nt,28,24),Kc()),e&2){let _;gI(),_D(u.loading()?1:u.loadError()?2:(_=u.batch())?3:-1,_);}},dependencies:[$8,M5,v3,pf,bd,sp,fp,W,I,Rt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{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{Bt as BatchDetailComponent};
@@ -1 +0,0 @@
1
- import {o as ot}from'./chunk-CXGgR5M1.js';import {a as ai,z}from'./chunk-B_L2A3hm.js';import {_ as _n,C as Cn}from'./chunk-37yFTUcY.js';import {C,V as Ve$1,b as at,an as Wn,a5 as $0,H as Hw,q as qo,r as r$1,u as ue,c as bi,Q as QE,d as $8,e as al,ax as er,f as rl,g as $i,Z as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,n as bD,l as Kc,a8 as Mh,G as ah,w as gI,B as _D,ao as N2,ab as ix,ap as cx,i as ie,L as LD,k as vw,R as Rw,m as gh,P as Ph,O as Ow,z as nl,E as VD,o as oE,N as ND,S as SD,x as ch,y as sE,D as xD,aa as Nw,p as lh,J as Pu,M as Lu}from'./main-2ZW45HAE.js';import {W,I}from'./chunk-C4Ee3umI.js';import {L as Lt,u as ut,p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-yxqIQom4.js';var ze=(()=>{class t{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/context-files`;}list(){return this.http.get(this.baseUrl).pipe(cx())}get(e){return this.http.get(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(cx())}create(e){return this.http.post(this.baseUrl,e).pipe(cx())}update(e,n){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(e)}`,n).pipe(cx())}delete(e){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(e)}`).pipe(cx())}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();var Te=()=>[".md"],Ie=(t,f)=>f.id;function Fe(t,f){if(t&1){let e=LD();_i(0,"header",1)(1,"h1"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"button",4),gh("click",function(){Pu(e);let r=VD();return Lu(r.openCreateForm())}),vw(5),Rw(6,"transloco"),Kc()();}t&2&&(gI(2),Ph(Ow(3,2,"context-files.title")),gI(3),nl(" ",Ow(6,4,"context-files.create")," "));}function ye(t,f){t&1&&(_i(0,"p",2),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Ne(t,f){if(t&1&&(_i(0,"p",3),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function De(t,f){if(t&1&&(_i(0,"p",5),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.deleteError());}}function we(t,f){if(t&1&&(_i(0,"p",9),vw(1),Kc()),t&2){let e=VD(3);gI(),Ph(e.saveError());}}function ke(t,f){if(t&1&&(lh(0,"nz-option",13),Rw(1,"transloco")),t&2){let e=f.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.tierKey(e)));}}function Le(t,f){if(t&1){let e=LD();_i(0,"button",20),gh("click",function(){Pu(e);let r=VD(3);return Lu(r.cancelForm())}),vw(1),Rw(2,"transloco"),Kc();}t&2&&(gI(),nl(" ",Ow(2,1,"context-files.form.cancel")," "));}function Pe(t,f){if(t&1){let e=LD();_i(0,"section",6),bD(1,we,2,1,"p",9),_i(2,"label",10)(3,"span"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"input",11),gh("ngModelChange",function(r){Pu(e);let p=VD(2);return Lu(p.formName.set(r))}),Kc(),oE(),Kc(),_i(7,"div",10)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"nz-select",12),gh("ngModelChange",function(r){Pu(e);let p=VD(2);return Lu(p.formTier.set(r))}),ND(12,ke,2,4,"nz-option",13,SD),Kc(),oE(),Kc(),_i(14,"div",10)(15,"span"),vw(16),Rw(17,"transloco"),Kc(),_i(18,"app-path-picker",14),gh("pathChange",function(r){Pu(e);let p=VD(2);return Lu(p.formPath.set(r))}),Kc(),_i(19,"p",15),vw(20),Rw(21,"transloco"),Kc()(),_i(22,"label",10)(23,"span"),vw(24),Rw(25,"transloco"),Kc(),_i(26,"input",16),gh("ngModelChange",function(r){Pu(e);let p=VD(2);return Lu(p.formDescription.set(r))}),Kc(),oE(),Kc(),_i(27,"div",17)(28,"button",18),gh("click",function(){Pu(e);let r=VD(2);return Lu(r.submitForm())}),vw(29),Rw(30,"transloco"),Kc(),bD(31,Le,3,3,"button",19),Kc()();}if(t&2){let e=VD(2);gI(),_D(e.saveError()?1:-1),gI(3),Ph(Ow(5,14,"context-files.form.name")),gI(2),ch("ngModel",e.formName()),sE(),gI(3),Ph(Ow(10,16,"context-files.form.tier")),gI(2),ch("ngModel",e.formTier()),sE(),gI(),xD(e.tiers),gI(4),Ph(Ow(17,18,"context-files.form.path")),gI(2),ch("extensions",Nw(26,Te))("path",e.formPath()),gI(2),Ph(Ow(21,20,"context-files.form.pathHint")),gI(4),Ph(Ow(25,22,"context-files.form.description")),gI(2),ch("ngModel",e.formDescription()),sE(),gI(2),ch("nzLoading",e.saving()),gI(),nl(" ",Ow(30,24,e.editingId()?"context-files.form.save":"context-files.form.add")," "),gI(2),_D(e.inSelectionMode()?-1:31);}}function Ve(t,f){if(t&1){let e=LD();_i(0,"section",7)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"button",21),gh("click",function(){Pu(e);let r=VD(2);return Lu(r.openCreateForm())}),vw(5),Rw(6,"transloco"),Kc()();}t&2&&(gI(2),Ph(Ow(3,2,"context-files.emptyState")),gI(3),nl(" ",Ow(6,4,"context-files.create")," "));}function Be(t,f){t&1&&lh(0,"th");}function Oe(t,f){t&1&&(_i(0,"th"),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"context-files.column.actions")));}function $e(t,f){if(t&1){let e=LD();_i(0,"td")(1,"label",24),gh("nzCheckedChange",function(r){Pu(e);let p=VD().$implicit,T=VD(3);return Lu(T.toggleSelected(p.id,r))}),Kc()();}if(t&2){let e=VD().$implicit,n=VD(3);gI(),ch("nzChecked",n.isSelected(e.id)),ah("data-testid","select-"+e.id);}}function Ae(t,f){if(t&1){let e=LD();_i(0,"td",23)(1,"button",25),gh("click",function(){Pu(e);let r=VD().$implicit,p=VD(3);return Lu(p.openEditForm(r))}),vw(2),Rw(3,"transloco"),Kc(),_i(4,"button",26),Rw(5,"transloco"),Rw(6,"transloco"),Rw(7,"transloco"),gh("nzOnConfirm",function(){Pu(e);let r=VD().$implicit,p=VD(3);return Lu(p.deleteFile(r.id))}),vw(8),Rw(9,"transloco"),Kc()();}if(t&2){let e=VD().$implicit;gI(),ah("data-testid","edit-"+e.id),gI(),nl(" ",Ow(3,7,"context-files.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(5,9,"context-files.deleteConfirm"))("nzOkText",Ow(6,11,"context-files.delete"))("nzCancelText",Ow(7,13,"common.cancel")),ah("data-testid","delete-"+e.id),gI(4),nl(" ",Ow(9,15,"context-files.delete")," ");}}function Ue(t,f){if(t&1&&(_i(0,"tr"),bD(1,$e,2,2,"td"),_i(2,"td"),vw(3),Kc(),_i(4,"td")(5,"nz-tag"),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"td",22),vw(9),Kc(),_i(10,"td"),vw(11),Kc(),bD(12,Ae,10,17,"td",23),Kc()),t&2){let e=f.$implicit,n=VD(3);ah("data-testid","context-file-"+e.id),gI(),_D(n.inSelectionMode()?1:-1),gI(),ah("data-testid","name-"+e.id),gI(),Ph(e.name),gI(2),ah("data-testid","tier-"+e.id),gI(),Ph(Ow(7,11,n.tierKey(e.tier))),gI(2),ah("data-testid","path-"+e.id),gI(),Ph(e.path),gI(),ah("data-testid","description-"+e.id),gI(),Ph(e.description),gI(),_D(n.inSelectionMode()?-1:12);}}function Re(t,f){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr"),bD(3,Be,1,0,"th"),_i(4,"th"),vw(5),Rw(6,"transloco"),Kc(),_i(7,"th"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"th"),vw(11),Rw(12,"transloco"),Kc(),_i(13,"th"),vw(14),Rw(15,"transloco"),Kc(),bD(16,Oe,3,3,"th"),Kc()(),_i(17,"tbody"),ND(18,Ue,13,13,"tr",null,Ie),Kc()()),t&2){let e=VD(2);ch("nzData",e.files())("nzFrontPagination",false)("nzShowPagination",false),gI(3),_D(e.inSelectionMode()?3:-1),gI(2),Ph(Ow(6,9,"context-files.column.name")),gI(3),Ph(Ow(9,11,"context-files.column.tier")),gI(3),Ph(Ow(12,13,"context-files.column.path")),gI(3),Ph(Ow(15,15,"context-files.column.description")),gI(2),_D(e.inSelectionMode()?-1:16),gI(2),xD(e.files());}}function je(t,f){if(t&1&&(bD(0,De,2,1,"p",5),bD(1,Pe,32,27,"section",6),bD(2,Ve,7,6,"section",7)(3,Re,20,17,"nz-table",8)),t&2){let e=VD();_D(e.deleteError()?0:-1),gI(),_D(e.inSelectionMode()||e.formOpen()?1:-1),gI(),_D(e.files().length===0&&!e.inSelectionMode()&&!e.formOpen()?2:3);}}var Ke=["user","organization","project"],St=(()=>{class t{constructor(){this.filesApi=C(ze),this.transloco=C(Ve$1),this.destroyRef=C(at),this.modalData=C(Wn,{optional:true}),this.selectionModeInput=$0(false),this.inSelectionMode=Hw(()=>this.modalData?.selectionMode??this.selectionModeInput()),this.files=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.selectedIds=qo([...this.modalData?.selectedIds??[]]),this.formName=qo(""),this.formTier=qo("user"),this.formPath=qo(""),this.formDescription=qo(""),this.tiers=Ke,this.reload();}currentSelectedIds(){return this.selectedIds()}tierKey(e){return `context-files.tier.${e}`}isSelected(e){return this.selectedIds().includes(e)}toggleSelected(e,n){this.selectedIds.update(r=>n?r.includes(e)?r:[...r,e]:r.filter(p=>p!==e));}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formTier.set(e.tier),this.formPath.set(e.path),this.formDescription.set(e.description??""),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$1({name:this.formName().trim(),tier:this.formTier(),path:this.formPath().trim()},this.formDescription().trim()?{description:this.formDescription().trim()}:{description:void 0}),n=this.editingId();(n?this.filesApi.update(n,e):this.filesApi.create(e)).pipe(ue(this.destroyRef)).subscribe({next:p=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.files.update(T=>[...T.filter(N=>N.id!==p.id),p].sort((N,Ee)=>N.name.localeCompare(Ee.name))),this.inSelectionMode()&&!this.isSelected(p.id)&&this.selectedIds.update(T=>[...T,p.id]),this.formName.set(""),this.formTier.set("user"),this.formPath.set(""),this.formDescription.set("");},error:p=>{this.saving.set(false),this.saveError.set(this.errorMessage(p,this.transloco.translate("context-files.saveFailed")));}});}deleteFile(e){this.deleteError.set(null),this.filesApi.delete(e).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.files.update(n=>n.filter(r=>r.id!==e)),this.selectedIds.update(n=>n.filter(r=>r!==e));},error:n=>{this.deleteError.set(this.errorMessage(n,this.transloco.translate("context-files.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.filesApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>{this.files.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("context-files.loadFailed")));}});}errorMessage(e,n){return e instanceof bi||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-context-file-list"]],inputs:{selectionModeInput:[1,"selectionModeInput"]},decls:5,vars:5,consts:[[1,"context-file-list"],[1,"header"],["data-testid","loading"],["data-testid","load-error",1,"error"],["nz-button","","nzType","primary","type","button","data-testid","create-context-file",3,"click"],["data-testid","delete-error",1,"error"],["data-testid","context-file-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","context-file-items",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","context-file-name",3,"ngModelChange","ngModel"],["data-testid","context-file-tier",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["mode","files",3,"pathChange","extensions","path"],[1,"hint"],["nz-input","","data-testid","context-file-description",3,"ngModelChange","ngModel"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","context-file-submit",3,"click","nzLoading"],["nz-button","","type","button","data-testid","context-file-cancel"],["nz-button","","type","button","data-testid","context-file-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","empty-create",3,"click"],[1,"path-cell"],[1,"actions"],["nz-checkbox","",3,"nzCheckedChange","nzChecked"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(n,r){n&1&&(_i(0,"div",0),bD(1,Fe,7,6,"header",1),bD(2,ye,3,3,"p",2)(3,Ne,2,1,"p",3)(4,je,4,3),Kc()),n&2&&(Mh("list-page",!r.inSelectionMode()),ah("data-testid",r.inSelectionMode()?"context-file-picker":"context-files-manage"),gI(),_D(r.inSelectionMode()?-1:1),gI(),_D(r.loading()?2:r.loadError()?3:4));},dependencies:[$8,al,er,rl,$i,pf,bd,sp,fp,Lt,ut,ai,z,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{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})();export{St as S,ze as z};
@@ -1 +0,0 @@
1
- import {w,q,g,I}from'./chunk-D_DUAV49.js';import {W,I as I$1}from'./chunk-C4Ee3umI.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-yxqIQom4.js';import {C,$,T as J1,V as Ve,b as at,U as p,a5 as $0,q as qo,W as rd,X as Bw,ac as Ng,ad as Xi,ae as Dg,u as ue,c as bi,s,r as r$1,Q as QE,d as $8,Y as M5,v as v3,Z as pf,a0 as bd,a1 as sp,K as Kt,n as bD,B as _D,j as _i,k as vw,R as Rw,l as Kc,w as gI,P as Ph,O as Ow,E as VD,N as ND,x as ch,D as xD,G as ah,I as xw,z as nl,L as LD,m as gh,J as Pu,M as Lu}from'./main-2ZW45HAE.js';var pt=o=>["/jobs",o],bt=(o,u)=>u.id;function mt(o,u){o&1&&(_i(0,"p",0),vw(1),Rw(2,"transloco"),Kc()),o&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ut(o,u){if(o&1&&(_i(0,"p",1),vw(1),Kc()),o&2){let t=VD();gI(),Ph(t.loadError());}}function ht(o,u){if(o&1){let t=LD();_i(0,"button",8),gh("click",function(i){Pu(t);let d=VD().$implicit,g=VD(2);return Lu(g.retryJob(d,i))}),vw(1),Rw(2,"transloco"),Kc();}if(o&2){let t=VD().$implicit,e=VD(2);ch("disabled",e.retryingJobId()===t.id),ah("data-testid","job-retry-"+t.id),gI(),nl(" ",Ow(2,3,e.retryingJobId()===t.id?"jobs.detail.retrying":"jobs.table.retry")," ");}}function gt(o,u){if(o&1){let t=LD();_i(0,"button",9),gh("click",function(i){Pu(t);let d=VD().$implicit,g=VD(2);return Lu(g.cancelJob(d,i))}),vw(1),Rw(2,"transloco"),Kc();}if(o&2){let t=VD().$implicit,e=VD(2);ch("disabled",e.cancellingJobId()===t.id),ah("data-testid","job-cancel-"+t.id),gI(),nl(" ",Ow(2,3,e.cancellingJobId()===t.id?"jobs.detail.cancelling":"jobs.table.cancel")," ");}}function xt(o,u){if(o&1&&(_i(0,"tr")(1,"td")(2,"a",3),vw(3),Kc(),_i(4,"div",4),vw(5),Kc()(),_i(6,"td")(7,"nz-tag",5),vw(8),Rw(9,"transloco"),Kc()(),_i(10,"td")(11,"span"),vw(12),Kc()(),_i(13,"td")(14,"span"),vw(15),Kc()(),_i(16,"td")(17,"span"),vw(18),Kc()(),_i(19,"td"),bD(20,ht,3,5,"button",6),bD(21,gt,3,5,"button",7),Kc()()),o&2){let t=u.$implicit,e=VD(2);ah("data-testid","job-row-"+t.id),gI(2),ch("routerLink",xw(18,pt,t.id)),ah("data-testid","job-link-"+t.id),gI(),nl(" ",e.composeJobTitle(t)," "),gI(2),Ph(t.id),gI(2),ch("ngClass",e.jobStatusTagClass(t.status,e.theme.theme())),ah("data-testid","job-status-"+t.id),gI(),Ph(Ow(9,16,e.statusKey(t.status))),gI(3),ah("data-testid","job-subject-"+t.id),gI(),Ph(e.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"?20:-1),gI(),_D(e.isTerminalStatus(t.status)?-1:21);}}function ft(o,u){if(o&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,xt,22,20,"tr",null,bt),Kc()()),o&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 Rt=(()=>{class o{constructor(){this.jobsApi=C($),this.router=C(J1),this.transloco=C(Ve),this.destroyRef=C(at),this.theme=C(p),this.jobStatusTagClass=w,this.composeJobTitle=q,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(),e=this.jobIds();if(t!=null){Bw(()=>{this.loaded.set([]),this.loading.set(false),this.loadError.set(null),this.patched.set({});});return}if(e.length===0){Bw(()=>{this.loaded.set([]),this.loading.set(false);});return}Bw(()=>{this.loading.set(true),this.loadError.set(null),Ng(e.map(i=>this.jobsApi.get(i).pipe(Xi(()=>Dg(null))))).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.loaded.set(i.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(),e=t??this.loaded(),i=this.patched();return e.map(d=>i[d.id]??d)}isTerminalStatus(t){return g(t)}statusKey(t){return `jobs.status.${t}`}subjectText(t){return I(t.subjectContext)??"\u2014"}retryJob(t,e){e.preventDefault(),e.stopPropagation(),!(t.status!=="failed"||this.retryingJobId()===t.id)&&(this.retryingJobId.set(t.id),this.loadError.set(null),this.jobsApi.retry(t.id).subscribe({next:i=>{this.retryingJobId.set(null),this.router.navigate(["/jobs",i.id]);},error:i=>{this.retryingJobId.set(null),this.loadError.set(i instanceof bi||i instanceof Error?i.message:this.transloco.translate("jobs.errors.retryFailed"));}}));}cancelJob(t,e){e.preventDefault(),e.stopPropagation(),!(g(t.status)||this.cancellingJobId()===t.id)&&(this.cancellingJobId.set(t.id),this.loadError.set(null),this.jobsApi.cancel(t.id).subscribe({next:i=>{this.cancellingJobId.set(null),this.patched.update(d=>s(r$1({},d),{[i.id]:i})),this.loaded.update(d=>d.map(g=>g.id===i.id?i:g));},error:i=>{this.cancellingJobId.set(null),this.loadError.set(i instanceof bi||i instanceof Error?i.message:this.transloco.translate("jobs.errors.cancelFailed"));}}));}static{this.\u0275fac=function(e){return new(e||o)};}static{this.\u0275cmp=QE({type:o,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"],[1,"job-row-id","mono"],[3,"ngClass"],["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(e,i){e&1&&bD(0,mt,3,3,"p",0)(1,ut,2,1,"p",1)(2,ft,24,22,"nz-table",2),e&2&&_D(i.loading()&&i.jobs()==null?0:i.loadError()?1:2);},dependencies:[$8,M5,v3,pf,bd,sp,pc,as,dc,Kl,cc,Ji,ls,W,I$1,Kt],styles:["[_nghost-%COMP%]{display:block;min-width:0;max-width:100%}.error[_ngcontent-%COMP%]{color:#9f1239}.job-row-id[_ngcontent-%COMP%]{margin-top:.2rem;font-size:.75rem;color:var(--knoflows-text-secondary, #6b6558)}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return o})();export{Rt as R};
@@ -1 +0,0 @@
1
- import {g as d_,h as x_,y as y_,W as W$,f as __}from'./chunk-DMAf3Qir.js';import {C,ao as N2,ab as ix,ap as cx,i as ie,s,r as r$1}from'./main-2ZW45HAE.js';var $=(()=>{class e{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/providers`;}listQueryTemplates(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/query-templates`).pipe(cx())}listExtendedActions(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/actions`).pipe(cx())}resolveQueryTemplate(t,i,r){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/query-templates/${encodeURIComponent(i)}/resolve`,{params:r}).pipe(cx())}previewModels(t){return this.http.post(`${this.baseUrl}/preview-models`,t).pipe(cx())}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();var d=[{id:"jira",labelKey:"settings.typeOption.jira",kind:"subject",type:"jira",subjectType:"ticket"},{id:"bitbucket",labelKey:"settings.typeOption.bitbucket",kind:"subject",type:"bitbucket",subjectType:"pull_request"},{id:"github",labelKey:"settings.typeOption.github",kind:"subject",type:"github",subjectType:"ticket"},{id:"confluence",labelKey:"settings.typeOption.confluence",kind:"subject",type:"confluence",subjectType:"documentation"},{id:"manual-ticket",labelKey:"settings.typeOption.manualTicket",kind:"subject",type:"manual",subjectType:"ticket"},{id:"manual-documentation",labelKey:"settings.typeOption.manualDocumentation",kind:"subject",type:"manual",subjectType:"documentation"},{id:"claude",labelKey:"settings.typeOption.claude",kind:"agent",type:"claude"},{id:"cursor",labelKey:"settings.typeOption.cursor",kind:"agent",type:"cursor"}],R=["ticket","pull_request","documentation"];function b(e){return d.find(n=>n.id===e)??d[0]}function x(e){return d.find(t=>t.kind!==e.kind||t.type!==e.type?false:t.kind==="agent"?true:__(e)&&t.subjectType===e.subjectType)?.id??e.type}function F(e){let n=x(e);return b(n).labelKey}function T(e){return e==="jira"?[{key:"baseUrl",labelKey:"settings.jira.baseUrl"},{key:"email",labelKey:"settings.jira.email"}]:e==="bitbucket"?[{key:"email",labelKey:"settings.bitbucket.email"},{key:"workspace",labelKey:"settings.bitbucket.workspace"}]:e==="github"?[{key:"username",labelKey:"settings.github.username"}]:e==="confluence"?[{key:"baseUrl",labelKey:"settings.confluence.baseUrl"},{key:"email",labelKey:"settings.confluence.email"}]:[]}function P(){let e=d[0];return {originalId:null,id:"",idAutoSync:true,optionId:e.id,kind:e.kind,type:e.type,subjectType:e.subjectType??null,displayName:"",config:{},secretKey:x_("instance",e.kind),secretValue:"",expiresOn:"",defaultAgent:false,maxConcurrent:d_}}function _(e,n=false){let t={};for(let o of T(e.type)){let s=e.config[o.key];typeof s=="string"&&(t[o.key]=s);}if(y_(e)){let o=e.config.model;typeof o=="string"&&o.trim()&&(t.model=o.trim());}let i=x(e),r=b(i);return {originalId:e.id,id:e.id,idAutoSync:false,optionId:i,kind:r.kind,type:r.type,subjectType:r.subjectType??null,displayName:e.displayName,config:t,secretKey:e.secretKey,secretValue:"",expiresOn:e.expiresOn??"",defaultAgent:r.kind==="agent"?n:false,maxConcurrent:y_(e)?e.maxConcurrent??d_:d_}}function q(e,n){let t=b(n);return s(r$1({},e),{optionId:t.id,kind:t.kind,type:t.type,subjectType:t.subjectType??null,config:{},secretKey:x_(e.id||"instance",t.kind),defaultAgent:t.kind==="agent"?e.defaultAgent:false,maxConcurrent:t.kind==="agent"?e.maxConcurrent||d_:e.maxConcurrent})}function w(e,n,t){if(!e.idAutoSync)return s(r$1({},e),{displayName:n});let i=n.trim().length>0?W$(n,t):"";return s(r$1({},e),{displayName:n,id:i,secretKey:x_(i||"instance",e.kind)})}function D(e,n){return s(r$1({},e),{id:n,idAutoSync:false,secretKey:x_(n.trim()||"instance",e.kind)})}function M(e){let n={};for(let s of T(e.type)){let f=(e.config[s.key]??"").trim();f&&(n[s.key]=f);}let t=e.id.trim(),i=e.displayName.trim()||t,r=e.secretKey.trim()||x_(t,e.kind),o=e.expiresOn.trim()||void 0;if(e.kind==="agent"){let s=(e.config.model??"").trim();return s&&(n.model=s),r$1({id:t,kind:"agent",type:e.type,displayName:i,config:n,secretKey:r,maxConcurrent:Math.max(1,Math.floor(Number(e.maxConcurrent)||d_))},o?{expiresOn:o}:{})}return r$1({id:t,kind:"subject",type:e.type,subjectType:e.subjectType??"ticket",displayName:i,config:n,secretKey:r},o?{expiresOn:o}:{})}function V(e){return e.issues.map(n=>`${n.path.length>0?n.path.map(String).join("."):"(root)"}: ${n.message}`)}function K(e){return (e?.providerInstances??[]).filter(__)}function B(e,n){return K(e).filter(t=>__(t)&&n.includes(t.subjectType))}export{$,B,D,F,M,P,R,T,V,_,d,q,w};
@@ -1 +0,0 @@
1
- import {G as Gn,u as un}from'./chunk-vYeIWxg4.js';import {f}from'./chunk-DgEO14wO.js';import {R as Rt$1}from'./chunk-Cx2n09Ng.js';import {w,q,$ as $$1,g,I,h,_,C as C$1,O,k,E,H,T,b,v}from'./chunk-D_DUAV49.js';import {T as T_,i as iy,o as oy,E as E_}from'./chunk-DMAf3Qir.js';import {W,I as I$1}from'./chunk-C4Ee3umI.js';import'./chunk-yxqIQom4.js';import'./chunk-DphMF2VB.js';import {C,a as C1,T as J1,$,V as Ve$1,b as at$1,U as p,q as qo,H as Hw,u as ue,W as rd,X as Bw,c as bi,Q as QE,d as $8,Y as M5,v as v3,Z as pf,a0 as bd,a1 as sp,a2 as fp,a3 as Th,a4 as xh,K as Kt,j as _i,n as bD,l as Kc,w as gI,B as _D,a5 as $0,a6 as B0,s,r as r$1,k as vw,R as Rw,P as Ph,O as Ow,E as VD,L as LD,m as gh,p as lh,G as ah,x as ch,J as Pu,M as Lu,z as nl,a7 as Pw,I as xw,N as ND,D as xD,a8 as Mh,a9 as Lh,aa as Nw}from'./main-2ZW45HAE.js';var We=i=>({index:i}),Pe=()=>[],$e=(i,c)=>c.definition.id,Le=(i,c)=>c.index,oe=(i,c)=>c.id;function Qe(i,c){if(i&1){let e=LD();_i(0,"div",1)(1,"button",2),gh("click",function(){Pu(e);let n=VD();return Lu(n.closeIteration())}),vw(2),Rw(3,"transloco"),Kc(),_i(4,"p",3),vw(5),Rw(6,"transloco"),Kc(),_i(7,"app-job-step-workspace",4),gh("selectExecution",function(n){Pu(e);let d=VD();return Lu(d.onNestedSelect(n))})("resumeSubmit",function(n){Pu(e);let d=VD();return Lu(d.resumeSubmit.emit(n))})("extractResume",function(n){Pu(e);let d=VD();return Lu(d.extractResume.emit(n))})("retryStep",function(n){Pu(e);let d=VD();return Lu(d.retryStep.emit(n))}),Kc()();}if(i&2){let e=c,t=VD();gI(2),nl(" ",Ow(3,12,"jobs.detail.loopBack")," "),gI(3),nl(" ",Pw(6,14,"jobs.detail.loopIteration",xw(17,We,e.index+1))," "),gI(2),ch("definitions",t.nestedLoopDefinition().steps)("executions",e.stepExecutions)("job",t.job())("selectedExecutionId",t.nestedSelectedId())("currentExecutionId",t.currentExecutionId())("waitingEvent",t.waitingEvent())("resuming",t.resuming())("canResume",t.canResume())("canRetryStep",t.canRetryStep())("retryingStep",t.retryingStep());}}function Ke(i,c){if(i&1&&(_i(0,"nz-tag",13),vw(1),Rw(2,"transloco"),Kc()),i&2){let e=c,t=VD().$implicit,n=VD(2);ch("ngClass",n.stepStatusTagClass(e.status,n.theme.theme())),ah("data-testid","step-status-"+t.definition.id),gI(),Ph(Ow(2,3,n.stepStatusKey(e.status)));}}function He(i,c){if(i&1){let e=LD();_i(0,"li")(1,"button",9),gh("click",function(){let n=Pu(e).$implicit,d=VD(2);return Lu(d.onStepClick(n))}),_i(2,"span",10),vw(3),Kc(),_i(4,"span",11)(5,"span",12),vw(6),Rw(7,"transloco"),Kc(),bD(8,Ke,3,5,"nz-tag",13),Kc()()();}if(i&2){let e,t=c.$implicit,n=VD(2);gI(),Mh("selected",n.isSelected(t))("current",n.isCurrent(t))("unreached",!t.reached),ch("disabled",!t.reached),ah("data-testid","step-"+t.definition.id),gI(2),Ph(t.definition.name),gI(3),Ph(Ow(7,11,n.stepTypeKey(t.definition.type))),gI(2),_D((e=t.execution)?8:-1,e);}}function Ue(i,c){i&1&&(_i(0,"p",8),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.noStepSelected")," "));}function Ge(i,c){i&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"jobs.detail.inProgress.loop")));}function Xe(i,c){if(i&1){let e=LD();_i(0,"li")(1,"button",21),gh("click",function(){let n=Pu(e).$implicit,d=VD(4);return Lu(d.openIteration(d.selectedDefinition(),n))}),vw(2),Rw(3,"transloco"),Kc()();}if(i&2){let e=c.$implicit;gI(),ah("data-testid","loop-iteration-"+e.index),gI(),nl(" ",Pw(3,2,"jobs.detail.loopIteration",xw(5,We,e.index+1))," ");}}function Ye(i,c){i&1&&(_i(0,"li",12),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"jobs.detail.noIterations")));}function Ze(i,c){if(i&1&&(_i(0,"p",20),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function et(i,c){if(i&1&&(_i(0,"div",14)(1,"h3"),vw(2),Kc(),bD(3,Ge,3,3,"p",18),_i(4,"ul",19),ND(5,Xe,4,7,"li",null,Le,false,Ye,3,3,"li",12),Kc(),bD(8,Ze,2,1,"p",20),Kc()),i&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:-1),gI(2),xD(e.selectedExecution().iterations??Nw(4,Pe)),gI(3),_D(e.selectedExecution().error?8:-1);}}function tt(i,c){i&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.inProgress.sub_workflow")," "));}function it(i,c){if(i&1&&(_i(0,"p",20),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function nt(i,c){if(i&1&&(_i(0,"div",15)(1,"h3"),vw(2),Kc(),bD(3,tt,3,3,"p",18),lh(4,"app-job-status-table",22),bD(5,it,2,1,"p",20),Kc()),i&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:-1),gI(),ch("jobIds",e.selectedExecution().childJobIds??Nw(4,Pe)),gI(),_D(e.selectedExecution().error?5:-1);}}function ot(i,c){if(i&1&&(_i(0,"p",28),vw(1),Kc()),i&2){let e=VD(6);gI(),Ph(e.confirmationPrompt());}}function at(i,c){if(i&1){let e=LD();_i(0,"div",25),bD(1,ot,2,1,"p",28),_i(2,"label",29),vw(3),Rw(4,"transloco"),_i(5,"textarea",30),gh("input",function(n){Pu(e);let d=VD(5);return Lu(d.setConfirmationComment(n))}),Kc()(),_i(6,"div",31)(7,"button",32),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.submitConfirmation(true))}),vw(8),Rw(9,"transloco"),Kc(),_i(10,"button",33),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.submitConfirmation(false))}),vw(11),Rw(12,"transloco"),Kc()()();}if(i&2){let e=VD(5);gI(),_D(e.confirmationPrompt()?1:-1),gI(2),nl(" ",Ow(4,7,"jobs.resume.comment")," "),gI(2),ch("value",e.confirmationComment()),gI(2),ch("disabled",e.resuming()),gI(),nl(" ",Ow(9,9,e.resuming()?"jobs.resume.submitting":"jobs.resume.approve")," "),gI(2),ch("disabled",e.resuming()),gI(),nl(" ",Ow(12,11,e.resuming()?"jobs.resume.submitting":"jobs.resume.reject")," ");}}function rt(i,c){if(i&1){let e=LD();_i(0,"div",38)(1,"label",41)(2,"input",42),gh("change",function(n){let d=Pu(e).$implicit,C=VD(6);return Lu(C.setCommentReviewIncluded(d.id,n))}),Kc(),_i(3,"span"),vw(4),Rw(5,"transloco"),Kc()(),_i(6,"div",43)(7,"code",44),vw(8),Kc(),_i(9,"textarea",45),gh("input",function(n){let d=Pu(e).$implicit,C=VD(6);return Lu(C.setCommentReviewBody(d.id,n))}),Kc()()();}if(i&2){let e=c.$implicit;ah("data-testid","comment-review-row-"+e.id),gI(2),ch("checked",e.included),ah("data-testid","comment-review-include-"+e.id),gI(2),Ph(Ow(5,9,"jobs.resume.commentReview.include")),gI(3),ah("data-testid","comment-review-location-"+e.id),gI(),Lh("",e.file,":",e.line),gI(),ch("value",e.body),ah("data-testid","comment-review-body-"+e.id);}}function st(i,c){i&1&&(_i(0,"p",39),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.resume.commentReview.empty")," "));}function lt(i,c){if(i&1){let e=LD();_i(0,"div",26)(1,"div",34)(2,"button",35),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.setCommentReviewAllIncluded(true))}),vw(3),Rw(4,"transloco"),Kc(),_i(5,"button",36),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.setCommentReviewAllIncluded(false))}),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"div",37),ND(9,rt,10,11,"div",38,oe,false,st,3,3,"p",39),Kc(),_i(12,"button",40),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.submitCommentReview())}),vw(13),Rw(14,"transloco"),Kc()();}if(i&2){let e=VD(5);gI(2),ch("disabled",e.resuming()||e.commentReviewDrafts().length===0),gI(),nl(" ",Ow(4,7,"jobs.resume.commentReview.selectAll")," "),gI(2),ch("disabled",e.resuming()||e.commentReviewDrafts().length===0),gI(),nl(" ",Ow(7,9,"jobs.resume.commentReview.selectNone")," "),gI(3),xD(e.commentReviewDrafts()),gI(3),ch("disabled",e.resuming()),gI(),nl(" ",Ow(14,11,e.resuming()?"jobs.resume.submitting":"jobs.resume.button")," ");}}function ct(i,c){if(i&1){let e=LD();_i(0,"label",47)(1,"span"),vw(2),Kc(),_i(3,"textarea",45),gh("input",function(n){let d=Pu(e).$implicit,C=VD(6);return Lu(C.setQuestionnaireAnswer(d.id,n))}),Kc()();}if(i&2){let e=c.$implicit,t=VD(6);ah("data-testid","resume-question-"+e.id),gI(2),Ph(e.prompt),gI(),ch("value",t.questionnaireAnswers()[e.id]),ah("data-testid","resume-answer-"+e.id);}}function dt(i,c){i&1&&(_i(0,"p",12),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"jobs.resume.noQuestions")));}function pt(i,c){if(i&1){let e=LD();_i(0,"div",27)(1,"div",46),ND(2,ct,4,4,"label",47,oe,false,dt,3,3,"p",12),Kc(),_i(5,"label",29),vw(6),Rw(7,"transloco"),_i(8,"textarea",48),gh("input",function(n){Pu(e);let d=VD(5);return Lu(d.setAdditionalComments(n))}),Kc()(),_i(9,"button",40),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.submitQuestionnaire())}),vw(10),Rw(11,"transloco"),Kc()();}if(i&2){let e=VD(5);gI(2),xD(e.questionnaireItems()),gI(4),nl(" ",Ow(7,5,"jobs.resume.additionalComments")," "),gI(2),ch("value",e.additionalComments()),gI(),ch("disabled",e.resuming()||!e.questionnaireReady()),gI(),nl(" ",Ow(11,7,e.resuming()?"jobs.resume.submitting":"jobs.resume.button")," ");}}function ut(i,c){if(i&1&&(_i(0,"section",23)(1,"h4"),vw(2),Rw(3,"transloco"),Kc(),bD(4,at,13,13,"div",25)(5,lt,15,13,"div",26)(6,pt,12,9,"div",27),Kc()),i&2){let e=VD(4);gI(2),Ph(Ow(3,2,"jobs.resume.heading")),gI(2),_D(e.interactionKind()==="confirmation"?4:e.interactionKind()==="comment_review"?5:6);}}function mt(i,c){if(i&1&&(_i(0,"pre",24),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.formatOutput(e.selectedExecution()));}}function _t(i,c){if(i&1&&(_i(0,"div",16)(1,"h3"),vw(2),Kc(),bD(3,ut,7,4,"section",23)(4,mt,2,1,"pre",24),Kc()),i&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.showResume()?3:4);}}function xt(i,c){i&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.inProgress.extract")," "));}function Ct(i,c){i&1&&(_i(0,"p",12),vw(1),Rw(2,"transloco"),_i(3,"code",57),vw(4),Kc()()),i&2&&(gI(),nl(" ",Ow(2,2,"jobs.extract.pattern")," "),gI(3),Ph(c));}function bt(i,c){if(i&1){let e=LD();_i(0,"section",49)(1,"h4"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"p",12),vw(5),Rw(6,"transloco"),Kc(),_i(7,"pre",51),vw(8),Kc(),bD(9,Ct,5,4,"p",12),_i(10,"label"),vw(11),Rw(12,"transloco"),_i(13,"input",52),gh("input",function(n){Pu(e);let d=VD(4);return Lu(d.onExtractValueInput(n))}),Kc()(),_i(14,"div",53)(15,"button",54),gh("click",function(){Pu(e);let n=VD(4);return Lu(n.provideExtractValue())}),vw(16),Rw(17,"transloco"),Kc(),_i(18,"button",55),gh("click",function(){Pu(e);let n=VD(4);return Lu(n.continueExtract())}),vw(19),Rw(20,"transloco"),Kc(),_i(21,"button",56),gh("click",function(){Pu(e);let n=VD(4);return Lu(n.cancelExtract())}),vw(22),Rw(23,"transloco"),Kc()()();}if(i&2){let e,t=VD(4);gI(2),Ph(Ow(3,12,"jobs.extract.heading")),gI(3),Ph(Ow(6,14,"jobs.extract.sourceValue")),gI(3),Ph(t.extractSourceDisplay()),gI(),_D((e=t.extractPauseData()?.pattern)?9:-1,e),gI(2),nl(" ",Ow(12,16,"jobs.extract.valueLabel")," "),gI(2),ch("value",t.extractValue()),gI(2),ch("disabled",t.resuming()),gI(),nl(" ",Ow(17,18,"jobs.extract.provideValue")," "),gI(2),ch("disabled",t.resuming()),gI(),nl(" ",Ow(20,20,"jobs.extract.continue")," "),gI(2),ch("disabled",t.resuming()),gI(),nl(" ",Ow(23,22,"jobs.extract.cancel")," ");}}function ft(i,c){if(i&1&&(_i(0,"p",50),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function gt(i,c){if(i&1&&(_i(0,"pre",24),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.formatOutput(e.selectedExecution()));}}function vt(i,c){if(i&1&&(_i(0,"div",17)(1,"h3"),vw(2),Kc(),bD(3,xt,3,3,"p",18)(4,bt,24,24,"section",49)(5,ft,2,1,"p",50)(6,gt,2,1,"pre",24),Kc()),i&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:e.showExtractResume()?4:e.selectedExecution().error||e.selectedExecution().status==="failed"?5:6);}}function ht(i,c){i&1&&(_i(0,"p",58),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.waitingForAgentSlot")," "));}function wt(i,c){if(i&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),i&2){let e=VD(4);gI(),nl(" ",Ow(2,1,"jobs.detail.inProgress."+e.selectedExecution().type)," ");}}function yt(i,c){if(i&1&&(_i(0,"p",20),vw(1),Kc()),i&2){let e=VD().$implicit;ah("data-testid","review-and-retry-error-"+e.id),gI(),Ph(e.error);}}function St(i,c){if(i&1){let e=LD();_i(0,"div",38)(1,"label",41)(2,"input",42),gh("change",function(n){let d=Pu(e).$implicit,C=VD(6);return Lu(C.setReviewRetryIncluded(d.id,n))}),Kc(),_i(3,"span"),vw(4),Rw(5,"transloco"),Kc()(),_i(6,"div",43)(7,"code",44),vw(8),Kc(),bD(9,yt,2,2,"p",20),_i(10,"textarea",45),gh("input",function(n){let d=Pu(e).$implicit,C=VD(6);return Lu(C.setReviewRetryBody(d.id,n))}),Kc()()();}if(i&2){let e=c.$implicit;ah("data-testid","review-and-retry-row-"+e.id),gI(2),ch("checked",e.included),ah("data-testid","review-and-retry-include-"+e.id),gI(2),Ph(Ow(5,10,"jobs.resume.commentReview.include")),gI(3),ah("data-testid","review-and-retry-location-"+e.id),gI(),Lh("",e.file,":",e.line),gI(),_D(e.error?9:-1),gI(),ch("value",e.body),ah("data-testid","review-and-retry-body-"+e.id);}}function Et(i,c){if(i&1){let e=LD();_i(0,"section",59)(1,"p",61),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",34)(5,"button",62),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.setReviewRetryAllIncluded(true))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",63),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.setReviewRetryAllIncluded(false))}),vw(9),Rw(10,"transloco"),Kc()(),_i(11,"div",64),ND(12,St,11,12,"div",38,oe),Kc(),_i(14,"button",65),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.submitReviewAndRetry())}),vw(15),Rw(16,"transloco"),Kc()();}if(i&2){let e=VD(5);gI(2),nl(" ",Ow(3,7,"jobs.detail.reviewAndRetryHint")," "),gI(3),ch("disabled",e.retryingStep()||e.reviewRetryDrafts().length===0),gI(),nl(" ",Ow(7,9,"jobs.resume.commentReview.selectAll")," "),gI(2),ch("disabled",e.retryingStep()||e.reviewRetryDrafts().length===0),gI(),nl(" ",Ow(10,11,"jobs.resume.commentReview.selectNone")," "),gI(3),xD(e.reviewRetryDrafts()),gI(2),ch("disabled",e.retryingStep()),gI(),nl(" ",Ow(16,13,e.retryingStep()?"jobs.detail.retrying":"jobs.detail.reviewAndRetry")," ");}}function kt(i,c){if(i&1){let e=LD();_i(0,"button",66),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.retryStep.emit(void 0))}),vw(1),Rw(2,"transloco"),Kc();}if(i&2){let e=VD(5);ch("disabled",e.retryingStep()),gI(),nl(" ",Ow(2,2,e.retryingStep()?"jobs.detail.retrying":"jobs.detail.retryStep")," ");}}function It(i,c){if(i&1&&(_i(0,"p",50),vw(1),Kc(),bD(2,Et,17,15,"section",59)(3,kt,3,4,"button",60)),i&2){let e=VD(4);gI(),Ph(e.selectedExecution().error),gI(),_D(e.showReviewAndRetry()?2:e.showRetryStep()?3:-1);}}function jt(i,c){if(i&1&&(_i(0,"pre",24),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.formatOutput(e.selectedExecution()));}}function Dt(i,c){if(i&1&&(_i(0,"div")(1,"h3"),vw(2),Kc(),bD(3,ht,3,3,"p",58)(4,wt,3,3,"p",18)(5,It,4,2)(6,jt,2,1,"pre",24),Kc()),i&2){let e=VD(3);ah("data-testid",e.selectedExecution().type+"-view"),gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isQueued(e.selectedExecution())?3:e.isRunning(e.selectedExecution())?4:e.selectedExecution().error||e.selectedExecution().status==="failed"?5:6);}}function Tt(i,c){if(i&1&&bD(0,et,9,5,"div",14)(1,nt,6,5,"div",15)(2,_t,5,2,"div",16)(3,vt,7,2,"div",17)(4,Dt,7,3,"div"),i&2){let e,t=VD(2);_D((e=t.selectedExecution().type)==="loop"?0:e==="sub_workflow"?1:e==="interaction"?2:e==="extract"?3:4);}}function Rt(i,c){if(i&1&&(_i(0,"aside",5)(1,"h3"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul",6),ND(5,He,9,13,"li",null,$e),Kc()(),_i(7,"section",7),bD(8,Ue,3,3,"p",8)(9,Tt,5,1),Kc()),i&2){let e=VD();gI(2),Ph(Ow(3,2,"jobs.detail.stepsHeading")),gI(3),xD(e.rows()),gI(3),_D(e.selectedExecution()?9:8);}}var Ne=(()=>{class i{constructor(){this.theme=C(p),this.stepStatusTagClass=h,this.definitions=$0.required(),this.executions=$0.required(),this.job=$0.required(),this.selectedExecutionId=$0(null),this.currentExecutionId=$0(null),this.waitingEvent=$0(null),this.resuming=$0(false),this.canResume=$0(false),this.canRetryStep=$0(false),this.retryingStep=$0(false),this.selectExecution=B0(),this.resumeSubmit=B0(),this.extractResume=B0(),this.retryStep=B0(),this.nestedIteration=qo(null),this.nestedLoopDefinition=qo(null),this.nestedSelectedId=qo(null),this.extractValue=qo(""),this.questionnaireAnswers=qo({}),this.additionalComments=qo(""),this.confirmationComment=qo(""),this.commentReviewDrafts=qo([]),this.reviewRetryDrafts=qo([]),this.rows=Hw(()=>_(this.definitions(),this.executions())),this.selectedExecution=Hw(()=>{let e=this.selectedExecutionId();return e?this.executions().find(t=>t.id===e)??null:null}),this.selectedDefinition=Hw(()=>{let e=this.selectedExecution();return e?this.definitions().find(t=>t.id===e.stepDefinitionId)??null:null}),this.interactionKind=Hw(()=>{let e=this.selectedDefinition();return e?.type==="interaction"?e.interaction:null}),this.interactionData=Hw(()=>{let e=this.selectedDefinition();return C$1({waitingEvent:this.waitingEvent(),priorOutput:e?O(this.definitions(),this.executions(),e.id,this.job()):void 0,selectedOutput:this.selectedExecution()?.output})}),this.waitingPrompts=Hw(()=>{let e=this.selectedDefinition();return e?.type!=="interaction"?[]:k({interaction:e.interaction,waitingEvent:this.waitingEvent(),priorOutput:O(this.definitions(),this.executions(),e.id,this.job()),selectedOutput:this.selectedExecution()?.output})}),this.questionnaireItems=Hw(()=>E(this.interactionData())),this.questionnaireReady=Hw(()=>H(this.questionnaireItems(),this.questionnaireAnswers())),this.confirmationPrompt=Hw(()=>this.waitingPrompts()[0]??""),this.commentReviewItems=Hw(()=>T_(this.interactionData())??[]),this.showResume=Hw(()=>{if(!this.canResume())return false;let e=this.selectedExecution(),t=this.currentExecutionId();return e!=null&&e.id===t&&e.type==="interaction"&&this.job().status==="waiting_for_human"}),this.showExtractResume=Hw(()=>{if(!this.canResume())return false;let e=this.selectedExecution(),t=this.currentExecutionId();return e!=null&&e.id===t&&e.type==="extract"&&this.job().status==="waiting_for_human"}),this.extractPauseData=Hw(()=>{let e=this.waitingEvent();if(e&&Ve(e.data))return e.data;let t=this.selectedExecution()?.output;return Ve(t)?t:null}),this.showRetryStep=Hw(()=>{if(!this.canRetryStep())return false;let e=this.selectedExecution();return !e||e.status!=="failed"||e.id!==this.currentExecutionId()||iy(this.selectedDefinition(),e)?false:T(e.type)}),this.showReviewAndRetry=Hw(()=>{if(!this.canRetryStep())return false;let e=this.selectedExecution();return !e||e.status!=="failed"||e.id!==this.currentExecutionId()?false:iy(this.selectedDefinition(),e)}),rd(()=>{let e=this.questionnaireItems(),t=e.map(n=>n.id).slice().sort().join("\0");Bw(()=>{let n=this.questionnaireAnswers();if(Object.keys(n).slice().sort().join("\0")===t)return;let C={};for(let S of e)C[S.id]=n[S.id]??"";this.questionnaireAnswers.set(C),this.additionalComments.set(""),this.confirmationComment.set("");});}),rd(()=>{let e=this.commentReviewItems(),t=e.map(n=>n.id).slice().sort().join("\0");Bw(()=>{let n=this.commentReviewDrafts();if(n.map(S=>S.id).slice().sort().join("\0")===t)return;let C=new Map(n.map(S=>[S.id,S]));this.commentReviewDrafts.set(e.map(S=>{let N=C.get(S.id);return s(r$1({},S),{body:N?.body??S.body,included:N?.included??true})}));});}),rd(()=>{let e=oy(this.selectedDefinition(),this.selectedExecution()),t=e.map(n=>n.id).slice().sort().join("\0");Bw(()=>{let n=this.reviewRetryDrafts();if(n.map(S=>S.id).slice().sort().join("\0")===t)return;let C=new Map(n.map(S=>[S.id,S]));this.reviewRetryDrafts.set(e.map(S=>{let N=C.get(S.id);return s(r$1({},S),{body:N?.body??S.body,included:N?.included??S.included})}));});});}stepStatusKey(e){return `jobs.stepStatus.${e}`}stepTypeKey(e){return `step-list.stepType.${e}`}onStepClick(e){!e.reached||!e.execution||(this.nestedIteration.set(null),this.nestedLoopDefinition.set(null),this.selectExecution.emit(e.execution.id));}openIteration(e,t){this.nestedLoopDefinition.set(e),this.nestedIteration.set(t);let n=t.stepExecutions.find(C=>C.id===this.currentExecutionId()),d=t.stepExecutions[0];this.nestedSelectedId.set(n?.id??d?.id??null);}closeIteration(){this.nestedIteration.set(null),this.nestedLoopDefinition.set(null),this.nestedSelectedId.set(null);}onNestedSelect(e){this.nestedSelectedId.set(e);}setQuestionnaireAnswer(e,t){let n=t.target.value;this.questionnaireAnswers.update(d=>s(r$1({},d),{[e]:n}));}setAdditionalComments(e){this.additionalComments.set(e.target.value);}setConfirmationComment(e){this.confirmationComment.set(e.target.value);}submitQuestionnaire(){!this.questionnaireReady()||this.resuming()||this.resumeSubmit.emit(b(this.questionnaireItems(),this.questionnaireAnswers(),this.additionalComments()));}submitConfirmation(e){this.resuming()||this.resumeSubmit.emit(v(e,this.confirmationComment()));}setCommentReviewIncluded(e,t){let n=t.target.checked;this.commentReviewDrafts.update(d=>d.map(C=>C.id===e?s(r$1({},C),{included:n}):C));}setCommentReviewBody(e,t){let n=t.target.value;this.commentReviewDrafts.update(d=>d.map(C=>C.id===e?s(r$1({},C),{body:n}):C));}setCommentReviewAllIncluded(e){this.commentReviewDrafts.update(t=>t.map(n=>s(r$1({},n),{included:e})));}submitCommentReview(){this.resuming()||this.resumeSubmit.emit(E_(this.commentReviewDrafts()));}setReviewRetryIncluded(e,t){let n=t.target.checked;this.reviewRetryDrafts.update(d=>d.map(C=>C.id===e?s(r$1({},C),{included:n}):C));}setReviewRetryBody(e,t){let n=t.target.value;this.reviewRetryDrafts.update(d=>d.map(C=>C.id===e?s(r$1({},C),{body:n}):C));}setReviewRetryAllIncluded(e){this.reviewRetryDrafts.update(t=>t.map(n=>s(r$1({},n),{included:e})));}submitReviewAndRetry(){if(this.retryingStep())return;let e=this.reviewRetryDrafts().filter(t=>t.included).map(({file:t,line:n,body:d})=>({file:t,line:n,body:d}));this.retryStep.emit({comments:e});}onExtractValueInput(e){this.extractValue.set(e.target.value);}extractSourceDisplay(){let e=this.extractPauseData();return e?Mt(e.sourceValue):""}provideExtractValue(){this.extractResume.emit({action:"provide_value",value:this.extractValue()});}continueExtract(){this.extractResume.emit({action:"continue"});}cancelExtract(){this.extractResume.emit({action:"cancel"});}formatOutput(e){return e.error?e.error:e.output===void 0?"":typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2)}isRunning(e){return e?.status==="running"}isQueued(e){return e?.status==="queued"}isSelected(e){return e.execution!=null&&e.execution.id===this.selectedExecutionId()}isCurrent(e){return e.execution!=null&&e.execution.id===this.currentExecutionId()}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-job-step-workspace"]],inputs:{definitions:[1,"definitions"],executions:[1,"executions"],job:[1,"job"],selectedExecutionId:[1,"selectedExecutionId"],currentExecutionId:[1,"currentExecutionId"],waitingEvent:[1,"waitingEvent"],resuming:[1,"resuming"],canResume:[1,"canResume"],canRetryStep:[1,"canRetryStep"],retryingStep:[1,"retryingStep"]},outputs:{selectExecution:"selectExecution",resumeSubmit:"resumeSubmit",extractResume:"extractResume",retryStep:"retryStep"},decls:3,vars:1,consts:[["data-testid","job-step-workspace",1,"workspace"],["data-testid","loop-drill-in",1,"nested"],["nz-button","","nzType","link","type","button","data-testid","loop-back",3,"click"],[1,"nested-label"],[3,"selectExecution","resumeSubmit","extractResume","retryStep","definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","resuming","canResume","canRetryStep","retryingStep"],["data-testid","step-side-panel",1,"side-panel"],[1,"step-list"],["data-testid","step-main-area",1,"main-area"],["data-testid","no-step-selected",1,"muted"],["type","button",1,"step-button",3,"click","disabled"],[1,"step-name"],[1,"step-meta"],[1,"muted"],[3,"ngClass"],["data-testid","loop-view"],["data-testid","sub-workflow-view"],["data-testid","interaction-view"],["data-testid","extract-view"],["data-testid","step-in-progress"],["data-testid","loop-iterations",1,"iteration-list"],[1,"error"],["nz-button","","nzType","link","type","button",3,"click"],[3,"jobIds"],["data-testid","resume-form",1,"resume"],["data-testid","step-output"],["data-testid","confirmation-resume"],["data-testid","comment-review-resume"],["data-testid","questionnaire-resume"],["data-testid","confirmation-prompt"],[1,"resume-field"],["data-testid","confirmation-comment","rows","2",3,"input","value"],[1,"confirmation-actions"],["nz-button","","nzType","primary","type","button","data-testid","confirmation-approve",3,"click","disabled"],["nz-button","","nzDanger","","type","button","data-testid","confirmation-reject",3,"click","disabled"],[1,"comment-review-toolbar"],["nz-button","","type","button","data-testid","comment-review-select-all",3,"click","disabled"],["nz-button","","type","button","data-testid","comment-review-select-none",3,"click","disabled"],["data-testid","comment-review-suggestions"],[1,"comment-review-row"],["data-testid","comment-review-empty",1,"muted"],["nz-button","","nzType","primary","type","button","data-testid","resume-button",3,"click","disabled"],[1,"comment-review-include"],["type","checkbox",3,"change","checked"],[1,"comment-review-fields"],[1,"comment-review-location"],["rows","2",3,"input","value"],["data-testid","waiting-questions"],[1,"resume-question"],["data-testid","resume-additional-comments","rows","2",3,"input","value"],["data-testid","extract-resume-form",1,"resume"],["data-testid","step-error",1,"error"],["data-testid","extract-source-value"],["data-testid","extract-value",3,"input","value"],[1,"extract-actions"],["nz-button","","nzType","primary","type","button","data-testid","extract-provide",3,"click","disabled"],["nz-button","","type","button","data-testid","extract-continue",3,"click","disabled"],["nz-button","","nzDanger","","type","button","data-testid","extract-cancel",3,"click","disabled"],["data-testid","extract-pattern"],["data-testid","step-queued"],["data-testid","review-and-retry",1,"resume"],["nz-button","","nzType","primary","type","button","data-testid","retry-step",3,"disabled"],["data-testid","review-and-retry-hint",1,"muted"],["nz-button","","type","button","data-testid","review-and-retry-select-all",3,"click","disabled"],["nz-button","","type","button","data-testid","review-and-retry-select-none",3,"click","disabled"],["data-testid","review-and-retry-comments"],["nz-button","","nzType","primary","type","button","data-testid","review-and-retry-submit",3,"click","disabled"],["nz-button","","nzType","primary","type","button","data-testid","retry-step",3,"click","disabled"]],template:function(t,n){if(t&1&&(_i(0,"div",0),bD(1,Qe,8,19,"div",1)(2,Rt,10,4),Kc()),t&2){let d;gI(),_D((d=n.nestedIteration())?1:2,d);}},dependencies:[i,$8,M5,pf,bd,sp,fp,W,I$1,Rt$1,Kt],styles:["[_nghost-%COMP%]{display:block;min-width:0;max-width:100%}.workspace[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(14rem,18rem) minmax(0,1fr);gap:1rem;align-items:start;min-height:20rem;min-width:0;max-width:100%}.nested[_ngcontent-%COMP%]{grid-column:1 / -1;min-width:0}.nested-label[_ngcontent-%COMP%]{margin:0 0 .75rem;color:#57534e}.side-panel[_ngcontent-%COMP%]{min-width:0;border:1px solid #d6d3d1;background:#ffffffbf;padding:.75rem}.side-panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem}.step-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.35rem}.step-button[_ngcontent-%COMP%]{width:100%;text-align:left;font:inherit;padding:.45rem .55rem;border:1px solid transparent;background:transparent;cursor:pointer;display:flex;flex-direction:column;gap:.2rem}.step-button[_ngcontent-%COMP%]:hover:not(:disabled){background:#f5f5f4}.step-button.selected[_ngcontent-%COMP%]{border-color:#a8a29e;background:#fafaf9}.step-button.current[_ngcontent-%COMP%]{box-shadow:inset 3px 0 #0c0a09}.step-button[_ngcontent-%COMP%]:disabled, .step-button.unreached[_ngcontent-%COMP%]{opacity:.55;cursor:not-allowed}.step-name[_ngcontent-%COMP%]{font-weight:600;overflow-wrap:anywhere}.step-meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center;font-size:.8rem}.main-area[_ngcontent-%COMP%]{min-width:0;overflow-x:auto;overflow-wrap:anywhere;word-break:break-word;border:1px solid #d6d3d1;background:#ffffffd9;padding:1rem;min-height:16rem}.main-area[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-top:0}.muted[_ngcontent-%COMP%]{color:#78716c}.error[_ngcontent-%COMP%]{color:#9f1239}[data-testid=retry-step][_ngcontent-%COMP%], [data-testid=review-and-retry][_ngcontent-%COMP%]{margin-top:.5rem}pre[_ngcontent-%COMP%]{max-width:100%;overflow:auto;padding:.75rem;background:#f5f5f4;border:1px solid #d6d3d1;font-size:.85rem}.iteration-list[_ngcontent-%COMP%]{padding-left:1.1rem}.resume-question[_ngcontent-%COMP%], .resume-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:0 0 .75rem}.resume-question[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-weight:500}.resume[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .resume[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{box-sizing:border-box;width:100%;max-width:100%;font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e}.resume[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:vertical}.confirmation-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.comment-review-toolbar[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;margin:0 0 .75rem}.comment-review-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.5rem .75rem;align-items:start;margin:0 0 .75rem}.comment-review-include[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.35rem;padding-top:.25rem;font-size:.85rem}.comment-review-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:0}.comment-review-location[_ngcontent-%COMP%]{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8rem}.extract-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}@media(max-width:48rem){.workspace[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1fr)}}"]});}}return i})();function Ve(i){return i!=null&&typeof i=="object"&&!Array.isArray(i)&&"sourceValue"in i}function Mt(i){return i==null?"":typeof i=="string"?i:JSON.stringify(i,null,2)}function Jt(i,c){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Vt(i,c){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let e=VD();gI(),Ph(e.loadError());}}function Wt(i,c){if(i&1&&(vw(0),Rw(1,"transloco")),i&2){let e=VD(2);Lh(" ",Ow(1,2,"jobs.detail.worktreeDeleted")," ",e.worktreeDeletedAt," ");}}function Pt(i,c){if(i&1&&vw(0),i&2){let e=VD(3);nl(" (",e.branch,") ");}}function Nt(i,c){if(i&1&&(vw(0),Rw(1,"transloco"),bD(2,Pt,1,1)),i&2){let e=VD(2);Lh(" ",Ow(1,3,"jobs.detail.worktree")," ",e.worktreePath," "),gI(2),_D(e.branch?2:-1);}}function zt(i,c){if(i&1&&(_i(0,"p",14),bD(1,Wt,2,4)(2,Nt,3,5),Kc()),i&2){let e=VD();gI(),_D(e.worktreeDeletedAt?1:2);}}function Ot(i,c){if(i&1){let e=LD();_i(0,"button",23),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.cancelJob())}),vw(1),Rw(2,"transloco"),Kc();}if(i&2){let e=VD(2);ch("disabled",e.cancelling()),gI(),nl(" ",Ow(2,2,e.cancelling()?"jobs.detail.cancelling":"jobs.detail.cancel")," ");}}function Bt(i,c){if(i&1){let e=LD();_i(0,"button",24),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.retryWorkflow())}),vw(1),Rw(2,"transloco"),Kc();}if(i&2){let e=VD(2);ch("disabled",e.retryingWorkflow()),gI(),nl(" ",Ow(2,2,e.retryingWorkflow()?"jobs.detail.retrying":"jobs.detail.retryWorkflow")," ");}}function At(i,c){if(i&1){let e=LD();_i(0,"button",25),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.jumpToCurrent())}),vw(1),Rw(2,"transloco"),Kc();}i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.jumpToCurrent")," "));}function Ft(i,c){if(i&1&&(_i(0,"p",19),vw(1),Kc()),i&2){let e=VD(2);gI(),Ph(e.actionError());}}function qt(i,c){i&1&&(lh(0,"nz-alert",20),Rw(1,"transloco")),i&2&&ch("nzMessage",Ow(1,1,"jobs.detail.queued"));}function $t(i,c){if(i&1){let e=LD();_i(0,"app-job-step-workspace",26),gh("selectExecution",function(n){Pu(e);let d=VD(2);return Lu(d.onSelectExecution(n))})("resumeSubmit",function(n){Pu(e);let d=VD(2);return Lu(d.submitResume(n))})("extractResume",function(n){Pu(e);let d=VD(2);return Lu(d.submitExtractResume(n))})("retryStep",function(n){Pu(e);let d=VD(2);return Lu(d.retryThisStep(n))}),Kc();}if(i&2){let e=VD(),t=VD();ch("definitions",c.steps)("executions",e.stepHistory)("job",e)("selectedExecutionId",t.viewedExecutionId())("currentExecutionId",t.blockingExecutionId()??t.currentStep()?.id??null)("waitingEvent",t.waitingEvent())("resuming",t.resuming())("canResume",true)("canRetryStep",e.status==="failed")("retryingStep",t.retryingStep());}}function Lt(i,c){i&1&&(_i(0,"p",22),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.workflowMissing")," "));}function Qt(i,c){if(i&1){let e=LD();_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"div",6)(8,"span",7),vw(9),Kc(),_i(10,"button",8),Rw(11,"transloco"),gh("click",function(){let n=Pu(e),d=VD();return Lu(d.copyJobId(n.id))}),lh(12,"span",9),Kc()(),_i(13,"p",10)(14,"span",11),vw(15),Kc(),vw(16," \xB7 "),_i(17,"nz-tag",12),vw(18),Rw(19,"transloco"),Kc(),vw(20," \xB7 "),_i(21,"span",13),vw(22),Kc()(),bD(23,zt,3,1,"p",14),Kc(),_i(24,"div",15),bD(25,Ot,3,4,"button",16),bD(26,Bt,3,4,"button",17),bD(27,At,3,3,"button",18),Kc()(),bD(28,Ft,2,1,"p",19),bD(29,qt,2,3,"nz-alert",20)(30,$t,1,10,"app-job-step-workspace",21)(31,Lt,3,3,"p",22);}if(i&2){let e,t=c,n=VD();gI(3),Ph(Ow(4,14,"jobs.detail.backToStart")),gI(3),Ph(n.composeJobTitle(t)),gI(3),Ph(t.id),gI(),ah("aria-label",Ow(11,16,"jobs.detail.copyId")),gI(5),Ph(t.workflowId),gI(2),ch("ngClass",n.jobStatusTagClass(t.status,n.theme.theme())),gI(),Ph(Ow(19,18,n.statusKey(t.status))),gI(4),Ph(n.subjectText()),gI(),_D(t.worktreePath?23:-1),gI(2),_D(n.isTerminalStatus(t.status)?-1:25),gI(),_D(t.status==="failed"?26:-1),gI(),_D(n.showJumpToCurrent()?27:-1),gI(),_D(n.actionError()?28:-1),gI(),_D(n.showQueued()?29:(e=n.workflow())?30:31,e);}}var Ei=(()=>{class i{constructor(){this.route=C(C1),this.router=C(J1),this.jobsApi=C($),this.eventsService=C(f),this.transloco=C(Ve$1),this.destroyRef=C(at$1),this.theme=C(p),this.jobStatusTagClass=w,this.composeJobTitle=q,this.job=qo(null),this.workflow=qo(null),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.eventStream=qo(null),this.eventsSnapshot=qo([]),this.autoFollow=qo(true),this.viewedExecutionId=qo(null),this.resuming=qo(false),this.retryingWorkflow=qo(false),this.retryingStep=qo(false),this.cancelling=qo(false),this.currentStep=Hw(()=>{let e=this.job();return e?$$1(e):null}),this.showQueued=Hw(()=>{let e=this.job();return e!=null&&$$1(e)==null}),this.showJumpToCurrent=Hw(()=>{let e=this.currentStep();return e?this.viewedExecutionId()!==e.id:false}),this.eventLog=Hw(()=>this.eventStream()?.events()??this.eventsSnapshot()),this.waitingEvent=Hw(()=>{let e=this.eventLog();for(let t=e.length-1;t>=0;t-=1){let n=e[t];if(n?.type==="waiting_for_human")return n}return null}),this.blockingExecutionId=Hw(()=>this.job()?.currentStepExecutionId??null),this.destroyRef.onDestroy(()=>this.closeStream()),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(e=>{let t=e.get("id");if(!t){this.loading.set(false),this.loadError.set(this.transloco.translate("jobs.detail.loadFailed"));return}this.load(t);}),rd(()=>{let e=this.eventStream();if(!e)return;let t=e.latest();t&&Bw(()=>{(t.type==="step_started"||t.type==="step_completed"||t.type==="step_failed"||t.type==="waiting_for_human"||t.type==="waiting_for_children"||t.type==="human_answered"||t.type==="job_completed"||t.type==="job_failed"||t.type==="job_cancelled")&&this.refreshJob(t.jobId),(t.type==="job_completed"||t.type==="job_failed"||t.type==="job_cancelled")&&this.closeStream();});}),rd(()=>{let e=this.currentStep();this.autoFollow()&&Bw(()=>{this.viewedExecutionId.set(e?.id??null);});});}statusKey(e){return `jobs.status.${e}`}isTerminalStatus(e){return g(e)}subjectText(){return I(this.job()?.subjectContext)??"\u2014"}copyJobId(e){let t=globalThis.navigator?.clipboard;t?.writeText&&t.writeText(e);}onSelectExecution(e){this.autoFollow.set(false),this.viewedExecutionId.set(e);}jumpToCurrent(){this.autoFollow.set(true),this.viewedExecutionId.set(this.currentStep()?.id??null);}submitResume(e){let t=this.job();t&&(this.actionError.set(null),this.resuming.set(true),this.jobsApi.resume(t.id,e).subscribe({next:n=>{this.resuming.set(false),this.applyJob(n),g(n.status)&&this.closeStream();},error:n=>{this.resuming.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.resumeFailed")));}}));}submitExtractResume(e){let t=this.job();t&&(this.actionError.set(null),this.resuming.set(true),this.jobsApi.resume(t.id,e).subscribe({next:n=>{this.resuming.set(false),this.applyJob(n),g(n.status)&&this.closeStream();},error:n=>{this.resuming.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.resumeFailed")));}}));}retryWorkflow(){let e=this.job();!e||e.status!=="failed"||this.retryingWorkflow()||(this.actionError.set(null),this.retryingWorkflow.set(true),this.jobsApi.retry(e.id).subscribe({next:t=>{this.retryingWorkflow.set(false),this.router.navigate(["/jobs",t.id]);},error:t=>{this.retryingWorkflow.set(false),this.actionError.set(this.errorMessage(t,this.transloco.translate("jobs.errors.retryFailed")));}}));}retryThisStep(e){let t=this.job();!t||t.status!=="failed"||this.retryingStep()||(this.actionError.set(null),this.retryingStep.set(true),this.jobsApi.retryStep(t.id,e).subscribe({next:n=>{this.retryingStep.set(false),this.applyJob(n),g(n.status)?this.closeStream():(this.closeStream(),this.eventStream.set(this.eventsService.connect({jobId:n.id})));},error:n=>{this.retryingStep.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.retryStepFailed")));}}));}cancelJob(){let e=this.job();!e||g(e.status)||this.cancelling()||(this.actionError.set(null),this.cancelling.set(true),this.jobsApi.cancel(e.id).subscribe({next:t=>{this.cancelling.set(false),this.applyJob(t),g(t.status)&&this.closeStream();},error:t=>{this.cancelling.set(false),this.actionError.set(this.errorMessage(t,this.transloco.translate("jobs.errors.cancelFailed")));}}));}load(e){this.loading.set(true),this.loadError.set(null),this.actionError.set(null),this.autoFollow.set(true),this.viewedExecutionId.set(null),this.retryingWorkflow.set(false),this.retryingStep.set(false),this.cancelling.set(false),this.closeStream(),this.eventsSnapshot.set([]),this.jobsApi.get(e).pipe(ue(this.destroyRef)).subscribe({next:t=>{this.applyJob(t),this.loading.set(false),g(t.status)||this.eventStream.set(this.eventsService.connect({jobId:t.id}));},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("jobs.detail.loadFailed")));}});}applyJob(e){this.job.set(e),this.workflow.set(e.workflowSnapshot??null),this.autoFollow()&&this.viewedExecutionId.set($$1(e)?.id??null);}refreshJob(e){this.jobsApi.get(e).subscribe({next:t=>this.applyJob(t),error:t=>{this.actionError.set(this.errorMessage(t,this.transloco.translate("jobs.errors.refreshFailed")));}});}closeStream(){let e=this.eventStream();e&&(this.eventsSnapshot.set(e.events()),e.close(),this.eventStream.set(null));}errorMessage(e,t){return e instanceof bi||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-job-detail"]],decls:4,vars:1,consts:[["data-testid","job-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/jobs"],["data-testid","job-title"],[1,"job-id-line"],["data-testid","job-id",1,"job-id","mono"],["type","button","nz-button","","nzType","text","nzSize","small","data-testid","copy-job-id",1,"copy-job-id",3,"click"],["nz-icon","","nzType","copy","nzTheme","outline"],[1,"meta"],["data-testid","job-workflow"],["data-testid","job-status",3,"ngClass"],["data-testid","job-subject"],["data-testid","job-worktree",1,"meta"],[1,"header-actions"],["nz-button","","nzDanger","","type","button","data-testid","cancel-job",3,"disabled"],["nz-button","","nzType","primary","type","button","data-testid","retry-workflow",3,"disabled"],["nz-button","","type","button","data-testid","jump-to-current"],["data-testid","action-error",1,"error"],["data-testid","queued-message","nzType","info",3,"nzMessage"],[3,"definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","resuming","canResume","canRetryStep","retryingStep"],["data-testid","missing-workflow",1,"muted"],["nz-button","","nzDanger","","type","button","data-testid","cancel-job",3,"click","disabled"],["nz-button","","nzType","primary","type","button","data-testid","retry-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","jump-to-current",3,"click"],[3,"selectExecution","resumeSubmit","extractResume","retryStep","definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","resuming","canResume","canRetryStep","retryingStep"]],template:function(t,n){if(t&1&&(_i(0,"main",0),bD(1,Jt,3,3,"p",1)(2,Vt,2,1,"p",2)(3,Qt,32,20),Kc()),t&2){let d;gI(),_D(n.loading()?1:n.loadError()?2:(d=n.job())?3:-1,d);}},dependencies:[$8,M5,v3,Gn,un,pf,bd,sp,fp,Th,xh,W,I$1,Ne,Kt],styles:["[_nghost-%COMP%]{display:block;min-width:0;max-width:100%}.detail-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem;min-width:0;max-width:100%}.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;align-items:center}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem}.job-id-line[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.15rem;margin-top:.2rem}.job-id[_ngcontent-%COMP%]{font-size:.8rem;color:var(--knoflows-text-secondary, #6b6558)}.copy-job-id[_ngcontent-%COMP%]{color:var(--knoflows-text-secondary, #6b6558)}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.error[_ngcontent-%COMP%]{color:#9f1239}.muted[_ngcontent-%COMP%]{color:#78716c}"]});}}return i})();export{Ei as JobDetailComponent};
@@ -1 +0,0 @@
1
- import {f}from'./chunk-J9qS04nF.js';import {C,b as at,a5 as $0,a6 as B0,q as qo,u as ue,s,r as r$1,Q as QE,d as $8,K as Kt,a$ as Jc,N as ND,b0 as Xc,w as gI,D as xD,k as vw,n as bD,z as nl,B as _D,L as LD,bu as mh,J as Pu,E as VD,M as Lu,cU as ph,G as ah,S as SD,aa as Nw,R as Rw,P as Ph,O as Ow}from'./main-2ZW45HAE.js';var q=()=>[],A=(t,o)=>o.name,B=(t,o)=>o.id;function j(t,o){t&1&&(Jc(0,"span",1),vw(1,"*"),Xc());}function z(t,o){if(t&1){let e=LD();Jc(0,"input",6),mh("change",function(r){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,r))}),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("checked",n.checked(e)),ah("data-testid","input-"+e.name);}}function U(t,o){if(t&1){let e=LD();Jc(0,"input",7),mh("input",function(r){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,r))}),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("value",n.displayValue(e)),ah("data-testid","input-"+e.name);}}function G(t,o){if(t&1&&(Jc(0,"option",4),vw(1),Xc()),t&2){let e=o.$implicit;ph("value",e),gI(),Ph(e);}}function H(t,o){if(t&1){let e=LD();Jc(0,"select",8),mh("change",function(r){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,r))}),ND(1,G,2,2,"option",4,SD),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("value",n.displayValue(e)),ah("data-testid","input-"+e.name),gI(),xD(e.options??Nw(2,q));}}function J(t,o){if(t&1&&(Jc(0,"option",4),vw(1),Xc()),t&2){let e=o.$implicit;ph("value",e.id),gI(),Ph(e.name);}}function K(t,o){if(t&1){let e=LD();Jc(0,"select",8),mh("change",function(r){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,r))}),Jc(1,"option",9),vw(2),Rw(3,"transloco"),Xc(),ND(4,J,2,2,"option",4,B),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("value",n.displayValue(e)),ah("data-testid","input-"+e.name),gI(2),Ph(Ow(3,3,"workflow-input.localRepositoryPlaceholder")),gI(2),xD(n.localRepositories());}}function Q(t,o){if(t&1){let e=LD();Jc(0,"input",10),mh("input",function(r){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,r))}),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("value",n.displayValue(e)),ah("data-testid","input-"+e.name);}}function X(t,o){if(t&1&&(Jc(0,"label"),vw(1),bD(2,j,2,0,"span",1),bD(3,z,1,2,"input",2)(4,U,1,2,"input",3)(5,H,3,3,"select",4)(6,K,6,5,"select",4)(7,Q,1,2,"input",5),Xc()),t&2){let e,n=o.$implicit;gI(),nl(" ",n.label," "),gI(),_D(n.required?2:-1),gI(),_D((e=n.type)==="boolean"?3:e==="number"?4:e==="select"?5:e==="localRepository"?6:7);}}function Y(t){if(t.defaultValue!==void 0)return t.defaultValue;switch(t.type){case "boolean":return false;case "number":return "";case "select":return t.options?.[0]??"";default:return ""}}function ae(t){let o={};for(let e of t)o[e.name]=Y(e);return o}var le=(()=>{class t{constructor(){this.reposApi=C(f),this.destroyRef=C(at),this.fields=$0([]),this.values=$0({}),this.valuesChange=B0(),this.localRepositories=qo([]),this.reposApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.localRepositories.set(e),error:()=>this.localRepositories.set([])});}displayValue(e){let n=this.values()[e.name];return n==null?"":String(n)}checked(e){return !!this.values()[e.name]}setValue(e,n){let r=n.target,a=r.value;e.type==="boolean"?a=r.checked:e.type==="number"&&(a=r.value===""?"":Number(r.value)),this.valuesChange.emit(s(r$1({},this.values()),{[e.name]:a}));}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-workflow-input-form"]],inputs:{fields:[1,"fields"],values:[1,"values"]},outputs:{valuesChange:"valuesChange"},decls:3,vars:0,consts:[["data-testid","workflow-input-form",1,"input-form"],[1,"required"],["type","checkbox",3,"checked"],["type","number",3,"value"],[3,"value"],["type","text",3,"value"],["type","checkbox",3,"change","checked"],["type","number",3,"input","value"],[3,"change","value"],["value",""],["type","text",3,"input","value"]],template:function(n,r){n&1&&(Jc(0,"div",0),ND(1,X,8,3,"label",null,A),Xc()),n&2&&(gI(),xD(r.fields()));},dependencies:[$8,Kt],styles:["label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0;font-size:.95rem}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e;background:#fff}input[type=checkbox][_ngcontent-%COMP%]{width:1.1rem;height:1.1rem}.required[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{ae as a,le as l};
@@ -1 +0,0 @@
1
- import {x as xy}from'./chunk-DMAf3Qir.js';function l(t){switch(t){case "completed":return "success";case "failed":return "error";case "cancelled":case "waiting_for_human":return "warning";default:return null}}function p(t){switch(t){case "completed":return "success";case "failed":return "error";case "completed_with_issues":case "cancelled":return "warning";default:return null}}function d(t){switch(t){case "completed":return "success";case "failed":return "error";default:return null}}function a(t,e){return e==="dark"&&t?`knoflows-tag-${t}`:""}function w(t,e){return a(l(t),e)}function x(t,e){return a(p(t),e)}function h(t,e){return a(d(t),e)}var m=new Set(["completed","failed","cancelled"]);function T(t){return t==="agent"||t==="shell"||t==="git"||t==="provider_action"}function g(t){return m.has(t)}function $(t){let e=t.stepHistory.find(r=>r.status==="running");if(e)return e;let n=t.stepHistory.find(r=>r.status==="queued");if(n)return n;if((t.status==="waiting_for_human"||t.status==="waiting_for_children")&&t.currentStepExecutionId){let r=t.stepHistory.find(i=>i.id===t.currentStepExecutionId);if(r)return r}return g(t.status)&&t.stepHistory.length>0?t.stepHistory[t.stepHistory.length-1]??null:null}function _(t,e){let n=new Map;for(let r of e)n.set(r.stepDefinitionId,r);return t.map(r=>{let i=n.get(r.id)??null;return {definition:r,execution:i,reached:i!=null}})}function I(t){if(!t)return null;if(t.mode==="single"){let n=t.subject;return `${n.id} \xB7 ${n.title}`}let e=t.subjects.length;if(e===0)return null;if(e===1){let n=t.subjects[0];return `${n.id} \xB7 ${n.title}`}return `${e} subjects`}function q(t){let e=t.workflowSnapshot?.name??t.workflowId;return t.subjectContext?t.subjectContext.mode==="single"?`${e} \u2014 ${t.subjectContext.subject.title}`:`${e} \u2014 ${t.subjectContext.subjects.length} items`:e}function O(t,e,n,r){let i=t.findIndex(u=>u.id===n);if(!(i<0))for(let u=i-1;u>=0;u-=1){let s=t[u];if(s.type!=="agent")continue;let c=e.find(o=>o.stepDefinitionId===s.id);if(c?.output!==void 0)return c.output;if(Object.prototype.hasOwnProperty.call(r.context,s.id))return r.context[s.id]}}function k(t){let e=t.waitingEvent;if(e&&e.questions.length>0)return e.questions;let n=e?.data??t.selectedOutput??t.priorOutput,r=xy(t.interaction,n);return r.length>0?r:e?.data!=null?[JSON.stringify(e.data,null,2)]:[]}function C(t){return t.waitingEvent?.data??t.selectedOutput??t.priorOutput}function E(t){if(!t||typeof t!="object")return [];let e=t.questions;if(!Array.isArray(e))return [];let n=new Set,r=[];return e.forEach((i,u)=>{let s="",c="";if(typeof i=="string")c=i.trim();else if(i&&typeof i=="object"){let o=i;typeof o.prompt=="string"&&(c=o.prompt.trim()),typeof o.id=="string"&&(s=o.id.trim());}if(c){if(!s){let o=`q${u+1}`;for(;n.has(o);)o=`${o}_${u}`;s=o;}n.add(s),r.push({id:s,prompt:c});}}),r}function H(t,e){return t.every(n=>(e[n.id]??"").trim()!=="")}function b(t,e,n){let r={};for(let u of t)r[u.id]=(e[u.id]??"").trim();let i=n.trim();return i&&(r.additionalComments=i),r}function v(t,e){let n=e.trim();return n?{approved:t,comment:n}:{approved:t}}export{$,C,E,H,I,O,T,_,b,g,h,k,q,v,w,x};
@@ -1 +0,0 @@
1
- import {_ as _n,C as Cn}from'./chunk-37yFTUcY.js';import {C,as as U,at as u,V as Ve,b as at,q as qo,u as ue,ac as Ng,c as bi,Q as QE,d as $8,v as v3,Z as pf,a0 as bd,a1 as sp,K as Kt,j as _i,k as vw,R as Rw,l as Kc,n as bD,w as gI,P as Ph,O as Ow,z as nl,B as _D,E as VD,N as ND,x as ch,D as xD,L as LD,m as gh,G as ah,J as Pu,M as Lu}from'./main-2ZW45HAE.js';import {b}from'./chunk-CM8oLO7n.js';import {W,I}from'./chunk-C4Ee3umI.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-yxqIQom4.js';import'./chunk-DphMF2VB.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(b),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 bi||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:[$8,v3,pf,bd,sp,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt],styles:[".list-page[_ngcontent-%COMP%]{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};
@@ -1 +0,0 @@
1
- import {T}from'./chunk-Cn95hfnf.js';import {a as ae,l as le}from'./chunk-DZhQ2iEt.js';import {H as He$1}from'./chunk-BuPc66MS.js';import {a as ai,z}from'./chunk-B_L2A3hm.js';import'./chunk-J9qS04nF.js';import {C,a as C1,T as J1,at as u,b as at,V as Ve,b1 as O,b2 as de,aw as Se,q as qo,H as Hw,u as ue$1,r as r$1,c as bi,Q as QE,d as $8,e as al,ax as er,f as rl,g as $i,v as v3,Z as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,k as vw,l as Kc,R as Rw,m as gh,n as bD,w as gI,P as Ph,O as Ow,x as ch,z as nl,B as _D,E as VD,L as LD,o as oE,N as ND,y as sE,D as xD,S as SD,p as lh,J as Pu,M as Lu}from'./main-2ZW45HAE.js';import {b}from'./chunk-CM8oLO7n.js';import {j as o_}from'./chunk-DMAf3Qir.js';import'./chunk-DphMF2VB.js';var me=(t,s)=>s.id;function ue(t,s){t&1&&(_i(0,"p",6),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function he(t,s){if(t&1&&(_i(0,"p",7),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function fe(t,s){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=s.$implicit;gI(),Ph(e);}}function ge(t,s){if(t&1&&(_i(0,"section",8)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,fe,2,1,"li",null,SD),Kc()()),t&2){let e=VD(2);gI(2),Ph(Ow(3,1,"shortcuts.editor.validation")),gI(3),xD(e.validationErrors());}}function _e(t,s){if(t&1&&lh(0,"nz-option",12),t&2){let e=s.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function we(t,s){if(t&1){let e=LD();_i(0,"app-workflow-input-form",14),gh("valuesChange",function(i){Pu(e);let u=VD(2);return Lu(u.setInputValues(i))}),Kc();}if(t&2){let e=VD(2);ch("fields",s.inputSchema)("values",e.inputValues());}}function ve(t,s){if(t&1){let e=LD();bD(0,ge,7,3,"section",8),_i(1,"label",9)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",10),gh("ngModelChange",function(i){Pu(e);let u=VD();return Lu(u.name.set(i))}),Kc(),oE(),Kc(),_i(6,"div",9)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",11),gh("ngModelChange",function(i){Pu(e);let u=VD();return Lu(u.onWorkflowChange(i))}),ND(11,_e,1,2,"nz-option",12,me),Kc(),oE(),Kc(),bD(13,we,1,2,"app-workflow-input-form",13);}if(t&2){let e,o=VD();_D(o.validationErrors().length>0?0:-1),gI(3),Ph(Ow(4,6,"shortcuts.editor.name")),gI(2),ch("ngModel",o.name()),sE(),gI(3),Ph(Ow(9,8,"shortcuts.editor.workflow")),gI(2),ch("ngModel",o.workflowId()),sE(),gI(),xD(o.eligibleWorkflows()),gI(2),_D((e=o.selectedWorkflow())?13:-1,e);}}function Ce(t){let s=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return s.length>0?`sc-${s}-${e}`:`sc-${e}`}var He=(()=>{class t{constructor(){this.route=C(C1),this.router=C(J1),this.shortcutsApi=C(u),this.workflowsApi=C(b),this.message=C(He$1),this.destroyRef=C(at),this.transloco=C(Ve),this.language=C(O),this.routeId=de(this.route.paramMap.pipe(Se(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.workflows=qo([]),this.inputValues=qo({}),this.lastJobId=qo(void 0),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("shortcuts.editor.titleNew"):this.transloco.translate("shortcuts.editor.titleEdit",{name:this.name().trim()}))),this.eligibleWorkflows=Hw(()=>this.workflows().filter(e=>e.appliesTo==="none"&&e.subjectHandling==="per-subject")),this.selectedWorkflow=Hw(()=>this.eligibleWorkflows().find(e=>e.id===this.workflowId())??null),this.workflowsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>this.workflows.set(e),error:e=>{this.workflows.set([]),this.message.error(this.errorMessage(e,this.transloco.translate("shortcuts.editor.loadFailed")));}}),this.route.paramMap.pipe(ue$1(this.destroyRef)).subscribe(e=>{let o=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),!o){this.name.set(""),this.workflowId.set(""),this.inputValues.set({}),this.lastJobId.set(void 0),this.loading.set(false);return}this.loading.set(true),this.shortcutsApi.get(o).subscribe({next:i=>{this.name.set(i.name),this.workflowId.set(i.workflowId),this.inputValues.set(i.inputValues),this.lastJobId.set(i.lastJobId),this.loading.set(false);},error:i=>{this.loading.set(false),this.loadError.set(this.errorMessage(i,this.transloco.translate("shortcuts.editor.loadFailed")));}});});}onWorkflowChange(e){this.workflowId.set(e);let o=this.eligibleWorkflows().find(i=>i.id===e);this.inputValues.set(ae(o?.inputSchema??[]));}setInputValues(e){this.inputValues.set(e);}save(){let e=this.routeId(),o=r$1({id:e??Ce(this.name()),name:this.name().trim(),workflowId:this.workflowId(),inputValues:this.inputValues()},this.lastJobId()?{lastJobId:this.lastJobId()}:{}),i=o_.safeParse(o);if(!i.success){this.validationErrors.set(T(i.error));return}this.validationErrors.set([]),this.saving.set(true),(this.isNew()||!e?this.shortcutsApi.create(i.data):this.shortcutsApi.update(e,i.data)).subscribe({next:M=>{this.saving.set(false),this.message.success(this.transloco.translate(this.isNew()?"shortcuts.editor.created":"shortcuts.editor.saved")),this.isNew()&&this.router.navigate(["/shortcuts",M.id,"edit"]);},error:M=>{this.saving.set(false),this.message.error(this.errorMessage(M,this.transloco.translate("shortcuts.editor.saveFailed")));}});}errorMessage(e,o){return e instanceof bi||e instanceof Error?e.message:o}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-shortcut-editor"]],decls:15,vars:10,consts:[["data-testid","shortcut-editor",1,"editor"],[1,"header"],["data-testid","page-title"],[1,"header-actions"],["routerLink","/shortcuts"],["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","shortcut-name",3,"ngModelChange","ngModel"],["data-testid","shortcut-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[3,"fields","values"],[3,"valuesChange","fields","values"]],template:function(o,i){o&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1",2),vw(4),Kc()(),_i(5,"div",3)(6,"a",4),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",5),gh("click",function(){return i.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,ue,3,3,"p",6)(13,he,2,1,"p",7)(14,ve,14,10),Kc()),o&2&&(gI(4),Ph(i.pageTitle()),gI(3),Ph(Ow(8,6,"shortcuts.editor.backToList")),gI(2),ch("nzLoading",i.saving())("disabled",i.loading()||!!i.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(i.loading()?12:i.loadError()?13:14));},dependencies:[$8,al,er,rl,$i,v3,pf,bd,sp,fp,ai,z,ex,Fm,Am,le,Kt],styles:[".editor[_ngcontent-%COMP%]{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}.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}"]});}}return t})();export{He as ShortcutEditorComponent};
@@ -1,5 +0,0 @@
1
- import {T}from'./chunk-Cn95hfnf.js';import {$ as $$1,B}from'./chunk-DFoFQkTa.js';import {H as He$1}from'./chunk-BuPc66MS.js';import {a as ai,z}from'./chunk-B_L2A3hm.js';import {C,a as C1,T as J1,as as U,au as $,b as at,V as Ve$1,b1 as O$1,b2 as de,aw as Se$1,q as qo,H as Hw,u as ue,s,r as r$1,c as bi,Q as QE,d as $8,e as al,ax as er,f as rl,g as $i,v as v3,Z as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,k as vw,l as Kc,R as Rw,m as gh,n as bD,w as gI,P as Ph,O as Ow,x as ch,z as nl,B as _D,E as VD,L as LD,o as oE,N as ND,y as sE,D as xD,S as SD,p as lh,J as Pu$1,M as Lu,a8 as Mh,G as ah,aa as Nw}from'./main-2ZW45HAE.js';import {b}from'./chunk-CM8oLO7n.js';import {d as Pu,$ as $_,f as __,M as M$}from'./chunk-DMAf3Qir.js';import'./chunk-DphMF2VB.js';var be=()=>[],O=(t,a)=>a.id,Me=(t,a)=>a.name;function Ie(t,a){t&1&&(_i(0,"p",6),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",7),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",8)(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",12),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function Pe(t,a){t&1&&(_i(0,"p",14),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",17),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",12),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",16),bD(1,Se,3,3,"p",17),_i(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"nz-select",18),Rw(6,"transloco"),gh("ngModelChange",function(n){Pu$1(e);let s=VD(3);return Lu(s.onInstanceChange(n))}),ND(7,Ne,1,2,"nz-option",12,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",14)(1,qe,9,10,"div",15),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",13)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",19)(5,"button",20),gh("click",function(){Pu$1(e);let n=VD(2);return Lu(n.setQueryMode("template"))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",21),gh("click",function(){Pu$1(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",12),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.label);}}function je(t,a){t&1&&(_i(0,"span",23),vw(1,"*"),Kc());}function Oe(t,a){if(t&1&&lh(0,"nz-option",12),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",26),gh("ngModelChange",function(n){Pu$1(e);let s=VD().$implicit,g=VD(4);return Lu(g.setTemplateParam(s.name,n))}),ND(1,Oe,1,2,"nz-option",12,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",27),gh("ngModelChange",function(n){Pu$1(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",9)(1,"span"),vw(2),bD(3,je,2,0,"span",23),Kc(),bD(4,Be,3,3,"nz-select",24)(5,$e,1,2,"input",25),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",9,Me),t&2&&xD(a.params);}function Re(t,a){if(t&1){let e=LD();_i(0,"div",9)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",22),gh("ngModelChange",function(n){Pu$1(e);let s=VD(2);return Lu(s.selectTemplate(n))}),ND(5,Fe,1,2,"nz-option",12,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",9)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",28),gh("ngModelChange",function(n){Pu$1(e);let s=VD(2);return Lu(s.queryText.set(n))}),Kc(),oE(),_i(5,"span",29),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",8),_i(1,"label",9)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",10),gh("ngModelChange",function(n){Pu$1(e);let s=VD();return Lu(s.name.set(n))}),Kc(),oE(),Kc(),_i(6,"div",9)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",11),gh("ngModelChange",function(n){Pu$1(e);let s=VD();return Lu(s.onWorkflowChange(n))}),ND(11,ke,1,2,"nz-option",12,O),Kc(),oE(),Kc(),bD(13,De,2,1),bD(14,Ae,11,11,"div",13),bD(15,Re,8,5)(16,Je,8,7,"label",9);}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(C1),this.router=C(J1),this.viewsApi=C(U),this.workflowsApi=C(b),this.settingsApi=C($),this.providersApi=C($$1),this.message=C(He$1),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
-
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(()=>Pu(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",{name:this.name().trim()}))),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($_),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
-
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=Pu(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),__(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$1({},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$1({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=M$.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$1(r$1({},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 bi||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"],["data-testid","page-title"],[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",2),vw(4),Kc()(),_i(5,"div",3)(6,"a",4),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",5),gh("click",function(){return n.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,Ie,3,3,"p",6)(13,Ee,2,1,"p",7)(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:[$8,al,er,rl,$i,v3,pf,bd,sp,fp,ai,z,ex,Fm,Am,Kt],styles:[".editor[_ngcontent-%COMP%]{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};
@@ -1 +0,0 @@
1
- import {aA as YE,aB as uu,aC as pT,C,aG as z0,bQ as Gm,aJ as Oe,aI as hT,bK as Le$1,bA as zt,Q as QE,a3 as Th,a4 as xh,aN as st,aO as Ee,bR as Mn,aP as ly,aQ as Z0,n as bD,B as _D,aX as Yl,L as LD,j as _i,bS as ec,l as Kc,E as VD,a8 as Mh,x as ch,w as gI,aY as nh,m as gh,p as lh,aZ as el,k as vw,a_ as tl,P as Ph,J as Pu,M as Lu,bT as fh}from'./main-2ZW45HAE.js';function X(n,i){n&1&&fh(0);}function $(n,i){if(n&1&&nh(0,X,1,0,"ng-container",7),n&2){let e=VD(3);ch("nzStringTemplateOutlet",e.nzIcon);}}function nn(n,i){if(n&1&&lh(0,"nz-icon",6),n&2){let e=VD(3);ch("nzType",e.nzIconType||e.inferredIconType)("nzTheme",e.iconTheme);}}function en(n,i){if(n&1&&(_i(0,"div",2),bD(1,$,1,1,"ng-container")(2,nn,1,2,"nz-icon",6),Kc()),n&2){let e=VD(2);gI(),_D(e.nzIcon?1:2);}}function tn(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(4);gI(),Ph(e.nzMessage);}}function on(n,i){if(n&1&&(_i(0,"span",8),nh(1,tn,2,1,"ng-container",7),Kc()),n&2){let e=VD(3);gI(),ch("nzStringTemplateOutlet",e.nzMessage);}}function an(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(4);gI(),Ph(e.nzDescription);}}function rn(n,i){if(n&1&&(_i(0,"span",9),nh(1,an,2,1,"ng-container",7),Kc()),n&2){let e=VD(3);gI(),ch("nzStringTemplateOutlet",e.nzDescription);}}function ln(n,i){if(n&1&&(_i(0,"div",3),bD(1,on,2,1,"span",8),bD(2,rn,2,1,"span",9),Kc()),n&2){let e=VD(2);gI(),_D(e.nzMessage?1:-1),gI(),_D(e.nzDescription?2:-1);}}function cn(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(3);gI(),Ph(e.nzAction);}}function sn(n,i){if(n&1&&(_i(0,"div",4),nh(1,cn,2,1,"ng-container",7),Kc()),n&2){let e=VD(2);gI(),ch("nzStringTemplateOutlet",e.nzAction);}}function dn(n,i){if(n&1&&(el(0),_i(1,"span",12),vw(2),Kc(),tl()),n&2){let e=VD(4);gI(2),Ph(e.nzCloseText);}}function mn(n,i){if(n&1&&nh(0,dn,3,1,"ng-container",7),n&2){let e=VD(3);ch("nzStringTemplateOutlet",e.nzCloseText);}}function pn(n,i){n&1&&lh(0,"nz-icon",11);}function _n(n,i){if(n&1){let e=LD();_i(0,"button",10),gh("click",function(){Pu(e);let z=VD(2);return Lu(z.closeAlert())}),bD(1,mn,1,1,"ng-container")(2,pn,1,0,"nz-icon",11),Kc();}if(n&2){let e=VD(2);gI(),_D(e.nzCloseText?1:2);}}function zn(n,i){if(n&1){let e=LD();_i(0,"div",1),ec(function(z){Pu(e);let T=VD();return Lu(T.onLeaveAnimationDone(z))}),bD(1,en,3,1,"div",2),bD(2,ln,3,2,"div",3),bD(3,sn,2,1,"div",4),bD(4,_n,3,1,"button",5),Kc();}if(n&2){let e=VD();Mh("ant-alert-rtl",e.dir()==="rtl")("ant-alert-success",e.nzType==="success")("ant-alert-info",e.nzType==="info")("ant-alert-warning",e.nzType==="warning")("ant-alert-error",e.nzType==="error")("ant-alert-no-icon",!e.nzShowIcon)("ant-alert-banner",e.nzBanner)("ant-alert-closable",e.nzCloseable)("ant-alert-with-description",!!e.nzDescription),ch("nzNoAnimation",e.nzNoAnimation),gI(),_D(e.nzShowIcon?1:-1),gI(),_D(e.nzMessage||e.nzDescription?2:-1),gI(),_D(e.nzAction?3:-1),gI(),_D(e.nzCloseable||e.nzCloseText?4:-1);}}var Z="alert",un=(()=>{let n,i=[],e=[],_,z=[],T=[];return class D{static{let r=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[Yl()],_=[Yl()],pT(null,null,n,{kind:"field",name:"nzCloseable",static:false,private:false,access:{has:t=>"nzCloseable"in t,get:t=>t.nzCloseable,set:(t,l)=>{t.nzCloseable=l;}},metadata:r},i,e),pT(null,null,_,{kind:"field",name:"nzShowIcon",static:false,private:false,access:{has:t=>"nzShowIcon"in t,get:t=>t.nzShowIcon,set:(t,l)=>{t.nzShowIcon=l;}},metadata:r},z,T),r&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:r});}cdr=C(z0);animationType=C(Gm,{optional:true});dir=C(Oe).valueSignal;_nzModuleName=Z;nzAction=null;nzCloseText=null;nzIconType=null;nzMessage=null;nzDescription=null;nzType="info";nzCloseable=hT(this,i,false);nzShowIcon=(hT(this,e),hT(this,z,false));nzBanner=(hT(this,T),false);nzNoAnimation=false;nzIcon=null;nzOnClose=new Le$1;closed=false;iconTheme="fill";inferredIconType="info-circle";isTypeSet=false;isShowIconSet=false;constructor(){zt(Z,()=>this.cdr.markForCheck());}closeAlert(){this.closed=true,(this.nzNoAnimation||this.animationType==="NoopAnimations")&&this.nzOnClose.emit(true);}onLeaveAnimationDone(r){let t=r.target;if(this.nzNoAnimation||this.animationType==="NoopAnimations"){r.animationComplete();return}t.classList.add("ant-alert-motion-leave","ant-alert-motion-leave-active");let l=()=>{t.removeEventListener("transitionend",l),this.nzOnClose.emit(true),r.animationComplete();};t.addEventListener("transitionend",l);}ngOnChanges(r){let{nzShowIcon:t,nzDescription:l,nzType:J,nzBanner:K}=r;if(t&&(this.isShowIconSet=true),J)switch(this.isTypeSet=true,this.nzType){case "error":this.inferredIconType="close-circle";break;case "success":this.inferredIconType="check-circle";break;case "info":this.inferredIconType="info-circle";break;case "warning":this.inferredIconType="exclamation-circle";break}l&&(this.iconTheme=this.nzDescription?"outline":"fill"),K&&(this.isTypeSet||(this.nzType="warning"),this.isShowIconSet||(this.nzShowIcon=true));}static \u0275fac=function(t){return new(t||D)};static \u0275cmp=QE({type:D,selectors:[["nz-alert"]],inputs:{nzAction:"nzAction",nzCloseText:"nzCloseText",nzIconType:"nzIconType",nzMessage:"nzMessage",nzDescription:"nzDescription",nzType:"nzType",nzCloseable:[2,"nzCloseable","nzCloseable",Z0],nzShowIcon:[2,"nzShowIcon","nzShowIcon",Z0],nzBanner:[2,"nzBanner","nzBanner",Z0],nzNoAnimation:[2,"nzNoAnimation","nzNoAnimation",Z0],nzIcon:"nzIcon"},outputs:{nzOnClose:"nzOnClose"},exportAs:["nzAlert"],features:[ly],decls:1,vars:1,consts:[[1,"ant-alert",3,"nzNoAnimation","ant-alert-rtl","ant-alert-success","ant-alert-info","ant-alert-warning","ant-alert-error","ant-alert-no-icon","ant-alert-banner","ant-alert-closable","ant-alert-with-description"],[1,"ant-alert",3,"nzNoAnimation"],[1,"ant-alert-icon"],[1,"ant-alert-content"],[1,"ant-alert-action"],["type","button","tabindex","0",1,"ant-alert-close-icon"],[3,"nzType","nzTheme"],[4,"nzStringTemplateOutlet"],[1,"ant-alert-message"],[1,"ant-alert-description"],["type","button","tabindex","0",1,"ant-alert-close-icon",3,"click"],["nzType","close"],[1,"ant-alert-close-text"]],template:function(t,l){t&1&&bD(0,zn,5,23,"div",0),t&2&&_D(l.closed?-1:0);},dependencies:[Th,xh,st,Ee,Mn],encapsulation:2})}})(),Gn=(()=>{class n{static \u0275fac=function(_){return new(_||n)};static \u0275mod=YE({type:n});static \u0275inj=uu({imports:[un]})}return n})();export{Gn as G,un as u};