@knoflows/engine 0.1.1-alpha.0 → 0.1.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine.js +31 -19
- package/dist/migrations/20260923070000_local_repo_default_reviewers/migration.sql +1 -0
- package/dist/migrations/20260923072051_hard_beast/migration.sql +2 -0
- package/dist/migrations/20260923072051_hard_beast/snapshot.json +1408 -0
- package/package.json +4 -4
- package/static/assets/i18n/en.json +23 -0
- package/static/assets/i18n/es.json +23 -0
- package/static/chunk-5P9quDD0.js +1 -0
- package/static/chunk-B1I44qNh.js +1 -0
- package/static/{chunk-BHko4hHm.js → chunk-B67hwr1X.js} +1 -1
- package/static/{chunk-CGHIKxZG.js → chunk-B7mctPQM.js} +1 -1
- package/static/{chunk-EDwdt-Wk.js → chunk-BAPXVTBt.js} +1 -1
- package/static/chunk-BNQus_d_.js +1 -0
- package/static/chunk-Bh5et471.js +1 -0
- package/static/{chunk--EZIkevK.js → chunk-BidviQhN.js} +1 -1
- package/static/chunk-BldTY6RI.js +1 -0
- package/static/chunk-BmEXmF8m.js +1 -0
- package/static/chunk-BqhxU3er.js +1 -0
- package/static/{chunk-Det50scT.js → chunk-Bv65hEw_.js} +1 -1
- package/static/{chunk-Dm_EWkUz.js → chunk-C07s4-rF.js} +1 -1
- package/static/chunk-C5eZIOiF.js +1 -0
- package/static/{chunk-BRAytoQl.js → chunk-C61nx2gP.js} +1 -1
- package/static/{chunk-DbQy6dR8.js → chunk-CI75Yj8J.js} +1 -1
- package/static/chunk-CNip9Ktj.js +1 -0
- package/static/chunk-CP6elnGc.js +1 -0
- package/static/{chunk-YU-Bg77r.js → chunk-Cf14heGp.js} +1 -1
- package/static/chunk-CiB-X52X.js +1 -0
- package/static/chunk-Cj5izLCS.js +1 -0
- package/static/{chunk-BIJScqTM.js → chunk-CxnyhsKe.js} +1 -1
- package/static/chunk-CyvupcYz.js +1 -0
- package/static/{chunk-CoQPYpxp.js → chunk-D1sSb3lO.js} +1 -1
- package/static/{chunk-iIEmH_ui.js → chunk-D5BPM_KC.js} +1 -1
- package/static/{chunk-D-ueyYEC.js → chunk-D9f8Ltay.js} +3 -3
- package/static/{chunk-DdDI9wRc.js → chunk-DBtN2lWe.js} +3 -3
- package/static/chunk-DD_o_6mU.js +1 -0
- package/static/chunk-DRe_kA_l.js +1 -0
- package/static/{chunk-BcDRgzYZ.js → chunk-Dt7AgNFd.js} +1 -1
- package/static/chunk-Dxa2JdVP.js +1 -0
- package/static/{chunk-CtiubhW7.js → chunk-DyGh8J3-.js} +1 -1
- package/static/chunk-IZZsw-Ul.js +1 -0
- package/static/{chunk-vINo5yVD.js → chunk-MciiAFro.js} +1 -1
- package/static/{chunk-CJWR0gwk.js → chunk-RWVebRsq.js} +1 -1
- package/static/chunk-doY5ozP9.js +1 -0
- package/static/{chunk-8ezEUcxN.js → chunk-g20-BKKx.js} +6 -6
- package/static/chunk-lPfYUUfU.js +1 -0
- package/static/chunk-vnmh6IU3.js +1 -0
- package/static/chunk-zWWkMLc1.js +1 -0
- package/static/index.html +1 -1
- package/static/{main-3VZRFHGG.js → main-GFNB573R.js} +1 -1
- package/static/chunk-B17yZLWe.js +0 -1
- package/static/chunk-B8OjWpOp.js +0 -1
- package/static/chunk-BKYaECRn.js +0 -1
- package/static/chunk-BLN4QkSi.js +0 -1
- package/static/chunk-BaLWULJh.js +0 -1
- package/static/chunk-Bok52e_k.js +0 -1
- package/static/chunk-BowAQ7m9.js +0 -1
- package/static/chunk-Bz7bE4tT.js +0 -1
- package/static/chunk-C7P7hUiX.js +0 -1
- package/static/chunk-CAxHAuhV.js +0 -1
- package/static/chunk-CZA-kp5w.js +0 -1
- package/static/chunk-CwEMAptL.js +0 -1
- package/static/chunk-D1355dNd.js +0 -1
- package/static/chunk-D8qyjd0z.js +0 -1
- package/static/chunk-DOAz4S6b.js +0 -1
- package/static/chunk-DoJknvak.js +0 -1
- package/static/chunk-DrncP2Qx.js +0 -1
- package/static/chunk-IjKs-6Cl.js +0 -1
- package/static/chunk-LPXHXTnJ.js +0 -1
- package/static/chunk-SiaN7xSQ.js +0 -1
- package/static/chunk-bSS_wejP.js +0 -1
package/static/chunk-B17yZLWe.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {S as St}from'./chunk-BRAytoQl.js';import'./chunk-Det50scT.js';import'./chunk-vINo5yVD.js';import {Z as ZE,n as uh}from'./main-3VZRFHGG.js';import'./chunk-Dm_EWkUz.js';import'./chunk-Bok52e_k.js';import'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';var c=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-context-files-manage"]],decls:1,vars:0,template:function(t,a){t&1&&uh(0,"app-context-file-list");},dependencies:[St],encapsulation:2});}}return e})();export{c as ContextFilesManageComponent};
|
package/static/chunk-B8OjWpOp.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {U}from'./chunk-YU-Bg77r.js';import {f}from'./chunk-CJWR0gwk.js';import {L as Lt}from'./chunk-LPXHXTnJ.js';import {y,S}from'./chunk-D8qyjd0z.js';import {W,I}from'./chunk-Bok52e_k.js';import'./chunk-8ezEUcxN.js';import'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';import {C,a as C1,$,V as Ve,b as at$1,S as p,q as qo,u as ue,T as id,W as qw,c as bi,Z as ZE,d as $8,X as M5,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,J as Jc,o as gI,M as MD,I as Iw,P as Pw,L as Lh,p as Fw,H as HD,n as uh,w as lh,az as jw,E as Aw,G as FD,m as mh,z as rl,O as Fu,Q as ju}from'./main-3VZRFHGG.js';var Z=i=>({count:i});function tt(i,p){i&1&&(_i(0,"p",1),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function et(i,p){if(i&1&&(_i(0,"p",2),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function it(i,p){if(i&1){let t=FD();_i(0,"button",15),mh("click",function(){Fu(t);let u=HD(2);return ju(u.cancelBatch())}),Iw(1),Pw(2,"transloco"),Jc();}if(i&2){let t=HD(2);lh("disabled",t.cancelling()),gI(),rl(" ",Fw(2,2,t.cancelling()?"batches.detail.cancelling":"batches.detail.cancel")," ");}}function nt(i,p){if(i&1&&(_i(0,"p",12),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.actionError());}}function at(i,p){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"h1",5),Iw(6),Jc(),_i(7,"p",6)(8,"nz-tag",7),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"span",8),Iw(12),Jc(),Iw(13," \xB7 "),_i(14,"span",9),Iw(15),Pw(16,"transloco"),Jc(),Iw(17," \xB7 "),_i(18,"span",10),Iw(19),Pw(20,"transloco"),Jc()()(),_D(21,it,3,4,"button",11),Jc(),_D(22,nt,2,1,"p",12),_i(23,"section",13)(24,"h2"),Iw(25),Pw(26,"transloco"),Jc(),uh(27,"app-job-status-table",14),Jc()),i&2){let t=p,e=HD();gI(3),Lh(Fw(4,12,"batches.detail.backHint")),gI(3),Lh(t.id),gI(2),lh("nzColor",e.batchStatusTagColor(t.status,e.theme.theme()))("ngClass",e.batchStatusTagClass(t.status,e.theme.theme())),gI(),Lh(Fw(10,14,e.statusKey(t.status))),gI(3),Lh(t.workflowId),gI(3),Lh(jw(16,16,"batches.detail.subjectCount",Aw(23,Z,t.resolvedSubjects.length))),gI(4),Lh(Fw(20,19,e.triggeredByKey(t.triggeredBy))),gI(2),MD(t.status==="running"?21:-1),gI(),MD(e.actionError()?22:-1),gI(3),Lh(Fw(26,21,"batches.detail.membersHeading")),gI(2),lh("jobs",e.memberJobs());}}var ot=3e3;function v(i){return i!=="running"}var Dt=(()=>{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=y,this.batchStatusTagColor=S,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);}),id(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();e&&(e.type!=="batch_completed"&&e.type!=="batch_cancelled"||e.batchId===this.batchId&&qw(()=>{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();},ot));}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=ZE({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,"nzColor","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),_D(1,tt,3,3,"p",1)(2,et,2,1,"p",2)(3,at,28,25),Jc()),e&2){let C;gI(),MD(u.loading()?1:u.loadError()?2:(C=u.batch())?3:-1,C);}},dependencies:[$8,M5,v3,pf,bd,sp,fp,W,I,Lt,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{Dt as BatchDetailComponent};
|
package/static/chunk-BKYaECRn.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a as ae,l as le}from'./chunk-EDwdt-Wk.js';import {H as He}from'./chunk-CwEMAptL.js';import {C,$ as $$1,b0 as jn,R as J1,V as Ve,s,r as r$1,c as bi,i as ie,b2 as Le,b3 as Wn,q as qo,U as Uw,Z as ZE,d as $8,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,m as mh,I as Iw,P as Pw,J as Jc,o as gI,M as MD,w as lh,z as rl,p as Fw,G as FD,H as HD,L as Lh,O as Fu,Q as ju}from'./main-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import {a as ai,z}from'./chunk-Dm_EWkUz.js';function M(e){return e.inputSchema.filter(a=>a.required)}function A(e,a){return e.appliesTo!=="none"&&!a.subjectId?.trim()}function Y(e,a){return A(e,a)||M(e).length>0}function x(e,a){return e.appliesTo==="none"?void 0:a.subjectId?.trim()||void 0}function et(e,a){if(e&1){let t=FD();_i(0,"label",1)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"input",7),Pw(5,"transloco"),mh("input",function(o){Fu(t);let n=HD();return ju(n.setSubjectId(o))}),Jc()();}if(e&2){let t=HD();gI(2),Lh(Fw(3,3,"jobs.start.subjectId")),gI(2),lh("value",t.subjectId())("placeholder",Fw(5,5,"jobs.start.subjectIdPlaceholder"));}}function it(e,a){if(e&1){let t=FD();_i(0,"app-workflow-input-form",8),mh("valuesChange",function(o){Fu(t);let n=HD();return ju(n.inputValues.set(o))}),Jc();}if(e&2){let t=HD();lh("fields",t.requiredFields())("values",t.inputValues());}}function ot(e,a){if(e&1&&(_i(0,"p",3),Iw(1),Jc()),e&2){let t=HD();gI(),Lh(t.actionError());}}var $=(()=>{class e{constructor(){this.jobsApi=C($$1),this.router=C(J1),this.transloco=C(Ve),this.modalRef=C(Le),this.data=C(Wn),this.subjectId=qo(this.data.subjectId??""),this.inputValues=qo(ae(M(this.data.workflow))),this.starting=qo(false),this.actionError=qo(null),this.showSubjectPicker=Uw(()=>A(this.data.workflow,this.context())),this.requiredFields=Uw(()=>M(this.data.workflow));}setSubjectId(t){this.subjectId.set(t.target.value);}start(){let t=this.data.workflow;if(this.showSubjectPicker()&&!this.subjectId().trim()){this.actionError.set(this.transloco.translate("jobs.errors.subjectIdRequired"));return}let i={workflowId:t.id,subjectId:this.subjectId().trim()||this.data.subjectId},o=x(t,i);this.actionError.set(null),this.starting.set(true),this.jobsApi.start(s(r$1({workflowId:t.id},o?{subjectId:o}:{}),{inputValues:r$1({},this.inputValues())})).subscribe({next:n=>{this.starting.set(false),this.modalRef.close(),this.router.navigate(["/jobs",n.id]);},error:n=>{this.starting.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.startFailed")));}});}cancel(){this.modalRef.close();}context(){return {workflowId:this.data.workflow.id,subjectId:this.data.subjectId}}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-start-job-modal"]],decls:11,vars:12,consts:[["data-testid","start-job-modal"],[1,"field"],[3,"fields","values"],["data-testid","action-error",1,"error"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","start-job-cancel",3,"click","disabled"],["nz-button","","nzType","primary","type","button","data-testid","start-button",3,"click","nzLoading","disabled"],["nz-input","","data-testid","subject-id","type","text",3,"input","value","placeholder"],[3,"valuesChange","fields","values"]],template:function(i,o){i&1&&(_i(0,"div",0),_D(1,et,6,7,"label",1),_D(2,it,1,2,"app-workflow-input-form",2),_D(3,ot,2,1,"p",3),_i(4,"div",4)(5,"button",5),mh("click",function(){return o.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",6),mh("click",function(){return o.start()}),Iw(9),Pw(10,"transloco"),Jc()()()),i&2&&(gI(),MD(o.showSubjectPicker()?1:-1),gI(),MD(o.requiredFields().length>0?2:-1),gI(),MD(o.actionError()?3:-1),gI(2),lh("disabled",o.starting()),gI(),rl(" ",Fw(7,8,"common.cancel")," "),gI(2),lh("nzLoading",o.starting())("disabled",o.starting()),gI(),rl(" ",Fw(10,10,o.starting()?"jobs.start.starting":"jobs.start.button")," "));},dependencies:[$8,pf,bd,sp,fp,ai,z,le,Kt],styles:[".field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:0 0 1rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239;margin:0 0 1rem}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem;margin-top:.5rem}"]});}}return e})();var At=(()=>{class e{constructor(){this.workflowsApi=C(b),this.jobsApi=C($$1),this.modal=C(jn),this.router=C(J1),this.transloco=C(Ve),this.message=C(He);}start(t){this.workflowsApi.get(t.workflowId).subscribe({next:i=>{if(!Y(i,t)){this.launch(i,t,{});return}this.modal.create({nzTitle:this.transloco.translate("jobs.start.heading"),nzContent:$,nzData:{workflow:i,subjectId:t.subjectId},nzFooter:null});},error:i=>{this.message.error(this.errorMessage(i,this.transloco.translate("jobs.errors.loadWorkflows")));}});}launch(t,i,o){let n=x(t,i);this.jobsApi.start(s(r$1({workflowId:t.id},n?{subjectId:n}:{}),{inputValues:o})).subscribe({next:k=>{this.router.navigate(["/jobs",k.id]);},error:k=>{this.message.error(this.errorMessage(k,this.transloco.translate("jobs.errors.startFailed")));}});}errorMessage(t,i){return t instanceof bi||t instanceof Error?t.message:i}static{this.\u0275fac=function(i){return new(i||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();export{At as A};
|
package/static/chunk-BLN4QkSi.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {A as At}from'./chunk-BKYaECRn.js';import'./chunk-EDwdt-Wk.js';import {l}from'./chunk-D19C8Gcb.js';import {I,_,b as b$1,v,T,y,h,E,P,A,j}from'./chunk-SiaN7xSQ.js';import {w,F,L}from'./chunk-IjKs-6Cl.js';import {H as He}from'./chunk-CwEMAptL.js';import {z as ze,S as St}from'./chunk-BRAytoQl.js';import {f}from'./chunk--EZIkevK.js';import {o as ot$2}from'./chunk-Det50scT.js';import'./chunk-vINo5yVD.js';import {f as f$1}from'./chunk-BIJScqTM.js';import {C,a as C1,R as J1,b as at,V as Ve,bo as O,bp as de,ba as Se,q as qo$1,U as Uw,u as ue,s,r as r$1,c as bi$1,Z as ZE,d as $8,e as al,bb as er$1,f as rl,g as $i$1,v as v3,Y 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$1,I as Iw,J as Jc,P as Pw,l as _D,m as mh,o as gI,L as Lh,p as Fw,M as MD,w as lh,z as rl$1,b0 as jn$1,a5 as q0,a6 as U0,T as id,t as t$1,bq as Ja,b1 as ts,x as xD,D as ch,B as AD,G as FD,H as HD,k as iE,N as ND,aO as SD,y as aE,a7 as KE,a8 as fu,aE as J0,av as K0,br as pn,bs as G0,bf as _r$1,bt as Ee,bg as Ci$1,ab as Oe,bu as ml,aD as Nr,bh as Bt,bv as pl,bw as Gw,bx as z0,by as Qr,bz as tl,bA as kr,bB as Xf,W as qw,bC as il,a3 as Ah,a4 as Th,bD as hl,au as w5,aj as $D,aw as rh,aT as Vw,bj as Nw,bk as St$1,bE as fn,bl as wo$1,bF as oD,bG as ir$1,aG as lw,bH as wh,bI as zD,bJ as Dh,bK as W0,bm as Xc,bL as yh,bn as el,al as Sh,n as uh,az as jw,E as Aw,aH as QD,O as Fu,Q as ju,bM as Hh,bN as Vh,ak as UD,aL as Fh,aR as xw,bO as Tw}from'./main-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import {N as Nt,K as Ke}from'./chunk-C7P7hUiX.js';import {G as Gn$1,u as un}from'./chunk-bSS_wejP.js';import {a as ai$1,z,o as ot$1,b as at$1,i as it$1,r as rt}from'./chunk-Dm_EWkUz.js';import {W,I as I$1}from'./chunk-Bok52e_k.js';import {w as w_,A as Ad,c as c_,i as ig,a as im,G as G_,n as nm,J as J_,F as F_,z as zg,U as Uu,j as j_}from'./chunk-8ezEUcxN.js';import {L as Lt,u as ut}from'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';var Dn=["input"],Ln=["inputNumberHost"],On=[[["","nzInputAddonBefore",""]],[["","nzInputAddonAfter",""]],[["","nzInputPrefix",""]],[["","nzInputSuffix",""]],[["","nzInputNumberUpIcon",""]],[["","nzInputNumberDownIcon",""]]],Wn=["[nzInputAddonBefore]","[nzInputAddonAfter]","[nzInputPrefix]","[nzInputSuffix]","[nzInputNumberUpIcon]","[nzInputNumberDownIcon]"];function jn(i,l){}function Rn(i,l){if(i&1&&rh(0,jn,0,0,"ng-template",8),i&2){HD();let e=QD(4);lh("ngTemplateOutlet",e);}}function Kn(i,l){}function Hn(i,l){if(i&1&&rh(0,Kn,0,0,"ng-template",8),i&2){HD();let e=QD(8);lh("ngTemplateOutlet",e);}}function qn(i,l){}function Gn(i,l){if(i&1&&rh(0,qn,0,0,"ng-template",8),i&2){HD();let e=QD(12);lh("ngTemplateOutlet",e);}}function Un(i,l){if(i&1&&Iw(0),i&2){let e=HD(3);Lh(e.nzAddonBefore());}}function Jn(i,l){i&1&&(_i$1(0,"div",10),UD(1,0,null,Un,1,1),Jc());}function Zn(i,l){}function Qn(i,l){if(i&1&&rh(0,Zn,0,0,"ng-template",8),i&2){HD(2);let e=QD(6);lh("ngTemplateOutlet",e);}}function Yn(i,l){}function Xn(i,l){if(i&1&&rh(0,Yn,0,0,"ng-template",8),i&2){HD(2);let e=QD(10);lh("ngTemplateOutlet",e);}}function ei(i,l){if(i&1&&Iw(0),i&2){let e=HD(3);Lh(e.nzAddonAfter());}}function ti(i,l){i&1&&(_i$1(0,"div",10),UD(1,1,null,ei,1,1),Jc());}function ni(i,l){if(i&1&&(_i$1(0,"div",9),_D(1,Jn,3,0,"div",10),_D(2,Qn,1,1,null,8)(3,Xn,1,1,null,8),_D(4,ti,3,0,"div",10),Jc()),i&2){let e=HD();gI(),MD(e.hasAddonBefore()?1:-1),gI(),MD(e.hasAffix()?2:3),gI(2),MD(e.hasAddonAfter()?4:-1);}}function ii(i,l){}function oi(i,l){if(i&1&&(_i$1(0,"div"),rh(1,ii,0,0,"ng-template",8),Jc()),i&2){let e=HD(),t=QD(8);lw(e.affixWrapperClass()),gI(),lh("ngTemplateOutlet",t);}}function ri(i,l){if(i&1&&Iw(0),i&2){let e=HD(3);Lh(e.nzPrefix());}}function ai(i,l){i&1&&(_i$1(0,"span",11),UD(1,2,null,ri,1,1),Jc());}function si(i,l){}function li(i,l){if(i&1&&Iw(0),i&2){let e=HD(3);Lh(e.nzSuffix());}}function pi(i,l){if(i&1&&uh(0,"nz-form-item-feedback-icon",13),i&2){let e=HD(3);lh("status",e.finalStatus());}}function di(i,l){if(i&1&&(_i$1(0,"span",12),UD(1,3,null,li,1,1),_D(3,pi,1,1,"nz-form-item-feedback-icon",13),Jc()),i&2){let e=HD(2);gI(3),MD(e.hasFeedback()&&e.finalStatus()?3:-1);}}function ci(i,l){if(i&1&&(_D(0,ai,3,0,"span",11),rh(1,si,0,0,"ng-template",8),_D(2,di,4,1,"span",12)),i&2){let e=HD(),t=QD(10);MD(e.hasPrefix()?0:-1),gI(),lh("ngTemplateOutlet",t),gI(),MD(e.hasSuffix()?2:-1);}}function _i(i,l){}function mi(i,l){if(i&1&&(_i$1(0,"div",null,5),rh(2,_i,0,0,"ng-template",8),Jc()),i&2){let e=HD(),t=QD(12);lw(e.inputNumberClass()),gI(2),lh("ngTemplateOutlet",t);}}function ui(i,l){i&1&&uh(0,"nz-icon",20);}function Ci(i,l){i&1&&uh(0,"nz-icon",21);}function xi(i,l){if(i&1){let e=FD();_i$1(0,"div",17,7),mh("mouseup",function(){Fu(e);let n=HD(2);return ju(n.stopAutoStep())})("mouseleave",function(){Fu(e);let n=HD(2);return ju(n.stopAutoStep())}),_i$1(2,"span",18),mh("mousedown",function(n){Fu(e);let o=HD(2);return ju(o.onStepMouseDown(n,true))}),UD(3,4,null,ui,1,0),Jc(),_i$1(5,"span",19),mh("mousedown",function(n){Fu(e);let o=HD(2);return ju(o.onStepMouseDown(n,false))}),UD(6,5,null,Ci,1,0),Jc()();}if(i&2){let e=HD(2);gI(2),Sh("ant-input-number-handler-up-disabled",e.upDisabled()),ch("aria-disabled",e.upDisabled()),gI(3),Sh("ant-input-number-handler-down-disabled",e.downDisabled()),ch("aria-disabled",e.downDisabled());}}function fi(i,l){if(i&1){let e=FD();_D(0,xi,8,6,"div",14),_i$1(1,"div",15)(2,"input",16,6),mh("input",function(){Fu(e);let n=QD(3),o=HD();return ju(o.onInput(n.value))})("wheel",function(n){Fu(e);let o=HD();return ju(o.onWheel(n))}),Jc()();}if(i&2){let e=HD();MD(e.nzControls()?0:-1),gI(2),lh("value",e.displayValue())("placeholder",e.nzPlaceHolder()??"")("disabled",e.finalDisabled())("readOnly",e.nzReadOnly()),ch("aria-valuemin",e.nzMin())("aria-valuemax",e.nzMax())("id",e.nzId())("step",e.nzStep())("value",e.displayValue());}}var ot=(()=>{class i{nzId=q0(null);nzSize=q0("default");nzPlaceHolder=q0(null);nzStatus=q0("");nzVariant=q0();nzStep=q0(1,{transform:J0});nzMin=q0(Number.MIN_SAFE_INTEGER,{transform:J0});nzMax=q0(Number.MAX_SAFE_INTEGER,{transform:J0});nzPrecision=q0(null);nzParser=q0();nzFormatter=q0();nzDisabled=q0(false,{transform:K0});nzReadOnly=q0(false,{transform:K0});nzAutoFocus=q0(false,{transform:K0});nzKeyboard=q0(true,{transform:K0});nzControls=q0(true,{transform:K0});nzChangeOnWheel=q0(true,{transform:K0});nzPrefix=q0();nzSuffix=q0();nzAddonBefore=q0();nzAddonAfter=q0();nzBlur=U0();nzFocus=U0();nzOnStep=U0();onChange=()=>{};onTouched=()=>{};isDisabledFirstChange=true;compactSize=C(pn,{optional:true});inputRef=G0.required("input");hostRef=G0("inputNumberHost");elementRef=C(_r$1);injector=C(Ee);focusMonitor=C(Ci$1);directionality=C(Oe);nzFormStatusService=C(ml,{optional:true});autoStepTimer=null;defaultFormatter=e=>{let t=this.nzPrecision();return Nr(t)?e.toFixed(t):e.toString()};value=qo$1(null);displayValue=qo$1("");formSize=C(Bt,{optional:true});formVariant=C(pl,{optional:true});dir=C(Oe).valueSignal;focused=qo$1(false);hasFeedback=qo$1(false);finalStatus=Gw(()=>this.nzStatus());finalDisabled=Gw(()=>this.nzDisabled());prefix=z0(ot$1);suffix=z0(at$1);addonBefore=z0(it$1);addonAfter=z0(rt);hasPrefix=Uw(()=>!!this.nzPrefix()||!!this.prefix());hasSuffix=Uw(()=>!!this.nzSuffix()||!!this.suffix()||this.hasFeedback());hasAffix=Uw(()=>this.hasPrefix()||this.hasSuffix());hasAddonBefore=Uw(()=>!!this.nzAddonBefore()||!!this.addonBefore());hasAddonAfter=Uw(()=>!!this.nzAddonAfter()||!!this.addonAfter());hasAddon=Uw(()=>this.hasAddonBefore()||this.hasAddonAfter());class=Uw(()=>this.hasAddon()?this.groupWrapperClass():this.hasAffix()?this.affixWrapperClass():this.inputNumberClass());inputNumberClass=Uw(()=>r$1(r$1({"ant-input-number":true,"ant-input-number-lg":this.finalSize()==="large","ant-input-number-sm":this.finalSize()==="small","ant-input-number-disabled":this.finalDisabled(),"ant-input-number-readonly":this.nzReadOnly(),"ant-input-number-focused":this.focused(),"ant-input-number-rtl":this.dir()==="rtl","ant-input-number-in-form-item":!!this.nzFormStatusService,"ant-input-number-out-of-range":this.value()!==null&&!it(this.value(),this.nzMin(),this.nzMax())},tl("ant-input-number",this.finalVariant())),Qr("ant-input-number",this.finalStatus(),this.hasFeedback())));affixWrapperClass=Uw(()=>r$1(r$1({"ant-input-number-affix-wrapper":true,"ant-input-number-affix-wrapper-disabled":this.finalDisabled(),"ant-input-number-affix-wrapper-readonly":this.nzReadOnly(),"ant-input-number-affix-wrapper-focused":this.focused(),"ant-input-number-affix-wrapper-rtl":this.dir()==="rtl"},Qr("ant-input-number-affix-wrapper",this.finalStatus(),this.hasFeedback())),tl("ant-input-number-affix-wrapper",this.finalVariant())));groupWrapperClass=Uw(()=>r$1(r$1({"ant-input-number-group-wrapper":true,"ant-input-number-group-wrapper-rtl":this.dir()==="rtl"},Qr("ant-input-number-group-wrapper",this.finalStatus(),this.hasFeedback())),tl("ant-input-number-group-wrapper",this.finalVariant())));finalSize=Uw(()=>this.formSize?.()?this.formSize():this.compactSize?this.compactSize():this.nzSize());finalVariant=Uw(()=>this.nzVariant()||this.formVariant?.()||"outlined");upDisabled=Uw(()=>!kr(this.value())&&this.value()>=this.nzMax());downDisabled=Uw(()=>!kr(this.value())&&this.value()<=this.nzMin());constructor(){let e=C(at);Xf(()=>{let t=this.hostRef(),n=t||this.elementRef;this.focusMonitor.monitor(n,true).pipe(ue(e)).subscribe(o=>{qw(()=>{this.focused.set(!!o),o?this.nzFocus.emit():(this.fixValue(),this.onTouched(),this.nzBlur.emit());});}),e.onDestroy(()=>{this.focusMonitor.stopMonitoring(n);});}),this.nzFormStatusService?.formStatusChanges.pipe(ue()).subscribe(({status:t,hasFeedback:n})=>{this.finalStatus.set(t),this.hasFeedback.set(n);});}ngOnInit(){this.nzAutoFocus()&&Xf(()=>this.focus(),{injector:this.injector});}writeValue(e){kr(e)&&(e=null),qw(()=>{this.value.set(e),this.setValue(e);});}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){qw(()=>{this.finalDisabled.set(this.isDisabledFirstChange&&this.nzDisabled()||e);}),this.isDisabledFirstChange=false;}focus(e){il(this.inputRef().nativeElement,e);}blur(){this.inputRef().nativeElement.blur();}step(e,t,n){if(t&&this.upDisabled()||!t&&this.downDisabled())return;let o=e.shiftKey?this.nzStep()*10:this.nzStep();t||(o=-o);let T=10**vn(o),J=bn((Math.round((this.value()||0)*T)+Math.round(o*T))/T,this.nzMin(),this.nzMax(),this.nzPrecision());this.setValue(J),this.nzOnStep.emit({type:t?"up":"down",value:this.value(),offset:this.nzStep(),emitter:n}),this.focus();}setValue(e){let t=this.nzFormatter()??this.defaultFormatter,n=this.nzPrecision();Nr(n)&&(e&&=+e.toFixed(n));let o=kr(e)?"":t(e);this.displayValue.set(o),this.updateValue(e);}setValueByTyping(e){if(this.displayValue.set(e),e===""){this.updateValue(null);return}let n=(this.nzParser()??hn)(e);if(bi(e)||Number.isNaN(n))return;let o=this.nzFormatter();if(o){let d=o(n);this.displayValue.set(d);}it(n,this.nzMin(),this.nzMax())&&this.updateValue(n);}updateValue(e){this.value()!==e&&(this.value.set(e),this.onChange(e));}fixValue(){let e=this.displayValue();if(e==="")return;let n=(this.nzParser()??hn)(e);if(Number.isNaN(n))n=this.value();else {let o=this.nzPrecision();Nr(o)&&vn(n)!==o&&(n=+n.toFixed(o)),it(n,this.nzMin(),this.nzMax())||(n=bn(n,this.nzMin(),this.nzMax(),o));}this.setValue(n);}stopAutoStep(){this.autoStepTimer!==null&&(clearTimeout(this.autoStepTimer),this.autoStepTimer=null);}onStepMouseDown(e,t){e.preventDefault(),this.stopAutoStep(),this.step(e,t,"handler");let n=()=>{this.step(e,t,"handler"),this.autoStepTimer=setTimeout(n,gi);};this.autoStepTimer=setTimeout(n,hi);}onKeyDown(e){switch(e.keyCode){case 38:e.preventDefault(),this.nzKeyboard()&&this.step(e,true,"keyboard");break;case 40:e.preventDefault(),this.nzKeyboard()&&this.step(e,false,"keyboard");break;case 13:this.fixValue();break}}onInput(e){this.setValueByTyping(e);}onWheel(e){this.finalDisabled()||this.nzReadOnly()||!this.nzChangeOnWheel()||(e.preventDefault(),this.step(e,e.deltaY<0,"wheel"));}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ZE({type:i,selectors:[["nz-input-number"]],contentQueries:function(t,n,o){t&1&&Dh(o,n.prefix,ot$1,5)(o,n.suffix,at$1,5)(o,n.addonBefore,it$1,5)(o,n.addonAfter,rt,5),t&2&&zD(4);},viewQuery:function(t,n){t&1&&wh(n.inputRef,Dn,5)(n.hostRef,Ln,5),t&2&&zD(2);},hostVars:2,hostBindings:function(t,n){t&1&&mh("keydown",function(d){return n.onKeyDown(d)}),t&2&&lw(n.class());},inputs:{nzId:[1,"nzId"],nzSize:[1,"nzSize"],nzPlaceHolder:[1,"nzPlaceHolder"],nzStatus:[1,"nzStatus"],nzVariant:[1,"nzVariant"],nzStep:[1,"nzStep"],nzMin:[1,"nzMin"],nzMax:[1,"nzMax"],nzPrecision:[1,"nzPrecision"],nzParser:[1,"nzParser"],nzFormatter:[1,"nzFormatter"],nzDisabled:[1,"nzDisabled"],nzReadOnly:[1,"nzReadOnly"],nzAutoFocus:[1,"nzAutoFocus"],nzKeyboard:[1,"nzKeyboard"],nzControls:[1,"nzControls"],nzChangeOnWheel:[1,"nzChangeOnWheel"],nzPrefix:[1,"nzPrefix"],nzSuffix:[1,"nzSuffix"],nzAddonBefore:[1,"nzAddonBefore"],nzAddonAfter:[1,"nzAddonAfter"]},outputs:{nzBlur:"nzBlur",nzFocus:"nzFocus",nzOnStep:"nzOnStep"},exportAs:["nzInputNumber"],features:[Nw([{provide:St$1,useExisting:wo$1(()=>i),multi:true},{provide:fn,useValue:"input-number"}]),oD([ir$1])],ngContentSelectors:Wn,decls:13,vars:1,consts:[["inputNumberWithAddonInner",""],["inputNumberWithAffix",""],["inputNumberWithAffixInner",""],["inputNumber",""],["inputNumberInner",""],["inputNumberHost",""],["input",""],["handlers",""],[3,"ngTemplateOutlet"],[1,"ant-input-number-wrapper","ant-input-number-group"],[1,"ant-input-number-group-addon"],[1,"ant-input-number-prefix"],[1,"ant-input-number-suffix"],[3,"status"],[1,"ant-input-number-handler-wrap"],[1,"ant-input-number-input-wrap"],["autocomplete","off","role","spinbutton",1,"ant-input-number-input",3,"input","wheel","value","placeholder","disabled","readOnly"],[1,"ant-input-number-handler-wrap",3,"mouseup","mouseleave"],["role","button","unselectable","on",1,"ant-input-number-handler","ant-input-number-handler-up",3,"mousedown"],["role","button","unselectable","on",1,"ant-input-number-handler","ant-input-number-handler-down",3,"mousedown"],["nzType","up",1,"ant-input-number-handler-up-inner"],["nzType","down",1,"ant-input-number-handler-down-inner"]],template:function(t,n){t&1&&($D(On),_D(0,Rn,1,1,null,8)(1,Hn,1,1,null,8)(2,Gn,1,1,null,8),rh(3,ni,5,3,"ng-template",null,0,Vw)(5,oi,2,3,"ng-template",null,1,Vw)(7,ci,3,3,"ng-template",null,2,Vw)(9,mi,3,3,"ng-template",null,3,Vw)(11,fi,4,10,"ng-template",null,4,Vw)),t&2&&MD(n.hasAddon()?0:n.hasAffix()?1:2);},dependencies:[Ah,Th,hl,w5],encapsulation:2})}return i})(),gi=200,hi=600;function hn(i){let l=i.trim().replace(/,/g,"").replace(/。/g,".");return l.length?+l:NaN}function it(i,l,e){return i>=l&&i<=e}function bn(i,l,e,t=null){if(t===null)return i<l?l:i>e?e:i;let n=+i.toFixed(t),o=Math.pow(10,t);return n<l?Math.ceil(l*o)/o:n>e?Math.floor(e*o)/o:n}function vn(i){return i.toString().split(".")[1]?.length||0}function bi(i){return /[.。](\d*0)?$/.test(i.toString())}var wn=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=KE({type:i});static \u0275inj=fu({imports:[ot]})}return i})();var wi=(i,l)=>l.id;function Si(i,l){if(i&1&&uh(0,"nz-option",2),i&2){let e=l.$implicit;lh("nzValue",e.id)("nzLabel",e.name);}}var Sn=(()=>{class i{constructor(){this.reposApi=C(f$1),this.destroyRef=C(at),this.path=W0(""),this.repoSelected=U0(),this.repos=qo$1([]),this.selectedCatalogId=Uw(()=>{let e=this.path();return this.repos().find(t=>t.localPath===e)?.id??null}),this.reposApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.repos.set(e),error:()=>this.repos.set([])});}onCatalogSelect(e){if(!e)return;let t=this.repos().find(n=>n.id===e);t&&this.repoSelected.emit(t);}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-repo-path-picker"]],inputs:{path:[1,"path"]},outputs:{path:"pathChange",repoSelected:"repoSelected"},decls:7,vars:8,consts:[["data-testid","repo-path-picker",1,"repo-path-picker"],["data-testid","repo-path-catalog",1,"catalog",3,"ngModelChange","ngModel","nzPlaceHolder"],[3,"nzValue","nzLabel"],["mode","directories",3,"pathChange","path","browseLabel"]],template:function(t,n){t&1&&(_i$1(0,"div",0)(1,"nz-select",1),Pw(2,"transloco"),mh("ngModelChange",function(d){return n.onCatalogSelect(d)}),xD(3,Si,1,2,"nz-option",2,wi),Jc(),iE(),_i$1(5,"app-path-picker",3),Pw(6,"transloco"),mh("pathChange",function(d){return n.path.set(d)}),Jc()()),t&2&&(gI(),lh("ngModel",n.selectedCatalogId())("nzPlaceHolder",Fw(2,4,"step-list.createWorktree.catalogPlaceholder")),aE(),gI(2),AD(n.repos()),gI(2),lh("path",n.path())("browseLabel",Fw(6,6,"step-list.createWorktree.browseManually")));},dependencies:[$8,al,rl,$i$1,ex,Fm,Am,ot$2,Kt],styles:["[_nghost-%COMP%]{display:block}.repo-path-picker[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.catalog[_ngcontent-%COMP%]{width:100%}"]});}}return i})();var yi=i=>({action:i}),zi=i=>({fields:i}),yn=(i,l)=>l.token,Mi=(i,l)=>l.subjectType,Ei=(i,l)=>l.id+l.name;function ki(i,l){i&1&&(Xc(0,"p",7),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.subWorkflowForEach")," "));}function Ti(i,l){if(i&1){let e=FD();Xc(0,"li")(1,"span",13),Iw(2),el(),Xc(3,"button",14),yh("click",function(){let n=Fu(e).$implicit,o=HD(3);return ju(o.copyToken(n.token))}),Iw(4),el()();}if(i&2){let e=l.$implicit,t=HD(3);gI(2),Lh(e.label),gI(),Sh("copied",t.copiedToken()===e.token),ch("data-testid","copy-token")("data-token",e.token),gI(),rl$1(" ",e.token," ");}}function Ii(i,l){if(i&1&&(Xc(0,"div",8)(1,"h5"),Iw(2),Pw(3,"transloco"),el(),Xc(4,"ul"),xD(5,Ti,5,6,"li",null,yn),el()()),i&2){let e=HD(2);gI(2),Lh(Fw(3,1,"step-list.availableParameters.inputs")),gI(3),AD(e.inputEntries());}}function Ni(i,l){if(i&1&&(Xc(0,"p",16),Iw(1),Pw(2,"transloco"),el()),i&2){let e=HD().$implicit;gI(),Lh(Fw(2,1,e.typeKey));}}function Fi(i,l){if(i&1){let e=FD();Xc(0,"li")(1,"button",14),yh("click",function(){let n=Fu(e).$implicit,o=HD(4);return ju(o.copyToken(n.token))}),Iw(2),el()();}if(i&2){let e=l.$implicit,t=HD(4);gI(),Sh("copied",t.copiedToken()===e.token),ch("data-testid","copy-token")("data-token",e.token),gI(),rl$1(" ",e.token," ");}}function Pi(i,l){if(i&1&&(_D(0,Ni,3,3,"p",16),Xc(1,"ul"),xD(2,Fi,3,5,"li",null,yn),el()),i&2){let e=l.$implicit,t=HD(3);MD(t.subjectGroups().length>1?0:-1),gI(2),AD(e.tokens);}}function Vi(i,l){if(i&1&&(Xc(0,"div",9)(1,"h5",15),Iw(2),Pw(3,"transloco"),el(),xD(4,Pi,4,1,null,null,Mi),el()),i&2){let e=HD(2);gI(2),Fh(" ",Fw(3,2,"step-list.availableParameters.subject")," (",e.subjectTypeHeading(),") "),gI(2),AD(e.subjectGroups());}}function Ai(i,l){i&1&&(Xc(0,"p",11),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.noPrevious")," "));}function $i(i,l){i&1&&(Xc(0,"span",19),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.loopOverwrite")," "));}function Bi(i,l){i&1&&(Xc(0,"p",5),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),Lh(Fw(2,1,"step-list.availableParameters.missingId")));}function Di(i,l){if(i&1){let e=FD();Xc(0,"button",14),yh("click",function(){let n=Fu(e).$implicit,o=HD(5);return ju(o.copyToken(n))}),Iw(1),el();}if(i&2){let e=l.$implicit,t=HD(5);Sh("copied",t.copiedToken()===e),ch("data-testid","copy-token")("data-token",e),gI(),rl$1(" ",e," ");}}function Li(i,l){if(i&1&&(Xc(0,"div",20),xD(1,Di,2,5,"button",25,ND),el()),i&2){let e=HD().$implicit;gI(),AD(e.tokens);}}function Oi(i,l){if(i&1&&(Xc(0,"p",21),Iw(1),Pw(2,"transloco"),el()),i&2){let e=HD().$implicit;gI(),rl$1(" ",jw(2,1,"step-list.availableParameters.providerOpaque",Aw(4,yi,e.actionLabel))," ");}}function Wi(i,l){i&1&&(Xc(0,"p",21),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.interactionOpaque")," "));}function ji(i,l){if(i&1&&(Xc(0,"p",22),Iw(1),Pw(2,"transloco"),el()),i&2){let e=HD().$implicit,t=HD(3);gI(),rl$1(" ",jw(2,1,"step-list.availableParameters.arrayOf",Aw(4,zi,t.arrayFields(e)))," ");}}function Ri(i,l){i&1&&(Xc(0,"p",23),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.subjectTypeUnion")," "));}function Ki(i,l){i&1&&(Xc(0,"p",24),Iw(1),Pw(2,"transloco"),el()),i&2&&(gI(),rl$1(" ",Fw(2,1,"step-list.availableParameters.noOutput")," "));}function Hi(i,l){if(i&1&&(Xc(0,"li",17),Pw(1,"transloco"),Xc(2,"div",18)(3,"span",13),Iw(4),el(),_D(5,$i,3,3,"span",19),el(),_D(6,Bi,3,3,"p",5),_D(7,Li,3,0,"div",20),_D(8,Oi,3,6,"p",21),_D(9,Wi,3,3,"p",21),_D(10,ji,3,6,"p",22),_D(11,Ri,3,3,"p",23),_D(12,Ki,3,3,"p",24),el()),i&2){let e=l.$implicit;ch("data-testid","previous-step-"+e.id)("title",e.inLoop?Fw(1,11,"step-list.availableParameters.loopOverwrite"):null),gI(4),Lh(e.name||e.id),gI(),MD(e.inLoop?5:-1),gI(),MD(e.id?-1:6),gI(),MD(e.tokens.length>0?7:-1),gI(),MD(e.shape.opaque&&e.isProvider?8:-1),gI(),MD(e.shape.opaque&&e.isInteraction?9:-1),gI(),MD(e.shape.isArray&&(e.shape.fields?.length??0)>0?10:-1),gI(),MD(e.shape.fieldsDependOnSubjectType?11:-1),gI(),MD(!e.shape.opaque&&(e.shape.fields?.length??0)===0&&!e.shape.isScalar?12:-1);}}function qi(i,l){if(i&1&&(Xc(0,"ul",12),xD(1,Hi,13,13,"li",17,Ei),el()),i&2){let e=HD(2);gI(),AD(e.previousEntries());}}function Gi(i,l){if(i&1&&(Xc(0,"div",4)(1,"p",5),Iw(2),Pw(3,"transloco"),el(),Xc(4,"p",6),Iw(5),Pw(6,"transloco"),el(),_D(7,ki,3,3,"p",7),_D(8,Ii,7,3,"div",8),_D(9,Vi,6,4,"div",9),Xc(10,"div",10)(11,"h5"),Iw(12),Pw(13,"transloco"),el(),_D(14,Ai,3,3,"p",11)(15,qi,3,0,"ul",12),el()()),i&2){let e=HD();gI(2),Lh(Fw(3,7,"step-list.availableParameters.hint")),gI(3),rl$1(" ",Fw(6,9,"step-list.availableParameters.condition")," "),gI(2),MD(e.currentStepType()==="sub_workflow"?7:-1),gI(),MD(e.inputEntries().length>0?8:-1),gI(),MD(e.subjectGroups().length>0?9:-1),gI(3),Lh(Fw(13,11,"step-list.availableParameters.previous")),gI(2),MD(e.previousEntries().length===0?14:15);}}var zn=(()=>{class i{constructor(){this.transloco=C(Ve),this.inputSchema=q0([]),this.appliesTo=q0("none"),this.previousSteps=q0([]),this.currentStepType=q0(null),this.expanded=qo$1(false),this.copiedToken=qo$1(null),this.inputEntries=Uw(()=>this.inputSchema().map(e=>({label:e.label.trim()||e.name,name:e.name.trim()})).filter(e=>e.name.length>0).map(e=>({label:e.label,token:nm(e.name)}))),this.subjectGroups=Uw(()=>J_(this.appliesTo()).map(e=>({subjectType:e.subjectType,typeKey:`workflow-editor.subjectType.${e.subjectType}`,tokens:e.fields.map(t=>({field:t,token:nm(`subject.${t}`)}))}))),this.previousEntries=Uw(()=>this.previousSteps().map(({step:e,inLoop:t})=>{let n=e;return {name:n.name,id:n.id,inLoop:t,shape:zg(n,this.appliesTo()),tokens:F_(n,this.appliesTo()),actionLabel:Ui(n),isProvider:n.type==="provider_action",isInteraction:n.type==="interaction"}}));}toggleExpanded(){this.expanded.update(e=>!e);}subjectTypeHeading(){return this.subjectGroups().map(e=>this.transloco.translate(e.typeKey)).join(", ")}arrayFields(e){return (e.shape.fields??[]).join(", ")}copyToken(e){let t=navigator.clipboard;if(!t?.writeText){this.copiedToken.set(e);return}t.writeText(e).then(()=>this.copiedToken.set(e),()=>this.copiedToken.set(e));}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-available-parameters"]],inputs:{inputSchema:[1,"inputSchema"],appliesTo:[1,"appliesTo"],previousSteps:[1,"previousSteps"],currentStepType:[1,"currentStepType"]},decls:8,vars:8,consts:[["data-testid","available-parameters",1,"available-parameters"],["type","button","data-testid","available-parameters-toggle",1,"panel-toggle",3,"click"],["aria-hidden","true",1,"chevron"],[1,"panel-title"],["data-testid","available-parameters-body",1,"panel-body"],[1,"hint"],["data-testid","step-condition-note",1,"hint"],["data-testid","sub-workflow-foreach-note",1,"hint"],["data-testid","available-parameters-inputs",1,"group"],["data-testid","available-parameters-subject",1,"group"],["data-testid","available-parameters-previous",1,"group"],["data-testid","available-parameters-no-previous",1,"hint"],[1,"previous-list"],[1,"entry-label"],["type","button",1,"param-token",3,"click"],["data-testid","available-parameters-subject-heading"],[1,"subject-type"],[1,"previous-entry"],[1,"previous-heading"],["data-testid","loop-overwrite-note",1,"loop-note"],[1,"token-row"],["data-testid","opaque-note",1,"hint"],["data-testid","array-note",1,"hint"],["data-testid","subject-type-union-note",1,"hint"],["data-testid","no-output-note",1,"hint"],["type","button",1,"param-token",3,"copied"]],template:function(t,n){t&1&&(Xc(0,"section",0)(1,"button",1),yh("click",function(){return n.toggleExpanded()}),Xc(2,"span",2),Iw(3),el(),Xc(4,"span",3),Iw(5),Pw(6,"transloco"),el()(),_D(7,Gi,16,13,"div",4),el()),t&2&&(Sh("expanded",n.expanded()),gI(),ch("aria-expanded",n.expanded()),gI(2),Lh(n.expanded()?"\u25BE":"\u25B8"),gI(2),Lh(Fw(6,6,"step-list.availableParameters.title")),gI(2),MD(n.expanded()?7:-1));},dependencies:[Kt],styles:[".available-parameters[_ngcontent-%COMP%]{margin:.85rem 0 .25rem;padding:.35rem .65rem;border:1px solid #e7e5e4;border-radius:.5rem;background:#fafaf9}.available-parameters.expanded[_ngcontent-%COMP%]{padding:.65rem .75rem .75rem}.panel-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.4rem;width:100%;margin:0;padding:.2rem 0;border:0;background:transparent;cursor:pointer;text-align:left;color:inherit}.chevron[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem;width:.9rem}.available-parameters[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{margin:0 0 .35rem}.panel-title[_ngcontent-%COMP%]{font-size:.95rem;font-weight:600}.panel-body[_ngcontent-%COMP%]{margin-top:.5rem}.available-parameters[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{font-size:.8rem;text-transform:uppercase;letter-spacing:.03em;color:#57534e}.hint[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:.8rem;color:#78716c}.group[_ngcontent-%COMP%]{margin-top:.65rem}.group[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.35rem .5rem}.previous-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem}.previous-entry[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.3rem}.previous-heading[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem .65rem;align-items:baseline}.entry-label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:600;color:#44403c}.loop-note[_ngcontent-%COMP%]{font-size:.75rem;color:#78716c}.subject-type[_ngcontent-%COMP%]{margin:.35rem 0 .2rem;font-size:.8rem;color:#57534e}.token-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem}.param-token[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.75rem;line-height:1.2;padding:.15rem .45rem;border:1px solid #d6d3d1;border-radius:.3rem;background:#fff;color:#1c1917;cursor:pointer}.param-token[_ngcontent-%COMP%]:hover{border-color:#a8a29e}.param-token.copied[_ngcontent-%COMP%]{border-color:#57534e;background:#e7e5e4}"]});}}return i})();function Ui(i){return i.type!=="provider_action"?"":i.extendedAction?.actionId??i.action}function Ji(i,l){if(i&1&&(uh(0,"nz-option",3),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD();lh("nzValue",e)("nzLabel",Fw(1,2,t.typeKey(e)));}}function Zi(i,l){if(i&1){let e=FD();_i$1(0,"label",1)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"input",4),mh("ngModelChange",function(n){Fu(e);let o=HD();return ju(o.setValue(n))}),Jc(),iE(),Jc();}if(i&2){let e=HD();gI(2),Lh(Fw(3,3,"step-list.fieldCondition.value")),gI(2),lh("ngModel",e.valueText()),ch("data-testid",e.testIdPrefix()+"-value"),aE();}}var Qi=["field_empty","field_equals"],Mn=(()=>{class i{constructor(){this.condition=q0.required(),this.testIdPrefix=q0("field-condition"),this.conditionChange=U0(),this.conditionTypes=Qi;}typeKey(e){return `step-list.untilType.${e}`}valueText(){let e=this.condition();return e.type!=="field_equals"?"":Xi(e.value)}setType(e){let t=this.condition();if(e==="field_empty"){this.conditionChange.emit({type:e,stepId:t.stepId,field:t.field});return}let n=t.type==="field_equals"?t.value:"";this.conditionChange.emit({type:e,stepId:t.stepId,field:t.field,value:n});}setField(e,t){this.conditionChange.emit(s(r$1({},this.condition()),{[e]:t}));}setValue(e){let t=this.condition();t.type==="field_equals"&&this.conditionChange.emit(s(r$1({},t),{value:Yi(e)}));}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-field-condition-editor"]],inputs:{condition:[1,"condition"],testIdPrefix:[1,"testIdPrefix"]},outputs:{conditionChange:"conditionChange"},decls:19,vars:17,consts:[[1,"field-grid"],[1,"field"],[3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["nz-input","",3,"ngModelChange","ngModel"]],template:function(t,n){t&1&&(_i$1(0,"div",0)(1,"div",1)(2,"span"),Iw(3),Pw(4,"transloco"),Jc(),_i$1(5,"nz-select",2),mh("ngModelChange",function(d){return n.setType(d)}),xD(6,Ji,2,4,"nz-option",3,ND),Jc(),iE(),Jc(),_i$1(8,"label",1)(9,"span"),Iw(10),Pw(11,"transloco"),Jc(),_i$1(12,"input",4),mh("ngModelChange",function(d){return n.setField("stepId",d)}),Jc(),iE(),Jc(),_i$1(13,"label",1)(14,"span"),Iw(15),Pw(16,"transloco"),Jc(),_i$1(17,"input",4),mh("ngModelChange",function(d){return n.setField("field",d)}),Jc(),iE(),Jc(),_D(18,Zi,5,5,"label",1),Jc()),t&2&&(ch("data-testid",n.testIdPrefix()),gI(3),Lh(Fw(4,11,"step-list.fieldCondition.type")),gI(2),lh("ngModel",n.condition().type),ch("data-testid",n.testIdPrefix()+"-type"),aE(),gI(),AD(n.conditionTypes),gI(4),Lh(Fw(11,13,"step-list.fieldCondition.stepId")),gI(2),lh("ngModel",n.condition().stepId),ch("data-testid",n.testIdPrefix()+"-stepId"),aE(),gI(3),Lh(Fw(16,15,"step-list.fieldCondition.field")),gI(2),lh("ngModel",n.condition().field),ch("data-testid",n.testIdPrefix()+"-field"),aE(),gI(),MD(n.condition().type==="field_equals"?18:-1));},dependencies:[al,er$1,rl,$i$1,ai$1,z,ex,Fm,Am,Kt],styles:[".field-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));gap:.5rem 1rem}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.65rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}"]});}}return i})();function En(){return {type:"field_empty",stepId:"",field:""}}function Yi(i){let l=i.trim();if(l==="")return "";try{return JSON.parse(l)}catch(e){return i}}function Xi(i){if(i===void 0)return "";if(typeof i=="string")try{return JSON.parse(i),JSON.stringify(i)}catch(l){return i}return JSON.stringify(i)}function eo(i,l){if(i&1){let e=FD();_i$1(0,"div",1)(1,"input",3),Hh("ngModelChange",function(n){let o=Fu(e).$implicit;return Tw(o.key,n)||(o.key=n),ju(n)}),mh("ngModelChange",function(){Fu(e);let n=HD();return ju(n.emitRows())}),Jc(),iE(),_i$1(2,"input",4),Hh("ngModelChange",function(n){let o=Fu(e).$implicit;return Tw(o.value,n)||(o.value=n),ju(n)}),mh("ngModelChange",function(){Fu(e);let n=HD();return ju(n.emitRows())}),Jc(),iE(),_i$1(3,"button",5),mh("click",function(){let n=Fu(e).$index,o=HD();return ju(o.remove(n))}),Iw(4,"Remove"),Jc()();}if(i&2){let e=l.$implicit;gI(),Vh("ngModel",e.key),aE(),gI(),Vh("ngModel",e.value),aE();}}var Nn=(()=>{class i{constructor(){this.rows=W0.required();}add(){this.rows.update(e=>[...e,{key:"",value:""}]);}remove(e){this.rows.update(t=>t.filter((n,o)=>o!==e));}emitRows(){this.rows.set(this.rows().map(e=>r$1({},e)));}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-key-value-editor"]],inputs:{rows:[1,"rows"]},outputs:{rows:"rowsChange"},decls:5,vars:0,consts:[[1,"kv-editor"],[1,"kv-row"],["nz-button","","nzType","dashed","type","button",3,"click"],["nz-input","","placeholder","key",3,"ngModelChange","ngModel"],["nz-input","","placeholder","value",3,"ngModelChange","ngModel"],["nz-button","","nzType","default","type","button",3,"click"]],template:function(t,n){t&1&&(_i$1(0,"div",0),xD(1,eo,5,2,"div",1,SD),_i$1(3,"button",2),mh("click",function(){return n.add()}),Iw(4,"Add param"),Jc()()),t&2&&(gI(),AD(n.rows()));},dependencies:[al,er$1,rl,$i$1,pf,bd,sp,fp,ai$1,z],styles:[".kv-editor[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.kv-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr auto;gap:.5rem;align-items:center}"]});}}return i})();function $e(i,l){let e=Uu(i);return L(l,e).map(t=>t.id)}function Pn(i,l){return $e(i,l)[0]??""}function Fn(i,l,e){let t=$e(l,e);if(t.includes(i))return null;let n=(e?.providerInstances??[]).find(o=>o.id===i);return n?j_(n)&&Uu(l).includes(n.subjectType)?null:{required:i,active:t[0]??n.id}:{required:i,active:t[0]??""}}function Vn(i,l,e){if(i.extendedAction?.providerId){let t=Fn(i.extendedAction.providerId,l,e);if(t)return t}return i.target?.source?Fn(i.target.source,i.target.subjectType,e):null}function An(i){return i.extendedAction!=null}var $n=()=>[];function io(i,l){return this.trackKey(l)}var he=(i,l)=>l.id,oo=(i,l)=>l.actionId,ro=(i,l)=>l.name;function ao(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(3);lh("nzValue",e)("nzLabel",Fw(1,2,t.stepTypeKey(e)));}}function so(i,l){if(i&1){let e=FD();_i$1(0,"app-field-condition-editor",24),mh("conditionChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{condition:n}))}),Jc();}if(i&2){let e=HD(2).$index;lh("condition",l)("testIdPrefix","step-condition-"+e);}}function lo(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e)("nzLabel",Fw(1,2,t.outputFormatKey(e)));}}function po(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function co(i,l){if(i&1){let e=FD();_i$1(0,"nz-tag",31),mh("nzOnClose",function(){let n=Fu(e).$implicit,o=HD(3).$index,d=HD();return ju(d.removeContextFile(o,n.id))}),Iw(1),Jc();}if(i&2){let e=l.$implicit;ch("data-testid","context-file-chip-"+e.id),gI(),rl$1(" ",e.name," ");}}function _o(i,l){i&1&&(_i$1(0,"span",29),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"step-list.contextFilesEmpty")));}function mo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"textarea",25),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{objective:n}))}),Jc(),iE(),Jc(),_i$1(5,"div",16)(6,"span"),Iw(7),Pw(8,"transloco"),Jc(),_i$1(9,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{outputFormat:n}))}),xD(10,lo,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_i$1(12,"div",16)(13,"span"),Iw(14),Pw(15,"transloco"),Jc(),_i$1(16,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.setAgentInstance(o,n))}),uh(17,"nz-option",15),Pw(18,"transloco"),xD(19,po,1,2,"nz-option",15,he),Jc(),iE(),Jc(),_i$1(21,"div",16)(22,"span"),Iw(23),Pw(24,"transloco"),Jc(),_i$1(25,"div",27),xD(26,co,2,2,"nz-tag",28,he,false,_o,3,3,"span",29),Jc(),_i$1(29,"button",30),mh("click",function(){Fu(e);let n=HD(2).$index,o=HD();return ju(o.openContextFilePicker(n))}),Iw(30),Pw(31,"transloco"),Jc()();}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(),ch("data-testid","agent-prompt-label-"+n),gI(),Lh(Fw(3,17,"step-list.objective")),gI(2),lh("ngModel",o.asAgent(t).objective),ch("data-testid","agent-objective-"+n),aE(),gI(3),Lh(Fw(8,19,"step-list.outputFormat.label")),gI(2),lh("ngModel",o.asAgent(t).outputFormat),ch("data-testid","agent-output-"+n),aE(),gI(),AD(o.outputFormats),gI(4),Lh(Fw(15,21,"step-list.agentInstance.label")),gI(2),lh("ngModel",o.asAgent(t).agentInstanceId??null),ch("data-testid","agent-instance-"+n),aE(),gI(),lh("nzValue",null)("nzLabel",Fw(18,23,"step-list.agentInstance.default")),gI(2),AD(o.agentInstanceOptions()),gI(2),ch("data-testid","agent-context-files-"+n),gI(2),Lh(Fw(24,25,"step-list.contextFiles")),gI(3),AD(o.selectedContextFiles(o.asAgent(t))),gI(3),ch("data-testid","select-context-files-"+n),gI(),rl$1(" ",Fw(31,27,"step-list.selectContextFiles")," ");}}function uo(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e)("nzLabel",Fw(1,2,t.interactionKey(e)));}}function Co(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit;lh("nzValue",e.id)("nzLabel",e.label);}}function xo(i,l){i&1&&(_i$1(0,"p",19),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"step-list.sourceStepIds.empty")));}function fo(i,l){i&1&&(_i$1(0,"p",19),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"step-list.sourceStepIds.hint")));}function go(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",32),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.patchAt(o,{sourceStepIds:n}))}),xD(5,Co,1,2,"nz-option",15,he),Jc(),iE(),_D(7,xo,3,3,"p",19)(8,fo,3,3,"p",19),Jc();}if(i&2){let e=HD(3),t=e.$implicit,n=e.$index,o=HD();ch("data-testid","comment-review-sources-"+n),gI(2),Lh(Fw(3,5,"step-list.sourceStepIds.label")),gI(2),lh("ngModel",o.asInteraction(t).sourceStepIds??xw(7,$n)),ch("data-testid","comment-review-source-ids-"+n),aE(),gI(),AD(o.commentSuggestionSources(t)),gI(2),MD(o.commentSuggestionSources(t).length===0?7:8);}}function ho(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.onInteractionChange(o,n))}),xD(5,uo,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_D(7,go,9,8,"div",16);}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,4,"step-list.interaction.label")),gI(2),lh("ngModel",o.asInteraction(t).interaction),ch("data-testid","interaction-type-"+n),aE(),gI(),AD(o.interactions),gI(2),MD(o.asInteraction(t).interaction==="comment_review"?7:-1);}}function bo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"textarea",25),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{command:n}))}),Jc(),iE(),Jc();}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,3,"step-list.command")),gI(2),lh("ngModel",o.asShell(t).command),ch("data-testid","shell-command-"+n),aE();}}function vo(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e)("nzLabel",Fw(1,2,t.onNoMatchKey(e)));}}function wo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"textarea",33),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{source:n}))}),Jc(),iE(),Jc(),_i$1(5,"label",16)(6,"span"),Iw(7),Pw(8,"transloco"),Jc(),_i$1(9,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{path:n}))}),Jc(),iE(),Jc(),_i$1(10,"label",16)(11,"span"),Iw(12),Pw(13,"transloco"),Jc(),_i$1(14,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{pattern:n}))}),Jc(),iE(),Jc(),_i$1(15,"div",16)(16,"span"),Iw(17),Pw(18,"transloco"),Jc(),_i$1(19,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{onNoMatch:n}))}),xD(20,vo,2,4,"nz-option",15,ND),Jc(),iE(),Jc();}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,12,"step-list.extract.source")),gI(2),lh("ngModel",o.asExtract(t).source),ch("data-testid","extract-source-"+n),aE(),gI(3),Lh(Fw(8,14,"step-list.extract.path")),gI(2),lh("ngModel",o.asExtract(t).path??""),ch("data-testid","extract-path-"+n),aE(),gI(3),Lh(Fw(13,16,"step-list.extract.pattern")),gI(2),lh("ngModel",o.asExtract(t).pattern??""),ch("data-testid","extract-pattern-"+n),aE(),gI(3),Lh(Fw(18,18,"step-list.extract.onNoMatch")),gI(2),lh("ngModel",o.asExtract(t).onNoMatch),ch("data-testid","extract-on-no-match-"+n),aE(),gI(),AD(o.extractOnNoMatchActions);}}function So(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e)("nzLabel",Fw(1,2,t.gitOperationKey(e)));}}function yo(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"app-repo-path-picker",38),mh("pathChange",function(n){Fu(e);let o=HD(4).$index,d=HD();return ju(d.setGitParam(o,"repoPath",n))})("repoSelected",function(n){Fu(e);let o=HD(4).$index,d=HD();return ju(d.applyCreateWorktreeCatalogRepo(o,n))}),Jc()();}if(i&2){let e=HD(4),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,3,"step-list.createWorktree.repoPath")),gI(2),lh("path",o.gitParam(o.asGit(t),"repoPath")),ch("data-testid","git-repo-path-"+n);}}function zo(i,l){if(i&1&&(_i$1(0,"p",19),Iw(1),Pw(2,"transloco"),Jc()),i&2){let e=HD(4).$index;ch("data-testid","git-resolve-from-pr-hint-"+e),gI(),rl$1(" ",Fw(2,2,"step-list.createWorktree.resolveFromPrHint")," ");}}function Mo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(4).$index,d=HD();return ju(d.setGitParam(o,"baseBranch",n))}),Jc(),iE(),Jc(),_i$1(5,"label",16)(6,"span"),Iw(7),Pw(8,"transloco"),Jc(),_i$1(9,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(4).$index,d=HD();return ju(d.setGitParam(o,"branchName",n))}),Jc(),iE(),Jc();}if(i&2){let e=HD(4),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,6,"step-list.createWorktree.baseBranch")),gI(2),lh("ngModel",o.gitParam(o.asGit(t),"baseBranch")),ch("data-testid","git-base-branch-"+n),aE(),gI(3),Lh(Fw(8,8,"step-list.createWorktree.branchName")),gI(2),lh("ngModel",o.gitParam(o.asGit(t),"branchName")),ch("data-testid","git-branch-name-"+n),aE();}}function Eo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(4).$index,d=HD();return ju(d.setGitParam(o,"branch",n))}),Jc(),iE(),Jc();}if(i&2){let e=HD(4),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,3,"step-list.createWorktree.branch")),gI(2),lh("ngModel",o.gitParam(o.asGit(t),"branch")),ch("data-testid","git-branch-"+n),aE();}}function ko(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setCreateWorktreeMode(o,n))}),uh(5,"nz-option",34),Pw(6,"transloco"),uh(7,"nz-option",35),Pw(8,"transloco"),Jc(),iE(),Jc(),_i$1(9,"div",16)(10,"span"),Iw(11),Pw(12,"transloco"),Jc(),_i$1(13,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setCreateWorktreeRepoSource(o,n))}),uh(14,"nz-option",36),Pw(15,"transloco"),uh(16,"nz-option",37),Pw(17,"transloco"),Jc(),iE(),Jc(),_D(18,yo,5,5,"div",16)(19,zo,3,4,"p",19),_D(20,Mo,10,10)(21,Eo,5,5,"label",16);}if(i&2){let e=HD(3),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,12,"step-list.createWorktree.mode")),gI(2),lh("ngModel",o.createWorktreeMode(o.asGit(t))),ch("data-testid","git-worktree-mode-"+n),aE(),gI(),lh("nzLabel",Fw(6,14,"step-list.createWorktree.newBranch")),gI(2),lh("nzLabel",Fw(8,16,"step-list.createWorktree.existingBranch")),gI(4),Lh(Fw(12,18,"step-list.createWorktree.repoSource")),gI(2),lh("ngModel",o.createWorktreeRepoSource(o.asGit(t))),ch("data-testid","git-worktree-repo-source-"+n),aE(),gI(),lh("nzLabel",Fw(15,20,"step-list.createWorktree.repoPathPick")),gI(2),lh("nzLabel",Fw(17,22,"step-list.createWorktree.resolveFromPr")),gI(2),MD(o.createWorktreeRepoSource(o.asGit(t))==="path"?18:19),gI(2),MD(o.createWorktreeMode(o.asGit(t))==="new-branch"?20:21);}}function To(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"app-key-value-editor",39),mh("rowsChange",function(n){Fu(e);let o=HD(3),d=o.$implicit,T=o.$index,J=HD();return ju(J.onParamRowsChange(T,d,n))}),Jc()();}if(i&2){let e=HD(3).$implicit,t=HD();gI(2),Lh(Fw(3,2,"step-list.params")),gI(2),lh("rows",t.paramRows(e));}}function Io(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{operation:n}))}),xD(5,So,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_D(7,ko,22,24)(8,To,5,4,"div",16);}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,4,"step-list.operation")),gI(2),lh("ngModel",o.asGit(t).operation),ch("data-testid","git-operation-"+n),aE(),gI(),AD(o.gitOperations),gI(2),MD(o.asGit(t).operation==="create_worktree"?7:8);}}function No(i,l){if(i&1&&uh(0,"nz-alert",40),i&2){let e=HD(3).$index;lh("nzMessage",l),ch("data-testid","extended-action-mismatch-"+e);}}function Fo(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(5);lh("nzValue",e)("nzLabel",Fw(1,2,t.subjectTypeKey(e)));}}function Po(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function Vo(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setTargetSubjectType(o,n))}),xD(5,Fo,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_i$1(7,"div",16)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i$1(11,"nz-select",43),Pw(12,"transloco"),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setTargetSource(o,n))}),xD(13,Po,1,2,"nz-option",15,he),Jc(),iE(),Jc(),_i$1(15,"label",16)(16,"span"),Iw(17),Pw(18,"transloco"),Jc(),_i$1(19,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setTargetSubjectId(o,n))}),Jc(),iE(),_i$1(20,"span",19),Iw(21),Pw(22,"transloco"),Jc()();}if(i&2){let e=l,t=HD(3),n=t.$implicit,o=t.$index,d=HD();gI(2),Lh(Fw(3,11,"step-list.target.subjectType")),gI(2),lh("ngModel",e.subjectType),ch("data-testid","provider-action-target-type-"+o),aE(),gI(),AD(d.targetSubjectTypes),gI(4),Lh(Fw(10,13,"step-list.target.source")),gI(2),lh("ngModel",e.source||null)("nzPlaceHolder",Fw(12,15,"step-list.target.sourcePlaceholder")),ch("data-testid","provider-action-target-source-"+o),aE(),gI(2),AD(d.targetInstanceOptions(d.asProvider(n))),gI(4),Lh(Fw(18,17,"step-list.target.subjectId")),gI(2),lh("ngModel",e.subjectId),ch("data-testid","provider-action-target-id-"+o),aE(),gI(2),Lh(Fw(22,19,"step-list.target.subjectIdHint"));}}function Ao(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit,t=HD(5);lh("nzValue",e)("nzLabel",t.providerLabel(e));}}function $o(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit;lh("nzValue",e.actionId)("nzLabel",e.label);}}function Bo(i,l){i&1&&(_i$1(0,"span",19),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"step-list.extendedAction.empty")));}function Do(i,l){i&1&&(_i$1(0,"span",44),Iw(1,"*"),Jc());}function Lo(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit;lh("nzValue",e)("nzLabel",e);}}function Oo(i,l){if(i&1){let e=FD();_i$1(0,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD().$implicit,d=HD(5).$index,T=HD();return ju(T.setExtendedParam(d,o.name,n))}),xD(1,Lo,1,2,"nz-option",15,ND),Jc(),iE();}if(i&2){let e=HD().$implicit,t=HD(5),n=t.$implicit,o=t.$index,d=HD();lh("ngModel",d.extendedParamValue(d.asProvider(n),e.name)),ch("data-testid","extended-action-param-"+e.name+"-"+o),aE(),gI(),AD(e.options??xw(2,$n));}}function Wo(i,l){if(i&1){let e=FD();_i$1(0,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD().$implicit,d=HD(5).$index,T=HD();return ju(T.setExtendedParam(d,o.name,n))}),Jc(),iE();}if(i&2){let e=HD().$implicit,t=HD(5),n=t.$implicit,o=t.$index,d=HD();lh("ngModel",d.extendedParamValue(d.asProvider(n),e.name)),ch("data-testid","extended-action-param-"+e.name+"-"+o),aE();}}function jo(i,l){if(i&1&&(_i$1(0,"label",16)(1,"span"),Iw(2),_D(3,Do,2,0,"span",44),Jc(),_D(4,Oo,3,3,"nz-select",45)(5,Wo,1,2,"input",46),Jc()),i&2){let e=l.$implicit;gI(2),rl$1(" ",e.label," "),gI(),MD(e.required?3:-1),gI(),MD(e.type==="select"?4:5);}}function Ro(i,l){i&1&&xD(0,jo,6,3,"label",16,ro),i&2&&AD(l.params);}function Ko(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setExtendedProvider(o,n))}),xD(5,Ao,1,2,"nz-option",15,ND),Jc(),iE(),Jc(),_i$1(7,"div",16)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i$1(11,"nz-select",43),Pw(12,"transloco"),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setExtendedAction(o,n))}),xD(13,$o,1,2,"nz-option",15,oo),Jc(),iE(),_D(15,Bo,3,3,"span",19),Jc(),_D(16,Ro,2,0);}if(i&2){let e,t=HD(3),n=t.$implicit,o=t.$index,d=HD();gI(2),Lh(Fw(3,9,"step-list.extendedAction.provider")),gI(2),lh("ngModel",d.asProvider(n).extendedAction?.providerId),ch("data-testid","extended-action-provider-"+o),aE(),gI(),AD(d.extendedProviderOptions()),gI(4),Lh(Fw(10,11,"step-list.extendedAction.action")),gI(2),lh("ngModel",d.asProvider(n).extendedAction?.actionId||null)("nzPlaceHolder",Fw(12,13,"step-list.extendedAction.none")),ch("data-testid","extended-action-id-"+o),aE(),gI(2),AD(d.extendedDescriptors(d.asProvider(n))),gI(2),MD(d.extendedDescriptors(d.asProvider(n)).length===0?15:-1),gI(),MD((e=d.selectedExtendedDescriptor(d.asProvider(n)))?16:-1,e);}}function Ho(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(5);lh("nzValue",e)("nzLabel",Fw(1,2,t.providerActionKey(e)));}}function qo(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.patchAt(o,{action:n}))}),xD(5,Ho,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_i$1(7,"div",16)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i$1(11,"app-key-value-editor",39),mh("rowsChange",function(n){Fu(e);let o=HD(3),d=o.$implicit,T=o.$index,J=HD();return ju(J.onParamRowsChange(T,d,n))}),Jc()();}if(i&2){let e=HD(3),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,5,"step-list.action")),gI(2),lh("ngModel",o.asProvider(t).action),ch("data-testid","provider-action-"+n),aE(),gI(),AD(o.providerActions),gI(4),Lh(Fw(10,7,"step-list.params")),gI(2),lh("rows",o.paramRows(t));}}function Go(i,l){if(i&1){let e=FD();_D(0,No,1,2,"nz-alert",40),_i$1(1,"label",22),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.setTargetEnabled(o,n))}),Iw(2),Pw(3,"transloco"),Jc(),iE(),_D(4,Vo,23,21),_i$1(5,"div",16)(6,"span"),Iw(7),Pw(8,"transloco"),Jc(),_i$1(9,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.setActionMode(o,n))}),uh(10,"nz-option",41),Pw(11,"transloco"),uh(12,"nz-option",42),Pw(13,"transloco"),Jc(),iE(),Jc(),_D(14,Ko,17,15)(15,qo,12,9);}if(i&2){let e,t,n=HD(2),o=n.$implicit,d=n.$index,T=HD();MD((e=T.mismatchWarning(T.asProvider(o)))?0:-1,e),gI(),lh("ngModel",T.hasTarget(o)),ch("data-testid","provider-action-target-toggle-"+d),aE(),gI(),rl$1(" ",Fw(3,11,"step-list.target.toggle")," "),gI(2),MD((t=T.asProvider(o).target)?4:-1,t),gI(3),Lh(Fw(8,13,"step-list.extendedAction.mode")),gI(2),lh("ngModel",T.isExtended(o)?"extended":"portable"),ch("data-testid","provider-action-mode-"+d),aE(),gI(),lh("nzLabel",Fw(11,15,"step-list.extendedAction.portable")),gI(2),lh("nzLabel",Fw(13,17,"step-list.extendedAction.extended")),gI(2),MD(T.isExtended(o)?14:15);}}function Uo(i,l){if(i&1&&uh(0,"nz-option",15),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e.id)("nzLabel",t.workflowOptionLabel(e));}}function Jo(i,l){if(i&1){let e=FD();_i$1(0,"label",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD(3).$index,d=HD();return ju(d.setSubWorkflowSource(o,n))}),Jc(),iE(),_i$1(5,"p",19),Iw(6),Pw(7,"transloco"),Jc()();}if(i&2){let e=HD(3),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,4,"step-list.forEach.sourcePath")),gI(2),lh("ngModel",o.subWorkflowSource(t)),ch("data-testid","sub-workflow-foreach-source-"+n),aE(),gI(2),Lh(Fw(7,6,"step-list.forEach.sourceHint"));}}function Zo(i,l){if(i&1){let e=FD();_i$1(0,"div",16)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"nz-select",47),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{workflowId:n}))}),xD(5,Uo,1,2,"nz-option",15,he),Jc(),iE(),Jc(),_i$1(7,"div",16)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i$1(11,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.setSubWorkflowForEachMode(o,n))}),uh(12,"nz-option",48),Pw(13,"transloco"),uh(14,"nz-option",49),Pw(15,"transloco"),Jc(),iE(),Jc(),_D(16,Jo,8,8,"label",16);}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();gI(2),Lh(Fw(3,9,"step-list.workflowId")),gI(2),lh("ngModel",o.asSubWorkflow(t).workflowId),ch("data-testid","sub-workflow-id-"+n),aE(),gI(),AD(o.childWorkflowOptions(t)),gI(4),Lh(Fw(10,11,"step-list.forEach")),gI(2),lh("ngModel",o.subWorkflowForEachMode(t)),ch("data-testid","sub-workflow-foreach-mode-"+n),aE(),gI(),lh("nzLabel",Fw(13,13,"step-list.forEach.selection")),gI(2),lh("nzLabel",Fw(15,15,"step-list.forEach.source")),gI(2),MD(o.subWorkflowForEachMode(t)==="source"?16:-1);}}function Qo(i,l){if(i&1&&(uh(0,"nz-option",15),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(4);lh("nzValue",e)("nzLabel",Fw(1,2,t.onMaxIterationsKey(e)));}}function Yo(i,l){if(i&1){let e=FD();_i$1(0,"app-field-condition-editor",24),mh("conditionChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{until:n}))}),Jc(),_i$1(1,"div",50)(2,"label",16)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i$1(6,"nz-input-number",51),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{maxIterations:n??0}))}),Jc(),iE(),Jc(),_i$1(7,"div",16)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i$1(11,"nz-select",26),mh("ngModelChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.patchAt(o,{onMaxIterations:{action:n}}))}),xD(12,Qo,2,4,"nz-option",15,ND),Jc(),iE(),Jc()(),_i$1(14,"div",52)(15,"h4"),Iw(16),Pw(17,"transloco"),Jc(),_i$1(18,"app-step-list",53),mh("stepsChange",function(n){Fu(e);let o=HD(2).$index,d=HD();return ju(d.setNestedSteps(o,n))}),Jc()();}if(i&2){let e=HD(2),t=e.$implicit,n=e.$index,o=HD();lh("condition",o.asLoop(t).until)("testIdPrefix","loop-until-"+n),gI(4),Lh(Fw(5,18,"step-list.maxIterations")),gI(2),lh("ngModel",o.asLoop(t).maxIterations)("nzMin",0),ch("data-testid","loop-max-"+n),aE(),gI(3),Lh(Fw(10,20,"step-list.onMaxIterations.action")),gI(2),lh("ngModel",o.asLoop(t).onMaxIterations.action),ch("data-testid","loop-on-max-"+n),aE(),gI(),AD(o.maxIterationActions),gI(2),ch("data-testid","loop-nested-"+n),gI(2),Lh(Fw(17,22,"step-list.nestedSteps")),gI(2),lh("steps",o.asLoop(t).steps)("rootSteps",o.effectiveRoot())("availableWorkflows",o.availableWorkflows())("appliesTo",o.appliesTo())("inputSchema",o.inputSchema())("settings",o.settings())("depth",o.depth()+1);}}function Xo(i,l){if(i&1){let e=FD();_i$1(0,"div",12)(1,"div",13)(2,"nz-select",14),mh("ngModelChange",function(n){Fu(e);let o=HD().$index,d=HD();return ju(d.changeType(o,n))}),xD(3,ao,2,4,"nz-option",15,ND),Jc(),iE(),Jc(),_i$1(5,"label",16)(6,"span"),Iw(7),Pw(8,"transloco"),Jc(),_i$1(9,"input",17),mh("ngModelChange",function(n){Fu(e);let o=HD().$index,d=HD();return ju(d.onNameChange(o,n))}),Jc(),iE(),Jc(),_i$1(10,"label",16)(11,"span"),Iw(12),Pw(13,"transloco"),Jc(),_i$1(14,"input",18),mh("ngModelChange",function(n){Fu(e);let o=HD().$index,d=HD();return ju(d.onIdChange(o,n))}),Jc(),iE(),_i$1(15,"p",19),Iw(16),Pw(17,"transloco"),Jc()(),uh(18,"app-available-parameters",20),_i$1(19,"section",21)(20,"label",22),mh("ngModelChange",function(n){Fu(e);let o=HD().$index,d=HD();return ju(d.setConditionEnabled(o,n))}),Iw(21),Pw(22,"transloco"),Jc(),iE(),_i$1(23,"p",19),Iw(24),Pw(25,"transloco"),Jc(),_D(26,so,1,2,"app-field-condition-editor",23),Jc(),_D(27,mo,32,29)(28,ho,8,6)(29,bo,5,5,"label",16)(30,wo,22,20)(31,Io,9,6)(32,Go,16,19)(33,Zo,17,17)(34,Yo,19,24),Jc();}if(i&2){let e,t,n=HD(),o=n.$implicit,d=n.$index,T=HD();ch("data-testid","step-body-"+d),gI(2),lh("ngModel",o.type),ch("data-testid","step-type-"+d),aE(),gI(),AD(T.stepTypes),gI(4),Lh(Fw(8,21,"step-list.name")),gI(2),lh("ngModel",o.name),ch("data-testid","step-name-"+d),aE(),gI(3),Lh(Fw(13,23,"step-list.id")),gI(2),lh("ngModel",o.id),ch("data-testid","step-id-"+d),aE(),gI(2),Lh(Fw(17,25,"step-list.idHint")),gI(2),lh("inputSchema",T.inputSchema())("appliesTo",T.appliesTo())("previousSteps",T.previousFor(o))("currentStepType",o.type),gI(),ch("data-testid","step-condition-"+d),gI(),lh("ngModel",!!o.condition),ch("data-testid","step-condition-toggle-"+d),aE(),gI(),rl$1(" ",Fw(22,27,"step-list.condition.title")," "),gI(3),Lh(Fw(25,29,"step-list.condition.hint")),gI(2),MD((e=o.condition)?26:-1,e),gI(),MD((t=o.type)==="agent"?27:t==="interaction"?28:t==="shell"?29:t==="extract"?30:t==="git"?31:t==="provider_action"?32:t==="sub_workflow"?33:t==="loop"?34:-1);}}function er(i,l){if(i&1){let e=FD();_i$1(0,"nz-card",3)(1,"div",4),mh("click",function(){let n=Fu(e).$implicit,o=HD();return ju(o.toggleExpanded(n))}),_i$1(2,"div",5)(3,"span",6),Iw(4),Jc(),_i$1(5,"span",7),Iw(6),Pw(7,"transloco"),Jc(),_i$1(8,"span",8),Iw(9),Pw(10,"transloco"),Jc()(),_i$1(11,"div",9),mh("click",function(n){return n.stopPropagation()}),_i$1(12,"button",10),mh("click",function(){let n=Fu(e).$index,o=HD();return ju(o.moveUp(n))}),Iw(13),Pw(14,"transloco"),Jc(),_i$1(15,"button",10),mh("click",function(){let n=Fu(e).$index,o=HD();return ju(o.moveDown(n))}),Iw(16),Pw(17,"transloco"),Jc(),_i$1(18,"button",11),mh("click",function(){let n=Fu(e).$index,o=HD();return ju(o.removeStep(n))}),Iw(19),Pw(20,"transloco"),Jc()()(),_D(21,Xo,35,31,"div",12),Jc();}if(i&2){let e=l.$implicit,t=l.$index,n=HD();Sh("step-card-expanded",n.isExpanded(e)),ch("data-testid","step-card-"+t),gI(),ch("data-testid","step-header-"+t),gI(3),Lh(n.isExpanded(e)?"\u25BE":"\u25B8"),gI(),ch("data-testid","step-header-name-"+t),gI(),rl$1(" ",e.name||Fw(7,18,"step-list.unnamed")," "),gI(2),ch("data-testid","step-type-label-"+t),gI(),rl$1(" ",Fw(10,20,n.stepTypeKey(e.type))," "),gI(3),lh("disabled",t===0),ch("data-testid","move-up-"+t),gI(),rl$1(" ",Fw(14,22,"step-list.moveUp")," "),gI(2),lh("disabled",t===n.steps().length-1),ch("data-testid","move-down-"+t),gI(),rl$1(" ",Fw(17,24,"step-list.moveDown")," "),gI(2),ch("data-testid","remove-"+t),gI(),rl$1(" ",Fw(20,26,"step-list.remove")," "),gI(2),MD(n.isExpanded(e)?21:-1);}}var Bn=(()=>{class i{constructor(){this.transloco=C(Ve),this.language=C(O),this.providersApi=C(w),this.contextFilesApi=C(ze),this.modal=C(jn$1),this.steps=q0.required(),this.rootSteps=q0([]),this.availableWorkflows=q0([]),this.appliesTo=q0("none"),this.inputSchema=q0([]),this.settings=q0(w_),this.depth=q0(0),this.stepsChange=U0(),this.stepTypes=y,this.outputFormats=["questionnaire","confirmation","comment_suggestions","free_text"],this.interactions=["questionnaire","confirmation","comment_review"],this.gitOperations=["create_worktree","checkout","create_branch","commit","push"],this.providerActions=["get_subject","get_comments","post_comment","update_status","get_content"],this.maxIterationActions=["fail","continue","ask_human"],this.extractOnNoMatchActions=["fail","empty","ask_human"],this.expandedKey=qo$1(null),this.contextFiles=qo$1([]),this.paramRowsByStepKey=new Map,this.actionsByProvider=new Map,this.loadingActions=new Set,this.targetSubjectTypes=F,this.contextFilesApi.list().pipe(ue()).subscribe({next:e=>this.contextFiles.set(e),error:()=>this.contextFiles.set([])}),id(()=>{for(let e of this.steps())e.type==="provider_action"&&e.extendedAction?.providerId&&this.ensureActionsLoaded(e.extendedAction.providerId);});}stepTypeKey(e){return `step-list.stepType.${e}`}outputFormatKey(e){return `step-list.outputFormat.${e}`}interactionKey(e){return `step-list.interaction.${e}`}gitOperationKey(e){return `step-list.gitOperation.${e}`}providerActionKey(e){return `step-list.providerAction.${e}`}onMaxIterationsKey(e){return `step-list.onMaxIterations.${e}`}onNoMatchKey(e){return `step-list.onNoMatch.${e}`}workflowOptionLabel(e){return this.language.currentLang(),this.transloco.translate("step-list.workflowOption",{name:e.name,id:e.id})}effectiveRoot(){let e=this.rootSteps();return e.length>0?e:this.steps()}previousFor(e){return im(this.effectiveRoot(),e)}commentSuggestionSources(e){return G_(this.effectiveRoot(),e).filter(t=>!!t.id).map(t=>({id:t.id,label:t.name?.trim()?`${t.name} (${t.id})`:t.id}))}onInteractionChange(e,t){if(t==="comment_review"){let n=this.asInteraction(this.steps()[e]);this.patchAt(e,{interaction:t,sourceStepIds:n.sourceStepIds??[]});return}this.patchAt(e,{interaction:t,sourceStepIds:void 0});}trackKey(e){return e._key}isExpanded(e){return this.expandedKey()===e._key}toggleExpanded(e){this.expandedKey.update(t=>t===e._key?null:e._key);}addStep(){this.emit([...this.steps(),h("agent")]);}removeStep(e){let t=this.steps()[e];t&&this.paramRowsByStepKey.delete(t._key),this.emit(this.steps().filter((n,o)=>o!==e));}moveUp(e){if(e<=0)return;let t=[...this.steps()],n=t[e-1];t[e-1]=t[e],t[e]=n,this.emit(t);}moveDown(e){if(e>=this.steps().length-1)return;let t=[...this.steps()],n=t[e+1];t[e+1]=t[e],t[e]=n,this.emit(t);}changeType(e,t){let n=this.steps()[e];if(!n||n.type===t)return;this.paramRowsByStepKey.delete(n._key);let o=h(t,{id:n.id,name:n.name,idAutoSync:n._idAutoSync,key:n._key});this.replaceAt(e,n.condition?s(r$1({},o),{condition:n.condition}):o);}patchAt(e,t){let n=this.steps()[e];n&&this.replaceAt(e,r$1(r$1({},n),t));}onNameChange(e,t){let n=this.steps()[e];n&&this.replaceAt(e,E(n,t,this.effectiveRoot()));}onIdChange(e,t){let n=this.steps()[e];n&&this.replaceAt(e,P(n,t));}setNestedSteps(e,t){let n=this.steps()[e];!n||n.type!=="loop"||this.replaceAt(e,s(r$1({},n),{steps:t}));}asAgent(e){return e}asInteraction(e){return e}asShell(e){return e}asExtract(e){return e}asGit(e){return e}createWorktreeMode(e){return e.params?.mode==="existing-branch"?"existing-branch":"new-branch"}createWorktreeRepoSource(e){return e.params?.resolveRepoFromSubject===true?"from-pr":"path"}gitParam(e,t){let n=e.params?.[t];return typeof n=="string"?n:""}setGitParam(e,t,n){let o=this.steps()[e];!o||o.type!=="git"||(this.paramRowsByStepKey.delete(o._key),this.patchAt(e,{params:s(r$1({},o.params),{[t]:n})}));}applyCreateWorktreeCatalogRepo(e,t){let n=this.steps()[e];if(!n||n.type!=="git")return;this.paramRowsByStepKey.delete(n._key);let o=s(r$1({},n.params),{repoPath:t.localPath});delete o.resolveRepoFromSubject;let d=this.gitParam(n,"baseBranch").trim(),T=t.defaultBranch?.trim();!d&&T&&(o.baseBranch=T),this.patchAt(e,{params:o});}setCreateWorktreeRepoSource(e,t){let n=this.steps()[e];if(!n||n.type!=="git")return;this.paramRowsByStepKey.delete(n._key);let o=r$1({},n.params);t==="from-pr"?(o.resolveRepoFromSubject=true,delete o.repoPath):delete o.resolveRepoFromSubject,this.patchAt(e,{params:o});}setCreateWorktreeMode(e,t){let n=this.steps()[e];if(!n||n.type!=="git")return;let o=n.params?.resolveRepoFromSubject===true,d=this.gitParam(n,"repoPath");this.paramRowsByStepKey.delete(n._key);let T=o?{resolveRepoFromSubject:true}:{repoPath:d};if(t==="existing-branch"){this.patchAt(e,{params:s(r$1({mode:"existing-branch"},T),{branch:this.gitParam(n,"branch")||this.gitParam(n,"branchName")})});return}this.patchAt(e,{params:s(r$1({},T),{baseBranch:this.gitParam(n,"baseBranch"),branchName:this.gitParam(n,"branchName")||this.gitParam(n,"branch")})});}asProvider(e){return e}asSubWorkflow(e){return e}subWorkflowForEachMode(e){return typeof this.asSubWorkflow(e).forEach=="object"?"source":"selection"}setSubWorkflowForEachMode(e,t){if(t==="selection"){this.patchAt(e,{forEach:"selection"});return}let n=this.asSubWorkflow(this.steps()[e]),o=typeof n.forEach=="object"?n.forEach.source:"";this.patchAt(e,{forEach:{source:o}});}subWorkflowSource(e){let t=this.asSubWorkflow(e).forEach;return typeof t=="object"?t.source:""}setSubWorkflowSource(e,t){this.patchAt(e,{forEach:{source:t}});}childWorkflowOptions(e){let t=this.availableWorkflows();return this.subWorkflowForEachMode(e)!=="source"?t:t.filter(n=>n.appliesTo==="none")}asLoop(e){return e}paramRows(e){let t=this.paramRowsByStepKey.get(e._key);if(!t){let n=e.type==="git"||e.type==="provider_action"?e.params:void 0;t=A(n),this.paramRowsByStepKey.set(e._key,t);}return t}onParamRowsChange(e,t,n){this.paramRowsByStepKey.set(t._key,n),this.patchAt(e,{params:j(n)});}isExtended(e){return e.type==="provider_action"&&An(this.asProvider(e))}setActionMode(e,t){let n=this.asProvider(this.steps()[e]);if(t==="portable"){let d=n,{extendedAction:T}=d,J=t$1(d,["extendedAction"]);this.replaceAt(e,J);return}let o=Pn(this.appliesTo(),this.settings());this.patchAt(e,{extendedAction:{providerId:o,actionId:"",params:{}}}),this.ensureActionsLoaded(o);}extendedProviderOptions(){return $e(this.appliesTo(),this.settings())}providerLabel(e){return (this.settings().providerInstances??[]).find(n=>n.id===e)?.displayName||e}agentInstanceOptions(){return (this.settings().providerInstances??[]).filter(e=>e.kind==="agent")}setAgentInstance(e,t){this.patchAt(e,{agentInstanceId:t||void 0});}selectedContextFiles(e){let t=e.contextFileIds??[],n=this.contextFiles();return t.map(o=>n.find(d=>d.id===o)??{id:o,name:o,tier:"user",path:""})}removeContextFile(e,t){let n=this.asAgent(this.steps()[e]);this.patchAt(e,{contextFileIds:(n.contextFileIds??[]).filter(o=>o!==t)});}openContextFilePicker(e){let t=this.asAgent(this.steps()[e]),n=this.modal.create({nzTitle:this.transloco.translate("context-files.selectTitle"),nzContent:St,nzData:{selectionMode:true,selectedIds:[...t.contextFileIds??[]]},nzWidth:800,nzOnOk:()=>{let o=n.getContentComponent();this.patchAt(e,{contextFileIds:o.currentSelectedIds()}),this.contextFilesApi.list().subscribe({next:d=>this.contextFiles.set(d)});}});}setExtendedProvider(e,t){this.patchAt(e,{extendedAction:{providerId:t,actionId:"",params:{}}}),this.ensureActionsLoaded(t);}setExtendedAction(e,t){let n=this.asProvider(this.steps()[e]),o=this.extendedDescriptors(n).find(d=>d.actionId===t);this.patchAt(e,{extendedAction:{providerId:n.extendedAction?.providerId??"",actionId:t,params:o?tr(o):{}}});}setExtendedParam(e,t,n){let d=this.asProvider(this.steps()[e]).extendedAction;d&&this.patchAt(e,{extendedAction:s(r$1({},d),{params:s(r$1({},d.params??{}),{[t]:n})})});}extendedParamValue(e,t){let n=e.extendedAction?.params?.[t];return n==null?"":String(n)}extendedDescriptors(e){let t=e.extendedAction?.providerId;return t?this.actionsByProvider.get(t)??[]:[]}selectedExtendedDescriptor(e){let t=e.extendedAction?.actionId;if(t)return this.extendedDescriptors(e).find(n=>n.actionId===t)}mismatchWarning(e){let t=Vn(e,this.appliesTo(),this.settings());return t?(this.language.currentLang(),this.transloco.translate("step-list.extendedAction.mismatch",t)):null}hasTarget(e){return e.type==="provider_action"&&this.asProvider(e).target!=null}setTargetEnabled(e,t){let n=this.asProvider(this.steps()[e]);if(!t){let o=n,{target:d}=o,T=t$1(o,["target"]);this.replaceAt(e,T);return}this.patchAt(e,{target:{subjectType:"ticket",source:"",subjectId:""}});}setTargetSubjectType(e,t){let n=this.asProvider(this.steps()[e]);this.patchAt(e,{target:{subjectType:t,source:"",subjectId:n.target?.subjectId??""}});}setTargetSource(e,t){let n=this.asProvider(this.steps()[e]);n.target&&this.patchAt(e,{target:s(r$1({},n.target),{source:t})});}setTargetSubjectId(e,t){let n=this.asProvider(this.steps()[e]);n.target&&this.patchAt(e,{target:s(r$1({},n.target),{subjectId:t})});}targetInstanceOptions(e){let t=e.target?.subjectType;return t?L(this.settings(),[t]):[]}setConditionEnabled(e,t){if(t){let n=this.steps()[e];this.patchAt(e,{condition:n?.condition??En()});return}this.patchAt(e,{condition:void 0});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}ensureActionsLoaded(e){!e||this.actionsByProvider.has(e)||this.loadingActions.has(e)||(this.loadingActions.add(e),this.providersApi.listExtendedActions(e).subscribe({next:t=>{this.loadingActions.delete(e),this.actionsByProvider.set(e,t);},error:()=>{this.loadingActions.delete(e),this.actionsByProvider.set(e,[]);}}));}replaceAt(e,t){this.emit(this.steps().map((n,o)=>o===e?t:n));}emit(e){this.stepsChange.emit(e);}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-step-list"]],inputs:{steps:[1,"steps"],rootSteps:[1,"rootSteps"],availableWorkflows:[1,"availableWorkflows"],appliesTo:[1,"appliesTo"],inputSchema:[1,"inputSchema"],settings:[1,"settings"],depth:[1,"depth"]},outputs:{stepsChange:"stepsChange"},decls:6,vars:4,consts:[["data-testid","step-list",1,"step-list"],[1,"step-card",3,"step-card-expanded"],["nz-button","","nzType","dashed","nzBlock","","type","button","data-testid","add-step",3,"click"],[1,"step-card"],[1,"step-header",3,"click"],[1,"step-header-meta"],["aria-hidden","true",1,"step-chevron"],[1,"step-name-preview"],[1,"step-type"],[1,"step-header-actions",3,"click"],["nz-button","","type","button",3,"click","disabled"],["nz-button","","nzDanger","","type","button",3,"click"],[1,"step-body"],[1,"step-toolbar"],[1,"type-select",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"field"],["nz-input","","required","",3,"ngModelChange","ngModel"],["nz-input","",3,"ngModelChange","ngModel"],[1,"hint"],[3,"inputSchema","appliesTo","previousSteps","currentStepType"],[1,"condition-section"],["nz-checkbox","",3,"ngModelChange","ngModel"],[3,"condition","testIdPrefix"],[3,"conditionChange","condition","testIdPrefix"],["nz-input","","rows","3",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel"],[1,"context-file-chips"],["nzMode","closeable"],["data-testid","context-files-empty",1,"hint"],["nz-button","","type","button",3,"click"],["nzMode","closeable",3,"nzOnClose"],["nzMode","multiple",3,"ngModelChange","ngModel"],["nz-input","","rows","2",3,"ngModelChange","ngModel"],["nzValue","new-branch",3,"nzLabel"],["nzValue","existing-branch",3,"nzLabel"],["nzValue","path",3,"nzLabel"],["nzValue","from-pr",3,"nzLabel"],[3,"pathChange","repoSelected","path"],[3,"rowsChange","rows"],["nzType","warning","nzShowIcon","",1,"mismatch",3,"nzMessage"],["nzValue","portable",3,"nzLabel"],["nzValue","extended",3,"nzLabel"],[3,"ngModelChange","ngModel","nzPlaceHolder"],[1,"required"],[3,"ngModel"],["nz-input","",3,"ngModel"],["nzShowSearch","","nzAllowClear","",3,"ngModelChange","ngModel"],["nzValue","selection",3,"nzLabel"],["nzValue","source",3,"nzLabel"],[1,"field-grid"],[3,"ngModelChange","ngModel","nzMin"],[1,"nested"],[3,"stepsChange","steps","rootSteps","availableWorkflows","appliesTo","inputSchema","settings","depth"]],template:function(t,n){t&1&&(_i$1(0,"div",0),xD(1,er,22,28,"nz-card",1,io,true),_i$1(3,"button",2),mh("click",function(){return n.addStep()}),Iw(4),Pw(5,"transloco"),Jc()()),t&2&&(ch("data-depth",n.depth()),gI(),AD(n.steps()),gI(3),rl$1(" ",Fw(5,2,"step-list.addStep")," "));},dependencies:[i,$8,al,er$1,rl,Ja,$i$1,pf,bd,sp,fp,Nt,Ke,Lt,ut,ai$1,z,wn,ot,ts,ex,Fm,Am,Gn$1,un,W,I$1,Nn,Mn,zn,Sn,Kt],styles:[".step-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.step-card[_ngcontent-%COMP%]{background:#fff}.step-header[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem;cursor:pointer;-webkit-user-select:none;user-select:none}.step-header-meta[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.step-chevron[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem;width:.9rem}.step-type[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:#57534e;background:#f5f5f4;border-radius:999px;padding:.15rem .55rem}.step-name-preview[_ngcontent-%COMP%]{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.step-header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.step-body[_ngcontent-%COMP%]{margin-top:.75rem;padding-top:.75rem;border-top:1px solid #e7e5e4}.step-toolbar[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.75rem;align-items:center}.type-select[_ngcontent-%COMP%]{min-width:11rem}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.65rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.field-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));gap:.5rem 1rem}.hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.mismatch[_ngcontent-%COMP%]{margin:.5rem 0}.required[_ngcontent-%COMP%]{color:#b91c1c}.nested[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;border-left:3px solid #d6d3d1;background:#fafaf9}.nested[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 .5rem}.condition-section[_ngcontent-%COMP%]{margin:.75rem 0;padding-top:.5rem}.condition-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.35rem 0 0}.context-file-chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center;margin:.35rem 0}"]});}}return i})();function tr(i){let l={};for(let e of i.params)l[e.name]=e.type==="select"?e.options?.[0]??"":"";return l}var nr=i=>({ids:i});function ir(i,l){if(i&1){let e=FD();_i$1(0,"button",10),mh("click",function(){Fu(e);let n=HD();return ju(n.exportWorkflow())}),Iw(1),Pw(2,"transloco"),Jc();}if(i&2){let e=HD();lh("disabled",e.loading()||!!e.loadError()),gI(),rl$1(" ",Fw(2,2,"workflow-editor.export")," ");}}function or(i,l){if(i&1){let e=FD();_i$1(0,"button",11),mh("click",function(){Fu(e);let n=HD();return ju(n.startWorkflow())}),Iw(1),Pw(2,"transloco"),Jc();}i&2&&(gI(),rl$1(" ",Fw(2,1,"workflow-editor.start")," "));}function rr(i,l){i&1&&(_i$1(0,"p",8),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"workflow-editor.loading")));}function ar(i,l){if(i&1&&(_i$1(0,"p",9),Iw(1),Jc()),i&2){let e=HD();gI(),Lh(e.loadError());}}function sr(i,l){if(i&1&&(_i$1(0,"li"),Iw(1),Jc()),i&2){let e=l.$implicit;gI(),Lh(e);}}function lr(i,l){if(i&1&&(_i$1(0,"section",12)(1,"h2"),Iw(2),Pw(3,"transloco"),Jc(),_i$1(4,"ul"),xD(5,sr,2,1,"li",null,ND),Jc()()),i&2){let e=HD(2);gI(2),Lh(Fw(3,1,"workflow-editor.validation")),gI(3),AD(e.validationErrors());}}function pr(i,l){if(i&1&&(uh(0,"nz-option",18),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(2);lh("nzValue",e)("nzLabel",Fw(1,2,t.subjectTypeKey(e)));}}function dr(i,l){if(i&1&&(uh(0,"nz-option",20),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(2);lh("nzValue",e)("nzLabel",Fw(1,3,t.subjectHandlingKey(e)))("nzDisabled",e==="collection"&&t.appliesToValue()==="none");}}function cr(i,l){if(i&1&&(uh(0,"nz-option",18),Pw(1,"transloco")),i&2){let e=l.$implicit,t=HD(3);lh("nzValue",e)("nzLabel",Fw(1,2,t.inputTypeKey(e)));}}function _r(i,l){if(i&1){let e=FD();_i$1(0,"div",23)(1,"label",15)(2,"span"),Iw(3),Pw(4,"transloco"),Jc(),_i$1(5,"input",27),mh("ngModelChange",function(n){let o=Fu(e).$index,d=HD(2);return ju(d.patchInputField(o,{name:n}))}),Jc(),iE(),Jc(),_i$1(6,"label",15)(7,"span"),Iw(8),Pw(9,"transloco"),Jc(),_i$1(10,"input",27),mh("ngModelChange",function(n){let o=Fu(e).$index,d=HD(2);return ju(d.patchInputField(o,{label:n}))}),Jc(),iE(),Jc(),_i$1(11,"div",15)(12,"span"),Iw(13),Pw(14,"transloco"),Jc(),_i$1(15,"nz-select",28),mh("ngModelChange",function(n){let o=Fu(e).$index,d=HD(2);return ju(d.patchInputField(o,{type:n}))}),xD(16,cr,2,4,"nz-option",18,ND),Jc(),iE(),Jc(),_i$1(18,"label",29),mh("ngModelChange",function(n){let o=Fu(e).$index,d=HD(2);return ju(d.patchInputField(o,{required:n}))}),Iw(19),Pw(20,"transloco"),Jc(),iE(),_i$1(21,"button",30),mh("click",function(){let n=Fu(e).$index,o=HD(2);return ju(o.removeInputField(n))}),Iw(22),Pw(23,"transloco"),Jc()();}if(i&2){let e=l.$implicit,t=l.$index,n=HD(2);ch("data-testid","input-field-"+t),gI(3),Lh(Fw(4,10,"workflow-editor.fieldName")),gI(2),lh("ngModel",e.name),aE(),gI(3),Lh(Fw(9,12,"workflow-editor.fieldLabel")),gI(2),lh("ngModel",e.label),aE(),gI(3),Lh(Fw(14,14,"workflow-editor.fieldType")),gI(2),lh("ngModel",e.type),aE(),gI(),AD(n.inputFieldTypes),gI(2),lh("ngModel",e.required),aE(),gI(),rl$1(" ",Fw(20,16,"workflow-editor.required")," "),gI(3),rl$1(" ",Fw(23,18,"workflow-editor.remove")," ");}}function mr(i,l){if(i&1&&(_i$1(0,"p",25),Iw(1),Pw(2,"transloco"),Jc()),i&2){let e=HD(2);gI(),rl$1(" ",jw(2,1,"workflow-editor.duplicateStepIds",Aw(4,nr,e.duplicateStepIds().join(", ")))," ");}}function ur(i,l){if(i&1){let e=FD();_D(0,lr,7,3,"section",12),_i$1(1,"nz-card",13),Pw(2,"transloco"),_i$1(3,"div",14)(4,"label",15)(5,"span"),Iw(6),Pw(7,"transloco"),Jc(),_i$1(8,"input",16),mh("ngModelChange",function(n){Fu(e);let o=HD();return ju(o.patchWorkflow({name:n}))}),Jc(),iE(),Jc(),_i$1(9,"div",15)(10,"span"),Iw(11),Pw(12,"transloco"),Jc(),_i$1(13,"nz-select",17),mh("ngModelChange",function(n){Fu(e);let o=HD();return ju(o.setAppliesTo(n))}),xD(14,pr,2,4,"nz-option",18,ND),Jc(),iE(),Jc(),_i$1(16,"div",15)(17,"span"),Iw(18),Pw(19,"transloco"),Jc(),_i$1(20,"nz-select",19),mh("ngModelChange",function(n){Fu(e);let o=HD();return ju(o.patchWorkflow({subjectHandling:n}))}),xD(21,dr,2,5,"nz-option",20,ND),Jc(),iE(),_i$1(23,"p",21),Iw(24),Pw(25,"transloco"),Jc()()(),_i$1(26,"label",15)(27,"span"),Iw(28),Pw(29,"transloco"),Jc(),_i$1(30,"textarea",22),mh("ngModelChange",function(n){Fu(e);let o=HD();return ju(o.patchWorkflow({description:n||void 0}))}),Jc(),iE(),Jc()(),_i$1(31,"nz-card",13),Pw(32,"transloco"),xD(33,_r,24,20,"div",23,SD),_i$1(35,"button",24),mh("click",function(){Fu(e);let n=HD();return ju(n.addInputField())}),Iw(36),Pw(37,"transloco"),Jc()(),_i$1(38,"nz-card",13),Pw(39,"transloco"),_D(40,mr,3,6,"p",25),_i$1(41,"app-step-list",26),mh("stepsChange",function(n){Fu(e);let o=HD();return ju(o.onStepsChange(n))}),Jc()();}if(i&2){let e=HD();MD(e.validationErrors().length>0?0:-1),gI(),lh("nzTitle",Fw(2,21,"workflow-editor.basics")),gI(5),Lh(Fw(7,23,"workflow-editor.name")),gI(2),lh("ngModel",e.workflow().name),aE(),gI(3),Lh(Fw(12,25,"workflow-editor.appliesTo")),gI(2),lh("ngModel",e.appliesToValue()),aE(),gI(),AD(e.subjectTypes),gI(4),Lh(Fw(19,27,"workflow-editor.subjectHandling.label")),gI(2),lh("ngModel",e.workflow().subjectHandling),aE(),gI(),AD(e.subjectHandlingOptions),gI(3),rl$1(" ",Fw(25,29,e.subjectHandlingHelpKey())," "),gI(4),Lh(Fw(29,31,"workflow-editor.description")),gI(2),lh("ngModel",e.workflow().description??""),aE(),gI(),lh("nzTitle",Fw(32,33,"workflow-editor.inputSchema")),gI(2),AD(e.workflow().inputSchema),gI(3),rl$1(" ",Fw(37,35,"workflow-editor.addInputField")," "),gI(2),lh("nzTitle",Fw(39,37,"workflow-editor.steps")),gI(2),MD(e.duplicateStepIds().length>0?40:-1),gI(),lh("steps",e.workflow().steps)("rootSteps",e.workflow().steps)("availableWorkflows",e.availableWorkflows())("appliesTo",e.workflow().appliesTo)("inputSchema",e.workflow().inputSchema)("settings",e.settings());}}var Cs=(()=>{class i{constructor(){this.route=C(C1),this.router=C(J1),this.workflowsApi=C(b),this.settingsApi=C(f),this.message=C(He),this.destroyRef=C(at),this.transloco=C(Ve),this.language=C(O),this.startJob=C(At),this.routeId=de(this.route.paramMap.pipe(Se(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.workflow=qo$1(I()),this.availableWorkflows=qo$1([]),this.settings=qo$1(w_),this.loadError=qo$1(null),this.validationErrors=qo$1([]),this.duplicateStepIds=qo$1([]),this.saving=qo$1(false),this.loading=qo$1(true),this.isNew=Uw(()=>!this.routeId()),this.canStart=Uw(()=>!this.isNew()&&!this.loading()&&!this.loadError()&&this.workflow().subjectHandling==="per-subject"),this.pageTitle=Uw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("workflow-editor.titleNew"):this.transloco.translate("workflow-editor.titleEdit",{name:this.workflow().name.trim()}))),this.subjectTypes=["none","ticket","pull_request","documentation"],this.subjectHandlingOptions=["per-subject","collection"],this.inputFieldTypes=["string","number","boolean","select","localRepository"],this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.availableWorkflows.set(e),error:()=>{}}),this.settingsApi.getSettings().pipe(ue(this.destroyRef)).subscribe({next:e=>this.settings.set(e),error:()=>{}}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(e=>{let t=e.get("id");if(this.validationErrors.set([]),this.duplicateStepIds.set([]),this.loadError.set(null),!t){this.workflow.set(I()),this.loading.set(false);return}this.loading.set(true),this.workflowsApi.get(t).subscribe({next:n=>{this.workflow.set(s(r$1({},structuredClone(n)),{steps:_(n.steps,{idAutoSync:false})})),this.loading.set(false);},error:n=>{this.loading.set(false),this.loadError.set(this.errorMessage(n,`Failed to load workflow ${t}`));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}subjectHandlingKey(e){return `workflow-editor.subjectHandling.${e}`}subjectHandlingHelpKey(){return `workflow-editor.subjectHandling.help.${this.workflow().subjectHandling}`}inputTypeKey(e){return `workflow-editor.inputType.${e}`}patchWorkflow(e){this.workflow.update(t=>r$1(r$1({},t),e));}setAppliesTo(e){if(e==="none"){this.patchWorkflow({appliesTo:e,subjectHandling:"per-subject"});return}this.patchWorkflow({appliesTo:e});}appliesToValue(){let e=this.workflow().appliesTo;return Array.isArray(e)?e[0]??"none":e}onStepsChange(e){this.patchWorkflow({steps:e}),this.duplicateStepIds.set(Ad(e));}addInputField(){this.patchWorkflow({inputSchema:[...this.workflow().inputSchema,b$1()]});}removeInputField(e){this.patchWorkflow({inputSchema:this.workflow().inputSchema.filter((t,n)=>n!==e)});}patchInputField(e,t){let n=this.workflow().inputSchema.map((o,d)=>d===e?r$1(r$1({},o),t):o);this.patchWorkflow({inputSchema:n});}save(){let e=this.workflow(),t=Ad(e.steps);if(this.duplicateStepIds.set(t),t.length>0){this.validationErrors.set([this.transloco.translate("workflow-editor.duplicateStepIds",{ids:t.join(", ")})]);return}let n=v(e,{omitWorkflowId:this.isNew()}),o=c_.safeParse(n);if(!o.success){this.validationErrors.set(T(o.error));return}this.validationErrors.set([]),this.saving.set(true);let d=o.data,T$1=this.routeId();(this.isNew()||!T$1?this.workflowsApi.create(d):this.workflowsApi.update(T$1,s(r$1({},d),{id:T$1}))).subscribe({next:me=>{this.saving.set(false),this.workflow.set(s(r$1({},structuredClone(me)),{steps:_(me.steps,{idAutoSync:false})})),this.message.success(this.isNew()?"Workflow created":"Workflow saved"),this.isNew()&&this.router.navigate(["/workflows",me.id,"edit"]);},error:me=>{this.saving.set(false),this.message.error(this.errorMessage(me,"Save failed"));}});}startWorkflow(){let e=this.routeId();!e||!this.canStart()||this.startJob.start({workflowId:e});}exportWorkflow(){let e=this.routeId();e&&this.workflowsApi.exportDefinition(e).subscribe({next:t=>{l(`${ig(t.name)}.json`,JSON.stringify(t,null,2),"application/json");},error:t=>{this.message.error(this.errorMessage(t,this.transloco.translate("workflow-editor.exportFailed")));}});}errorMessage(e,t){return e instanceof bi$1||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-editor"]],decls:17,vars:12,consts:[["data-testid","workflow-editor",1,"editor"],[1,"header"],["data-testid","page-title"],[1,"header-actions"],["routerLink","/workflows","data-testid","back-to-workflows"],["nz-button","","type","button","data-testid","export-workflow",3,"disabled"],["nz-button","","type","button","data-testid","start-workflow"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["nz-button","","type","button","data-testid","export-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","start-workflow",3,"click"],["data-testid","validation-errors",1,"errors"],[3,"nzTitle"],[1,"grid"],[1,"field"],["nz-input","","data-testid","workflow-name",3,"ngModelChange","ngModel"],["data-testid","workflow-applies-to",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","workflow-subject-handling",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel","nzDisabled"],["data-testid","workflow-subject-handling-help",1,"help"],["nz-input","","rows","2","data-testid","workflow-description",3,"ngModelChange","ngModel"],[1,"input-field-row"],["nz-button","","nzType","dashed","type","button",3,"click"],["data-testid","duplicate-step-ids",1,"error"],[3,"stepsChange","steps","rootSteps","availableWorkflows","appliesTo","inputSchema","settings"],["nz-input","",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel"],["nz-checkbox","",3,"ngModelChange","ngModel"],["nz-button","","nzDanger","","type","button",3,"click"]],template:function(t,n){t&1&&(_i$1(0,"main",0)(1,"header",1)(2,"div")(3,"h1",2),Iw(4),Jc()(),_i$1(5,"div",3)(6,"a",4),Iw(7),Pw(8,"transloco"),Jc(),_D(9,ir,3,4,"button",5),_D(10,or,3,3,"button",6),_i$1(11,"button",7),mh("click",function(){return n.save()}),Iw(12),Pw(13,"transloco"),Jc()()(),_D(14,rr,3,3,"p",8)(15,ar,2,1,"p",9)(16,ur,42,39),Jc()),t&2&&(gI(4),Lh(n.pageTitle()),gI(3),Lh(Fw(8,8,"workflow-editor.backToWorkflows")),gI(2),MD(n.isNew()?-1:9),gI(),MD(n.canStart()?10:-1),gI(),lh("nzLoading",n.saving())("disabled",n.loading()||!!n.loadError()),gI(),rl$1(" ",Fw(13,10,"common.save")," "),gI(2),MD(n.loading()?14:n.loadError()?15:16));},dependencies:[$8,al,er$1,rl,$i$1,v3,pf,bd,sp,fp,Nt,Ke,Lt,ut,ai$1,z,ex,Fm,Am,Bn,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;flex-wrap:wrap;gap:.75rem;align-items:center}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}.grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));gap:.75rem 1rem}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.help[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.checkbox-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;margin-bottom:.5rem}.input-field-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 8rem auto auto;gap:.5rem;align-items:end;margin-bottom:.5rem}.input-field-row[_ngcontent-%COMP%] > .field[_ngcontent-%COMP%]{margin:0}.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 i})();export{Cs as WorkflowEditorComponent};
|
package/static/chunk-BaLWULJh.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b}from'./chunk-BcDRgzYZ.js';import {L as Lt$1}from'./chunk-LPXHXTnJ.js';import'./chunk-8ezEUcxN.js';import'./chunk-Bok52e_k.js';import {L as Lt,u as ut,D as Di,m as mn}from'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';import {C,$,a as C1,V as Ve,b as at,q as qo,U as Uw,u as ue$1,s,r as r$1,c as bi,Z as ZE,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,I as Iw,P as Pw,J as Jc,m as mh,k as iE,l as _D,n as uh,x as xD,N as ND,o as gI,L as Lh,p as Fw,w as lh,y as aE,z as rl$1,M as MD,B as AD,H as HD,D as ch,E as Aw,G as FD,O as Fu,Q as ju}from'./main-3VZRFHGG.js';import'./chunk-D8qyjd0z.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),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function de(t,a){if(t&1&&(_i(0,"p",6),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.queuedError());}}function pe(t,a){t&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.queuedEmpty")," "));}function ue(t,a){if(t&1&&(_i(0,"tr")(1,"td")(2,"a",25),Iw(3),Jc()(),_i(4,"td",26),Iw(5),Jc(),_i(6,"td",27),Iw(7),Jc()()),t&2){let e=a.$implicit,s=HD(2);ch("data-testid","queued-row-"+e.jobId),gI(2),lh("routerLink",Aw(6,re,e.jobId)),ch("data-testid","queued-job-link-"+e.jobId),gI(),rl$1(" ",e.jobId," "),gI(2),Lh(e.agentInstanceId),gI(2),Lh(s.queuedWaitLabel(e.enqueuedAt));}}function ce(t,a){if(t&1&&(_i(0,"table",8)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc()()(),_i(12,"tbody"),xD(13,ue,8,8,"tr",null,ae),Jc()()),t&2){let e=HD();gI(4),Lh(Fw(5,3,"jobs.table.column.id")),gI(3),Lh(Fw(8,5,"jobs.list.queuedAgent")),gI(3),Lh(Fw(11,7,"jobs.list.queuedWait")),gI(3),AD(e.queuedSteps());}}function he(t,a){if(t&1&&uh(0,"nz-option",14),t&2){let e=a.$implicit;lh("nzValue",e.id)("nzLabel",e.name+" ("+e.id+")");}}function me(t,a){t&1&&(_i(0,"p",15),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ge(t,a){if(t&1&&(_i(0,"p",16),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.runningError());}}function fe(t,a){t&1&&(_i(0,"p",17),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.runningEmpty")," "));}function be(t,a){if(t&1&&uh(0,"app-job-status-table",18),t&2){let e=HD();lh("jobs",e.runningJobs());}}function _e(t,a){if(t&1&&(uh(0,"nz-option",14),Pw(1,"transloco"),Pw(2,"transloco")),t&2){let e=a.$implicit,s=HD();lh("nzValue",e)("nzLabel",e==="all"?Fw(1,2,"jobs.list.filterAll"):Fw(2,4,s.statusKey(e)));}}function ye(t,a){if(t&1&&uh(0,"nz-option",14),t&2){let e=a.$implicit;lh("nzValue",e.id)("nzLabel",e.name+" ("+e.id+")");}}function Ce(t,a){t&1&&(_i(0,"p",22),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function xe(t,a){if(t&1&&(_i(0,"p",23),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.historyError());}}function Me(t,a){t&1&&(_i(0,"p",24),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),rl$1(" ",Fw(2,1,"jobs.list.historyEmpty")," "));}function ve(t,a){if(t&1){let e=FD();_i(0,"nz-pagination",29),mh("nzPageIndexChange",function(o){Fu(e);let m=HD(2);return ju(m.setHistoryPage(o))}),Jc();}if(t&2){let e=HD(2);lh("nzPageIndex",e.historyPageIndex())("nzPageSize",e.pageSize)("nzTotal",e.historyTotal());}}function Ie(t,a){if(t&1&&(uh(0,"app-job-status-table",18),_D(1,ve,1,3,"nz-pagination",28)),t&2){let e=HD();lh("jobs",e.historyJobs()),gI(),MD(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=Uw(()=>{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=ZE({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"),Iw(3),Pw(4,"transloco"),Jc()(),_i(5,"label",2),mh("ngModelChange",function(b){return o.setShowChildJobs(b)}),Iw(6),Pw(7,"transloco"),Jc(),iE(),_i(8,"section",3)(9,"header",4)(10,"h2"),Iw(11),Pw(12,"transloco"),Jc()(),_D(13,le,3,3,"p",5)(14,de,2,1,"p",6)(15,pe,3,3,"p",7)(16,ce,15,9,"table",8),Jc(),_i(17,"section",9)(18,"header",4)(19,"h2"),Iw(20),Pw(21,"transloco"),Jc()(),_i(22,"div",10)(23,"div",11)(24,"span"),Iw(25),Pw(26,"transloco"),Jc(),_i(27,"nz-select",12),mh("ngModelChange",function(b){return o.setRunningWorkflowId(b)}),uh(28,"nz-option",13),Pw(29,"transloco"),xD(30,he,1,2,"nz-option",14,oe),Jc(),iE(),Jc()(),_D(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),Jc(),_i(36,"section",19)(37,"header",4)(38,"h2"),Iw(39),Pw(40,"transloco"),Jc()(),_i(41,"div",10)(42,"div",11)(43,"span"),Iw(44),Pw(45,"transloco"),Jc(),_i(46,"nz-select",20),mh("ngModelChange",function(b){return o.setHistoryStatusFilter(b)}),xD(47,_e,3,6,"nz-option",14,ND),Jc(),iE(),Jc(),_i(49,"div",11)(50,"span"),Iw(51),Pw(52,"transloco"),Jc(),_i(53,"nz-select",21),mh("ngModelChange",function(b){return o.setHistoryWorkflowId(b)}),uh(54,"nz-option",13),Pw(55,"transloco"),xD(56,ye,1,2,"nz-option",14,oe),Jc(),iE(),Jc()(),_D(58,Ce,3,3,"p",22)(59,xe,2,1,"p",23)(60,Me,3,3,"p",24)(61,Ie,2,2),Jc()()),s&2&&(gI(3),Lh(Fw(4,17,"jobs.list.title")),gI(2),lh("ngModel",o.showChildJobs()),aE(),gI(),rl$1(" ",Fw(7,19,"jobs.list.showChildJobs")," "),gI(5),Lh(Fw(12,21,"jobs.list.queued")),gI(2),MD(o.queuedLoading()?13:o.queuedError()?14:o.queuedSteps().length===0?15:16),gI(7),Lh(Fw(21,23,"jobs.list.running")),gI(5),Lh(Fw(26,25,"jobs.list.filterByWorkflow")),gI(2),lh("ngModel",o.runningWorkflowId()),aE(),gI(),lh("nzLabel",Fw(29,27,"jobs.list.filterAll")),gI(2),AD(o.workflows()),gI(2),MD(o.runningLoading()?32:o.runningError()?33:o.runningJobs().length===0?34:35),gI(7),Lh(Fw(40,29,"jobs.list.history")),gI(5),Lh(Fw(45,31,"jobs.list.filterByStatus")),gI(2),lh("ngModel",o.historyStatusFilter()),aE(),gI(),AD(o.historyStatusOptions),gI(4),Lh(Fw(52,33,"jobs.list.filterByWorkflow")),gI(2),lh("ngModel",o.historyWorkflowId()),aE(),gI(),lh("nzLabel",Fw(55,35,"jobs.list.filterAll")),gI(2),AD(o.workflows()),gI(2),MD(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,Lt$1,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};
|
package/static/chunk-Bok52e_k.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a7 as KE,a8 as fu,C,bV as XI,bf as _r,ab as Oe,ae as Le$1,bW as Bl,bX as _l,Z as ZE,a3 as Ah,a4 as Th,ai as ly,av as K0,aj as $D,ak as UD,l as _D,o as gI,M as MD,m as mh,aP as Mh,al as Sh,bY as qn,bZ as $n,G as FD,j as _i,J as Jc,O as Fu,H as HD,Q as ju}from'./main-3VZRFHGG.js';var V=["*"];function x(o,A){if(o&1){let n=FD();_i(0,"nz-icon",1),mh("click",function(e){Fu(n);let i=HD();return ju(i.closeTag(e))}),Jc();}}var I=(()=>{class o{renderer=C(XI);el=C(_r).nativeElement;dir=C(Oe).valueSignal;nzMode="default";nzColor;nzChecked=false;nzBordered=true;nzOnClose=new Le$1;nzCheckedChange=new Le$1;isPresetColor=false;updateCheckedStatus(){this.nzMode==="checkable"&&(this.nzChecked=!this.nzChecked,this.nzCheckedChange.emit(this.nzChecked));}closeTag(n){this.nzOnClose.emit(n),n.defaultPrevented||this.renderer.removeChild(this.renderer.parentNode(this.el),this.el);}clearPresetColor(){let n=new RegExp(`(ant-tag-(?:${[...qn,...$n].join("|")}))`,"g"),t=this.el.classList.toString(),e=[],i=n.exec(t);for(;i!==null;)e.push(i[1]),i=n.exec(t);this.el.classList.remove(...e);}setPresetColor(){this.clearPresetColor(),this.nzColor?this.isPresetColor=Bl(this.nzColor)||_l(this.nzColor):this.isPresetColor=false,this.isPresetColor&&this.el.classList.add(`ant-tag-${this.nzColor}`);}ngOnChanges(n){let{nzColor:t}=n;t&&this.setPresetColor();}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=ZE({type:o,selectors:[["nz-tag"]],hostAttrs:[1,"ant-tag"],hostVars:12,hostBindings:function(t,e){t&1&&mh("click",function(){return e.updateCheckedStatus()}),t&2&&(Mh("background-color",e.isPresetColor?"":e.nzColor),Sh("ant-tag-has-color",e.nzColor&&!e.isPresetColor)("ant-tag-checkable",e.nzMode==="checkable")("ant-tag-checkable-checked",e.nzChecked)("ant-tag-rtl",e.dir()==="rtl")("ant-tag-borderless",!e.nzBordered));},inputs:{nzMode:"nzMode",nzColor:"nzColor",nzChecked:[2,"nzChecked","nzChecked",K0],nzBordered:[2,"nzBordered","nzBordered",K0]},outputs:{nzOnClose:"nzOnClose",nzCheckedChange:"nzCheckedChange"},exportAs:["nzTag"],features:[ly],ngContentSelectors:V,decls:2,vars:1,consts:[["nzType","close","tabindex","-1",1,"ant-tag-close-icon"],["nzType","close","tabindex","-1",1,"ant-tag-close-icon",3,"click"]],template:function(t,e){t&1&&($D(),UD(0),_D(1,x,1,0,"nz-icon",0)),t&2&&(gI(),MD(e.nzMode==="closeable"?1:-1));},dependencies:[Ah,Th],encapsulation:2})}return o})(),W=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=KE({type:o});static \u0275inj=fu({imports:[I]})}return o})();export{I,W};
|
package/static/chunk-BowAQ7m9.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {p as pc,a as as,d as dc,K as Kl,U as Ul,c as cc,J as Ji,l as ls,e as es}from'./chunk-CtiubhW7.js';import {a5 as q0,a6 as U0,q as qo,U as Uw,Z as ZE,d as $8,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,I as Iw,P as Pw,J as Jc,x as xD,o as gI,M as MD,w as lh,L as Lh,p as Fw,B as AD,G as FD,m as mh,H as HD,z as rl,az as jw,E as Aw,D as ch,O as Fu,Q as ju}from'./main-3VZRFHGG.js';var Q=t=>({count:t}),U=t=>["/jobs",t],X=(t,c)=>c.id;function Y(t,c){if(t&1){let e=FD();_i(0,"div",1)(1,"button",4),mh("click",function(){Fu(e);let o=HD();return ju(o.emitBulk())}),Iw(2),Pw(3,"transloco"),Jc()();}if(t&2){let e=HD();gI(),lh("disabled",e.checkedCount()===0),gI(),rl(" ",jw(3,2,"runnableTable.runSelected",Aw(5,Q,e.checkedCount()))," ");}}function Z(t,c){if(t&1){let e=FD();_i(0,"th",5),mh("nzCheckedChange",function(o){Fu(e);let s=HD();return ju(s.onAllChecked(o))}),Jc();}if(t&2){let e=HD();lh("nzChecked",e.allChecked())("nzIndeterminate",e.someChecked());}}function ee(t,c){t&1&&(_i(0,"th"),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"runnableTable.column.actions")));}function te(t,c){if(t&1){let e=FD();_i(0,"td",12),mh("nzCheckedChange",function(o){Fu(e);let s=HD().$implicit,H=HD();return ju(H.onItemChecked(s.id,o))}),Jc();}if(t&2){let e=HD().$implicit,n=HD();lh("nzChecked",n.checkedIds().has(e.id)),ch("data-testid","check-"+e.id);}}function ne(t,c){if(t&1&&(_i(0,"span",9),Iw(1),Jc()),t&2){let e=HD().$implicit;ch("data-testid","subtitle-"+e.id),gI(),Lh(e.subtitle);}}function ie(t,c){if(t&1&&(_i(0,"a",10),Iw(1),Pw(2,"transloco"),Jc()),t&2){let e=c,n=HD().$implicit,o=HD();lh("routerLink",Aw(5,U,e.id)),ch("data-testid","latest-"+n.id),gI(),rl(" ",Fw(2,3,o.statusKey(e.status))," ");}}function oe(t,c){if(t&1&&(_i(0,"span",11),Iw(1),Pw(2,"transloco"),Jc()),t&2){let e=HD().$implicit;ch("data-testid","latest-"+e.id),gI(),Lh(Fw(2,2,"runnableTable.neverRun"));}}function ae(t,c){if(t&1){let e=FD();_i(0,"td")(1,"button",13),mh("click",function(){Fu(e);let o=HD().$implicit,s=HD();return ju(s.emitRow(o.id))}),Iw(2),Pw(3,"transloco"),Jc()();}if(t&2){let e=HD().$implicit;gI(),ch("data-testid","run-"+e.id),gI(),rl(" ",Fw(3,2,"runnableTable.run")," ");}}function le(t,c){if(t&1&&(_i(0,"tr"),_D(1,te,1,2,"td",6),_i(2,"td")(3,"div",7)(4,"span",8),Iw(5),Jc(),_D(6,ne,2,2,"span",9),Jc()(),_i(7,"td"),_D(8,ie,3,7,"a",10)(9,oe,3,4,"span",11),Jc(),_D(10,ae,4,4,"td"),Jc()),t&2){let e,n=c.$implicit,o=HD();ch("data-testid","row-"+n.id),gI(),MD(o.selectable()?1:-1),gI(3),ch("data-testid","label-"+n.id),gI(),Lh(n.primaryLabel),gI(),MD(n.subtitle?6:-1),gI(2),MD((e=n.latestJob)?8:9,e),gI(2),MD(o.showRowAction()?10:-1);}}var we=(()=>{class t{constructor(){this.rows=q0([]),this.selectable=q0(false),this.showRowAction=q0(true),this.rowAction=U0(),this.bulkAction=U0(),this.checkedIds=qo(new Set),this.checkedCount=Uw(()=>this.checkedIds().size),this.allChecked=Uw(()=>{let e=this.rows();return e.length>0&&e.every(n=>this.checkedIds().has(n.id))}),this.someChecked=Uw(()=>{let e=this.checkedCount();return e>0&&e<this.rows().length});}onItemChecked(e,n){this.checkedIds.update(o=>{let s=new Set(o);return n?s.add(e):s.delete(e),s});}onAllChecked(e){this.checkedIds.set(e?new Set(this.rows().map(n=>n.id)):new Set);}emitBulk(){this.bulkAction.emit([...this.checkedIds()]);}emitRow(e){this.rowAction.emit(e);}statusKey(e){return `jobs.status.${e}`}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-runnable-items-table"]],inputs:{rows:[1,"rows"],selectable:[1,"selectable"],showRowAction:[1,"showRowAction"]},outputs:{rowAction:"rowAction",bulkAction:"bulkAction"},decls:16,vars:12,consts:[["data-testid","runnable-items-table",1,"runnable-table"],["data-testid","bulk-bar",1,"bulk-bar"],[3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","select-all",3,"nzChecked","nzIndeterminate"],["nz-button","","type","button","data-testid","run-selected",3,"click","disabled"],["data-testid","select-all",3,"nzCheckedChange","nzChecked","nzIndeterminate"],[3,"nzChecked"],[1,"item"],[1,"primary"],[1,"subtitle"],[3,"routerLink"],[1,"never"],[3,"nzCheckedChange","nzChecked"],["nz-button","","nzType","link","type","button",3,"click"]],template:function(n,o){n&1&&(_i(0,"div",0),_D(1,Y,4,7,"div",1),_i(2,"nz-table",2)(3,"thead")(4,"tr"),_D(5,Z,1,2,"th",3),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_D(12,ee,3,3,"th"),Jc()(),_i(13,"tbody"),xD(14,le,11,7,"tr",null,X),Jc()()()),n&2&&(gI(),MD(o.selectable()?1:-1),gI(),lh("nzData",o.rows())("nzFrontPagination",false)("nzShowPagination",false),gI(3),MD(o.selectable()?5:-1),gI(2),Lh(Fw(8,8,"runnableTable.column.item")),gI(3),Lh(Fw(11,10,"runnableTable.column.latestRun")),gI(2),MD(o.showRowAction()?12:-1),gI(2),AD(o.rows()));},dependencies:[$8,v3,pf,bd,sp,fp,pc,as,dc,Kl,Ul,cc,Ji,ls,es,Kt],styles:[".runnable-table[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.bulk-bar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.15rem}.primary[_ngcontent-%COMP%]{font-weight:600}.subtitle[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.never[_ngcontent-%COMP%]{color:#78716c}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return t})();export{we as w};
|
package/static/chunk-Bz7bE4tT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a as ae,l as le}from'./chunk-EDwdt-Wk.js';import {T}from'./chunk-SiaN7xSQ.js';import {H as He}from'./chunk-CwEMAptL.js';import'./chunk-BIJScqTM.js';import {C,a as C1,R as J1,b7 as m,b8 as y,b as at,V as Ve,bo as O,bp as de,ba as Se,q as qo,U as Uw,u as ue$1,r as r$1,c as bi,Z as ZE,d as $8,e as al,bb as er,f as rl,g as $i,v as v3,Y 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,I as Iw,J as Jc,P as Pw,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl$1,M as MD,H as HD,G as FD,k as iE,x as xD,y as aE,B as AD,N as ND,n as uh,O as Fu,Q as ju}from'./main-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import {a as ai,z}from'./chunk-Dm_EWkUz.js';import {k as d_}from'./chunk-8ezEUcxN.js';import'./chunk-iIEmH_ui.js';var ue=(t,s)=>s.id;function he(t,s){t&1&&(_i(0,"p",6),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function fe(t,s){if(t&1&&(_i(0,"p",7),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function ge(t,s){if(t&1&&(_i(0,"li"),Iw(1),Jc()),t&2){let e=s.$implicit;gI(),Lh(e);}}function _e(t,s){if(t&1&&(_i(0,"section",8)(1,"h2"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"ul"),xD(5,ge,2,1,"li",null,ND),Jc()()),t&2){let e=HD(2);gI(2),Lh(Fw(3,1,"shortcuts.editor.validation")),gI(3),AD(e.validationErrors());}}function ve(t,s){if(t&1&&uh(0,"nz-option",12),t&2){let e=s.$implicit;lh("nzValue",e.id)("nzLabel",e.name);}}function we(t,s){if(t&1){let e=FD();_i(0,"app-workflow-input-form",14),mh("valuesChange",function(i){Fu(e);let u=HD(2);return ju(u.setInputValues(i))}),Jc();}if(t&2){let e=HD(2);lh("fields",s.inputSchema)("values",e.inputValues());}}function Ce(t,s){if(t&1){let e=FD();_D(0,_e,7,3,"section",8),_i(1,"label",9)(2,"span"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"input",10),mh("ngModelChange",function(i){Fu(e);let u=HD();return ju(u.name.set(i))}),Jc(),iE(),Jc(),_i(6,"div",9)(7,"span"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"nz-select",11),mh("ngModelChange",function(i){Fu(e);let u=HD();return ju(u.onWorkflowChange(i))}),xD(11,ve,1,2,"nz-option",12,ue),Jc(),iE(),Jc(),_D(13,we,1,2,"app-workflow-input-form",13);}if(t&2){let e,o=HD();MD(o.validationErrors().length>0?0:-1),gI(3),Lh(Fw(4,6,"shortcuts.editor.name")),gI(2),lh("ngModel",o.name()),aE(),gI(3),Lh(Fw(9,8,"shortcuts.editor.workflow")),gI(2),lh("ngModel",o.workflowId()),aE(),gI(),AD(o.eligibleWorkflows()),gI(2),MD((e=o.selectedWorkflow())?13:-1,e);}}function be(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 Ge=(()=>{class t{constructor(){this.route=C(C1),this.router=C(J1),this.shortcutsApi=C(m),this.nav=C(y),this.workflowsApi=C(b),this.message=C(He),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=Uw(()=>!this.routeId()),this.pageTitle=Uw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("shortcuts.editor.titleNew"):this.transloco.translate("shortcuts.editor.titleEdit",{name:this.name().trim()}))),this.eligibleWorkflows=Uw(()=>this.workflows().filter(e=>e.appliesTo==="none"&&e.subjectHandling==="per-subject")),this.selectedWorkflow=Uw(()=>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??be(this.name()),name:this.name().trim(),workflowId:this.workflowId(),inputValues:this.inputValues()},this.lastJobId()?{lastJobId:this.lastJobId()}:{}),i=d_.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.nav.refresh(),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=ZE({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),Iw(4),Jc()(),_i(5,"div",3)(6,"a",4),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"button",5),mh("click",function(){return i.save()}),Iw(10),Pw(11,"transloco"),Jc()()(),_D(12,he,3,3,"p",6)(13,fe,2,1,"p",7)(14,Ce,14,10),Jc()),o&2&&(gI(4),Lh(i.pageTitle()),gI(3),Lh(Fw(8,6,"shortcuts.editor.backToList")),gI(2),lh("nzLoading",i.saving())("disabled",i.loading()||!!i.loadError()),gI(),rl$1(" ",Fw(11,8,"common.save")," "),gI(2),MD(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{Ge as ShortcutEditorComponent};
|
package/static/chunk-C7P7hUiX.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a7 as KE,a8 as fu,bP as hn,aA as mT,C,a9 as Z0,ab as Oe$1,aB as yT,aC as zt,Z as ZE,as as st,at as Ee$1,au as w5,av as K0,aj as $D,l as _D,j as _i,J as Jc,M as MD,o as gI,aQ as aw,al as Sh,am as Ih,an as WD,ao as GD,aM as Yl,bQ as Wr,r as r$1,ai as ly,H as HD,aw as rh,w as lh,n as uh,aR as xw,ak as UD,x as xD,aO as SD,B as AD,bR as eD,bS as dh,aP as Mh,aJ as tl,I as Iw,aK as nl,L as Lh,bT as oh,ax as Eh,ac as Er,N as ND}from'./main-3VZRFHGG.js';var Ce=["*"];function fe(e,a){if(e&1&&(_i(0,"div",0),uh(1,"nz-skeleton-element",4),Jc()),e&2){let t=HD(2);gI(),lh("nzSize",t.avatar.size||"default")("nzShape",t.avatar.shape||"circle");}}function _e(e,a){if(e&1&&uh(0,"h3",5),e&2){let t=HD(2);Mh("width",t.toCSSUnit(t.title.width));}}function ve(e,a){if(e&1&&uh(0,"li"),e&2){let t=a.$index,n=HD(3);Mh("width",n.toCSSUnit(n.widthList[t]));}}function ge(e,a){if(e&1&&(_i(0,"ul",3),xD(1,ve,1,2,"li",6,ND),Jc()),e&2){let t=HD(2);gI(),AD(t.rowsList);}}function he(e,a){if(e&1&&(_D(0,fe,2,2,"div",0),_i(1,"div",1),_D(2,_e,1,2,"h3",2),_D(3,ge,3,0,"ul",3),Jc()),e&2){let t=HD();MD(t.nzAvatar?0:-1),gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzParagraph?3:-1);}}function Se(e,a){e&1&&UD(0);}var Te=(()=>{class e{nzActive=false;nzType;nzBlock=false;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["nz-skeleton-element"]],hostAttrs:[1,"ant-skeleton","ant-skeleton-element"],hostVars:4,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-active",i.nzActive)("ant-skeleton-block",i.nzBlock);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzType:"nzType",nzBlock:[2,"nzBlock","nzBlock",K0]}})}return e})();var ye=(()=>{class e{nzShape="circle";nzSize="default";styleMap={};ngOnChanges(t){if(t.nzSize&&typeof this.nzSize=="number"){let n=`${this.nzSize}px`;this.styleMap={width:n,height:n,"line-height":n};}else this.styleMap={};}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton-element","nzType","avatar"]],inputs:{nzShape:"nzShape",nzSize:"nzSize"},features:[ly],decls:1,vars:10,consts:[[1,"ant-skeleton-avatar"]],template:function(n,i){n&1&&dh(0,"span",0),n&2&&(aw(i.styleMap),Sh("ant-skeleton-avatar-square",i.nzShape==="square")("ant-skeleton-avatar-circle",i.nzShape==="circle")("ant-skeleton-avatar-lg",i.nzSize==="large")("ant-skeleton-avatar-sm",i.nzSize==="small"));},encapsulation:2})}return e})();var ce=(()=>{class e{cdr=C(Z0);nzActive=false;nzLoading=true;nzRound=false;nzTitle=true;nzAvatar=false;nzParagraph=true;title;avatar;paragraph;rowsList=[];widthList=[];toCSSUnit(t=""){return Wr(t)}getTitleProps(){let t=!!this.nzAvatar,n=!!this.nzParagraph,i="";return !t&&n?i="38%":t&&n&&(i="50%"),r$1({width:i},this.getProps(this.nzTitle))}getAvatarProps(){let t=this.nzTitle&&!this.nzParagraph?"square":"circle";return r$1({shape:t,size:"large"},this.getProps(this.nzAvatar))}getParagraphProps(){let t=!!this.nzAvatar,n=!!this.nzTitle,i={};return (!t||!n)&&(i.width="61%"),!t&&n?i.rows=3:i.rows=2,r$1(r$1({},i),this.getProps(this.nzParagraph))}getProps(t){return t&&typeof t=="object"?t:{}}getWidthList(){let{width:t,rows:n}=this.paragraph,i=[];return t&&Array.isArray(t)?i=t:t&&!Array.isArray(t)&&(i=[],i[n-1]=t),i}updateProps(){this.title=this.getTitleProps(),this.avatar=this.getAvatarProps(),this.paragraph=this.getParagraphProps(),this.rowsList=[...Array(this.paragraph.rows)],this.widthList=this.getWidthList(),this.cdr.markForCheck();}ngOnInit(){this.updateProps();}ngOnChanges(t){(t.nzTitle||t.nzAvatar||t.nzParagraph)&&this.updateProps();}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-skeleton"]],hostAttrs:[1,"ant-skeleton"],hostVars:6,hostBindings:function(n,i){n&2&&Sh("ant-skeleton-with-avatar",!!i.nzAvatar)("ant-skeleton-active",i.nzActive)("ant-skeleton-round",i.nzRound);},inputs:{nzActive:[2,"nzActive","nzActive",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzRound:[2,"nzRound","nzRound",K0],nzTitle:"nzTitle",nzAvatar:"nzAvatar",nzParagraph:"nzParagraph"},exportAs:["nzSkeleton"],features:[ly],ngContentSelectors:Ce,decls:2,vars:1,consts:[[1,"ant-skeleton-header"],[1,"ant-skeleton-content"],[1,"ant-skeleton-title",3,"width"],[1,"ant-skeleton-paragraph"],["nzType","avatar",3,"nzSize","nzShape"],[1,"ant-skeleton-title"],[3,"width"]],template:function(n,i){n&1&&($D(),_D(0,he,4,3)(1,Se,1,0)),n&2&&MD(i.nzLoading?0:1);},dependencies:[Te,ye],encapsulation:2})}return e})(),pe=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({})}return e})();function Ne(e,a){}function ke(e,a){if(e&1&&(_i(0,"div",0),rh(1,Ne,0,0,"ng-template",2),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzAvatar);}}function be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Me(e,a){if(e&1&&(_i(0,"div",3),rh(1,be,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Ae(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzDescription);}}function De(e,a){if(e&1&&(_i(0,"div",4),rh(1,Ae,2,1,"ng-container",5),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzDescription);}}function Ee(e,a){if(e&1&&(_i(0,"div",1),_D(1,Me,2,1,"div",3),_D(2,De,2,1,"div",4),Jc()),e&2){let t=HD();gI(),MD(t.nzTitle?1:-1),gI(),MD(t.nzDescription?2:-1);}}var me=["*"];function we(e,a){e&1&&UD(0);}var Pe=()=>({rows:4});function Be(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzTitle);}}function Oe(e,a){if(e&1&&(_i(0,"div",6),rh(1,Be,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzTitle);}}function Fe(e,a){if(e&1&&(tl(0),Iw(1),nl()),e&2){let t=HD(3);gI(),Lh(t.nzExtra);}}function Le(e,a){if(e&1&&(_i(0,"div",7),rh(1,Fe,2,1,"ng-container",9),Jc()),e&2){let t=HD(2);gI(),lh("nzStringTemplateOutlet",t.nzExtra);}}function He(e,a){}function Ie(e,a){if(e&1&&rh(0,He,0,0,"ng-template",8),e&2){let t=HD(2);lh("ngTemplateOutlet",t.listOfNzCardTabComponent.template);}}function qe(e,a){if(e&1&&(_i(0,"div",0)(1,"div",5),_D(2,Oe,2,1,"div",6),_D(3,Le,2,1,"div",7),Jc(),_D(4,Ie,1,1,null,8),Jc()),e&2){let t=HD();gI(2),MD(t.nzTitle?2:-1),gI(),MD(t.nzExtra?3:-1),gI(),MD(t.listOfNzCardTabComponent?4:-1);}}function je(e,a){}function Re(e,a){if(e&1&&(_i(0,"div",1),rh(1,je,0,0,"ng-template",8),Jc()),e&2){let t=HD();gI(),lh("ngTemplateOutlet",t.nzCover);}}function Ge(e,a){e&1&&uh(0,"nz-skeleton",3),e&2&&lh("nzActive",true)("nzTitle",false)("nzParagraph",xw(3,Pe));}function Qe(e,a){e&1&&UD(0);}function Ve(e,a){}function $e(e,a){if(e&1&&(_i(0,"li")(1,"span"),rh(2,Ve,0,0,"ng-template",8),Jc()()),e&2){let t=a.$implicit,n=a.$count;Mh("width",100/n,"%"),gI(2),lh("ngTemplateOutlet",t);}}function Ue(e,a){if(e&1&&(_i(0,"ul",4),xD(1,$e,3,3,"li",10,SD),Jc()),e&2){let t=HD();gI(),AD(t.nzActions);}}var We=(()=>{class e{nzHoverable=true;static \u0275fac=function(n){return new(n||e)};static \u0275dir=eD({type:e,selectors:[["","nz-card-grid",""]],hostAttrs:[1,"ant-card-grid"],hostVars:2,hostBindings:function(n,i){n&2&&Sh("ant-card-hoverable",i.nzHoverable);},inputs:{nzHoverable:[2,"nzHoverable","nzHoverable",K0]},exportAs:["nzCardGrid"]})}return e})(),Ze=(()=>{class e{nzTitle=null;nzDescription=null;nzAvatar=null;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-meta"]],hostAttrs:[1,"ant-card-meta"],inputs:{nzTitle:"nzTitle",nzDescription:"nzDescription",nzAvatar:"nzAvatar"},exportAs:["nzCardMeta"],decls:2,vars:2,consts:[[1,"ant-card-meta-avatar"],[1,"ant-card-meta-detail"],[3,"ngTemplateOutlet"],[1,"ant-card-meta-title"],[1,"ant-card-meta-description"],[4,"nzStringTemplateOutlet"]],template:function(n,i){n&1&&(_D(0,ke,2,1,"div",0),_D(1,Ee,3,2,"div",1)),n&2&&(MD(i.nzAvatar?0:-1),gI(),MD(i.nzTitle||i.nzDescription?1:-1));},dependencies:[w5,st,Ee$1],encapsulation:2})}return e})(),Je=(()=>{class e{template;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=ZE({type:e,selectors:[["nz-card-tab"]],viewQuery:function(n,i){if(n&1&&Eh(Er,7),n&2){let S;WD(S=GD())&&(i.template=S.first);}},exportAs:["nzCardTab"],ngContentSelectors:me,decls:1,vars:0,template:function(n,i){n&1&&($D(),oh(0,we,1,0,"ng-template"));},encapsulation:2})}return e})(),ze="card",Ke=(()=>{let e,a=[],t=[],n,i=[],S=[],W,Z=[],J=[];return class U{static{let C=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;e=[Yl()],n=[Yl()],W=[Yl()],mT(null,null,e,{kind:"field",name:"nzBordered",static:false,private:false,access:{has:r=>"nzBordered"in r,get:r=>r.nzBordered,set:(r,l)=>{r.nzBordered=l;}},metadata:C},a,t),mT(null,null,n,{kind:"field",name:"nzHoverable",static:false,private:false,access:{has:r=>"nzHoverable"in r,get:r=>r.nzHoverable,set:(r,l)=>{r.nzHoverable=l;}},metadata:C},i,S),mT(null,null,W,{kind:"field",name:"nzSize",static:false,private:false,access:{has:r=>"nzSize"in r,get:r=>r.nzSize,set:(r,l)=>{r.nzSize=l;}},metadata:C},Z,J),C&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:C});}cdr=C(Z0);dir=C(Oe$1).valueSignal;_nzModuleName=ze;nzBordered=yT(this,a,true);nzLoading=(yT(this,t),false);nzHoverable=yT(this,i,false);nzBodyStyle=(yT(this,S),null);nzCover;nzActions=[];nzType=null;nzSize=yT(this,Z,"default");nzTitle=yT(this,J);nzExtra;listOfNzCardTabComponent;listOfNzCardGridDirective;constructor(){zt(ze,()=>this.cdr.markForCheck());}static \u0275fac=function(r){return new(r||U)};static \u0275cmp=ZE({type:U,selectors:[["nz-card"]],contentQueries:function(r,l,K){if(r&1&&Ih(K,Je,5)(K,We,4),r&2){let E;WD(E=GD())&&(l.listOfNzCardTabComponent=E.first),WD(E=GD())&&(l.listOfNzCardGridDirective=E);}},hostAttrs:[1,"ant-card"],hostVars:16,hostBindings:function(r,l){r&2&&Sh("ant-card-loading",l.nzLoading)("ant-card-bordered",l.nzBordered)("ant-card-hoverable",l.nzHoverable)("ant-card-small",l.nzSize==="small")("ant-card-contain-grid",l.listOfNzCardGridDirective&&l.listOfNzCardGridDirective.length)("ant-card-type-inner",l.nzType==="inner")("ant-card-contain-tabs",!!l.listOfNzCardTabComponent)("ant-card-rtl",l.dir()==="rtl");},inputs:{nzBordered:[2,"nzBordered","nzBordered",K0],nzLoading:[2,"nzLoading","nzLoading",K0],nzHoverable:[2,"nzHoverable","nzHoverable",K0],nzBodyStyle:"nzBodyStyle",nzCover:"nzCover",nzActions:"nzActions",nzType:"nzType",nzSize:"nzSize",nzTitle:"nzTitle",nzExtra:"nzExtra"},exportAs:["nzCard"],ngContentSelectors:me,decls:6,vars:6,consts:[[1,"ant-card-head"],[1,"ant-card-cover"],[1,"ant-card-body"],[3,"nzActive","nzTitle","nzParagraph"],[1,"ant-card-actions"],[1,"ant-card-head-wrapper"],[1,"ant-card-head-title"],[1,"ant-card-extra"],[3,"ngTemplateOutlet"],[4,"nzStringTemplateOutlet"],[3,"width"]],template:function(r,l){r&1&&($D(),_D(0,qe,5,3,"div",0),_D(1,Re,2,1,"div",1),_i(2,"div",2),_D(3,Ge,1,4,"nz-skeleton",3)(4,Qe,1,0),Jc(),_D(5,Ue,3,0,"ul",4)),r&2&&(MD(l.nzTitle||l.nzExtra||l.listOfNzCardTabComponent?0:-1),gI(),MD(l.nzCover?1:-1),gI(),aw(l.nzBodyStyle),gI(),MD(l.nzLoading?3:4),gI(2),MD(l.nzActions.length?5:-1));},dependencies:[st,Ee$1,w5,pe,ce],encapsulation:2})}})(),Nt=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=KE({type:e});static \u0275inj=fu({imports:[Ke,Ze,hn]})}return e})();export{Ke as K,Nt as N};
|
package/static/chunk-CAxHAuhV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {f}from'./chunk-BIJScqTM.js';import {x,h,w}from'./chunk-D8qyjd0z.js';import {W,I}from'./chunk-Bok52e_k.js';import'./chunk-8ezEUcxN.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-CtiubhW7.js';import'./chunk-iIEmH_ui.js';import {Z as ZE,n as uh,C,$,V as Ve,b as at,S as p,q as qo,U as Uw,u as ue$1,aW as Ng,c as bi,d as $8,X as M5,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl,M as MD,H as HD,x as xD,B as AD,G as FD,D as ch,E as Aw,O as Fu,Q as ju}from'./main-3VZRFHGG.js';var pe=t=>["/jobs",t],ce=(t,d)=>d.id;function me(t,d){t&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function he(t,d){if(t&1&&(_i(0,"p",4),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function ue(t,d){if(t&1&&(_i(0,"p",5),Iw(1),Jc()),t&2){let e=HD(2);gI(),Lh(e.actionError());}}function fe(t,d){t&1&&(_i(0,"p",6),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"worktrees.activeWarning")));}function ge(t,d){t&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"worktrees.emptyState")));}function Ce(t,d){if(t&1){let e=FD();_i(0,"tr")(1,"td")(2,"label",9),mh("nzCheckedChange",function(l){let b=Fu(e).$implicit,le=HD(3);return ju(le.toggleSelected(b.id,l))}),Jc()(),_i(3,"td")(4,"a",10),Iw(5),Jc()(),_i(6,"td"),Iw(7),Jc(),_i(8,"td"),Iw(9),Jc(),_i(10,"td",11),Iw(11),Jc(),_i(12,"td")(13,"nz-tag",12),Iw(14),Pw(15,"transloco"),Jc()(),_i(16,"td"),Iw(17),Jc()();}if(t&2){let e=d.$implicit,i=HD(3);ch("data-testid","worktree-row-"+e.id),gI(2),lh("nzChecked",i.isSelected(e.id)),ch("data-testid","worktree-select-"+e.id),gI(2),lh("routerLink",Aw(16,pe,e.id)),ch("data-testid","worktree-job-"+e.id),gI(),Lh(e.id),gI(2),Lh(i.repoName(e)),gI(2),Lh(e.branch??"\u2014"),gI(2),Lh(e.worktreePath),gI(2),lh("nzColor",i.jobStatusTagColor(e.status,i.theme.theme()))("ngClass",i.jobStatusTagClass(e.status,i.theme.theme())),ch("data-testid","worktree-status-"+e.id),gI(),Lh(Fw(15,14,i.statusKey(e.status))),gI(3),Lh(e.createdAt);}}function xe(t,d){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr"),uh(3,"th"),_i(4,"th"),Iw(5),Pw(6,"transloco"),Jc(),_i(7,"th"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"th"),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"th"),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"th"),Iw(17),Pw(18,"transloco"),Jc(),_i(19,"th"),Iw(20),Pw(21,"transloco"),Jc()()(),_i(22,"tbody"),xD(23,Ce,18,18,"tr",null,ce),Jc()()),t&2){let e=HD(2);lh("nzData",e.jobs())("nzShowPagination",false),gI(5),Lh(Fw(6,8,"worktrees.column.job")),gI(3),Lh(Fw(9,10,"worktrees.column.repository")),gI(3),Lh(Fw(12,12,"worktrees.column.branch")),gI(3),Lh(Fw(15,14,"worktrees.column.path")),gI(3),Lh(Fw(18,16,"worktrees.column.status")),gI(3),Lh(Fw(21,18,"worktrees.column.created")),gI(3),AD(e.jobs());}}function be(t,d){if(t&1&&(_D(0,ue,2,1,"p",5),_D(1,fe,3,3,"p",6),_D(2,ge,3,3,"p",7)(3,xe,25,20,"nz-table",8)),t&2){let e=HD();MD(e.actionError()?0:-1),gI(),MD(e.selectedHasActive()?1:-1),gI(),MD(e.jobs().length===0?2:3);}}var se=(()=>{class t{constructor(){this.jobsApi=C($),this.reposApi=C(f),this.transloco=C(Ve),this.destroyRef=C(at),this.theme=C(p),this.jobStatusTagClass=x,this.jobStatusTagColor=h,this.jobs=qo([]),this.repos=qo([]),this.selectedIds=qo([]),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.deleting=qo(false),this.selectedHasActive=Uw(()=>this.selectedJobs().some(e=>!w(e.status))),this.selectedJobs=Uw(()=>{let e=new Set(this.selectedIds());return this.jobs().filter(i=>e.has(i.id))}),this.reload();}statusKey(e){return `jobs.status.${e}`}repoName(e){return this.repos().find(l=>_e(e,l))?.name??"\u2014"}isSelected(e){return this.selectedIds().includes(e)}toggleSelected(e,i){this.selectedIds.update(l=>i?l.includes(e)?l:[...l,e]:l.filter(b=>b!==e)),this.actionError.set(null);}deleteSelected(){if(!(this.deleting()||this.selectedIds().length===0)){if(this.selectedHasActive()){this.actionError.set(this.transloco.translate("worktrees.activeWarning"));return}this.deleting.set(true),this.actionError.set(null),this.jobsApi.deleteWorktrees(this.selectedIds()).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.deleting.set(false),this.selectedIds.set([]),this.reload();},error:e=>{this.deleting.set(false),this.actionError.set(this.errorMessage(e,this.transloco.translate("worktrees.deleteFailed")));}});}}reload(){this.loading.set(true),this.loadError.set(null),Ng({jobs:this.jobsApi.list({liveWorktree:true}),repos:this.reposApi.list()}).pipe(ue$1(this.destroyRef)).subscribe({next:({jobs:e,repos:i})=>{this.jobs.set(e),this.repos.set(i),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("worktrees.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=ZE({type:t,selectors:[["app-worktree-list"]],decls:11,vars:8,consts:[["data-testid","worktrees-manage",1,"list-page"],[1,"header"],["nz-button","","nzDanger","","type","button","data-testid","delete-worktrees",3,"click","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","action-error",1,"error"],["data-testid","active-warning",1,"warn"],["data-testid","empty-state",1,"empty"],["data-testid","worktree-table",3,"nzData","nzShowPagination"],["nz-checkbox","",3,"nzCheckedChange","nzChecked"],[3,"routerLink"],[1,"path-cell"],[3,"nzColor","ngClass"]],template:function(i,l){i&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"button",2),mh("click",function(){return l.deleteSelected()}),Iw(6),Pw(7,"transloco"),Jc()(),_D(8,me,3,3,"p",3)(9,he,2,1,"p",4)(10,be,4,3),Jc()),i&2&&(gI(3),Lh(Fw(4,4,"worktrees.title")),gI(2),lh("disabled",l.deleting()||l.selectedIds().length===0),gI(),rl(" ",Fw(7,6,"worktrees.deleteSelected")," "),gI(2),MD(l.loading()?8:l.loadError()?9:10));},dependencies:[$8,M5,v3,pf,bd,sp,fp,Lt,ut,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}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.warn[_ngcontent-%COMP%]{color:#92400e}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return t})();function _e(t,d){let e=(t.worktreePath??"").replaceAll("\\","/"),i=d.localPath.replaceAll("\\","/").replace(/\/+$/,""),l=(d.worktreeBasePath??ke(i)).replaceAll("\\","/");return e.startsWith(l)||e.startsWith(i)}function ke(t){let d=t.split("/"),e=d.pop()??"repo";return `${d.join("/")}/${e}-worktrees`}var qe=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-worktrees-manage"]],decls:1,vars:0,template:function(i,l){i&1&&uh(0,"app-worktree-list");},dependencies:[se],encapsulation:2});}}return t})();export{qe as WorktreesManageComponent};
|
package/static/chunk-CZA-kp5w.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {w as we}from'./chunk-BowAQ7m9.js';import {A as At}from'./chunk-BKYaECRn.js';import {a as ae,l as le}from'./chunk-EDwdt-Wk.js';import'./chunk-CwEMAptL.js';import'./chunk-BIJScqTM.js';import {C,a as C1,b6 as U,$,V as Ve,b as at$1,q as qo,U as Uw,u as ue,r as r$1,aW as Ng,aY as Dg,c as bi,Z as ZE,d as $8,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,J as Jc,o as gI,M as MD,I as Iw,P as Pw,L as Lh,p as Fw,H as HD,G as FD,m as mh,w as lh,z as rl,O as Fu,Q as ju,n as uh,E as Aw}from'./main-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import {G as Gn,u as un}from'./chunk-bSS_wejP.js';import'./chunk-Dm_EWkUz.js';import {U as U$1}from'./chunk-YU-Bg77r.js';import'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';var et=i=>["/batches",i];function it(i,r){i&1&&(_i(0,"p",1),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function nt(i,r){if(i&1&&(_i(0,"p",2),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function ot(i,r){i&1&&(_i(0,"a",10),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(lh("routerLink",Aw(4,et,r)),gI(),rl(" ",Fw(2,2,"views.detail.openBatch")," "));}function at(i,r){if(i&1&&(uh(0,"nz-alert",9),_D(1,ot,3,6,"a",10)),i&2){let t,e=HD(2);lh("nzMessage",e.confirmation()),gI(),MD((t=e.confirmationBatchId())?1:-1,t);}}function lt(i,r){i&1&&(_i(0,"p",11),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),rl(" ",Fw(2,1,"views.detail.noBulkWorkflows")," "));}function rt(i,r){if(i&1&&(_i(0,"p",14),Iw(1),Jc()),i&2){let t=HD(4);gI(),Lh(t.launchError());}}function st(i,r){if(i&1){let t=FD();_i(0,"p",12),Iw(1),Jc(),_i(2,"app-workflow-input-form",13),mh("valuesChange",function(n){Fu(t);let s=HD(3);return ju(s.setInputValues(n))}),Jc(),_D(3,rt,2,1,"p",14),_i(4,"div",15)(5,"button",16),mh("click",function(){Fu(t);let n=HD(3);return ju(n.launch())}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",17),mh("click",function(){Fu(t);let n=HD(3);return ju(n.cancelLaunch())}),Iw(9),Pw(10,"transloco"),Jc()();}if(i&2){let t=r,e=HD(3);gI(),Lh(t.name),gI(),lh("fields",t.inputSchema)("values",e.inputValues()),gI(),MD(e.launchError()?3:-1),gI(2),lh("nzLoading",e.launching())("disabled",e.launching()),gI(),rl(" ",Fw(7,8,e.launching()?"views.detail.launching":"views.detail.launch")," "),gI(3),rl(" ",Fw(10,10,"views.detail.cancelLaunch")," ");}}function ct(i,r){if(i&1&&(_i(0,"section",6)(1,"h2"),Iw(2),Pw(3,"transloco"),Jc(),_D(4,lt,3,3,"p",11)(5,st,11,12),Jc()),i&2){let t,e=HD(2);gI(2),rl(" ",Fw(3,2,r==="view"?"views.detail.launchViewTitle":"views.detail.launchSelectedTitle")," "),gI(2),MD(e.canBulkLaunch()?(t=e.boundWorkflow())?5:-1:4,t);}}function dt(i,r){i&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"views.detail.emptySubjects")));}function ut(i,r){if(i&1){let t=FD();_i(0,"app-runnable-items-table",18),mh("rowAction",function(n){Fu(t);let s=HD(2);return ju(s.onRowAction(n))})("bulkAction",function(n){Fu(t);let s=HD(2);return ju(s.onBulkAction(n))}),Jc();}if(i&2){let t=HD(2);lh("rows",t.rows())("selectable",true)("showRowAction",t.showRowAction());}}function pt(i,r){if(i&1){let t=FD();_i(0,"header",3)(1,"h1",4),Iw(2),Jc(),_i(3,"button",5),mh("click",function(){Fu(t);let n=HD();return ju(n.beginLaunch("view"))}),Iw(4),Pw(5,"transloco"),Jc()(),_D(6,at,2,2),_D(7,ct,6,4,"section",6),_D(8,dt,3,3,"p",7)(9,ut,1,3,"app-runnable-items-table",8);}if(i&2){let t,e=HD();gI(2),Lh(r.name),gI(),lh("disabled",!e.canBulkLaunch()),gI(),rl(" ",Fw(5,6,"views.detail.runOnAll")," "),gI(2),MD(e.confirmation()?6:-1),gI(),MD((t=e.launchMode())?7:-1,t),gI(),MD(e.subjects().length===0?8:9);}}var zt=(()=>{class i{constructor(){this.route=C(C1),this.viewsApi=C(U),this.workflowsApi=C(b),this.batchesApi=C(U$1),this.jobsApi=C($),this.startJob=C(At),this.transloco=C(Ve),this.destroyRef=C(at$1),this.view=qo(null),this.subjects=qo([]),this.workflows=qo([]),this.latestBySubject=qo({}),this.loading=qo(true),this.loadError=qo(null),this.selectedIds=qo([]),this.launchMode=qo(null),this.inputValues=qo({}),this.launching=qo(false),this.launchError=qo(null),this.confirmation=qo(null),this.confirmationBatchId=qo(null),this.boundWorkflow=Uw(()=>{let t=this.view();return t?this.workflows().find(e=>e.id===t.workflowId)??null:null}),this.canBulkLaunch=Uw(()=>this.boundWorkflow()!=null),this.showRowAction=Uw(()=>this.boundWorkflow()?.subjectHandling==="per-subject"),this.rows=Uw(()=>{let t=this.latestBySubject();return this.subjects().map(e=>({id:e.id,primaryLabel:e.title,subtitle:this.subjectDetails(e),latestJob:t[e.id]??null}))}),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("views.detail.loadFailed"));return}this.load(e);});}subjectDetails(t){if(t.subjectType==="ticket")return [t.status,t.assignee].filter(Boolean).join(" \xB7 ");if(t.subjectType==="pull_request"){let e=`${t.sourceBranch} \u2192 ${t.targetBranch}`;return t.author?`${t.author} \xB7 ${e}`:e}return t.url??""}onBulkAction(t){this.selectedIds.set(t),this.beginLaunch("manual");}onRowAction(t){let e=this.view();e&&this.startJob.start({workflowId:e.workflowId,subjectId:t});}beginLaunch(t){t==="manual"&&this.selectedIds().length===0||(this.launchError.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),this.launchMode.set(t),this.inputValues.set(ae(this.boundWorkflow()?.inputSchema??[])));}cancelLaunch(){this.launchMode.set(null),this.launchError.set(null);}setInputValues(t){this.inputValues.set(t);}launch(){let t=this.view(),e=this.boundWorkflow(),n=this.launchMode();if(!t||!e||!n)return;let s=n==="view"?{mode:"view",viewId:t.id}:{mode:"manual",subjectType:t.subjectType,subjectIds:[...this.selectedIds()]};this.launching.set(true),this.launchError.set(null),this.batchesApi.launch({workflowId:e.id,selection:s,triggeredBy:n==="view"?"view_bulk":"multiselect",inputValues:r$1({},this.inputValues())}).pipe(ue(this.destroyRef)).subscribe({next:w=>{this.launching.set(false),this.confirmation.set(this.confirmationMessage(w)),this.confirmationBatchId.set(w.kind==="batch"?w.batch.id:null),this.launchMode.set(null),this.refreshLatest(t.workflowId,this.subjects().map(tt=>tt.id));},error:w=>{this.launching.set(false),this.launchError.set(this.errorMessage(w,this.transloco.translate("views.detail.launchFailed")));}});}confirmationMessage(t){return t.kind==="batch"?this.transloco.translate("views.detail.confirmation.batch",{id:t.batch.id,count:t.batch.jobIds.length}):this.transloco.translate("views.detail.confirmation.job",{id:t.job.id})}load(t){this.loading.set(true),this.loadError.set(null),this.selectedIds.set([]),this.launchMode.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),Ng({view:this.viewsApi.get(t),subjects:this.viewsApi.getSubjects(t),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({view:e,subjects:n,workflows:s})=>{this.view.set(e),this.subjects.set(n),this.workflows.set(s),this.loading.set(false),this.refreshLatest(e.workflowId,n.map(w=>w.id));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("views.detail.loadFailed")));}});}refreshLatest(t,e){(e.length===0?Dg({}):this.jobsApi.latestBySubject(t,e)).pipe(ue(this.destroyRef)).subscribe({next:s=>this.latestBySubject.set(s),error:()=>this.latestBySubject.set({})});}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=ZE({type:i,selectors:[["app-view-detail"]],decls:4,vars:1,consts:[["data-testid","view-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["data-testid","view-name"],["nz-button","","nzType","primary","type","button","data-testid","run-on-all",3,"click","disabled"],["data-testid","launch-panel",1,"launch-panel"],["data-testid","empty-subjects",1,"muted"],[3,"rows","selectable","showRowAction"],["data-testid","launch-confirmation","nzType","success",3,"nzMessage"],["nz-button","","nzType","link","data-testid","open-batch",3,"routerLink"],["data-testid","no-bulk-workflows",1,"muted"],["data-testid","launch-workflow",1,"muted"],[3,"valuesChange","fields","values"],["data-testid","launch-error",1,"error"],[1,"launch-actions"],["nz-button","","nzType","primary","type","button","data-testid","launch-submit",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","launch-cancel",3,"click"],[3,"rowAction","bulkAction","rows","selectable","showRowAction"]],template:function(e,n){if(e&1&&(_i(0,"main",0),_D(1,it,3,3,"p",1)(2,nt,2,1,"p",2)(3,pt,10,8),Jc()),e&2){let s;gI(),MD(n.loading()?1:n.loadError()?2:(s=n.view())?3:-1,s);}},dependencies:[$8,v3,Gn,un,pf,bd,sp,fp,le,we,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:center}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:14rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.launch-panel[_ngcontent-%COMP%]{padding:1rem;border:1px solid #d6d3d1;background:#ffffffb3}.launch-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.launch-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;margin-top:.5rem}.muted[_ngcontent-%COMP%]{color:#78716c}.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 i})();export{zt as ViewDetailComponent};
|
package/static/chunk-CwEMAptL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {$}from'./chunk-iIEmH_ui.js';import {s,r as r$1,ch as Sy,i as ie,C,bt as Ee,d5 as go,dg as Ul,dh as Fd,di as kn,aC as zt,bQ as Wr,Z as ZE,c3 as th,j as _i,x as xD,N as ND,J as Jc,aP as Mh,al as Sh,o as gI,B as AD,ap as re,a9 as Z0,be as E3,bR as eD,ae as Le$1,bs as G0,bf as _r,a3 as Ah,a4 as Th,as as st,at as Ee$1,m as mh,l as _D,aw as rh,aQ as aw,aG as lw,M as MD,w as lh,cM as Rw,bH as wh,bI as zD,G as FD,b as at,n as uh,aJ as tl,aK as nl,H as HD,O as Fu,Q as ju,aU as vv}from'./main-3VZRFHGG.js';var ce=["animationElement"],me=(n,o)=>({$implicit:n,data:o});function le(n,o){n&1&&uh(0,"nz-icon",4);}function pe(n,o){n&1&&uh(0,"nz-icon",5);}function de(n,o){n&1&&uh(0,"nz-icon",6);}function he(n,o){n&1&&uh(0,"nz-icon",7);}function fe(n,o){n&1&&uh(0,"nz-icon",8);}function ue(n,o){if(n&1&&(tl(0),uh(1,"span",10),nl()),n&2){let e=HD();gI(),lh("innerHTML",e.instance.content,vv);}}function ge(n,o){if(n&1){let e=FD();_i(0,"nz-message",2),mh("destroyed",function(i){Fu(e);let s=HD();return ju(s.remove(i.id,i.userAction))}),Jc();}if(n&2){let e=o.$implicit;lh("instance",e);}}var ve=0,M=class{container;nzSingletonService=C($);injector=C(Ee);remove(o){this.container&&(o?this.container.remove(o):this.container.removeAll());}getInstanceId(){return `${this.componentPrefix}-${ve++}`}withContainer(o){let e=this.nzSingletonService.getSingletonWithKey(this.componentPrefix);if(e)return e;let t=go(this.injector,{hasBackdrop:false,scrollStrategy:Fd(),positionStrategy:Ul(this.injector)}),i=new kn(o,null,this.injector),s=t.attach(i),re=t.hostElement;return re.style.zIndex="1010",e||(this.container=e=s.instance,this.nzSingletonService.registerSingletonWithKey(this.componentPrefix,e),this.container.afterAllInstancesRemoved.subscribe(()=>{this.container=void 0,this.nzSingletonService.unregisterSingletonWithKey(this.componentPrefix),t.dispose();})),e}},Ce=(()=>{class n{config;instances=[];_afterAllInstancesRemoved=new re;afterAllInstancesRemoved=this._afterAllInstancesRemoved.asObservable();cdr=C(Z0);nzConfigService=C(E3);constructor(){this.subscribeConfigChange();}create(e){let t=this.onCreate(e);return this.instances.length>=this.config.nzMaxStack&&(this.instances=this.instances.slice(1)),this.instances=[...this.instances,t],this.readyInstances(),t}remove(e,t=false){this.instances.map((i,s)=>({index:s,instance:i})).filter(({instance:i})=>i.messageId===e).forEach(({index:i,instance:s})=>{this.instances.splice(i,1),this.instances=[...this.instances],this.onRemove(s,t),this.readyInstances();}),this.instances.length||this.onAllInstancesRemoved();}removeAll(){this.instances.forEach(e=>this.onRemove(e,false)),this.instances=[],this.readyInstances(),this.onAllInstancesRemoved();}onCreate(e){return e.options=this.mergeOptions(e.options),e.onClose=new re,e}onRemove(e,t){e.onClose.next(t),e.onClose.complete();}onAllInstancesRemoved(){this._afterAllInstancesRemoved.next(),this._afterAllInstancesRemoved.complete();}readyInstances(){this.cdr.detectChanges();}mergeOptions(e){let{nzDuration:t,nzAnimate:i,nzPauseOnHover:s}=this.config;return r$1({nzDuration:t,nzAnimate:i,nzPauseOnHover:s},e)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=eD({type:n})}return n})(),ye=(()=>{class n{destroyRef=C(at);elementRef=C(_r);options;autoClose;userAction=false;eraseTimer;eraseTimingStart;eraseTTL;constructor(){this.destroyRef.onDestroy(()=>{this.autoClose&&this.clearEraseTimeout();});}ngOnInit(){this.options=this.instance.options,this.options.nzAnimate&&this._startEnterAnimation(),this.autoClose=this.options.nzDuration>0,this.autoClose&&(this.initErase(),this.startEraseTimeout());}onEnter(){this.autoClose&&this.options.nzPauseOnHover&&(this.clearEraseTimeout(),this.updateTTL());}onLeave(){this.autoClose&&this.options.nzPauseOnHover&&this.startEraseTimeout();}destroy(e=false){this.userAction=e,this.options.nzAnimate?this._startLeaveAnimation(()=>this.destroyed.next({id:this.instance.messageId,userAction:e})):this.destroyed.next({id:this.instance.messageId,userAction:e});}initErase(){this.eraseTTL=this.options.nzDuration,this.eraseTimingStart=Date.now();}updateTTL(){this.autoClose&&(this.eraseTTL-=Date.now()-this.eraseTimingStart);}startEraseTimeout(){this.eraseTTL>0?(this.clearEraseTimeout(),this.eraseTimer=setTimeout(()=>this.destroy(),this.eraseTTL),this.eraseTimingStart=Date.now()):this.destroy();}clearEraseTimeout(){this.eraseTimer!==null&&(clearTimeout(this.eraseTimer),this.eraseTimer=void 0);}_startEnterAnimation(){let e=this.animationElement().nativeElement;e.classList.add(this._animationClassMap.enter);let t=i=>{this.matchAnimationKeyframe(i,this._animationKeyframeMap.enter)&&(e.removeEventListener("animationend",t),e.classList.remove(this._animationClassMap.enter));};e.addEventListener("animationend",t);}_startLeaveAnimation(e){let t=this.animationElement().nativeElement;t.classList.remove(this._animationClassMap.enter),t.classList.add(this._animationClassMap.leave);let i=s=>{this.matchAnimationKeyframe(s,this._animationKeyframeMap.leave)&&(t.removeEventListener("animationend",i),e());};t.addEventListener("animationend",i);}matchAnimationKeyframe(e,t){return typeof t=="string"?e.animationName===t:t.includes(e.animationName)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=eD({type:n})}return n})(),ze=(()=>{class n extends ye{instance;destroyed=new Le$1;index;animationElement=G0.required("animationElement",{read:_r});_animationKeyframeMap={enter:"MessageMoveIn",leave:"MessageMoveOut"};_animationClassMap={enter:"ant-message-move-up-enter",leave:"ant-message-move-up-leave"};static \u0275fac=(()=>{let e;return function(i){return (e||(e=Sy(n)))(i||n)}})();static \u0275cmp=ZE({type:n,selectors:[["nz-message"]],viewQuery:function(t,i){t&1&&wh(i.animationElement,ce,5,_r),t&2&&zD();},inputs:{instance:"instance"},outputs:{destroyed:"destroyed"},exportAs:["nzMessage"],features:[th],decls:10,vars:12,consts:[["animationElement",""],[1,"ant-message-notice",3,"mouseenter","mouseleave"],[1,"ant-message-notice-content"],[1,"ant-message-custom-content"],["nzType","check-circle"],["nzType","info-circle"],["nzType","exclamation-circle"],["nzType","close-circle"],["nzType","loading"],[4,"nzStringTemplateOutlet","nzStringTemplateOutletContext"],[3,"innerHTML"]],template:function(t,i){if(t&1&&(_i(0,"div",1,0),mh("mouseenter",function(){return i.onEnter()})("mouseleave",function(){return i.onLeave()}),_i(2,"div",2)(3,"div",3),_D(4,le,1,0,"nz-icon",4)(5,pe,1,0,"nz-icon",5)(6,de,1,0,"nz-icon",6)(7,he,1,0,"nz-icon",7)(8,fe,1,0,"nz-icon",8),rh(9,ue,2,1,"ng-container",9),Jc()()()),t&2){let s;aw(i.instance.options?.nzStyle),lw(i.instance.options?.nzClass),gI(3),lw("ant-message-"+i.instance.type),gI(),MD((s=i.instance.type)==="success"?4:s==="info"?5:s==="warning"?6:s==="error"?7:s==="loading"?8:-1),gI(5),lh("nzStringTemplateOutlet",i.instance.content)("nzStringTemplateOutletContext",Rw(9,me,i,i.instance.options?.nzData));}},dependencies:[Ah,Th,st,Ee$1],encapsulation:2})}return n})(),f="message",_e={nzAnimate:true,nzDuration:3e3,nzMaxStack:7,nzPauseOnHover:true,nzTop:24,nzDirection:"ltr"},Te=(()=>{class n extends Ce{dir=this.nzConfigService.getConfigForComponent(f)?.nzDirection||"ltr";top;constructor(){super(),this.updateConfig();}subscribeConfigChange(){zt(f,()=>{this.updateConfig(),this.dir=this.nzConfigService.getConfigForComponent(f)?.nzDirection||this.dir;});}updateConfig(){this.config=r$1(r$1(r$1({},_e),this.config),this.nzConfigService.getConfigForComponent(f)),this.top=Wr(this.config.nzTop),this.cdr.markForCheck();}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ZE({type:n,selectors:[["nz-message-container"]],exportAs:["nzMessageContainer"],features:[th],decls:3,vars:4,consts:[[1,"ant-message"],[3,"instance"],[3,"destroyed","instance"]],template:function(t,i){t&1&&(_i(0,"div",0),xD(1,ge,1,1,"nz-message",1,ND),Jc()),t&2&&(Mh("top",i.top),Sh("ant-message-rtl",i.dir==="rtl"),gI(),AD(i.instances));},dependencies:[ze],encapsulation:2})}return n})(),He=(()=>{class n extends M{componentPrefix="message-";success(e,t){return this.createInstance({type:"success",content:e},t)}error(e,t){return this.createInstance({type:"error",content:e},t)}info(e,t){return this.createInstance({type:"info",content:e},t)}warning(e,t){return this.createInstance({type:"warning",content:e},t)}loading(e,t){return this.createInstance({type:"loading",content:e},t)}create(e,t,i){return this.createInstance({type:e,content:t},i)}createInstance(e,t){return this.container=this.withContainer(Te),this.container.create(s(r$1({},e),{createdAt:new Date,messageId:this.getInstanceId(),options:t}))}static \u0275fac=(()=>{let e;return function(i){return (e||(e=Sy(n)))(i||n)}})();static \u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();export{He as H};
|
package/static/chunk-D1355dNd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {w as we}from'./chunk-BowAQ7m9.js';import {_ as _n}from'./chunk-vINo5yVD.js';import {C,b7 as m,b8 as y,$,R as J1,V as Ve,b as at,q as qo,U as Uw,u as ue,aW as Ng,c as bi,Z as ZE,d as $8,v as v3,Y as pf,a0 as bd,a1 as sp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,l as _D,o as gI,L as Lh,p as Fw,z as rl,M as MD,H as HD,G as FD,m as mh,w as lh,O as Fu,Q as ju}from'./main-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import'./chunk-CtiubhW7.js';import'./chunk-iIEmH_ui.js';function G(i,b){i&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function H(i,b){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function K(i,b){if(i&1&&(_i(0,"p",5),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.actionError());}}function Q(i,b){i&1&&(_i(0,"section",6)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"a",8),Iw(5),Pw(6,"transloco"),Jc()()),i&2&&(gI(2),Lh(Fw(3,2,"shortcuts.list.emptyState")),gI(3),rl(" ",Fw(6,4,"shortcuts.list.emptyCreateButton")," "));}function X(i,b){if(i&1){let t=FD();_i(0,"app-runnable-items-table",9),mh("rowAction",function(e){Fu(t);let c=HD(2);return ju(c.onRowAction(e))}),Jc();}if(i&2){let t=HD(2);lh("rows",t.rows())("selectable",false)("showRowAction",true);}}function Y(i,b){if(i&1&&(_D(0,K,2,1,"p",5),_D(1,Q,7,6,"section",6)(2,X,1,3,"app-runnable-items-table",7)),i&2){let t=HD();MD(t.actionError()?0:-1),gI(),MD(t.shortcuts().length===0?1:2);}}var bt=(()=>{class i{constructor(){this.shortcutsApi=C(m),this.nav=C(y),this.workflowsApi=C(b),this.jobsApi=C($),this.router=C(J1),this.transloco=C(Ve),this.destroyRef=C(at),this.shortcuts=qo([]),this.workflows=qo([]),this.jobsById=qo({}),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.rows=Uw(()=>{let t=this.jobsById(),o=this.workflows();return this.shortcuts().map(e=>({id:e.id,primaryLabel:e.name,subtitle:o.find(c=>c.id===e.workflowId)?.name,latestJob:e.lastJobId?t[e.lastJobId]??null:null}))}),this.load();}onRowAction(t){let o=this.shortcuts().find(e=>e.id===t);o&&(this.actionError.set(null),this.jobsApi.start({workflowId:o.workflowId,inputValues:o.inputValues}).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.shortcutsApi.update(o.id,{lastJobId:e.id}).pipe(ue(this.destroyRef)).subscribe({next:c=>{this.shortcuts.update(q=>q.map(C=>C.id===c.id?c:C)),this.router.navigate(["/jobs",e.id]);},error:()=>{this.router.navigate(["/jobs",e.id]);}});},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("shortcuts.list.runFailed")));}}));}deleteShortcut(t){this.actionError.set(null),this.shortcutsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.nav.refresh(),this.shortcuts.update(o=>o.filter(e=>e.id!==t));},error:o=>{this.actionError.set(this.errorMessage(o,this.transloco.translate("shortcuts.list.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({shortcuts:this.shortcutsApi.list(),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({shortcuts:t,workflows:o})=>{this.shortcuts.set(t),this.workflows.set(o),this.loading.set(false),this.loadLatestJobs(t);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("shortcuts.list.loadFailed")));}});}loadLatestJobs(t){let o=t.map(e=>e.lastJobId).filter(e=>e!=null);if(o.length===0){this.jobsById.set({});return}Ng(Object.fromEntries(o.map(e=>[e,this.jobsApi.get(e)]))).pipe(ue(this.destroyRef)).subscribe({next:e=>this.jobsById.set(e),error:()=>this.jobsById.set({})});}errorMessage(t,o){return t instanceof bi||t instanceof Error?t.message:o}static{this.\u0275fac=function(o){return new(o||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-shortcut-list"]],decls:11,vars:7,consts:[["data-testid","shortcuts-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","create-shortcut"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","action-error",1,"error"],["data-testid","empty-state",1,"empty"],[3,"rows","selectable","showRowAction"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","empty-create"],[3,"rowAction","rows","selectable","showRowAction"]],template:function(o,e){o&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"a",2),Iw(6),Pw(7,"transloco"),Jc()(),_D(8,G,3,3,"p",3)(9,H,2,1,"p",4)(10,Y,3,2),Jc()),o&2&&(gI(3),Lh(Fw(4,3,"shortcuts.list.title")),gI(3),rl(" ",Fw(7,5,"shortcuts.list.createButton")," "),gI(2),MD(e.loading()?8:e.loadError()?9:10));},dependencies:[$8,v3,pf,bd,sp,_n,we,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}.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}"]});}}return i})();export{bt as ShortcutListComponent};
|
package/static/chunk-D8qyjd0z.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {T as Ty}from'./chunk-8ezEUcxN.js';function p(t){switch(t){case "completed":return "success";case "failed":return "error";case "waiting_for_human":case "waiting_for_children":return "info";case "pending":case "cancelled":return "muted";case "planning":case "implementing":case "testing":return "primary"}}function d(t){switch(t){case "completed":return "success";case "failed":return "error";case "completed_with_issues":case "cancelled":return "warning";default:return null}}function m(t){switch(t){case "completed":return "success";case "failed":return "error";case "queued":case "waiting_for_children":return "info";case "running":return "primary";case "pending":case "skipped":return "muted"}}function a(t,e){if(!(!t||e==="dark"))switch(t){case "success":return "success";case "warning":return "warning";case "error":return "error";case "info":case "primary":case "muted":return}}function f(t,e){return !t||e!=="dark"&&!(t==="info"||t==="primary"||t==="muted")?"":`knoflows-tag-${t}`}function x(t,e){return f(p(t),e)}function h(t,e){return a(p(t),e)}function y(t,e){return f(d(t),e)}function S(t,e){return a(d(t),e)}function T(t,e){return f(m(t),e)}function _(t,e){return a(m(t),e)}var g=new Set(["completed","failed","cancelled"]);function C(t){return t==="agent"||t==="shell"||t==="git"||t==="provider_action"}function w(t){return g.has(t)}function I(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 w(t.status)&&t.stepHistory.length>0?t.stepHistory[t.stepHistory.length-1]??null:null}function k(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 O(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 b(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 v(t,e,n,r){let i=t.findIndex(s=>s.id===n);if(!(i<0))for(let s=i-1;s>=0;s-=1){let o=t[s];if(o.type!=="agent")continue;let c=e.find(u=>u.stepDefinitionId===o.id);if(c?.output!==void 0)return c.output;if(Object.prototype.hasOwnProperty.call(r.context,o.id))return r.context[o.id]}}function D(t){let e=t.waitingEvent;if(e&&e.questions.length>0)return e.questions;let n=e?.data??t.selectedOutput??t.priorOutput,r=Ty(t.interaction,n);return r.length>0?r:e?.data!=null?[JSON.stringify(e.data,null,2)]:[]}function E(t){return t.waitingEvent?.data??t.selectedOutput??t.priorOutput}function H(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,s)=>{let o="",c="";if(typeof i=="string")c=i.trim();else if(i&&typeof i=="object"){let u=i;typeof u.prompt=="string"&&(c=u.prompt.trim()),typeof u.id=="string"&&(o=u.id.trim());}if(c){if(!o){let u=`q${s+1}`;for(;n.has(u);)u=`${u}_${s}`;o=u;}n.add(o),r.push({id:o,prompt:c});}}),r}function A(t,e){return t.every(n=>(e[n.id]??"").trim()!=="")}function P(t,e,n){let r={};for(let s of t)r[s.id]=(e[s.id]??"").trim();let i=n.trim();return i&&(r.additionalComments=i),r}function J(t,e){let n=e.trim();return n?{approved:t,comment:n}:{approved:t}}export{A,C,D,E,H,I,J,O,P,S,T,_,b,h,k,v,w,x,y};
|
package/static/chunk-DOAz4S6b.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {_ as _n,C as Cn}from'./chunk-vINo5yVD.js';import {C,b6 as U,b7 as m,b8 as y,V as Ve,b as at,q as qo,u as ue,aW as Ng,c as bi,Z as ZE,d as $8,v as v3,Y as pf,a0 as bd,a1 as sp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,l as _D,o as gI,L as Lh,p as Fw,z as rl,M as MD,H as HD,x as xD,w as lh,B as AD,G as FD,m as mh,D as ch,O as Fu,Q as ju}from'./main-3VZRFHGG.js';import {b}from'./chunk-BcDRgzYZ.js';import {W,I}from'./chunk-Bok52e_k.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-CtiubhW7.js';import'./chunk-iIEmH_ui.js';function ee(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 te=(t,p)=>p.type+p.id;function ie(t,p){t&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ne(t,p){if(t&1&&(_i(0,"p",6),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function oe(t,p){if(t&1&&(_i(0,"p",7),Iw(1),Jc()),t&2){let e=HD(2);gI(),Lh(e.deleteError());}}function ae(t,p){t&1&&(_i(0,"section",8)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",2)(5,"a",10),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"a",11),Iw(9),Pw(10,"transloco"),Jc()()()),t&2&&(gI(2),Lh(Fw(3,3,"manage.views.emptyState")),gI(4),rl(" ",Fw(7,5,"manage.views.createView")," "),gI(3),rl(" ",Fw(10,7,"manage.views.createShortcut")," "));}function re(t,p){if(t&1&&(Iw(0),Pw(1,"transloco")),t&2){let e=HD().$implicit,i=HD(3);rl(" ",Fw(1,1,i.subjectTypeKey(e.subjectType))," ");}}function se(t,p){t&1&&(Iw(0),Pw(1,"transloco")),t&2&&rl(" ",Fw(1,1,"manage.views.noSubjectType")," ");}function de(t,p){if(t&1){let e=FD();_i(0,"tr")(1,"td"),Iw(2),Jc(),_i(3,"td")(4,"nz-tag"),Iw(5),Pw(6,"transloco"),Jc()(),_i(7,"td"),Iw(8),Jc(),_i(9,"td"),_D(10,re,2,3)(11,se,2,3),Jc(),_i(12,"td",12)(13,"a",13),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"button",14),Pw(17,"transloco"),Pw(18,"transloco"),Pw(19,"transloco"),mh("nzOnConfirm",function(){let c=Fu(e).$implicit,v=HD(3);return ju(v.deleteItem(c))}),Iw(20),Pw(21,"transloco"),Jc()()();}if(t&2){let e=p.$implicit,i=HD(3);ch("data-testid","item-"+e.type+"-"+e.id),gI(),ch("data-testid","name-"+e.type+"-"+e.id),gI(),Lh(e.name),gI(2),ch("data-testid","type-"+e.type+"-"+e.id),gI(),Lh(Fw(6,17,i.typeKey(e.type))),gI(2),ch("data-testid","workflow-"+e.type+"-"+e.id),gI(),rl(" ",i.workflowName(e)," "),gI(),ch("data-testid","subject-type-"+e.type+"-"+e.id),gI(),MD(e.subjectType?10:11),gI(3),lh("routerLink",i.editLink(e)),ch("data-testid","edit-"+e.type+"-"+e.id),gI(),rl(" ",Fw(15,19,"manage.views.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(17,21,i.deleteConfirmKey(e)))("nzOkText",Fw(18,23,"manage.views.delete"))("nzCancelText",Fw(19,25,"common.cancel")),ch("data-testid","delete-"+e.type+"-"+e.id),gI(4),rl(" ",Fw(21,27,"manage.views.delete")," ");}}function pe(t,p){if(t&1&&(_i(0,"nz-table",9)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc()()(),_i(18,"tbody"),xD(19,de,22,29,"tr",null,te),Jc()()),t&2){let e=HD(2);lh("nzData",e.items())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,8,"manage.views.column.name")),gI(3),Lh(Fw(8,10,"manage.views.column.type")),gI(3),Lh(Fw(11,12,"manage.views.column.workflow")),gI(3),Lh(Fw(14,14,"manage.views.column.subjectType")),gI(3),Lh(Fw(17,16,"manage.views.column.actions")),gI(3),AD(e.items());}}function le(t,p){if(t&1&&(_D(0,oe,2,1,"p",7),_D(1,ae,11,9,"section",8)(2,pe,21,18,"nz-table",9)),t&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.items().length===0?1:2);}}var Pe=(()=>{class t{constructor(){this.viewsApi=C(U),this.shortcutsApi=C(m),this.nav=C(y),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.nav.refresh(),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(ee(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=ZE({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"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"div",2)(6,"a",3),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"a",4),Iw(10),Pw(11,"transloco"),Jc()()(),_D(12,ie,3,3,"p",5)(13,ne,2,1,"p",6)(14,le,3,2),Jc()),i&2&&(gI(3),Lh(Fw(4,4,"manage.views.title")),gI(4),rl(" ",Fw(8,6,"manage.views.createView")," "),gI(3),rl(" ",Fw(11,8,"manage.views.createShortcut")," "),gI(2),MD(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{Pe as ViewsAndShortcutsManageComponent};
|