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

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 (47) hide show
  1. package/dist/engine.js +19 -19
  2. package/package.json +3 -3
  3. package/static/assets/i18n/en.json +1 -0
  4. package/static/assets/i18n/es.json +1 -0
  5. package/static/{chunk-NZ-CPWJ2.js → chunk-9iLiX6s9.js} +1 -1
  6. package/static/{chunk-CecXf-CU.js → chunk-B1ctXsPE.js} +1 -1
  7. package/static/{chunk-bCuvpgQS.js → chunk-BCVM7LpT.js} +1 -1
  8. package/static/{chunk-B2Xol2Un.js → chunk-BDJQdoLK.js} +1 -1
  9. package/static/{chunk-DfcFBVF4.js → chunk-BHl7Qe4I.js} +1 -1
  10. package/static/{chunk-Bgl02GNl.js → chunk-BIvdnqHD.js} +1 -1
  11. package/static/{chunk-HUIPNwd9.js → chunk-BKICOySu.js} +1 -1
  12. package/static/{chunk-Dv5GyY6h.js → chunk-BifCfczc.js} +1 -1
  13. package/static/{chunk-BhF-m2HP.js → chunk-BjQMmcp2.js} +1 -1
  14. package/static/{chunk-Dp4H7MY0.js → chunk-Bwjn3y5m.js} +1 -1
  15. package/static/{chunk-C0HCwfa5.js → chunk-C73FUXq8.js} +1 -1
  16. package/static/{chunk-9U0WIegY.js → chunk-C9wrgS_q.js} +1 -1
  17. package/static/{chunk-BhTujCrk.js → chunk-CID_DKHO.js} +1 -1
  18. package/static/{chunk-CeywzbyD.js → chunk-CN3wKZOB.js} +1 -1
  19. package/static/{chunk-Cg2E0vnT.js → chunk-CQOTdAZb.js} +1 -1
  20. package/static/{chunk-Fwpw-z7T.js → chunk-CaN6B9M_.js} +1 -1
  21. package/static/{chunk-iE460Kz5.js → chunk-ChofVXdQ.js} +1 -1
  22. package/static/{chunk-DGC4TkAL.js → chunk-CuMWfPIh.js} +1 -1
  23. package/static/{chunk-Bu6_39Nh.js → chunk-CvXwIrKe.js} +1 -1
  24. package/static/{chunk-DUkiyf7y.js → chunk-D-NkClC5.js} +1 -1
  25. package/static/{chunk-Th9whP36.js → chunk-D8gvcRpT.js} +1 -1
  26. package/static/{chunk-B7WkIFy0.js → chunk-DEGtd3B-.js} +1 -1
  27. package/static/{chunk-Edaw7VGW.js → chunk-DEfYLuNM.js} +1 -1
  28. package/static/{chunk-CRv0PDB7.js → chunk-DFJPjl29.js} +1 -1
  29. package/static/{chunk-B0kZCuEt.js → chunk-DH_EwOze.js} +1 -1
  30. package/static/{chunk-CenXuPs5.js → chunk-DMO51-bi.js} +1 -1
  31. package/static/{chunk-z2vvQAle.js → chunk-DPfPY82u.js} +1 -1
  32. package/static/{chunk-DYzSLsNo.js → chunk-DVfH_gtr.js} +1 -1
  33. package/static/{chunk-CRdEWPUM.js → chunk-DaXqAFL1.js} +1 -1
  34. package/static/{chunk-C2BVYtVN.js → chunk-Darhf4Mc.js} +2 -2
  35. package/static/{chunk-BW9BdLk-.js → chunk-Dbi2Cgba.js} +1 -1
  36. package/static/chunk-DkiTgkyJ.js +5 -0
  37. package/static/{chunk-yoe_30RI.js → chunk-GVGHSEm1.js} +1 -1
  38. package/static/{chunk-C7h8oMzu.js → chunk-JnLpFByq.js} +1 -1
  39. package/static/{chunk-DZJZYEZl.js → chunk-LeZgxxmQ.js} +1 -1
  40. package/static/{chunk-FOJfn_t9.js → chunk-b67RbqkY.js} +1 -1
  41. package/static/{chunk-DtQtDE8q.js → chunk-mzNzLBkE.js} +1 -1
  42. package/static/chunk-oT_2rlWK.js +1 -0
  43. package/static/{chunk-CsQ_HDGC.js → chunk-ov4Fshx3.js} +1 -1
  44. package/static/index.html +1 -1
  45. package/static/{main-CHQMTVIP.js → main-CL3L2RPE.js} +1 -1
  46. package/static/chunk-DixyYfV_.js +0 -1
  47. package/static/chunk-p6dftaf8.js +0 -5
@@ -1 +1 @@
1
- import {l}from'./chunk-D19C8Gcb.js';import {T}from'./chunk-FOJfn_t9.js';import {_ as _n,C as Cn}from'./chunk-NZ-CPWJ2.js';import {C,V as Ve,b as at,b0 as jn,R as J1,q as qo,u as ue,aS as v,aY as Dg,c as bi,Z as ZE,d as $8,e as al,f as rl,g as $i,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,b1 as ts,h as ex,F as Fm,A as Am,K as Kt$1,G as FD,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl$1,M as MD,b2 as Le,b3 as Wn,az as jw,E as Aw,H as HD,x as xD,N as ND,k as iE,y as aE,B as AD,b4 as N2,aV as ix,b5 as cx,i as ie$1,n as uh,D as ch,aO as SD,aP as Mh,O as Fu,Q as ju,aH as QD}from'./main-CHQMTVIP.js';import {b}from'./chunk-B7WkIFy0.js';import {N as Nt,K as Ke}from'./chunk-Edaw7VGW.js';import {n as ng,i as i_}from'./chunk-C2BVYtVN.js';import {W,I}from'./chunk-iE460Kz5.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';var Ot=i=>({name:i}),Lt=(()=>{class i{constructor(){this.modalRef=C(Le),this.data=C(Wn);}cancel(){this.modalRef.close(void 0);}choose(t){this.modalRef.close(t);}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-import-conflict"]],decls:14,vars:15,consts:[["data-testid","import-conflict-dialog"],["data-testid","import-conflict-message"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","import-conflict-cancel",3,"click"],["nz-button","","type","button","data-testid","import-conflict-create-new",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","import-conflict-update",3,"click"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",2)(5,"button",3),mh("click",function(){return a.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",4),mh("click",function(){return a.choose("create_new")}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",5),mh("click",function(){return a.choose("update")}),Iw(12),Pw(13,"transloco"),Jc()()()),e&2&&(gI(2),rl$1(" ",jw(3,4,"workflows.import.conflictBody",Aw(13,Ot,a.data.name))," "),gI(4),rl$1(" ",Fw(7,7,"common.cancel")," "),gI(3),rl$1(" ",Fw(10,9,"workflows.import.createNew")," "),gI(3),rl$1(" ",Fw(13,11,"workflows.import.update")," "));},dependencies:[pf,bd,sp,fp,Kt$1],styles:["p[_ngcontent-%COMP%]{margin:0 0 1.25rem;color:#44403c}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem}"]});}}return i})();var Pt=(()=>{class i{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/workflow-library`;}list(){return this.http.get(this.baseUrl).pipe(cx())}add(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/add`,{}).pipe(cx())}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275prov=ie$1({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();var At=(i,d)=>d.id;function Vt(i,d){i&1&&(_i(0,"p",2),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Rt(i,d){if(i&1&&(_i(0,"p",3),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function Ht(i,d){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.addError());}}function Kt(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD(3);gI(),Lh(Fw(2,1,e.subjectTypeKey(t)));}}function Ut(i,d){if(i&1&&(_i(0,"li")(1,"span"),Iw(2),Jc(),_i(3,"span",14),Iw(4),Pw(5,"transloco"),Jc()()),i&2){let t=d.$implicit,e=HD(4);Mh("margin-left",t.depth,"rem"),gI(2),Lh(t.name),gI(2),Lh(Fw(5,4,e.stepTypeKey(t.type)));}}function Jt(i,d){if(i&1&&(_i(0,"ol",12),xD(1,Ut,6,6,"li",13,SD),Jc()),i&2){let t=HD().$implicit,e=HD(2);ch("data-testid","library-steps-"+t.id),gI(),AD(e.previewSteps(t));}}function Zt(i,d){if(i&1){let t=FD();_i(0,"nz-card")(1,"div",6)(2,"h2"),Iw(3),Jc(),_i(4,"nz-tag"),Iw(5),Pw(6,"transloco"),Jc()(),_i(7,"p",7),Iw(8),Jc(),_i(9,"div",8),xD(10,Kt,3,3,"nz-tag",null,ND),Jc(),_i(12,"div",9)(13,"button",10),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.togglePreview(a.id))}),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"button",11),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.addToMyWorkflows(a.id))}),Iw(17),Pw(18,"transloco"),Jc()(),_D(19,Jt,3,1,"ol",12),Jc();}if(i&2){let t=d.$implicit,e=HD(2);ch("data-testid","library-entry-"+t.id),gI(2),ch("data-testid","library-name-"+t.id),gI(),Lh(t.name),gI(),ch("data-testid","library-source-"+t.id),gI(),Lh(Fw(6,13,e.sourceKey(t.source))),gI(2),ch("data-testid","library-description-"+t.id),gI(),rl$1(" ",t.description," "),gI(2),AD(e.appliesToValues(t)),gI(3),ch("data-testid","library-preview-"+t.id),gI(),rl$1(" ",Fw(15,15,e.isExpanded(t.id)?"workflow-library.hideSteps":"workflow-library.previewSteps")," "),gI(2),lh("disabled",e.addingId()!==null),ch("data-testid","library-add-"+t.id),gI(),rl$1(" ",Fw(18,17,e.addingId()===t.id?"workflow-library.adding":"workflow-library.add")," "),gI(2),MD(e.isExpanded(t.id)?19:-1);}}function qt(i,d){if(i&1&&(_D(0,Ht,2,1,"p",4),_i(1,"div",5),xD(2,Zt,20,19,"nz-card",null,At),Jc()),i&2){let t=HD();MD(t.addError()?0:-1),gI(2),AD(t.entries());}}var jt=(()=>{class i{constructor(){this.libraryApi=C(Pt),this.router=C(J1),this.transloco=C(Ve),this.destroyRef=C(at),this.modalRef=C(Le,{optional:true}),this.entries=qo([]),this.loading=qo(true),this.loadError=qo(null),this.addError=qo(null),this.addingId=qo(null),this.expandedIds=qo(new Set),this.libraryApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.entries.set(t),this.loading.set(false);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("workflow-library.loadFailed")));}});}sourceKey(t){return `workflow-library.source.${t}`}appliesToValues(t){let e=t.workflowDefinition.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}stepTypeKey(t){return `step-list.stepType.${t}`}isExpanded(t){return this.expandedIds().has(t)}togglePreview(t){this.expandedIds.update(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a});}previewSteps(t){return Dt(t.workflowDefinition.steps,0)}addToMyWorkflows(t){this.addingId()||(this.addError.set(null),this.addingId.set(t),this.libraryApi.add(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.addingId.set(null),this.modalRef?.close(),this.router.navigate(["/workflows",e.id,"edit"]);},error:e=>{this.addingId.set(null),this.addError.set(this.errorMessage(e,this.transloco.translate("workflow-library.addFailed")));}}));}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-library-browser"]],decls:7,vars:4,consts:[["data-testid","workflow-library-browser",1,"library"],[1,"lede"],["data-testid","library-loading"],["data-testid","library-load-error",1,"error"],["data-testid","library-add-error",1,"error"],[1,"cards"],[1,"card-head"],[1,"description"],[1,"applies-to"],[1,"card-actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","primary","type","button",3,"click","disabled"],[1,"steps-preview"],[3,"margin-left"],[1,"step-type"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_D(4,Vt,3,3,"p",2)(5,Rt,2,1,"p",3)(6,qt,4,1),Jc()),e&2&&(gI(2),Lh(Fw(3,2,"workflow-library.lede")),gI(2),MD(a.loading()?4:a.loadError()?5:6));},dependencies:[$8,pf,bd,sp,fp,Nt,Ke,W,I,Kt$1],styles:[".library[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.lede[_ngcontent-%COMP%]{margin:0;color:#57534e}.cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.card-head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}.card-head[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.05rem;font-weight:600}.description[_ngcontent-%COMP%]{margin:.5rem 0 0;color:#57534e}.applies-to[_ngcontent-%COMP%]{margin-top:.5rem}.card-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.5rem}.steps-preview[_ngcontent-%COMP%]{margin:.75rem 0 0;padding-left:1.25rem;color:#44403c}.steps-preview[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;margin:.25rem 0}.step-type[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();function Dt(i,d){let t=[];for(let e of i)t.push({name:e.name,type:e.type,depth:d}),e.type==="loop"&&Array.isArray(e.steps)&&t.push(...Dt(e.steps,d+1));return t}var Gt=i=>({count:i}),Qt=i=>["/workflows",i,"edit"],Xt=(i,d)=>d.id;function Yt(i,d){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.actionError());}}function te(i,d){i&1&&(_i(0,"p",10),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ee(i,d){if(i&1&&(_i(0,"p",11),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function ie(i,d){if(i&1&&(uh(0,"nz-option",14),Pw(1,"transloco")),i&2){let t=d.$implicit,e=HD(2);lh("nzValue",t)("nzLabel",Fw(1,2,e.subjectHandlingFilterKey(t)));}}function ne(i,d){if(i&1&&(_i(0,"p",15),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.deleteError());}}function oe(i,d){if(i&1){let t=FD();_i(0,"section",16)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",18)(5,"button",19),mh("click",function(){Fu(t);let a=HD(2);return ju(a.openLibrary())}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"a",20),Iw(9),Pw(10,"transloco"),Jc()()();}i&2&&(gI(2),Lh(Fw(3,3,"workflows.list.emptyState")),gI(4),rl$1(" ",Fw(7,5,"workflows.list.emptyBrowseLibrary")," "),gI(3),rl$1(" ",Fw(10,7,"workflows.list.emptyCreateButton")," "));}function re(i,d){if(i&1&&(_i(0,"span"),Iw(1),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(t.description);}}function ae(i,d){if(i&1&&(_i(0,"span",22),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(Fw(2,2,"workflows.list.noDescription"));}}function le(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD().$implicit,a=HD(3);ch("data-testid","applies-to-"+e.id),gI(),Lh(Fw(2,2,a.subjectTypeKey(t)));}}function se(i,d){if(i&1){let t=FD();_i(0,"tr")(1,"td")(2,"span"),Iw(3),Jc()(),_i(4,"td",21),_D(5,re,2,2,"span")(6,ae,3,4,"span",22),Jc(),_i(7,"td"),xD(8,le,3,4,"nz-tag",null,ND),Jc(),_i(10,"td")(11,"nz-tag"),Iw(12),Pw(13,"transloco"),Jc()(),_i(14,"td")(15,"span"),Iw(16),Pw(17,"transloco"),Jc()(),_i(18,"td",23)(19,"a",24),Iw(20),Pw(21,"transloco"),Jc(),_i(22,"button",25),mh("click",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.exportWorkflow(a))}),Iw(23),Pw(24,"transloco"),Jc(),_i(25,"button",26),Pw(26,"transloco"),Pw(27,"transloco"),Pw(28,"transloco"),mh("nzOnConfirm",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.deleteWorkflow(a.id))}),Iw(29),Pw(30,"transloco"),Jc()()();}if(i&2){let t=d.$implicit,e=HD(3);ch("data-testid","workflow-"+t.id),gI(2),ch("data-testid","name-"+t.id),gI(),Lh(t.name),gI(2),MD(t.description?.trim()?5:6),gI(3),AD(e.appliesToValues(t)),gI(3),ch("data-testid","subject-handling-"+t.id),gI(),Lh(Fw(13,18,e.subjectHandlingKey(t.subjectHandling))),gI(3),ch("data-testid","step-count-"+t.id),gI(),Lh(jw(17,20,"workflows.list.stepCount",Aw(35,Gt,t.steps.length))),gI(3),lh("routerLink",Aw(37,Qt,t.id)),ch("data-testid","edit-"+t.id),gI(),rl$1(" ",Fw(21,23,"workflows.list.edit")," "),gI(2),ch("data-testid","export-"+t.id),gI(),rl$1(" ",Fw(24,25,"workflows.list.export")," "),gI(2),lh("nzPopconfirmTitle",Fw(26,27,"workflows.list.deleteConfirm"))("nzOkText",Fw(27,29,"workflows.list.delete"))("nzCancelText",Fw(28,31,"common.cancel")),ch("data-testid","delete-"+t.id),gI(4),rl$1(" ",Fw(30,33,"workflows.list.delete")," ");}}function pe(i,d){if(i&1&&(_i(0,"nz-table",17)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc(),_i(18,"th"),Iw(19),Pw(20,"transloco"),Jc()()(),_i(21,"tbody"),xD(22,se,31,39,"tr",null,Xt),Jc()()),i&2){let t=HD(2);lh("nzData",t.workflows())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,9,"workflows.list.column.name")),gI(3),Lh(Fw(8,11,"workflows.list.column.description")),gI(3),Lh(Fw(11,13,"workflow-editor.appliesTo")),gI(3),Lh(Fw(14,15,"workflow-editor.subjectHandling.label")),gI(3),Lh(Fw(17,17,"workflows.list.column.steps")),gI(3),Lh(Fw(20,19,"workflows.list.column.actions")),gI(3),AD(t.workflows());}}function de(i,d){if(i&1){let t=FD();_i(0,"div",12)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nz-select",13),mh("ngModelChange",function(a){Fu(t);let f=HD();return ju(f.setSubjectHandlingFilter(a))}),xD(5,ie,2,4,"nz-option",14,ND),Jc(),iE(),Jc(),_D(7,ne,2,1,"p",15),_D(8,oe,11,9,"section",16)(9,pe,24,21,"nz-table",17);}if(i&2){let t=HD();gI(2),Lh(Fw(3,4,"workflows.list.filterBySubjectHandling")),gI(2),lh("ngModel",t.subjectHandlingFilter()),aE(),gI(),AD(t.subjectHandlingOptions),gI(2),MD(t.deleteError()?7:-1),gI(),MD(t.workflows().length===0?8:9);}}var si=(()=>{class i{constructor(){this.workflowsApi=C(b),this.transloco=C(Ve),this.destroyRef=C(at),this.modal=C(jn),this.router=C(J1),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.actionError=qo(null),this.importing=qo(false),this.subjectHandlingFilter=qo("all"),this.subjectHandlingOptions=["all","per-subject","collection"],this.load();}setSubjectHandlingFilter(t){this.subjectHandlingFilter.set(t),this.load();}appliesToValues(t){let e=t.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}subjectHandlingKey(t){return `workflow-editor.subjectHandling.${t}`}subjectHandlingFilterKey(t){return t==="all"?"workflows.list.filterAll":`workflow-editor.subjectHandling.${t}`}deleteWorkflow(t){this.deleteError.set(null),this.workflowsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.workflows.update(e=>e.filter(a=>a.id!==t));},error:e=>{this.deleteError.set(this.errorMessage(e,this.transloco.translate("workflows.list.deleteFailed")));}});}openLibrary(){this.modal.create({nzTitle:this.transloco.translate("workflow-library.title"),nzContent:jt,nzFooter:null,nzWidth:720});}exportWorkflow(t){this.actionError.set(null),this.workflowsApi.exportDefinition(t.id).pipe(ue(this.destroyRef)).subscribe({next:e=>{l(`${ng(e.name)}.json`,JSON.stringify(e,null,2),"application/json");},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("workflows.list.exportFailed")));}});}downloadInstructions(){this.actionError.set(null),this.workflowsApi.getInstructions().pipe(ue(this.destroyRef)).subscribe({next:t=>{l("knoflows-workflow-agent-instructions.md",t,"text/markdown;charset=utf-8");},error:t=>{this.actionError.set(this.errorMessage(t,this.transloco.translate("workflows.list.instructionsFailed")));}});}onImportFile(t){let e=t.target,a=e.files?.[0];e.value="",!(!a||this.importing())&&this.readAndImport(a);}importJsonText(t){this.actionError.set(null);let e;try{e=JSON.parse(t);}catch(f){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));return}let a=i_.safeParse(e);if(!a.success){let f=T(a.error);this.actionError.set(`${this.transloco.translate("workflows.list.importInvalidSchema")}: ${f[0]??""}`);return}this.postImport(e);}readAndImport(t){return v(this,null,function*(){try{this.importJsonText(yield t.text());}catch(e){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));}})}postImport(t,e){this.importing.set(true),this.actionError.set(null),this.workflowsApi.importDefinition(e?{workflowDefinition:t,resolution:e}:{workflowDefinition:t}).pipe(ue(this.destroyRef)).subscribe({next:a=>{this.importing.set(false),this.router.navigate(["/workflows",a.id,"edit"]);},error:a=>{this.importing.set(false);let f=this.importConflict(a);if(f&&!e){this.openImportConflict(t,f.name);return}this.actionError.set(this.errorMessage(a,this.transloco.translate("workflows.list.importFailed")));}});}openImportConflict(t,e){(this.modal.create({nzTitle:this.transloco.translate("workflows.import.conflictTitle"),nzContent:Lt,nzData:{name:e},nzFooter:null}).afterClose??Dg(void 0)).pipe(ue(this.destroyRef)).subscribe(T=>{(T==="update"||T==="create_new")&&this.postImport(t,T);});}importConflict(t){if(!(t instanceof bi)||t.httpStatus!==409||!t.details)return null;let e=t.details.conflictingWorkflowId,a=t.details.conflictingWorkflowName;return typeof e!="string"||typeof a!="string"?null:{id:e,name:a}}load(){let t=this.subjectHandlingFilter();this.loading.set(true),this.loadError.set(null),this.workflowsApi.list(t==="all"?void 0:{subjectHandling:t}).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.workflows.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("workflows.list.loadFailed")));}});}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-list"]],decls:24,vars:18,consts:[["importFileInput",""],["data-testid","workflows-list",1,"list-page"],[1,"header"],[1,"header-actions"],["type","file","accept","application/json,.json","hidden","","data-testid","import-file",3,"change"],["nz-button","","type","button","data-testid","import-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","download-instructions",3,"click"],["nz-button","","type","button","data-testid","browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","create-workflow"],["data-testid","action-error",1,"error"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"field"],["data-testid","subject-handling-filter",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","workflow-items",3,"nzData","nzFrontPagination","nzShowPagination"],[1,"empty-actions"],["nz-button","","type","button","data-testid","empty-browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","empty-create"],[1,"description-cell"],[1,"muted"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(e,a){if(e&1){let f=FD();_i(0,"main",1)(1,"header",2)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"div",3)(6,"input",4,0),mh("change",function(U){return a.onImportFile(U)}),Jc(),_i(8,"button",5),mh("click",function(){Fu(f);let U=QD(7);return ju(U.click())}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",6),mh("click",function(){return a.downloadInstructions()}),Iw(12),Pw(13,"transloco"),Jc(),_i(14,"button",7),mh("click",function(){return a.openLibrary()}),Iw(15),Pw(16,"transloco"),Jc(),_i(17,"a",8),Iw(18),Pw(19,"transloco"),Jc()()(),_D(20,Yt,2,1,"p",9),_D(21,te,3,3,"p",10)(22,ee,2,1,"p",11)(23,de,10,6),Jc();}e&2&&(gI(3),Lh(Fw(4,8,"workflows.list.title")),gI(5),lh("disabled",a.importing()),gI(),rl$1(" ",Fw(10,10,"workflows.list.import")," "),gI(3),rl$1(" ",Fw(13,12,"workflows.list.downloadInstructions")," "),gI(3),rl$1(" ",Fw(16,14,"workflows.list.browseLibrary")," "),gI(3),rl$1(" ",Fw(19,16,"workflows.list.createButton")," "),gI(2),MD(a.actionError()?20:-1),gI(),MD(a.loading()?21:a.loadError()?22:23));},dependencies:[$8,al,rl,$i,v3,pf,bd,sp,fp,ts,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;flex-shrink:0;justify-content:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;max-width:16rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.muted[_ngcontent-%COMP%]{color:#a8a29e;font-style:italic}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.empty-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;flex-wrap:wrap;gap:.75rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] td.description-cell{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;text-overflow:unset;max-width:28rem;vertical-align:top}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return i})();export{si as WorkflowListComponent,si as WorkflowsManageComponent};
1
+ import {l}from'./chunk-D19C8Gcb.js';import {T}from'./chunk-b67RbqkY.js';import {_ as _n,C as Cn}from'./chunk-9iLiX6s9.js';import {C,V as Ve,b as at,b0 as jn,R as J1,q as qo,u as ue,aS as v,aY as Dg,c as bi,Z as ZE,d as $8,e as al,f as rl,g as $i,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,b1 as ts,h as ex,F as Fm,A as Am,K as Kt$1,G as FD,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl$1,M as MD,b2 as Le,b3 as Wn,az as jw,E as Aw,H as HD,x as xD,N as ND,k as iE,y as aE,B as AD,b4 as N2,aV as ix,b5 as cx,i as ie$1,n as uh,D as ch,aO as SD,aP as Mh,O as Fu,Q as ju,aH as QD}from'./main-CL3L2RPE.js';import {b}from'./chunk-DEGtd3B-.js';import {N as Nt,K as Ke}from'./chunk-DEfYLuNM.js';import {n as ng,i as i_}from'./chunk-Darhf4Mc.js';import {W,I}from'./chunk-ChofVXdQ.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-CID_DKHO.js';import'./chunk-CQOTdAZb.js';var Ot=i=>({name:i}),Lt=(()=>{class i{constructor(){this.modalRef=C(Le),this.data=C(Wn);}cancel(){this.modalRef.close(void 0);}choose(t){this.modalRef.close(t);}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-import-conflict"]],decls:14,vars:15,consts:[["data-testid","import-conflict-dialog"],["data-testid","import-conflict-message"],[1,"dialog-actions"],["nz-button","","type","button","data-testid","import-conflict-cancel",3,"click"],["nz-button","","type","button","data-testid","import-conflict-create-new",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","import-conflict-update",3,"click"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",2)(5,"button",3),mh("click",function(){return a.cancel()}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",4),mh("click",function(){return a.choose("create_new")}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",5),mh("click",function(){return a.choose("update")}),Iw(12),Pw(13,"transloco"),Jc()()()),e&2&&(gI(2),rl$1(" ",jw(3,4,"workflows.import.conflictBody",Aw(13,Ot,a.data.name))," "),gI(4),rl$1(" ",Fw(7,7,"common.cancel")," "),gI(3),rl$1(" ",Fw(10,9,"workflows.import.createNew")," "),gI(3),rl$1(" ",Fw(13,11,"workflows.import.update")," "));},dependencies:[pf,bd,sp,fp,Kt$1],styles:["p[_ngcontent-%COMP%]{margin:0 0 1.25rem;color:#44403c}.dialog-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem}"]});}}return i})();var Pt=(()=>{class i{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/workflow-library`;}list(){return this.http.get(this.baseUrl).pipe(cx())}add(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/add`,{}).pipe(cx())}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275prov=ie$1({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();var At=(i,d)=>d.id;function Vt(i,d){i&1&&(_i(0,"p",2),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Rt(i,d){if(i&1&&(_i(0,"p",3),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function Ht(i,d){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.addError());}}function Kt(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD(3);gI(),Lh(Fw(2,1,e.subjectTypeKey(t)));}}function Ut(i,d){if(i&1&&(_i(0,"li")(1,"span"),Iw(2),Jc(),_i(3,"span",14),Iw(4),Pw(5,"transloco"),Jc()()),i&2){let t=d.$implicit,e=HD(4);Mh("margin-left",t.depth,"rem"),gI(2),Lh(t.name),gI(2),Lh(Fw(5,4,e.stepTypeKey(t.type)));}}function Jt(i,d){if(i&1&&(_i(0,"ol",12),xD(1,Ut,6,6,"li",13,SD),Jc()),i&2){let t=HD().$implicit,e=HD(2);ch("data-testid","library-steps-"+t.id),gI(),AD(e.previewSteps(t));}}function Zt(i,d){if(i&1){let t=FD();_i(0,"nz-card")(1,"div",6)(2,"h2"),Iw(3),Jc(),_i(4,"nz-tag"),Iw(5),Pw(6,"transloco"),Jc()(),_i(7,"p",7),Iw(8),Jc(),_i(9,"div",8),xD(10,Kt,3,3,"nz-tag",null,ND),Jc(),_i(12,"div",9)(13,"button",10),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.togglePreview(a.id))}),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"button",11),mh("click",function(){let a=Fu(t).$implicit,f=HD(2);return ju(f.addToMyWorkflows(a.id))}),Iw(17),Pw(18,"transloco"),Jc()(),_D(19,Jt,3,1,"ol",12),Jc();}if(i&2){let t=d.$implicit,e=HD(2);ch("data-testid","library-entry-"+t.id),gI(2),ch("data-testid","library-name-"+t.id),gI(),Lh(t.name),gI(),ch("data-testid","library-source-"+t.id),gI(),Lh(Fw(6,13,e.sourceKey(t.source))),gI(2),ch("data-testid","library-description-"+t.id),gI(),rl$1(" ",t.description," "),gI(2),AD(e.appliesToValues(t)),gI(3),ch("data-testid","library-preview-"+t.id),gI(),rl$1(" ",Fw(15,15,e.isExpanded(t.id)?"workflow-library.hideSteps":"workflow-library.previewSteps")," "),gI(2),lh("disabled",e.addingId()!==null),ch("data-testid","library-add-"+t.id),gI(),rl$1(" ",Fw(18,17,e.addingId()===t.id?"workflow-library.adding":"workflow-library.add")," "),gI(2),MD(e.isExpanded(t.id)?19:-1);}}function qt(i,d){if(i&1&&(_D(0,Ht,2,1,"p",4),_i(1,"div",5),xD(2,Zt,20,19,"nz-card",null,At),Jc()),i&2){let t=HD();MD(t.addError()?0:-1),gI(2),AD(t.entries());}}var jt=(()=>{class i{constructor(){this.libraryApi=C(Pt),this.router=C(J1),this.transloco=C(Ve),this.destroyRef=C(at),this.modalRef=C(Le,{optional:true}),this.entries=qo([]),this.loading=qo(true),this.loadError=qo(null),this.addError=qo(null),this.addingId=qo(null),this.expandedIds=qo(new Set),this.libraryApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.entries.set(t),this.loading.set(false);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("workflow-library.loadFailed")));}});}sourceKey(t){return `workflow-library.source.${t}`}appliesToValues(t){let e=t.workflowDefinition.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}stepTypeKey(t){return `step-list.stepType.${t}`}isExpanded(t){return this.expandedIds().has(t)}togglePreview(t){this.expandedIds.update(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a});}previewSteps(t){return Dt(t.workflowDefinition.steps,0)}addToMyWorkflows(t){this.addingId()||(this.addError.set(null),this.addingId.set(t),this.libraryApi.add(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.addingId.set(null),this.modalRef?.close(),this.router.navigate(["/workflows",e.id,"edit"]);},error:e=>{this.addingId.set(null),this.addError.set(this.errorMessage(e,this.transloco.translate("workflow-library.addFailed")));}}));}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-library-browser"]],decls:7,vars:4,consts:[["data-testid","workflow-library-browser",1,"library"],[1,"lede"],["data-testid","library-loading"],["data-testid","library-load-error",1,"error"],["data-testid","library-add-error",1,"error"],[1,"cards"],[1,"card-head"],[1,"description"],[1,"applies-to"],[1,"card-actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","primary","type","button",3,"click","disabled"],[1,"steps-preview"],[3,"margin-left"],[1,"step-type"]],template:function(e,a){e&1&&(_i(0,"div",0)(1,"p",1),Iw(2),Pw(3,"transloco"),Jc(),_D(4,Vt,3,3,"p",2)(5,Rt,2,1,"p",3)(6,qt,4,1),Jc()),e&2&&(gI(2),Lh(Fw(3,2,"workflow-library.lede")),gI(2),MD(a.loading()?4:a.loadError()?5:6));},dependencies:[$8,pf,bd,sp,fp,Nt,Ke,W,I,Kt$1],styles:[".library[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.lede[_ngcontent-%COMP%]{margin:0;color:#57534e}.cards[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.card-head[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem}.card-head[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.05rem;font-weight:600}.description[_ngcontent-%COMP%]{margin:.5rem 0 0;color:#57534e}.applies-to[_ngcontent-%COMP%]{margin-top:.5rem}.card-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.5rem}.steps-preview[_ngcontent-%COMP%]{margin:.75rem 0 0;padding-left:1.25rem;color:#44403c}.steps-preview[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;margin:.25rem 0}.step-type[_ngcontent-%COMP%]{color:#78716c;font-size:.85rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();function Dt(i,d){let t=[];for(let e of i)t.push({name:e.name,type:e.type,depth:d}),e.type==="loop"&&Array.isArray(e.steps)&&t.push(...Dt(e.steps,d+1));return t}var Gt=i=>({count:i}),Qt=i=>["/workflows",i,"edit"],Xt=(i,d)=>d.id;function Yt(i,d){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.actionError());}}function te(i,d){i&1&&(_i(0,"p",10),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function ee(i,d){if(i&1&&(_i(0,"p",11),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function ie(i,d){if(i&1&&(uh(0,"nz-option",14),Pw(1,"transloco")),i&2){let t=d.$implicit,e=HD(2);lh("nzValue",t)("nzLabel",Fw(1,2,e.subjectHandlingFilterKey(t)));}}function ne(i,d){if(i&1&&(_i(0,"p",15),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.deleteError());}}function oe(i,d){if(i&1){let t=FD();_i(0,"section",16)(1,"p"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"div",18)(5,"button",19),mh("click",function(){Fu(t);let a=HD(2);return ju(a.openLibrary())}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"a",20),Iw(9),Pw(10,"transloco"),Jc()()();}i&2&&(gI(2),Lh(Fw(3,3,"workflows.list.emptyState")),gI(4),rl$1(" ",Fw(7,5,"workflows.list.emptyBrowseLibrary")," "),gI(3),rl$1(" ",Fw(10,7,"workflows.list.emptyCreateButton")," "));}function re(i,d){if(i&1&&(_i(0,"span"),Iw(1),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(t.description);}}function ae(i,d){if(i&1&&(_i(0,"span",22),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=HD().$implicit;ch("data-testid","description-"+t.id),gI(),Lh(Fw(2,2,"workflows.list.noDescription"));}}function le(i,d){if(i&1&&(_i(0,"nz-tag"),Iw(1),Pw(2,"transloco"),Jc()),i&2){let t=d.$implicit,e=HD().$implicit,a=HD(3);ch("data-testid","applies-to-"+e.id),gI(),Lh(Fw(2,2,a.subjectTypeKey(t)));}}function se(i,d){if(i&1){let t=FD();_i(0,"tr")(1,"td")(2,"span"),Iw(3),Jc()(),_i(4,"td",21),_D(5,re,2,2,"span")(6,ae,3,4,"span",22),Jc(),_i(7,"td"),xD(8,le,3,4,"nz-tag",null,ND),Jc(),_i(10,"td")(11,"nz-tag"),Iw(12),Pw(13,"transloco"),Jc()(),_i(14,"td")(15,"span"),Iw(16),Pw(17,"transloco"),Jc()(),_i(18,"td",23)(19,"a",24),Iw(20),Pw(21,"transloco"),Jc(),_i(22,"button",25),mh("click",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.exportWorkflow(a))}),Iw(23),Pw(24,"transloco"),Jc(),_i(25,"button",26),Pw(26,"transloco"),Pw(27,"transloco"),Pw(28,"transloco"),mh("nzOnConfirm",function(){let a=Fu(t).$implicit,f=HD(3);return ju(f.deleteWorkflow(a.id))}),Iw(29),Pw(30,"transloco"),Jc()()();}if(i&2){let t=d.$implicit,e=HD(3);ch("data-testid","workflow-"+t.id),gI(2),ch("data-testid","name-"+t.id),gI(),Lh(t.name),gI(2),MD(t.description?.trim()?5:6),gI(3),AD(e.appliesToValues(t)),gI(3),ch("data-testid","subject-handling-"+t.id),gI(),Lh(Fw(13,18,e.subjectHandlingKey(t.subjectHandling))),gI(3),ch("data-testid","step-count-"+t.id),gI(),Lh(jw(17,20,"workflows.list.stepCount",Aw(35,Gt,t.steps.length))),gI(3),lh("routerLink",Aw(37,Qt,t.id)),ch("data-testid","edit-"+t.id),gI(),rl$1(" ",Fw(21,23,"workflows.list.edit")," "),gI(2),ch("data-testid","export-"+t.id),gI(),rl$1(" ",Fw(24,25,"workflows.list.export")," "),gI(2),lh("nzPopconfirmTitle",Fw(26,27,"workflows.list.deleteConfirm"))("nzOkText",Fw(27,29,"workflows.list.delete"))("nzCancelText",Fw(28,31,"common.cancel")),ch("data-testid","delete-"+t.id),gI(4),rl$1(" ",Fw(30,33,"workflows.list.delete")," ");}}function pe(i,d){if(i&1&&(_i(0,"nz-table",17)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc(),_i(18,"th"),Iw(19),Pw(20,"transloco"),Jc()()(),_i(21,"tbody"),xD(22,se,31,39,"tr",null,Xt),Jc()()),i&2){let t=HD(2);lh("nzData",t.workflows())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,9,"workflows.list.column.name")),gI(3),Lh(Fw(8,11,"workflows.list.column.description")),gI(3),Lh(Fw(11,13,"workflow-editor.appliesTo")),gI(3),Lh(Fw(14,15,"workflow-editor.subjectHandling.label")),gI(3),Lh(Fw(17,17,"workflows.list.column.steps")),gI(3),Lh(Fw(20,19,"workflows.list.column.actions")),gI(3),AD(t.workflows());}}function de(i,d){if(i&1){let t=FD();_i(0,"div",12)(1,"span"),Iw(2),Pw(3,"transloco"),Jc(),_i(4,"nz-select",13),mh("ngModelChange",function(a){Fu(t);let f=HD();return ju(f.setSubjectHandlingFilter(a))}),xD(5,ie,2,4,"nz-option",14,ND),Jc(),iE(),Jc(),_D(7,ne,2,1,"p",15),_D(8,oe,11,9,"section",16)(9,pe,24,21,"nz-table",17);}if(i&2){let t=HD();gI(2),Lh(Fw(3,4,"workflows.list.filterBySubjectHandling")),gI(2),lh("ngModel",t.subjectHandlingFilter()),aE(),gI(),AD(t.subjectHandlingOptions),gI(2),MD(t.deleteError()?7:-1),gI(),MD(t.workflows().length===0?8:9);}}var si=(()=>{class i{constructor(){this.workflowsApi=C(b),this.transloco=C(Ve),this.destroyRef=C(at),this.modal=C(jn),this.router=C(J1),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.actionError=qo(null),this.importing=qo(false),this.subjectHandlingFilter=qo("all"),this.subjectHandlingOptions=["all","per-subject","collection"],this.load();}setSubjectHandlingFilter(t){this.subjectHandlingFilter.set(t),this.load();}appliesToValues(t){let e=t.appliesTo;return e==="none"?["none"]:Array.isArray(e)?e:[e]}subjectTypeKey(t){return `workflow-editor.subjectType.${t}`}subjectHandlingKey(t){return `workflow-editor.subjectHandling.${t}`}subjectHandlingFilterKey(t){return t==="all"?"workflows.list.filterAll":`workflow-editor.subjectHandling.${t}`}deleteWorkflow(t){this.deleteError.set(null),this.workflowsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.workflows.update(e=>e.filter(a=>a.id!==t));},error:e=>{this.deleteError.set(this.errorMessage(e,this.transloco.translate("workflows.list.deleteFailed")));}});}openLibrary(){this.modal.create({nzTitle:this.transloco.translate("workflow-library.title"),nzContent:jt,nzFooter:null,nzWidth:720});}exportWorkflow(t){this.actionError.set(null),this.workflowsApi.exportDefinition(t.id).pipe(ue(this.destroyRef)).subscribe({next:e=>{l(`${ng(e.name)}.json`,JSON.stringify(e,null,2),"application/json");},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("workflows.list.exportFailed")));}});}downloadInstructions(){this.actionError.set(null),this.workflowsApi.getInstructions().pipe(ue(this.destroyRef)).subscribe({next:t=>{l("knoflows-workflow-agent-instructions.md",t,"text/markdown;charset=utf-8");},error:t=>{this.actionError.set(this.errorMessage(t,this.transloco.translate("workflows.list.instructionsFailed")));}});}onImportFile(t){let e=t.target,a=e.files?.[0];e.value="",!(!a||this.importing())&&this.readAndImport(a);}importJsonText(t){this.actionError.set(null);let e;try{e=JSON.parse(t);}catch(f){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));return}let a=i_.safeParse(e);if(!a.success){let f=T(a.error);this.actionError.set(`${this.transloco.translate("workflows.list.importInvalidSchema")}: ${f[0]??""}`);return}this.postImport(e);}readAndImport(t){return v(this,null,function*(){try{this.importJsonText(yield t.text());}catch(e){this.actionError.set(this.transloco.translate("workflows.list.importInvalidJson"));}})}postImport(t,e){this.importing.set(true),this.actionError.set(null),this.workflowsApi.importDefinition(e?{workflowDefinition:t,resolution:e}:{workflowDefinition:t}).pipe(ue(this.destroyRef)).subscribe({next:a=>{this.importing.set(false),this.router.navigate(["/workflows",a.id,"edit"]);},error:a=>{this.importing.set(false);let f=this.importConflict(a);if(f&&!e){this.openImportConflict(t,f.name);return}this.actionError.set(this.errorMessage(a,this.transloco.translate("workflows.list.importFailed")));}});}openImportConflict(t,e){(this.modal.create({nzTitle:this.transloco.translate("workflows.import.conflictTitle"),nzContent:Lt,nzData:{name:e},nzFooter:null}).afterClose??Dg(void 0)).pipe(ue(this.destroyRef)).subscribe(T=>{(T==="update"||T==="create_new")&&this.postImport(t,T);});}importConflict(t){if(!(t instanceof bi)||t.httpStatus!==409||!t.details)return null;let e=t.details.conflictingWorkflowId,a=t.details.conflictingWorkflowName;return typeof e!="string"||typeof a!="string"?null:{id:e,name:a}}load(){let t=this.subjectHandlingFilter();this.loading.set(true),this.loadError.set(null),this.workflowsApi.list(t==="all"?void 0:{subjectHandling:t}).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.workflows.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("workflows.list.loadFailed")));}});}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-workflow-list"]],decls:24,vars:18,consts:[["importFileInput",""],["data-testid","workflows-list",1,"list-page"],[1,"header"],[1,"header-actions"],["type","file","accept","application/json,.json","hidden","","data-testid","import-file",3,"change"],["nz-button","","type","button","data-testid","import-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","download-instructions",3,"click"],["nz-button","","type","button","data-testid","browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","create-workflow"],["data-testid","action-error",1,"error"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"field"],["data-testid","subject-handling-filter",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","workflow-items",3,"nzData","nzFrontPagination","nzShowPagination"],[1,"empty-actions"],["nz-button","","type","button","data-testid","empty-browse-library",3,"click"],["nz-button","","nzType","primary","routerLink","/workflows/new","data-testid","empty-create"],[1,"description-cell"],[1,"muted"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(e,a){if(e&1){let f=FD();_i(0,"main",1)(1,"header",2)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"div",3)(6,"input",4,0),mh("change",function(U){return a.onImportFile(U)}),Jc(),_i(8,"button",5),mh("click",function(){Fu(f);let U=QD(7);return ju(U.click())}),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"button",6),mh("click",function(){return a.downloadInstructions()}),Iw(12),Pw(13,"transloco"),Jc(),_i(14,"button",7),mh("click",function(){return a.openLibrary()}),Iw(15),Pw(16,"transloco"),Jc(),_i(17,"a",8),Iw(18),Pw(19,"transloco"),Jc()()(),_D(20,Yt,2,1,"p",9),_D(21,te,3,3,"p",10)(22,ee,2,1,"p",11)(23,de,10,6),Jc();}e&2&&(gI(3),Lh(Fw(4,8,"workflows.list.title")),gI(5),lh("disabled",a.importing()),gI(),rl$1(" ",Fw(10,10,"workflows.list.import")," "),gI(3),rl$1(" ",Fw(13,12,"workflows.list.downloadInstructions")," "),gI(3),rl$1(" ",Fw(16,14,"workflows.list.browseLibrary")," "),gI(3),rl$1(" ",Fw(19,16,"workflows.list.createButton")," "),gI(2),MD(a.actionError()?20:-1),gI(),MD(a.loading()?21:a.loadError()?22:23));},dependencies:[$8,al,rl,$i,v3,pf,bd,sp,fp,ts,_n,Cn,ex,Fm,Am,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;flex-shrink:0;justify-content:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;max-width:16rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.muted[_ngcontent-%COMP%]{color:#a8a29e;font-style:italic}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.empty-actions[_ngcontent-%COMP%]{display:flex;justify-content:center;flex-wrap:wrap;gap:.75rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] td.description-cell{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;text-overflow:unset;max-width:28rem;vertical-align:top}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return i})();export{si as WorkflowListComponent,si as WorkflowsManageComponent};
@@ -1 +1 @@
1
- import {H as H$,Y as Y$}from'./chunk-C2BVYtVN.js';import {s,r as r$1,t as t$1}from'./main-CHQMTVIP.js';var y=["agent","interaction","shell","extract","git","provider_action","sub_workflow","loop"];function I(){return {name:"",appliesTo:"none",subjectHandling:"per-subject",inputSchema:[],steps:[],notificationPolicy:{triggers:[]}}}function d(){return crypto.randomUUID()}function _(t,e){return t.map(n=>{let r=s(r$1({},n),{_key:d(),_idAutoSync:e.idAutoSync});return n.type==="loop"?s(r$1({},r),{steps:_(n.steps,e)}):r})}function h(t,e){let n=e?.id??"",r=e?.name??"",i={_key:e?.key??d(),_idAutoSync:e?.idAutoSync??true};switch(t){case "agent":return r$1({type:t,id:n,name:r,objective:"",outputFormat:"free_text"},i);case "interaction":return r$1({type:t,id:n,name:r,interaction:"questionnaire"},i);case "shell":return r$1({type:t,id:n,name:r,command:""},i);case "extract":return r$1({type:t,id:n,name:r,source:"",onNoMatch:"fail"},i);case "git":return r$1({type:t,id:n,name:r,operation:"create_worktree",params:{}},i);case "provider_action":return r$1({type:t,id:n,name:r,action:"get_subject",params:{}},i);case "sub_workflow":return r$1({type:t,id:n,name:r,workflowId:"",forEach:"selection"},i);case "loop":return r$1({type:t,id:n,name:r,steps:[],until:{type:"field_empty",stepId:"",field:""},maxIterations:3,onMaxIterations:{action:"fail"}},i)}}function b(){return {name:"",label:"",type:"string",required:false}}function A(t){return t?Object.entries(t).map(([e,n])=>({key:e,value:n==null?"":String(n)})):[]}function j(t){let e={};for(let n of t){let r=n.key.trim();r&&(e[r]=n.value);}return e}function T(t){return t.issues.map(e=>`${e.path.length>0?e.path.map(String).join("."):"(root)"}: ${e.message}`)}function m(t){let i=t,{_key:e,_idAutoSync:n}=i,r=t$1(i,["_key","_idAutoSync"]);return r.type==="loop"?s(r$1({},r),{steps:r.steps.map(a=>m(a))}):r}function v(t,e={}){let n=t.steps.map(x=>{let u=m(x);if(!u.id){let p=u,{id:g}=p;return t$1(p,["id"])}return u}),a=t,{id:r}=a,i=t$1(a,["id"]);return e.omitWorkflowId||!r?s(r$1({},i),{steps:n}):s(r$1({},i),{id:r,steps:n})}function E(t,e,n){if(!t._idAutoSync)return s(r$1({},t),{name:e});let r=H$(n);t.id&&r.delete(t.id);let i=e.trim().length>0?Y$(e,r):"";return s(r$1({},t),{name:e,id:i})}function P(t,e){return s(r$1({},t),{id:e,_idAutoSync:false})}export{A,E,I,P,T,_,b,h,j,v,y};
1
+ import {H as H$,Y as Y$}from'./chunk-Darhf4Mc.js';import {s,r as r$1,t as t$1}from'./main-CL3L2RPE.js';var y=["agent","interaction","shell","extract","git","provider_action","sub_workflow","loop"];function I(){return {name:"",appliesTo:"none",subjectHandling:"per-subject",inputSchema:[],steps:[],notificationPolicy:{triggers:[]}}}function d(){return crypto.randomUUID()}function _(t,e){return t.map(n=>{let r=s(r$1({},n),{_key:d(),_idAutoSync:e.idAutoSync});return n.type==="loop"?s(r$1({},r),{steps:_(n.steps,e)}):r})}function h(t,e){let n=e?.id??"",r=e?.name??"",i={_key:e?.key??d(),_idAutoSync:e?.idAutoSync??true};switch(t){case "agent":return r$1({type:t,id:n,name:r,objective:"",outputFormat:"free_text"},i);case "interaction":return r$1({type:t,id:n,name:r,interaction:"questionnaire"},i);case "shell":return r$1({type:t,id:n,name:r,command:""},i);case "extract":return r$1({type:t,id:n,name:r,source:"",onNoMatch:"fail"},i);case "git":return r$1({type:t,id:n,name:r,operation:"create_worktree",params:{}},i);case "provider_action":return r$1({type:t,id:n,name:r,action:"get_subject",params:{}},i);case "sub_workflow":return r$1({type:t,id:n,name:r,workflowId:"",forEach:"selection"},i);case "loop":return r$1({type:t,id:n,name:r,steps:[],until:{type:"field_empty",stepId:"",field:""},maxIterations:3,onMaxIterations:{action:"fail"}},i)}}function b(){return {name:"",label:"",type:"string",required:false}}function A(t){return t?Object.entries(t).map(([e,n])=>({key:e,value:n==null?"":String(n)})):[]}function j(t){let e={};for(let n of t){let r=n.key.trim();r&&(e[r]=n.value);}return e}function T(t){return t.issues.map(e=>`${e.path.length>0?e.path.map(String).join("."):"(root)"}: ${e.message}`)}function m(t){let i=t,{_key:e,_idAutoSync:n}=i,r=t$1(i,["_key","_idAutoSync"]);return r.type==="loop"?s(r$1({},r),{steps:r.steps.map(a=>m(a))}):r}function v(t,e={}){let n=t.steps.map(x=>{let u=m(x);if(!u.id){let p=u,{id:g}=p;return t$1(p,["id"])}return u}),a=t,{id:r}=a,i=t$1(a,["id"]);return e.omitWorkflowId||!r?s(r$1({},i),{steps:n}):s(r$1({},i),{id:r,steps:n})}function E(t,e,n){if(!t._idAutoSync)return s(r$1({},t),{name:e});let r=H$(n);t.id&&r.delete(t.id);let i=e.trim().length>0?Y$(e,r):"";return s(r$1({},t),{name:e,id:i})}function P(t,e){return s(r$1({},t),{id:e,_idAutoSync:false})}export{A,E,I,P,T,_,b,h,j,v,y};
@@ -1 +1 @@
1
- import {o as ot}from'./chunk-C0HCwfa5.js';import {_ as _n,C as Cn}from'./chunk-NZ-CPWJ2.js';import {f}from'./chunk-z2vvQAle.js';import {Z as ZE,n as uh,C,V as Ve,b as at,q as qo,r as r$1,u as ue$1,c as bi,d as $8,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,z as rl$1,M as MD,H as HD,G as FD,k as iE,w as lh,y as aE,x as xD,B as AD,D as ch,O as Fu,Q as ju}from'./main-CHQMTVIP.js';import {a as ai,z}from'./chunk-B2Xol2Un.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';var ce=(i,h)=>h.id;function de(i,h){i&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function me(i,h){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let e=HD();gI(),Lh(e.loadError());}}function fe(i,h){if(i&1&&(_i(0,"p",5),Iw(1),Jc()),i&2){let e=HD(2);gI(),Lh(e.deleteError());}}function he(i,h){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let e=HD(3);gI(),Lh(e.saveError());}}function ue(i,h){if(i&1){let e=FD();_i(0,"section",6),_D(1,he,2,1,"p",9),_i(2,"label",10)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"input",11),mh("ngModelChange",function(l){Fu(e);let d=HD(2);return ju(d.formName.set(l))}),Jc(),iE(),Jc(),_i(7,"div",10)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"app-path-picker",12),mh("pathChange",function(l){Fu(e);let d=HD(2);return ju(d.formLocalPath.set(l))}),Jc()(),_i(12,"div",10)(13,"span"),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"p",13),Iw(17),Pw(18,"transloco"),Jc(),_i(19,"app-path-picker",12),mh("pathChange",function(l){Fu(e);let d=HD(2);return ju(d.formWorktreeBasePath.set(l))}),Jc()(),_i(20,"label",10)(21,"span"),Iw(22),Pw(23,"transloco"),Jc(),_i(24,"input",14),mh("ngModelChange",function(l){Fu(e);let d=HD(2);return ju(d.formDefaultBranch.set(l))}),Jc(),iE(),Jc(),_i(25,"div",15)(26,"button",16),mh("click",function(){Fu(e);let l=HD(2);return ju(l.submitForm())}),Iw(27),Pw(28,"transloco"),Jc(),_i(29,"button",17),mh("click",function(){Fu(e);let l=HD(2);return ju(l.cancelForm())}),Iw(30),Pw(31,"transloco"),Jc()()();}if(i&2){let e=HD(2);gI(),MD(e.saveError()?1:-1),gI(3),Lh(Fw(5,13,"local-repos.form.name")),gI(2),lh("ngModel",e.formName()),aE(),gI(3),Lh(Fw(10,15,"local-repos.form.localPath")),gI(2),lh("path",e.formLocalPath()),gI(3),Lh(Fw(15,17,"local-repos.form.worktreeBasePath")),gI(3),Lh(Fw(18,19,"local-repos.form.worktreeBaseHint")),gI(2),lh("path",e.formWorktreeBasePath()),gI(3),Lh(Fw(23,21,"local-repos.form.defaultBranch")),gI(2),lh("ngModel",e.formDefaultBranch()),aE(),gI(2),lh("disabled",e.saving()),gI(),rl$1(" ",Fw(28,23,"common.save")," "),gI(3),rl$1(" ",Fw(31,25,"common.cancel")," ");}}function _e(i,h){i&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"local-repos.emptyState")));}function Ce(i,h){if(i&1){let e=FD();_i(0,"tr")(1,"td"),Iw(2),Jc(),_i(3,"td",18),Iw(4),Jc(),_i(5,"td",18),Iw(6),Jc(),_i(7,"td"),Iw(8),Jc(),_i(9,"td",19)(10,"button",20),mh("click",function(){let l=Fu(e).$implicit,d=HD(3);return ju(d.openEditForm(l))}),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"button",21),Pw(14,"transloco"),mh("nzOnConfirm",function(){let l=Fu(e).$implicit,d=HD(3);return ju(d.deleteRepo(l))}),Iw(15),Pw(16,"transloco"),Jc()()();}if(i&2){let e=h.$implicit;ch("data-testid","local-repo-row-"+e.id),gI(2),Lh(e.name),gI(2),Lh(e.localPath),gI(2),Lh(e.worktreeBasePath||"\u2014"),gI(2),Lh(e.defaultBranch||"\u2014"),gI(2),ch("data-testid","edit-local-repo-"+e.id),gI(),rl$1(" ",Fw(12,10,"local-repos.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(14,12,"local-repos.deleteConfirm")),ch("data-testid","delete-local-repo-"+e.id),gI(2),rl$1(" ",Fw(16,14,"local-repos.delete")," ");}}function ge(i,h){if(i&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc()()(),_i(18,"tbody"),xD(19,Ce,17,16,"tr",null,ce),Jc()()),i&2){let e=HD(2);lh("nzData",e.repos())("nzShowPagination",false),gI(4),Lh(Fw(5,7,"local-repos.column.name")),gI(3),Lh(Fw(8,9,"local-repos.column.localPath")),gI(3),Lh(Fw(11,11,"local-repos.column.worktreeBasePath")),gI(3),Lh(Fw(14,13,"local-repos.column.defaultBranch")),gI(3),Lh(Fw(17,15,"local-repos.column.actions")),gI(3),AD(e.repos());}}function xe(i,h){if(i&1&&(_D(0,fe,2,1,"p",5),_D(1,ue,32,27,"section",6),_D(2,_e,3,3,"p",7)(3,ge,21,17,"nz-table",8)),i&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.formOpen()?1:-1),gI(),MD(e.repos().length===0&&!e.formOpen()?2:e.repos().length>0?3:-1);}}var ae=(()=>{class i{constructor(){this.reposApi=C(f),this.transloco=C(Ve),this.destroyRef=C(at),this.repos=qo([]),this.loading=qo(true),this.loadError=qo(null),this.saveError=qo(null),this.deleteError=qo(null),this.saving=qo(false),this.formOpen=qo(false),this.editingId=qo(null),this.formName=qo(""),this.formLocalPath=qo(""),this.formWorktreeBasePath=qo(""),this.formDefaultBranch=qo(""),this.reload();}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formLocalPath.set(e.localPath),this.formWorktreeBasePath.set(e.worktreeBasePath??""),this.formDefaultBranch.set(e.defaultBranch??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r$1(r$1({name:this.formName().trim(),localPath:this.formLocalPath().trim()},this.formWorktreeBasePath().trim()?{worktreeBasePath:this.formWorktreeBasePath().trim()}:{worktreeBasePath:void 0}),this.formDefaultBranch().trim()?{defaultBranch:this.formDefaultBranch().trim()}:{defaultBranch:void 0}),a=this.editingId();(a?this.reposApi.update(a,e):this.reposApi.create(e)).pipe(ue$1(this.destroyRef)).subscribe({next:d=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.repos.update(le=>[...le.filter(M=>M.id!==d.id),d].sort((M,se)=>M.name.localeCompare(se.name))),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.set("");},error:d=>{this.saving.set(false),this.saveError.set(this.errorMessage(d,this.transloco.translate("local-repos.saveFailed")));}});}deleteRepo(e){this.deleteError.set(null),this.reposApi.delete(e.id).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.repos.update(a=>a.filter(l=>l.id!==e.id));},error:a=>{this.deleteError.set(this.errorMessage(a,this.transloco.translate("local-repos.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.reposApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>{this.repos.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("local-repos.loadFailed")));}});}errorMessage(e,a){return e instanceof bi||e instanceof Error?e.message:a}static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-local-repository-list"]],decls:11,vars:7,consts:[["data-testid","local-repos-manage",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","type","button","data-testid","create-local-repo",3,"click"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","local-repo-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","local-repo-table",3,"nzData","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","local-repo-name",3,"ngModelChange","ngModel"],["mode","directories",3,"pathChange","path"],[1,"hint"],["nz-input","","data-testid","local-repo-default-branch",3,"ngModelChange","ngModel"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","save-local-repo",3,"click","disabled"],["nz-button","","type","button","data-testid","cancel-local-repo",3,"click"],[1,"path-cell"],[1,"actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle"]],template:function(a,l){a&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"button",2),mh("click",function(){return l.openCreateForm()}),Iw(6),Pw(7,"transloco"),Jc()(),_D(8,de,3,3,"p",3)(9,me,2,1,"p",4)(10,xe,4,3),Jc()),a&2&&(gI(3),Lh(Fw(4,3,"local-repos.title")),gI(3),rl$1(" ",Fw(7,5,"local-repos.create")," "),gI(2),MD(l.loading()?8:l.loadError()?9:10));},dependencies:[$8,al,er,rl,$i,pf,bd,sp,fp,ai,z,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return i})();var qe=(()=>{class i{static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-local-repositories-manage"]],decls:1,vars:0,template:function(a,l){a&1&&uh(0,"app-local-repository-list");},dependencies:[ae],encapsulation:2});}}return i})();export{qe as LocalRepositoriesManageComponent};
1
+ import {o as ot}from'./chunk-C73FUXq8.js';import {_ as _n,C as Cn}from'./chunk-9iLiX6s9.js';import {f}from'./chunk-DPfPY82u.js';import {Z as ZE,n as uh,C,V as Ve,b as at,q as qo,r as r$1,u as ue$1,c as bi,d as $8,e as al,bb as er,f as rl,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,z as rl$1,M as MD,H as HD,G as FD,k as iE,w as lh,y as aE,x as xD,B as AD,D as ch,O as Fu,Q as ju}from'./main-CL3L2RPE.js';import {a as ai,z}from'./chunk-BDJQdoLK.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-CID_DKHO.js';import'./chunk-CQOTdAZb.js';var ce=(i,h)=>h.id;function de(i,h){i&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function me(i,h){if(i&1&&(_i(0,"p",4),Iw(1),Jc()),i&2){let e=HD();gI(),Lh(e.loadError());}}function fe(i,h){if(i&1&&(_i(0,"p",5),Iw(1),Jc()),i&2){let e=HD(2);gI(),Lh(e.deleteError());}}function he(i,h){if(i&1&&(_i(0,"p",9),Iw(1),Jc()),i&2){let e=HD(3);gI(),Lh(e.saveError());}}function ue(i,h){if(i&1){let e=FD();_i(0,"section",6),_D(1,he,2,1,"p",9),_i(2,"label",10)(3,"span"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"input",11),mh("ngModelChange",function(l){Fu(e);let d=HD(2);return ju(d.formName.set(l))}),Jc(),iE(),Jc(),_i(7,"div",10)(8,"span"),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"app-path-picker",12),mh("pathChange",function(l){Fu(e);let d=HD(2);return ju(d.formLocalPath.set(l))}),Jc()(),_i(12,"div",10)(13,"span"),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"p",13),Iw(17),Pw(18,"transloco"),Jc(),_i(19,"app-path-picker",12),mh("pathChange",function(l){Fu(e);let d=HD(2);return ju(d.formWorktreeBasePath.set(l))}),Jc()(),_i(20,"label",10)(21,"span"),Iw(22),Pw(23,"transloco"),Jc(),_i(24,"input",14),mh("ngModelChange",function(l){Fu(e);let d=HD(2);return ju(d.formDefaultBranch.set(l))}),Jc(),iE(),Jc(),_i(25,"div",15)(26,"button",16),mh("click",function(){Fu(e);let l=HD(2);return ju(l.submitForm())}),Iw(27),Pw(28,"transloco"),Jc(),_i(29,"button",17),mh("click",function(){Fu(e);let l=HD(2);return ju(l.cancelForm())}),Iw(30),Pw(31,"transloco"),Jc()()();}if(i&2){let e=HD(2);gI(),MD(e.saveError()?1:-1),gI(3),Lh(Fw(5,13,"local-repos.form.name")),gI(2),lh("ngModel",e.formName()),aE(),gI(3),Lh(Fw(10,15,"local-repos.form.localPath")),gI(2),lh("path",e.formLocalPath()),gI(3),Lh(Fw(15,17,"local-repos.form.worktreeBasePath")),gI(3),Lh(Fw(18,19,"local-repos.form.worktreeBaseHint")),gI(2),lh("path",e.formWorktreeBasePath()),gI(3),Lh(Fw(23,21,"local-repos.form.defaultBranch")),gI(2),lh("ngModel",e.formDefaultBranch()),aE(),gI(2),lh("disabled",e.saving()),gI(),rl$1(" ",Fw(28,23,"common.save")," "),gI(3),rl$1(" ",Fw(31,25,"common.cancel")," ");}}function _e(i,h){i&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"local-repos.emptyState")));}function Ce(i,h){if(i&1){let e=FD();_i(0,"tr")(1,"td"),Iw(2),Jc(),_i(3,"td",18),Iw(4),Jc(),_i(5,"td",18),Iw(6),Jc(),_i(7,"td"),Iw(8),Jc(),_i(9,"td",19)(10,"button",20),mh("click",function(){let l=Fu(e).$implicit,d=HD(3);return ju(d.openEditForm(l))}),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"button",21),Pw(14,"transloco"),mh("nzOnConfirm",function(){let l=Fu(e).$implicit,d=HD(3);return ju(d.deleteRepo(l))}),Iw(15),Pw(16,"transloco"),Jc()()();}if(i&2){let e=h.$implicit;ch("data-testid","local-repo-row-"+e.id),gI(2),Lh(e.name),gI(2),Lh(e.localPath),gI(2),Lh(e.worktreeBasePath||"\u2014"),gI(2),Lh(e.defaultBranch||"\u2014"),gI(2),ch("data-testid","edit-local-repo-"+e.id),gI(),rl$1(" ",Fw(12,10,"local-repos.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(14,12,"local-repos.deleteConfirm")),ch("data-testid","delete-local-repo-"+e.id),gI(2),rl$1(" ",Fw(16,14,"local-repos.delete")," ");}}function ge(i,h){if(i&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc(),_i(15,"th"),Iw(16),Pw(17,"transloco"),Jc()()(),_i(18,"tbody"),xD(19,Ce,17,16,"tr",null,ce),Jc()()),i&2){let e=HD(2);lh("nzData",e.repos())("nzShowPagination",false),gI(4),Lh(Fw(5,7,"local-repos.column.name")),gI(3),Lh(Fw(8,9,"local-repos.column.localPath")),gI(3),Lh(Fw(11,11,"local-repos.column.worktreeBasePath")),gI(3),Lh(Fw(14,13,"local-repos.column.defaultBranch")),gI(3),Lh(Fw(17,15,"local-repos.column.actions")),gI(3),AD(e.repos());}}function xe(i,h){if(i&1&&(_D(0,fe,2,1,"p",5),_D(1,ue,32,27,"section",6),_D(2,_e,3,3,"p",7)(3,ge,21,17,"nz-table",8)),i&2){let e=HD();MD(e.deleteError()?0:-1),gI(),MD(e.formOpen()?1:-1),gI(),MD(e.repos().length===0&&!e.formOpen()?2:e.repos().length>0?3:-1);}}var ae=(()=>{class i{constructor(){this.reposApi=C(f),this.transloco=C(Ve),this.destroyRef=C(at),this.repos=qo([]),this.loading=qo(true),this.loadError=qo(null),this.saveError=qo(null),this.deleteError=qo(null),this.saving=qo(false),this.formOpen=qo(false),this.editingId=qo(null),this.formName=qo(""),this.formLocalPath=qo(""),this.formWorktreeBasePath=qo(""),this.formDefaultBranch=qo(""),this.reload();}openCreateForm(){this.editingId.set(null),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.set(""),this.saveError.set(null),this.formOpen.set(true);}openEditForm(e){this.editingId.set(e.id),this.formName.set(e.name),this.formLocalPath.set(e.localPath),this.formWorktreeBasePath.set(e.worktreeBasePath??""),this.formDefaultBranch.set(e.defaultBranch??""),this.saveError.set(null),this.formOpen.set(true);}cancelForm(){this.formOpen.set(false),this.editingId.set(null),this.saveError.set(null);}submitForm(){if(this.saving())return;this.saveError.set(null),this.saving.set(true);let e=r$1(r$1({name:this.formName().trim(),localPath:this.formLocalPath().trim()},this.formWorktreeBasePath().trim()?{worktreeBasePath:this.formWorktreeBasePath().trim()}:{worktreeBasePath:void 0}),this.formDefaultBranch().trim()?{defaultBranch:this.formDefaultBranch().trim()}:{defaultBranch:void 0}),a=this.editingId();(a?this.reposApi.update(a,e):this.reposApi.create(e)).pipe(ue$1(this.destroyRef)).subscribe({next:d=>{this.saving.set(false),this.formOpen.set(false),this.editingId.set(null),this.repos.update(le=>[...le.filter(M=>M.id!==d.id),d].sort((M,se)=>M.name.localeCompare(se.name))),this.formName.set(""),this.formLocalPath.set(""),this.formWorktreeBasePath.set(""),this.formDefaultBranch.set("");},error:d=>{this.saving.set(false),this.saveError.set(this.errorMessage(d,this.transloco.translate("local-repos.saveFailed")));}});}deleteRepo(e){this.deleteError.set(null),this.reposApi.delete(e.id).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.repos.update(a=>a.filter(l=>l.id!==e.id));},error:a=>{this.deleteError.set(this.errorMessage(a,this.transloco.translate("local-repos.deleteFailed")));}});}reload(){this.loading.set(true),this.loadError.set(null),this.reposApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>{this.repos.set(e),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("local-repos.loadFailed")));}});}errorMessage(e,a){return e instanceof bi||e instanceof Error?e.message:a}static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-local-repository-list"]],decls:11,vars:7,consts:[["data-testid","local-repos-manage",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","type","button","data-testid","create-local-repo",3,"click"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","local-repo-form",1,"form"],["data-testid","empty-state",1,"empty"],["data-testid","local-repo-table",3,"nzData","nzShowPagination"],["data-testid","save-error",1,"error"],[1,"field"],["nz-input","","data-testid","local-repo-name",3,"ngModelChange","ngModel"],["mode","directories",3,"pathChange","path"],[1,"hint"],["nz-input","","data-testid","local-repo-default-branch",3,"ngModelChange","ngModel"],[1,"form-actions"],["nz-button","","nzType","primary","type","button","data-testid","save-local-repo",3,"click","disabled"],["nz-button","","type","button","data-testid","cancel-local-repo",3,"click"],[1,"path-cell"],[1,"actions"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle"]],template:function(a,l){a&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"button",2),mh("click",function(){return l.openCreateForm()}),Iw(6),Pw(7,"transloco"),Jc()(),_D(8,de,3,3,"p",3)(9,me,2,1,"p",4)(10,xe,4,3),Jc()),a&2&&(gI(3),Lh(Fw(4,3,"local-repos.title")),gI(3),rl$1(" ",Fw(7,5,"local-repos.create")," "),gI(2),MD(l.loading()?8:l.loadError()?9:10));},dependencies:[$8,al,er,rl,$i,pf,bd,sp,fp,ai,z,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,ot,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.65rem;padding:.85rem;border:1px solid #e7e5e4;background:#fff}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:.2rem 0 0;font-size:.8rem;color:#78716c}.form-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return i})();var qe=(()=>{class i{static{this.\u0275fac=function(a){return new(a||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-local-repositories-manage"]],decls:1,vars:0,template:function(a,l){a&1&&uh(0,"app-local-repository-list");},dependencies:[ae],encapsulation:2});}}return i})();export{qe as LocalRepositoriesManageComponent};
@@ -0,0 +1 @@
1
+ import {S as St}from'./chunk-BIvdnqHD.js';import'./chunk-C73FUXq8.js';import'./chunk-9iLiX6s9.js';import {Z as ZE,n as uh}from'./main-CL3L2RPE.js';import'./chunk-BDJQdoLK.js';import'./chunk-ChofVXdQ.js';import'./chunk-CID_DKHO.js';import'./chunk-CQOTdAZb.js';var c=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-context-files-manage"]],decls:1,vars:0,template:function(t,a){t&1&&uh(0,"app-context-file-list");},dependencies:[St],encapsulation:2});}}return e})();export{c as ContextFilesManageComponent};
@@ -1 +1 @@
1
- import {D,B,L,h,v,H,Q,G,J,Y,X as X$1,Z}from'./chunk-DUkiyf7y.js';import {H as He}from'./chunk-C7h8oMzu.js';import {_ as _n,C as Cn}from'./chunk-NZ-CPWJ2.js';import {G as Gn,u as un}from'./chunk-Dp4H7MY0.js';import {a as ai,z}from'./chunk-B2Xol2Un.js';import {I as I_,k as k_,t as tm}from'./chunk-C2BVYtVN.js';import {W,I}from'./chunk-iE460Kz5.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-BhTujCrk.js';import'./chunk-Cg2E0vnT.js';import {C,b as at,V as Ve,q as qo,U as Uw,aW as Ng,u as ue,s,r as r$1,b9 as Nl,ba as Se,aX as es,aY as Dg,c as bi,Z as ZE,d as $8,e as al,bb as er,bc as Jc,f as rl,bd as Nc,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt$1,j as _i,I as Iw,P as Pw,J as Jc$1,m as mh,l as _D,o as gI,L as Lh,p as Fw,z as rl$1,M as MD,a7 as KE,a8 as fu,aA as mT,be as E3,bf as _r,aa as oe,a9 as Z0,bg as Ci,aB as yT,ab as Oe,bh as Bt$1,aq as el,bi as cl,a3 as Ah,a4 as Th,as as st,at as Ee,ai as ly,av as K0,n as uh,al as Sh,w as lh,D as ch,bj as Nw,bk as St,bl as wo,ax as Eh,an as WD,ao as GD,H as HD,x as xD,B as AD,G as FD,k as iE,y as aE,aM as Yl,aw as rh,N as ND,aJ as tl,aK as nl,O as Fu,Q as ju}from'./main-CHQMTVIP.js';var Tt=["switchElement"];function wt(n,m){n&1&&uh(0,"nz-icon",3);}function It(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzCheckedChildren);}}function Nt(n,m){if(n&1&&rh(0,It,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzCheckedChildren);}}function kt(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzUnCheckedChildren);}}function Dt(n,m){if(n&1&&rh(0,kt,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzUnCheckedChildren);}}var Ot="switch",X=(()=>{let n,m=[],e=[];return class q{static{let i=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[Yl()],mT(null,null,n,{kind:"field",name:"nzSize",static:false,private:false,access:{has:s=>"nzSize"in s,get:s=>s.nzSize,set:(s,S)=>{s.nzSize=S;}},metadata:i},m,e),i&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:i});}_nzModuleName=Ot;nzConfigService=C(E3);el=C(_r).nativeElement;ngZone=C(oe);cdr=C(Z0);focusMonitor=C(Ci);destroyRef=C(at);isChecked=false;onChange=()=>{};onTouched=()=>{};switchElement;nzLoading=false;nzDisabled=false;nzControl=false;nzCheckedChildren=null;nzUnCheckedChildren=null;nzSize=yT(this,m,"default");nzId=(yT(this,e),null);dir=C(Oe).valueSignal;isNzDisableFirstChange=true;size=qo(this.nzSize);formSize=C(Bt$1,{optional:true});finalSize=Uw(()=>this.formSize?.()||this.size());updateValue(i){this.isChecked!==i&&(this.isChecked=i,this.onChange(this.isChecked));}focus(){this.focusMonitor.focusVia(this.switchElement.nativeElement,"keyboard");}blur(){this.switchElement.nativeElement.blur();}constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.switchElement.nativeElement);});}ngOnChanges(i){let{nzSize:s}=i;s&&this.size.set(s.currentValue);}ngOnInit(){el(this.el,"click").pipe(ue(this.destroyRef)).subscribe(i=>{i.preventDefault(),!(this.nzControl||this.nzDisabled||this.nzLoading)&&this.ngZone.run(()=>{this.updateValue(!this.isChecked),this.cdr.markForCheck();});}),el(this.switchElement.nativeElement,"keydown").pipe(ue(this.destroyRef)).subscribe(i=>{if(this.nzControl||this.nzDisabled||this.nzLoading)return;let{keyCode:s}=i;s!==37&&s!==39&&s!==32&&s!==13||(i.preventDefault(),this.ngZone.run(()=>{s===37?this.updateValue(false):s===39?this.updateValue(true):(s===32||s===13)&&this.updateValue(!this.isChecked),this.cdr.markForCheck();}));});}ngAfterViewInit(){this.focusMonitor.monitor(this.switchElement.nativeElement,true).pipe(ue(this.destroyRef)).subscribe(i=>{i||Promise.resolve().then(()=>this.onTouched());});}writeValue(i){this.isChecked=i,this.cdr.markForCheck();}registerOnChange(i){this.onChange=i;}registerOnTouched(i){this.onTouched=i;}setDisabledState(i){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||i,this.isNzDisableFirstChange=false,this.cdr.markForCheck();}static \u0275fac=function(s){return new(s||q)};static \u0275cmp=ZE({type:q,selectors:[["nz-switch"]],viewQuery:function(s,S){if(s&1&&Eh(Tt,7),s&2){let j;WD(j=GD())&&(S.switchElement=j.first);}},inputs:{nzLoading:[2,"nzLoading","nzLoading",K0],nzDisabled:[2,"nzDisabled","nzDisabled",K0],nzControl:[2,"nzControl","nzControl",K0],nzCheckedChildren:"nzCheckedChildren",nzUnCheckedChildren:"nzUnCheckedChildren",nzSize:"nzSize",nzId:"nzId"},exportAs:["nzSwitch"],features:[Nw([{provide:St,useExisting:wo(()=>q),multi:true}]),ly],decls:8,vars:15,consts:[["switchElement",""],["nz-wave","","type","button",1,"ant-switch",3,"disabled","nzWaveExtraNode"],[1,"ant-switch-handle"],["nzType","loading",1,"ant-switch-loading-icon"],[1,"ant-switch-inner"],[1,"ant-click-animating-node"],[4,"nzStringTemplateOutlet"]],template:function(s,S){s&1&&(_i(0,"button",1,0)(2,"span",2),_D(3,wt,1,0,"nz-icon",3),Jc$1(),_i(4,"span",4),_D(5,Nt,1,1,"ng-container")(6,Dt,1,1,"ng-container"),Jc$1(),uh(7,"div",5),Jc$1()),s&2&&(Sh("ant-switch-checked",S.isChecked)("ant-switch-loading",S.nzLoading)("ant-switch-disabled",S.nzDisabled)("ant-switch-small",S.finalSize()==="small")("ant-switch-rtl",S.dir()==="rtl"),lh("disabled",S.nzDisabled)("nzWaveExtraNode",true),ch("id",S.nzId),gI(3),MD(S.nzLoading?3:-1),gI(2),MD(S.isChecked?5:6));},dependencies:[cl,fp,Ah,Th,st,Ee],encapsulation:2})}})(),xt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=KE({type:n});static \u0275inj=fu({imports:[X]})}return n})();var ee=(n,m)=>m.id,Pt=(n,m)=>m.key;function Rt(n,m){n&1&&(_i(0,"div",4),uh(1,"nz-alert",9),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),lh("nzMessage",Fw(2,1,"settings.restartRequired.message")));}function At(n,m){n&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Ft(n,m){if(n&1&&(_i(0,"p",6),Iw(1),Jc$1()),n&2){let e=HD();gI(),Lh(e.loadError());}}function Bt(n,m){if(n&1&&(_i(0,"nz-tag",11),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=HD().$implicit;ch("data-testid",e.id+"-default-chip"),gI(),Lh(Fw(2,2,"settings.defaultAgent.label"));}}function Lt(n,m){if(n&1&&(_i(0,"nz-tag",17),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=m,t=HD(2).$implicit,i=HD(2);lh("nzColor",i.testResultTone(e)),ch("title",e.message??"")("data-testid",t.id+"-test-result"),gI(),rl$1(" ",Fw(2,4,i.testResultLabelKey(e))," ");}}function Kt(n,m){if(n&1){let e=FD();_i(0,"span",13)(1,"button",16),mh("click",function(){Fu(e);let i=HD().$implicit,s=HD(2);return ju(s.testSavedConnection(i))}),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Lt,3,6,"nz-tag",17),Jc$1();}if(n&2){let e,t=HD().$implicit,i=HD(2);gI(),lh("nzLoading",i.listTestState(t.id)?.running===true)("disabled",i.listTestState(t.id)?.running===true),ch("data-testid",t.id+"-test-connection"),gI(),rl$1(" ",Fw(3,5,"settings.testConnection")," "),gI(2),MD((e=i.listTestState(t.id)?.result)?4:-1,e);}}function $t(n,m){if(n&1){let e=FD();_i(0,"tr")(1,"td",10)(2,"span"),Iw(3),Jc$1(),_D(4,Bt,3,4,"nz-tag",11),Jc$1(),_i(5,"td")(6,"nz-tag"),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"td"),Iw(10),Jc$1(),_i(11,"td",12),_D(12,Kt,5,7,"span",13),_i(13,"button",14),mh("click",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.openEdit(i))}),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"button",15),Pw(17,"transloco"),Pw(18,"transloco"),Pw(19,"transloco"),mh("nzOnConfirm",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.removeInstance(i.id))}),Iw(20),Pw(21,"transloco"),Jc$1()()();}if(n&2){let e=m.$implicit,t=HD(2);ch("data-testid","instance-"+e.id),gI(),ch("data-testid",e.id+"-name"),gI(2),Lh(e.displayName),gI(),MD(t.isDefaultAgent(e)?4:-1),gI(2),ch("data-testid",e.id+"-type"),gI(),Lh(Fw(8,16,t.typeLabelKey(e))),gI(2),ch("data-testid",e.id+"-expires"),gI(),rl$1(" ",e.expiresOn??""," "),gI(2),MD(t.supportsTestConnection(e.type)?12:-1),gI(),ch("data-testid",e.id+"-edit"),gI(),rl$1(" ",Fw(15,18,"settings.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(17,20,"settings.deleteConfirm"))("nzOkText",Fw(18,22,"settings.delete"))("nzCancelText",Fw(19,24,"common.cancel")),ch("data-testid",e.id+"-delete"),gI(4),rl$1(" ",Fw(21,26,"settings.delete")," ");}}function qt(n,m){if(n&1&&(_i(0,"nz-table",7)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc$1(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc$1(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc$1()()(),_i(15,"tbody"),xD(16,$t,22,28,"tr",null,ee),Jc$1()()),n&2){let e=HD();lh("nzData",e.instances())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,7,"settings.column.displayName")),gI(3),Lh(Fw(8,9,"settings.column.type")),gI(3),Lh(Fw(11,11,"settings.column.expiresOn")),gI(3),Lh(Fw(14,13,"settings.column.actions")),gI(3),AD(e.instances());}}function jt(n,m){if(n&1&&(_i(0,"li"),Iw(1),Jc$1()),n&2){let e=m.$implicit;gI(),Lh(e);}}function Ut(n,m){if(n&1&&(_i(0,"section",19)(1,"h3"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"ul"),xD(5,jt,2,1,"li",null,ND),Jc$1()()),n&2){let e=HD(2);gI(2),Lh(Fw(3,1,"settings.validation")),gI(3),AD(e.validationErrors());}}function Wt(n,m){if(n&1&&(_i(0,"p",20),Iw(1),Jc$1()),n&2){let e=HD(2);gI(),Lh(e.secretSaveError());}}function Zt(n,m){if(n&1&&(uh(0,"nz-option",27),Pw(1,"transloco")),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",Fw(1,2,e.labelKey));}}function Ht(n,m){if(n&1){let e=FD();_i(0,"label",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"input",37),mh("ngModelChange",function(i){let s=Fu(e).$implicit,S=HD(2);return ju(S.setDraftConfig(s.key,i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=m.$implicit,t=HD(2);gI(2),Lh(Fw(3,3,e.labelKey)),gI(2),lh("ngModel",t.configValue(t.draft().config,e.key)),ch("data-testid","provider-config-"+e.key),aE();}}function Qt(n,m){if(n&1){let e=FD();_i(0,"button",38),mh("click",function(){Fu(e);let i=HD(2);return ju(i.fetchModels())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.fetchingModels())("disabled",!e.canFetchModels()),gI(),rl$1(" ",Fw(2,3,"settings.model.fetch")," ");}}function Gt(n,m){if(n&1){let e=FD();_i(0,"button",39),mh("click",function(){Fu(e);let i=HD(2);return ju(i.testDraftConnection())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.modalTestRunning())("disabled",!e.canTestConnection()),gI(),rl$1(" ",Fw(2,3,"settings.testConnection")," ");}}function Jt(n,m){if(n&1&&(_i(0,"p",41),Iw(1),Jc$1()),n&2){let e=HD();Sh("warning",e.identityMismatch)("error",!e.success),gI(),rl$1(" ",e.message," ");}}function Yt(n,m){if(n&1&&(_i(0,"div",32)(1,"nz-tag",17),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Jt,2,5,"p",40),Jc$1()),n&2){let e=m,t=HD(2);gI(),lh("nzColor",t.testResultTone(e)),gI(),rl$1(" ",Fw(3,3,t.testResultLabelKey(e))," "),gI(2),MD(e.message?4:-1);}}function Xt(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=HD(3);lh("nzValue",e.configValue(e.draft().config,"model"))("nzLabel",e.configValue(e.draft().config,"model"));}}function ei(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function ti(n,m){if(n&1&&(_i(0,"p",43),Iw(1),Jc$1()),n&2){let e=HD(3);gI(),Lh(e.modelsError());}}function ii(n,m){if(n&1){let e=FD();_i(0,"div",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"nz-select",42),Pw(5,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDraftConfig("model",i??""))}),_D(6,Xt,1,2,"nz-option",27),xD(7,ei,1,2,"nz-option",27,ee),Jc$1(),iE(),_D(9,ti,2,1,"p",43),_i(10,"p",25),Iw(11),Pw(12,"transloco"),Jc$1()(),_i(13,"label",21)(14,"span"),Iw(15),Pw(16,"transloco"),Jc$1(),_i(17,"input",44),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setMaxConcurrent(i))}),Jc$1(),iE(),_i(18,"p",25),Iw(19),Pw(20,"transloco"),Jc$1()(),_i(21,"label",45)(22,"span"),Iw(23),Pw(24,"transloco"),Jc$1(),_i(25,"nz-switch",46),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDefaultAgentDraft(i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=HD(2);gI(2),Lh(Fw(3,11,"settings.model.label")),gI(2),lh("nzPlaceHolder",Fw(5,13,"settings.model.placeholder"))("ngModel",e.configValue(e.draft().config,"model")),aE(),gI(2),MD(e.selectedModelMissingFromList()?6:-1),gI(),AD(e.availableModels()),gI(2),MD(e.modelsError()?9:-1),gI(2),Lh(Fw(12,15,"settings.model.hint")),gI(4),Lh(Fw(16,17,"settings.maxConcurrent.label")),gI(2),lh("ngModel",e.draft().maxConcurrent),aE(),gI(2),Lh(Fw(20,19,"settings.maxConcurrent.hint")),gI(4),Lh(Fw(24,21,"settings.defaultAgent.toggle")),gI(2),lh("ngModel",e.draft().defaultAgent),aE();}}function ni(n,m){if(n&1){let e=FD();_i(0,"div",8)(1,"div",18)(2,"h2"),Iw(3),Pw(4,"transloco"),Jc$1(),_D(5,Ut,7,3,"section",19),_D(6,Wt,2,1,"p",20),_i(7,"label",21)(8,"span"),Iw(9),Pw(10,"transloco"),Jc$1(),_i(11,"input",22),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onDisplayNameChange(i))}),Jc$1(),iE(),Jc$1(),_i(12,"label",23)(13,"span"),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"input",24),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onIdChange(i))}),Jc$1(),iE(),_i(17,"p",25),Iw(18),Pw(19,"transloco"),Jc$1()(),_i(20,"div",21)(21,"span"),Iw(22),Pw(23,"transloco"),Jc$1(),_i(24,"nz-select",26),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onTypeChange(i))}),xD(25,Zt,2,4,"nz-option",27,ee),Jc$1(),iE(),Jc$1(),xD(27,Ht,5,5,"label",21,Pt),_i(29,"label",21)(30,"span"),Iw(31),Pw(32,"transloco"),Jc$1(),_i(33,"div",28)(34,"input",29),Pw(35,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setSecretValue(i))}),Jc$1(),iE(),_D(36,Qt,3,5,"button",30),_D(37,Gt,3,5,"button",31),Jc$1(),_D(38,Yt,5,5,"div",32),Jc$1(),_D(39,ii,26,23),_i(40,"label",21)(41,"span"),Iw(42),Pw(43,"transloco"),Jc$1(),_i(44,"input",33),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setExpiresOn(i))}),Jc$1(),iE(),_i(45,"p",25),Iw(46),Pw(47,"transloco"),Jc$1()(),_i(48,"div",34)(49,"button",35),mh("click",function(){Fu(e);let i=HD();return ju(i.closeModal())}),Iw(50),Pw(51,"transloco"),Jc$1(),_i(52,"button",36),mh("click",function(){Fu(e);let i=HD();return ju(i.saveModal())}),Iw(53),Pw(54,"transloco"),Jc$1()()()();}if(n&2){let e,t=HD();gI(3),rl$1(" ",Fw(4,23,t.draft().originalId?"settings.editProvider":"settings.addProvider")," "),gI(2),MD(t.validationErrors().length>0?5:-1),gI(),MD(t.secretSaveError()?6:-1),gI(3),Lh(Fw(10,25,"settings.displayName")),gI(2),lh("ngModel",t.draft().displayName),aE(),gI(3),Lh(Fw(15,27,"settings.instanceId")),gI(2),lh("ngModel",t.draft().id),aE(),gI(2),Lh(Fw(19,29,"settings.instanceIdHint")),gI(4),Lh(Fw(23,31,"settings.type.label")),gI(2),lh("ngModel",t.draft().optionId),aE(),gI(),AD(t.typeOptions),gI(2),AD(t.configFields(t.draft().type)),gI(4),Lh(Fw(32,33,"settings.apiKey.label")),gI(3),lh("ngModel",t.draft().secretValue)("placeholder",Fw(35,35,t.draft().originalId?"settings.apiKey.placeholderEdit":"settings.apiKey.placeholderCreate")),aE(),gI(2),MD(t.draft().kind==="agent"?36:-1),gI(),MD(t.supportsTestConnection(t.draft().type)?37:-1),gI(),MD((e=t.modalTestResult())?38:-1,e),gI(),MD(t.draft().kind==="agent"?39:-1),gI(3),Lh(Fw(43,37,"settings.expiresOn.label")),gI(2),lh("ngModel",t.draft().expiresOn),aE(),gI(2),Lh(Fw(47,39,"settings.expiresOn.hint")),gI(4),rl$1(" ",Fw(51,41,"common.cancel")," "),gI(2),lh("nzLoading",t.saving()),gI(),rl$1(" ",Fw(54,43,"common.save")," ");}}var Xi=(()=>{class n{constructor(){this.api=C(D),this.providersApi=C(B),this.message=C(He),this.destroyRef=C(at),this.transloco=C(Ve),this.loaded=qo({providerInstances:[]}),this.status=qo([]),this.draft=qo(L()),this.loading=qo(true),this.saving=qo(false),this.loadError=qo(null),this.validationErrors=qo([]),this.secretSaveError=qo(null),this.restartRequired=qo(false),this.modalOpen=qo(false),this.availableModels=qo([]),this.fetchingModels=qo(false),this.modelsError=qo(null),this.listTests=qo({}),this.modalTestRunning=qo(false),this.modalTestResult=qo(null),this.instances=Uw(()=>this.loaded().providerInstances??[]),this.typeOptions=h,this.configFields=v,this.typeLabelKey=H,this.isAgent=I_,this.supportsTestConnection=k_,Ng({settings:this.api.getSettings(),status:this.api.getProviderStatus()}).pipe(ue(this.destroyRef)).subscribe({next:({settings:e,status:t})=>{this.applySettings(e,false),this.status.set(t),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("settings.loadFailed")));}});}configValue(e,t){let i=e[t];return typeof i=="string"?i:""}isDefaultAgent(e){return I_(e)&&this.loaded().defaultAgentInstanceId===e.id}selectedModelMissingFromList(){let e=this.configValue(this.draft().config,"model");return e?!this.availableModels().some(t=>t.id===e):false}canFetchModels(){let e=this.draft();return e.kind==="agent"&&(e.secretValue.trim().length>0||e.originalId!=null)}canTestConnection(){let e=this.draft();return k_(e.type)&&(e.secretValue.trim().length>0||e.originalId!=null)}listTestState(e){return this.listTests()[e]}testResultTone(e){return e.identityMismatch?"warning":e.success?"success":"error"}testResultLabelKey(e){return e.identityMismatch?"settings.testConnection.mismatch":e.success?"settings.testConnection.connected":"settings.testConnection.failed"}openCreate(){this.resetModal(L());}openEdit(e){this.resetModal(Q(e,this.isDefaultAgent(e)));}closeModal(){this.modalOpen.set(false);}onDisplayNameChange(e){this.draft.update(t=>G(t,e,this.existingIds(t)));}onIdChange(e){this.draft.update(t=>J(t,e));}onTypeChange(e){this.availableModels.set([]),this.modelsError.set(null),this.modalTestResult.set(null),this.draft.update(t=>{let i=Y(t,e);return i.kind!=="agent"||t.kind==="agent"?i:s(r$1({},i),{defaultAgent:this.shouldDefaultNewAgent(t)})});}setDraftConfig(e,t){this.draft.update(i=>s(r$1({},i),{config:s(r$1({},i.config),{[e]:t})}));}setSecretValue(e){this.draft.update(t=>s(r$1({},t),{secretValue:e}));}setExpiresOn(e){this.draft.update(t=>s(r$1({},t),{expiresOn:e}));}setDefaultAgentDraft(e){this.draft.update(t=>s(r$1({},t),{defaultAgent:e}));}setMaxConcurrent(e){let t=typeof e=="number"?e:Number(e),i=Number.isFinite(t)&&t>=1?Math.floor(t):1;this.draft.update(s$1=>s(r$1({},s$1),{maxConcurrent:i}));}fetchModels(){let e=this.draft();if(e.kind!=="agent"||!this.canFetchModels())return;let t=e.secretValue.trim();this.fetchingModels.set(true),this.modelsError.set(null),this.providersApi.previewModels(t?{type:e.type,apiKey:t}:{type:e.type,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.availableModels.set(i),this.fetchingModels.set(false);},error:i=>{this.fetchingModels.set(false),this.modelsError.set(this.errorMessage(i,this.transloco.translate("settings.model.fetchFailed")));}});}testSavedConnection(e){k_(e.type)&&(this.listTests()[e.id]?.running||(this.listTests.update(t=>s(r$1({},t),{[e.id]:{running:true,result:t[e.id]?.result}})),this.api.testProviderConnection(e.id).pipe(ue(this.destroyRef)).subscribe({next:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:t}}));},error:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:{success:false,message:this.errorMessage(t,this.transloco.translate("settings.testConnection.failed"))}}}));}})));}testDraftConnection(){let e=this.draft();if(!this.canTestConnection()||this.modalTestRunning())return;let t=e.secretValue.trim();this.modalTestRunning.set(true),this.modalTestResult.set(null),this.providersApi.testConnection(t?{type:e.type,config:e.config,apiKey:t}:{type:e.type,config:e.config,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.modalTestRunning.set(false),this.modalTestResult.set(i);},error:i=>{this.modalTestRunning.set(false),this.modalTestResult.set({success:false,message:this.errorMessage(i,this.transloco.translate("settings.testConnection.failed"))});}});}saveModal(){let e=this.draft();if(this.validationErrors.set([]),this.secretSaveError.set(null),!e.displayName.trim()){this.validationErrors.set([this.transloco.translate("settings.displayNameRequired")]);return}if(e.originalId==null&&!e.secretValue.trim()){this.validationErrors.set([this.transloco.translate("settings.apiKey.required")]);return}let t=tm.safeParse(X$1(e));if(!t.success){this.validationErrors.set(Z(t.error));return}this.saving.set(true);let i=t.data,s$1=i.kind==="agent"?{defaultAgent:e.defaultAgent}:{};(e.originalId==null?this.api.createProviderInstance(r$1(r$1({},i),s$1)):this.api.updateProviderInstance(e.originalId,r$1(r$1({displayName:i.displayName,config:i.config,secretKey:i.secretKey,expiresOn:i.expiresOn??null},i.kind==="agent"?{maxConcurrent:i.maxConcurrent}:{}),s$1))).pipe(Nl(D=>{this.applySettings(D.settings,D.restartRequired);let P=e.secretValue.trim();return P?this.api.setSecret(i.secretKey,P).pipe(Se(()=>({kind:"ok"})),es(vt=>Dg({kind:"secret-failed",err:vt}))):Dg({kind:"ok"})}),ue(this.destroyRef)).subscribe({next:D=>{if(this.saving.set(false),D.kind==="secret-failed"){this.draft.update(P=>s(r$1({},P),{originalId:i.id,id:i.id,idAutoSync:false,secretKey:i.secretKey})),this.secretSaveError.set(this.errorMessage(D.err,this.transloco.translate("settings.apiKey.setFailedAfterSave"))),this.refreshStatus();return}this.modalOpen.set(false),this.refreshStatus();},error:D=>{this.saving.set(false),this.message.error(this.errorMessage(D,this.transloco.translate("settings.saveFailed")));}});}removeInstance(e){this.api.deleteProviderInstance(e).subscribe({next:t=>this.applySettings(t.settings,t.restartRequired),error:t=>{this.message.error(this.errorMessage(t,this.transloco.translate("settings.saveFailed")));}});}resetModal(e){this.validationErrors.set([]),this.secretSaveError.set(null),this.availableModels.set([]),this.modelsError.set(null),this.fetchingModels.set(false),this.modalTestRunning.set(false),this.modalTestResult.set(null),this.draft.set(e),this.modalOpen.set(true);}shouldDefaultNewAgent(e){return e.originalId&&e.originalId===this.loaded().defaultAgentInstanceId?true:!this.loaded().defaultAgentInstanceId}existingIds(e){return this.instances().map(t=>t.id).filter(t=>t!==e.originalId)}applySettings(e,t){let i=e.providerInstances??[];this.loaded.set(r$1({providerInstances:i},e.defaultAgentInstanceId?{defaultAgentInstanceId:e.defaultAgentInstanceId}:{})),t&&this.restartRequired.set(true);}refreshStatus(){this.api.getProviderStatus().subscribe({next:e=>this.status.set(e),error:()=>{}});}errorMessage(e,t){return e instanceof bi||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||n)};}static{this.\u0275cmp=ZE({type:n,selectors:[["app-settings"]],decls:17,vars:12,consts:[["data-testid","settings-page",1,"settings"],[1,"header"],[1,"lede"],["nz-button","","nzType","primary","type","button","data-testid","add-provider",3,"click"],["data-testid","restart-required-banner"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","provider-instances",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","provider-modal",1,"modal-backdrop"],["nzType","warning","nzShowIcon","","nzBanner","",3,"nzMessage"],[1,"name-cell"],["nzColor","blue"],[1,"actions"],[1,"test-connection"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"],["nz-button","","nzType","link","type","button",3,"click","nzLoading","disabled"],[3,"nzColor"],["role","dialog",1,"modal-panel"],["data-testid","validation-errors",1,"errors"],["data-testid","secret-save-error",1,"error"],[1,"field"],["nz-input","","data-testid","provider-display-name",3,"ngModelChange","ngModel"],[1,"field","field-id"],["nz-input","","data-testid","provider-id",3,"ngModelChange","ngModel"],[1,"hint"],["data-testid","provider-type",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"api-key-row"],["nz-input","","type","password","autocomplete","off","data-testid","provider-api-key",3,"ngModelChange","ngModel","placeholder"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"nzLoading","disabled"],["data-testid","provider-test-result",1,"test-result-row"],["nz-input","","type","date","data-testid","provider-expires-on",3,"ngModelChange","ngModel"],[1,"modal-actions"],["nz-button","","type","button","data-testid","provider-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","provider-save",3,"click","nzLoading"],["nz-input","",3,"ngModelChange","ngModel"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"click","nzLoading","disabled"],["data-testid","provider-test-result-message",1,"test-result-message",3,"warning","error"],["data-testid","provider-test-result-message",1,"test-result-message"],["data-testid","provider-model","nzAllowClear","",3,"ngModelChange","nzPlaceHolder","ngModel"],["data-testid","provider-models-error",1,"error"],["nz-input","","type","number","min","1","step","1","data-testid","provider-max-concurrent",3,"ngModelChange","ngModel"],[1,"field","field-switch"],["data-testid","provider-default-agent",3,"ngModelChange","ngModel"]],template:function(t,i){t&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"p",2),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"button",3),mh("click",function(){return i.openCreate()}),Iw(10),Pw(11,"transloco"),Jc$1()(),_D(12,Rt,3,3,"div",4),_D(13,At,3,3,"p",5)(14,Ft,2,1,"p",6)(15,qt,18,15,"nz-table",7),_D(16,ni,55,45,"div",8),Jc$1()),t&2&&(gI(4),Lh(Fw(5,6,"settings.title")),gI(3),Lh(Fw(8,8,"settings.lede")),gI(3),rl$1(" ",Fw(11,10,"settings.addProvider")," "),gI(2),MD(i.restartRequired()?12:-1),gI(),MD(i.loading()?13:i.loadError()?14:15),gI(3),MD(i.modalOpen()?16:-1));},dependencies:[$8,al,er,Jc,rl,Nc,$i,Gn,un,pf,bd,sp,fp,ai,z,_n,Cn,ex,Fm,Am,xt,X,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".settings[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.field-id[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace;font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.15rem .25rem}.test-connection[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem}.api-key-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.api-key-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:10rem}.test-result-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.4rem .6rem;margin-top:.45rem}.test-result-message[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#57534e;flex:1;min-width:12rem}.test-result-message.warning[_ngcontent-%COMP%]{color:#b45309}.test-result-message.error[_ngcontent-%COMP%]{color:#9f1239}.field-switch[_ngcontent-%COMP%]{flex-direction:row;align-items:center;justify-content:space-between}.modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:4rem 1rem 2rem;background:#1c191759}.modal-panel[_ngcontent-%COMP%]{width:min(32rem,100%);max-height:calc(100vh - 6rem);overflow:auto;background:#fff;border-radius:.5rem;padding:1.25rem 1.5rem 1.5rem;box-shadow:0 10px 30px #1c19172e}.modal-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.15rem}.modal-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}"]});}}return n})();export{Xi as ProvidersManageComponent,Xi as SettingsComponent};
1
+ import {D,B,L,h,v,H,Q,G,J,Y,X as X$1,Z}from'./chunk-D-NkClC5.js';import {H as He}from'./chunk-JnLpFByq.js';import {_ as _n,C as Cn}from'./chunk-9iLiX6s9.js';import {G as Gn,u as un}from'./chunk-Bwjn3y5m.js';import {a as ai,z}from'./chunk-BDJQdoLK.js';import {I as I_,k as k_,t as tm}from'./chunk-Darhf4Mc.js';import {W,I}from'./chunk-ChofVXdQ.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-CID_DKHO.js';import'./chunk-CQOTdAZb.js';import {C,b as at,V as Ve,q as qo,U as Uw,aW as Ng,u as ue,s,r as r$1,b9 as Nl,ba as Se,aX as es,aY as Dg,c as bi,Z as ZE,d as $8,e as al,bb as er,bc as Jc,f as rl,bd as Nc,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt$1,j as _i,I as Iw,P as Pw,J as Jc$1,m as mh,l as _D,o as gI,L as Lh,p as Fw,z as rl$1,M as MD,a7 as KE,a8 as fu,aA as mT,be as E3,bf as _r,aa as oe,a9 as Z0,bg as Ci,aB as yT,ab as Oe,bh as Bt$1,aq as el,bi as cl,a3 as Ah,a4 as Th,as as st,at as Ee,ai as ly,av as K0,n as uh,al as Sh,w as lh,D as ch,bj as Nw,bk as St,bl as wo,ax as Eh,an as WD,ao as GD,H as HD,x as xD,B as AD,G as FD,k as iE,y as aE,aM as Yl,aw as rh,N as ND,aJ as tl,aK as nl,O as Fu,Q as ju}from'./main-CL3L2RPE.js';var Tt=["switchElement"];function wt(n,m){n&1&&uh(0,"nz-icon",3);}function It(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzCheckedChildren);}}function Nt(n,m){if(n&1&&rh(0,It,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzCheckedChildren);}}function kt(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzUnCheckedChildren);}}function Dt(n,m){if(n&1&&rh(0,kt,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzUnCheckedChildren);}}var Ot="switch",X=(()=>{let n,m=[],e=[];return class q{static{let i=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[Yl()],mT(null,null,n,{kind:"field",name:"nzSize",static:false,private:false,access:{has:s=>"nzSize"in s,get:s=>s.nzSize,set:(s,S)=>{s.nzSize=S;}},metadata:i},m,e),i&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:i});}_nzModuleName=Ot;nzConfigService=C(E3);el=C(_r).nativeElement;ngZone=C(oe);cdr=C(Z0);focusMonitor=C(Ci);destroyRef=C(at);isChecked=false;onChange=()=>{};onTouched=()=>{};switchElement;nzLoading=false;nzDisabled=false;nzControl=false;nzCheckedChildren=null;nzUnCheckedChildren=null;nzSize=yT(this,m,"default");nzId=(yT(this,e),null);dir=C(Oe).valueSignal;isNzDisableFirstChange=true;size=qo(this.nzSize);formSize=C(Bt$1,{optional:true});finalSize=Uw(()=>this.formSize?.()||this.size());updateValue(i){this.isChecked!==i&&(this.isChecked=i,this.onChange(this.isChecked));}focus(){this.focusMonitor.focusVia(this.switchElement.nativeElement,"keyboard");}blur(){this.switchElement.nativeElement.blur();}constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.switchElement.nativeElement);});}ngOnChanges(i){let{nzSize:s}=i;s&&this.size.set(s.currentValue);}ngOnInit(){el(this.el,"click").pipe(ue(this.destroyRef)).subscribe(i=>{i.preventDefault(),!(this.nzControl||this.nzDisabled||this.nzLoading)&&this.ngZone.run(()=>{this.updateValue(!this.isChecked),this.cdr.markForCheck();});}),el(this.switchElement.nativeElement,"keydown").pipe(ue(this.destroyRef)).subscribe(i=>{if(this.nzControl||this.nzDisabled||this.nzLoading)return;let{keyCode:s}=i;s!==37&&s!==39&&s!==32&&s!==13||(i.preventDefault(),this.ngZone.run(()=>{s===37?this.updateValue(false):s===39?this.updateValue(true):(s===32||s===13)&&this.updateValue(!this.isChecked),this.cdr.markForCheck();}));});}ngAfterViewInit(){this.focusMonitor.monitor(this.switchElement.nativeElement,true).pipe(ue(this.destroyRef)).subscribe(i=>{i||Promise.resolve().then(()=>this.onTouched());});}writeValue(i){this.isChecked=i,this.cdr.markForCheck();}registerOnChange(i){this.onChange=i;}registerOnTouched(i){this.onTouched=i;}setDisabledState(i){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||i,this.isNzDisableFirstChange=false,this.cdr.markForCheck();}static \u0275fac=function(s){return new(s||q)};static \u0275cmp=ZE({type:q,selectors:[["nz-switch"]],viewQuery:function(s,S){if(s&1&&Eh(Tt,7),s&2){let j;WD(j=GD())&&(S.switchElement=j.first);}},inputs:{nzLoading:[2,"nzLoading","nzLoading",K0],nzDisabled:[2,"nzDisabled","nzDisabled",K0],nzControl:[2,"nzControl","nzControl",K0],nzCheckedChildren:"nzCheckedChildren",nzUnCheckedChildren:"nzUnCheckedChildren",nzSize:"nzSize",nzId:"nzId"},exportAs:["nzSwitch"],features:[Nw([{provide:St,useExisting:wo(()=>q),multi:true}]),ly],decls:8,vars:15,consts:[["switchElement",""],["nz-wave","","type","button",1,"ant-switch",3,"disabled","nzWaveExtraNode"],[1,"ant-switch-handle"],["nzType","loading",1,"ant-switch-loading-icon"],[1,"ant-switch-inner"],[1,"ant-click-animating-node"],[4,"nzStringTemplateOutlet"]],template:function(s,S){s&1&&(_i(0,"button",1,0)(2,"span",2),_D(3,wt,1,0,"nz-icon",3),Jc$1(),_i(4,"span",4),_D(5,Nt,1,1,"ng-container")(6,Dt,1,1,"ng-container"),Jc$1(),uh(7,"div",5),Jc$1()),s&2&&(Sh("ant-switch-checked",S.isChecked)("ant-switch-loading",S.nzLoading)("ant-switch-disabled",S.nzDisabled)("ant-switch-small",S.finalSize()==="small")("ant-switch-rtl",S.dir()==="rtl"),lh("disabled",S.nzDisabled)("nzWaveExtraNode",true),ch("id",S.nzId),gI(3),MD(S.nzLoading?3:-1),gI(2),MD(S.isChecked?5:6));},dependencies:[cl,fp,Ah,Th,st,Ee],encapsulation:2})}})(),xt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=KE({type:n});static \u0275inj=fu({imports:[X]})}return n})();var ee=(n,m)=>m.id,Pt=(n,m)=>m.key;function Rt(n,m){n&1&&(_i(0,"div",4),uh(1,"nz-alert",9),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),lh("nzMessage",Fw(2,1,"settings.restartRequired.message")));}function At(n,m){n&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Ft(n,m){if(n&1&&(_i(0,"p",6),Iw(1),Jc$1()),n&2){let e=HD();gI(),Lh(e.loadError());}}function Bt(n,m){if(n&1&&(_i(0,"nz-tag",11),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=HD().$implicit;ch("data-testid",e.id+"-default-chip"),gI(),Lh(Fw(2,2,"settings.defaultAgent.label"));}}function Lt(n,m){if(n&1&&(_i(0,"nz-tag",17),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=m,t=HD(2).$implicit,i=HD(2);lh("nzColor",i.testResultTone(e)),ch("title",e.message??"")("data-testid",t.id+"-test-result"),gI(),rl$1(" ",Fw(2,4,i.testResultLabelKey(e))," ");}}function Kt(n,m){if(n&1){let e=FD();_i(0,"span",13)(1,"button",16),mh("click",function(){Fu(e);let i=HD().$implicit,s=HD(2);return ju(s.testSavedConnection(i))}),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Lt,3,6,"nz-tag",17),Jc$1();}if(n&2){let e,t=HD().$implicit,i=HD(2);gI(),lh("nzLoading",i.listTestState(t.id)?.running===true)("disabled",i.listTestState(t.id)?.running===true),ch("data-testid",t.id+"-test-connection"),gI(),rl$1(" ",Fw(3,5,"settings.testConnection")," "),gI(2),MD((e=i.listTestState(t.id)?.result)?4:-1,e);}}function $t(n,m){if(n&1){let e=FD();_i(0,"tr")(1,"td",10)(2,"span"),Iw(3),Jc$1(),_D(4,Bt,3,4,"nz-tag",11),Jc$1(),_i(5,"td")(6,"nz-tag"),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"td"),Iw(10),Jc$1(),_i(11,"td",12),_D(12,Kt,5,7,"span",13),_i(13,"button",14),mh("click",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.openEdit(i))}),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"button",15),Pw(17,"transloco"),Pw(18,"transloco"),Pw(19,"transloco"),mh("nzOnConfirm",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.removeInstance(i.id))}),Iw(20),Pw(21,"transloco"),Jc$1()()();}if(n&2){let e=m.$implicit,t=HD(2);ch("data-testid","instance-"+e.id),gI(),ch("data-testid",e.id+"-name"),gI(2),Lh(e.displayName),gI(),MD(t.isDefaultAgent(e)?4:-1),gI(2),ch("data-testid",e.id+"-type"),gI(),Lh(Fw(8,16,t.typeLabelKey(e))),gI(2),ch("data-testid",e.id+"-expires"),gI(),rl$1(" ",e.expiresOn??""," "),gI(2),MD(t.supportsTestConnection(e.type)?12:-1),gI(),ch("data-testid",e.id+"-edit"),gI(),rl$1(" ",Fw(15,18,"settings.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(17,20,"settings.deleteConfirm"))("nzOkText",Fw(18,22,"settings.delete"))("nzCancelText",Fw(19,24,"common.cancel")),ch("data-testid",e.id+"-delete"),gI(4),rl$1(" ",Fw(21,26,"settings.delete")," ");}}function qt(n,m){if(n&1&&(_i(0,"nz-table",7)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc$1(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc$1(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc$1()()(),_i(15,"tbody"),xD(16,$t,22,28,"tr",null,ee),Jc$1()()),n&2){let e=HD();lh("nzData",e.instances())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,7,"settings.column.displayName")),gI(3),Lh(Fw(8,9,"settings.column.type")),gI(3),Lh(Fw(11,11,"settings.column.expiresOn")),gI(3),Lh(Fw(14,13,"settings.column.actions")),gI(3),AD(e.instances());}}function jt(n,m){if(n&1&&(_i(0,"li"),Iw(1),Jc$1()),n&2){let e=m.$implicit;gI(),Lh(e);}}function Ut(n,m){if(n&1&&(_i(0,"section",19)(1,"h3"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"ul"),xD(5,jt,2,1,"li",null,ND),Jc$1()()),n&2){let e=HD(2);gI(2),Lh(Fw(3,1,"settings.validation")),gI(3),AD(e.validationErrors());}}function Wt(n,m){if(n&1&&(_i(0,"p",20),Iw(1),Jc$1()),n&2){let e=HD(2);gI(),Lh(e.secretSaveError());}}function Zt(n,m){if(n&1&&(uh(0,"nz-option",27),Pw(1,"transloco")),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",Fw(1,2,e.labelKey));}}function Ht(n,m){if(n&1){let e=FD();_i(0,"label",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"input",37),mh("ngModelChange",function(i){let s=Fu(e).$implicit,S=HD(2);return ju(S.setDraftConfig(s.key,i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=m.$implicit,t=HD(2);gI(2),Lh(Fw(3,3,e.labelKey)),gI(2),lh("ngModel",t.configValue(t.draft().config,e.key)),ch("data-testid","provider-config-"+e.key),aE();}}function Qt(n,m){if(n&1){let e=FD();_i(0,"button",38),mh("click",function(){Fu(e);let i=HD(2);return ju(i.fetchModels())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.fetchingModels())("disabled",!e.canFetchModels()),gI(),rl$1(" ",Fw(2,3,"settings.model.fetch")," ");}}function Gt(n,m){if(n&1){let e=FD();_i(0,"button",39),mh("click",function(){Fu(e);let i=HD(2);return ju(i.testDraftConnection())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.modalTestRunning())("disabled",!e.canTestConnection()),gI(),rl$1(" ",Fw(2,3,"settings.testConnection")," ");}}function Jt(n,m){if(n&1&&(_i(0,"p",41),Iw(1),Jc$1()),n&2){let e=HD();Sh("warning",e.identityMismatch)("error",!e.success),gI(),rl$1(" ",e.message," ");}}function Yt(n,m){if(n&1&&(_i(0,"div",32)(1,"nz-tag",17),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Jt,2,5,"p",40),Jc$1()),n&2){let e=m,t=HD(2);gI(),lh("nzColor",t.testResultTone(e)),gI(),rl$1(" ",Fw(3,3,t.testResultLabelKey(e))," "),gI(2),MD(e.message?4:-1);}}function Xt(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=HD(3);lh("nzValue",e.configValue(e.draft().config,"model"))("nzLabel",e.configValue(e.draft().config,"model"));}}function ei(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function ti(n,m){if(n&1&&(_i(0,"p",43),Iw(1),Jc$1()),n&2){let e=HD(3);gI(),Lh(e.modelsError());}}function ii(n,m){if(n&1){let e=FD();_i(0,"div",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"nz-select",42),Pw(5,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDraftConfig("model",i??""))}),_D(6,Xt,1,2,"nz-option",27),xD(7,ei,1,2,"nz-option",27,ee),Jc$1(),iE(),_D(9,ti,2,1,"p",43),_i(10,"p",25),Iw(11),Pw(12,"transloco"),Jc$1()(),_i(13,"label",21)(14,"span"),Iw(15),Pw(16,"transloco"),Jc$1(),_i(17,"input",44),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setMaxConcurrent(i))}),Jc$1(),iE(),_i(18,"p",25),Iw(19),Pw(20,"transloco"),Jc$1()(),_i(21,"label",45)(22,"span"),Iw(23),Pw(24,"transloco"),Jc$1(),_i(25,"nz-switch",46),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDefaultAgentDraft(i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=HD(2);gI(2),Lh(Fw(3,11,"settings.model.label")),gI(2),lh("nzPlaceHolder",Fw(5,13,"settings.model.placeholder"))("ngModel",e.configValue(e.draft().config,"model")),aE(),gI(2),MD(e.selectedModelMissingFromList()?6:-1),gI(),AD(e.availableModels()),gI(2),MD(e.modelsError()?9:-1),gI(2),Lh(Fw(12,15,"settings.model.hint")),gI(4),Lh(Fw(16,17,"settings.maxConcurrent.label")),gI(2),lh("ngModel",e.draft().maxConcurrent),aE(),gI(2),Lh(Fw(20,19,"settings.maxConcurrent.hint")),gI(4),Lh(Fw(24,21,"settings.defaultAgent.toggle")),gI(2),lh("ngModel",e.draft().defaultAgent),aE();}}function ni(n,m){if(n&1){let e=FD();_i(0,"div",8)(1,"div",18)(2,"h2"),Iw(3),Pw(4,"transloco"),Jc$1(),_D(5,Ut,7,3,"section",19),_D(6,Wt,2,1,"p",20),_i(7,"label",21)(8,"span"),Iw(9),Pw(10,"transloco"),Jc$1(),_i(11,"input",22),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onDisplayNameChange(i))}),Jc$1(),iE(),Jc$1(),_i(12,"label",23)(13,"span"),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"input",24),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onIdChange(i))}),Jc$1(),iE(),_i(17,"p",25),Iw(18),Pw(19,"transloco"),Jc$1()(),_i(20,"div",21)(21,"span"),Iw(22),Pw(23,"transloco"),Jc$1(),_i(24,"nz-select",26),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onTypeChange(i))}),xD(25,Zt,2,4,"nz-option",27,ee),Jc$1(),iE(),Jc$1(),xD(27,Ht,5,5,"label",21,Pt),_i(29,"label",21)(30,"span"),Iw(31),Pw(32,"transloco"),Jc$1(),_i(33,"div",28)(34,"input",29),Pw(35,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setSecretValue(i))}),Jc$1(),iE(),_D(36,Qt,3,5,"button",30),_D(37,Gt,3,5,"button",31),Jc$1(),_D(38,Yt,5,5,"div",32),Jc$1(),_D(39,ii,26,23),_i(40,"label",21)(41,"span"),Iw(42),Pw(43,"transloco"),Jc$1(),_i(44,"input",33),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setExpiresOn(i))}),Jc$1(),iE(),_i(45,"p",25),Iw(46),Pw(47,"transloco"),Jc$1()(),_i(48,"div",34)(49,"button",35),mh("click",function(){Fu(e);let i=HD();return ju(i.closeModal())}),Iw(50),Pw(51,"transloco"),Jc$1(),_i(52,"button",36),mh("click",function(){Fu(e);let i=HD();return ju(i.saveModal())}),Iw(53),Pw(54,"transloco"),Jc$1()()()();}if(n&2){let e,t=HD();gI(3),rl$1(" ",Fw(4,23,t.draft().originalId?"settings.editProvider":"settings.addProvider")," "),gI(2),MD(t.validationErrors().length>0?5:-1),gI(),MD(t.secretSaveError()?6:-1),gI(3),Lh(Fw(10,25,"settings.displayName")),gI(2),lh("ngModel",t.draft().displayName),aE(),gI(3),Lh(Fw(15,27,"settings.instanceId")),gI(2),lh("ngModel",t.draft().id),aE(),gI(2),Lh(Fw(19,29,"settings.instanceIdHint")),gI(4),Lh(Fw(23,31,"settings.type.label")),gI(2),lh("ngModel",t.draft().optionId),aE(),gI(),AD(t.typeOptions),gI(2),AD(t.configFields(t.draft().type)),gI(4),Lh(Fw(32,33,"settings.apiKey.label")),gI(3),lh("ngModel",t.draft().secretValue)("placeholder",Fw(35,35,t.draft().originalId?"settings.apiKey.placeholderEdit":"settings.apiKey.placeholderCreate")),aE(),gI(2),MD(t.draft().kind==="agent"?36:-1),gI(),MD(t.supportsTestConnection(t.draft().type)?37:-1),gI(),MD((e=t.modalTestResult())?38:-1,e),gI(),MD(t.draft().kind==="agent"?39:-1),gI(3),Lh(Fw(43,37,"settings.expiresOn.label")),gI(2),lh("ngModel",t.draft().expiresOn),aE(),gI(2),Lh(Fw(47,39,"settings.expiresOn.hint")),gI(4),rl$1(" ",Fw(51,41,"common.cancel")," "),gI(2),lh("nzLoading",t.saving()),gI(),rl$1(" ",Fw(54,43,"common.save")," ");}}var Xi=(()=>{class n{constructor(){this.api=C(D),this.providersApi=C(B),this.message=C(He),this.destroyRef=C(at),this.transloco=C(Ve),this.loaded=qo({providerInstances:[]}),this.status=qo([]),this.draft=qo(L()),this.loading=qo(true),this.saving=qo(false),this.loadError=qo(null),this.validationErrors=qo([]),this.secretSaveError=qo(null),this.restartRequired=qo(false),this.modalOpen=qo(false),this.availableModels=qo([]),this.fetchingModels=qo(false),this.modelsError=qo(null),this.listTests=qo({}),this.modalTestRunning=qo(false),this.modalTestResult=qo(null),this.instances=Uw(()=>this.loaded().providerInstances??[]),this.typeOptions=h,this.configFields=v,this.typeLabelKey=H,this.isAgent=I_,this.supportsTestConnection=k_,Ng({settings:this.api.getSettings(),status:this.api.getProviderStatus()}).pipe(ue(this.destroyRef)).subscribe({next:({settings:e,status:t})=>{this.applySettings(e,false),this.status.set(t),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("settings.loadFailed")));}});}configValue(e,t){let i=e[t];return typeof i=="string"?i:""}isDefaultAgent(e){return I_(e)&&this.loaded().defaultAgentInstanceId===e.id}selectedModelMissingFromList(){let e=this.configValue(this.draft().config,"model");return e?!this.availableModels().some(t=>t.id===e):false}canFetchModels(){let e=this.draft();return e.kind==="agent"&&(e.secretValue.trim().length>0||e.originalId!=null)}canTestConnection(){let e=this.draft();return k_(e.type)&&(e.secretValue.trim().length>0||e.originalId!=null)}listTestState(e){return this.listTests()[e]}testResultTone(e){return e.identityMismatch?"warning":e.success?"success":"error"}testResultLabelKey(e){return e.identityMismatch?"settings.testConnection.mismatch":e.success?"settings.testConnection.connected":"settings.testConnection.failed"}openCreate(){this.resetModal(L());}openEdit(e){this.resetModal(Q(e,this.isDefaultAgent(e)));}closeModal(){this.modalOpen.set(false);}onDisplayNameChange(e){this.draft.update(t=>G(t,e,this.existingIds(t)));}onIdChange(e){this.draft.update(t=>J(t,e));}onTypeChange(e){this.availableModels.set([]),this.modelsError.set(null),this.modalTestResult.set(null),this.draft.update(t=>{let i=Y(t,e);return i.kind!=="agent"||t.kind==="agent"?i:s(r$1({},i),{defaultAgent:this.shouldDefaultNewAgent(t)})});}setDraftConfig(e,t){this.draft.update(i=>s(r$1({},i),{config:s(r$1({},i.config),{[e]:t})}));}setSecretValue(e){this.draft.update(t=>s(r$1({},t),{secretValue:e}));}setExpiresOn(e){this.draft.update(t=>s(r$1({},t),{expiresOn:e}));}setDefaultAgentDraft(e){this.draft.update(t=>s(r$1({},t),{defaultAgent:e}));}setMaxConcurrent(e){let t=typeof e=="number"?e:Number(e),i=Number.isFinite(t)&&t>=1?Math.floor(t):1;this.draft.update(s$1=>s(r$1({},s$1),{maxConcurrent:i}));}fetchModels(){let e=this.draft();if(e.kind!=="agent"||!this.canFetchModels())return;let t=e.secretValue.trim();this.fetchingModels.set(true),this.modelsError.set(null),this.providersApi.previewModels(t?{type:e.type,apiKey:t}:{type:e.type,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.availableModels.set(i),this.fetchingModels.set(false);},error:i=>{this.fetchingModels.set(false),this.modelsError.set(this.errorMessage(i,this.transloco.translate("settings.model.fetchFailed")));}});}testSavedConnection(e){k_(e.type)&&(this.listTests()[e.id]?.running||(this.listTests.update(t=>s(r$1({},t),{[e.id]:{running:true,result:t[e.id]?.result}})),this.api.testProviderConnection(e.id).pipe(ue(this.destroyRef)).subscribe({next:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:t}}));},error:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:{success:false,message:this.errorMessage(t,this.transloco.translate("settings.testConnection.failed"))}}}));}})));}testDraftConnection(){let e=this.draft();if(!this.canTestConnection()||this.modalTestRunning())return;let t=e.secretValue.trim();this.modalTestRunning.set(true),this.modalTestResult.set(null),this.providersApi.testConnection(t?{type:e.type,config:e.config,apiKey:t}:{type:e.type,config:e.config,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.modalTestRunning.set(false),this.modalTestResult.set(i);},error:i=>{this.modalTestRunning.set(false),this.modalTestResult.set({success:false,message:this.errorMessage(i,this.transloco.translate("settings.testConnection.failed"))});}});}saveModal(){let e=this.draft();if(this.validationErrors.set([]),this.secretSaveError.set(null),!e.displayName.trim()){this.validationErrors.set([this.transloco.translate("settings.displayNameRequired")]);return}if(e.originalId==null&&!e.secretValue.trim()){this.validationErrors.set([this.transloco.translate("settings.apiKey.required")]);return}let t=tm.safeParse(X$1(e));if(!t.success){this.validationErrors.set(Z(t.error));return}this.saving.set(true);let i=t.data,s$1=i.kind==="agent"?{defaultAgent:e.defaultAgent}:{};(e.originalId==null?this.api.createProviderInstance(r$1(r$1({},i),s$1)):this.api.updateProviderInstance(e.originalId,r$1(r$1({displayName:i.displayName,config:i.config,secretKey:i.secretKey,expiresOn:i.expiresOn??null},i.kind==="agent"?{maxConcurrent:i.maxConcurrent}:{}),s$1))).pipe(Nl(D=>{this.applySettings(D.settings,D.restartRequired);let P=e.secretValue.trim();return P?this.api.setSecret(i.secretKey,P).pipe(Se(()=>({kind:"ok"})),es(vt=>Dg({kind:"secret-failed",err:vt}))):Dg({kind:"ok"})}),ue(this.destroyRef)).subscribe({next:D=>{if(this.saving.set(false),D.kind==="secret-failed"){this.draft.update(P=>s(r$1({},P),{originalId:i.id,id:i.id,idAutoSync:false,secretKey:i.secretKey})),this.secretSaveError.set(this.errorMessage(D.err,this.transloco.translate("settings.apiKey.setFailedAfterSave"))),this.refreshStatus();return}this.modalOpen.set(false),this.refreshStatus();},error:D=>{this.saving.set(false),this.message.error(this.errorMessage(D,this.transloco.translate("settings.saveFailed")));}});}removeInstance(e){this.api.deleteProviderInstance(e).subscribe({next:t=>this.applySettings(t.settings,t.restartRequired),error:t=>{this.message.error(this.errorMessage(t,this.transloco.translate("settings.saveFailed")));}});}resetModal(e){this.validationErrors.set([]),this.secretSaveError.set(null),this.availableModels.set([]),this.modelsError.set(null),this.fetchingModels.set(false),this.modalTestRunning.set(false),this.modalTestResult.set(null),this.draft.set(e),this.modalOpen.set(true);}shouldDefaultNewAgent(e){return e.originalId&&e.originalId===this.loaded().defaultAgentInstanceId?true:!this.loaded().defaultAgentInstanceId}existingIds(e){return this.instances().map(t=>t.id).filter(t=>t!==e.originalId)}applySettings(e,t){let i=e.providerInstances??[];this.loaded.set(r$1({providerInstances:i},e.defaultAgentInstanceId?{defaultAgentInstanceId:e.defaultAgentInstanceId}:{})),t&&this.restartRequired.set(true);}refreshStatus(){this.api.getProviderStatus().subscribe({next:e=>this.status.set(e),error:()=>{}});}errorMessage(e,t){return e instanceof bi||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||n)};}static{this.\u0275cmp=ZE({type:n,selectors:[["app-settings"]],decls:17,vars:12,consts:[["data-testid","settings-page",1,"settings"],[1,"header"],[1,"lede"],["nz-button","","nzType","primary","type","button","data-testid","add-provider",3,"click"],["data-testid","restart-required-banner"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","provider-instances",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","provider-modal",1,"modal-backdrop"],["nzType","warning","nzShowIcon","","nzBanner","",3,"nzMessage"],[1,"name-cell"],["nzColor","blue"],[1,"actions"],[1,"test-connection"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"],["nz-button","","nzType","link","type","button",3,"click","nzLoading","disabled"],[3,"nzColor"],["role","dialog",1,"modal-panel"],["data-testid","validation-errors",1,"errors"],["data-testid","secret-save-error",1,"error"],[1,"field"],["nz-input","","data-testid","provider-display-name",3,"ngModelChange","ngModel"],[1,"field","field-id"],["nz-input","","data-testid","provider-id",3,"ngModelChange","ngModel"],[1,"hint"],["data-testid","provider-type",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"api-key-row"],["nz-input","","type","password","autocomplete","off","data-testid","provider-api-key",3,"ngModelChange","ngModel","placeholder"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"nzLoading","disabled"],["data-testid","provider-test-result",1,"test-result-row"],["nz-input","","type","date","data-testid","provider-expires-on",3,"ngModelChange","ngModel"],[1,"modal-actions"],["nz-button","","type","button","data-testid","provider-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","provider-save",3,"click","nzLoading"],["nz-input","",3,"ngModelChange","ngModel"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"click","nzLoading","disabled"],["data-testid","provider-test-result-message",1,"test-result-message",3,"warning","error"],["data-testid","provider-test-result-message",1,"test-result-message"],["data-testid","provider-model","nzAllowClear","",3,"ngModelChange","nzPlaceHolder","ngModel"],["data-testid","provider-models-error",1,"error"],["nz-input","","type","number","min","1","step","1","data-testid","provider-max-concurrent",3,"ngModelChange","ngModel"],[1,"field","field-switch"],["data-testid","provider-default-agent",3,"ngModelChange","ngModel"]],template:function(t,i){t&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"p",2),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"button",3),mh("click",function(){return i.openCreate()}),Iw(10),Pw(11,"transloco"),Jc$1()(),_D(12,Rt,3,3,"div",4),_D(13,At,3,3,"p",5)(14,Ft,2,1,"p",6)(15,qt,18,15,"nz-table",7),_D(16,ni,55,45,"div",8),Jc$1()),t&2&&(gI(4),Lh(Fw(5,6,"settings.title")),gI(3),Lh(Fw(8,8,"settings.lede")),gI(3),rl$1(" ",Fw(11,10,"settings.addProvider")," "),gI(2),MD(i.restartRequired()?12:-1),gI(),MD(i.loading()?13:i.loadError()?14:15),gI(3),MD(i.modalOpen()?16:-1));},dependencies:[$8,al,er,Jc,rl,Nc,$i,Gn,un,pf,bd,sp,fp,ai,z,_n,Cn,ex,Fm,Am,xt,X,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".settings[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.field-id[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace;font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.15rem .25rem}.test-connection[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem}.api-key-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.api-key-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:10rem}.test-result-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.4rem .6rem;margin-top:.45rem}.test-result-message[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#57534e;flex:1;min-width:12rem}.test-result-message.warning[_ngcontent-%COMP%]{color:#b45309}.test-result-message.error[_ngcontent-%COMP%]{color:#9f1239}.field-switch[_ngcontent-%COMP%]{flex-direction:row;align-items:center;justify-content:space-between}.modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:4rem 1rem 2rem;background:#1c191759}.modal-panel[_ngcontent-%COMP%]{width:min(32rem,100%);max-height:calc(100vh - 6rem);overflow:auto;background:#fff;border-radius:.5rem;padding:1.25rem 1.5rem 1.5rem;box-shadow:0 10px 30px #1c19172e}.modal-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.15rem}.modal-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}"]});}}return n})();export{Xi as ProvidersManageComponent,Xi as SettingsComponent};
package/static/index.html CHANGED
@@ -35,5 +35,5 @@
35
35
  <style>@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:400;src:url("./media/inter-latin-400-normal-55WT6UWF.woff2") format("woff2"),url("./media/inter-latin-400-normal-FR5HOXA4.woff") format("woff")}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:500;src:url("./media/inter-latin-500-normal-W62DVTXI.woff2") format("woff2"),url("./media/inter-latin-500-normal-ZNGIZ2YB.woff") format("woff")}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:600;src:url("./media/inter-latin-600-normal-R6Y2SZCR.woff2") format("woff2"),url("./media/inter-latin-600-normal-ZYHV6QZT.woff") format("woff")}html,body,app-root{height:100%;margin:0}body{font-family:Inter,sans-serif;overflow:hidden}:root{--app-chrome-height:56px}</style><link rel="stylesheet" href="styles-JGCTKGGH.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-JGCTKGGH.css"></noscript></head>
36
36
  <body>
37
37
  <app-root></app-root>
38
- <script src="polyfills-YMBILSHJ.js" type="module"></script><script src="main-CHQMTVIP.js" type="module"></script></body>
38
+ <script src="polyfills-YMBILSHJ.js" type="module"></script><script src="main-CL3L2RPE.js" type="module"></script></body>
39
39
  </html>