@whoz-oss/coday-client 3.38.1 → 3.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/browser/{chunk-BEyVaXZw.js → chunk-3MJ0Ti-Y.js} +1 -1
  2. package/browser/{chunk-CZnAfJLi.js → chunk-4vQbg-kA.js} +1 -1
  3. package/browser/{chunk-CN3KNQgA.js → chunk-5-BfZrei.js} +1 -1
  4. package/browser/{chunk-T9MQYUti.js → chunk-60gXvpj7.js} +1 -1
  5. package/browser/{chunk-CZX7oIFo.js → chunk-7o_oifdY.js} +1 -1
  6. package/browser/{chunk-CaDoTva_.js → chunk-9KnP21So.js} +1 -1
  7. package/browser/{chunk-DH0Wajw-.js → chunk-9jrJS3EM.js} +1 -1
  8. package/browser/{chunk-c97Xd1e7.js → chunk-B2equFW3.js} +1 -1
  9. package/browser/{chunk-D8dx7NVM.js → chunk-B7ukmyeI.js} +1 -1
  10. package/browser/{chunk-CLWw22I9.js → chunk-B9YlDOE0.js} +1 -1
  11. package/browser/{chunk-CbcSBfFf.js → chunk-BBEQptGI.js} +1 -1
  12. package/browser/{chunk-DhcPza6a.js → chunk-BBIzym9V.js} +1 -1
  13. package/browser/{chunk-BogUaEol.js → chunk-BEq2BNXS.js} +1 -1
  14. package/browser/{chunk-BOKt4fd5.js → chunk-BJ-7nYj4.js} +1 -1
  15. package/browser/{chunk-7fOouIuV.js → chunk-BLZrsqKB.js} +1 -1
  16. package/browser/{chunk-BgfJqF1A.js → chunk-BLnXkEkq.js} +1 -1
  17. package/browser/{chunk-BliPTf4E.js → chunk-BRwiSXXI.js} +1 -1
  18. package/browser/{chunk-YYvEFXGq.js → chunk-BSrsNU1V.js} +1 -1
  19. package/browser/{chunk-EqErt3Qp.js → chunk-BVcRoz1R.js} +1 -1
  20. package/browser/{chunk-qvvMVV4R.js → chunk-BXTkwOIw.js} +1 -1
  21. package/browser/{chunk-DdWPZGlK.js → chunk-BlCbDw3M.js} +1 -1
  22. package/browser/{chunk-04MJH5Yd.js → chunk-BoftpnzR.js} +1 -1
  23. package/browser/{chunk-XCnsR8xQ.js → chunk-By9sOwdI.js} +1 -1
  24. package/browser/{chunk-13MxRt1O.js → chunk-C2o5oyLK.js} +1 -1
  25. package/browser/chunk-C3Z37bhY.js +1 -0
  26. package/browser/{chunk-BM16b3cR.js → chunk-C3yr8nng.js} +1 -1
  27. package/browser/{chunk-DHxop1LM.js → chunk-C64Jkhq7.js} +1 -1
  28. package/browser/{chunk-BpSy6uuY.js → chunk-CD-fmXp6.js} +1 -1
  29. package/browser/{chunk-BD6_mt1u.js → chunk-CKerTqPB.js} +1 -1
  30. package/browser/{chunk-CJKZzhHn.js → chunk-CLrqVyKV.js} +1 -1
  31. package/browser/{chunk-DVnyaJID.js → chunk-CNfbdufX.js} +1 -1
  32. package/browser/{chunk-CFGJRCis.js → chunk-CaqvmGfj.js} +1 -1
  33. package/browser/{chunk-LGOMM3nw.js → chunk-CcPXJDXB.js} +1 -1
  34. package/browser/{chunk-BgTxjRff.js → chunk-ChWkcamF.js} +1 -1
  35. package/browser/chunk-CoCuHv7l.js +10 -0
  36. package/browser/{chunk-DQYAeiwD.js → chunk-CokSGPE-.js} +1 -1
  37. package/browser/{chunk-ChthFlqY.js → chunk-D-4BeiMh.js} +1 -1
  38. package/browser/{chunk-H43Ph-fP.js → chunk-D3O3jhyf.js} +1 -1
  39. package/browser/{chunk-Byp1xSWS.js → chunk-D44Hstdr.js} +1 -1
  40. package/browser/{chunk-MBkyLOjF.js → chunk-D61dnrnW.js} +1 -1
  41. package/browser/{chunk-CGSah2dx.js → chunk-DDA1zBuS.js} +1 -1
  42. package/browser/{chunk-CMpdXBSy.js → chunk-DF0xzSR2.js} +1 -1
  43. package/browser/{chunk-BOYF_Klp.js → chunk-DG0P1FqD.js} +1 -1
  44. package/browser/{chunk-C_Msy9y8.js → chunk-DGLDAyz5.js} +1 -1
  45. package/browser/{chunk-Bwge_nZo.js → chunk-DOBQKEJe.js} +1 -1
  46. package/browser/{chunk-CtudezKL.js → chunk-DPT7oOdT.js} +1 -1
  47. package/browser/{chunk-DSIStEbo.js → chunk-DRgqn-qP.js} +1 -1
  48. package/browser/{chunk-C3VwqpzN.js → chunk-DTUH09cB.js} +1 -1
  49. package/browser/{chunk-cmwHo6Es.js → chunk-DW9fvBt1.js} +1 -1
  50. package/browser/{chunk-D8of8ooh.js → chunk-DXHmG3oR.js} +1 -1
  51. package/browser/{chunk-C6EpqMLM.js → chunk-DXQp0AEx.js} +1 -1
  52. package/browser/{chunk-Cwvsyr83.js → chunk-DZTUBsFJ.js} +1 -1
  53. package/browser/{chunk-_Lwb2hwD.js → chunk-D_Vfha6R.js} +1 -1
  54. package/browser/{chunk-XhAOLq1L.js → chunk-DcEzmA4h.js} +1 -1
  55. package/browser/{chunk-Ca9T3_t5.js → chunk-Dh18q-Lc.js} +1 -1
  56. package/browser/{chunk-BqEn27y2.js → chunk-Dq_UNbZ5.js} +1 -1
  57. package/browser/{chunk-C3pgalZd.js → chunk-Dz7HwY8x.js} +1 -1
  58. package/browser/{chunk-B4kiiSgV.js → chunk-OASPCvWB.js} +1 -1
  59. package/browser/{chunk-wi-CxI3Z.js → chunk-Rs6cK9ku.js} +1 -1
  60. package/browser/{chunk-BG8qY3j-.js → chunk-T5M7kuTl.js} +1 -1
  61. package/browser/{chunk-Dkm7iGL9.js → chunk-W9kY_24O.js} +1 -1
  62. package/browser/{chunk-fP8U5olb.js → chunk-WjMW0pJz.js} +1 -1
  63. package/browser/{chunk-0x13ysen.js → chunk-Y9ehAR_-.js} +1 -1
  64. package/browser/{chunk-CHx25z-u.js → chunk-ZzSo4P1K.js} +1 -1
  65. package/browser/{chunk-BT67CQFK.js → chunk-fauRGNCQ.js} +1 -1
  66. package/browser/{chunk-DKgoxuom.js → chunk-gsN8nQ-0.js} +1 -1
  67. package/browser/{chunk-CEsA7CZw.js → chunk-kA4lPIPM.js} +1 -1
  68. package/browser/{chunk-BIgSE_ha.js → chunk-rqxXWZv_.js} +1 -1
  69. package/browser/{chunk-CakrWWjO.js → chunk-tLYPS8qt.js} +1 -1
  70. package/browser/{chunk-Dtabpp8Q.js → chunk-zax44XIK.js} +1 -1
  71. package/browser/{chunk-iXx4FJpq.js → chunk-zzUvCUec.js} +1 -1
  72. package/browser/index.html +1 -1
  73. package/browser/{main-5YX2WY5Q.js → main-YUNT4ZXI.js} +3 -3
  74. package/package.json +1 -1
  75. package/browser/chunk-CNYFTG-c.js +0 -1
  76. package/browser/chunk-CP8bTPZX.js +0 -10
@@ -1,4 +1,4 @@
1
- import {N as Ne,u as ui$1,a as me,f as fi$1,Y as Yt,V as Ve$1,n as ne}from'./chunk-BpSy6uuY.js';import {g,az as Xt,aR as Fs,aZ as js,al as vt,e as xw,S as Sg,k as ws,t as rC,o as pl,u as CC,v as bg,X as XE,z as oC,D as Pg,E as EC,I as IC,j as Gn$1,q as Rg,n as GC,b$ as kC,T as Tg,a8 as Yg,O as Ot,C as Ce,cK as YB,cb as ZB,a as Gi$1,m as mT,b as U,bA as yC,bB as vC,ad as Hg,A as Ug,aw as hl,b6 as _g,ax as gl,J as Jw,y as eC,cc as qB,cr as QB,cd as Hf,cv as jg,cw as wC,ce as _b,af as Eg,an as ue,cL as vd,cM as _d,bS as va$1,W as br$1,cJ as Og,c0 as xg,cN as kn,aL as wo$1,aM as Zn$1,br as sn,bD as ge,aO as wt$1,bE as vt$1,bs as Tl,bL as pe,aS as K,cO as us,w,aT as Ut,cP as Bt,bR as Id,bP as Wy,bu as Ve,c2 as ME,x,a_ as QT,bI as Ig,b5 as nT,aW as C,bv as Fg,aV as U$1,bw as St,aX as D,bx as on,bz as Oi$1,bF as J,cQ as q,cR as X,ac as gC,a9 as lC,aa as If,ab as wf,a5 as vl,cS as Yt$1,cT as Gp,bM as mr,aP as G,ae as kt,aA as an,bW as Y,cU as pi,cV as vg,aC as Tu,by as um,cB as on$1,c8 as KT,ah as rT,a4 as nC,c9 as kf,bt as Qn$2,ap as wd,bX as Pt,bZ as X$1,b_ as xt,cW as ZI,cD as Te,a3 as VI,a6 as UI,bo as tC,c3 as kt$1,bJ as dr,a$ as XC,b4 as oT,b0 as Qg,ch as Ng,cX as yr$1,cY as tt$1,aY as ft$1,cz as to$1,ag as fT}from'./main-5YX2WY5Q.js';import {w as wt,j as Yn$1,k as _t$1,n as ni,l as Xn$1,E as En,z as ze$1,Q as Qn$1,e as ei,Y as Ye,f as fn,a as wt$2,A as At,Z as Zn$2,C as Cn}from'./chunk-wi-CxI3Z.js';var ii=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],oi=["mat-icon, [matMenuItemIcon]","*"];function ai(n,i){n&1&&(kf(),ws(0,"svg",2),Sg(1,"polygon",3),pl());}var ri=["*"];function si(n,i){if(n&1){let e=lC();hl(0,"div",0),Og("click",function(){If(e);let o=gC();return wf(o.closed.emit("click"))})("animationstart",function(o){If(e);let a=gC();return wf(a._onAnimationStart(o.animationName))})("animationend",function(o){If(e);let a=gC();return wf(a._onAnimationDone(o.animationName))})("animationcancel",function(o){If(e);let a=gC();return wf(a._onAnimationDone(o.animationName))}),hl(1,"div",1),vC(2),gl()();}if(n&2){let e=gC();kC(e._classList),Ug("mat-menu-panel-animations-disabled",e._animationsDisabled)("mat-menu-panel-exit-animation",e._panelAnimationState==="void")("mat-menu-panel-animating",e._isAnimating()),xg("id",e.panelId),Tg("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby||null)("aria-describedby",e.ariaDescribedby||null);}}var pt=new C("MAT_MENU_PANEL"),ze=(()=>{class n{_elementRef=g(Xt);_document=g(U$1);_focusMonitor=g(St);_parentMenu=g(pt,{optional:true});_changeDetectorRef=g(Tl);role="menuitem";disabled=false;disableRipple=false;_hovered=new ue;_focused=new ue;_highlighted=false;_triggersSubmenu=false;constructor(){g(D).load(on),this._parentMenu?.addItem?.(this);}focus(e,t){this._focusMonitor&&e?this._focusMonitor.focusVia(this._getHostElement(),e,t):this._getHostElement().focus(t),this._focused.next(this);}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,false);}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete();}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(e){this.disabled&&(e.preventDefault(),e.stopPropagation());}_handleMouseEnter(){this._hovered.next(this);}getLabel(){let e=this._elementRef.nativeElement.cloneNode(true),t=e.querySelectorAll("mat-icon, .material-icons");for(let o=0;o<t.length;o++)t[o].remove();return e.textContent?.trim()||""}_setHighlighted(e){this._highlighted=e,this._changeDetectorRef.markForCheck();}_setTriggersSubmenu(e){this._triggersSubmenu=e,this._changeDetectorRef.markForCheck();}_hasFocus(){return this._document&&this._document.activeElement===this._getHostElement()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=xw({type:n,selectors:[["","mat-menu-item",""]],hostAttrs:[1,"mat-mdc-menu-item","mat-focus-indicator"],hostVars:8,hostBindings:function(t,o){t&1&&Rg("click",function(m){return o._checkDisabled(m)})("mouseenter",function(){return o._handleMouseEnter()}),t&2&&(Tg("role",o.role)("tabindex",o._getTabIndex())("aria-disabled",o.disabled)("disabled",o.disabled||null),Ug("mat-mdc-menu-item-highlighted",o._highlighted)("mat-mdc-menu-item-submenu-trigger",o._triggersSubmenu));},inputs:{role:"role",disabled:[2,"disabled","disabled",QT],disableRipple:[2,"disableRipple","disableRipple",QT]},exportAs:["matMenuItem"],ngContentSelectors:oi,decls:5,vars:3,consts:[[1,"mat-mdc-menu-item-text"],["matRipple","",1,"mat-mdc-menu-ripple",3,"matRippleDisabled","matRippleTrigger"],["viewBox","0 0 5 10","focusable","false","aria-hidden","true",1,"mat-mdc-menu-submenu-icon"],["points","0,0 5,5 0,10"]],template:function(t,o){t&1&&(yC(ii),vC(0),ws(1,"span",0),vC(2,1),pl(),Sg(3,"div",1),Jw(4,ai,2,0,":svg:svg",2)),t&2&&(XE(3),bg("matRippleDisabled",o.disableRipple||o.disabled)("matRippleTrigger",o._getHostElement()),XE(),eC(o._triggersSubmenu?4:-1));},dependencies:[Oi$1],encapsulation:2})}return n})();var Sn=new C("MatMenuContent"),va=(()=>{class n{_template=g(dr);_appRef=g(yr$1);_injector=g(pe);_viewContainerRef=g(mr);_document=g(U$1);_changeDetectorRef=g(Tl);_portal;_outlet;_attached=new ue;attach(e={}){this._portal||(this._portal=new Y(this._template,this._viewContainerRef)),this.detach(),this._outlet||(this._outlet=new tt$1(this._document.createElement("div"),this._appRef,this._injector));let t=this._template.elementRef.nativeElement;t.parentNode.insertBefore(this._outlet.outletElement,t),this._changeDetectorRef.markForCheck(),this._portal.attach(this._outlet,e),this._attached.next();}detach(){this._portal?.isAttached&&this._portal.detach();}ngOnDestroy(){this.detach(),this._outlet?.dispose();}static \u0275fac=function(t){return new(t||n)};static \u0275dir=js({type:n,selectors:[["ng-template","matMenuContent",""]],features:[nT([{provide:Sn,useExisting:n}])]})}return n})(),li=new C("mat-menu-default-options",{providedIn:"root",factory:()=>({overlapTrigger:false,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"})}),mt="_mat-menu-enter",et="_mat-menu-exit",Ee=(()=>{class n{_elementRef=g(Xt);_changeDetectorRef=g(Tl);_injector=g(pe);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled=K();_allItems;_directDescendantItems=new us;_classList={};_panelAnimationState="void";_animationDone=new ue;_isAnimating=Gi$1(false);parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(e){this._xPosition=e,this.setPositionClasses();}get yPosition(){return this._yPosition}set yPosition(e){this._yPosition=e,this.setPositionClasses();}templateRef;items;lazyContent;overlapTrigger=false;hasBackdrop;get panelClass(){return this._previousPanelClass}set panelClass(e){let t=this._previousPanelClass,o=w({},this._classList);t&&t.length&&t.split(" ").forEach(a=>{o[a]=false;}),this._previousPanelClass=e,e&&e.length&&(e.split(" ").forEach(a=>{o[a]=true;}),this._elementRef.nativeElement.className=""),this._classList=o;}_previousPanelClass="";get classList(){return this.panelClass}set classList(e){this.panelClass=e;}closed=new vt;close=this.closed;panelId=g(Ut).getId("mat-menu-panel-");constructor(){let e=g(li);this.overlayPanelClass=e.overlayPanelClass||"",this._xPosition=e.xPosition,this._yPosition=e.yPosition,this.backdropClass=e.backdropClass,this.overlapTrigger=e.overlapTrigger,this.hasBackdrop=e.hasBackdrop;}ngOnInit(){this.setPositionClasses();}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new Bt(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(Id(this._directDescendantItems),va$1(e=>Wy(...e.map(t=>t._focused)))).subscribe(e=>this._keyManager.updateActiveItem(e)),this._directDescendantItems.changes.subscribe(e=>{let t=this._keyManager;if(this._panelAnimationState==="enter"&&t.activeItem?._hasFocus()){let o=e.toArray(),a=Math.max(0,Math.min(o.length-1,t.activeItemIndex||0));o[a]&&!o[a].disabled?t.setActiveItem(a):t.setNextItemActive();}});}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout);}_hovered(){return this._directDescendantItems.changes.pipe(Id(this._directDescendantItems),va$1(t=>Wy(...t.map(o=>o._hovered))))}addItem(e){}removeItem(e){}_handleKeydown(e){let t=e.keyCode,o=this._keyManager;switch(t){case 27:Ve(e)||(e.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&this.direction==="ltr"&&this.closed.emit("keydown");break;case 39:this.parentMenu&&this.direction==="rtl"&&this.closed.emit("keydown");break;default:(t===38||t===40)&&o.setFocusOrigin("keyboard"),o.onKeydown(e);return}}focusFirstItem(e="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=ME(()=>{let t=this._resolvePanel();if(!t||!t.contains(document.activeElement)){let o=this._keyManager;o.setFocusOrigin(e).setFirstItemActive(),!o.activeItem&&t&&t.focus();}},{injector:this._injector});}resetActiveItem(){this._keyManager.setActiveItem(-1);}setElevation(e){}setPositionClasses(e=this.xPosition,t=this.yPosition){this._classList=x(w({},this._classList),{"mat-menu-before":e==="before","mat-menu-after":e==="after","mat-menu-above":t==="above","mat-menu-below":t==="below"}),this._changeDetectorRef.markForCheck();}_onAnimationDone(e){let t=e===et;(t||e===mt)&&(t&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(t?"void":"enter"),this._isAnimating.set(false));}_onAnimationStart(e){(e===mt||e===et)&&this._isAnimating.set(true);}_setIsOpen(e){if(this._panelAnimationState=e?"enter":"void",e){if(this._keyManager.activeItemIndex===0){let t=this._resolvePanel();t&&(t.scrollTop=0);}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(et),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(e?mt:et);}),this._changeDetectorRef.markForCheck();}_updateDirectDescendants(){this._allItems.changes.pipe(Id(this._allItems)).subscribe(e=>{this._directDescendantItems.reset(e.filter(t=>t._parentMenu===this)),this._directDescendantItems.notifyOnChanges();});}_resolvePanel(){let e=null;return this._directDescendantItems.length&&(e=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),e}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=xw({type:n,selectors:[["mat-menu"]],contentQueries:function(t,o,a){if(t&1&&Fg(a,Sn,5)(a,ze,5)(a,ze,4),t&2){let m;EC(m=IC())&&(o.lazyContent=m.first),EC(m=IC())&&(o._allItems=m),EC(m=IC())&&(o.items=m);}},viewQuery:function(t,o){if(t&1&&Pg(dr,5),t&2){let a;EC(a=IC())&&(o.templateRef=a.first);}},hostVars:3,hostBindings:function(t,o){t&2&&Tg("aria-label",null)("aria-labelledby",null)("aria-describedby",null);},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",QT],hasBackdrop:[2,"hasBackdrop","hasBackdrop",e=>e==null?null:QT(e)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[nT([{provide:pt,useExisting:n}])],ngContentSelectors:ri,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(t,o){t&1&&(yC(),Ig(0,si,3,12,"ng-template"));},styles:[`mat-menu {
1
+ import {N as Ne,u as ui$1,a as me,f as fi$1,Y as Yt,V as Ve$1,n as ne}from'./chunk-CD-fmXp6.js';import {g,az as Xt,aR as Fs,aZ as js,al as vt,e as xw,S as Sg,k as ws,t as rC,o as pl,u as CC,v as bg,X as XE,z as oC,D as Pg,E as EC,I as IC,j as Gn$1,q as Rg,n as GC,b$ as kC,T as Tg,a8 as Yg,O as Ot,C as Ce,cK as YB,cb as ZB,a as Gi$1,m as mT,b as U,bA as yC,bB as vC,ad as Hg,A as Ug,cc as qB,cr as QB,cd as Hf,J as Jw,y as eC,cv as jg,cw as wC,aw as hl,b6 as _g,ax as gl,ce as _b,af as Eg,an as ue,cL as vd,cM as _d,bS as va$1,W as br$1,cJ as Og,c0 as xg,cN as kn,aL as wo$1,aM as Zn$1,br as sn,bD as ge,aO as wt$1,bE as vt$1,bs as Tl,bL as pe,aS as K,cO as us,w,aT as Ut,cP as Bt,bR as Id,bP as Wy,bu as Ve,c2 as ME,x,a_ as QT,bI as Ig,b5 as nT,aW as C,bv as Fg,aV as U$1,bw as St,aX as D,bx as on,bz as Oi$1,bF as J,cQ as q,cR as X,a9 as lC,aa as If,ac as gC,ab as wf,a5 as vl,cS as Yt$1,cT as Gp,bM as mr,aP as G,ae as kt,aA as an,bW as Y,cU as pi,cV as vg,aC as Tu,by as um,cB as on$1,c8 as KT,ah as rT,a4 as nC,c9 as kf,bt as Qn$2,ap as wd,bX as Pt,bZ as X$1,b_ as xt,cW as ZI,cD as Te,a3 as VI,a6 as UI,bo as tC,c3 as kt$1,bJ as dr,a$ as XC,b4 as oT,b0 as Qg,ch as Ng,cX as yr$1,cY as tt$1,aY as ft$1,cz as to$1,ag as fT}from'./main-YUNT4ZXI.js';import {w as wt,j as Yn$1,k as _t$1,n as ni,l as Xn$1,E as En,z as ze$1,Q as Qn$1,e as ei,Y as Ye,f as fn,a as wt$2,A as At,Z as Zn$2,C as Cn}from'./chunk-Rs6cK9ku.js';var ii=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],oi=["mat-icon, [matMenuItemIcon]","*"];function ai(n,i){n&1&&(kf(),ws(0,"svg",2),Sg(1,"polygon",3),pl());}var ri=["*"];function si(n,i){if(n&1){let e=lC();hl(0,"div",0),Og("click",function(){If(e);let o=gC();return wf(o.closed.emit("click"))})("animationstart",function(o){If(e);let a=gC();return wf(a._onAnimationStart(o.animationName))})("animationend",function(o){If(e);let a=gC();return wf(a._onAnimationDone(o.animationName))})("animationcancel",function(o){If(e);let a=gC();return wf(a._onAnimationDone(o.animationName))}),hl(1,"div",1),vC(2),gl()();}if(n&2){let e=gC();kC(e._classList),Ug("mat-menu-panel-animations-disabled",e._animationsDisabled)("mat-menu-panel-exit-animation",e._panelAnimationState==="void")("mat-menu-panel-animating",e._isAnimating()),xg("id",e.panelId),Tg("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby||null)("aria-describedby",e.ariaDescribedby||null);}}var pt=new C("MAT_MENU_PANEL"),ze=(()=>{class n{_elementRef=g(Xt);_document=g(U$1);_focusMonitor=g(St);_parentMenu=g(pt,{optional:true});_changeDetectorRef=g(Tl);role="menuitem";disabled=false;disableRipple=false;_hovered=new ue;_focused=new ue;_highlighted=false;_triggersSubmenu=false;constructor(){g(D).load(on),this._parentMenu?.addItem?.(this);}focus(e,t){this._focusMonitor&&e?this._focusMonitor.focusVia(this._getHostElement(),e,t):this._getHostElement().focus(t),this._focused.next(this);}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,false);}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete();}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(e){this.disabled&&(e.preventDefault(),e.stopPropagation());}_handleMouseEnter(){this._hovered.next(this);}getLabel(){let e=this._elementRef.nativeElement.cloneNode(true),t=e.querySelectorAll("mat-icon, .material-icons");for(let o=0;o<t.length;o++)t[o].remove();return e.textContent?.trim()||""}_setHighlighted(e){this._highlighted=e,this._changeDetectorRef.markForCheck();}_setTriggersSubmenu(e){this._triggersSubmenu=e,this._changeDetectorRef.markForCheck();}_hasFocus(){return this._document&&this._document.activeElement===this._getHostElement()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=xw({type:n,selectors:[["","mat-menu-item",""]],hostAttrs:[1,"mat-mdc-menu-item","mat-focus-indicator"],hostVars:8,hostBindings:function(t,o){t&1&&Rg("click",function(m){return o._checkDisabled(m)})("mouseenter",function(){return o._handleMouseEnter()}),t&2&&(Tg("role",o.role)("tabindex",o._getTabIndex())("aria-disabled",o.disabled)("disabled",o.disabled||null),Ug("mat-mdc-menu-item-highlighted",o._highlighted)("mat-mdc-menu-item-submenu-trigger",o._triggersSubmenu));},inputs:{role:"role",disabled:[2,"disabled","disabled",QT],disableRipple:[2,"disableRipple","disableRipple",QT]},exportAs:["matMenuItem"],ngContentSelectors:oi,decls:5,vars:3,consts:[[1,"mat-mdc-menu-item-text"],["matRipple","",1,"mat-mdc-menu-ripple",3,"matRippleDisabled","matRippleTrigger"],["viewBox","0 0 5 10","focusable","false","aria-hidden","true",1,"mat-mdc-menu-submenu-icon"],["points","0,0 5,5 0,10"]],template:function(t,o){t&1&&(yC(ii),vC(0),ws(1,"span",0),vC(2,1),pl(),Sg(3,"div",1),Jw(4,ai,2,0,":svg:svg",2)),t&2&&(XE(3),bg("matRippleDisabled",o.disableRipple||o.disabled)("matRippleTrigger",o._getHostElement()),XE(),eC(o._triggersSubmenu?4:-1));},dependencies:[Oi$1],encapsulation:2})}return n})();var Sn=new C("MatMenuContent"),va=(()=>{class n{_template=g(dr);_appRef=g(yr$1);_injector=g(pe);_viewContainerRef=g(mr);_document=g(U$1);_changeDetectorRef=g(Tl);_portal;_outlet;_attached=new ue;attach(e={}){this._portal||(this._portal=new Y(this._template,this._viewContainerRef)),this.detach(),this._outlet||(this._outlet=new tt$1(this._document.createElement("div"),this._appRef,this._injector));let t=this._template.elementRef.nativeElement;t.parentNode.insertBefore(this._outlet.outletElement,t),this._changeDetectorRef.markForCheck(),this._portal.attach(this._outlet,e),this._attached.next();}detach(){this._portal?.isAttached&&this._portal.detach();}ngOnDestroy(){this.detach(),this._outlet?.dispose();}static \u0275fac=function(t){return new(t||n)};static \u0275dir=js({type:n,selectors:[["ng-template","matMenuContent",""]],features:[nT([{provide:Sn,useExisting:n}])]})}return n})(),li=new C("mat-menu-default-options",{providedIn:"root",factory:()=>({overlapTrigger:false,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"})}),mt="_mat-menu-enter",et="_mat-menu-exit",Ee=(()=>{class n{_elementRef=g(Xt);_changeDetectorRef=g(Tl);_injector=g(pe);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled=K();_allItems;_directDescendantItems=new us;_classList={};_panelAnimationState="void";_animationDone=new ue;_isAnimating=Gi$1(false);parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(e){this._xPosition=e,this.setPositionClasses();}get yPosition(){return this._yPosition}set yPosition(e){this._yPosition=e,this.setPositionClasses();}templateRef;items;lazyContent;overlapTrigger=false;hasBackdrop;get panelClass(){return this._previousPanelClass}set panelClass(e){let t=this._previousPanelClass,o=w({},this._classList);t&&t.length&&t.split(" ").forEach(a=>{o[a]=false;}),this._previousPanelClass=e,e&&e.length&&(e.split(" ").forEach(a=>{o[a]=true;}),this._elementRef.nativeElement.className=""),this._classList=o;}_previousPanelClass="";get classList(){return this.panelClass}set classList(e){this.panelClass=e;}closed=new vt;close=this.closed;panelId=g(Ut).getId("mat-menu-panel-");constructor(){let e=g(li);this.overlayPanelClass=e.overlayPanelClass||"",this._xPosition=e.xPosition,this._yPosition=e.yPosition,this.backdropClass=e.backdropClass,this.overlapTrigger=e.overlapTrigger,this.hasBackdrop=e.hasBackdrop;}ngOnInit(){this.setPositionClasses();}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new Bt(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(Id(this._directDescendantItems),va$1(e=>Wy(...e.map(t=>t._focused)))).subscribe(e=>this._keyManager.updateActiveItem(e)),this._directDescendantItems.changes.subscribe(e=>{let t=this._keyManager;if(this._panelAnimationState==="enter"&&t.activeItem?._hasFocus()){let o=e.toArray(),a=Math.max(0,Math.min(o.length-1,t.activeItemIndex||0));o[a]&&!o[a].disabled?t.setActiveItem(a):t.setNextItemActive();}});}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout);}_hovered(){return this._directDescendantItems.changes.pipe(Id(this._directDescendantItems),va$1(t=>Wy(...t.map(o=>o._hovered))))}addItem(e){}removeItem(e){}_handleKeydown(e){let t=e.keyCode,o=this._keyManager;switch(t){case 27:Ve(e)||(e.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&this.direction==="ltr"&&this.closed.emit("keydown");break;case 39:this.parentMenu&&this.direction==="rtl"&&this.closed.emit("keydown");break;default:(t===38||t===40)&&o.setFocusOrigin("keyboard"),o.onKeydown(e);return}}focusFirstItem(e="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=ME(()=>{let t=this._resolvePanel();if(!t||!t.contains(document.activeElement)){let o=this._keyManager;o.setFocusOrigin(e).setFirstItemActive(),!o.activeItem&&t&&t.focus();}},{injector:this._injector});}resetActiveItem(){this._keyManager.setActiveItem(-1);}setElevation(e){}setPositionClasses(e=this.xPosition,t=this.yPosition){this._classList=x(w({},this._classList),{"mat-menu-before":e==="before","mat-menu-after":e==="after","mat-menu-above":t==="above","mat-menu-below":t==="below"}),this._changeDetectorRef.markForCheck();}_onAnimationDone(e){let t=e===et;(t||e===mt)&&(t&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(t?"void":"enter"),this._isAnimating.set(false));}_onAnimationStart(e){(e===mt||e===et)&&this._isAnimating.set(true);}_setIsOpen(e){if(this._panelAnimationState=e?"enter":"void",e){if(this._keyManager.activeItemIndex===0){let t=this._resolvePanel();t&&(t.scrollTop=0);}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(et),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(e?mt:et);}),this._changeDetectorRef.markForCheck();}_updateDirectDescendants(){this._allItems.changes.pipe(Id(this._allItems)).subscribe(e=>{this._directDescendantItems.reset(e.filter(t=>t._parentMenu===this)),this._directDescendantItems.notifyOnChanges();});}_resolvePanel(){let e=null;return this._directDescendantItems.length&&(e=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),e}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=xw({type:n,selectors:[["mat-menu"]],contentQueries:function(t,o,a){if(t&1&&Fg(a,Sn,5)(a,ze,5)(a,ze,4),t&2){let m;EC(m=IC())&&(o.lazyContent=m.first),EC(m=IC())&&(o._allItems=m),EC(m=IC())&&(o.items=m);}},viewQuery:function(t,o){if(t&1&&Pg(dr,5),t&2){let a;EC(a=IC())&&(o.templateRef=a.first);}},hostVars:3,hostBindings:function(t,o){t&2&&Tg("aria-label",null)("aria-labelledby",null)("aria-describedby",null);},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",QT],hasBackdrop:[2,"hasBackdrop","hasBackdrop",e=>e==null?null:QT(e)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[nT([{provide:pt,useExisting:n}])],ngContentSelectors:ri,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(t,o){t&1&&(yC(),Ig(0,si,3,12,"ng-template"));},styles:[`mat-menu {
2
2
  display: none;
3
3
  }
4
4
 
@@ -1,4 +1,4 @@
1
- import {s as se}from'./chunk-CLWw22I9.js';import {a as Dr,q as qi,F as Fn,b as $i,h as ht,c as br$1,y as yr}from'./chunk-DSIStEbo.js';import {g,H as py,P,Y as x,aL as wo,aM as Zn,bD as ge,bE as vt,aO as wt,bs as Tl,az as Xt,aW as C,aS as K,bF as J,al as vt$1,aT as Ut,bG as p,bH as Pt,e as xw,a_ as QT,bA as yC,bI as Ig,b5 as nT,D as Pg,bJ as dr,E as EC,I as IC,bv as Fg,bK as fe,bL as pe,bM as mr,aP as G,bt as Qn,bN as F,aR as Fs,an as ue,O as Ot,bO as mt,bP as Wy,ae as kt$1,W as br,r as re,bQ as Gy,bR as Id,bS as va,aF as R$1,bu as Ve$1,bT as pn,bU as Od,bV as Zy,aA as an,bW as Y,bX as Pt$1,bY as po,bZ as X,b_ as xt,aZ as js,aC as Tu,q as Rg,T as Tg,aw as hl,bB as vC,ax as gl,ac as gC,b$ as kC,A as Ug,c0 as xg,c1 as E,c2 as ME,c3 as kt$2,bC as Si}from'./main-5YX2WY5Q.js';import {D}from'./chunk-wi-CxI3Z.js';var xe=class a{http=g(py);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(hl(0,"div",1,0),vC(2),gl()),a&2){let e=o.id,t=gC();kC(t._classList),Ug("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),xg("id",t.id),Tg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new C("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(Tl);_elementRef=g(Xt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=J.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new vt$1;opened=new vt$1;closed=new vt$1;optionActivated=new vt$1;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,Fn,5)(n,$i,5),t&2){let s;EC(s=IC())&&(i.options=s),EC(s=IC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Pg(dr,7)(Ke,5),t&2){let n;EC(n=IC())&&(i.template=n.first),EC(n=IC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",QT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",QT],requireSelection:[2,"requireSelection","requireSelection",QT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",QT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:qi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(yC(),Ig(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
1
+ import {s as se}from'./chunk-B9YlDOE0.js';import {a as Dr,q as qi,F as Fn,b as $i,h as ht,c as br$1,y as yr}from'./chunk-DRgqn-qP.js';import {g,H as py,P,Y as x,aL as wo,aM as Zn,bD as ge,bE as vt,aO as wt,bs as Tl,az as Xt,aW as C,aS as K,bF as J,al as vt$1,aT as Ut,bG as p,bH as Pt,e as xw,a_ as QT,bA as yC,bI as Ig,b5 as nT,D as Pg,bJ as dr,E as EC,I as IC,bv as Fg,bK as fe,bL as pe,bM as mr,aP as G,bt as Qn,bN as F,aR as Fs,an as ue,O as Ot,bO as mt,bP as Wy,ae as kt$1,W as br,r as re,bQ as Gy,bR as Id,bS as va,aF as R$1,bu as Ve$1,bT as pn,bU as Od,bV as Zy,aA as an,bW as Y,bX as Pt$1,bY as po,bZ as X,b_ as xt,aZ as js,aC as Tu,q as Rg,T as Tg,aw as hl,bB as vC,ax as gl,ac as gC,b$ as kC,A as Ug,c0 as xg,c1 as E,c2 as ME,c3 as kt$2,bC as Si}from'./main-YUNT4ZXI.js';import {D}from'./chunk-Rs6cK9ku.js';var xe=class a{http=g(py);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(hl(0,"div",1,0),vC(2),gl()),a&2){let e=o.id,t=gC();kC(t._classList),Ug("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),xg("id",t.id),Tg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new C("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(Tl);_elementRef=g(Xt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=J.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new vt$1;opened=new vt$1;closed=new vt$1;optionActivated=new vt$1;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,Fn,5)(n,$i,5),t&2){let s;EC(s=IC())&&(i.options=s),EC(s=IC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Pg(dr,7)(Ke,5),t&2){let n;EC(n=IC())&&(i.template=n.first),EC(n=IC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",QT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",QT],requireSelection:[2,"requireSelection","requireSelection",QT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",QT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:qi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(yC(),Ig(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
2
2
  width: 100%;
3
3
  max-height: 256px;
4
4
  visibility: hidden;
@@ -1 +1 @@
1
- import {g,H as py,W as br,bU as Od,r as re,Y as x}from'./main-5YX2WY5Q.js';var f=class s{http=g(py);agentsCache=new Map;getAgents(e){let t=this.agentsCache.get(e);return t?br(t):this.http.get(`/api/projects/${e}/agents`).pipe(Od(o=>{this.agentsCache.set(e,o);}))}getAgentsAutocomplete(e,t){return this.getAgents(e).pipe(re(o=>{if(!t)return o;let i=t.toLowerCase(),a=r=>{let n=r.name.toLowerCase();return n.startsWith(i)?0:n.includes(i)?1:2};return o.filter(r=>{let n=r.name.toLowerCase(),h=r.description?.toLowerCase()||"";return n.includes(i)||h.includes(i)}).sort((r,n)=>a(r)-a(n))}))}clearCache(e){this.agentsCache.delete(e);}clearAllCache(){this.agentsCache.clear();}static \u0275fac=function(t){return new(t||s)};static \u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"})};export{f};
1
+ import {g,H as py,W as br,bU as Od,r as re,Y as x}from'./main-YUNT4ZXI.js';var f=class s{http=g(py);agentsCache=new Map;getAgents(e){let t=this.agentsCache.get(e);return t?br(t):this.http.get(`/api/projects/${e}/agents`).pipe(Od(o=>{this.agentsCache.set(e,o);}))}getAgentsAutocomplete(e,t){return this.getAgents(e).pipe(re(o=>{if(!t)return o;let i=t.toLowerCase(),a=r=>{let n=r.name.toLowerCase();return n.startsWith(i)?0:n.includes(i)?1:2};return o.filter(r=>{let n=r.name.toLowerCase(),h=r.description?.toLowerCase()||"";return n.includes(i)||h.includes(i)}).sort((r,n)=>a(r)-a(n))}))}clearCache(e){this.agentsCache.delete(e);}clearAllCache(){this.agentsCache.clear();}static \u0275fac=function(t){return new(t||s)};static \u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"})};export{f};
@@ -1 +1 @@
1
- import {m}from'./chunk-CP8bTPZX.js';import {g,ao as V,G,C as Ce$1,da as M,a as Gi,b as U,a7 as ya,W as br,x,w,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a5 as vl,a8 as Yg,y as eC,a9 as lC,S as Sg,a3 as VI,t as rC,bo as tC,ac as gC,v as bg,A as Ug,a6 as UI,z as oC,aa as If,ab as wf}from'./main-5YX2WY5Q.js';import {o as z,z as ze,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,Z as Zn,l as Xn,C as Cn,E as En,p as An,q as Ct,V as Vt}from'./chunk-wi-CxI3Z.js';import'./chunk-BqEn27y2.js';import'./chunk-DSIStEbo.js';import'./chunk-BpSy6uuY.js';var ne=(i,t)=>t.id;function ie(i,t){i&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function ae(i,t){i&1&&(ws(0,"span",12),GC(1,"Name is required."),pl());}function le(i,t){if(i&1&&(ws(0,"p",32),GC(1),pl(),ws(2,"span",26),GC(3,"Agent Config cannot be changed after creation."),pl()),i&2){let e=gC(3);XE(),Yg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function me(i,t){if(i&1&&(ws(0,"option",34),GC(1),pl()),i&2){let e=t.$implicit;bg("ngValue",e.id),XE(),Yg(e.name);}}function pe(i,t){if(i&1&&(ws(0,"select",33)(1,"option",34),GC(2,"\u2014 None \u2014"),pl(),rC(3,me,2,2,"option",34,ne),pl(),VI(),ws(5,"span",26),GC(6,"Optional. Links this prompt to an agent as a starter. Immutable after creation."),pl()),i&2){let e=gC(3);bg("formControl",e.agentConfigIdControl),UI(),XE(),bg("ngValue",null),XE(2),oC(e.availableAgentConfigs());}}function de(i,t){if(i&1&&(ws(0,"div",8)(1,"label",31),GC(2,"Agent Config"),pl(),Jw(3,le,4,1)(4,pe,7,2),pl()),i&2){let e=gC(2);XE(3),eC(e.isEditMode()&&e.agentConfigIdControl.value?3:e.isEditMode()?-1:4);}}function ce(i,t){i&1&&(ws(0,"p",19),GC(1,"No parameters defined."),pl());}function se(i,t){i&1&&(ws(0,"span",12),GC(1,"Parameter name is required."),pl());}function _e(i,t){if(i&1){let e=lC();ws(0,"div",20)(1,"div",35)(2,"div",36)(3,"label",37),GC(4,"Name "),ws(5,"span",10),GC(6,"*"),pl()(),Sg(7,"input",38),VI(),Jw(8,se,2,0,"span",12),pl(),ws(9,"div",36)(10,"label",37),GC(11,"Description"),pl(),Sg(12,"input",39),VI(),pl(),ws(13,"div",36)(14,"label",37),GC(15,"Default value"),pl(),Sg(16,"input",40),VI(),pl()(),ws(17,"button",41),Rg("click",function(){let m=If(e).$index,d=gC(2);return wf(d.removeParameter(m))}),GC(18," \xD7 "),pl()();}if(i&2){let e=t.$implicit,l=t.$index;bg("formGroupName",l),XE(3),bg("for","param-name-"+l),XE(4),Ug("prompt-form__input--invalid",e.controls.name.invalid&&e.controls.name.touched),bg("id","param-name-"+l),UI(),XE(),eC(e.controls.name.invalid&&e.controls.name.touched?8:-1),XE(2),bg("for","param-desc-"+l),XE(2),bg("id","param-desc-"+l),UI(),XE(2),bg("for","param-default-"+l),XE(2),bg("id","param-default-"+l),UI();}}function fe(i,t){i&1&&(ws(0,"span",12),GC(1,"Content entry must not be blank."),pl());}function ue(i,t){if(i&1){let e=lC();ws(0,"div",22)(1,"span",42),GC(2),pl(),ws(3,"div",43),Sg(4,"textarea",44),VI(),Jw(5,fe,2,0,"span",12),pl(),ws(6,"button",45),Rg("click",function(){let m=If(e).$index,d=gC(2);return wf(d.removeContentEntry(m))}),GC(7," \xD7 "),pl()();}if(i&2){let e=t.$implicit,l=t.$index,m=gC(2);XE(2),Yg(l+1),XE(2),Ug("prompt-form__textarea--invalid",e.invalid&&e.touched),bg("formControlName",l),UI(),XE(),eC(e.invalid&&e.touched?5:-1),XE(),bg("disabled",m.contentArray.length===1);}}function ge(i,t){if(i&1&&(ws(0,"p",23),GC(1),pl()),i&2){let e=gC(2);XE(),Yg(e.errorMessage());}}function Ce(i,t){i&1&&(ws(0,"span",12),GC(1,"Invalid JSON."),pl());}function xe(i,t){if(i&1){let e=lC();ws(0,"button",46),Rg("click",function(){If(e);let m=gC(2);return wf(m.exportYaml())}),GC(1),pl();}if(i&2){let e=gC(2);bg("disabled",e.isExporting()),XE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ve(i,t){if(i&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let m=gC();return wf(m.submit())}),ws(1,"div",8)(2,"label",9),GC(3,"Name "),ws(4,"span",10),GC(5,"*"),pl()(),Sg(6,"input",11),VI(),Jw(7,ae,2,0,"span",12),pl(),ws(8,"div",8)(9,"label",13),GC(10,"Description"),pl(),Sg(11,"input",14),VI(),pl(),Jw(12,de,5,1,"div",8),ws(13,"fieldset",15)(14,"legend",16),GC(15," Parameters "),ws(16,"span",17),GC(17,"Named placeholders used in content"),pl()(),ws(18,"p",18),GC(19," Each parameter must have a name and a default value. Use "),ws(20,"code"),GC(21),pl(),GC(22," in content entries to reference them. "),pl(),Jw(23,ce,2,0,"p",19),rC(24,_e,19,10,"div",20,tC),ws(26,"button",21),Rg("click",function(){If(e);let m=gC();return wf(m.addParameter())}),GC(27,"+ Add parameter"),pl()(),ws(28,"fieldset",15)(29,"legend",16),GC(30," Content "),ws(31,"span",10),GC(32,"*"),pl(),ws(33,"span",17),GC(34,"Ordered list of text commands"),pl()(),ws(35,"p",18),GC(36," Each content entry is a command. Use "),ws(37,"code"),GC(38,"@AgentName"),pl(),GC(39," to target an agent, "),ws(40,"code"),GC(41,"/promptName param1 param2"),pl(),GC(42," to call another prompt, and "),ws(43,"code"),GC(44),pl(),GC(45," for parameter placeholders. "),pl(),rC(46,ue,8,6,"div",22,tC),ws(48,"button",21),Rg("click",function(){If(e);let m=gC();return wf(m.addContentEntry())}),GC(49,"+ Add content entry"),pl()(),Jw(50,ge,2,1,"p",23),ws(51,"div",8)(52,"label",24),GC(53,"External Metadata"),pl(),Sg(54,"textarea",25),VI(),Jw(55,Ce,2,0,"span",12),ws(56,"span",26),GC(57,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),pl()(),ws(58,"div",27)(59,"button",28),GC(60),pl(),Jw(61,xe,2,2,"button",29),ws(62,"button",30),Rg("click",function(){If(e);let m=gC();return wf(m.cancel())}),GC(63,"Cancel"),pl()()();}if(i&2){let e=gC();bg("formGroup",e.form),XE(6),Ug("prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),bg("formControl",e.nameControl),UI(),XE(),eC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(4),bg("formControl",e.descriptionControl),UI(),XE(),eC(e.availableAgentConfigs().length>0?12:-1),XE(),bg("formArrayName","parameters"),XE(8),Yg(e.paramPlaceholderSyntax),XE(2),eC(e.parametersArray.length===0?23:-1),XE(),oC(e.parametersArray.controls),XE(4),bg("formArrayName","content"),XE(16),Yg(e.paramPlaceholderSyntax),XE(2),oC(e.contentArray.controls),XE(4),eC(e.errorMessage()?50:-1),XE(4),bg("formControl",e.externalMetadataJsonControl),UI(),XE(),eC(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?55:-1),XE(4),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create"," "),XE(),eC(e.isEditMode()?61:-1);}}var re=class i{route=g(V);router=g(G);destroyRef=g(Ce$1);promptState=g(m);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(null),agentConfigId:new _t(null),externalMetadataJson:new _t("",{nonNullable:true,validators:[be]}),content:new ze([this.createContentControl()],{validators:[_e$1.required]}),parameters:new ze([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);isExporting=Gi(false);errorMessage=Gi(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=Gi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U(this.destroyRef),ya(()=>br([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U(this.destroyRef),ya(()=>br([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(l=>this.contentArray.push(this.createContentControl(l))),this.parametersArray.clear(),(t.parameters??[]).forEach(l=>this.parametersArray.push(this.createParameterGroup(l))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new _t(t,{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new z({name:new _t(t?.name??"",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(t?.description??null),defaultValue:new _t(t?.defaultValue??"",{nonNullable:true,validators:[_e$1.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(d=>d.value.trim()),parameters:this.parametersArray.controls.map(d=>({name:d.controls.name.value.trim(),description:d.controls.description.value?.trim()||void 0,defaultValue:d.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let l=this.externalMetadataJsonControl.value.trim();e.externalMetadata=l?JSON.parse(l):null;let m=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),m.pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:d=>{this.isSubmitting.set(false),d.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):d.status===400?this.errorMessage.set(d.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let l=new Blob([e],{type:"application/yaml"}),m=URL.createObjectURL(l),d=document.createElement("a");d.href=m,d.download=`${this.existingPrompt?.name??"prompt"}.yaml`,d.click(),URL.revokeObjectURL(m),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-prompt-form"]],decls:10,vars:3,consts:[[1,"prompt-form"],[1,"prompt-form__header"],["type","button","title","Back to prompts",1,"prompt-form__back",3,"click"],[1,"prompt-form__back-icon"],[1,"prompt-form__title"],[1,"prompt-form__loading"],[1,"prompt-form__form",3,"formGroup"],[1,"prompt-form__form",3,"ngSubmit","formGroup"],[1,"prompt-form__field"],["for","prompt-name",1,"prompt-form__label"],["aria-hidden","true"],["id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__field-error"],["for","prompt-description",1,"prompt-form__label"],["id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__section",3,"formArrayName"],[1,"prompt-form__label"],[1,"prompt-form__label-hint"],[1,"prompt-form__section-hint"],[1,"prompt-form__empty-hint"],[1,"prompt-form__param-row",3,"formGroupName"],["type","button",1,"prompt-form__add-btn",3,"click"],[1,"prompt-form__content-row"],[1,"prompt-form__error"],["for","prompt-external-metadata",1,"prompt-form__label"],["id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"prompt-form__textarea","prompt-form__textarea--code",3,"formControl"],[1,"prompt-form__field-hint"],[1,"prompt-form__actions"],["type","submit",1,"prompt-form__btn","prompt-form__btn--primary",3,"disabled"],["type","button",1,"prompt-form__btn","prompt-form__btn--export",3,"disabled"],["type","button",1,"prompt-form__btn",3,"click"],["for","prompt-agent-config",1,"prompt-form__label"],[1,"prompt-form__readonly-value"],["id","prompt-agent-config",1,"prompt-form__select",3,"formControl"],[3,"ngValue"],[1,"prompt-form__param-fields"],[1,"prompt-form__field","prompt-form__field--inline"],[1,"prompt-form__label",3,"for"],["type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","Optional","formControlName","description","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",1,"prompt-form__input",3,"id"],["type","button","title","Remove this parameter",1,"prompt-form__remove-btn",3,"click"],[1,"prompt-form__content-index"],[1,"prompt-form__content-field"],["rows","4","placeholder","Enter a command\u2026",1,"prompt-form__textarea",3,"formControlName"],["type","button","title","Remove this entry",1,"prompt-form__remove-btn",3,"click","disabled"],["type","button",1,"prompt-form__btn","prompt-form__btn--export",3,"click","disabled"]],template:function(e,l){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return l.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,ie,2,0,"p",5)(9,ve,64,18,"form",6),pl()),e&2&&(XE(5),vl(" ",l.isPlatformMode?"Platform prompts":"Prompts"," "),XE(2),Yg(l.isEditMode()?"Edit prompt":"New prompt"),XE(),eC(l.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,Zn,Xn,Cn,En,An,Ct,Vt],styles:[".prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.prompt-form__field--inline[_ngcontent-%COMP%]{flex:1}.prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.prompt-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary);margin-left:.375rem}.prompt-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;cursor:pointer;appearance:auto;transition:border-color .15s ease}.prompt-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;padding:.5rem .875rem;border-radius:0;background:var(--color-bg-hover);border:1px solid var(--color-divider);color:var(--color-text);font-size:.9375rem}.prompt-form__input[_ngcontent-%COMP%], .prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.prompt-form__input[_ngcontent-%COMP%]:focus, .prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__input[_ngcontent-%COMP%]::placeholder, .prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.prompt-form__textarea--code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85rem;resize:vertical}.prompt-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.prompt-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.prompt-form__content-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-start}.prompt-form__content-field[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem}.prompt-form__content-index[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;padding-top:.6rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary);text-align:right;-webkit-user-select:none;user-select:none}.prompt-form__param-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end;padding:.75rem;border-radius:0;background:var(--color-bg-hover)}.prompt-form__param-fields[_ngcontent-%COMP%]{flex:1;display:flex;gap:.75rem;flex-wrap:wrap}.prompt-form__add-btn[_ngcontent-%COMP%]{align-self:flex-start;padding:.4rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-accent);font-size:.875rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__add-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-accent)}.prompt-form__remove-btn[_ngcontent-%COMP%]{flex-shrink:0;width:1.75rem;height:1.75rem;display:flex;align-items:center;justify-content:center;border-radius:0;border:1px solid transparent;background:transparent;color:var(--color-neutral-500);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.prompt-form__remove-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:color-mix(in srgb,var(--red) 10%,transparent);color:var(--red);border-color:var(--red)}.prompt-form__remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.prompt-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:0;background:color-mix(in srgb,var(--red) 10%,transparent);border:1px solid var(--red);color:var(--red);font-size:.875rem;line-height:1.4}.prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--red);line-height:1.3}.prompt-form__input--invalid[_ngcontent-%COMP%], .prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--red)}.prompt-form__input--invalid[_ngcontent-%COMP%]:focus, .prompt-form__textarea--invalid[_ngcontent-%COMP%]:focus{border-color:var(--red)}.prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.prompt-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.prompt-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};function be(i){let t=i.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{re as PromptFormComponent};
1
+ import {m}from'./chunk-CoCuHv7l.js';import {g,ao as V,G,C as Ce$1,da as M,a as Gi,b as U,a7 as ya,W as br,x,w,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a5 as vl,a8 as Yg,y as eC,a9 as lC,S as Sg,a3 as VI,t as rC,bo as tC,ac as gC,v as bg,A as Ug,a6 as UI,z as oC,aa as If,ab as wf}from'./main-YUNT4ZXI.js';import {o as z,z as ze,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,Z as Zn,l as Xn,C as Cn,E as En,p as An,q as Ct,V as Vt}from'./chunk-Rs6cK9ku.js';import'./chunk-Dq_UNbZ5.js';import'./chunk-DRgqn-qP.js';import'./chunk-CD-fmXp6.js';var ne=(i,t)=>t.id;function ie(i,t){i&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function ae(i,t){i&1&&(ws(0,"span",12),GC(1,"Name is required."),pl());}function le(i,t){if(i&1&&(ws(0,"p",32),GC(1),pl(),ws(2,"span",26),GC(3,"Agent Config cannot be changed after creation."),pl()),i&2){let e=gC(3);XE(),Yg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function me(i,t){if(i&1&&(ws(0,"option",34),GC(1),pl()),i&2){let e=t.$implicit;bg("ngValue",e.id),XE(),Yg(e.name);}}function pe(i,t){if(i&1&&(ws(0,"select",33)(1,"option",34),GC(2,"\u2014 None \u2014"),pl(),rC(3,me,2,2,"option",34,ne),pl(),VI(),ws(5,"span",26),GC(6,"Optional. Links this prompt to an agent as a starter. Immutable after creation."),pl()),i&2){let e=gC(3);bg("formControl",e.agentConfigIdControl),UI(),XE(),bg("ngValue",null),XE(2),oC(e.availableAgentConfigs());}}function de(i,t){if(i&1&&(ws(0,"div",8)(1,"label",31),GC(2,"Agent Config"),pl(),Jw(3,le,4,1)(4,pe,7,2),pl()),i&2){let e=gC(2);XE(3),eC(e.isEditMode()&&e.agentConfigIdControl.value?3:e.isEditMode()?-1:4);}}function ce(i,t){i&1&&(ws(0,"p",19),GC(1,"No parameters defined."),pl());}function se(i,t){i&1&&(ws(0,"span",12),GC(1,"Parameter name is required."),pl());}function _e(i,t){if(i&1){let e=lC();ws(0,"div",20)(1,"div",35)(2,"div",36)(3,"label",37),GC(4,"Name "),ws(5,"span",10),GC(6,"*"),pl()(),Sg(7,"input",38),VI(),Jw(8,se,2,0,"span",12),pl(),ws(9,"div",36)(10,"label",37),GC(11,"Description"),pl(),Sg(12,"input",39),VI(),pl(),ws(13,"div",36)(14,"label",37),GC(15,"Default value"),pl(),Sg(16,"input",40),VI(),pl()(),ws(17,"button",41),Rg("click",function(){let m=If(e).$index,d=gC(2);return wf(d.removeParameter(m))}),GC(18," \xD7 "),pl()();}if(i&2){let e=t.$implicit,l=t.$index;bg("formGroupName",l),XE(3),bg("for","param-name-"+l),XE(4),Ug("prompt-form__input--invalid",e.controls.name.invalid&&e.controls.name.touched),bg("id","param-name-"+l),UI(),XE(),eC(e.controls.name.invalid&&e.controls.name.touched?8:-1),XE(2),bg("for","param-desc-"+l),XE(2),bg("id","param-desc-"+l),UI(),XE(2),bg("for","param-default-"+l),XE(2),bg("id","param-default-"+l),UI();}}function fe(i,t){i&1&&(ws(0,"span",12),GC(1,"Content entry must not be blank."),pl());}function ue(i,t){if(i&1){let e=lC();ws(0,"div",22)(1,"span",42),GC(2),pl(),ws(3,"div",43),Sg(4,"textarea",44),VI(),Jw(5,fe,2,0,"span",12),pl(),ws(6,"button",45),Rg("click",function(){let m=If(e).$index,d=gC(2);return wf(d.removeContentEntry(m))}),GC(7," \xD7 "),pl()();}if(i&2){let e=t.$implicit,l=t.$index,m=gC(2);XE(2),Yg(l+1),XE(2),Ug("prompt-form__textarea--invalid",e.invalid&&e.touched),bg("formControlName",l),UI(),XE(),eC(e.invalid&&e.touched?5:-1),XE(),bg("disabled",m.contentArray.length===1);}}function ge(i,t){if(i&1&&(ws(0,"p",23),GC(1),pl()),i&2){let e=gC(2);XE(),Yg(e.errorMessage());}}function Ce(i,t){i&1&&(ws(0,"span",12),GC(1,"Invalid JSON."),pl());}function xe(i,t){if(i&1){let e=lC();ws(0,"button",46),Rg("click",function(){If(e);let m=gC(2);return wf(m.exportYaml())}),GC(1),pl();}if(i&2){let e=gC(2);bg("disabled",e.isExporting()),XE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ve(i,t){if(i&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let m=gC();return wf(m.submit())}),ws(1,"div",8)(2,"label",9),GC(3,"Name "),ws(4,"span",10),GC(5,"*"),pl()(),Sg(6,"input",11),VI(),Jw(7,ae,2,0,"span",12),pl(),ws(8,"div",8)(9,"label",13),GC(10,"Description"),pl(),Sg(11,"input",14),VI(),pl(),Jw(12,de,5,1,"div",8),ws(13,"fieldset",15)(14,"legend",16),GC(15," Parameters "),ws(16,"span",17),GC(17,"Named placeholders used in content"),pl()(),ws(18,"p",18),GC(19," Each parameter must have a name and a default value. Use "),ws(20,"code"),GC(21),pl(),GC(22," in content entries to reference them. "),pl(),Jw(23,ce,2,0,"p",19),rC(24,_e,19,10,"div",20,tC),ws(26,"button",21),Rg("click",function(){If(e);let m=gC();return wf(m.addParameter())}),GC(27,"+ Add parameter"),pl()(),ws(28,"fieldset",15)(29,"legend",16),GC(30," Content "),ws(31,"span",10),GC(32,"*"),pl(),ws(33,"span",17),GC(34,"Ordered list of text commands"),pl()(),ws(35,"p",18),GC(36," Each content entry is a command. Use "),ws(37,"code"),GC(38,"@AgentName"),pl(),GC(39," to target an agent, "),ws(40,"code"),GC(41,"/promptName param1 param2"),pl(),GC(42," to call another prompt, and "),ws(43,"code"),GC(44),pl(),GC(45," for parameter placeholders. "),pl(),rC(46,ue,8,6,"div",22,tC),ws(48,"button",21),Rg("click",function(){If(e);let m=gC();return wf(m.addContentEntry())}),GC(49,"+ Add content entry"),pl()(),Jw(50,ge,2,1,"p",23),ws(51,"div",8)(52,"label",24),GC(53,"External Metadata"),pl(),Sg(54,"textarea",25),VI(),Jw(55,Ce,2,0,"span",12),ws(56,"span",26),GC(57,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),pl()(),ws(58,"div",27)(59,"button",28),GC(60),pl(),Jw(61,xe,2,2,"button",29),ws(62,"button",30),Rg("click",function(){If(e);let m=gC();return wf(m.cancel())}),GC(63,"Cancel"),pl()()();}if(i&2){let e=gC();bg("formGroup",e.form),XE(6),Ug("prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),bg("formControl",e.nameControl),UI(),XE(),eC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(4),bg("formControl",e.descriptionControl),UI(),XE(),eC(e.availableAgentConfigs().length>0?12:-1),XE(),bg("formArrayName","parameters"),XE(8),Yg(e.paramPlaceholderSyntax),XE(2),eC(e.parametersArray.length===0?23:-1),XE(),oC(e.parametersArray.controls),XE(4),bg("formArrayName","content"),XE(16),Yg(e.paramPlaceholderSyntax),XE(2),oC(e.contentArray.controls),XE(4),eC(e.errorMessage()?50:-1),XE(4),bg("formControl",e.externalMetadataJsonControl),UI(),XE(),eC(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?55:-1),XE(4),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create"," "),XE(),eC(e.isEditMode()?61:-1);}}var re=class i{route=g(V);router=g(G);destroyRef=g(Ce$1);promptState=g(m);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(null),agentConfigId:new _t(null),externalMetadataJson:new _t("",{nonNullable:true,validators:[be]}),content:new ze([this.createContentControl()],{validators:[_e$1.required]}),parameters:new ze([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);isExporting=Gi(false);errorMessage=Gi(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=Gi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U(this.destroyRef),ya(()=>br([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U(this.destroyRef),ya(()=>br([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(l=>this.contentArray.push(this.createContentControl(l))),this.parametersArray.clear(),(t.parameters??[]).forEach(l=>this.parametersArray.push(this.createParameterGroup(l))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new _t(t,{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new z({name:new _t(t?.name??"",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(t?.description??null),defaultValue:new _t(t?.defaultValue??"",{nonNullable:true,validators:[_e$1.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(d=>d.value.trim()),parameters:this.parametersArray.controls.map(d=>({name:d.controls.name.value.trim(),description:d.controls.description.value?.trim()||void 0,defaultValue:d.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let l=this.externalMetadataJsonControl.value.trim();e.externalMetadata=l?JSON.parse(l):null;let m=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),m.pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:d=>{this.isSubmitting.set(false),d.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):d.status===400?this.errorMessage.set(d.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let l=new Blob([e],{type:"application/yaml"}),m=URL.createObjectURL(l),d=document.createElement("a");d.href=m,d.download=`${this.existingPrompt?.name??"prompt"}.yaml`,d.click(),URL.revokeObjectURL(m),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-prompt-form"]],decls:10,vars:3,consts:[[1,"prompt-form"],[1,"prompt-form__header"],["type","button","title","Back to prompts",1,"prompt-form__back",3,"click"],[1,"prompt-form__back-icon"],[1,"prompt-form__title"],[1,"prompt-form__loading"],[1,"prompt-form__form",3,"formGroup"],[1,"prompt-form__form",3,"ngSubmit","formGroup"],[1,"prompt-form__field"],["for","prompt-name",1,"prompt-form__label"],["aria-hidden","true"],["id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__field-error"],["for","prompt-description",1,"prompt-form__label"],["id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__section",3,"formArrayName"],[1,"prompt-form__label"],[1,"prompt-form__label-hint"],[1,"prompt-form__section-hint"],[1,"prompt-form__empty-hint"],[1,"prompt-form__param-row",3,"formGroupName"],["type","button",1,"prompt-form__add-btn",3,"click"],[1,"prompt-form__content-row"],[1,"prompt-form__error"],["for","prompt-external-metadata",1,"prompt-form__label"],["id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"prompt-form__textarea","prompt-form__textarea--code",3,"formControl"],[1,"prompt-form__field-hint"],[1,"prompt-form__actions"],["type","submit",1,"prompt-form__btn","prompt-form__btn--primary",3,"disabled"],["type","button",1,"prompt-form__btn","prompt-form__btn--export",3,"disabled"],["type","button",1,"prompt-form__btn",3,"click"],["for","prompt-agent-config",1,"prompt-form__label"],[1,"prompt-form__readonly-value"],["id","prompt-agent-config",1,"prompt-form__select",3,"formControl"],[3,"ngValue"],[1,"prompt-form__param-fields"],[1,"prompt-form__field","prompt-form__field--inline"],[1,"prompt-form__label",3,"for"],["type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","Optional","formControlName","description","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",1,"prompt-form__input",3,"id"],["type","button","title","Remove this parameter",1,"prompt-form__remove-btn",3,"click"],[1,"prompt-form__content-index"],[1,"prompt-form__content-field"],["rows","4","placeholder","Enter a command\u2026",1,"prompt-form__textarea",3,"formControlName"],["type","button","title","Remove this entry",1,"prompt-form__remove-btn",3,"click","disabled"],["type","button",1,"prompt-form__btn","prompt-form__btn--export",3,"click","disabled"]],template:function(e,l){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return l.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,ie,2,0,"p",5)(9,ve,64,18,"form",6),pl()),e&2&&(XE(5),vl(" ",l.isPlatformMode?"Platform prompts":"Prompts"," "),XE(2),Yg(l.isEditMode()?"Edit prompt":"New prompt"),XE(),eC(l.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,Zn,Xn,Cn,En,An,Ct,Vt],styles:[".prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.prompt-form__field--inline[_ngcontent-%COMP%]{flex:1}.prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.prompt-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary);margin-left:.375rem}.prompt-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;cursor:pointer;appearance:auto;transition:border-color .15s ease}.prompt-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;padding:.5rem .875rem;border-radius:0;background:var(--color-bg-hover);border:1px solid var(--color-divider);color:var(--color-text);font-size:.9375rem}.prompt-form__input[_ngcontent-%COMP%], .prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.prompt-form__input[_ngcontent-%COMP%]:focus, .prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__input[_ngcontent-%COMP%]::placeholder, .prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.prompt-form__textarea--code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85rem;resize:vertical}.prompt-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.prompt-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.prompt-form__content-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-start}.prompt-form__content-field[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem}.prompt-form__content-index[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;padding-top:.6rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary);text-align:right;-webkit-user-select:none;user-select:none}.prompt-form__param-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end;padding:.75rem;border-radius:0;background:var(--color-bg-hover)}.prompt-form__param-fields[_ngcontent-%COMP%]{flex:1;display:flex;gap:.75rem;flex-wrap:wrap}.prompt-form__add-btn[_ngcontent-%COMP%]{align-self:flex-start;padding:.4rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-accent);font-size:.875rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__add-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-accent)}.prompt-form__remove-btn[_ngcontent-%COMP%]{flex-shrink:0;width:1.75rem;height:1.75rem;display:flex;align-items:center;justify-content:center;border-radius:0;border:1px solid transparent;background:transparent;color:var(--color-neutral-500);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.prompt-form__remove-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:color-mix(in srgb,var(--red) 10%,transparent);color:var(--red);border-color:var(--red)}.prompt-form__remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.prompt-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:0;background:color-mix(in srgb,var(--red) 10%,transparent);border:1px solid var(--red);color:var(--red);font-size:.875rem;line-height:1.4}.prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--red);line-height:1.3}.prompt-form__input--invalid[_ngcontent-%COMP%], .prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--red)}.prompt-form__input--invalid[_ngcontent-%COMP%]:focus, .prompt-form__textarea--invalid[_ngcontent-%COMP%]:focus{border-color:var(--red)}.prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.prompt-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.prompt-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};function be(i){let t=i.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{re as PromptFormComponent};
@@ -1,4 +1,4 @@
1
- import {an as ue,g,L,ci as me,ap as wd,av as B,e as xw,k as ws,n as GC,o as pl,ai as tm,aj as KC,q as Rg,a3 as VI,S as Sg,J as Jw,t as rC,X as XE,ak as em,a6 as UI,v as bg,y as eC,z as oC,a5 as vl,aL as wo,aM as Zn$1,aO as wt$1,az as Xt,aW as C,cj as Pn,ce as _b,c8 as KT,af as Eg,ag as fT,c9 as kf,ck as Ff,ch as Ng,u as CC,T as Tg,ad as Hg,b$ as kC,A as Ug,D as Pg,E as EC,I as IC,aJ as Tr,aG as fe,cl as be,p as pe,l as le,bU as Od,b9 as T,b8 as B$1,be as A,b7 as u,bd as h,cm as M,d as O,ba as v,bb as m,c as b,cn as F,f,V,bc as R,co as H,cp as K,ca as _e,Y as x,Z as z$1,_ as Ue,am as qm,j as Gn,i as pr,a0 as jt,a2 as Nt,a1 as Vt,b0 as Qg,ac as gC}from'./main-5YX2WY5Q.js';import {s as se}from'./chunk-7fOouIuV.js';import {t as ti,Q as Qn,e as ei,Y as Ye$1,h as _n,A as At,m as mn,Z as Zn,c as cn,w as wt}from'./chunk-wi-CxI3Z.js';var Xe=["determinateSpinner"];function et(c,e){if(c&1&&(kf(),ws(0,"svg",11),Sg(1,"circle",12),pl()),c&2){let t=gC();Tg("viewBox",t._viewBox()),XE(),Hg("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Tg("r",t._circleRadius());}}var tt=new C("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:qe})}),qe=100,nt=10,yt=(()=>{class c{_elementRef=g(Xt);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t;}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=g(tt),n=Pn(),i=this._elementRef.nativeElement;this._noopAnimations=n==="di-disabled"&&!!t&&!t._forceAnimations,this.mode=i.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&n==="reduced-motion"&&i.classList.add("mat-progress-spinner-reduced-motion"),t&&(t.color&&(this.color=this._defaultColor=t.color),t.diameter&&(this.diameter=t.diameter),t.strokeWidth&&(this.strokeWidth=t.strokeWidth));}mode;get value(){return this.mode==="determinate"?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0));}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0;}_diameter=qe;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0;}_strokeWidth;_circleRadius(){return (this.diameter-nt)/2}_viewBox(){let t=this._circleRadius()*2+this.strokeWidth;return `0 0 ${t} ${t}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(n){return new(n||c)};static \u0275cmp=xw({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&Pg(Xe,5),n&2){let o;EC(o=IC())&&(i._determinateCircle=o.first);}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(n,i){n&2&&(Tg("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),kC("mat-"+i.color),Hg("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),Ug("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"));},inputs:{color:"color",mode:"mode",value:[2,"value","value",KT],diameter:[2,"diameter","diameter",KT],strokeWidth:[2,"strokeWidth","strokeWidth",KT]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(n,i){if(n&1&&(Eg(0,et,2,8,"ng-template",null,0,fT),ws(2,"div",2,1),kf(),ws(4,"svg",3),Sg(5,"circle",4),pl()(),Ff(),ws(6,"div",5)(7,"div",6)(8,"div",7),Ng(9,8),pl(),ws(10,"div",9),Ng(11,8),pl(),ws(12,"div",10),Ng(13,8),pl()()()),n&2){let o=CC(1);XE(4),Tg("viewBox",i._viewBox()),XE(),Hg("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),Tg("r",i._circleRadius()),XE(4),bg("ngTemplateOutlet",o),XE(2),bg("ngTemplateOutlet",o),XE(2),bg("ngTemplateOutlet",o);}},dependencies:[_b],styles:[`.mat-mdc-progress-spinner {
1
+ import {an as ue,g,L,ci as me,ap as wd,av as B,e as xw,k as ws,n as GC,o as pl,ai as tm,aj as KC,q as Rg,a3 as VI,S as Sg,J as Jw,t as rC,X as XE,ak as em,a6 as UI,v as bg,y as eC,z as oC,a5 as vl,aL as wo,aM as Zn$1,aO as wt$1,az as Xt,aW as C,cj as Pn,ce as _b,c8 as KT,af as Eg,ag as fT,c9 as kf,ck as Ff,ch as Ng,u as CC,T as Tg,ad as Hg,b$ as kC,A as Ug,D as Pg,E as EC,I as IC,aJ as Tr,aG as fe,cl as be,p as pe,l as le,bU as Od,b9 as T,b8 as B$1,be as A,b7 as u,bd as h,cm as M,d as O,ba as v,bb as m,c as b,cn as F,f,V,bc as R,co as H,cp as K,ca as _e,Y as x,Z as z$1,_ as Ue,am as qm,j as Gn,i as pr,a0 as jt,a2 as Nt,a1 as Vt,b0 as Qg,ac as gC}from'./main-YUNT4ZXI.js';import {s as se}from'./chunk-BLZrsqKB.js';import {t as ti,Q as Qn,e as ei,Y as Ye$1,h as _n,A as At,m as mn,Z as Zn,c as cn,w as wt}from'./chunk-Rs6cK9ku.js';var Xe=["determinateSpinner"];function et(c,e){if(c&1&&(kf(),ws(0,"svg",11),Sg(1,"circle",12),pl()),c&2){let t=gC();Tg("viewBox",t._viewBox()),XE(),Hg("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Tg("r",t._circleRadius());}}var tt=new C("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:qe})}),qe=100,nt=10,yt=(()=>{class c{_elementRef=g(Xt);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t;}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=g(tt),n=Pn(),i=this._elementRef.nativeElement;this._noopAnimations=n==="di-disabled"&&!!t&&!t._forceAnimations,this.mode=i.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&n==="reduced-motion"&&i.classList.add("mat-progress-spinner-reduced-motion"),t&&(t.color&&(this.color=this._defaultColor=t.color),t.diameter&&(this.diameter=t.diameter),t.strokeWidth&&(this.strokeWidth=t.strokeWidth));}mode;get value(){return this.mode==="determinate"?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0));}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0;}_diameter=qe;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0;}_strokeWidth;_circleRadius(){return (this.diameter-nt)/2}_viewBox(){let t=this._circleRadius()*2+this.strokeWidth;return `0 0 ${t} ${t}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(n){return new(n||c)};static \u0275cmp=xw({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&Pg(Xe,5),n&2){let o;EC(o=IC())&&(i._determinateCircle=o.first);}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(n,i){n&2&&(Tg("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),kC("mat-"+i.color),Hg("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),Ug("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"));},inputs:{color:"color",mode:"mode",value:[2,"value","value",KT],diameter:[2,"diameter","diameter",KT],strokeWidth:[2,"strokeWidth","strokeWidth",KT]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(n,i){if(n&1&&(Eg(0,et,2,8,"ng-template",null,0,fT),ws(2,"div",2,1),kf(),ws(4,"svg",3),Sg(5,"circle",4),pl()(),Ff(),ws(6,"div",5)(7,"div",6)(8,"div",7),Ng(9,8),pl(),ws(10,"div",9),Ng(11,8),pl(),ws(12,"div",10),Ng(13,8),pl()()()),n&2){let o=CC(1);XE(4),Tg("viewBox",i._viewBox()),XE(),Hg("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),Tg("r",i._circleRadius()),XE(4),bg("ngTemplateOutlet",o),XE(2),bg("ngTemplateOutlet",o),XE(2),bg("ngTemplateOutlet",o);}},dependencies:[_b],styles:[`.mat-mdc-progress-spinner {
2
2
  --mat-progress-spinner-animation-multiplier: 1;
3
3
  display: block;
4
4
  overflow: hidden;
@@ -1 +1 @@
1
- import {i}from'./chunk-CNYFTG-c.js';import {l}from'./chunk-CP8bTPZX.js';import {g as g$1,df as U,aJ as Tr,aD as Ly,bS as va,a7 as ya,W as br,r as re,cE as Ad,bU as Od,w,Y as x}from'./main-5YX2WY5Q.js';var g="none",N="me",O=class p{nsController=g$1(U);userState=g$1(l);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(va(([e])=>{let r=this.loadPlatformProviders().pipe(ya(()=>br([])));return e?Ly([r,this.loadNamespaceProviders(e).pipe(ya(()=>br([]))),this.loadUserProviders(e).pipe(ya(()=>br([]))),this.loadUserProviders("global").pipe(ya(()=>br([])))]).pipe(re(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):Ly([r,this.loadNamespaceProviders("").pipe(ya(()=>br([]))),this.loadUserProviders("global").pipe(ya(()=>br([])))]).pipe(re(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),Ad({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=i(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):br([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(Od(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(Od(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=w({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(Od(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(Od(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=x({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O};
1
+ import {i}from'./chunk-C3Z37bhY.js';import {l}from'./chunk-CoCuHv7l.js';import {g as g$1,df as U,aJ as Tr,aD as Ly,bS as va,a7 as ya,W as br,r as re,cE as Ad,bU as Od,w,Y as x}from'./main-YUNT4ZXI.js';var g="none",N="me",O=class p{nsController=g$1(U);userState=g$1(l);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(va(([e])=>{let r=this.loadPlatformProviders().pipe(ya(()=>br([])));return e?Ly([r,this.loadNamespaceProviders(e).pipe(ya(()=>br([]))),this.loadUserProviders(e).pipe(ya(()=>br([]))),this.loadUserProviders("global").pipe(ya(()=>br([])))]).pipe(re(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):Ly([r,this.loadNamespaceProviders("").pipe(ya(()=>br([]))),this.loadUserProviders("global").pipe(ya(()=>br([])))]).pipe(re(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),Ad({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=i(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):br([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(Od(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(Od(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=w({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(Od(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(Od(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=x({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O};
@@ -1 +1 @@
1
- import {N}from'./chunk-CbcSBfFf.js';import {g,ao as V,G,C as Ce$1,da as M,dn as B,a as Gi,dp as J,d8 as F,F as F$1,m as mT,dq as ve$1,b as U,a7 as ya,W as br,Q as By,r as re,x,w,e as xw,s as si,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,y as eC,ac as gC,v as bg,a9 as lC,S as Sg,a3 as VI,a6 as UI,T as Tg,a5 as vl,t as rC,z as oC,bo as tC,aa as If,ab as wf,b0 as Qg}from'./main-5YX2WY5Q.js';import'./chunk-CP8bTPZX.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,W as Wt,C as Cn,E as En}from'./chunk-wi-CxI3Z.js';import'./chunk-CNYFTG-c.js';import'./chunk-BqEn27y2.js';import'./chunk-DSIStEbo.js';import'./chunk-BpSy6uuY.js';var Ce=(o,t)=>t.config.id,be=(o,t)=>t.type;function xe(o,t){if(o&1&&(ws(0,"a",5),GC(1,"View resolved definition \u2192"),pl()),o&2){let e=gC();bg("routerLink",e.inspectRoute());}}function he(o,t){o&1&&(ws(0,"span",6),GC(1,"Platform level"),pl());}function ve(o,t){o&1&&(ws(0,"p",7),GC(1,"Loading\u2026"),pl());}function ye(o,t){if(o&1&&(ws(0,"span",49),GC(1),pl()),o&2){let e=gC().$implicit;XE(),Yg(e.config.integrationType);}}function we(o,t){if(o&1&&(Sg(0,"input",50),VI()),o&2){let e=gC().$implicit;bg("formControl",e.toolsControl),UI();}}function Se(o,t){if(o&1){let e=lC();ws(0,"div",45)(1,"label",46)(2,"input",47),Rg("change",function(){let c=If(e).$implicit,g=gC(3);return wf(g.toggleIntegration(c))}),pl(),ws(3,"span",48),GC(4),pl(),Jw(5,ye,2,1,"span",49),pl(),Jw(6,we,1,1,"input",50),pl();}if(o&2){let e=t.$implicit;XE(2),bg("checked",e.enabled()),XE(2),Yg(e.config.name),XE(),eC(e.config.integrationType?5:-1),XE(),eC(e.enabled()?6:-1);}}function Me(o,t){if(o&1&&(ws(0,"p",56),GC(1),pl()),o&2){let e=gC().$implicit;XE(),vl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function Ee(o,t){if(o&1){let e=lC();ws(0,"div",45)(1,"label",46)(2,"span",48),GC(3),pl(),ws(4,"span",49),GC(5,"built-in"),pl()(),ws(6,"select",52),Rg("change",function(c){let g=If(e).$implicit,C=gC(4);return wf(C.setBuiltInState(g,c.target.value))}),ws(7,"option",53),GC(8),pl(),ws(9,"option",54),GC(10,"Enabled"),pl(),ws(11,"option",55),GC(12,"Disabled"),pl()(),Jw(13,Me,2,1,"p",56),ws(14,"p",57),GC(15),pl()();}if(o&2){let e=t.$implicit,a=gC(4);XE(),Tg("for","built-in-"+e.type),XE(2),Yg(e.displayName),XE(3),bg("id","built-in-"+e.type)("value",e.state()),XE(2),Yg(a.builtInDefaultLabel(e)),XE(5),eC(e.state()==="on"&&e.restrictedTools?13:-1),XE(2),Yg(e.description);}}function Ae(o,t){if(o&1&&(ws(0,"p",51),GC(1,"Built-in integrations"),pl(),rC(2,Ee,16,7,"div",45,be)),o&2){let e=gC(3);XE(2),oC(e.builtInRows());}}function Ie(o,t){if(o&1&&(ws(0,"fieldset",20)(1,"legend",29),GC(2,"Integrations"),pl(),ws(3,"p",44),GC(4," Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration. "),pl(),rC(5,Se,7,4,"div",45,Ce),Jw(7,Ae,4,0),pl()),o&2){let e=gC(2);XE(5),oC(e.integrationRows()),XE(2),eC(e.builtInRows().length>0?7:-1);}}function Oe(o,t){o&1&&(ws(0,"p",60),GC(1,"Invalid JSON \u2014 please fix the syntax."),pl());}function Pe(o,t){if(o&1&&(ws(0,"div",10)(1,"label",58),GC(2,"Loop configuration (JSON)"),pl(),Sg(3,"textarea",59),VI(),Jw(4,Oe,2,0,"p",60),ws(5,"p",24),GC(6," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),ws(7,"code",30),GC(8,"AgentLoopPayload"),pl(),GC(9,". Leave empty if you always provide the payload at launch. "),pl()()),o&2){let e=gC(2);XE(3),bg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),UI(),XE(),eC(e.loopConfigControl.invalid&&e.loopConfigControl.touched?4:-1);}}function ke(o,t){if(o&1){let e=lC();ws(0,"li",61),Sg(1,"input",62),VI(),ws(2,"button",63),Rg("click",function(){let c=If(e).$implicit,g=gC(3);return wf(g.removeSubAgent(c))}),GC(3," \u{1F5D1} "),pl()();}if(o&2){let e=t.$implicit;XE(),bg("formControl",e.control),UI();}}function Te(o,t){if(o&1&&(ws(0,"ul",31),rC(1,ke,4,1,"li",61,tC),pl()),o&2){let e=gC(2);XE(),oC(e.subAgentRows());}}function Re(o,t){if(o&1&&GC(0),o&2){let e=gC(2);Qg(" : ",e.defaultDelegationTimeoutSeconds()," s (",e.defaultDelegationTimeoutSeconds()/60," min) ");}}function De(o,t){o&1&&(ws(0,"p",38),GC(1," Enter a valid positive whole number of seconds, or leave empty to inherit the server default. "),pl());}function Ve(o,t){if(o&1){let e=lC();ws(0,"button",64),Rg("click",function(){If(e);let c=gC(2);return wf(c.useDefaultDelegationTimeout())}),GC(1," Use server default "),pl();}}function Ne(o,t){if(o&1){let e=lC();ws(0,"button",65),Rg("click",function(){If(e);let c=gC(2);return wf(c.exportYaml())}),GC(1),pl();}if(o&2){let e=gC(2);bg("disabled",e.isExporting()),XE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Fe(o,t){if(o&1){let e=lC();ws(0,"form",9),Rg("ngSubmit",function(){If(e);let c=gC();return wf(c.submit())}),ws(1,"div",10)(2,"label",11),GC(3,"Name "),ws(4,"span",12),GC(5,"*"),pl()(),Sg(6,"input",13),VI(),pl(),ws(7,"div",10)(8,"label",14),GC(9,"Description"),pl(),Sg(10,"input",15),VI(),pl(),ws(11,"div",10)(12,"label",16),GC(13,"Model name"),pl(),Sg(14,"input",17),VI(),pl(),ws(15,"div",10)(16,"label",18),GC(17,"Instructions"),pl(),Sg(18,"textarea",19),VI(),pl(),Jw(19,Ie,8,1,"fieldset",20),ws(20,"div",10)(21,"label",21),GC(22,"Execution mode"),pl(),ws(23,"select",22)(24,"option",23),GC(25,"SIMPLE \u2014 Standard agent (single LLM call)"),pl(),ws(26,"option",23),GC(27,"ADVANCED \u2014 Multi-step reasoning loop"),pl(),ws(28,"option",23),GC(29,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),pl()(),VI(),ws(30,"p",24),GC(31,' SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu. '),pl()(),Jw(32,Pe,10,3,"div",10),ws(33,"div",10)(34,"label",25),Sg(35,"input",26),VI(),ws(36,"span",27),GC(37,"Enabled"),pl()(),ws(38,"p",28),GC(39,"Disabled agents are excluded from namespace resolution."),pl()(),ws(40,"div",10)(41,"span",29),GC(42,"Sub-agents"),pl(),ws(43,"p",24),GC(44," Glob patterns for agents this agent may delegate to. "),ws(45,"code",30),GC(46,"*"),pl(),GC(47," matches any sequence of characters (e.g. "),ws(48,"code",30),GC(49,"*Fixer"),pl(),GC(50,", "),ws(51,"code",30),GC(52,"*"),pl(),GC(53," for all). Leave empty to disable delegation. "),pl(),Jw(54,Te,3,0,"ul",31),ws(55,"div",32)(56,"input",33),Rg("keydown.enter",function(){If(e);let c=gC();return wf(c.addSubAgent())}),pl(),VI(),ws(57,"button",34),Rg("click",function(){If(e);let c=gC();return wf(c.addSubAgent())}),GC(58," + "),pl()()(),ws(59,"div",10)(60,"label",35),GC(61,"Delegation timeout (seconds)"),pl(),ws(62,"p",36),GC(63," Maximum time for each delegation launched by this agent, including nested delegations. On timeout, the sub-agent and its active descendants are stopped. Leave empty to use the server default "),Jw(64,Re,1,2),GC(65," . "),pl(),Sg(66,"input",37),VI(),Jw(67,De,2,0,"p",38),Jw(68,Ve,2,0,"button",39),pl(),ws(69,"div",40)(70,"button",41),GC(71),pl(),Jw(72,Ne,2,2,"button",42),ws(73,"button",43),Rg("click",function(){If(e);let c=gC();return wf(c.cancel())}),GC(74,"Cancel"),pl()()();}if(o&2){let e=gC();bg("formGroup",e.form),XE(6),bg("formControl",e.nameControl),UI(),XE(4),bg("formControl",e.descriptionControl),UI(),XE(4),bg("formControl",e.modelNameControl),UI(),XE(4),bg("formControl",e.instructionsControl),UI(),XE(),eC(e.integrationRows().length>0||e.builtInRows().length>0?19:-1),XE(4),bg("formControl",e.executionModeControl),UI(),XE(),bg("value",e.ExecutionMode.SIMPLE),XE(2),bg("value",e.ExecutionMode.ADVANCED),XE(2),bg("value",e.ExecutionMode.LOOP),XE(4),eC(e.isLoopMode()?32:-1),XE(3),bg("formControl",e.enabledControl),UI(),XE(19),eC(e.subAgentRows().length>0?54:-1),XE(2),bg("formControl",e.newSubAgentControl),UI(),XE(),bg("disabled",!e.newSubAgentControl.value.trim()),XE(7),eC(e.defaultDelegationTimeoutSeconds()!==null?64:-1),XE(2),bg("formControl",e.delegationTimeoutControl),Tg("aria-invalid",e.delegationTimeoutControl.invalid),UI(),XE(),eC(e.delegationTimeoutControl.invalid?67:-1),XE(),eC(e.delegationTimeoutControl.value!==null?68:-1),XE(2),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create"," "),XE(),eC(e.isEditMode()?72:-1);}}var pe=class o{route=g(V);router=g(G);destroyRef=g(Ce$1);agentConfigController=g(M);defaultsController=g(B);defaultDelegationTimeoutSeconds=Gi(null);exportService=g(J);integrationConfigState=g(N);integrationTypeController=g(F);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]}),description:new _t(null),modelName:new _t(null),instructions:new _t(null),executionMode:new _t("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new _t(null,{validators:[_e.min(1),_e.max(2147483647),_e.pattern(/^\d+$/)]}),enabled:new _t(false,{nonNullable:true}),loopConfig:new _t(null,{validators:[o.jsonValidator]})});static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(a){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$1(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=mT(()=>this.executionModeValue()==="LOOP");subAgentRows=Gi([]);newSubAgentControl=new _t("",{nonNullable:true});isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);isExporting=Gi(false);ExecutionMode=ve$1;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=Gi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}integrationRows=Gi([]);existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U(this.destroyRef),ya(()=>br(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),By({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes()}).pipe(U(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:a,platformIntegrations:c,builtInTypes:g})=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let C=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(C),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let T=[...c,...a];this.integrationRows.set(this.buildIntegrationRows(T,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(g,e.integrations??void 0)),this.subAgentRows.set((e.subAgents??[]).map(_e=>({control:new _t(_e,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){By({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes()}).pipe(U(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:a,builtInTypes:c})=>{let g=[...a,...e];this.integrationRows.set(this.buildIntegrationRows(g,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,t??void 0));}});}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(re(t=>t.filter(e=>!e.configSchema)),ya(t=>(console.error("[agent-config-form] failed to load integration types",t),br([]))))}buildIntegrationRows(t,e){return t.map(a=>{let c=a.name??"",g=e?.[c],C=e!=null&&c in e,T=Array.isArray(g)?g.join(", "):"";return {config:a,enabled:Gi(C),toolsControl:new _t(T,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(a=>{let c=e!=null&&a.type in e,g=e?.[a.type],C=c?Array.isArray(g)&&g.length===0?"off":"on":"default";return {type:a.type,displayName:a.displayName,description:a.description,enabledByDefault:a.enabledByDefault===true,state:Gi(C),restrictedTools:Array.isArray(g)&&g.length>0?g:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();t&&(this.subAgentRows.update(e=>[...e,{control:new _t(t,{nonNullable:true})}]),this.newSubAgentControl.reset(""));}removeSubAgent(t){this.subAgentRows.update(e=>e.filter(a=>a!==t));}buildSubAgentsPayload(){let t=this.subAgentRows().map(e=>e.control.value.trim()).filter(e=>e.length>0);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let a of this.integrationRows().filter(c=>c.enabled())){let c=a.config.name??"",g=a.toolsControl.value.trim();t[c]=g===""?null:g.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let a of this.builtInRows()){let c=a.state();c==="on"?t[a.type]=a.restrictedTools??null:c==="off"&&(t[a.type]=[]);}let e=new Set([...this.integrationRows().map(a=>a.config.name??""),...this.builtInRows().map(a=>a.type)]);for(let[a,c]of Object.entries(this.existingConfig?.integrations??{}))e.has(a)||(t[a]=c);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let a=new Blob([e],{type:"application/yaml"}),c=URL.createObjectURL(a),g=document.createElement("a");g.href=c,g.download=`${this.existingConfig?.name??"agent"}.yaml`,g.click(),URL.revokeObjectURL(c),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-agent-config-form"]],decls:12,vars:4,consts:[[1,"agent-config-form"],[1,"agent-config-form__header"],["type","button","title","Back to agent configs",1,"agent-config-form__back",3,"click"],[1,"agent-config-form__back-icon"],[1,"agent-config-form__title"],[1,"agent-config-form__sibling-link",3,"routerLink"],[1,"agent-config-form__platform-badge"],[1,"agent-config-form__loading"],[1,"agent-config-form__form",3,"formGroup"],[1,"agent-config-form__form",3,"ngSubmit","formGroup"],[1,"agent-config-form__field"],["for","agent-config-name",1,"agent-config-form__label"],["aria-hidden","true"],["id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-description",1,"agent-config-form__label"],["id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-model-name",1,"agent-config-form__label"],["id","agent-config-model-name","type","text","placeholder","Optional \u2014 model alias or name to use","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-instructions",1,"agent-config-form__label"],["id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",1,"agent-config-form__textarea",3,"formControl"],[1,"agent-config-form__integrations"],["for","agent-config-execution-mode",1,"agent-config-form__label"],["id","agent-config-execution-mode",1,"agent-config-form__select",3,"formControl"],[3,"value"],[1,"agent-config-form__field-hint"],[1,"agent-config-form__toggle-label"],["type","checkbox",1,"agent-config-form__toggle-checkbox",3,"formControl"],[1,"agent-config-form__toggle-text"],[1,"agent-config-form__toggle-hint"],[1,"agent-config-form__label"],[1,"agent-config-form__code"],[1,"agent-config-form__sub-agent-list"],[1,"agent-config-form__sub-agent-add"],["type","text","placeholder","e.g. *Fixer or *","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"keydown.enter","formControl"],["type","button","title","Add pattern",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--add",3,"click","disabled"],["for","delegation-timeout",1,"agent-config-form__label"],["id","delegation-timeout-hint",1,"agent-config-form__field-hint"],["id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",1,"agent-config-form__input",3,"formControl"],["id","delegation-timeout-error","role","alert",1,"agent-config-form__field-hint"],["type","button",1,"agent-config-form__sub-agent-btn"],[1,"agent-config-form__actions"],["type","submit",1,"agent-config-form__btn","agent-config-form__btn--primary",3,"disabled"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"disabled"],["type","button",1,"agent-config-form__btn",3,"click"],[1,"agent-config-form__integrations-hint"],[1,"agent-config-form__integration-row"],[1,"agent-config-form__integration-toggle"],["type","checkbox",1,"agent-config-form__integration-checkbox",3,"change","checked"],[1,"agent-config-form__integration-name"],[1,"agent-config-form__integration-type"],["type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"agent-config-form__input","agent-config-form__integration-tools",3,"formControl"],[1,"agent-config-form__integrations-separator"],[1,"agent-config-form__integration-state",3,"change","id","value"],["value","default"],["value","on"],["value","off"],[1,"agent-config-form__integration-restriction"],[1,"agent-config-form__integration-builtin-desc"],["for","agent-config-loop-config",1,"agent-config-form__label"],["id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",1,"agent-config-form__textarea","agent-config-form__textarea--mono",3,"placeholder","formControl"],["role","alert",1,"agent-config-form__field-error"],[1,"agent-config-form__sub-agent-row"],["type","text","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"formControl"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger",3,"click"],["type","button",1,"agent-config-form__sub-agent-btn",3,"click"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"click","disabled"]],template:function(e,a){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return a.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Agent Configs "),pl(),ws(6,"h1",4),GC(7),pl(),Jw(8,xe,2,1,"a",5),Jw(9,he,2,0,"span",6),pl(),Jw(10,ve,2,0,"p",7)(11,Fe,75,23,"form",8),pl()),e&2&&(XE(7),Yg(a.isEditMode()?"Edit agent config":"New agent config"),XE(),eC(a.isEditMode()?8:-1),XE(),eC(a.isPlatformMode?9:-1),XE(),eC(a.isLoading()?10:11));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Wt,Cn,En,si],styles:[".agent-config-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.agent-config-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.agent-config-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.agent-config-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-accent);text-decoration:none}.agent-config-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__platform-badge[_ngcontent-%COMP%]{display:inline-block;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:var(--color-surface);border:1px solid var(--color-divider);border-radius:0;padding:.125rem .5rem;letter-spacing:.02em;align-self:flex-start}.agent-config-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.agent-config-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.agent-config-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.agent-config-form__input[_ngcontent-%COMP%], .agent-config-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.agent-config-form__input[_ngcontent-%COMP%]:focus, .agent-config-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__input[_ngcontent-%COMP%]::placeholder, .agent-config-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.agent-config-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px;line-height:1.5}.agent-config-form__textarea--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.8125rem}.agent-config-form__field-error[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-error, var(--red, #dc2626));line-height:1.4}.agent-config-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;cursor:pointer;transition:border-color .15s ease;appearance:auto}.agent-config-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__integrations[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.agent-config-form__integrations-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__integration-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__integration-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__integration-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__integration-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__integration-type[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:monospace}.agent-config-form__integration-tools[_ngcontent-%COMP%]{margin-left:1.5rem;font-size:.875rem}.agent-config-form__integrations-separator[_ngcontent-%COMP%]{margin:.25rem 0 0;padding-top:.5rem;border-top:1px solid var(--color-divider);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);font-family:var(--font-heading)}.agent-config-form__integration-state[_ngcontent-%COMP%]{margin-left:1.5rem;padding:.375rem .625rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.875rem;font-family:inherit;outline:none;transition:border-color .15s ease}.agent-config-form__integration-state[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.agent-config-form__integration-restriction[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;font-style:italic;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-form__integration-builtin-desc[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__field-hint[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:0}.agent-config-form__sub-agent-list[_ngcontent-%COMP%]{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.375rem}.agent-config-form__sub-agent-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem}.agent-config-form__sub-agent-input[_ngcontent-%COMP%]{flex:1;min-width:0}.agent-config-form__sub-agent-add[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;margin-top:.5rem}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]{flex-shrink:0;width:2rem;height:2rem;padding:0;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text-secondary);font-size:.9rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s ease,border-color .15s ease,color .15s ease}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500);color:var(--color-text)}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:not-allowed}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]{width:2rem;height:2rem;font-size:1.25rem;font-weight:300;border-color:var(--color-accent);color:var(--color-accent)}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent);color:#fff}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]{border:1px solid transparent;color:var(--color-neutral-500)}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--red);color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent)}.agent-config-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.agent-config-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.agent-config-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.agent-config-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.agent-config-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.agent-config-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{pe as AgentConfigFormComponent};
1
+ import {N}from'./chunk-BBEQptGI.js';import {g,ao as V,G,C as Ce$1,da as M,dn as B,a as Gi,dp as J,d8 as F,F as F$1,m as mT,dq as ve$1,b as U,a7 as ya,W as br,Q as By,r as re,x,w,e as xw,s as si,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,y as eC,ac as gC,v as bg,a9 as lC,S as Sg,a3 as VI,a6 as UI,T as Tg,a5 as vl,t as rC,z as oC,bo as tC,aa as If,ab as wf,b0 as Qg}from'./main-YUNT4ZXI.js';import'./chunk-CoCuHv7l.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,W as Wt,C as Cn,E as En}from'./chunk-Rs6cK9ku.js';import'./chunk-C3Z37bhY.js';import'./chunk-Dq_UNbZ5.js';import'./chunk-DRgqn-qP.js';import'./chunk-CD-fmXp6.js';var Ce=(o,t)=>t.config.id,be=(o,t)=>t.type;function xe(o,t){if(o&1&&(ws(0,"a",5),GC(1,"View resolved definition \u2192"),pl()),o&2){let e=gC();bg("routerLink",e.inspectRoute());}}function he(o,t){o&1&&(ws(0,"span",6),GC(1,"Platform level"),pl());}function ve(o,t){o&1&&(ws(0,"p",7),GC(1,"Loading\u2026"),pl());}function ye(o,t){if(o&1&&(ws(0,"span",49),GC(1),pl()),o&2){let e=gC().$implicit;XE(),Yg(e.config.integrationType);}}function we(o,t){if(o&1&&(Sg(0,"input",50),VI()),o&2){let e=gC().$implicit;bg("formControl",e.toolsControl),UI();}}function Se(o,t){if(o&1){let e=lC();ws(0,"div",45)(1,"label",46)(2,"input",47),Rg("change",function(){let c=If(e).$implicit,g=gC(3);return wf(g.toggleIntegration(c))}),pl(),ws(3,"span",48),GC(4),pl(),Jw(5,ye,2,1,"span",49),pl(),Jw(6,we,1,1,"input",50),pl();}if(o&2){let e=t.$implicit;XE(2),bg("checked",e.enabled()),XE(2),Yg(e.config.name),XE(),eC(e.config.integrationType?5:-1),XE(),eC(e.enabled()?6:-1);}}function Me(o,t){if(o&1&&(ws(0,"p",56),GC(1),pl()),o&2){let e=gC().$implicit;XE(),vl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function Ee(o,t){if(o&1){let e=lC();ws(0,"div",45)(1,"label",46)(2,"span",48),GC(3),pl(),ws(4,"span",49),GC(5,"built-in"),pl()(),ws(6,"select",52),Rg("change",function(c){let g=If(e).$implicit,C=gC(4);return wf(C.setBuiltInState(g,c.target.value))}),ws(7,"option",53),GC(8),pl(),ws(9,"option",54),GC(10,"Enabled"),pl(),ws(11,"option",55),GC(12,"Disabled"),pl()(),Jw(13,Me,2,1,"p",56),ws(14,"p",57),GC(15),pl()();}if(o&2){let e=t.$implicit,a=gC(4);XE(),Tg("for","built-in-"+e.type),XE(2),Yg(e.displayName),XE(3),bg("id","built-in-"+e.type)("value",e.state()),XE(2),Yg(a.builtInDefaultLabel(e)),XE(5),eC(e.state()==="on"&&e.restrictedTools?13:-1),XE(2),Yg(e.description);}}function Ae(o,t){if(o&1&&(ws(0,"p",51),GC(1,"Built-in integrations"),pl(),rC(2,Ee,16,7,"div",45,be)),o&2){let e=gC(3);XE(2),oC(e.builtInRows());}}function Ie(o,t){if(o&1&&(ws(0,"fieldset",20)(1,"legend",29),GC(2,"Integrations"),pl(),ws(3,"p",44),GC(4," Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration. "),pl(),rC(5,Se,7,4,"div",45,Ce),Jw(7,Ae,4,0),pl()),o&2){let e=gC(2);XE(5),oC(e.integrationRows()),XE(2),eC(e.builtInRows().length>0?7:-1);}}function Oe(o,t){o&1&&(ws(0,"p",60),GC(1,"Invalid JSON \u2014 please fix the syntax."),pl());}function Pe(o,t){if(o&1&&(ws(0,"div",10)(1,"label",58),GC(2,"Loop configuration (JSON)"),pl(),Sg(3,"textarea",59),VI(),Jw(4,Oe,2,0,"p",60),ws(5,"p",24),GC(6," Default payload for this loop agent. Overridden at launch time if the first message contains a valid "),ws(7,"code",30),GC(8,"AgentLoopPayload"),pl(),GC(9,". Leave empty if you always provide the payload at launch. "),pl()()),o&2){let e=gC(2);XE(3),bg("placeholder",e.loopConfigPlaceholder)("formControl",e.loopConfigControl),UI(),XE(),eC(e.loopConfigControl.invalid&&e.loopConfigControl.touched?4:-1);}}function ke(o,t){if(o&1){let e=lC();ws(0,"li",61),Sg(1,"input",62),VI(),ws(2,"button",63),Rg("click",function(){let c=If(e).$implicit,g=gC(3);return wf(g.removeSubAgent(c))}),GC(3," \u{1F5D1} "),pl()();}if(o&2){let e=t.$implicit;XE(),bg("formControl",e.control),UI();}}function Te(o,t){if(o&1&&(ws(0,"ul",31),rC(1,ke,4,1,"li",61,tC),pl()),o&2){let e=gC(2);XE(),oC(e.subAgentRows());}}function Re(o,t){if(o&1&&GC(0),o&2){let e=gC(2);Qg(" : ",e.defaultDelegationTimeoutSeconds()," s (",e.defaultDelegationTimeoutSeconds()/60," min) ");}}function De(o,t){o&1&&(ws(0,"p",38),GC(1," Enter a valid positive whole number of seconds, or leave empty to inherit the server default. "),pl());}function Ve(o,t){if(o&1){let e=lC();ws(0,"button",64),Rg("click",function(){If(e);let c=gC(2);return wf(c.useDefaultDelegationTimeout())}),GC(1," Use server default "),pl();}}function Ne(o,t){if(o&1){let e=lC();ws(0,"button",65),Rg("click",function(){If(e);let c=gC(2);return wf(c.exportYaml())}),GC(1),pl();}if(o&2){let e=gC(2);bg("disabled",e.isExporting()),XE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Fe(o,t){if(o&1){let e=lC();ws(0,"form",9),Rg("ngSubmit",function(){If(e);let c=gC();return wf(c.submit())}),ws(1,"div",10)(2,"label",11),GC(3,"Name "),ws(4,"span",12),GC(5,"*"),pl()(),Sg(6,"input",13),VI(),pl(),ws(7,"div",10)(8,"label",14),GC(9,"Description"),pl(),Sg(10,"input",15),VI(),pl(),ws(11,"div",10)(12,"label",16),GC(13,"Model name"),pl(),Sg(14,"input",17),VI(),pl(),ws(15,"div",10)(16,"label",18),GC(17,"Instructions"),pl(),Sg(18,"textarea",19),VI(),pl(),Jw(19,Ie,8,1,"fieldset",20),ws(20,"div",10)(21,"label",21),GC(22,"Execution mode"),pl(),ws(23,"select",22)(24,"option",23),GC(25,"SIMPLE \u2014 Standard agent (single LLM call)"),pl(),ws(26,"option",23),GC(27,"ADVANCED \u2014 Multi-step reasoning loop"),pl(),ws(28,"option",23),GC(29,"LOOP \u2014 Bulk loop agent (no LLM, experimental)"),pl()(),VI(),ws(30,"p",24),GC(31,' SIMPLE runs a single LLM pass. ADVANCED uses an intention loop for complex tasks. LOOP (experimental) starts one case per result of a tool, without an LLM \u2014 run it with "Launch loop" in the agent list menu. '),pl()(),Jw(32,Pe,10,3,"div",10),ws(33,"div",10)(34,"label",25),Sg(35,"input",26),VI(),ws(36,"span",27),GC(37,"Enabled"),pl()(),ws(38,"p",28),GC(39,"Disabled agents are excluded from namespace resolution."),pl()(),ws(40,"div",10)(41,"span",29),GC(42,"Sub-agents"),pl(),ws(43,"p",24),GC(44," Glob patterns for agents this agent may delegate to. "),ws(45,"code",30),GC(46,"*"),pl(),GC(47," matches any sequence of characters (e.g. "),ws(48,"code",30),GC(49,"*Fixer"),pl(),GC(50,", "),ws(51,"code",30),GC(52,"*"),pl(),GC(53," for all). Leave empty to disable delegation. "),pl(),Jw(54,Te,3,0,"ul",31),ws(55,"div",32)(56,"input",33),Rg("keydown.enter",function(){If(e);let c=gC();return wf(c.addSubAgent())}),pl(),VI(),ws(57,"button",34),Rg("click",function(){If(e);let c=gC();return wf(c.addSubAgent())}),GC(58," + "),pl()()(),ws(59,"div",10)(60,"label",35),GC(61,"Delegation timeout (seconds)"),pl(),ws(62,"p",36),GC(63," Maximum time for each delegation launched by this agent, including nested delegations. On timeout, the sub-agent and its active descendants are stopped. Leave empty to use the server default "),Jw(64,Re,1,2),GC(65," . "),pl(),Sg(66,"input",37),VI(),Jw(67,De,2,0,"p",38),Jw(68,Ve,2,0,"button",39),pl(),ws(69,"div",40)(70,"button",41),GC(71),pl(),Jw(72,Ne,2,2,"button",42),ws(73,"button",43),Rg("click",function(){If(e);let c=gC();return wf(c.cancel())}),GC(74,"Cancel"),pl()()();}if(o&2){let e=gC();bg("formGroup",e.form),XE(6),bg("formControl",e.nameControl),UI(),XE(4),bg("formControl",e.descriptionControl),UI(),XE(4),bg("formControl",e.modelNameControl),UI(),XE(4),bg("formControl",e.instructionsControl),UI(),XE(),eC(e.integrationRows().length>0||e.builtInRows().length>0?19:-1),XE(4),bg("formControl",e.executionModeControl),UI(),XE(),bg("value",e.ExecutionMode.SIMPLE),XE(2),bg("value",e.ExecutionMode.ADVANCED),XE(2),bg("value",e.ExecutionMode.LOOP),XE(4),eC(e.isLoopMode()?32:-1),XE(3),bg("formControl",e.enabledControl),UI(),XE(19),eC(e.subAgentRows().length>0?54:-1),XE(2),bg("formControl",e.newSubAgentControl),UI(),XE(),bg("disabled",!e.newSubAgentControl.value.trim()),XE(7),eC(e.defaultDelegationTimeoutSeconds()!==null?64:-1),XE(2),bg("formControl",e.delegationTimeoutControl),Tg("aria-invalid",e.delegationTimeoutControl.invalid),UI(),XE(),eC(e.delegationTimeoutControl.invalid?67:-1),XE(),eC(e.delegationTimeoutControl.value!==null?68:-1),XE(2),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create"," "),XE(),eC(e.isEditMode()?72:-1);}}var pe=class o{route=g(V);router=g(G);destroyRef=g(Ce$1);agentConfigController=g(M);defaultsController=g(B);defaultDelegationTimeoutSeconds=Gi(null);exportService=g(J);integrationConfigState=g(N);integrationTypeController=g(F);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]}),description:new _t(null),modelName:new _t(null),instructions:new _t(null),executionMode:new _t("SIMPLE",{nonNullable:true}),delegationTimeoutSeconds:new _t(null,{validators:[_e.min(1),_e.max(2147483647),_e.pattern(/^\d+$/)]}),enabled:new _t(false,{nonNullable:true}),loopConfig:new _t(null,{validators:[o.jsonValidator]})});static jsonValidator(t){let e=t.value?.trim();if(!e)return null;try{return JSON.parse(e),null}catch(a){return {invalidJson:true}}}get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get executionModeControl(){return this.form.controls.executionMode}get delegationTimeoutControl(){return this.form.controls.delegationTimeoutSeconds}useDefaultDelegationTimeout(){this.delegationTimeoutControl.setValue(null),this.delegationTimeoutControl.markAsDirty();}get enabledControl(){return this.form.controls.enabled}get loopConfigControl(){return this.form.controls.loopConfig}executionModeValue=F$1(this.form.controls.executionMode.valueChanges,{initialValue:this.form.controls.executionMode.value});isLoopMode=mT(()=>this.executionModeValue()==="LOOP");subAgentRows=Gi([]);newSubAgentControl=new _t("",{nonNullable:true});isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);isExporting=Gi(false);ExecutionMode=ve$1;loopConfigPlaceholder=JSON.stringify({search:{tool:"SearchTalents",params:{talentId:["6ac76692a909eaaae0b078d6"],resolveTargets:["MANAGER"],next:null}},act:{agentName:"ProfileCaretaker",promptTemplate:"This talent has not completed their profile. As their manager, I need you to help me review and improve it."}},null,2);builtInRows=Gi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}integrationRows=Gi([]);existingConfig=null;ngOnInit(){this.defaultsController.getAgentConfigDefaults().pipe(U(this.destroyRef),ya(()=>br(null))).subscribe(e=>this.defaultDelegationTimeoutSeconds.set(e?.delegationTimeoutSeconds??null));let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),By({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes()}).pipe(U(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:a,platformIntegrations:c,builtInTypes:g})=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null);let C=e.executionMode??(e.advancedExecution?"ADVANCED":"SIMPLE");this.executionModeControl.setValue(C),this.delegationTimeoutControl.setValue(e.delegationTimeoutSeconds??null),this.enabledControl.setValue(e.enabled??true),this.loopConfigControl.setValue(e.loopConfig!=null?JSON.stringify(e.loopConfig,null,2):null);let T=[...c,...a];this.integrationRows.set(this.buildIntegrationRows(T,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(g,e.integrations??void 0)),this.subAgentRows.set((e.subAgents??[]).map(_e=>({control:new _t(_e,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){By({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes()}).pipe(U(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:a,builtInTypes:c})=>{let g=[...a,...e];this.integrationRows.set(this.buildIntegrationRows(g,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(c,t??void 0));}});}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(re(t=>t.filter(e=>!e.configSchema)),ya(t=>(console.error("[agent-config-form] failed to load integration types",t),br([]))))}buildIntegrationRows(t,e){return t.map(a=>{let c=a.name??"",g=e?.[c],C=e!=null&&c in e,T=Array.isArray(g)?g.join(", "):"";return {config:a,enabled:Gi(C),toolsControl:new _t(T,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(a=>{let c=e!=null&&a.type in e,g=e?.[a.type],C=c?Array.isArray(g)&&g.length===0?"off":"on":"default";return {type:a.type,displayName:a.displayName,description:a.description,enabledByDefault:a.enabledByDefault===true,state:Gi(C),restrictedTools:Array.isArray(g)&&g.length>0?g:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();t&&(this.subAgentRows.update(e=>[...e,{control:new _t(t,{nonNullable:true})}]),this.newSubAgentControl.reset(""));}removeSubAgent(t){this.subAgentRows.update(e=>e.filter(a=>a!==t));}buildSubAgentsPayload(){let t=this.subAgentRows().map(e=>e.control.value.trim()).filter(e=>e.length>0);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let a of this.integrationRows().filter(c=>c.enabled())){let c=a.config.name??"",g=a.toolsControl.value.trim();t[c]=g===""?null:g.split(",").map(C=>C.trim()).filter(C=>C.length>0);}for(let a of this.builtInRows()){let c=a.state();c==="on"?t[a.type]=a.restrictedTools??null:c==="off"&&(t[a.type]=[]);}let e=new Set([...this.integrationRows().map(a=>a.config.name??""),...this.builtInRows().map(a=>a.type)]);for(let[a,c]of Object.entries(this.existingConfig?.integrations??{}))e.has(a)||(t[a]=c);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.isSubmitting.set(true);let t=x(w({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),executionMode:this.executionModeControl.value,advancedExecution:this.executionModeControl.value==="ADVANCED",enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload(),delegationTimeoutSeconds:this.delegationTimeoutControl.value,loopConfig:this.buildLoopConfigPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let a=new Blob([e],{type:"application/yaml"}),c=URL.createObjectURL(a),g=document.createElement("a");g.href=c,g.download=`${this.existingConfig?.name??"agent"}.yaml`,g.click(),URL.revokeObjectURL(c),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}buildLoopConfigPayload(){let t=this.loopConfigControl.value?.trim();if(!t)return this.existingConfig?.loopConfig!=null?null:void 0;try{return JSON.parse(t)}catch(e){return}}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-agent-config-form"]],decls:12,vars:4,consts:[[1,"agent-config-form"],[1,"agent-config-form__header"],["type","button","title","Back to agent configs",1,"agent-config-form__back",3,"click"],[1,"agent-config-form__back-icon"],[1,"agent-config-form__title"],[1,"agent-config-form__sibling-link",3,"routerLink"],[1,"agent-config-form__platform-badge"],[1,"agent-config-form__loading"],[1,"agent-config-form__form",3,"formGroup"],[1,"agent-config-form__form",3,"ngSubmit","formGroup"],[1,"agent-config-form__field"],["for","agent-config-name",1,"agent-config-form__label"],["aria-hidden","true"],["id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-description",1,"agent-config-form__label"],["id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-model-name",1,"agent-config-form__label"],["id","agent-config-model-name","type","text","placeholder","Optional \u2014 model alias or name to use","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-instructions",1,"agent-config-form__label"],["id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",1,"agent-config-form__textarea",3,"formControl"],[1,"agent-config-form__integrations"],["for","agent-config-execution-mode",1,"agent-config-form__label"],["id","agent-config-execution-mode",1,"agent-config-form__select",3,"formControl"],[3,"value"],[1,"agent-config-form__field-hint"],[1,"agent-config-form__toggle-label"],["type","checkbox",1,"agent-config-form__toggle-checkbox",3,"formControl"],[1,"agent-config-form__toggle-text"],[1,"agent-config-form__toggle-hint"],[1,"agent-config-form__label"],[1,"agent-config-form__code"],[1,"agent-config-form__sub-agent-list"],[1,"agent-config-form__sub-agent-add"],["type","text","placeholder","e.g. *Fixer or *","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"keydown.enter","formControl"],["type","button","title","Add pattern",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--add",3,"click","disabled"],["for","delegation-timeout",1,"agent-config-form__label"],["id","delegation-timeout-hint",1,"agent-config-form__field-hint"],["id","delegation-timeout","type","number","min","1","max","2147483647","step","1","placeholder","Server default","aria-describedby","delegation-timeout-hint delegation-timeout-error",1,"agent-config-form__input",3,"formControl"],["id","delegation-timeout-error","role","alert",1,"agent-config-form__field-hint"],["type","button",1,"agent-config-form__sub-agent-btn"],[1,"agent-config-form__actions"],["type","submit",1,"agent-config-form__btn","agent-config-form__btn--primary",3,"disabled"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"disabled"],["type","button",1,"agent-config-form__btn",3,"click"],[1,"agent-config-form__integrations-hint"],[1,"agent-config-form__integration-row"],[1,"agent-config-form__integration-toggle"],["type","checkbox",1,"agent-config-form__integration-checkbox",3,"change","checked"],[1,"agent-config-form__integration-name"],[1,"agent-config-form__integration-type"],["type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"agent-config-form__input","agent-config-form__integration-tools",3,"formControl"],[1,"agent-config-form__integrations-separator"],[1,"agent-config-form__integration-state",3,"change","id","value"],["value","default"],["value","on"],["value","off"],[1,"agent-config-form__integration-restriction"],[1,"agent-config-form__integration-builtin-desc"],["for","agent-config-loop-config",1,"agent-config-form__label"],["id","agent-config-loop-config","rows","10","spellcheck","false","autocomplete","off",1,"agent-config-form__textarea","agent-config-form__textarea--mono",3,"placeholder","formControl"],["role","alert",1,"agent-config-form__field-error"],[1,"agent-config-form__sub-agent-row"],["type","text","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"formControl"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger",3,"click"],["type","button",1,"agent-config-form__sub-agent-btn",3,"click"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"click","disabled"]],template:function(e,a){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return a.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Agent Configs "),pl(),ws(6,"h1",4),GC(7),pl(),Jw(8,xe,2,1,"a",5),Jw(9,he,2,0,"span",6),pl(),Jw(10,ve,2,0,"p",7)(11,Fe,75,23,"form",8),pl()),e&2&&(XE(7),Yg(a.isEditMode()?"Edit agent config":"New agent config"),XE(),eC(a.isEditMode()?8:-1),XE(),eC(a.isPlatformMode?9:-1),XE(),eC(a.isLoading()?10:11));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Wt,Cn,En,si],styles:[".agent-config-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.agent-config-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.agent-config-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.agent-config-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-accent);text-decoration:none}.agent-config-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__platform-badge[_ngcontent-%COMP%]{display:inline-block;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:var(--color-surface);border:1px solid var(--color-divider);border-radius:0;padding:.125rem .5rem;letter-spacing:.02em;align-self:flex-start}.agent-config-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.agent-config-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.agent-config-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.agent-config-form__input[_ngcontent-%COMP%], .agent-config-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.agent-config-form__input[_ngcontent-%COMP%]:focus, .agent-config-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__input[_ngcontent-%COMP%]::placeholder, .agent-config-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.agent-config-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px;line-height:1.5}.agent-config-form__textarea--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.8125rem}.agent-config-form__field-error[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-error, var(--red, #dc2626));line-height:1.4}.agent-config-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;cursor:pointer;transition:border-color .15s ease;appearance:auto}.agent-config-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__integrations[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.agent-config-form__integrations-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__integration-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__integration-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__integration-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__integration-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__integration-type[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:monospace}.agent-config-form__integration-tools[_ngcontent-%COMP%]{margin-left:1.5rem;font-size:.875rem}.agent-config-form__integrations-separator[_ngcontent-%COMP%]{margin:.25rem 0 0;padding-top:.5rem;border-top:1px solid var(--color-divider);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);font-family:var(--font-heading)}.agent-config-form__integration-state[_ngcontent-%COMP%]{margin-left:1.5rem;padding:.375rem .625rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.875rem;font-family:inherit;outline:none;transition:border-color .15s ease}.agent-config-form__integration-state[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.agent-config-form__integration-restriction[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;font-style:italic;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-form__integration-builtin-desc[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__field-hint[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:0}.agent-config-form__sub-agent-list[_ngcontent-%COMP%]{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.375rem}.agent-config-form__sub-agent-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem}.agent-config-form__sub-agent-input[_ngcontent-%COMP%]{flex:1;min-width:0}.agent-config-form__sub-agent-add[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;margin-top:.5rem}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]{flex-shrink:0;width:2rem;height:2rem;padding:0;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text-secondary);font-size:.9rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s ease,border-color .15s ease,color .15s ease}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500);color:var(--color-text)}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:not-allowed}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]{width:2rem;height:2rem;font-size:1.25rem;font-weight:300;border-color:var(--color-accent);color:var(--color-accent)}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent);color:#fff}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]{border:1px solid transparent;color:var(--color-neutral-500)}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--red);color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent)}.agent-config-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.agent-config-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.agent-config-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.agent-config-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.agent-config-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.agent-config-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{pe as AgentConfigFormComponent};
@@ -1,4 +1,4 @@
1
- import {x as xe}from'./chunk-C3VwqpzN.js';import {P as Pt$1,L as Lt}from'./chunk-DHxop1LM.js';import {v as ve,n as ne}from'./chunk-qvvMVV4R.js';import {d}from'./chunk-CFGJRCis.js';import {W,k as ke,s as se}from'./chunk-7fOouIuV.js';import {T as Tn,S as Sn,n as nt,a as ae,l as le,c as ce}from'./chunk-CLWw22I9.js';import {$ as $n,o as ot,i as it,I as In,E as Ee,z as ze,v as va,D as Dn,F as Fn,g as gt$1,A as An}from'./chunk-DSIStEbo.js';import'./chunk-BpSy6uuY.js';import {g,bm as Mm,R as Re,a as Gi,m as mT,e as xw,h as hr,j as Gn,k as ws,q as Rg,n as GC,o as pl,a3 as VI,J as Jw,af as Eg,ag as fT,u as CC,X as XE,v as bg,a6 as UI,y as eC,Z as z,_ as Ue,am as qm,$ as zt$1,a0 as jt$1,a1 as Vt,a2 as Nt$1,i as pr,ai as tm,aj as KC,t as rC,a8 as Yg,ak as em,z as oC,a5 as vl,ac as gC,a9 as lC,aa as If,ab as wf,bp as ml,bq as yl,ah as rT,b4 as oT,aL as wo,aM as Zn$1,br as sn,aO as wt$1,bs as Tl,bt as Qn,aT as Ut$1,al as vt$1,aW as C,bu as Ve,aZ as js,a_ as QT,b5 as nT,T as Tg,A as Ug,bv as Fg,E as EC,I as IC,az as Xt$1,bw as St,aS as K$1,aX as D$1,bx as on,by as um,bz as Oi,bA as yC,bB as vC,S as Sg,D as Pg,bC as Si,bo as tC}from'./main-5YX2WY5Q.js';import {y as yt$1,w as wt,t as ti,Z as Zn,c as cn,Y as Ye,f as fn,g as gt,$ as $t$1,D}from'./chunk-wi-CxI3Z.js';var Pt=["button"],Ot=["*"];function Ft(l,a){if(l&1&&(ws(0,"div",2),Sg(1,"mat-pseudo-checkbox",6),pl()),l&2){let e=gC();XE(),bg("disabled",e.disabled);}}var yt=new C("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:()=>({hideSingleSelectionIndicator:false,hideMultipleSelectionIndicator:false,disabledInteractive:false})}),vt=new C("MatButtonToggleGroup"),Dt={provide:D,useExisting:Si(()=>ie),multi:true},K=class{source;value;constructor(a,e){this.source=a,this.value=e;}},ie=(()=>{class l{_changeDetector=g(Tl);_dir=g(Qn,{optional:true});_multiple=false;_disabled=false;_disabledInteractive=false;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck();}_name=g(Ut$1).getId("mat-button-toggle-group-");vertical=false;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(t=>t.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value);}valueChange=new vt$1;get selected(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck();}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck();}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck();}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new vt$1;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck();}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck();}_hideMultipleSelectionIndicator;constructor(){let e=g(yt,{optional:true});this.appearance=e&&e.appearance?e.appearance:"standard",this._hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??false,this._hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??false;}ngOnInit(){this._selectionModel=new gt$1(this.multiple,void 0,false);}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex();}writeValue(e){this.value=e,this._changeDetector.markForCheck();}registerOnChange(e){this._controlValueAccessorChangeFn=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e;}_keydown(e){if(this.multiple||this.disabled||Ve(e))return;let n=e.target.id,o=this._buttonToggles.toArray().findIndex(I=>I.buttonId===n),u=null;switch(e.keyCode){case 32:case 13:u=this._buttonToggles.get(o)||null;break;case 38:u=this._getNextButton(o,-1);break;case 37:u=this._getNextButton(o,this.dir==="ltr"?-1:1);break;case 40:u=this._getNextButton(o,1);break;case 39:u=this._getNextButton(o,this.dir==="ltr"?1:-1);break;default:return}u&&(e.preventDefault(),u._onButtonClick(),u.focus());}_emitChangeEvent(e){let t=new K(e,this.value);this._rawValue=t.value,this._controlValueAccessorChangeFn(t.value),this.change.emit(t);}_syncButtonToggle(e,t,n=false,o=false){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=false),this._selectionModel?t?this._selectionModel.select(e):this._selectionModel.deselect(e):o=true,o?Promise.resolve().then(()=>this._updateModelValue(e,n)):this._updateModelValue(e,n);}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return typeof this._rawValue>"u"?false:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(t=>e.value!=null&&t===e.value):e.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1;}),this.selected)this.selected.tabIndex=0;else for(let e=0;e<this._buttonToggles.length;e++){let t=this._buttonToggles.get(e);if(!t.disabled){t.tabIndex=0;break}}}_getNextButton(e,t){let n=this._buttonToggles;for(let o=1;o<=n.length;o++){let u=(e+t*o+n.length)%n.length,I=n.get(u);if(I&&!I.disabled)return I}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let t=this._buttonToggles.toArray();if(this.multiple&&e?(this._clearSelection(),e.forEach(n=>this._selectValue(n,t))):(this._clearSelection(),this._selectValue(e,t)),!this.multiple&&t.every(n=>n.tabIndex===-1)){for(let n of t)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=false,this.multiple||(e.tabIndex=-1);});}_selectValue(e,t){for(let n of t)if(n.value===e){n.checked=true,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(e,t){t&&this._emitChangeEvent(e),this.valueChange.emit(this.value);}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck());}static \u0275fac=function(t){return new(t||l)};static \u0275dir=js({type:l,selectors:[["mat-button-toggle-group"]],contentQueries:function(t,n,o){if(t&1&&Fg(o,X,5),t&2){let u;EC(u=IC())&&(n._buttonToggles=u);}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(t,n){t&1&&Rg("keydown",function(u){return n._keydown(u)}),t&2&&(Tg("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),Ug("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"));},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",QT],value:"value",multiple:[2,"multiple","multiple",QT],disabled:[2,"disabled","disabled",QT],disabledInteractive:[2,"disabledInteractive","disabledInteractive",QT],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",QT]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[nT([Dt,{provide:vt,useExisting:l}])]})}return l})(),X=(()=>{class l{_changeDetectorRef=g(Tl);_elementRef=g(Xt$1);_focusMonitor=g(St);_idGenerator=g(Ut$1);_animationDisabled=K$1();_checked=false;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return `${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(e){this._tabIndex.set(e);}_tabIndex;disableRipple=false;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e;}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck());}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e;}_disabled=false;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e;}_disabledInteractive;change=new vt$1;constructor(){g(D$1).load(on);let e=g(vt,{optional:true}),t=g(new um("tabindex"),{optional:true})||"",n=g(yt,{optional:true});this._tabIndex=Gi(parseInt(t)||0),this.buttonToggleGroup=e,this._appearance=n&&n.appearance?n.appearance:"standard",this._disabledInteractive=n?.disabledInteractive??false;}ngOnInit(){let e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=true:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked));}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,true);}ngOnDestroy(){let e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,false,false,true);}focus(e){this._buttonElement.nativeElement.focus(e);}_onButtonClick(){if(this.disabled)return;let e=this.isSingleSelector()?true:!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,true),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let t=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);t&&(t.tabIndex=-1),this.tabIndex=0;}this.change.emit(new K(this,this.value));}_markForCheck(){this._changeDetectorRef.markForCheck();}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=xw({type:l,selectors:[["mat-button-toggle"]],viewQuery:function(t,n){if(t&1&&Pg(Pt,5),t&2){let o;EC(o=IC())&&(n._buttonElement=o.first);}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(t,n){t&1&&Rg("focus",function(){return n.focus()}),t&2&&(Tg("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),Ug("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"));},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",QT],appearance:"appearance",checked:[2,"checked","checked",QT],disabled:[2,"disabled","disabled",QT],disabledInteractive:[2,"disabledInteractive","disabledInteractive",QT]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:Ot,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(t,n){if(t&1&&(yC(),ws(0,"button",1,0),Rg("click",function(){return n._onButtonClick()}),Jw(2,Ft,2,1,"div",2),ws(3,"span",3),vC(4),pl()(),Sg(5,"span",4)(6,"span",5)),t&2){let o=CC(1);bg("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),Tg("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),XE(2),eC(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),XE(4),bg("matRippleTrigger",o)("matRippleDisabled",n.disableRipple||n.disabled);}},dependencies:[Oi,An],styles:[`.mat-button-toggle-standalone,
1
+ import {x as xe}from'./chunk-DTUH09cB.js';import {P as Pt$1,L as Lt}from'./chunk-C64Jkhq7.js';import {v as ve,n as ne}from'./chunk-BXTkwOIw.js';import {d}from'./chunk-CaqvmGfj.js';import {W,k as ke,s as se}from'./chunk-BLZrsqKB.js';import {T as Tn,S as Sn,n as nt,a as ae,l as le,c as ce}from'./chunk-B9YlDOE0.js';import {$ as $n,o as ot,i as it,I as In,E as Ee,z as ze,v as va,D as Dn,F as Fn,g as gt$1,A as An}from'./chunk-DRgqn-qP.js';import'./chunk-CD-fmXp6.js';import {g,bm as Mm,R as Re,a as Gi,m as mT,e as xw,h as hr,j as Gn,k as ws,q as Rg,n as GC,o as pl,a3 as VI,J as Jw,af as Eg,ag as fT,u as CC,X as XE,v as bg,a6 as UI,y as eC,Z as z,_ as Ue,am as qm,$ as zt$1,a0 as jt$1,a1 as Vt,a2 as Nt$1,i as pr,ai as tm,aj as KC,t as rC,a8 as Yg,ak as em,z as oC,a5 as vl,ac as gC,a9 as lC,aa as If,ab as wf,bp as ml,bq as yl,ah as rT,b4 as oT,aL as wo,aM as Zn$1,br as sn,aO as wt$1,bs as Tl,bt as Qn,aT as Ut$1,al as vt$1,aW as C,bu as Ve,aZ as js,a_ as QT,b5 as nT,T as Tg,A as Ug,bv as Fg,E as EC,I as IC,az as Xt$1,bw as St,aS as K$1,aX as D$1,bx as on,by as um,bz as Oi,bA as yC,bB as vC,S as Sg,D as Pg,bC as Si,bo as tC}from'./main-YUNT4ZXI.js';import {y as yt$1,w as wt,t as ti,Z as Zn,c as cn,Y as Ye,f as fn,g as gt,$ as $t$1,D}from'./chunk-Rs6cK9ku.js';var Pt=["button"],Ot=["*"];function Ft(l,a){if(l&1&&(ws(0,"div",2),Sg(1,"mat-pseudo-checkbox",6),pl()),l&2){let e=gC();XE(),bg("disabled",e.disabled);}}var yt=new C("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:()=>({hideSingleSelectionIndicator:false,hideMultipleSelectionIndicator:false,disabledInteractive:false})}),vt=new C("MatButtonToggleGroup"),Dt={provide:D,useExisting:Si(()=>ie),multi:true},K=class{source;value;constructor(a,e){this.source=a,this.value=e;}},ie=(()=>{class l{_changeDetector=g(Tl);_dir=g(Qn,{optional:true});_multiple=false;_disabled=false;_disabledInteractive=false;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck();}_name=g(Ut$1).getId("mat-button-toggle-group-");vertical=false;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(t=>t.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value);}valueChange=new vt$1;get selected(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck();}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck();}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck();}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new vt$1;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck();}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck();}_hideMultipleSelectionIndicator;constructor(){let e=g(yt,{optional:true});this.appearance=e&&e.appearance?e.appearance:"standard",this._hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??false,this._hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??false;}ngOnInit(){this._selectionModel=new gt$1(this.multiple,void 0,false);}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex();}writeValue(e){this.value=e,this._changeDetector.markForCheck();}registerOnChange(e){this._controlValueAccessorChangeFn=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e;}_keydown(e){if(this.multiple||this.disabled||Ve(e))return;let n=e.target.id,o=this._buttonToggles.toArray().findIndex(I=>I.buttonId===n),u=null;switch(e.keyCode){case 32:case 13:u=this._buttonToggles.get(o)||null;break;case 38:u=this._getNextButton(o,-1);break;case 37:u=this._getNextButton(o,this.dir==="ltr"?-1:1);break;case 40:u=this._getNextButton(o,1);break;case 39:u=this._getNextButton(o,this.dir==="ltr"?1:-1);break;default:return}u&&(e.preventDefault(),u._onButtonClick(),u.focus());}_emitChangeEvent(e){let t=new K(e,this.value);this._rawValue=t.value,this._controlValueAccessorChangeFn(t.value),this.change.emit(t);}_syncButtonToggle(e,t,n=false,o=false){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=false),this._selectionModel?t?this._selectionModel.select(e):this._selectionModel.deselect(e):o=true,o?Promise.resolve().then(()=>this._updateModelValue(e,n)):this._updateModelValue(e,n);}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return typeof this._rawValue>"u"?false:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(t=>e.value!=null&&t===e.value):e.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1;}),this.selected)this.selected.tabIndex=0;else for(let e=0;e<this._buttonToggles.length;e++){let t=this._buttonToggles.get(e);if(!t.disabled){t.tabIndex=0;break}}}_getNextButton(e,t){let n=this._buttonToggles;for(let o=1;o<=n.length;o++){let u=(e+t*o+n.length)%n.length,I=n.get(u);if(I&&!I.disabled)return I}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let t=this._buttonToggles.toArray();if(this.multiple&&e?(this._clearSelection(),e.forEach(n=>this._selectValue(n,t))):(this._clearSelection(),this._selectValue(e,t)),!this.multiple&&t.every(n=>n.tabIndex===-1)){for(let n of t)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=false,this.multiple||(e.tabIndex=-1);});}_selectValue(e,t){for(let n of t)if(n.value===e){n.checked=true,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(e,t){t&&this._emitChangeEvent(e),this.valueChange.emit(this.value);}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck());}static \u0275fac=function(t){return new(t||l)};static \u0275dir=js({type:l,selectors:[["mat-button-toggle-group"]],contentQueries:function(t,n,o){if(t&1&&Fg(o,X,5),t&2){let u;EC(u=IC())&&(n._buttonToggles=u);}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(t,n){t&1&&Rg("keydown",function(u){return n._keydown(u)}),t&2&&(Tg("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),Ug("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"));},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",QT],value:"value",multiple:[2,"multiple","multiple",QT],disabled:[2,"disabled","disabled",QT],disabledInteractive:[2,"disabledInteractive","disabledInteractive",QT],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",QT]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[nT([Dt,{provide:vt,useExisting:l}])]})}return l})(),X=(()=>{class l{_changeDetectorRef=g(Tl);_elementRef=g(Xt$1);_focusMonitor=g(St);_idGenerator=g(Ut$1);_animationDisabled=K$1();_checked=false;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return `${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(e){this._tabIndex.set(e);}_tabIndex;disableRipple=false;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e;}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck());}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e;}_disabled=false;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e;}_disabledInteractive;change=new vt$1;constructor(){g(D$1).load(on);let e=g(vt,{optional:true}),t=g(new um("tabindex"),{optional:true})||"",n=g(yt,{optional:true});this._tabIndex=Gi(parseInt(t)||0),this.buttonToggleGroup=e,this._appearance=n&&n.appearance?n.appearance:"standard",this._disabledInteractive=n?.disabledInteractive??false;}ngOnInit(){let e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=true:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked));}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,true);}ngOnDestroy(){let e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,false,false,true);}focus(e){this._buttonElement.nativeElement.focus(e);}_onButtonClick(){if(this.disabled)return;let e=this.isSingleSelector()?true:!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,true),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let t=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);t&&(t.tabIndex=-1),this.tabIndex=0;}this.change.emit(new K(this,this.value));}_markForCheck(){this._changeDetectorRef.markForCheck();}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=xw({type:l,selectors:[["mat-button-toggle"]],viewQuery:function(t,n){if(t&1&&Pg(Pt,5),t&2){let o;EC(o=IC())&&(n._buttonElement=o.first);}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(t,n){t&1&&Rg("focus",function(){return n.focus()}),t&2&&(Tg("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),Ug("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"));},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",QT],appearance:"appearance",checked:[2,"checked","checked",QT],disabled:[2,"disabled","disabled",QT],disabledInteractive:[2,"disabledInteractive","disabledInteractive",QT]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:Ot,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(t,n){if(t&1&&(yC(),ws(0,"button",1,0),Rg("click",function(){return n._onButtonClick()}),Jw(2,Ft,2,1,"div",2),ws(3,"span",3),vC(4),pl()(),Sg(5,"span",4)(6,"span",5)),t&2){let o=CC(1);bg("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),Tg("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),XE(2),eC(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),XE(4),bg("matRippleTrigger",o)("matRippleDisabled",n.disableRipple||n.disabled);}},dependencies:[Oi,An],styles:[`.mat-button-toggle-standalone,
2
2
  .mat-button-toggle-group {
3
3
  position: relative;
4
4
  display: inline-flex;