@knoflows/engine 0.1.0-alpha.4 → 0.1.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/engine.js +14 -13
  2. package/package.json +1 -1
  3. package/static/assets/i18n/en.json +8 -7
  4. package/static/assets/i18n/es.json +8 -7
  5. package/static/{chunk-D6KYmz2w.js → chunk--huWzdqj.js} +1 -1
  6. package/static/chunk-164-t-LC.js +1 -0
  7. package/static/chunk-B2oijRKi.js +1 -0
  8. package/static/{chunk-CWRAmEOi.js → chunk-BMOj-ctp.js} +1 -1
  9. package/static/{chunk-Ca9rxJZS.js → chunk-B_0vwfJH.js} +1 -1
  10. package/static/chunk-Ba2Pk3ZV.js +1 -0
  11. package/static/{chunk-BJ_zTxjo.js → chunk-BgxH8sDB.js} +1 -1
  12. package/static/chunk-BiwCj5Ed.js +1 -0
  13. package/static/{chunk-CECejZs9.js → chunk-C9TOy_jn.js} +1 -1
  14. package/static/{chunk-BaL0hYvK.js → chunk-CIADdbUP.js} +1 -1
  15. package/static/{chunk-VW6e_Kls.js → chunk-CfZWJKlu.js} +1 -1
  16. package/static/chunk-Cg4mENZa.js +1 -0
  17. package/static/chunk-Cv5pNW9n.js +1 -0
  18. package/static/{chunk-BqWiMcNp.js → chunk-CxrhCycA.js} +1 -1
  19. package/static/{chunk-BvGpCrD9.js → chunk-CzSFfhcS.js} +1 -1
  20. package/static/{chunk-CbG3rfKf.js → chunk-D5kutWaL.js} +6 -6
  21. package/static/chunk-D7ecsHWV.js +1 -0
  22. package/static/{chunk-Cdhqfnmn.js → chunk-DZV_xppV.js} +1 -1
  23. package/static/{chunk-DZ8K8fY1.js → chunk-DaPHlPte.js} +1 -1
  24. package/static/{chunk-DrMwVUpq.js → chunk-DeFJOu7x.js} +1 -1
  25. package/static/{chunk-B4PXIvtd.js → chunk-DjcxfmKB.js} +1 -1
  26. package/static/{chunk-jDfyi4_G.js → chunk-DkKxPJBS.js} +1 -1
  27. package/static/{chunk-smuNKEab.js → chunk-DnSW_i5C.js} +3 -3
  28. package/static/{chunk-C5kOvUkS.js → chunk-Dnos4vY0.js} +1 -1
  29. package/static/{chunk-BnjE7sDc.js → chunk-E9Klh0DL.js} +1 -1
  30. package/static/{chunk-DS5k0b_s.js → chunk-GrrV0ukn.js} +1 -1
  31. package/static/chunk-M0pfvgRb.js +1 -0
  32. package/static/{chunk-3tEYpnqu.js → chunk-PG4bRDhM.js} +1 -1
  33. package/static/chunk-dMfVmcfD.js +1 -0
  34. package/static/index.html +1 -1
  35. package/static/{main-5C7K2447.js → main-6LDEPJ3H.js} +1 -1
  36. package/static/chunk--cAlvNjP.js +0 -1
  37. package/static/chunk-4TrlkpZx.js +0 -1
  38. package/static/chunk-99HzEG7y.js +0 -1
  39. package/static/chunk-BEPCHPAV.js +0 -1
  40. package/static/chunk-Byfh9OPw.js +0 -1
  41. package/static/chunk-C67ITweo.js +0 -1
  42. package/static/chunk-Cgq1n6kP.js +0 -1
  43. package/static/chunk-CpxvtoPc.js +0 -1
  44. package/static/chunk-DGw7ID-A.js +0 -1
  45. package/static/chunk-qdbp1qcP.js +0 -1
@@ -0,0 +1 @@
1
+ import {J,K as K$1}from'./chunk--huWzdqj.js';import {U}from'./chunk-CfZWJKlu.js';import {C,U as U$1,I as ue,a as ar,W,q as qo,H as Hw,s,r,c as qe,Q as QE,F as Fn,M as Mt,f as ec,g as _i,v as vw,h as Rw,K as Kc,m as bD,j as gh,N as ND,p as gI,P as Ph,O as Ow,A as _D,u as nl,w as ch,y as xD,B as VD,T as Lh,L as LD,E as Pu,G as Lu}from'./main-6LDEPJ3H.js';var L=(t,p)=>p.id;function $(t,p){if(t&1&&(_i(0,"p",3),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function z(t,p){if(t&1&&(_i(0,"option",6),vw(1),Kc()),t&2){let e=p.$implicit;ch("value",e.id),gI(),Lh("",e.name," (",e.id,")");}}function H(t,p){if(t&1){let e=LD();_i(0,"label"),vw(1),Rw(2,"transloco"),_i(3,"input",10),Rw(4,"transloco"),gh("input",function(o){Pu(e);let s=VD(2);return Lu(s.setSubjectId(o))}),Kc()();}if(t&2){let e=VD(2);gI(),nl(" ",Ow(2,3,"jobs.start.subjectId")," "),gI(2),ch("value",e.subjectId())("placeholder",Ow(4,5,"jobs.start.subjectIdPlaceholder"));}}function G(t,p){if(t&1){let e=LD();bD(0,H,5,7,"label"),_i(1,"app-workflow-input-form",9),gh("valuesChange",function(o){Pu(e);let s=VD();return Lu(s.inputValues.set(o))}),Kc();}if(t&2){let e=VD();_D(e.needsSubjectId()?0:-1),gI(),ch("fields",p.inputSchema)("values",e.inputValues());}}function K(t,p){if(t&1&&(_i(0,"p",8),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.actionError());}}var re=(()=>{class t{constructor(){this.workflowsApi=C(U),this.jobsApi=C(U$1),this.router=C(ue),this.transloco=C(ar),this.route=C(W),this.workflows=qo([]),this.selectedWorkflowId=qo(""),this.subjectId=qo(""),this.inputValues=qo({}),this.loadError=qo(null),this.actionError=qo(null),this.starting=qo(false),this.selectedWorkflow=Hw(()=>this.workflows().find(e=>e.id===this.selectedWorkflowId())??null),this.needsSubjectId=Hw(()=>{let e=this.selectedWorkflow();return e!=null&&e.appliesTo!=="none"}),this.workflowsApi.list({subjectHandling:"per-subject"}).subscribe({next:e=>{this.workflows.set(e);let n=this.route.snapshot.queryParamMap.get("workflowId"),o=n&&e.some(C=>C.id===n)?n:e[0]?.id;o&&this.selectWorkflow(o);let s=this.route.snapshot.queryParamMap.get("subjectId");s&&this.subjectId.set(s);},error:e=>{this.loadError.set(this.errorMessage(e,this.transloco.translate("jobs.errors.loadWorkflows")));}});}selectWorkflow(e){this.selectedWorkflowId.set(e);let n=this.workflows().find(o=>o.id===e);this.inputValues.set(J(n?.inputSchema??[])),this.actionError.set(null);}onWorkflowChange(e){let n=e.target.value;this.selectWorkflow(n);}setSubjectId(e){this.subjectId.set(e.target.value);}start(){let e=this.selectedWorkflow();if(e){if(this.needsSubjectId()&&!this.subjectId().trim()){this.actionError.set(this.transloco.translate("jobs.errors.subjectIdRequired"));return}this.actionError.set(null),this.starting.set(true),this.jobsApi.start(s(r({workflowId:e.id},this.needsSubjectId()?{subjectId:this.subjectId().trim()}:{}),{inputValues:r({},this.inputValues())})).subscribe({next:n=>{this.starting.set(false),this.router.navigate(["/jobs",n.id]);},error:n=>{this.starting.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.startFailed")));}});}}errorMessage(e,n){return e instanceof qe||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-job-runner"]],decls:26,vars:23,consts:[[1,"runner"],["routerLink","/jobs"],[1,"lede"],["data-testid","load-error",1,"error"],["data-testid","start-form",1,"panel"],["data-testid","workflow-select",3,"change","value"],[3,"value"],["data-testid","start-button","type","button",3,"click","disabled"],["data-testid","action-error",1,"error"],[3,"valuesChange","fields","values"],["data-testid","subject-id","type","text",3,"input","value","placeholder"]],template:function(n,o){if(n&1&&(_i(0,"main",0)(1,"a",1),vw(2),Rw(3,"transloco"),Kc(),_i(4,"h1"),vw(5),Rw(6,"transloco"),Kc(),_i(7,"p",2),vw(8),Rw(9,"transloco"),Kc(),bD(10,$,2,1,"p",3),_i(11,"section",4)(12,"h2"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"label"),vw(16),Rw(17,"transloco"),_i(18,"select",5),gh("change",function(C){return o.onWorkflowChange(C)}),ND(19,z,2,3,"option",6,L),Kc()(),bD(21,G,2,3),_i(22,"button",7),gh("click",function(){return o.start()}),vw(23),Rw(24,"transloco"),Kc()(),bD(25,K,2,1,"p",8),Kc()),n&2){let s;gI(2),Ph(Ow(3,11,"jobs.detail.backToStart")),gI(3),Ph(Ow(6,13,"jobs.title")),gI(3),Ph(Ow(9,15,"jobs.lede")),gI(2),_D(o.loadError()?10:-1),gI(3),Ph(Ow(14,17,"jobs.start.heading")),gI(3),nl(" ",Ow(17,19,"jobs.start.workflow")," "),gI(2),ch("value",o.selectedWorkflowId()),gI(),xD(o.workflows()),gI(2),_D((s=o.selectedWorkflow())?21:-1,s),gI(),ch("disabled",o.starting()),gI(),nl(" ",Ow(24,21,o.starting()?"jobs.start.starting":"jobs.start.button")," "),gI(2),_D(o.actionError()?25:-1);}},dependencies:[Fn,Mt,K$1,ec],styles:[".runner[_ngcontent-%COMP%]{max-width:52rem;margin:0 auto;padding:1.5rem;color:#1c1917;line-height:1.45}.lede[_ngcontent-%COMP%]{color:#57534e}.panel[_ngcontent-%COMP%]{margin-top:1.25rem;padding:1rem 0;border-top:1px solid #d6d3d1}label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0;font-size:.95rem}input[type=text][_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e;background:#fff}button[_ngcontent-%COMP%]{font:inherit;margin-top:.5rem;padding:.45rem .9rem;border:1px solid #44403c;background:#f5f5f4;cursor:pointer}button[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{re as JobRunnerComponent};
@@ -1 +1 @@
1
- import {I,g,b,v,j,y,h,E,P,A,T}from'./chunk--cAlvNjP.js';import {N as Nt,K as Ke$1}from'./chunk-BJ_zTxjo.js';import {f as fr,K as Ki,x,V as Vt,R as Rt$1,w as wt,F as Ft}from'./chunk-C5kOvUkS.js';import {U as Ud,b as b$}from'./chunk-CbG3rfKf.js';import {C,W,I as ue,b as at,a as ar,ac as O,ad as Zn$1,ae as Se,q as qo,H as Hw,R as Rt,s,r,c as qe,Q as QE,F as Fn,n as n8,af as S4,J as J6,k as k3,M as Mt,d as sd,z as zc,e as t7,Z as y7,$ as $b,V as V5,D as D5,f as ec,g as _i,v as vw,K as Kc,h as Rw,j as gh,m as bD,p as gI,P as Ph,O as Ow,w as ch,u as nl,A as _D,a0 as $0,a1 as B0,t,ag as $6,N as ND,a5 as ah,y as xD,B as VD,L as LD,o as oE,S as SD,a7 as MD,x as sE,ah as YE,ai as uu,aj as Y0,ak as Z0,al as N1,am as q0,an as _r,ao as Ee,ap as a3,aq as Le,ar as ga,as as j3,at as m1,au as za,av as Uw,aw as W0,ax as D8,ay as u9,az as a9,aA as Kf,Y as Bw,aB as f9,aC as pt,aD as Se$1,aE as va,aF as vr,aG as BD,aH as nh,aI as Lw,aJ as Sw,aK as h1,aL as B1,aM as wo,aN as rD,aO as R4,aP as cw,aQ as Dh,aR as GD,aS as Eh,aT as U0,l as lh,a2 as Pw,a3 as xw,aU as zD,E as Pu,G as Lu,aV as Vh,aW as jh,aX as $D,a4 as Mh,aY as ww}from'./main-5C7K2447.js';import {U}from'./chunk-VW6e_Kls.js';import {F as Fe,o as oe}from'./chunk-Ca9rxJZS.js';import'./chunk-DS5k0b_s.js';var Ut=["input"],Ht=["inputNumberHost"],Zt=[[["","nzInputAddonBefore",""]],[["","nzInputAddonAfter",""]],[["","nzInputPrefix",""]],[["","nzInputSuffix",""]],[["","nzInputNumberUpIcon",""]],[["","nzInputNumberDownIcon",""]]],Qt=["[nzInputAddonBefore]","[nzInputAddonAfter]","[nzInputPrefix]","[nzInputSuffix]","[nzInputNumberUpIcon]","[nzInputNumberDownIcon]"];function Gt(i,p){}function Yt(i,p){if(i&1&&nh(0,Gt,0,0,"ng-template",8),i&2){VD();let e=zD(4);ch("ngTemplateOutlet",e);}}function Jt(i,p){}function Xt(i,p){if(i&1&&nh(0,Jt,0,0,"ng-template",8),i&2){VD();let e=zD(8);ch("ngTemplateOutlet",e);}}function en(i,p){}function tn(i,p){if(i&1&&nh(0,en,0,0,"ng-template",8),i&2){VD();let e=zD(12);ch("ngTemplateOutlet",e);}}function nn(i,p){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzAddonBefore());}}function on(i,p){i&1&&(_i(0,"div",10),$D(1,0,null,nn,1,1),Kc());}function rn(i,p){}function an(i,p){if(i&1&&nh(0,rn,0,0,"ng-template",8),i&2){VD(2);let e=zD(6);ch("ngTemplateOutlet",e);}}function ln(i,p){}function sn(i,p){if(i&1&&nh(0,ln,0,0,"ng-template",8),i&2){VD(2);let e=zD(10);ch("ngTemplateOutlet",e);}}function pn(i,p){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzAddonAfter());}}function dn(i,p){i&1&&(_i(0,"div",10),$D(1,1,null,pn,1,1),Kc());}function cn(i,p){if(i&1&&(_i(0,"div",9),bD(1,on,3,0,"div",10),bD(2,an,1,1,null,8)(3,sn,1,1,null,8),bD(4,dn,3,0,"div",10),Kc()),i&2){let e=VD();gI(),_D(e.hasAddonBefore()?1:-1),gI(),_D(e.hasAffix()?2:3),gI(2),_D(e.hasAddonAfter()?4:-1);}}function un(i,p){}function mn(i,p){if(i&1&&(_i(0,"div"),nh(1,un,0,0,"ng-template",8),Kc()),i&2){let e=VD(),n=zD(8);cw(e.affixWrapperClass()),gI(),ch("ngTemplateOutlet",n);}}function _n(i,p){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzPrefix());}}function fn(i,p){i&1&&(_i(0,"span",11),$D(1,2,null,_n,1,1),Kc());}function gn(i,p){}function xn(i,p){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzSuffix());}}function Cn(i,p){if(i&1&&lh(0,"nz-form-item-feedback-icon",13),i&2){let e=VD(3);ch("status",e.finalStatus());}}function hn(i,p){if(i&1&&(_i(0,"span",12),$D(1,3,null,xn,1,1),bD(3,Cn,1,1,"nz-form-item-feedback-icon",13),Kc()),i&2){let e=VD(2);gI(3),_D(e.hasFeedback()&&e.finalStatus()?3:-1);}}function wn(i,p){if(i&1&&(bD(0,fn,3,0,"span",11),nh(1,gn,0,0,"ng-template",8),bD(2,hn,4,1,"span",12)),i&2){let e=VD(),n=zD(10);_D(e.hasPrefix()?0:-1),gI(),ch("ngTemplateOutlet",n),gI(),_D(e.hasSuffix()?2:-1);}}function bn(i,p){}function zn(i,p){if(i&1&&(_i(0,"div",null,5),nh(2,bn,0,0,"ng-template",8),Kc()),i&2){let e=VD(),n=zD(12);cw(e.inputNumberClass()),gI(2),ch("ngTemplateOutlet",n);}}function vn(i,p){i&1&&lh(0,"nz-icon",20);}function yn(i,p){i&1&&lh(0,"nz-icon",21);}function Sn(i,p){if(i&1){let e=LD();_i(0,"div",17,7),gh("mouseup",function(){Pu(e);let t=VD(2);return Lu(t.stopAutoStep())})("mouseleave",function(){Pu(e);let t=VD(2);return Lu(t.stopAutoStep())}),_i(2,"span",18),gh("mousedown",function(t){Pu(e);let o=VD(2);return Lu(o.onStepMouseDown(t,true))}),$D(3,4,null,vn,1,0),Kc(),_i(5,"span",19),gh("mousedown",function(t){Pu(e);let o=VD(2);return Lu(o.onStepMouseDown(t,false))}),$D(6,5,null,yn,1,0),Kc()();}if(i&2){let e=VD(2);gI(2),Mh("ant-input-number-handler-up-disabled",e.upDisabled()),ah("aria-disabled",e.upDisabled()),gI(3),Mh("ant-input-number-handler-down-disabled",e.downDisabled()),ah("aria-disabled",e.downDisabled());}}function Mn(i,p){if(i&1){let e=LD();bD(0,Sn,8,6,"div",14),_i(1,"div",15)(2,"input",16,6),gh("input",function(){Pu(e);let t=zD(3),o=VD();return Lu(o.onInput(t.value))})("wheel",function(t){Pu(e);let o=VD();return Lu(o.onWheel(t))}),Kc()();}if(i&2){let e=VD();_D(e.nzControls()?0:-1),gI(2),ch("value",e.displayValue())("placeholder",e.nzPlaceHolder()??"")("disabled",e.finalDisabled())("readOnly",e.nzReadOnly()),ah("aria-valuemin",e.nzMin())("aria-valuemax",e.nzMax())("id",e.nzId())("step",e.nzStep())("value",e.displayValue());}}var Ke=(()=>{class i{nzId=$0(null);nzSize=$0("default");nzPlaceHolder=$0(null);nzStatus=$0("");nzVariant=$0();nzStep=$0(1,{transform:Y0});nzMin=$0(Number.MIN_SAFE_INTEGER,{transform:Y0});nzMax=$0(Number.MAX_SAFE_INTEGER,{transform:Y0});nzPrecision=$0(null);nzParser=$0();nzFormatter=$0();nzDisabled=$0(false,{transform:Z0});nzReadOnly=$0(false,{transform:Z0});nzAutoFocus=$0(false,{transform:Z0});nzKeyboard=$0(true,{transform:Z0});nzControls=$0(true,{transform:Z0});nzChangeOnWheel=$0(true,{transform:Z0});nzPrefix=$0();nzSuffix=$0();nzAddonBefore=$0();nzAddonAfter=$0();nzBlur=B0();nzFocus=B0();nzOnStep=B0();onChange=()=>{};onTouched=()=>{};isDisabledFirstChange=true;compactSize=C(N1,{optional:true});inputRef=q0.required("input");hostRef=q0("inputNumberHost");elementRef=C(_r);injector=C(Ee);focusMonitor=C(a3);directionality=C(Le);nzFormStatusService=C(ga,{optional:true});autoStepTimer=null;defaultFormatter=e=>{let n=this.nzPrecision();return j3(n)?e.toFixed(n):e.toString()};value=qo(null);displayValue=qo("");formSize=C(m1,{optional:true});formVariant=C(za,{optional:true});dir=C(Le).valueSignal;focused=qo(false);hasFeedback=qo(false);finalStatus=Uw(()=>this.nzStatus());finalDisabled=Uw(()=>this.nzDisabled());prefix=W0(Vt);suffix=W0(Rt$1);addonBefore=W0(wt);addonAfter=W0(Ft);hasPrefix=Hw(()=>!!this.nzPrefix()||!!this.prefix());hasSuffix=Hw(()=>!!this.nzSuffix()||!!this.suffix()||this.hasFeedback());hasAffix=Hw(()=>this.hasPrefix()||this.hasSuffix());hasAddonBefore=Hw(()=>!!this.nzAddonBefore()||!!this.addonBefore());hasAddonAfter=Hw(()=>!!this.nzAddonAfter()||!!this.addonAfter());hasAddon=Hw(()=>this.hasAddonBefore()||this.hasAddonAfter());class=Hw(()=>this.hasAddon()?this.groupWrapperClass():this.hasAffix()?this.affixWrapperClass():this.inputNumberClass());inputNumberClass=Hw(()=>r(r({"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&&!Oe(this.value(),this.nzMin(),this.nzMax())},u9("ant-input-number",this.finalVariant())),D8("ant-input-number",this.finalStatus(),this.hasFeedback())));affixWrapperClass=Hw(()=>r(r({"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"},D8("ant-input-number-affix-wrapper",this.finalStatus(),this.hasFeedback())),u9("ant-input-number-affix-wrapper",this.finalVariant())));groupWrapperClass=Hw(()=>r(r({"ant-input-number-group-wrapper":true,"ant-input-number-group-wrapper-rtl":this.dir()==="rtl"},D8("ant-input-number-group-wrapper",this.finalStatus(),this.hasFeedback())),u9("ant-input-number-group-wrapper",this.finalVariant())));finalSize=Hw(()=>this.formSize?.()?this.formSize():this.compactSize?this.compactSize():this.nzSize());finalVariant=Hw(()=>this.nzVariant()||this.formVariant?.()||"outlined");upDisabled=Hw(()=>!a9(this.value())&&this.value()>=this.nzMax());downDisabled=Hw(()=>!a9(this.value())&&this.value()<=this.nzMin());constructor(){let e=C(at);Kf(()=>{let n=this.hostRef(),t=n||this.elementRef;this.focusMonitor.monitor(t,true).pipe(Rt(e)).subscribe(o=>{Bw(()=>{this.focused.set(!!o),o?this.nzFocus.emit():(this.fixValue(),this.onTouched(),this.nzBlur.emit());});}),e.onDestroy(()=>{this.focusMonitor.stopMonitoring(t);});}),this.nzFormStatusService?.formStatusChanges.pipe(Rt()).subscribe(({status:n,hasFeedback:t})=>{this.finalStatus.set(n),this.hasFeedback.set(t);});}ngOnInit(){this.nzAutoFocus()&&Kf(()=>this.focus(),{injector:this.injector});}writeValue(e){a9(e)&&(e=null),Bw(()=>{this.value.set(e),this.setValue(e);});}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){Bw(()=>{this.finalDisabled.set(this.isDisabledFirstChange&&this.nzDisabled()||e);}),this.isDisabledFirstChange=false;}focus(e){f9(this.inputRef().nativeElement,e);}blur(){this.inputRef().nativeElement.blur();}step(e,n,t){if(n&&this.upDisabled()||!n&&this.downDisabled())return;let o=e.shiftKey?this.nzStep()*10:this.nzStep();n||(o=-o);let k=10**Bt(o),W=$t((Math.round((this.value()||0)*k)+Math.round(o*k))/k,this.nzMin(),this.nzMax(),this.nzPrecision());this.setValue(W),this.nzOnStep.emit({type:n?"up":"down",value:this.value(),offset:this.nzStep(),emitter:t}),this.focus();}setValue(e){let n=this.nzFormatter()??this.defaultFormatter,t=this.nzPrecision();j3(t)&&(e&&=+e.toFixed(t));let o=a9(e)?"":n(e);this.displayValue.set(o),this.updateValue(e);}setValueByTyping(e){if(this.displayValue.set(e),e===""){this.updateValue(null);return}let t=(this.nzParser()??At)(e);if(Tn(e)||Number.isNaN(t))return;let o=this.nzFormatter();if(o){let d=o(t);this.displayValue.set(d);}Oe(t,this.nzMin(),this.nzMax())&&this.updateValue(t);}updateValue(e){this.value()!==e&&(this.value.set(e),this.onChange(e));}fixValue(){let e=this.displayValue();if(e==="")return;let t=(this.nzParser()??At)(e);if(Number.isNaN(t))t=this.value();else {let o=this.nzPrecision();j3(o)&&Bt(t)!==o&&(t=+t.toFixed(o)),Oe(t,this.nzMin(),this.nzMax())||(t=$t(t,this.nzMin(),this.nzMax(),o));}this.setValue(t);}stopAutoStep(){this.autoStepTimer!==null&&(clearTimeout(this.autoStepTimer),this.autoStepTimer=null);}onStepMouseDown(e,n){e.preventDefault(),this.stopAutoStep(),this.step(e,n,"handler");let t=()=>{this.step(e,n,"handler"),this.autoStepTimer=setTimeout(t,Nn);};this.autoStepTimer=setTimeout(t,kn);}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(n){return new(n||i)};static \u0275cmp=QE({type:i,selectors:[["nz-input-number"]],contentQueries:function(n,t,o){n&1&&Eh(o,t.prefix,Vt,5)(o,t.suffix,Rt$1,5)(o,t.addonBefore,wt,5)(o,t.addonAfter,Ft,5),n&2&&GD(4);},viewQuery:function(n,t){n&1&&Dh(t.inputRef,Ut,5)(t.hostRef,Ht,5),n&2&&GD(2);},hostVars:2,hostBindings:function(n,t){n&1&&gh("keydown",function(d){return t.onKeyDown(d)}),n&2&&cw(t.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:[Sw([{provide:h1,useExisting:wo(()=>i),multi:true},{provide:B1,useValue:"input-number"}]),rD([R4])],ngContentSelectors:Qt,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(n,t){n&1&&(BD(Zt),bD(0,Yt,1,1,null,8)(1,Xt,1,1,null,8)(2,tn,1,1,null,8),nh(3,cn,5,3,"ng-template",null,0,Lw)(5,mn,2,3,"ng-template",null,1,Lw)(7,wn,3,3,"ng-template",null,2,Lw)(9,zn,3,3,"ng-template",null,3,Lw)(11,Mn,4,10,"ng-template",null,4,Lw)),n&2&&_D(t.hasAddon()?0:t.hasAffix()?1:2);},dependencies:[pt,Se$1,va,vr],encapsulation:2})}return i})(),Nn=200,kn=600;function At(i){let p=i.trim().replace(/,/g,"").replace(/。/g,".");return p.length?+p:NaN}function Oe(i,p,e){return i>=p&&i<=e}function $t(i,p,e,n=null){if(n===null)return i<p?p:i>e?e:i;let t=+i.toFixed(n),o=Math.pow(10,n);return t<p?Math.ceil(p*o)/o:t>e?Math.floor(e*o)/o:t}function Bt(i){return i.toString().split(".")[1]?.length||0}function Tn(i){return /[.。](\d*0)?$/.test(i.toString())}var Pt=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=YE({type:i});static \u0275inj=uu({imports:[Ke]})}return i})();function En(i,p){if(i&1){let e=LD();_i(0,"div",1)(1,"input",3),Vh("ngModelChange",function(t){let o=Pu(e).$implicit;return ww(o.key,t)||(o.key=t),Lu(t)}),gh("ngModelChange",function(){Pu(e);let t=VD();return Lu(t.emitRows())}),Kc(),oE(),_i(2,"input",4),Vh("ngModelChange",function(t){let o=Pu(e).$implicit;return ww(o.value,t)||(o.value=t),Lu(t)}),gh("ngModelChange",function(){Pu(e);let t=VD();return Lu(t.emitRows())}),Kc(),oE(),_i(3,"button",5),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.remove(t))}),vw(4,"Remove"),Kc()();}if(i&2){let e=p.$implicit;gI(),jh("ngModel",e.key),sE(),gI(),jh("ngModel",e.value),sE();}}var jt=(()=>{class i{constructor(){this.rows=U0.required();}add(){this.rows.update(e=>[...e,{key:"",value:""}]);}remove(e){this.rows.update(n=>n.filter((t,o)=>o!==e));}emitRows(){this.rows.set(this.rows().map(e=>r({},e)));}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=QE({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(n,t){n&1&&(_i(0,"div",0),ND(1,En,5,2,"div",1,MD),_i(3,"button",2),gh("click",function(){return t.add()}),vw(4,"Add param"),Kc()()),n&2&&(gI(),xD(t.rows()));},dependencies:[n8,S4,J6,k3,sd,zc,t7,y7,Ki,x],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 An(i,p){return this.trackKey(p)}var $n=(i,p)=>p.id;function Bn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(2);ch("nzValue",e)("nzLabel",Ow(1,2,n.stepTypeKey(e)));}}function Pn(i,p){if(i&1){let e=LD();_i(0,"label",16),gh("ngModelChange",function(t){let o=Pu(e).$implicit,d=VD(2),k=d.$implicit,W=d.$index,L=VD();return Lu(L.toggleKnowledge(W,L.asAgent(k),o,t))}),vw(1),Rw(2,"transloco"),Kc(),oE();}if(i&2){let e=p.$implicit,n=VD(2),t=n.$implicit,o=n.$index,d=VD();ch("ngModel",d.hasKnowledge(d.asAgent(t),e)),ah("data-testid","agent-knowledge-"+e+"-"+o),sE(),gI(),nl(" ",Ow(2,3,d.knowledgeTierKey(e))," ");}}function Wn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.outputFormatKey(e)));}}function Ln(i,p){if(i&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",12),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{objective:t}))}),Kc(),oE(),Kc(),_i(5,"div",8)(6,"span"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"div",13),ND(10,Pn,3,5,"label",14,SD),Kc(),_i(12,"p",11),vw(13),Rw(14,"transloco"),Kc()(),_i(15,"div",8)(16,"span"),vw(17),Rw(18,"transloco"),Kc(),_i(19,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{outputFormat:t}))}),ND(20,Wn,2,4,"nz-option",5,SD),Kc(),oE(),Kc();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,8,"step-list.objective")),gI(2),ch("ngModel",o.asAgent(n).objective),ah("data-testid","agent-objective-"+t),sE(),gI(3),Ph(Ow(8,10,"step-list.knowledgeScope")),gI(3),xD(o.knowledgeTiers),gI(3),Ph(Ow(14,12,"step-list.knowledgeScopeHint")),gI(4),Ph(Ow(18,14,"step-list.outputFormat.label")),gI(2),ch("ngModel",o.asAgent(n).outputFormat),ah("data-testid","agent-output-"+t),sE(),gI(),xD(o.outputFormats);}}function On(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.interactionKey(e)));}}function Rn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.notifyModeKey(e)));}}function Kn(i,p){if(i&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{interaction:t}))}),ND(5,On,2,4,"nz-option",5,SD),Kc(),oE(),Kc(),_i(7,"div",8)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.setNotifyMode(o,t))}),ND(12,Rn,2,4,"nz-option",5,SD),Kc(),oE(),Kc();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,6,"step-list.interaction.label")),gI(2),ch("ngModel",o.asInteraction(n).interaction),ah("data-testid","interaction-type-"+t),sE(),gI(),xD(o.interactions),gI(4),Ph(Ow(10,8,"step-list.notify")),gI(2),ch("ngModel",o.notifyMode(o.asInteraction(n))),ah("data-testid","interaction-notify-"+t),sE(),gI(),xD(o.notifyModes);}}function jn(i,p){if(i&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",12),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{command:t}))}),Kc(),oE(),Kc();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,3,"step-list.command")),gI(2),ch("ngModel",o.asShell(n).command),ah("data-testid","shell-command-"+t),sE();}}function qn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.gitOperationKey(e)));}}function Un(i,p){if(i&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{operation:t}))}),ND(5,qn,2,4,"nz-option",5,SD),Kc(),oE(),Kc(),_i(7,"div",8)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"app-key-value-editor",17),gh("rowsChange",function(t){Pu(e);let o=VD(),d=o.$implicit,k=o.$index,W=VD();return Lu(W.onParamRowsChange(k,d,t))}),Kc()();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,5,"step-list.operation")),gI(2),ch("ngModel",o.asGit(n).operation),ah("data-testid","git-operation-"+t),sE(),gI(),xD(o.gitOperations),gI(4),Ph(Ow(10,7,"step-list.params")),gI(2),ch("rows",o.paramRows(n));}}function Hn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.providerActionKey(e)));}}function Zn(i,p){if(i&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{action:t}))}),ND(5,Hn,2,4,"nz-option",5,SD),Kc(),oE(),Kc(),_i(7,"div",8)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"app-key-value-editor",17),gh("rowsChange",function(t){Pu(e);let o=VD(),d=o.$implicit,k=o.$index,W=VD();return Lu(W.onParamRowsChange(k,d,t))}),Kc()();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,5,"step-list.action")),gI(2),ch("ngModel",o.asProvider(n).action),ah("data-testid","provider-action-"+t),sE(),gI(),xD(o.providerActions),gI(4),Ph(Ow(10,7,"step-list.params")),gI(2),ch("rows",o.paramRows(n));}}function Qn(i,p){if(i&1&&lh(0,"nz-option",5),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e.id)("nzLabel",n.workflowOptionLabel(e));}}function Gn(i,p){if(i&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",18),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{workflowId:t}))}),ND(5,Qn,1,2,"nz-option",5,$n),Kc(),oE(),Kc(),_i(7,"p",8)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"code",19),vw(12,"selection"),Kc()();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,4,"step-list.workflowId")),gI(2),ch("ngModel",o.asSubWorkflow(n).workflowId),ah("data-testid","sub-workflow-id-"+t),sE(),gI(),xD(o.availableWorkflows()),gI(4),Ph(Ow(10,6,"step-list.forEach"));}}function Yn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.untilTypeKey(e)));}}function Jn(i,p){if(i&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"input",10),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.setUntilValue(o,t))}),Kc(),oE(),Kc();}if(i&2){let e=VD(2),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,3,"step-list.until.value")),gI(2),ch("ngModel",o.untilValue(o.asLoop(n))),ah("data-testid","loop-until-value-"+t),sE();}}function Xn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.onMaxIterationsKey(e)));}}function ei(i,p){if(i&1){let e=LD();_i(0,"div",20)(1,"div",8)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.setUntilType(o,t))}),ND(6,Yn,2,4,"nz-option",5,SD),Kc(),oE(),Kc(),_i(8,"label",8)(9,"span"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"input",10),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.setUntilField(o,"stepId",t))}),Kc(),oE(),Kc(),_i(13,"label",8)(14,"span"),vw(15),Rw(16,"transloco"),Kc(),_i(17,"input",10),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.setUntilField(o,"field",t))}),Kc(),oE(),Kc(),bD(18,Jn,5,5,"label",8),_i(19,"label",8)(20,"span"),vw(21),Rw(22,"transloco"),Kc(),_i(23,"nz-input-number",21),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{maxIterations:t??0}))}),Kc(),oE(),Kc(),_i(24,"div",8)(25,"span"),vw(26),Rw(27,"transloco"),Kc(),_i(28,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{onMaxIterations:{action:t}}))}),ND(29,Xn,2,4,"nz-option",5,SD),Kc(),oE(),Kc()(),_i(31,"div",22)(32,"h4"),vw(33),Rw(34,"transloco"),Kc(),_i(35,"app-step-list",23),gh("stepsChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.setNestedSteps(o,t))}),Kc()();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(3),Ph(Ow(4,23,"step-list.until.type")),gI(2),ch("ngModel",o.asLoop(n).until.type),ah("data-testid","loop-until-type-"+t),sE(),gI(),xD(o.untilTypes),gI(4),Ph(Ow(11,25,"step-list.until.stepId")),gI(2),ch("ngModel",o.asLoop(n).until.stepId),ah("data-testid","loop-until-stepId-"+t),sE(),gI(3),Ph(Ow(16,27,"step-list.until.field")),gI(2),ch("ngModel",o.asLoop(n).until.field),ah("data-testid","loop-until-field-"+t),sE(),gI(),_D(o.asLoop(n).until.type==="field_equals"?18:-1),gI(3),Ph(Ow(22,29,"step-list.maxIterations")),gI(2),ch("ngModel",o.asLoop(n).maxIterations)("nzMin",0),ah("data-testid","loop-max-"+t),sE(),gI(3),Ph(Ow(27,31,"step-list.onMaxIterations.action")),gI(2),ch("ngModel",o.asLoop(n).onMaxIterations.action),ah("data-testid","loop-on-max-"+t),sE(),gI(),xD(o.maxIterationActions),gI(2),ah("data-testid","loop-nested-"+t),gI(2),Ph(Ow(34,33,"step-list.nestedSteps")),gI(2),ch("steps",o.asLoop(n).steps)("rootSteps",o.effectiveRoot())("availableWorkflows",o.availableWorkflows())("depth",o.depth()+1);}}function ti(i,p){if(i&1){let e=LD();_i(0,"nz-card",1)(1,"div",3)(2,"nz-select",4),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD();return Lu(d.changeType(o,t))}),ND(3,Bn,2,4,"nz-option",5,SD),Kc(),oE(),_i(5,"button",6),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.moveUp(t))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",6),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.moveDown(t))}),vw(9),Rw(10,"transloco"),Kc(),_i(11,"button",7),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.removeStep(t))}),vw(12),Rw(13,"transloco"),Kc()(),_i(14,"label",8)(15,"span"),vw(16),Rw(17,"transloco"),Kc(),_i(18,"input",9),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD();return Lu(d.onNameChange(o,t))}),Kc(),oE(),Kc(),_i(19,"label",8)(20,"span"),vw(21),Rw(22,"transloco"),Kc(),_i(23,"input",10),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD();return Lu(d.onIdChange(o,t))}),Kc(),oE(),_i(24,"p",11),vw(25),Rw(26,"transloco"),Kc()(),bD(27,Ln,22,16)(28,Kn,14,10)(29,jn,5,5,"label",8)(30,Un,12,9)(31,Zn,12,9)(32,Gn,13,8)(33,ei,36,35),Kc();}if(i&2){let e,n=p.$implicit,t=p.$index,o=VD();ch("nzTitle",o.cardTitle(t,n)),ah("data-testid","step-card-"+t),gI(2),ch("ngModel",n.type),ah("data-testid","step-type-"+t),sE(),gI(),xD(o.stepTypes),gI(2),ch("disabled",t===0),ah("data-testid","move-up-"+t),gI(),nl(" ",Ow(7,20,"step-list.moveUp")," "),gI(2),ch("disabled",t===o.steps().length-1),ah("data-testid","move-down-"+t),gI(),nl(" ",Ow(10,22,"step-list.moveDown")," "),gI(2),ah("data-testid","remove-"+t),gI(),nl(" ",Ow(13,24,"step-list.remove")," "),gI(4),Ph(Ow(17,26,"step-list.name")),gI(2),ch("ngModel",n.name),ah("data-testid","step-name-"+t),sE(),gI(3),Ph(Ow(22,28,"step-list.id")),gI(2),ch("ngModel",n.id),ah("data-testid","step-id-"+t),sE(),gI(2),Ph(Ow(26,30,"step-list.idHint")),gI(2),_D((e=n.type)==="agent"?27:e==="interaction"?28:e==="shell"?29:e==="git"?30:e==="provider_action"?31:e==="sub_workflow"?32:e==="loop"?33:-1);}}var qt=(()=>{class i{constructor(){this.transloco=C(ar),this.language=C(O),this.steps=$0.required(),this.rootSteps=$0([]),this.availableWorkflows=$0([]),this.depth=$0(0),this.stepsChange=B0(),this.stepTypes=y,this.outputFormats=["questionnaire","confirmation","comment_suggestions","free_text"],this.interactions=["questionnaire","confirmation","conversation"],this.gitOperations=["create_worktree","checkout","create_branch","commit","push"],this.providerActions=["get_subject","get_comments","post_comment","update_status","get_content"],this.knowledgeTiers=["user","organization","project"],this.untilTypes=["field_empty","field_equals"],this.maxIterationActions=["fail","continue","ask_human"],this.notifyModes=["inherit","on","off"],this.paramRowsByStepKey=new Map;}cardTitle(e,n){this.language.currentLang();let t=this.transloco.translate(this.stepTypeKey(n.type));return n.name?this.transloco.translate("step-list.cardTitleNamed",{index:e+1,type:t,name:n.name}):this.transloco.translate("step-list.cardTitle",{index:e+1,type:t})}stepTypeKey(e){return `step-list.stepType.${e}`}outputFormatKey(e){return `step-list.outputFormat.${e}`}interactionKey(e){return `step-list.interaction.${e}`}notifyModeKey(e){return `step-list.notifyMode.${e}`}gitOperationKey(e){return `step-list.gitOperation.${e}`}providerActionKey(e){return `step-list.providerAction.${e}`}knowledgeTierKey(e){return `step-list.knowledgeTier.${e}`}untilTypeKey(e){return `step-list.untilType.${e}`}onMaxIterationsKey(e){return `step-list.onMaxIterations.${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()}trackKey(e){return e._key}addStep(){this.emit([...this.steps(),h("agent")]);}removeStep(e){let n=this.steps()[e];n&&this.paramRowsByStepKey.delete(n._key),this.emit(this.steps().filter((t,o)=>o!==e));}moveUp(e){if(e<=0)return;let n=[...this.steps()],t=n[e-1];n[e-1]=n[e],n[e]=t,this.emit(n);}moveDown(e){if(e>=this.steps().length-1)return;let n=[...this.steps()],t=n[e+1];n[e+1]=n[e],n[e]=t,this.emit(n);}changeType(e,n){let t=this.steps()[e];if(!t||t.type===n)return;this.paramRowsByStepKey.delete(t._key);let o=h(n,{id:t.id,name:t.name,idAutoSync:t._idAutoSync,key:t._key});this.replaceAt(e,o);}patchAt(e,n){let t=this.steps()[e];t&&this.replaceAt(e,r(r({},t),n));}onNameChange(e,n){let t=this.steps()[e];t&&this.replaceAt(e,E(t,n,this.effectiveRoot()));}onIdChange(e,n){let t=this.steps()[e];t&&this.replaceAt(e,P(t,n));}setNestedSteps(e,n){let t=this.steps()[e];!t||t.type!=="loop"||this.replaceAt(e,s(r({},t),{steps:n}));}asAgent(e){return e}asInteraction(e){return e}asShell(e){return e}asGit(e){return e}asProvider(e){return e}asSubWorkflow(e){return e}asLoop(e){return e}hasKnowledge(e,n){return e.knowledgeScope?.includes(n)??false}toggleKnowledge(e,n,t,o){let d=new Set(n.knowledgeScope??[]);o?d.add(t):d.delete(t);let k=[...d];this.patchAt(e,{knowledgeScope:k&&k.length>0?k:void 0});}notifyMode(e){return e.notify===void 0?"inherit":e.notify?"on":"off"}setNotifyMode(e,n){if(n==="inherit"){let t$1=this.asInteraction(this.steps()[e]),{notify:d}=t$1,k=t(t$1,["notify"]);this.replaceAt(e,k);return}this.patchAt(e,{notify:n==="on"});}paramRows(e){let n=this.paramRowsByStepKey.get(e._key);if(!n){let t=e.type==="git"||e.type==="provider_action"?e.params:void 0;n=A(t),this.paramRowsByStepKey.set(e._key,n);}return n}onParamRowsChange(e,n,t){this.paramRowsByStepKey.set(n._key,t),this.patchAt(e,{params:T(t)});}setUntilType(e,n){let t=this.asLoop(this.steps()[e]);if(n==="field_empty"){this.patchAt(e,{until:{type:n,stepId:t.until.stepId,field:t.until.field}});return}let o=t.until.type==="field_equals"?t.until.value:"";this.patchAt(e,{until:{type:n,stepId:t.until.stepId,field:t.until.field,value:o}});}setUntilField(e,n,t){let o=this.asLoop(this.steps()[e]);this.patchAt(e,{until:s(r({},o.until),{[n]:t})});}setUntilValue(e,n){let t=this.asLoop(this.steps()[e]);t.until.type==="field_equals"&&this.patchAt(e,{until:s(r({},t.until),{value:n})});}untilValue(e){return e.until.type==="field_equals"?String(e.until.value??""):""}replaceAt(e,n){this.emit(this.steps().map((t,o)=>o===e?n:t));}emit(e){this.stepsChange.emit(e);}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-step-list"]],inputs:{steps:[1,"steps"],rootSteps:[1,"rootSteps"],availableWorkflows:[1,"availableWorkflows"],depth:[1,"depth"]},outputs:{stepsChange:"stepsChange"},decls:6,vars:4,consts:[["data-testid","step-list",1,"step-list"],[1,"step-card",3,"nzTitle"],["nz-button","","nzType","dashed","nzBlock","","type","button","data-testid","add-step",3,"click"],[1,"step-toolbar"],[1,"type-select",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["nz-button","","type","button",3,"click","disabled"],["nz-button","","nzDanger","","type","button",3,"click"],[1,"field"],["nz-input","","required","",3,"ngModelChange","ngModel"],["nz-input","",3,"ngModelChange","ngModel"],[1,"hint"],["nz-input","","rows","3",3,"ngModelChange","ngModel"],[1,"checkbox-row"],["nz-checkbox","",3,"ngModel"],[3,"ngModelChange","ngModel"],["nz-checkbox","",3,"ngModelChange","ngModel"],[3,"rowsChange","rows"],["nzShowSearch","","nzAllowClear","",3,"ngModelChange","ngModel"],["data-testid","sub-workflow-foreach"],[1,"field-grid"],[3,"ngModelChange","ngModel","nzMin"],[1,"nested"],[3,"stepsChange","steps","rootSteps","availableWorkflows","depth"]],template:function(n,t){n&1&&(_i(0,"div",0),ND(1,ti,34,32,"nz-card",1,An,true),_i(3,"button",2),gh("click",function(){return t.addStep()}),vw(4),Rw(5,"transloco"),Kc()()),n&2&&(ah("data-depth",t.depth()),gI(),xD(t.steps()),gI(3),nl(" ",Ow(5,2,"step-list.addStep")," "));},dependencies:[i,Fn,n8,S4,J6,$6,k3,sd,zc,t7,y7,Nt,Ke$1,Fe,oe,Ki,x,Pt,Ke,$b,V5,D5,jt,ec],styles:[".step-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.step-card[_ngcontent-%COMP%]{background:#fff}.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}.checkbox-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem}.hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.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}"]});}}return i})();var ni=i=>({ids:i});function ii(i,p){i&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"workflow-editor.loading")));}function oi(i,p){if(i&1&&(_i(0,"p",6),vw(1),Kc()),i&2){let e=VD();gI(),Ph(e.loadError());}}function ri(i,p){if(i&1&&(_i(0,"li"),vw(1),Kc()),i&2){let e=p.$implicit;gI(),Ph(e);}}function ai(i,p){if(i&1&&(_i(0,"section",7)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,ri,2,1,"li",null,SD),Kc()()),i&2){let e=VD(2);gI(2),Ph(Ow(3,1,"workflow-editor.validation")),gI(3),xD(e.validationErrors());}}function li(i,p){if(i&1&&(lh(0,"nz-option",13),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(2);ch("nzValue",e)("nzLabel",Ow(1,2,n.subjectTypeKey(e)));}}function si(i,p){if(i&1&&(lh(0,"nz-option",13),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(2);ch("nzValue",e)("nzLabel",Ow(1,2,n.cardinalityKey(e)));}}function pi(i,p){if(i&1){let e=LD();_i(0,"label",23),gh("ngModelChange",function(t){let o=Pu(e).$implicit,d=VD(2);return Lu(d.toggleTrigger(o,t))}),vw(1),Rw(2,"transloco"),Kc(),oE();}if(i&2){let e=p.$implicit,n=VD(2);ch("ngModel",n.hasTrigger(e)),ah("data-testid","notify-"+e),sE(),gI(),nl(" ",Ow(2,3,n.triggerKey(e))," ");}}function di(i,p){if(i&1&&(lh(0,"nz-option",13),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.inputTypeKey(e)));}}function ci(i,p){if(i&1){let e=LD();_i(0,"div",19)(1,"label",10)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",18),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{name:t}))}),Kc(),oE(),Kc(),_i(6,"label",10)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"input",18),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{label:t}))}),Kc(),oE(),Kc(),_i(11,"div",10)(12,"span"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"nz-select",24),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{type:t}))}),ND(16,di,2,4,"nz-option",13,SD),Kc(),oE(),Kc(),_i(18,"label",23),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{required:t}))}),vw(19),Rw(20,"transloco"),Kc(),oE(),_i(21,"button",25),gh("click",function(){let t=Pu(e).$index,o=VD(2);return Lu(o.removeInputField(t))}),vw(22),Rw(23,"transloco"),Kc()();}if(i&2){let e=p.$implicit,n=p.$index,t=VD(2);ah("data-testid","input-field-"+n),gI(3),Ph(Ow(4,10,"workflow-editor.fieldName")),gI(2),ch("ngModel",e.name),sE(),gI(3),Ph(Ow(9,12,"workflow-editor.fieldLabel")),gI(2),ch("ngModel",e.label),sE(),gI(3),Ph(Ow(14,14,"workflow-editor.fieldType")),gI(2),ch("ngModel",e.type),sE(),gI(),xD(t.inputFieldTypes),gI(2),ch("ngModel",e.required),sE(),gI(),nl(" ",Ow(20,16,"workflow-editor.required")," "),gI(3),nl(" ",Ow(23,18,"workflow-editor.remove")," ");}}function ui(i,p){if(i&1&&(_i(0,"p",21),vw(1),Rw(2,"transloco"),Kc()),i&2){let e=VD(2);gI(),nl(" ",Pw(2,1,"workflow-editor.duplicateStepIds",xw(4,ni,e.duplicateStepIds().join(", ")))," ");}}function mi(i,p){if(i&1){let e=LD();bD(0,ai,7,3,"section",7),_i(1,"nz-card",8),Rw(2,"transloco"),_i(3,"div",9)(4,"label",10)(5,"span"),vw(6),Rw(7,"transloco"),Kc(),_i(8,"input",11),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.patchWorkflow({name:t}))}),Kc(),oE(),Kc(),_i(9,"div",10)(10,"span"),vw(11),Rw(12,"transloco"),Kc(),_i(13,"nz-select",12),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.setAppliesTo(t))}),ND(14,li,2,4,"nz-option",13,SD),Kc(),oE(),Kc(),_i(16,"div",10)(17,"span"),vw(18),Rw(19,"transloco"),Kc(),_i(20,"nz-select",14),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.patchWorkflow({cardinality:t}))}),ND(21,si,2,4,"nz-option",13,SD),Kc(),oE(),Kc()(),_i(23,"label",10)(24,"span"),vw(25),Rw(26,"transloco"),Kc(),_i(27,"textarea",15),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.patchWorkflow({description:t||void 0}))}),Kc(),oE(),Kc()(),_i(28,"nz-card",8),Rw(29,"transloco"),_i(30,"div",16),ND(31,pi,3,5,"label",17,SD),Kc(),_i(33,"label",10)(34,"span"),vw(35),Rw(36,"transloco"),Kc(),_i(37,"input",18),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.patchWorkflow({notificationPolicy:s(r({},o.workflow().notificationPolicy),{messageTemplate:t||void 0})}))}),Kc(),oE(),Kc()(),_i(38,"nz-card",8),Rw(39,"transloco"),ND(40,ci,24,20,"div",19,MD),_i(42,"button",20),gh("click",function(){Pu(e);let t=VD();return Lu(t.addInputField())}),vw(43),Rw(44,"transloco"),Kc()(),_i(45,"nz-card",8),Rw(46,"transloco"),bD(47,ui,3,6,"p",21),_i(48,"app-step-list",22),gh("stepsChange",function(t){Pu(e);let o=VD();return Lu(o.onStepsChange(t))}),Kc()();}if(i&2){let e=VD();_D(e.validationErrors().length>0?0:-1),gI(),ch("nzTitle",Ow(2,20,"workflow-editor.basics")),gI(5),Ph(Ow(7,22,"workflow-editor.name")),gI(2),ch("ngModel",e.workflow().name),sE(),gI(3),Ph(Ow(12,24,"workflow-editor.appliesTo")),gI(2),ch("ngModel",e.appliesToValue()),sE(),gI(),xD(e.subjectTypes),gI(4),Ph(Ow(19,26,"workflow-editor.cardinality.label")),gI(2),ch("ngModel",e.workflow().cardinality),sE(),gI(),xD(e.cardinalities),gI(4),Ph(Ow(26,28,"workflow-editor.description")),gI(2),ch("ngModel",e.workflow().description??""),sE(),gI(),ch("nzTitle",Ow(29,30,"workflow-editor.notificationPolicy")),gI(3),xD(e.notificationTriggers),gI(4),Ph(Ow(36,32,"workflow-editor.messageTemplate")),gI(2),ch("ngModel",e.workflow().notificationPolicy.messageTemplate??""),sE(),gI(),ch("nzTitle",Ow(39,34,"workflow-editor.inputSchema")),gI(2),xD(e.workflow().inputSchema),gI(3),nl(" ",Ow(44,36,"workflow-editor.addInputField")," "),gI(2),ch("nzTitle",Ow(46,38,"workflow-editor.steps")),gI(2),_D(e.duplicateStepIds().length>0?47:-1),gI(),ch("steps",e.workflow().steps)("rootSteps",e.workflow().steps)("availableWorkflows",e.availableWorkflows());}}var So=(()=>{class i{constructor(){this.route=C(W),this.router=C(ue),this.workflowsApi=C(U),this.message=C(fr),this.destroyRef=C(at),this.transloco=C(ar),this.language=C(O),this.routeId=Zn$1(this.route.paramMap.pipe(Se(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.workflow=qo(I()),this.availableWorkflows=qo([]),this.loadError=qo(null),this.validationErrors=qo([]),this.duplicateStepIds=qo([]),this.saving=qo(false),this.loading=qo(true),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("workflow-editor.titleNew"):this.transloco.translate("workflow-editor.titleEdit",{id:this.workflow().id||this.routeId()}))),this.subjectTypes=["none","ticket","pull_request","documentation"],this.cardinalities=["single","batch","aggregate"],this.notificationTriggers=["on_fail","on_complete","on_needs_input"],this.inputFieldTypes=["string","number","boolean","select"],this.workflowsApi.list().pipe(Rt(this.destroyRef)).subscribe({next:e=>this.availableWorkflows.set(e),error:()=>{}}),this.route.paramMap.pipe(Rt(this.destroyRef)).subscribe(e=>{let n=e.get("id");if(this.validationErrors.set([]),this.duplicateStepIds.set([]),this.loadError.set(null),!n){this.workflow.set(I()),this.loading.set(false);return}this.loading.set(true),this.workflowsApi.get(n).subscribe({next:t=>{this.workflow.set(s(r({},structuredClone(t)),{steps:g(t.steps,{idAutoSync:false})})),this.loading.set(false);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,`Failed to load workflow ${n}`));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}cardinalityKey(e){return `workflow-editor.cardinality.${e}`}triggerKey(e){return `workflow-editor.trigger.${e}`}inputTypeKey(e){return `workflow-editor.inputType.${e}`}patchWorkflow(e){this.workflow.update(n=>r(r({},n),e));}setAppliesTo(e){this.patchWorkflow({appliesTo:e});}appliesToValue(){let e=this.workflow().appliesTo;return Array.isArray(e)?e[0]??"none":e}hasTrigger(e){return this.workflow().notificationPolicy.triggers.includes(e)}toggleTrigger(e,n){let t=this.workflow().notificationPolicy.triggers,o=n?[...new Set([...t,e])]:t.filter(d=>d!==e);this.patchWorkflow({notificationPolicy:s(r({},this.workflow().notificationPolicy),{triggers:o})});}onStepsChange(e){this.patchWorkflow({steps:e}),this.duplicateStepIds.set(Ud(e));}addInputField(){this.patchWorkflow({inputSchema:[...this.workflow().inputSchema,b()]});}removeInputField(e){this.patchWorkflow({inputSchema:this.workflow().inputSchema.filter((n,t)=>t!==e)});}patchInputField(e,n){let t=this.workflow().inputSchema.map((o,d)=>d===e?r(r({},o),n):o);this.patchWorkflow({inputSchema:t});}save(){let e=this.workflow(),n=Ud(e.steps);if(this.duplicateStepIds.set(n),n.length>0){this.validationErrors.set([this.transloco.translate("workflow-editor.duplicateStepIds",{ids:n.join(", ")})]);return}let t=v(e,{omitWorkflowId:this.isNew()}),o=b$.safeParse(t);if(!o.success){this.validationErrors.set(j(o.error));return}this.validationErrors.set([]),this.saving.set(true);let d=o.data,k=this.routeId();(this.isNew()||!k?this.workflowsApi.create(d):this.workflowsApi.update(k,s(r({},d),{id:k}))).subscribe({next:L=>{this.saving.set(false),this.workflow.set(s(r({},structuredClone(L)),{steps:g(L.steps,{idAutoSync:false})})),this.message.success(this.isNew()?"Workflow created":"Workflow saved"),this.isNew()&&this.router.navigate(["/workflows",L.id,"edit"]);},error:L=>{this.saving.set(false),this.message.error(this.errorMessage(L,"Save failed"));}});}errorMessage(e,n){return e instanceof qe||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-workflow-editor"]],decls:15,vars:10,consts:[["data-testid","workflow-editor",1,"editor"],[1,"header"],[1,"header-actions"],["routerLink","/jobs"],["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"],[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-cardinality",3,"ngModelChange","ngModel"],["nz-input","","rows","2","data-testid","workflow-description",3,"ngModelChange","ngModel"],[1,"checkbox-row"],["nz-checkbox","",3,"ngModel"],["nz-input","",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"],["nz-checkbox","",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel"],["nz-button","","nzDanger","","type","button",3,"click"]],template:function(n,t){n&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),vw(4),Kc()(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",4),gh("click",function(){return t.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,ii,3,3,"p",5)(13,oi,2,1,"p",6)(14,mi,49,40),Kc()),n&2&&(gI(4),Ph(t.pageTitle()),gI(3),Ph(Ow(8,6,"workflow-editor.backToJobs")),gI(2),ch("nzLoading",t.saving())("disabled",t.loading()||!!t.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(t.loading()?12:t.loadError()?13:14));},dependencies:[Fn,n8,S4,J6,k3,Mt,sd,zc,t7,y7,Nt,Ke$1,Fe,oe,Ki,x,$b,V5,D5,qt,ec],styles:[".editor[_ngcontent-%COMP%]{max-width:56rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.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}.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{So as WorkflowEditorComponent};
1
+ import {I,g,b,v,T,y,h,E,P,A,j}from'./chunk-M0pfvgRb.js';import {N as Nt,K as Ke$1}from'./chunk-BgxH8sDB.js';import {f as fr,K as Ki,x,V as Vt,R as Rt$1,w as wt,F as Ft}from'./chunk-Dnos4vY0.js';import {U as Ud,b as bh}from'./chunk-D5kutWaL.js';import {C,W,I as ue,b as at,a as ar,ac as O,ad as Zn$1,ae as Se,q as qo,H as Hw,R as Rt,s,r,c as qe,Q as QE,F as Fn,n as n8,af as S4,J as J6,k as k3,M as Mt,d as sd,z as zc,e as t7,Z as y7,$ as $b,V as V5,D as D5,f as ec,g as _i,v as vw,K as Kc,h as Rw,j as gh,m as bD,p as gI,P as Ph,O as Ow,w as ch,u as nl,A as _D,a0 as $0,a1 as B0,t,ag as $6,N as ND,a5 as ah,y as xD,B as VD,L as LD,o as oE,S as SD,a7 as MD,x as sE,ah as YE,ai as uu,aj as Y0,ak as Z0,al as N1,am as q0,an as _r,ao as Ee,ap as a3,aq as Le,ar as ga,as as j3,at as m1,au as za,av as Uw,aw as W0,ax as D8,ay as u9,az as a9,aA as Kf,Y as Bw,aB as f9,aC as pt,aD as Se$1,aE as va,aF as vr,aG as BD,aH as nh,aI as Lw,aJ as Sw,aK as h1,aL as B1,aM as wo,aN as rD,aO as R4,aP as cw,aQ as Dh,aR as GD,aS as Eh,aT as U0,l as lh,a2 as Pw,a3 as xw,aU as zD,E as Pu,G as Lu,aV as Vh,aW as jh,aX as $D,a4 as Mh,aY as ww}from'./main-6LDEPJ3H.js';import {U}from'./chunk-CfZWJKlu.js';import {F as Fe,o as oe}from'./chunk-B_0vwfJH.js';import'./chunk-GrrV0ukn.js';var qt=["input"],Ut=["inputNumberHost"],Zt=[[["","nzInputAddonBefore",""]],[["","nzInputAddonAfter",""]],[["","nzInputPrefix",""]],[["","nzInputSuffix",""]],[["","nzInputNumberUpIcon",""]],[["","nzInputNumberDownIcon",""]]],Qt=["[nzInputAddonBefore]","[nzInputAddonAfter]","[nzInputPrefix]","[nzInputSuffix]","[nzInputNumberUpIcon]","[nzInputNumberDownIcon]"];function Gt(i,p){}function Yt(i,p){if(i&1&&nh(0,Gt,0,0,"ng-template",8),i&2){VD();let e=zD(4);ch("ngTemplateOutlet",e);}}function Jt(i,p){}function Xt(i,p){if(i&1&&nh(0,Jt,0,0,"ng-template",8),i&2){VD();let e=zD(8);ch("ngTemplateOutlet",e);}}function en(i,p){}function tn(i,p){if(i&1&&nh(0,en,0,0,"ng-template",8),i&2){VD();let e=zD(12);ch("ngTemplateOutlet",e);}}function nn(i,p){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzAddonBefore());}}function on(i,p){i&1&&(_i(0,"div",10),$D(1,0,null,nn,1,1),Kc());}function rn(i,p){}function an(i,p){if(i&1&&nh(0,rn,0,0,"ng-template",8),i&2){VD(2);let e=zD(6);ch("ngTemplateOutlet",e);}}function ln(i,p){}function sn(i,p){if(i&1&&nh(0,ln,0,0,"ng-template",8),i&2){VD(2);let e=zD(10);ch("ngTemplateOutlet",e);}}function pn(i,p){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzAddonAfter());}}function dn(i,p){i&1&&(_i(0,"div",10),$D(1,1,null,pn,1,1),Kc());}function cn(i,p){if(i&1&&(_i(0,"div",9),bD(1,on,3,0,"div",10),bD(2,an,1,1,null,8)(3,sn,1,1,null,8),bD(4,dn,3,0,"div",10),Kc()),i&2){let e=VD();gI(),_D(e.hasAddonBefore()?1:-1),gI(),_D(e.hasAffix()?2:3),gI(2),_D(e.hasAddonAfter()?4:-1);}}function un(i,p){}function mn(i,p){if(i&1&&(_i(0,"div"),nh(1,un,0,0,"ng-template",8),Kc()),i&2){let e=VD(),n=zD(8);cw(e.affixWrapperClass()),gI(),ch("ngTemplateOutlet",n);}}function _n(i,p){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzPrefix());}}function fn(i,p){i&1&&(_i(0,"span",11),$D(1,2,null,_n,1,1),Kc());}function gn(i,p){}function xn(i,p){if(i&1&&vw(0),i&2){let e=VD(3);Ph(e.nzSuffix());}}function hn(i,p){if(i&1&&lh(0,"nz-form-item-feedback-icon",13),i&2){let e=VD(3);ch("status",e.finalStatus());}}function Cn(i,p){if(i&1&&(_i(0,"span",12),$D(1,3,null,xn,1,1),bD(3,hn,1,1,"nz-form-item-feedback-icon",13),Kc()),i&2){let e=VD(2);gI(3),_D(e.hasFeedback()&&e.finalStatus()?3:-1);}}function wn(i,p){if(i&1&&(bD(0,fn,3,0,"span",11),nh(1,gn,0,0,"ng-template",8),bD(2,Cn,4,1,"span",12)),i&2){let e=VD(),n=zD(10);_D(e.hasPrefix()?0:-1),gI(),ch("ngTemplateOutlet",n),gI(),_D(e.hasSuffix()?2:-1);}}function bn(i,p){}function zn(i,p){if(i&1&&(_i(0,"div",null,5),nh(2,bn,0,0,"ng-template",8),Kc()),i&2){let e=VD(),n=zD(12);cw(e.inputNumberClass()),gI(2),ch("ngTemplateOutlet",n);}}function vn(i,p){i&1&&lh(0,"nz-icon",20);}function yn(i,p){i&1&&lh(0,"nz-icon",21);}function Sn(i,p){if(i&1){let e=LD();_i(0,"div",17,7),gh("mouseup",function(){Pu(e);let t=VD(2);return Lu(t.stopAutoStep())})("mouseleave",function(){Pu(e);let t=VD(2);return Lu(t.stopAutoStep())}),_i(2,"span",18),gh("mousedown",function(t){Pu(e);let o=VD(2);return Lu(o.onStepMouseDown(t,true))}),$D(3,4,null,vn,1,0),Kc(),_i(5,"span",19),gh("mousedown",function(t){Pu(e);let o=VD(2);return Lu(o.onStepMouseDown(t,false))}),$D(6,5,null,yn,1,0),Kc()();}if(i&2){let e=VD(2);gI(2),Mh("ant-input-number-handler-up-disabled",e.upDisabled()),ah("aria-disabled",e.upDisabled()),gI(3),Mh("ant-input-number-handler-down-disabled",e.downDisabled()),ah("aria-disabled",e.downDisabled());}}function Mn(i,p){if(i&1){let e=LD();bD(0,Sn,8,6,"div",14),_i(1,"div",15)(2,"input",16,6),gh("input",function(){Pu(e);let t=zD(3),o=VD();return Lu(o.onInput(t.value))})("wheel",function(t){Pu(e);let o=VD();return Lu(o.onWheel(t))}),Kc()();}if(i&2){let e=VD();_D(e.nzControls()?0:-1),gI(2),ch("value",e.displayValue())("placeholder",e.nzPlaceHolder()??"")("disabled",e.finalDisabled())("readOnly",e.nzReadOnly()),ah("aria-valuemin",e.nzMin())("aria-valuemax",e.nzMax())("id",e.nzId())("step",e.nzStep())("value",e.displayValue());}}var Ke=(()=>{class i{nzId=$0(null);nzSize=$0("default");nzPlaceHolder=$0(null);nzStatus=$0("");nzVariant=$0();nzStep=$0(1,{transform:Y0});nzMin=$0(Number.MIN_SAFE_INTEGER,{transform:Y0});nzMax=$0(Number.MAX_SAFE_INTEGER,{transform:Y0});nzPrecision=$0(null);nzParser=$0();nzFormatter=$0();nzDisabled=$0(false,{transform:Z0});nzReadOnly=$0(false,{transform:Z0});nzAutoFocus=$0(false,{transform:Z0});nzKeyboard=$0(true,{transform:Z0});nzControls=$0(true,{transform:Z0});nzChangeOnWheel=$0(true,{transform:Z0});nzPrefix=$0();nzSuffix=$0();nzAddonBefore=$0();nzAddonAfter=$0();nzBlur=B0();nzFocus=B0();nzOnStep=B0();onChange=()=>{};onTouched=()=>{};isDisabledFirstChange=true;compactSize=C(N1,{optional:true});inputRef=q0.required("input");hostRef=q0("inputNumberHost");elementRef=C(_r);injector=C(Ee);focusMonitor=C(a3);directionality=C(Le);nzFormStatusService=C(ga,{optional:true});autoStepTimer=null;defaultFormatter=e=>{let n=this.nzPrecision();return j3(n)?e.toFixed(n):e.toString()};value=qo(null);displayValue=qo("");formSize=C(m1,{optional:true});formVariant=C(za,{optional:true});dir=C(Le).valueSignal;focused=qo(false);hasFeedback=qo(false);finalStatus=Uw(()=>this.nzStatus());finalDisabled=Uw(()=>this.nzDisabled());prefix=W0(Vt);suffix=W0(Rt$1);addonBefore=W0(wt);addonAfter=W0(Ft);hasPrefix=Hw(()=>!!this.nzPrefix()||!!this.prefix());hasSuffix=Hw(()=>!!this.nzSuffix()||!!this.suffix()||this.hasFeedback());hasAffix=Hw(()=>this.hasPrefix()||this.hasSuffix());hasAddonBefore=Hw(()=>!!this.nzAddonBefore()||!!this.addonBefore());hasAddonAfter=Hw(()=>!!this.nzAddonAfter()||!!this.addonAfter());hasAddon=Hw(()=>this.hasAddonBefore()||this.hasAddonAfter());class=Hw(()=>this.hasAddon()?this.groupWrapperClass():this.hasAffix()?this.affixWrapperClass():this.inputNumberClass());inputNumberClass=Hw(()=>r(r({"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&&!Oe(this.value(),this.nzMin(),this.nzMax())},u9("ant-input-number",this.finalVariant())),D8("ant-input-number",this.finalStatus(),this.hasFeedback())));affixWrapperClass=Hw(()=>r(r({"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"},D8("ant-input-number-affix-wrapper",this.finalStatus(),this.hasFeedback())),u9("ant-input-number-affix-wrapper",this.finalVariant())));groupWrapperClass=Hw(()=>r(r({"ant-input-number-group-wrapper":true,"ant-input-number-group-wrapper-rtl":this.dir()==="rtl"},D8("ant-input-number-group-wrapper",this.finalStatus(),this.hasFeedback())),u9("ant-input-number-group-wrapper",this.finalVariant())));finalSize=Hw(()=>this.formSize?.()?this.formSize():this.compactSize?this.compactSize():this.nzSize());finalVariant=Hw(()=>this.nzVariant()||this.formVariant?.()||"outlined");upDisabled=Hw(()=>!a9(this.value())&&this.value()>=this.nzMax());downDisabled=Hw(()=>!a9(this.value())&&this.value()<=this.nzMin());constructor(){let e=C(at);Kf(()=>{let n=this.hostRef(),t=n||this.elementRef;this.focusMonitor.monitor(t,true).pipe(Rt(e)).subscribe(o=>{Bw(()=>{this.focused.set(!!o),o?this.nzFocus.emit():(this.fixValue(),this.onTouched(),this.nzBlur.emit());});}),e.onDestroy(()=>{this.focusMonitor.stopMonitoring(t);});}),this.nzFormStatusService?.formStatusChanges.pipe(Rt()).subscribe(({status:n,hasFeedback:t})=>{this.finalStatus.set(n),this.hasFeedback.set(t);});}ngOnInit(){this.nzAutoFocus()&&Kf(()=>this.focus(),{injector:this.injector});}writeValue(e){a9(e)&&(e=null),Bw(()=>{this.value.set(e),this.setValue(e);});}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){Bw(()=>{this.finalDisabled.set(this.isDisabledFirstChange&&this.nzDisabled()||e);}),this.isDisabledFirstChange=false;}focus(e){f9(this.inputRef().nativeElement,e);}blur(){this.inputRef().nativeElement.blur();}step(e,n,t){if(n&&this.upDisabled()||!n&&this.downDisabled())return;let o=e.shiftKey?this.nzStep()*10:this.nzStep();n||(o=-o);let k=10**Bt(o),W=$t((Math.round((this.value()||0)*k)+Math.round(o*k))/k,this.nzMin(),this.nzMax(),this.nzPrecision());this.setValue(W),this.nzOnStep.emit({type:n?"up":"down",value:this.value(),offset:this.nzStep(),emitter:t}),this.focus();}setValue(e){let n=this.nzFormatter()??this.defaultFormatter,t=this.nzPrecision();j3(t)&&(e&&=+e.toFixed(t));let o=a9(e)?"":n(e);this.displayValue.set(o),this.updateValue(e);}setValueByTyping(e){if(this.displayValue.set(e),e===""){this.updateValue(null);return}let t=(this.nzParser()??At)(e);if(Tn(e)||Number.isNaN(t))return;let o=this.nzFormatter();if(o){let d=o(t);this.displayValue.set(d);}Oe(t,this.nzMin(),this.nzMax())&&this.updateValue(t);}updateValue(e){this.value()!==e&&(this.value.set(e),this.onChange(e));}fixValue(){let e=this.displayValue();if(e==="")return;let t=(this.nzParser()??At)(e);if(Number.isNaN(t))t=this.value();else {let o=this.nzPrecision();j3(o)&&Bt(t)!==o&&(t=+t.toFixed(o)),Oe(t,this.nzMin(),this.nzMax())||(t=$t(t,this.nzMin(),this.nzMax(),o));}this.setValue(t);}stopAutoStep(){this.autoStepTimer!==null&&(clearTimeout(this.autoStepTimer),this.autoStepTimer=null);}onStepMouseDown(e,n){e.preventDefault(),this.stopAutoStep(),this.step(e,n,"handler");let t=()=>{this.step(e,n,"handler"),this.autoStepTimer=setTimeout(t,Nn);};this.autoStepTimer=setTimeout(t,kn);}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(n){return new(n||i)};static \u0275cmp=QE({type:i,selectors:[["nz-input-number"]],contentQueries:function(n,t,o){n&1&&Eh(o,t.prefix,Vt,5)(o,t.suffix,Rt$1,5)(o,t.addonBefore,wt,5)(o,t.addonAfter,Ft,5),n&2&&GD(4);},viewQuery:function(n,t){n&1&&Dh(t.inputRef,qt,5)(t.hostRef,Ut,5),n&2&&GD(2);},hostVars:2,hostBindings:function(n,t){n&1&&gh("keydown",function(d){return t.onKeyDown(d)}),n&2&&cw(t.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:[Sw([{provide:h1,useExisting:wo(()=>i),multi:true},{provide:B1,useValue:"input-number"}]),rD([R4])],ngContentSelectors:Qt,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(n,t){n&1&&(BD(Zt),bD(0,Yt,1,1,null,8)(1,Xt,1,1,null,8)(2,tn,1,1,null,8),nh(3,cn,5,3,"ng-template",null,0,Lw)(5,mn,2,3,"ng-template",null,1,Lw)(7,wn,3,3,"ng-template",null,2,Lw)(9,zn,3,3,"ng-template",null,3,Lw)(11,Mn,4,10,"ng-template",null,4,Lw)),n&2&&_D(t.hasAddon()?0:t.hasAffix()?1:2);},dependencies:[pt,Se$1,va,vr],encapsulation:2})}return i})(),Nn=200,kn=600;function At(i){let p=i.trim().replace(/,/g,"").replace(/。/g,".");return p.length?+p:NaN}function Oe(i,p,e){return i>=p&&i<=e}function $t(i,p,e,n=null){if(n===null)return i<p?p:i>e?e:i;let t=+i.toFixed(n),o=Math.pow(10,n);return t<p?Math.ceil(p*o)/o:t>e?Math.floor(e*o)/o:t}function Bt(i){return i.toString().split(".")[1]?.length||0}function Tn(i){return /[.。](\d*0)?$/.test(i.toString())}var Pt=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=YE({type:i});static \u0275inj=uu({imports:[Ke]})}return i})();function En(i,p){if(i&1){let e=LD();_i(0,"div",1)(1,"input",3),Vh("ngModelChange",function(t){let o=Pu(e).$implicit;return ww(o.key,t)||(o.key=t),Lu(t)}),gh("ngModelChange",function(){Pu(e);let t=VD();return Lu(t.emitRows())}),Kc(),oE(),_i(2,"input",4),Vh("ngModelChange",function(t){let o=Pu(e).$implicit;return ww(o.value,t)||(o.value=t),Lu(t)}),gh("ngModelChange",function(){Pu(e);let t=VD();return Lu(t.emitRows())}),Kc(),oE(),_i(3,"button",5),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.remove(t))}),vw(4,"Remove"),Kc()();}if(i&2){let e=p.$implicit;gI(),jh("ngModel",e.key),sE(),gI(),jh("ngModel",e.value),sE();}}var jt=(()=>{class i{constructor(){this.rows=U0.required();}add(){this.rows.update(e=>[...e,{key:"",value:""}]);}remove(e){this.rows.update(n=>n.filter((t,o)=>o!==e));}emitRows(){this.rows.set(this.rows().map(e=>r({},e)));}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=QE({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(n,t){n&1&&(_i(0,"div",0),ND(1,En,5,2,"div",1,MD),_i(3,"button",2),gh("click",function(){return t.add()}),vw(4,"Add param"),Kc()()),n&2&&(gI(),xD(t.rows()));},dependencies:[n8,S4,J6,k3,sd,zc,t7,y7,Ki,x],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 An(i,p){return this.trackKey(p)}var $n=(i,p)=>p.id;function Bn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(2);ch("nzValue",e)("nzLabel",Ow(1,2,n.stepTypeKey(e)));}}function Pn(i,p){if(i&1){let e=LD();_i(0,"label",16),gh("ngModelChange",function(t){let o=Pu(e).$implicit,d=VD(2),k=d.$implicit,W=d.$index,L=VD();return Lu(L.toggleKnowledge(W,L.asAgent(k),o,t))}),vw(1),Rw(2,"transloco"),Kc(),oE();}if(i&2){let e=p.$implicit,n=VD(2),t=n.$implicit,o=n.$index,d=VD();ch("ngModel",d.hasKnowledge(d.asAgent(t),e)),ah("data-testid","agent-knowledge-"+e+"-"+o),sE(),gI(),nl(" ",Ow(2,3,d.knowledgeTierKey(e))," ");}}function Wn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.outputFormatKey(e)));}}function Ln(i,p){if(i&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",12),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{objective:t}))}),Kc(),oE(),Kc(),_i(5,"div",8)(6,"span"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"div",13),ND(10,Pn,3,5,"label",14,SD),Kc(),_i(12,"p",11),vw(13),Rw(14,"transloco"),Kc()(),_i(15,"div",8)(16,"span"),vw(17),Rw(18,"transloco"),Kc(),_i(19,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{outputFormat:t}))}),ND(20,Wn,2,4,"nz-option",5,SD),Kc(),oE(),Kc();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,8,"step-list.objective")),gI(2),ch("ngModel",o.asAgent(n).objective),ah("data-testid","agent-objective-"+t),sE(),gI(3),Ph(Ow(8,10,"step-list.knowledgeScope")),gI(3),xD(o.knowledgeTiers),gI(3),Ph(Ow(14,12,"step-list.knowledgeScopeHint")),gI(4),Ph(Ow(18,14,"step-list.outputFormat.label")),gI(2),ch("ngModel",o.asAgent(n).outputFormat),ah("data-testid","agent-output-"+t),sE(),gI(),xD(o.outputFormats);}}function On(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.interactionKey(e)));}}function Rn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.notifyModeKey(e)));}}function Kn(i,p){if(i&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{interaction:t}))}),ND(5,On,2,4,"nz-option",5,SD),Kc(),oE(),Kc(),_i(7,"div",8)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.setNotifyMode(o,t))}),ND(12,Rn,2,4,"nz-option",5,SD),Kc(),oE(),Kc();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,6,"step-list.interaction.label")),gI(2),ch("ngModel",o.asInteraction(n).interaction),ah("data-testid","interaction-type-"+t),sE(),gI(),xD(o.interactions),gI(4),Ph(Ow(10,8,"step-list.notify")),gI(2),ch("ngModel",o.notifyMode(o.asInteraction(n))),ah("data-testid","interaction-notify-"+t),sE(),gI(),xD(o.notifyModes);}}function jn(i,p){if(i&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",12),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{command:t}))}),Kc(),oE(),Kc();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,3,"step-list.command")),gI(2),ch("ngModel",o.asShell(n).command),ah("data-testid","shell-command-"+t),sE();}}function Hn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.gitOperationKey(e)));}}function qn(i,p){if(i&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{operation:t}))}),ND(5,Hn,2,4,"nz-option",5,SD),Kc(),oE(),Kc(),_i(7,"div",8)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"app-key-value-editor",17),gh("rowsChange",function(t){Pu(e);let o=VD(),d=o.$implicit,k=o.$index,W=VD();return Lu(W.onParamRowsChange(k,d,t))}),Kc()();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,5,"step-list.operation")),gI(2),ch("ngModel",o.asGit(n).operation),ah("data-testid","git-operation-"+t),sE(),gI(),xD(o.gitOperations),gI(4),Ph(Ow(10,7,"step-list.params")),gI(2),ch("rows",o.paramRows(n));}}function Un(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.providerActionKey(e)));}}function Zn(i,p){if(i&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{action:t}))}),ND(5,Un,2,4,"nz-option",5,SD),Kc(),oE(),Kc(),_i(7,"div",8)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"app-key-value-editor",17),gh("rowsChange",function(t){Pu(e);let o=VD(),d=o.$implicit,k=o.$index,W=VD();return Lu(W.onParamRowsChange(k,d,t))}),Kc()();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,5,"step-list.action")),gI(2),ch("ngModel",o.asProvider(n).action),ah("data-testid","provider-action-"+t),sE(),gI(),xD(o.providerActions),gI(4),Ph(Ow(10,7,"step-list.params")),gI(2),ch("rows",o.paramRows(n));}}function Qn(i,p){if(i&1&&lh(0,"nz-option",5),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e.id)("nzLabel",n.workflowOptionLabel(e));}}function Gn(i,p){if(i&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",18),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{workflowId:t}))}),ND(5,Qn,1,2,"nz-option",5,$n),Kc(),oE(),Kc(),_i(7,"p",8)(8,"span"),vw(9),Rw(10,"transloco"),Kc(),_i(11,"code",19),vw(12,"selection"),Kc()();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,4,"step-list.workflowId")),gI(2),ch("ngModel",o.asSubWorkflow(n).workflowId),ah("data-testid","sub-workflow-id-"+t),sE(),gI(),xD(o.availableWorkflows()),gI(4),Ph(Ow(10,6,"step-list.forEach"));}}function Yn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.untilTypeKey(e)));}}function Jn(i,p){if(i&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"input",10),gh("ngModelChange",function(t){Pu(e);let o=VD(2).$index,d=VD();return Lu(d.setUntilValue(o,t))}),Kc(),oE(),Kc();}if(i&2){let e=VD(2),n=e.$implicit,t=e.$index,o=VD();gI(2),Ph(Ow(3,3,"step-list.until.value")),gI(2),ch("ngModel",o.untilValue(o.asLoop(n))),ah("data-testid","loop-until-value-"+t),sE();}}function Xn(i,p){if(i&1&&(lh(0,"nz-option",5),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.onMaxIterationsKey(e)));}}function ei(i,p){if(i&1){let e=LD();_i(0,"div",20)(1,"div",8)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.setUntilType(o,t))}),ND(6,Yn,2,4,"nz-option",5,SD),Kc(),oE(),Kc(),_i(8,"label",8)(9,"span"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"input",10),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.setUntilField(o,"stepId",t))}),Kc(),oE(),Kc(),_i(13,"label",8)(14,"span"),vw(15),Rw(16,"transloco"),Kc(),_i(17,"input",10),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.setUntilField(o,"field",t))}),Kc(),oE(),Kc(),bD(18,Jn,5,5,"label",8),_i(19,"label",8)(20,"span"),vw(21),Rw(22,"transloco"),Kc(),_i(23,"nz-input-number",21),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{maxIterations:t??0}))}),Kc(),oE(),Kc(),_i(24,"div",8)(25,"span"),vw(26),Rw(27,"transloco"),Kc(),_i(28,"nz-select",15),gh("ngModelChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.patchAt(o,{onMaxIterations:{action:t}}))}),ND(29,Xn,2,4,"nz-option",5,SD),Kc(),oE(),Kc()(),_i(31,"div",22)(32,"h4"),vw(33),Rw(34,"transloco"),Kc(),_i(35,"app-step-list",23),gh("stepsChange",function(t){Pu(e);let o=VD().$index,d=VD();return Lu(d.setNestedSteps(o,t))}),Kc()();}if(i&2){let e=VD(),n=e.$implicit,t=e.$index,o=VD();gI(3),Ph(Ow(4,23,"step-list.until.type")),gI(2),ch("ngModel",o.asLoop(n).until.type),ah("data-testid","loop-until-type-"+t),sE(),gI(),xD(o.untilTypes),gI(4),Ph(Ow(11,25,"step-list.until.stepId")),gI(2),ch("ngModel",o.asLoop(n).until.stepId),ah("data-testid","loop-until-stepId-"+t),sE(),gI(3),Ph(Ow(16,27,"step-list.until.field")),gI(2),ch("ngModel",o.asLoop(n).until.field),ah("data-testid","loop-until-field-"+t),sE(),gI(),_D(o.asLoop(n).until.type==="field_equals"?18:-1),gI(3),Ph(Ow(22,29,"step-list.maxIterations")),gI(2),ch("ngModel",o.asLoop(n).maxIterations)("nzMin",0),ah("data-testid","loop-max-"+t),sE(),gI(3),Ph(Ow(27,31,"step-list.onMaxIterations.action")),gI(2),ch("ngModel",o.asLoop(n).onMaxIterations.action),ah("data-testid","loop-on-max-"+t),sE(),gI(),xD(o.maxIterationActions),gI(2),ah("data-testid","loop-nested-"+t),gI(2),Ph(Ow(34,33,"step-list.nestedSteps")),gI(2),ch("steps",o.asLoop(n).steps)("rootSteps",o.effectiveRoot())("availableWorkflows",o.availableWorkflows())("depth",o.depth()+1);}}function ti(i,p){if(i&1){let e=LD();_i(0,"nz-card",1)(1,"div",3)(2,"nz-select",4),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD();return Lu(d.changeType(o,t))}),ND(3,Bn,2,4,"nz-option",5,SD),Kc(),oE(),_i(5,"button",6),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.moveUp(t))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",6),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.moveDown(t))}),vw(9),Rw(10,"transloco"),Kc(),_i(11,"button",7),gh("click",function(){let t=Pu(e).$index,o=VD();return Lu(o.removeStep(t))}),vw(12),Rw(13,"transloco"),Kc()(),_i(14,"label",8)(15,"span"),vw(16),Rw(17,"transloco"),Kc(),_i(18,"input",9),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD();return Lu(d.onNameChange(o,t))}),Kc(),oE(),Kc(),_i(19,"label",8)(20,"span"),vw(21),Rw(22,"transloco"),Kc(),_i(23,"input",10),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD();return Lu(d.onIdChange(o,t))}),Kc(),oE(),_i(24,"p",11),vw(25),Rw(26,"transloco"),Kc()(),bD(27,Ln,22,16)(28,Kn,14,10)(29,jn,5,5,"label",8)(30,qn,12,9)(31,Zn,12,9)(32,Gn,13,8)(33,ei,36,35),Kc();}if(i&2){let e,n=p.$implicit,t=p.$index,o=VD();ch("nzTitle",o.cardTitle(t,n)),ah("data-testid","step-card-"+t),gI(2),ch("ngModel",n.type),ah("data-testid","step-type-"+t),sE(),gI(),xD(o.stepTypes),gI(2),ch("disabled",t===0),ah("data-testid","move-up-"+t),gI(),nl(" ",Ow(7,20,"step-list.moveUp")," "),gI(2),ch("disabled",t===o.steps().length-1),ah("data-testid","move-down-"+t),gI(),nl(" ",Ow(10,22,"step-list.moveDown")," "),gI(2),ah("data-testid","remove-"+t),gI(),nl(" ",Ow(13,24,"step-list.remove")," "),gI(4),Ph(Ow(17,26,"step-list.name")),gI(2),ch("ngModel",n.name),ah("data-testid","step-name-"+t),sE(),gI(3),Ph(Ow(22,28,"step-list.id")),gI(2),ch("ngModel",n.id),ah("data-testid","step-id-"+t),sE(),gI(2),Ph(Ow(26,30,"step-list.idHint")),gI(2),_D((e=n.type)==="agent"?27:e==="interaction"?28:e==="shell"?29:e==="git"?30:e==="provider_action"?31:e==="sub_workflow"?32:e==="loop"?33:-1);}}var Ht=(()=>{class i{constructor(){this.transloco=C(ar),this.language=C(O),this.steps=$0.required(),this.rootSteps=$0([]),this.availableWorkflows=$0([]),this.depth=$0(0),this.stepsChange=B0(),this.stepTypes=y,this.outputFormats=["questionnaire","confirmation","comment_suggestions","free_text"],this.interactions=["questionnaire","confirmation","conversation"],this.gitOperations=["create_worktree","checkout","create_branch","commit","push"],this.providerActions=["get_subject","get_comments","post_comment","update_status","get_content"],this.knowledgeTiers=["user","organization","project"],this.untilTypes=["field_empty","field_equals"],this.maxIterationActions=["fail","continue","ask_human"],this.notifyModes=["inherit","on","off"],this.paramRowsByStepKey=new Map;}cardTitle(e,n){this.language.currentLang();let t=this.transloco.translate(this.stepTypeKey(n.type));return n.name?this.transloco.translate("step-list.cardTitleNamed",{index:e+1,type:t,name:n.name}):this.transloco.translate("step-list.cardTitle",{index:e+1,type:t})}stepTypeKey(e){return `step-list.stepType.${e}`}outputFormatKey(e){return `step-list.outputFormat.${e}`}interactionKey(e){return `step-list.interaction.${e}`}notifyModeKey(e){return `step-list.notifyMode.${e}`}gitOperationKey(e){return `step-list.gitOperation.${e}`}providerActionKey(e){return `step-list.providerAction.${e}`}knowledgeTierKey(e){return `step-list.knowledgeTier.${e}`}untilTypeKey(e){return `step-list.untilType.${e}`}onMaxIterationsKey(e){return `step-list.onMaxIterations.${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()}trackKey(e){return e._key}addStep(){this.emit([...this.steps(),h("agent")]);}removeStep(e){let n=this.steps()[e];n&&this.paramRowsByStepKey.delete(n._key),this.emit(this.steps().filter((t,o)=>o!==e));}moveUp(e){if(e<=0)return;let n=[...this.steps()],t=n[e-1];n[e-1]=n[e],n[e]=t,this.emit(n);}moveDown(e){if(e>=this.steps().length-1)return;let n=[...this.steps()],t=n[e+1];n[e+1]=n[e],n[e]=t,this.emit(n);}changeType(e,n){let t=this.steps()[e];if(!t||t.type===n)return;this.paramRowsByStepKey.delete(t._key);let o=h(n,{id:t.id,name:t.name,idAutoSync:t._idAutoSync,key:t._key});this.replaceAt(e,o);}patchAt(e,n){let t=this.steps()[e];t&&this.replaceAt(e,r(r({},t),n));}onNameChange(e,n){let t=this.steps()[e];t&&this.replaceAt(e,E(t,n,this.effectiveRoot()));}onIdChange(e,n){let t=this.steps()[e];t&&this.replaceAt(e,P(t,n));}setNestedSteps(e,n){let t=this.steps()[e];!t||t.type!=="loop"||this.replaceAt(e,s(r({},t),{steps:n}));}asAgent(e){return e}asInteraction(e){return e}asShell(e){return e}asGit(e){return e}asProvider(e){return e}asSubWorkflow(e){return e}asLoop(e){return e}hasKnowledge(e,n){return e.knowledgeScope?.includes(n)??false}toggleKnowledge(e,n,t,o){let d=new Set(n.knowledgeScope??[]);o?d.add(t):d.delete(t);let k=[...d];this.patchAt(e,{knowledgeScope:k&&k.length>0?k:void 0});}notifyMode(e){return e.notify===void 0?"inherit":e.notify?"on":"off"}setNotifyMode(e,n){if(n==="inherit"){let t$1=this.asInteraction(this.steps()[e]),{notify:d}=t$1,k=t(t$1,["notify"]);this.replaceAt(e,k);return}this.patchAt(e,{notify:n==="on"});}paramRows(e){let n=this.paramRowsByStepKey.get(e._key);if(!n){let t=e.type==="git"||e.type==="provider_action"?e.params:void 0;n=A(t),this.paramRowsByStepKey.set(e._key,n);}return n}onParamRowsChange(e,n,t){this.paramRowsByStepKey.set(n._key,t),this.patchAt(e,{params:j(t)});}setUntilType(e,n){let t=this.asLoop(this.steps()[e]);if(n==="field_empty"){this.patchAt(e,{until:{type:n,stepId:t.until.stepId,field:t.until.field}});return}let o=t.until.type==="field_equals"?t.until.value:"";this.patchAt(e,{until:{type:n,stepId:t.until.stepId,field:t.until.field,value:o}});}setUntilField(e,n,t){let o=this.asLoop(this.steps()[e]);this.patchAt(e,{until:s(r({},o.until),{[n]:t})});}setUntilValue(e,n){let t=this.asLoop(this.steps()[e]);t.until.type==="field_equals"&&this.patchAt(e,{until:s(r({},t.until),{value:n})});}untilValue(e){return e.until.type==="field_equals"?String(e.until.value??""):""}replaceAt(e,n){this.emit(this.steps().map((t,o)=>o===e?n:t));}emit(e){this.stepsChange.emit(e);}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-step-list"]],inputs:{steps:[1,"steps"],rootSteps:[1,"rootSteps"],availableWorkflows:[1,"availableWorkflows"],depth:[1,"depth"]},outputs:{stepsChange:"stepsChange"},decls:6,vars:4,consts:[["data-testid","step-list",1,"step-list"],[1,"step-card",3,"nzTitle"],["nz-button","","nzType","dashed","nzBlock","","type","button","data-testid","add-step",3,"click"],[1,"step-toolbar"],[1,"type-select",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["nz-button","","type","button",3,"click","disabled"],["nz-button","","nzDanger","","type","button",3,"click"],[1,"field"],["nz-input","","required","",3,"ngModelChange","ngModel"],["nz-input","",3,"ngModelChange","ngModel"],[1,"hint"],["nz-input","","rows","3",3,"ngModelChange","ngModel"],[1,"checkbox-row"],["nz-checkbox","",3,"ngModel"],[3,"ngModelChange","ngModel"],["nz-checkbox","",3,"ngModelChange","ngModel"],[3,"rowsChange","rows"],["nzShowSearch","","nzAllowClear","",3,"ngModelChange","ngModel"],["data-testid","sub-workflow-foreach"],[1,"field-grid"],[3,"ngModelChange","ngModel","nzMin"],[1,"nested"],[3,"stepsChange","steps","rootSteps","availableWorkflows","depth"]],template:function(n,t){n&1&&(_i(0,"div",0),ND(1,ti,34,32,"nz-card",1,An,true),_i(3,"button",2),gh("click",function(){return t.addStep()}),vw(4),Rw(5,"transloco"),Kc()()),n&2&&(ah("data-depth",t.depth()),gI(),xD(t.steps()),gI(3),nl(" ",Ow(5,2,"step-list.addStep")," "));},dependencies:[i,Fn,n8,S4,J6,$6,k3,sd,zc,t7,y7,Nt,Ke$1,Fe,oe,Ki,x,Pt,Ke,$b,V5,D5,jt,ec],styles:[".step-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.step-card[_ngcontent-%COMP%]{background:#fff}.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}.checkbox-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem}.hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.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}"]});}}return i})();var ni=i=>({ids:i});function ii(i,p){i&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"workflow-editor.loading")));}function oi(i,p){if(i&1&&(_i(0,"p",6),vw(1),Kc()),i&2){let e=VD();gI(),Ph(e.loadError());}}function ri(i,p){if(i&1&&(_i(0,"li"),vw(1),Kc()),i&2){let e=p.$implicit;gI(),Ph(e);}}function ai(i,p){if(i&1&&(_i(0,"section",7)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,ri,2,1,"li",null,SD),Kc()()),i&2){let e=VD(2);gI(2),Ph(Ow(3,1,"workflow-editor.validation")),gI(3),xD(e.validationErrors());}}function li(i,p){if(i&1&&(lh(0,"nz-option",13),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(2);ch("nzValue",e)("nzLabel",Ow(1,2,n.subjectTypeKey(e)));}}function si(i,p){if(i&1&&(lh(0,"nz-option",15),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(2);ch("nzValue",e)("nzLabel",Ow(1,3,n.subjectHandlingKey(e)))("nzDisabled",e==="collection"&&n.appliesToValue()==="none");}}function pi(i,p){if(i&1){let e=LD();_i(0,"label",25),gh("ngModelChange",function(t){let o=Pu(e).$implicit,d=VD(2);return Lu(d.toggleTrigger(o,t))}),vw(1),Rw(2,"transloco"),Kc(),oE();}if(i&2){let e=p.$implicit,n=VD(2);ch("ngModel",n.hasTrigger(e)),ah("data-testid","notify-"+e),sE(),gI(),nl(" ",Ow(2,3,n.triggerKey(e))," ");}}function di(i,p){if(i&1&&(lh(0,"nz-option",13),Rw(1,"transloco")),i&2){let e=p.$implicit,n=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,n.inputTypeKey(e)));}}function ci(i,p){if(i&1){let e=LD();_i(0,"div",21)(1,"label",10)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",20),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{name:t}))}),Kc(),oE(),Kc(),_i(6,"label",10)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"input",20),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{label:t}))}),Kc(),oE(),Kc(),_i(11,"div",10)(12,"span"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"nz-select",26),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{type:t}))}),ND(16,di,2,4,"nz-option",13,SD),Kc(),oE(),Kc(),_i(18,"label",25),gh("ngModelChange",function(t){let o=Pu(e).$index,d=VD(2);return Lu(d.patchInputField(o,{required:t}))}),vw(19),Rw(20,"transloco"),Kc(),oE(),_i(21,"button",27),gh("click",function(){let t=Pu(e).$index,o=VD(2);return Lu(o.removeInputField(t))}),vw(22),Rw(23,"transloco"),Kc()();}if(i&2){let e=p.$implicit,n=p.$index,t=VD(2);ah("data-testid","input-field-"+n),gI(3),Ph(Ow(4,10,"workflow-editor.fieldName")),gI(2),ch("ngModel",e.name),sE(),gI(3),Ph(Ow(9,12,"workflow-editor.fieldLabel")),gI(2),ch("ngModel",e.label),sE(),gI(3),Ph(Ow(14,14,"workflow-editor.fieldType")),gI(2),ch("ngModel",e.type),sE(),gI(),xD(t.inputFieldTypes),gI(2),ch("ngModel",e.required),sE(),gI(),nl(" ",Ow(20,16,"workflow-editor.required")," "),gI(3),nl(" ",Ow(23,18,"workflow-editor.remove")," ");}}function ui(i,p){if(i&1&&(_i(0,"p",23),vw(1),Rw(2,"transloco"),Kc()),i&2){let e=VD(2);gI(),nl(" ",Pw(2,1,"workflow-editor.duplicateStepIds",xw(4,ni,e.duplicateStepIds().join(", ")))," ");}}function mi(i,p){if(i&1){let e=LD();bD(0,ai,7,3,"section",7),_i(1,"nz-card",8),Rw(2,"transloco"),_i(3,"div",9)(4,"label",10)(5,"span"),vw(6),Rw(7,"transloco"),Kc(),_i(8,"input",11),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.patchWorkflow({name:t}))}),Kc(),oE(),Kc(),_i(9,"div",10)(10,"span"),vw(11),Rw(12,"transloco"),Kc(),_i(13,"nz-select",12),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.setAppliesTo(t))}),ND(14,li,2,4,"nz-option",13,SD),Kc(),oE(),Kc(),_i(16,"div",10)(17,"span"),vw(18),Rw(19,"transloco"),Kc(),_i(20,"nz-select",14),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.patchWorkflow({subjectHandling:t}))}),ND(21,si,2,5,"nz-option",15,SD),Kc(),oE(),_i(23,"p",16),vw(24),Rw(25,"transloco"),Kc()()(),_i(26,"label",10)(27,"span"),vw(28),Rw(29,"transloco"),Kc(),_i(30,"textarea",17),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.patchWorkflow({description:t||void 0}))}),Kc(),oE(),Kc()(),_i(31,"nz-card",8),Rw(32,"transloco"),_i(33,"div",18),ND(34,pi,3,5,"label",19,SD),Kc(),_i(36,"label",10)(37,"span"),vw(38),Rw(39,"transloco"),Kc(),_i(40,"input",20),gh("ngModelChange",function(t){Pu(e);let o=VD();return Lu(o.patchWorkflow({notificationPolicy:s(r({},o.workflow().notificationPolicy),{messageTemplate:t||void 0})}))}),Kc(),oE(),Kc()(),_i(41,"nz-card",8),Rw(42,"transloco"),ND(43,ci,24,20,"div",21,MD),_i(45,"button",22),gh("click",function(){Pu(e);let t=VD();return Lu(t.addInputField())}),vw(46),Rw(47,"transloco"),Kc()(),_i(48,"nz-card",8),Rw(49,"transloco"),bD(50,ui,3,6,"p",23),_i(51,"app-step-list",24),gh("stepsChange",function(t){Pu(e);let o=VD();return Lu(o.onStepsChange(t))}),Kc()();}if(i&2){let e=VD();_D(e.validationErrors().length>0?0:-1),gI(),ch("nzTitle",Ow(2,21,"workflow-editor.basics")),gI(5),Ph(Ow(7,23,"workflow-editor.name")),gI(2),ch("ngModel",e.workflow().name),sE(),gI(3),Ph(Ow(12,25,"workflow-editor.appliesTo")),gI(2),ch("ngModel",e.appliesToValue()),sE(),gI(),xD(e.subjectTypes),gI(4),Ph(Ow(19,27,"workflow-editor.subjectHandling.label")),gI(2),ch("ngModel",e.workflow().subjectHandling),sE(),gI(),xD(e.subjectHandlingOptions),gI(3),nl(" ",Ow(25,29,e.subjectHandlingHelpKey())," "),gI(4),Ph(Ow(29,31,"workflow-editor.description")),gI(2),ch("ngModel",e.workflow().description??""),sE(),gI(),ch("nzTitle",Ow(32,33,"workflow-editor.notificationPolicy")),gI(3),xD(e.notificationTriggers),gI(4),Ph(Ow(39,35,"workflow-editor.messageTemplate")),gI(2),ch("ngModel",e.workflow().notificationPolicy.messageTemplate??""),sE(),gI(),ch("nzTitle",Ow(42,37,"workflow-editor.inputSchema")),gI(2),xD(e.workflow().inputSchema),gI(3),nl(" ",Ow(47,39,"workflow-editor.addInputField")," "),gI(2),ch("nzTitle",Ow(49,41,"workflow-editor.steps")),gI(2),_D(e.duplicateStepIds().length>0?50:-1),gI(),ch("steps",e.workflow().steps)("rootSteps",e.workflow().steps)("availableWorkflows",e.availableWorkflows());}}var So=(()=>{class i{constructor(){this.route=C(W),this.router=C(ue),this.workflowsApi=C(U),this.message=C(fr),this.destroyRef=C(at),this.transloco=C(ar),this.language=C(O),this.routeId=Zn$1(this.route.paramMap.pipe(Se(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.workflow=qo(I()),this.availableWorkflows=qo([]),this.loadError=qo(null),this.validationErrors=qo([]),this.duplicateStepIds=qo([]),this.saving=qo(false),this.loading=qo(true),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("workflow-editor.titleNew"):this.transloco.translate("workflow-editor.titleEdit",{id:this.workflow().id||this.routeId()}))),this.subjectTypes=["none","ticket","pull_request","documentation"],this.subjectHandlingOptions=["per-subject","collection"],this.notificationTriggers=["on_fail","on_complete","on_needs_input"],this.inputFieldTypes=["string","number","boolean","select"],this.workflowsApi.list().pipe(Rt(this.destroyRef)).subscribe({next:e=>this.availableWorkflows.set(e),error:()=>{}}),this.route.paramMap.pipe(Rt(this.destroyRef)).subscribe(e=>{let n=e.get("id");if(this.validationErrors.set([]),this.duplicateStepIds.set([]),this.loadError.set(null),!n){this.workflow.set(I()),this.loading.set(false);return}this.loading.set(true),this.workflowsApi.get(n).subscribe({next:t=>{this.workflow.set(s(r({},structuredClone(t)),{steps:g(t.steps,{idAutoSync:false})})),this.loading.set(false);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,`Failed to load workflow ${n}`));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}subjectHandlingKey(e){return `workflow-editor.subjectHandling.${e}`}subjectHandlingHelpKey(){return `workflow-editor.subjectHandling.help.${this.workflow().subjectHandling}`}triggerKey(e){return `workflow-editor.trigger.${e}`}inputTypeKey(e){return `workflow-editor.inputType.${e}`}patchWorkflow(e){this.workflow.update(n=>r(r({},n),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}hasTrigger(e){return this.workflow().notificationPolicy.triggers.includes(e)}toggleTrigger(e,n){let t=this.workflow().notificationPolicy.triggers,o=n?[...new Set([...t,e])]:t.filter(d=>d!==e);this.patchWorkflow({notificationPolicy:s(r({},this.workflow().notificationPolicy),{triggers:o})});}onStepsChange(e){this.patchWorkflow({steps:e}),this.duplicateStepIds.set(Ud(e));}addInputField(){this.patchWorkflow({inputSchema:[...this.workflow().inputSchema,b()]});}removeInputField(e){this.patchWorkflow({inputSchema:this.workflow().inputSchema.filter((n,t)=>t!==e)});}patchInputField(e,n){let t=this.workflow().inputSchema.map((o,d)=>d===e?r(r({},o),n):o);this.patchWorkflow({inputSchema:t});}save(){let e=this.workflow(),n=Ud(e.steps);if(this.duplicateStepIds.set(n),n.length>0){this.validationErrors.set([this.transloco.translate("workflow-editor.duplicateStepIds",{ids:n.join(", ")})]);return}let t=v(e,{omitWorkflowId:this.isNew()}),o=bh.safeParse(t);if(!o.success){this.validationErrors.set(T(o.error));return}this.validationErrors.set([]),this.saving.set(true);let d=o.data,k=this.routeId();(this.isNew()||!k?this.workflowsApi.create(d):this.workflowsApi.update(k,s(r({},d),{id:k}))).subscribe({next:L=>{this.saving.set(false),this.workflow.set(s(r({},structuredClone(L)),{steps:g(L.steps,{idAutoSync:false})})),this.message.success(this.isNew()?"Workflow created":"Workflow saved"),this.isNew()&&this.router.navigate(["/workflows",L.id,"edit"]);},error:L=>{this.saving.set(false),this.message.error(this.errorMessage(L,"Save failed"));}});}errorMessage(e,n){return e instanceof qe||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-workflow-editor"]],decls:15,vars:10,consts:[["data-testid","workflow-editor",1,"editor"],[1,"header"],[1,"header-actions"],["routerLink","/jobs"],["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"],[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,"checkbox-row"],["nz-checkbox","",3,"ngModel"],["nz-input","",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"],["nz-checkbox","",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel"],["nz-button","","nzDanger","","type","button",3,"click"]],template:function(n,t){n&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),vw(4),Kc()(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",4),gh("click",function(){return t.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,ii,3,3,"p",5)(13,oi,2,1,"p",6)(14,mi,52,43),Kc()),n&2&&(gI(4),Ph(t.pageTitle()),gI(3),Ph(Ow(8,6,"workflow-editor.backToJobs")),gI(2),ch("nzLoading",t.saving())("disabled",t.loading()||!!t.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(t.loading()?12:t.loadError()?13:14));},dependencies:[Fn,n8,S4,J6,k3,Mt,sd,zc,t7,y7,Nt,Ke$1,Fe,oe,Ki,x,$b,V5,D5,Ht,ec],styles:[".editor[_ngcontent-%COMP%]{max-width:56rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.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{So as WorkflowEditorComponent};
@@ -1 +1 @@
1
- import {q as qo,H as Hw,a8 as sc,i as ie}from'./main-5C7K2447.js';var f=(()=>{class e{connect(t){let n=new URLSearchParams;t?.jobId&&n.set("jobId",t.jobId),t?.batchId&&n.set("batchId",t.batchId);let r=n.toString(),p=`${sc.apiBaseUrl}/events${r?`?${r}`:""}`,a=qo([]),b=Hw(()=>{let o=a();return o.length>0?o[o.length-1]:void 0}),s=new EventSource(p);return s.onmessage=o=>{let c;try{c=JSON.parse(o.data);}catch(d){return}a.update(d=>[...d,c]);},{events:a.asReadonly(),latest:b,close:()=>{s.onmessage=null,s.close();}}}static{this.\u0275fac=function(n){return new(n||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();export{f};
1
+ import {q as qo,H as Hw,a8 as sc,i as ie}from'./main-6LDEPJ3H.js';var f=(()=>{class e{connect(t){let n=new URLSearchParams;t?.jobId&&n.set("jobId",t.jobId),t?.batchId&&n.set("batchId",t.batchId);let r=n.toString(),p=`${sc.apiBaseUrl}/events${r?`?${r}`:""}`,a=qo([]),b=Hw(()=>{let o=a();return o.length>0?o[o.length-1]:void 0}),s=new EventSource(p);return s.onmessage=o=>{let c;try{c=JSON.parse(o.data);}catch(d){return}a.update(d=>[...d,c]);},{events:a.asReadonly(),latest:b,close:()=>{s.onmessage=null,s.close();}}}static{this.\u0275fac=function(n){return new(n||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();export{f};
@@ -1 +1 @@
1
- import {U}from'./chunk-jDfyi4_G.js';import {f}from'./chunk-DZ8K8fY1.js';import {v as vt}from'./chunk-BnjE7sDc.js';import {W as W$1,I}from'./chunk-CECejZs9.js';import'./chunk-BaL0hYvK.js';import'./chunk-Ca9rxJZS.js';import'./chunk-DS5k0b_s.js';import {C,W,U as U$1,a as ar,b as at,q as qo,R as Rt,X as rd,Y as Bw,c as qe,Q as QE,F as Fn,M as Mt,f as ec,g as _i,m as bD,K as Kc,p as gI,A as _D,v as vw,h as Rw,P as Ph,O as Ow,B as VD,l as lh,a2 as Pw,a3 as xw,w as ch}from'./main-5C7K2447.js';var z=i=>({count:i});function F(i,h){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function K(i,h){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function L(i,h){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"p",6)(8,"nz-tag",7),vw(9),Rw(10,"transloco"),Kc(),_i(11,"span",8),vw(12),Kc(),vw(13," \xB7 "),_i(14,"span",9),vw(15),Rw(16,"transloco"),Kc(),vw(17," \xB7 "),_i(18,"span",10),vw(19),Rw(20,"transloco"),Kc()()()(),_i(21,"section",11)(22,"h2"),vw(23),Rw(24,"transloco"),Kc(),lh(25,"app-job-status-table",12),Kc()),i&2){let t=h,e=VD();gI(3),Ph(Ow(4,8,"batches.detail.backHint")),gI(3),Ph(t.id),gI(3),Ph(Ow(10,10,e.statusKey(t.status))),gI(3),Ph(t.workflowId),gI(3),Ph(Pw(16,12,"batches.detail.subjectCount",xw(19,z,t.resolvedSubjects.length))),gI(4),Ph(Ow(20,15,e.triggeredByKey(t.triggeredBy))),gI(4),Ph(Ow(24,17,"batches.detail.membersHeading")),gI(2),ch("jobs",e.memberJobs());}}var $=3e3;function g(i){return i!=="running"}var rt=(()=>{class i{constructor(){this.route=C(W),this.batchesApi=C(U),this.jobsApi=C(U$1),this.eventsService=C(f),this.transloco=C(ar),this.destroyRef=C(at),this.batch=qo(null),this.memberJobs=qo([]),this.loading=qo(true),this.loadError=qo(null),this.polling=qo(false),this.eventStream=qo(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(Rt(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),rd(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();!e||e.type!=="batch_completed"||e.batchId===this.batchId&&Bw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();});});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(Rt(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),g(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),g(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||g(t.status)){this.stopPolling();return}this.refreshMembers();},$));}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 qe||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["data-testid","batch-members",1,"members"],[3,"jobs"]],template:function(e,p){if(e&1&&(_i(0,"main",0),bD(1,F,3,3,"p",1)(2,K,2,1,"p",2)(3,L,26,21),Kc()),e&2){let f;gI(),_D(p.loading()?1:p.loadError()?2:(f=p.batch())?3:-1,f);}},dependencies:[Fn,Mt,W$1,I,vt,ec],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%] 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{rt as BatchDetailComponent};
1
+ import {U}from'./chunk-DkKxPJBS.js';import {f}from'./chunk-DaPHlPte.js';import {v as vt}from'./chunk-E9Klh0DL.js';import {W as W$1,I}from'./chunk-C9TOy_jn.js';import'./chunk-CIADdbUP.js';import'./chunk-B_0vwfJH.js';import'./chunk-GrrV0ukn.js';import {C,W,U as U$1,a as ar,b as at,q as qo,R as Rt,X as rd,Y as Bw,c as qe,Q as QE,F as Fn,M as Mt,f as ec,g as _i,m as bD,K as Kc,p as gI,A as _D,v as vw,h as Rw,P as Ph,O as Ow,B as VD,l as lh,a2 as Pw,a3 as xw,w as ch}from'./main-6LDEPJ3H.js';var z=i=>({count:i});function F(i,h){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function K(i,h){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function L(i,h){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"p",6)(8,"nz-tag",7),vw(9),Rw(10,"transloco"),Kc(),_i(11,"span",8),vw(12),Kc(),vw(13," \xB7 "),_i(14,"span",9),vw(15),Rw(16,"transloco"),Kc(),vw(17," \xB7 "),_i(18,"span",10),vw(19),Rw(20,"transloco"),Kc()()()(),_i(21,"section",11)(22,"h2"),vw(23),Rw(24,"transloco"),Kc(),lh(25,"app-job-status-table",12),Kc()),i&2){let t=h,e=VD();gI(3),Ph(Ow(4,8,"batches.detail.backHint")),gI(3),Ph(t.id),gI(3),Ph(Ow(10,10,e.statusKey(t.status))),gI(3),Ph(t.workflowId),gI(3),Ph(Pw(16,12,"batches.detail.subjectCount",xw(19,z,t.resolvedSubjects.length))),gI(4),Ph(Ow(20,15,e.triggeredByKey(t.triggeredBy))),gI(4),Ph(Ow(24,17,"batches.detail.membersHeading")),gI(2),ch("jobs",e.memberJobs());}}var $=3e3;function g(i){return i!=="running"}var rt=(()=>{class i{constructor(){this.route=C(W),this.batchesApi=C(U),this.jobsApi=C(U$1),this.eventsService=C(f),this.transloco=C(ar),this.destroyRef=C(at),this.batch=qo(null),this.memberJobs=qo([]),this.loading=qo(true),this.loadError=qo(null),this.polling=qo(false),this.eventStream=qo(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(Rt(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),rd(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();!e||e.type!=="batch_completed"||e.batchId===this.batchId&&Bw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();});});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(Rt(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),g(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),g(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||g(t.status)){this.stopPolling();return}this.refreshMembers();},$));}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 qe||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["data-testid","batch-members",1,"members"],[3,"jobs"]],template:function(e,p){if(e&1&&(_i(0,"main",0),bD(1,F,3,3,"p",1)(2,K,2,1,"p",2)(3,L,26,21),Kc()),e&2){let f;gI(),_D(p.loading()?1:p.loadError()?2:(f=p.batch())?3:-1,f);}},dependencies:[Fn,Mt,W$1,I,vt,ec],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%] 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{rt as BatchDetailComponent};
@@ -1 +1 @@
1
- import {ah as YE,ai as uu,bb as pT,C,bP as z0,cK as Gm,aq as Le,bc as hT,a$ as Le$1,c1 as Vt,Q as QE,aC as pt,aD as Se,bs as Tt,bt as Ie,br as t4,b2 as ly,ak as Z0,m as bD,A as _D,bz as ut,L as LD,g as _i,cL as ec,K as Kc,B as VD,a4 as Mh,w as ch,p as gI,aH as nh,j as gh,l as lh,bX as el,v as vw,bY as tl,P as Ph,E as Pu,G as Lu,cz as fh}from'./main-5C7K2447.js';function X(n,i){n&1&&fh(0);}function $(n,i){if(n&1&&nh(0,X,1,0,"ng-container",7),n&2){let e=VD(3);ch("nzStringTemplateOutlet",e.nzIcon);}}function nn(n,i){if(n&1&&lh(0,"nz-icon",6),n&2){let e=VD(3);ch("nzType",e.nzIconType||e.inferredIconType)("nzTheme",e.iconTheme);}}function en(n,i){if(n&1&&(_i(0,"div",2),bD(1,$,1,1,"ng-container")(2,nn,1,2,"nz-icon",6),Kc()),n&2){let e=VD(2);gI(),_D(e.nzIcon?1:2);}}function tn(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(4);gI(),Ph(e.nzMessage);}}function on(n,i){if(n&1&&(_i(0,"span",8),nh(1,tn,2,1,"ng-container",7),Kc()),n&2){let e=VD(3);gI(),ch("nzStringTemplateOutlet",e.nzMessage);}}function an(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(4);gI(),Ph(e.nzDescription);}}function rn(n,i){if(n&1&&(_i(0,"span",9),nh(1,an,2,1,"ng-container",7),Kc()),n&2){let e=VD(3);gI(),ch("nzStringTemplateOutlet",e.nzDescription);}}function ln(n,i){if(n&1&&(_i(0,"div",3),bD(1,on,2,1,"span",8),bD(2,rn,2,1,"span",9),Kc()),n&2){let e=VD(2);gI(),_D(e.nzMessage?1:-1),gI(),_D(e.nzDescription?2:-1);}}function cn(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(3);gI(),Ph(e.nzAction);}}function sn(n,i){if(n&1&&(_i(0,"div",4),nh(1,cn,2,1,"ng-container",7),Kc()),n&2){let e=VD(2);gI(),ch("nzStringTemplateOutlet",e.nzAction);}}function dn(n,i){if(n&1&&(el(0),_i(1,"span",12),vw(2),Kc(),tl()),n&2){let e=VD(4);gI(2),Ph(e.nzCloseText);}}function mn(n,i){if(n&1&&nh(0,dn,3,1,"ng-container",7),n&2){let e=VD(3);ch("nzStringTemplateOutlet",e.nzCloseText);}}function pn(n,i){n&1&&lh(0,"nz-icon",11);}function _n(n,i){if(n&1){let e=LD();_i(0,"button",10),gh("click",function(){Pu(e);let z=VD(2);return Lu(z.closeAlert())}),bD(1,mn,1,1,"ng-container")(2,pn,1,0,"nz-icon",11),Kc();}if(n&2){let e=VD(2);gI(),_D(e.nzCloseText?1:2);}}function zn(n,i){if(n&1){let e=LD();_i(0,"div",1),ec(function(z){Pu(e);let T=VD();return Lu(T.onLeaveAnimationDone(z))}),bD(1,en,3,1,"div",2),bD(2,ln,3,2,"div",3),bD(3,sn,2,1,"div",4),bD(4,_n,3,1,"button",5),Kc();}if(n&2){let e=VD();Mh("ant-alert-rtl",e.dir()==="rtl")("ant-alert-success",e.nzType==="success")("ant-alert-info",e.nzType==="info")("ant-alert-warning",e.nzType==="warning")("ant-alert-error",e.nzType==="error")("ant-alert-no-icon",!e.nzShowIcon)("ant-alert-banner",e.nzBanner)("ant-alert-closable",e.nzCloseable)("ant-alert-with-description",!!e.nzDescription),ch("nzNoAnimation",e.nzNoAnimation),gI(),_D(e.nzShowIcon?1:-1),gI(),_D(e.nzMessage||e.nzDescription?2:-1),gI(),_D(e.nzAction?3:-1),gI(),_D(e.nzCloseable||e.nzCloseText?4:-1);}}var Z="alert",un=(()=>{let n,i=[],e=[],_,z=[],T=[];return class D{static{let r=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[ut()],_=[ut()],pT(null,null,n,{kind:"field",name:"nzCloseable",static:false,private:false,access:{has:t=>"nzCloseable"in t,get:t=>t.nzCloseable,set:(t,l)=>{t.nzCloseable=l;}},metadata:r},i,e),pT(null,null,_,{kind:"field",name:"nzShowIcon",static:false,private:false,access:{has:t=>"nzShowIcon"in t,get:t=>t.nzShowIcon,set:(t,l)=>{t.nzShowIcon=l;}},metadata:r},z,T),r&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:r});}cdr=C(z0);animationType=C(Gm,{optional:true});dir=C(Le).valueSignal;_nzModuleName=Z;nzAction=null;nzCloseText=null;nzIconType=null;nzMessage=null;nzDescription=null;nzType="info";nzCloseable=hT(this,i,false);nzShowIcon=(hT(this,e),hT(this,z,false));nzBanner=(hT(this,T),false);nzNoAnimation=false;nzIcon=null;nzOnClose=new Le$1;closed=false;iconTheme="fill";inferredIconType="info-circle";isTypeSet=false;isShowIconSet=false;constructor(){Vt(Z,()=>this.cdr.markForCheck());}closeAlert(){this.closed=true,(this.nzNoAnimation||this.animationType==="NoopAnimations")&&this.nzOnClose.emit(true);}onLeaveAnimationDone(r){let t=r.target;if(this.nzNoAnimation||this.animationType==="NoopAnimations"){r.animationComplete();return}t.classList.add("ant-alert-motion-leave","ant-alert-motion-leave-active");let l=()=>{t.removeEventListener("transitionend",l),this.nzOnClose.emit(true),r.animationComplete();};t.addEventListener("transitionend",l);}ngOnChanges(r){let{nzShowIcon:t,nzDescription:l,nzType:J,nzBanner:K}=r;if(t&&(this.isShowIconSet=true),J)switch(this.isTypeSet=true,this.nzType){case "error":this.inferredIconType="close-circle";break;case "success":this.inferredIconType="check-circle";break;case "info":this.inferredIconType="info-circle";break;case "warning":this.inferredIconType="exclamation-circle";break}l&&(this.iconTheme=this.nzDescription?"outline":"fill"),K&&(this.isTypeSet||(this.nzType="warning"),this.isShowIconSet||(this.nzShowIcon=true));}static \u0275fac=function(t){return new(t||D)};static \u0275cmp=QE({type:D,selectors:[["nz-alert"]],inputs:{nzAction:"nzAction",nzCloseText:"nzCloseText",nzIconType:"nzIconType",nzMessage:"nzMessage",nzDescription:"nzDescription",nzType:"nzType",nzCloseable:[2,"nzCloseable","nzCloseable",Z0],nzShowIcon:[2,"nzShowIcon","nzShowIcon",Z0],nzBanner:[2,"nzBanner","nzBanner",Z0],nzNoAnimation:[2,"nzNoAnimation","nzNoAnimation",Z0],nzIcon:"nzIcon"},outputs:{nzOnClose:"nzOnClose"},exportAs:["nzAlert"],features:[ly],decls:1,vars:1,consts:[[1,"ant-alert",3,"nzNoAnimation","ant-alert-rtl","ant-alert-success","ant-alert-info","ant-alert-warning","ant-alert-error","ant-alert-no-icon","ant-alert-banner","ant-alert-closable","ant-alert-with-description"],[1,"ant-alert",3,"nzNoAnimation"],[1,"ant-alert-icon"],[1,"ant-alert-content"],[1,"ant-alert-action"],["type","button","tabindex","0",1,"ant-alert-close-icon"],[3,"nzType","nzTheme"],[4,"nzStringTemplateOutlet"],[1,"ant-alert-message"],[1,"ant-alert-description"],["type","button","tabindex","0",1,"ant-alert-close-icon",3,"click"],["nzType","close"],[1,"ant-alert-close-text"]],template:function(t,l){t&1&&bD(0,zn,5,23,"div",0),t&2&&_D(l.closed?-1:0);},dependencies:[pt,Se,Tt,Ie,t4],encapsulation:2})}})(),Gn=(()=>{class n{static \u0275fac=function(_){return new(_||n)};static \u0275mod=YE({type:n});static \u0275inj=uu({imports:[un]})}return n})();export{Gn as G,un as u};
1
+ import {ah as YE,ai as uu,bb as pT,C,bP as z0,cK as Gm,aq as Le,bc as hT,a$ as Le$1,c1 as Vt,Q as QE,aC as pt,aD as Se,bs as Tt,bt as Ie,br as t4,b2 as ly,ak as Z0,m as bD,A as _D,bz as ut,L as LD,g as _i,cL as ec,K as Kc,B as VD,a4 as Mh,w as ch,p as gI,aH as nh,j as gh,l as lh,bX as el,v as vw,bY as tl,P as Ph,E as Pu,G as Lu,cz as fh}from'./main-6LDEPJ3H.js';function X(n,i){n&1&&fh(0);}function $(n,i){if(n&1&&nh(0,X,1,0,"ng-container",7),n&2){let e=VD(3);ch("nzStringTemplateOutlet",e.nzIcon);}}function nn(n,i){if(n&1&&lh(0,"nz-icon",6),n&2){let e=VD(3);ch("nzType",e.nzIconType||e.inferredIconType)("nzTheme",e.iconTheme);}}function en(n,i){if(n&1&&(_i(0,"div",2),bD(1,$,1,1,"ng-container")(2,nn,1,2,"nz-icon",6),Kc()),n&2){let e=VD(2);gI(),_D(e.nzIcon?1:2);}}function tn(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(4);gI(),Ph(e.nzMessage);}}function on(n,i){if(n&1&&(_i(0,"span",8),nh(1,tn,2,1,"ng-container",7),Kc()),n&2){let e=VD(3);gI(),ch("nzStringTemplateOutlet",e.nzMessage);}}function an(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(4);gI(),Ph(e.nzDescription);}}function rn(n,i){if(n&1&&(_i(0,"span",9),nh(1,an,2,1,"ng-container",7),Kc()),n&2){let e=VD(3);gI(),ch("nzStringTemplateOutlet",e.nzDescription);}}function ln(n,i){if(n&1&&(_i(0,"div",3),bD(1,on,2,1,"span",8),bD(2,rn,2,1,"span",9),Kc()),n&2){let e=VD(2);gI(),_D(e.nzMessage?1:-1),gI(),_D(e.nzDescription?2:-1);}}function cn(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(3);gI(),Ph(e.nzAction);}}function sn(n,i){if(n&1&&(_i(0,"div",4),nh(1,cn,2,1,"ng-container",7),Kc()),n&2){let e=VD(2);gI(),ch("nzStringTemplateOutlet",e.nzAction);}}function dn(n,i){if(n&1&&(el(0),_i(1,"span",12),vw(2),Kc(),tl()),n&2){let e=VD(4);gI(2),Ph(e.nzCloseText);}}function mn(n,i){if(n&1&&nh(0,dn,3,1,"ng-container",7),n&2){let e=VD(3);ch("nzStringTemplateOutlet",e.nzCloseText);}}function pn(n,i){n&1&&lh(0,"nz-icon",11);}function _n(n,i){if(n&1){let e=LD();_i(0,"button",10),gh("click",function(){Pu(e);let z=VD(2);return Lu(z.closeAlert())}),bD(1,mn,1,1,"ng-container")(2,pn,1,0,"nz-icon",11),Kc();}if(n&2){let e=VD(2);gI(),_D(e.nzCloseText?1:2);}}function zn(n,i){if(n&1){let e=LD();_i(0,"div",1),ec(function(z){Pu(e);let T=VD();return Lu(T.onLeaveAnimationDone(z))}),bD(1,en,3,1,"div",2),bD(2,ln,3,2,"div",3),bD(3,sn,2,1,"div",4),bD(4,_n,3,1,"button",5),Kc();}if(n&2){let e=VD();Mh("ant-alert-rtl",e.dir()==="rtl")("ant-alert-success",e.nzType==="success")("ant-alert-info",e.nzType==="info")("ant-alert-warning",e.nzType==="warning")("ant-alert-error",e.nzType==="error")("ant-alert-no-icon",!e.nzShowIcon)("ant-alert-banner",e.nzBanner)("ant-alert-closable",e.nzCloseable)("ant-alert-with-description",!!e.nzDescription),ch("nzNoAnimation",e.nzNoAnimation),gI(),_D(e.nzShowIcon?1:-1),gI(),_D(e.nzMessage||e.nzDescription?2:-1),gI(),_D(e.nzAction?3:-1),gI(),_D(e.nzCloseable||e.nzCloseText?4:-1);}}var Z="alert",un=(()=>{let n,i=[],e=[],_,z=[],T=[];return class D{static{let r=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[ut()],_=[ut()],pT(null,null,n,{kind:"field",name:"nzCloseable",static:false,private:false,access:{has:t=>"nzCloseable"in t,get:t=>t.nzCloseable,set:(t,l)=>{t.nzCloseable=l;}},metadata:r},i,e),pT(null,null,_,{kind:"field",name:"nzShowIcon",static:false,private:false,access:{has:t=>"nzShowIcon"in t,get:t=>t.nzShowIcon,set:(t,l)=>{t.nzShowIcon=l;}},metadata:r},z,T),r&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:r});}cdr=C(z0);animationType=C(Gm,{optional:true});dir=C(Le).valueSignal;_nzModuleName=Z;nzAction=null;nzCloseText=null;nzIconType=null;nzMessage=null;nzDescription=null;nzType="info";nzCloseable=hT(this,i,false);nzShowIcon=(hT(this,e),hT(this,z,false));nzBanner=(hT(this,T),false);nzNoAnimation=false;nzIcon=null;nzOnClose=new Le$1;closed=false;iconTheme="fill";inferredIconType="info-circle";isTypeSet=false;isShowIconSet=false;constructor(){Vt(Z,()=>this.cdr.markForCheck());}closeAlert(){this.closed=true,(this.nzNoAnimation||this.animationType==="NoopAnimations")&&this.nzOnClose.emit(true);}onLeaveAnimationDone(r){let t=r.target;if(this.nzNoAnimation||this.animationType==="NoopAnimations"){r.animationComplete();return}t.classList.add("ant-alert-motion-leave","ant-alert-motion-leave-active");let l=()=>{t.removeEventListener("transitionend",l),this.nzOnClose.emit(true),r.animationComplete();};t.addEventListener("transitionend",l);}ngOnChanges(r){let{nzShowIcon:t,nzDescription:l,nzType:J,nzBanner:K}=r;if(t&&(this.isShowIconSet=true),J)switch(this.isTypeSet=true,this.nzType){case "error":this.inferredIconType="close-circle";break;case "success":this.inferredIconType="check-circle";break;case "info":this.inferredIconType="info-circle";break;case "warning":this.inferredIconType="exclamation-circle";break}l&&(this.iconTheme=this.nzDescription?"outline":"fill"),K&&(this.isTypeSet||(this.nzType="warning"),this.isShowIconSet||(this.nzShowIcon=true));}static \u0275fac=function(t){return new(t||D)};static \u0275cmp=QE({type:D,selectors:[["nz-alert"]],inputs:{nzAction:"nzAction",nzCloseText:"nzCloseText",nzIconType:"nzIconType",nzMessage:"nzMessage",nzDescription:"nzDescription",nzType:"nzType",nzCloseable:[2,"nzCloseable","nzCloseable",Z0],nzShowIcon:[2,"nzShowIcon","nzShowIcon",Z0],nzBanner:[2,"nzBanner","nzBanner",Z0],nzNoAnimation:[2,"nzNoAnimation","nzNoAnimation",Z0],nzIcon:"nzIcon"},outputs:{nzOnClose:"nzOnClose"},exportAs:["nzAlert"],features:[ly],decls:1,vars:1,consts:[[1,"ant-alert",3,"nzNoAnimation","ant-alert-rtl","ant-alert-success","ant-alert-info","ant-alert-warning","ant-alert-error","ant-alert-no-icon","ant-alert-banner","ant-alert-closable","ant-alert-with-description"],[1,"ant-alert",3,"nzNoAnimation"],[1,"ant-alert-icon"],[1,"ant-alert-content"],[1,"ant-alert-action"],["type","button","tabindex","0",1,"ant-alert-close-icon"],[3,"nzType","nzTheme"],[4,"nzStringTemplateOutlet"],[1,"ant-alert-message"],[1,"ant-alert-description"],["type","button","tabindex","0",1,"ant-alert-close-icon",3,"click"],["nzType","close"],[1,"ant-alert-close-text"]],template:function(t,l){t&1&&bD(0,zn,5,23,"div",0),t&2&&_D(l.closed?-1:0);},dependencies:[pt,Se,Tt,Ie,t4],encapsulation:2})}})(),Gn=(()=>{class n{static \u0275fac=function(_){return new(_||n)};static \u0275mod=YE({type:n});static \u0275inj=uu({imports:[un]})}return n})();export{Gn as G,un as u};
@@ -1 +1 @@
1
- import {C,b7 as Kn,a8 as sc,b9 as Xa,b8 as lc,i as ie}from'./main-5C7K2447.js';var U=(()=>{class r{constructor(){this.http=C(Kn),this.baseUrl=`${sc.apiBaseUrl}/batches`;}list(t){return this.http.get(this.baseUrl,{params:Xa(t)}).pipe(lc())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(lc())}jobs(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/jobs`).pipe(lc())}launch(t){return this.http.post(this.baseUrl,t).pipe(lc())}static{this.\u0275fac=function(a){return new(a||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{U};
1
+ import {C,b7 as Kn,a8 as sc,b9 as Xa,b8 as lc,i as ie}from'./main-6LDEPJ3H.js';var U=(()=>{class r{constructor(){this.http=C(Kn),this.baseUrl=`${sc.apiBaseUrl}/batches`;}list(t){return this.http.get(this.baseUrl,{params:Xa(t)}).pipe(lc())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(lc())}jobs(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/jobs`).pipe(lc())}launch(t){return this.http.post(this.baseUrl,t).pipe(lc())}static{this.\u0275fac=function(a){return new(a||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{U};
@@ -1,5 +1,5 @@
1
- import {j}from'./chunk--cAlvNjP.js';import {f as fr,K as Ki,x}from'./chunk-C5kOvUkS.js';import {z as z$,d as d$}from'./chunk-CbG3rfKf.js';import {C,W,I as ue,aZ as U,b6 as l,b as at,a as ar,ac as O,ad as Zn,ae as Se$1,q as qo,H as Hw,R as Rt,s,r,c as qe$1,Q as QE,F as Fn,n as n8,af as S4,J as J6,k as k3,M as Mt,d as sd,z as zc,e as t7,Z as y7,$ as $b,V as V5,D as D5,f as ec,g as _i,v as vw,K as Kc,h as Rw,j as gh,m as bD,p as gI,P as Ph,O as Ow,w as ch,u as nl,A as _D,b7 as Kn,a8 as sc,b8 as lc,i as ie,B as VD,L as LD,o as oE,N as ND,x as sE,y as xD,S as SD,l as lh,E as Pu,G as Lu,a5 as ah,a6 as Nw}from'./main-5C7K2447.js';import {U as U$1}from'./chunk-VW6e_Kls.js';import'./chunk-DS5k0b_s.js';var Te=(()=>{class t{constructor(){this.http=C(Kn),this.baseUrl=`${sc.apiBaseUrl}/providers`;}listQueryTemplates(e){return this.http.get(`${this.baseUrl}/${encodeURIComponent(e)}/query-templates`).pipe(lc())}resolveQueryTemplate(e,i,n){return this.http.post(`${this.baseUrl}/${encodeURIComponent(e)}/query-templates/${encodeURIComponent(i)}/resolve`,{params:n}).pipe(lc())}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();function A(t,o){let e=t?.activeProviders;if(o==="ticket")return e?.ticket;if(o==="pull_request")return e?.repo}var Ee=()=>[],be=(t,o)=>o.id,Ve=(t,o)=>o.name;function Ie(t,o){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ke(t,o){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function ze(t,o){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=o.$implicit;gI(),Ph(e);}}function Se(t,o){if(t&1&&(_i(0,"section",7)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,ze,2,1,"li",null,SD),Kc()()),t&2){let e=VD(2);gI(2),Ph(Ow(3,1,"views.editor.validation")),gI(3),xD(e.validationErrors());}}function qe(t,o){if(t&1&&lh(0,"nz-option",11),t&2){let e=o.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function Pe(t,o){if(t&1&&(lh(0,"nz-option",11),Rw(1,"transloco")),t&2){let e=o.$implicit,i=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,i.subjectTypeKey(e)));}}function je(t,o){if(t&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",14),gh("ngModelChange",function(n){Pu(e);let d=VD(2);return Lu(d.onSubjectTypeChange(n))}),ND(5,Pe,2,4,"nz-option",11,SD),Kc(),oE(),Kc();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,2,"views.editor.subjectType")),gI(2),ch("ngModel",e.subjectType()),sE(),gI(),xD(e.subjectTypeOptions());}}function Ne(t,o){if(t&1&&(_i(0,"p",12),vw(1),Rw(2,"transloco"),Kc()),t&2){let e=VD(2);gI(),nl(" ",Ow(2,1,e.subjectTypeKey(o))," ");}}function De(t,o){if(t&1){let e=LD();_i(0,"div",13)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",15)(5,"button",16),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("template"))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",17),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("raw"))}),vw(9),Rw(10,"transloco"),Kc()()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,5,"views.editor.queryMode")),gI(3),ch("nzType",e.queryMode()==="template"?"primary":"default"),gI(),nl(" ",Ow(7,7,"views.editor.queryMode.template")," "),gI(2),ch("nzType",e.queryMode()==="raw"?"primary":"default"),gI(),nl(" ",Ow(10,9,"views.editor.queryMode.raw")," ");}}function Fe(t,o){if(t&1&&lh(0,"nz-option",11),t&2){let e=o.$implicit;ch("nzValue",e.id)("nzLabel",e.label);}}function $e(t,o){t&1&&(_i(0,"span",19),vw(1,"*"),Kc());}function Ae(t,o){if(t&1&&lh(0,"nz-option",11),t&2){let e=o.$implicit;ch("nzValue",e)("nzLabel",e);}}function Be(t,o){if(t&1){let e=LD();_i(0,"nz-select",22),gh("ngModelChange",function(n){Pu(e);let d=VD().$implicit,m=VD(4);return Lu(m.setTemplateParam(d.name,n))}),ND(1,Ae,1,2,"nz-option",11,SD),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE(),gI(),xD(e.options??Nw(2,Ee));}}function Oe(t,o){if(t&1){let e=LD();_i(0,"input",23),gh("ngModelChange",function(n){Pu(e);let d=VD().$implicit,m=VD(4);return Lu(m.setTemplateParam(d.name,n))}),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE();}}function Le(t,o){if(t&1&&(_i(0,"label",8)(1,"span"),vw(2),bD(3,$e,2,0,"span",19),Kc(),bD(4,Be,3,3,"nz-select",20)(5,Oe,1,2,"input",21),Kc()),t&2){let e=o.$implicit;gI(2),nl(" ",e.label," "),gI(),_D(e.required?3:-1),gI(),_D(e.type==="select"?4:5);}}function Re(t,o){t&1&&ND(0,Le,6,3,"label",8,Ve),t&2&&xD(o.params);}function We(t,o){if(t&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",18),gh("ngModelChange",function(n){Pu(e);let d=VD(2);return Lu(d.selectTemplate(n))}),ND(5,Fe,1,2,"nz-option",11,be),Kc(),oE(),Kc(),bD(7,Re,2,0);}if(t&2){let e,i=VD(2);gI(2),Ph(Ow(3,3,"views.editor.template")),gI(2),ch("ngModel",i.selectedTemplateId()),sE(),gI(),xD(i.templates()),gI(2),_D((e=i.selectedTemplate())?7:-1,e);}}function Ue(t,o){if(t&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",24),gh("ngModelChange",function(n){Pu(e);let d=VD(2);return Lu(d.queryText.set(n))}),Kc(),oE(),_i(5,"span",25),vw(6),Rw(7,"transloco"),Kc()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,3,"views.editor.query")),gI(2),ch("ngModel",e.queryText()),sE(),gI(2),Ph(Ow(7,5,"views.editor.queryHint"));}}function Qe(t,o){if(t&1){let e=LD();bD(0,Se,7,3,"section",7),_i(1,"label",8)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",9),gh("ngModelChange",function(n){Pu(e);let d=VD();return Lu(d.name.set(n))}),Kc(),oE(),Kc(),_i(6,"div",8)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",10),gh("ngModelChange",function(n){Pu(e);let d=VD();return Lu(d.onWorkflowChange(n))}),ND(11,qe,1,2,"nz-option",11,be),Kc(),oE(),Kc(),bD(13,je,7,4,"div",8)(14,Ne,3,3,"p",12),bD(15,De,11,11,"div",13),bD(16,We,8,5)(17,Ue,8,7,"label",8);}if(t&2){let e,i=VD();_D(i.validationErrors().length>0?0:-1),gI(3),Ph(Ow(4,8,"views.editor.name")),gI(2),ch("ngModel",i.name()),sE(),gI(3),Ph(Ow(9,10,"views.editor.workflow")),gI(2),ch("ngModel",i.workflowId()),sE(),gI(),xD(i.bindableWorkflows()),gI(2),_D(i.needsSubjectTypePicker()?13:(e=i.subjectType())?14:-1,e),gI(2),_D(i.hasTemplates()?15:-1),gI(),_D(i.queryMode()==="template"&&i.hasTemplates()?16:17);}}function Je(t){let o=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return o.length>0?`${o}-${e}`:`view-${e}`}function xe(t){let o={};for(let e of t.params)o[e.name]=e.type==="select"?e.options?.[0]??"":"";return o}var kt=(()=>{class t{constructor(){this.route=C(W),this.router=C(ue),this.viewsApi=C(U),this.workflowsApi=C(U$1),this.settingsApi=C(l),this.providersApi=C(Te),this.message=C(fr),this.destroyRef=C(at),this.transloco=C(ar),this.language=C(O),this.routeId=Zn(this.route.paramMap.pipe(Se$1(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.workflows=qo([]),this.subjectType=qo(null),this.queryText=qo(`{
1
+ import {T}from'./chunk-M0pfvgRb.js';import {f as fr,K as Ki,x}from'./chunk-Dnos4vY0.js';import {z as zh,d as dh}from'./chunk-D5kutWaL.js';import {C,W,I as ue,aZ as U,b6 as l,b as at,a as ar,ac as O,ad as Zn,ae as Se$1,q as qo,H as Hw,R as Rt,s,r,c as qe$1,Q as QE,F as Fn,n as n8,af as S4,J as J6,k as k3,M as Mt,d as sd,z as zc,e as t7,Z as y7,$ as $b,V as V5,D as D5,f as ec,g as _i,v as vw,K as Kc,h as Rw,j as gh,m as bD,p as gI,P as Ph,O as Ow,w as ch,u as nl,A as _D,b7 as Kn,a8 as sc,b8 as lc,i as ie,B as VD,L as LD,o as oE,N as ND,x as sE,y as xD,S as SD,l as lh,E as Pu,G as Lu,a5 as ah,a6 as Nw}from'./main-6LDEPJ3H.js';import {U as U$1}from'./chunk-CfZWJKlu.js';import'./chunk-GrrV0ukn.js';var Te=(()=>{class t{constructor(){this.http=C(Kn),this.baseUrl=`${sc.apiBaseUrl}/providers`;}listQueryTemplates(e){return this.http.get(`${this.baseUrl}/${encodeURIComponent(e)}/query-templates`).pipe(lc())}resolveQueryTemplate(e,i,n){return this.http.post(`${this.baseUrl}/${encodeURIComponent(e)}/query-templates/${encodeURIComponent(i)}/resolve`,{params:n}).pipe(lc())}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275prov=ie({token:t,factory:t.\u0275fac,providedIn:"root"});}}return t})();function A(t,o){let e=t?.activeProviders;if(o==="ticket")return e?.ticket;if(o==="pull_request")return e?.repo}var Ee=()=>[],be=(t,o)=>o.id,Ve=(t,o)=>o.name;function Ie(t,o){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ke(t,o){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function ze(t,o){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=o.$implicit;gI(),Ph(e);}}function Se(t,o){if(t&1&&(_i(0,"section",7)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,ze,2,1,"li",null,SD),Kc()()),t&2){let e=VD(2);gI(2),Ph(Ow(3,1,"views.editor.validation")),gI(3),xD(e.validationErrors());}}function qe(t,o){if(t&1&&lh(0,"nz-option",11),t&2){let e=o.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function Pe(t,o){if(t&1&&(lh(0,"nz-option",11),Rw(1,"transloco")),t&2){let e=o.$implicit,i=VD(3);ch("nzValue",e)("nzLabel",Ow(1,2,i.subjectTypeKey(e)));}}function je(t,o){if(t&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",14),gh("ngModelChange",function(n){Pu(e);let d=VD(2);return Lu(d.onSubjectTypeChange(n))}),ND(5,Pe,2,4,"nz-option",11,SD),Kc(),oE(),Kc();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,2,"views.editor.subjectType")),gI(2),ch("ngModel",e.subjectType()),sE(),gI(),xD(e.subjectTypeOptions());}}function Ne(t,o){if(t&1&&(_i(0,"p",12),vw(1),Rw(2,"transloco"),Kc()),t&2){let e=VD(2);gI(),nl(" ",Ow(2,1,e.subjectTypeKey(o))," ");}}function De(t,o){if(t&1){let e=LD();_i(0,"div",13)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",15)(5,"button",16),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("template"))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",17),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("raw"))}),vw(9),Rw(10,"transloco"),Kc()()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,5,"views.editor.queryMode")),gI(3),ch("nzType",e.queryMode()==="template"?"primary":"default"),gI(),nl(" ",Ow(7,7,"views.editor.queryMode.template")," "),gI(2),ch("nzType",e.queryMode()==="raw"?"primary":"default"),gI(),nl(" ",Ow(10,9,"views.editor.queryMode.raw")," ");}}function Fe(t,o){if(t&1&&lh(0,"nz-option",11),t&2){let e=o.$implicit;ch("nzValue",e.id)("nzLabel",e.label);}}function $e(t,o){t&1&&(_i(0,"span",19),vw(1,"*"),Kc());}function Ae(t,o){if(t&1&&lh(0,"nz-option",11),t&2){let e=o.$implicit;ch("nzValue",e)("nzLabel",e);}}function Be(t,o){if(t&1){let e=LD();_i(0,"nz-select",22),gh("ngModelChange",function(n){Pu(e);let d=VD().$implicit,m=VD(4);return Lu(m.setTemplateParam(d.name,n))}),ND(1,Ae,1,2,"nz-option",11,SD),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE(),gI(),xD(e.options??Nw(2,Ee));}}function Oe(t,o){if(t&1){let e=LD();_i(0,"input",23),gh("ngModelChange",function(n){Pu(e);let d=VD().$implicit,m=VD(4);return Lu(m.setTemplateParam(d.name,n))}),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE();}}function Le(t,o){if(t&1&&(_i(0,"label",8)(1,"span"),vw(2),bD(3,$e,2,0,"span",19),Kc(),bD(4,Be,3,3,"nz-select",20)(5,Oe,1,2,"input",21),Kc()),t&2){let e=o.$implicit;gI(2),nl(" ",e.label," "),gI(),_D(e.required?3:-1),gI(),_D(e.type==="select"?4:5);}}function Re(t,o){t&1&&ND(0,Le,6,3,"label",8,Ve),t&2&&xD(o.params);}function We(t,o){if(t&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",18),gh("ngModelChange",function(n){Pu(e);let d=VD(2);return Lu(d.selectTemplate(n))}),ND(5,Fe,1,2,"nz-option",11,be),Kc(),oE(),Kc(),bD(7,Re,2,0);}if(t&2){let e,i=VD(2);gI(2),Ph(Ow(3,3,"views.editor.template")),gI(2),ch("ngModel",i.selectedTemplateId()),sE(),gI(),xD(i.templates()),gI(2),_D((e=i.selectedTemplate())?7:-1,e);}}function Ue(t,o){if(t&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",24),gh("ngModelChange",function(n){Pu(e);let d=VD(2);return Lu(d.queryText.set(n))}),Kc(),oE(),_i(5,"span",25),vw(6),Rw(7,"transloco"),Kc()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,3,"views.editor.query")),gI(2),ch("ngModel",e.queryText()),sE(),gI(2),Ph(Ow(7,5,"views.editor.queryHint"));}}function Qe(t,o){if(t&1){let e=LD();bD(0,Se,7,3,"section",7),_i(1,"label",8)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",9),gh("ngModelChange",function(n){Pu(e);let d=VD();return Lu(d.name.set(n))}),Kc(),oE(),Kc(),_i(6,"div",8)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",10),gh("ngModelChange",function(n){Pu(e);let d=VD();return Lu(d.onWorkflowChange(n))}),ND(11,qe,1,2,"nz-option",11,be),Kc(),oE(),Kc(),bD(13,je,7,4,"div",8)(14,Ne,3,3,"p",12),bD(15,De,11,11,"div",13),bD(16,We,8,5)(17,Ue,8,7,"label",8);}if(t&2){let e,i=VD();_D(i.validationErrors().length>0?0:-1),gI(3),Ph(Ow(4,8,"views.editor.name")),gI(2),ch("ngModel",i.name()),sE(),gI(3),Ph(Ow(9,10,"views.editor.workflow")),gI(2),ch("ngModel",i.workflowId()),sE(),gI(),xD(i.bindableWorkflows()),gI(2),_D(i.needsSubjectTypePicker()?13:(e=i.subjectType())?14:-1,e),gI(2),_D(i.hasTemplates()?15:-1),gI(),_D(i.queryMode()==="template"&&i.hasTemplates()?16:17);}}function Je(t){let o=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return o.length>0?`${o}-${e}`:`view-${e}`}function xe(t){let o={};for(let e of t.params)o[e.name]=e.type==="select"?e.options?.[0]??"":"";return o}var kt=(()=>{class t{constructor(){this.route=C(W),this.router=C(ue),this.viewsApi=C(U),this.workflowsApi=C(U$1),this.settingsApi=C(l),this.providersApi=C(Te),this.message=C(fr),this.destroyRef=C(at),this.transloco=C(ar),this.language=C(O),this.routeId=Zn(this.route.paramMap.pipe(Se$1(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.workflows=qo([]),this.subjectType=qo(null),this.queryText=qo(`{
2
2
 
3
- }`),this.queryMode=qo("template"),this.templates=qo([]),this.selectedTemplateId=qo(null),this.templateParams=qo({}),this.settings=qo(null),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.bindableWorkflows=Hw(()=>this.workflows().filter(e=>e.appliesTo!=="none")),this.selectedWorkflow=Hw(()=>this.bindableWorkflows().find(e=>e.id===this.workflowId())??null),this.subjectTypeOptions=Hw(()=>z$(this.selectedWorkflow()?.appliesTo??"none")),this.needsSubjectTypePicker=Hw(()=>this.subjectTypeOptions().length>1),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("views.editor.titleNew"):this.transloco.translate("views.editor.titleEdit",{id:this.routeId()}))),this.selectedTemplate=Hw(()=>this.templates().find(e=>e.id===this.selectedTemplateId())??null),this.hasTemplates=Hw(()=>this.templates().length>0),this.workflowsApi.list().pipe(Rt(this.destroyRef)).subscribe({next:e=>this.workflows.set(e),error:e=>{this.workflows.set([]),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.settingsApi.getSettings().pipe(Rt(this.destroyRef)).subscribe({next:e=>{this.settings.set(e),this.refreshTemplates();},error:e=>{this.settings.set({}),this.refreshTemplates(),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.route.paramMap.pipe(Rt(this.destroyRef)).subscribe(e=>{let i=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),this.pendingProvenance=void 0,!i){this.name.set(""),this.workflowId.set(""),this.subjectType.set(null),this.queryText.set(`{
3
+ }`),this.queryMode=qo("template"),this.templates=qo([]),this.selectedTemplateId=qo(null),this.templateParams=qo({}),this.settings=qo(null),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.bindableWorkflows=Hw(()=>this.workflows().filter(e=>e.appliesTo!=="none")),this.selectedWorkflow=Hw(()=>this.bindableWorkflows().find(e=>e.id===this.workflowId())??null),this.subjectTypeOptions=Hw(()=>zh(this.selectedWorkflow()?.appliesTo??"none")),this.needsSubjectTypePicker=Hw(()=>this.subjectTypeOptions().length>1),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("views.editor.titleNew"):this.transloco.translate("views.editor.titleEdit",{id:this.routeId()}))),this.selectedTemplate=Hw(()=>this.templates().find(e=>e.id===this.selectedTemplateId())??null),this.hasTemplates=Hw(()=>this.templates().length>0),this.workflowsApi.list().pipe(Rt(this.destroyRef)).subscribe({next:e=>this.workflows.set(e),error:e=>{this.workflows.set([]),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.settingsApi.getSettings().pipe(Rt(this.destroyRef)).subscribe({next:e=>{this.settings.set(e),this.refreshTemplates();},error:e=>{this.settings.set({}),this.refreshTemplates(),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.route.paramMap.pipe(Rt(this.destroyRef)).subscribe(e=>{let i=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),this.pendingProvenance=void 0,!i){this.name.set(""),this.workflowId.set(""),this.subjectType.set(null),this.queryText.set(`{
4
4
 
5
- }`),this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),this.loading.set(false),this.refreshTemplates();return}this.loading.set(true),this.viewsApi.get(i).subscribe({next:n=>{this.name.set(n.name),this.workflowId.set(n.workflowId),this.subjectType.set(n.subjectType),this.queryText.set(JSON.stringify(n.query,null,2)),this.pendingProvenance=n.queryTemplate,this.queryMode.set(n.queryTemplate?"template":"raw"),this.loading.set(false),this.refreshTemplates();},error:n=>{this.loading.set(false),this.loadError.set(this.errorMessage(n,this.transloco.translate("views.editor.loadFailed")));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}onWorkflowChange(e){this.workflowId.set(e);let i=z$(this.bindableWorkflows().find(n=>n.id===e)?.appliesTo??"none");if(this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),i.length===1)this.subjectType.set(i[0]);else if(i.length>1){let n=this.subjectType();this.subjectType.set(n&&i.includes(n)?n:null);}else this.subjectType.set(null);this.refreshTemplates();}onSubjectTypeChange(e){this.subjectType.set(e),this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),this.refreshTemplates();}setQueryMode(e){this.queryMode.set(e),e==="template"&&!this.selectedTemplateId()&&this.templates()[0]&&this.selectTemplate(this.templates()[0].id);}selectTemplate(e){let i=this.templates().find(n=>n.id===e);this.selectedTemplateId.set(e),this.templateParams.set(i?xe(i):{});}templateParamValue(e){let i=this.templateParams()[e];return i==null?"":String(i)}setTemplateParam(e,i){this.templateParams.set(s(r({},this.templateParams()),{[e]:i}));}save(){if(this.queryMode()==="template"&&this.hasTemplates()){this.saveFromTemplate();return}this.saveFromRawJson();}saveFromTemplate(){let e=this.selectedTemplate(),i=this.subjectType(),n=i?A(this.settings(),i):void 0;if(!e||!n){this.validationErrors.set([this.transloco.translate("views.editor.pickTemplate")]);return}let d=e.params.filter(m=>{if(!m.required)return false;let z=this.templateParams()[m.name];return z==null||String(z).trim()===""});if(d.length>0){this.validationErrors.set(d.map(m=>this.transloco.translate("views.editor.missingParam",{label:m.label})));return}this.validationErrors.set([]),this.saving.set(true),this.providersApi.resolveQueryTemplate(n,e.id,this.templateParams()).subscribe({next:m=>{this.persist({query:m.query,queryTemplate:{templateId:e.id,params:this.templateParams()}});},error:m=>{this.saving.set(false),this.message.error(this.errorMessage(m,this.transloco.translate("views.editor.resolveFailed")));}});}saveFromRawJson(){let e;try{e=JSON.parse(this.queryText());}catch(i){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}if(e===null||typeof e!="object"||Array.isArray(e)){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}this.persist({query:e});}persist(e){let i=this.routeId(),n=this.subjectType(),d=r({id:i??Je(this.name()),name:this.name().trim(),subjectType:n??"",workflowId:this.workflowId(),query:e.query},e.queryTemplate?{queryTemplate:e.queryTemplate}:{}),m=d$.safeParse(d);if(!m.success){this.saving.set(false),this.validationErrors.set(j(m.error));return}this.validationErrors.set([]),this.saving.set(true);let z=m.data;(this.isNew()||!i?this.viewsApi.create(z):this.viewsApi.update(i,z)).subscribe({next:N=>{this.saving.set(false),this.message.success(this.transloco.translate(this.isNew()?"views.editor.created":"views.editor.saved")),this.isNew()&&this.router.navigate(["/views",N.id,"edit"]);},error:N=>{this.saving.set(false),this.message.error(this.errorMessage(N,this.transloco.translate("views.editor.saveFailed")));}});}refreshTemplates(){let e=this.subjectType(),i=e?A(this.settings(),e):null;if(!i){this.templates.set([]),this.applyLoadedTemplates([]);return}this.providersApi.listQueryTemplates(i).subscribe({next:n=>{this.templates.set(n),this.applyLoadedTemplates(n);},error:()=>{this.templates.set([]),this.applyLoadedTemplates([]);}});}applyLoadedTemplates(e){let i=this.pendingProvenance;if(i){let n=e.find(d=>d.id===i.templateId);n?(this.queryMode.set("template"),this.selectedTemplateId.set(n.id),this.templateParams.set(r(r({},xe(n)),i.params))):(this.queryMode.set("raw"),this.selectedTemplateId.set(null)),this.pendingProvenance=void 0;return}if(this.queryMode()!=="raw"){if(e.length===0){this.queryMode.set("raw"),this.selectedTemplateId.set(null),this.templateParams.set({});return}e.some(n=>n.id===this.selectedTemplateId())||this.selectTemplate(e[0].id);}}errorMessage(e,i){return e instanceof qe$1||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-view-editor"]],decls:15,vars:10,consts:[["data-testid","view-editor",1,"editor"],[1,"header"],[1,"header-actions"],["routerLink","/views"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","validation-errors",1,"errors"],[1,"field"],["nz-input","","data-testid","view-name",3,"ngModelChange","ngModel"],["data-testid","view-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","view-subject-type-resolved",1,"hint"],["data-testid","query-mode-toggle",1,"field"],["data-testid","view-subject-type",3,"ngModelChange","ngModel"],[1,"mode-toggle"],["nz-button","","type","button","data-testid","query-mode-template",3,"click","nzType"],["nz-button","","type","button","data-testid","query-mode-raw",3,"click","nzType"],["data-testid","view-template",3,"ngModelChange","ngModel"],[1,"required"],[3,"ngModel"],["nz-input","",3,"ngModel"],[3,"ngModelChange","ngModel"],["nz-input","",3,"ngModelChange","ngModel"],["nz-input","","rows","8","data-testid","view-query",3,"ngModelChange","ngModel"],[1,"hint"]],template:function(i,n){i&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),vw(4),Kc()(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",4),gh("click",function(){return n.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,Ie,3,3,"p",5)(13,ke,2,1,"p",6)(14,Qe,18,12),Kc()),i&2&&(gI(4),Ph(n.pageTitle()),gI(3),Ph(Ow(8,6,"views.editor.backToList")),gI(2),ch("nzLoading",n.saving())("disabled",n.loading()||!!n.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(n.loading()?12:n.loadError()?13:14));},dependencies:[Fn,n8,S4,J6,k3,Mt,sd,zc,t7,y7,Ki,x,$b,V5,D5,ec],styles:[".editor[_ngcontent-%COMP%]{max-width:40rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{font-size:.8rem;color:#78716c}.mode-toggle[_ngcontent-%COMP%]{display:flex;gap:.5rem}.required[_ngcontent-%COMP%]{color:#9f1239}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}textarea[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace}"]});}}return t})();export{kt as ViewEditorComponent};
5
+ }`),this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),this.loading.set(false),this.refreshTemplates();return}this.loading.set(true),this.viewsApi.get(i).subscribe({next:n=>{this.name.set(n.name),this.workflowId.set(n.workflowId),this.subjectType.set(n.subjectType),this.queryText.set(JSON.stringify(n.query,null,2)),this.pendingProvenance=n.queryTemplate,this.queryMode.set(n.queryTemplate?"template":"raw"),this.loading.set(false),this.refreshTemplates();},error:n=>{this.loading.set(false),this.loadError.set(this.errorMessage(n,this.transloco.translate("views.editor.loadFailed")));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}onWorkflowChange(e){this.workflowId.set(e);let i=zh(this.bindableWorkflows().find(n=>n.id===e)?.appliesTo??"none");if(this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),i.length===1)this.subjectType.set(i[0]);else if(i.length>1){let n=this.subjectType();this.subjectType.set(n&&i.includes(n)?n:null);}else this.subjectType.set(null);this.refreshTemplates();}onSubjectTypeChange(e){this.subjectType.set(e),this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),this.refreshTemplates();}setQueryMode(e){this.queryMode.set(e),e==="template"&&!this.selectedTemplateId()&&this.templates()[0]&&this.selectTemplate(this.templates()[0].id);}selectTemplate(e){let i=this.templates().find(n=>n.id===e);this.selectedTemplateId.set(e),this.templateParams.set(i?xe(i):{});}templateParamValue(e){let i=this.templateParams()[e];return i==null?"":String(i)}setTemplateParam(e,i){this.templateParams.set(s(r({},this.templateParams()),{[e]:i}));}save(){if(this.queryMode()==="template"&&this.hasTemplates()){this.saveFromTemplate();return}this.saveFromRawJson();}saveFromTemplate(){let e=this.selectedTemplate(),i=this.subjectType(),n=i?A(this.settings(),i):void 0;if(!e||!n){this.validationErrors.set([this.transloco.translate("views.editor.pickTemplate")]);return}let d=e.params.filter(m=>{if(!m.required)return false;let z=this.templateParams()[m.name];return z==null||String(z).trim()===""});if(d.length>0){this.validationErrors.set(d.map(m=>this.transloco.translate("views.editor.missingParam",{label:m.label})));return}this.validationErrors.set([]),this.saving.set(true),this.providersApi.resolveQueryTemplate(n,e.id,this.templateParams()).subscribe({next:m=>{this.persist({query:m.query,queryTemplate:{templateId:e.id,params:this.templateParams()}});},error:m=>{this.saving.set(false),this.message.error(this.errorMessage(m,this.transloco.translate("views.editor.resolveFailed")));}});}saveFromRawJson(){let e;try{e=JSON.parse(this.queryText());}catch(i){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}if(e===null||typeof e!="object"||Array.isArray(e)){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}this.persist({query:e});}persist(e){let i=this.routeId(),n=this.subjectType(),d=r({id:i??Je(this.name()),name:this.name().trim(),subjectType:n??"",workflowId:this.workflowId(),query:e.query},e.queryTemplate?{queryTemplate:e.queryTemplate}:{}),m=dh.safeParse(d);if(!m.success){this.saving.set(false),this.validationErrors.set(T(m.error));return}this.validationErrors.set([]),this.saving.set(true);let z=m.data;(this.isNew()||!i?this.viewsApi.create(z):this.viewsApi.update(i,z)).subscribe({next:N=>{this.saving.set(false),this.message.success(this.transloco.translate(this.isNew()?"views.editor.created":"views.editor.saved")),this.isNew()&&this.router.navigate(["/views",N.id,"edit"]);},error:N=>{this.saving.set(false),this.message.error(this.errorMessage(N,this.transloco.translate("views.editor.saveFailed")));}});}refreshTemplates(){let e=this.subjectType(),i=e?A(this.settings(),e):null;if(!i){this.templates.set([]),this.applyLoadedTemplates([]);return}this.providersApi.listQueryTemplates(i).subscribe({next:n=>{this.templates.set(n),this.applyLoadedTemplates(n);},error:()=>{this.templates.set([]),this.applyLoadedTemplates([]);}});}applyLoadedTemplates(e){let i=this.pendingProvenance;if(i){let n=e.find(d=>d.id===i.templateId);n?(this.queryMode.set("template"),this.selectedTemplateId.set(n.id),this.templateParams.set(r(r({},xe(n)),i.params))):(this.queryMode.set("raw"),this.selectedTemplateId.set(null)),this.pendingProvenance=void 0;return}if(this.queryMode()!=="raw"){if(e.length===0){this.queryMode.set("raw"),this.selectedTemplateId.set(null),this.templateParams.set({});return}e.some(n=>n.id===this.selectedTemplateId())||this.selectTemplate(e[0].id);}}errorMessage(e,i){return e instanceof qe$1||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-view-editor"]],decls:15,vars:10,consts:[["data-testid","view-editor",1,"editor"],[1,"header"],[1,"header-actions"],["routerLink","/views"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","validation-errors",1,"errors"],[1,"field"],["nz-input","","data-testid","view-name",3,"ngModelChange","ngModel"],["data-testid","view-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","view-subject-type-resolved",1,"hint"],["data-testid","query-mode-toggle",1,"field"],["data-testid","view-subject-type",3,"ngModelChange","ngModel"],[1,"mode-toggle"],["nz-button","","type","button","data-testid","query-mode-template",3,"click","nzType"],["nz-button","","type","button","data-testid","query-mode-raw",3,"click","nzType"],["data-testid","view-template",3,"ngModelChange","ngModel"],[1,"required"],[3,"ngModel"],["nz-input","",3,"ngModel"],[3,"ngModelChange","ngModel"],["nz-input","",3,"ngModelChange","ngModel"],["nz-input","","rows","8","data-testid","view-query",3,"ngModelChange","ngModel"],[1,"hint"]],template:function(i,n){i&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),vw(4),Kc()(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",4),gh("click",function(){return n.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,Ie,3,3,"p",5)(13,ke,2,1,"p",6)(14,Qe,18,12),Kc()),i&2&&(gI(4),Ph(n.pageTitle()),gI(3),Ph(Ow(8,6,"views.editor.backToList")),gI(2),ch("nzLoading",n.saving())("disabled",n.loading()||!!n.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(n.loading()?12:n.loadError()?13:14));},dependencies:[Fn,n8,S4,J6,k3,Mt,sd,zc,t7,y7,Ki,x,$b,V5,D5,ec],styles:[".editor[_ngcontent-%COMP%]{max-width:40rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{font-size:.8rem;color:#78716c}.mode-toggle[_ngcontent-%COMP%]{display:flex;gap:.5rem}.required[_ngcontent-%COMP%]{color:#9f1239}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}textarea[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace}"]});}}return t})();export{kt as ViewEditorComponent};