@whoz-oss/coday-client 3.33.1 → 3.34.1

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 (79) hide show
  1. package/browser/{chunk-DmspnNZU.js → chunk-1pMMl5aQ.js} +1 -1
  2. package/browser/{chunk-CCjiYUwJ.js → chunk-24Rqvp-B.js} +1 -1
  3. package/browser/{chunk-DoBiZHJP.js → chunk-3SjkoJQ2.js} +1 -1
  4. package/browser/{chunk-Xqo-i29q.js → chunk-6yN7LoqT.js} +1 -1
  5. package/browser/{chunk-Dq_iutg_.js → chunk-8bJEDZYk.js} +1 -1
  6. package/browser/{chunk-DRINXf1H.js → chunk-9B6pDYGf.js} +1 -1
  7. package/browser/{chunk-DKZE1MMp.js → chunk-9Y4DMIzP.js} +1 -1
  8. package/browser/{chunk-BfgOvSfj.js → chunk-B0wi4IQ8.js} +1 -1
  9. package/browser/{chunk-ZI_RF6mJ.js → chunk-B1h8Rr_L.js} +1 -1
  10. package/browser/{chunk-CgZso3Sn.js → chunk-B400uKLU.js} +1 -1
  11. package/browser/{chunk-BVHP3O1y.js → chunk-B4GIoG1U.js} +1 -1
  12. package/browser/{chunk-DTO-7qsb.js → chunk-BAHGxBjI.js} +1 -1
  13. package/browser/{chunk-Dg2L56ka.js → chunk-BByguAe9.js} +1 -1
  14. package/browser/{chunk-CrDpiJQ_.js → chunk-BECO5DZL.js} +1 -1
  15. package/browser/{chunk-CfLw6giw.js → chunk-BEoycX98.js} +1 -1
  16. package/browser/{chunk-vuYNru7F.js → chunk-BHtGbjK6.js} +1 -1
  17. package/browser/{chunk-WJVIVGQ_.js → chunk-BK-SvUGW.js} +1 -1
  18. package/browser/chunk-BLltB5Fl.js +1 -0
  19. package/browser/{chunk-s2nIreh9.js → chunk-BOwbpQDE.js} +1 -1
  20. package/browser/{chunk-97Ur9CVM.js → chunk-B_wrSH-e.js} +1 -1
  21. package/browser/{chunk-DSWc3xOX.js → chunk-Begup16p.js} +1 -1
  22. package/browser/{chunk-BwA9KDbo.js → chunk-BqbE20yc.js} +1 -1
  23. package/browser/{chunk-DrktTXS1.js → chunk-BscGFXSw.js} +1 -1
  24. package/browser/{chunk-Fswp1zS2.js → chunk-Bt_Yi0KO.js} +1 -1
  25. package/browser/{chunk-6LX0m2KK.js → chunk-BvggdF8d.js} +1 -1
  26. package/browser/{chunk-7OibMkdV.js → chunk-C5xuZf5R.js} +1 -1
  27. package/browser/{chunk-BA-NscEe.js → chunk-C7OQXeW9.js} +1 -1
  28. package/browser/{chunk--u1fh-bE.js → chunk-C8eqogQ9.js} +1 -1
  29. package/browser/{chunk-CWhMBwZt.js → chunk-CDyIhHOt.js} +1 -1
  30. package/browser/{chunk-D1wn67qT.js → chunk-CGjjc55P.js} +6 -6
  31. package/browser/{chunk-ByHd8LOC.js → chunk-CJCjJyKP.js} +1 -1
  32. package/browser/{chunk-nyQxv1ai.js → chunk-CLaD3yHE.js} +1 -1
  33. package/browser/{chunk-CrtwjGyv.js → chunk-CMjxkuFH.js} +2 -2
  34. package/browser/{chunk-Bdo-PzpO.js → chunk-CS3cO2Tx.js} +1 -1
  35. package/browser/{chunk-BgHBODRL.js → chunk-CT8vu_Pw.js} +1 -1
  36. package/browser/{chunk-I798FyiF.js → chunk-CThe5GoQ.js} +1 -1
  37. package/browser/{chunk-CY4cIdrD.js → chunk-CX3BRjB5.js} +1 -1
  38. package/browser/{chunk-KJgXoqSt.js → chunk-CXqNbVXr.js} +1 -1
  39. package/browser/{chunk-CaZu6-ik.js → chunk-CZe6uHRZ.js} +1 -1
  40. package/browser/{chunk-tpkg6uRN.js → chunk-Ceb8iCgi.js} +1 -1
  41. package/browser/{chunk-DFN1Pyx5.js → chunk-Ci0veFyD.js} +1 -1
  42. package/browser/{chunk-BYRF4k2F.js → chunk-CqTTbhQw.js} +1 -1
  43. package/browser/{chunk-XRvc0QGl.js → chunk-D-bfzu2J.js} +1 -1
  44. package/browser/{chunk-BMMVal6G.js → chunk-DE0C-yKk.js} +1 -1
  45. package/browser/{chunk-CvSL9m7J.js → chunk-DFjEHH4o.js} +1 -1
  46. package/browser/{chunk-DzIeB2JV.js → chunk-DGUwcds6.js} +1 -1
  47. package/browser/{chunk-CDVp9M5o.js → chunk-DH80wnhH.js} +1 -1
  48. package/browser/{chunk-BAW4T6Di.js → chunk-DLpC4uuD.js} +1 -1
  49. package/browser/chunk-DOeIIw1a.js +1 -0
  50. package/browser/{chunk-Bb0cfZpR.js → chunk-DS1gnXQd.js} +1 -1
  51. package/browser/{chunk-BR2UGTBA.js → chunk-DUTqrLQ0.js} +2 -2
  52. package/browser/{chunk-amKg4vsy.js → chunk-DVK2B443.js} +1 -1
  53. package/browser/chunk-DY8YywkA.js +1 -0
  54. package/browser/{chunk-BvidtKG2.js → chunk-DdPOtjZp.js} +5 -5
  55. package/browser/{chunk-qnkDdlfN.js → chunk-DfHrtnxD.js} +1 -1
  56. package/browser/{chunk-DRl5lKc8.js → chunk-DmpFu0Pv.js} +1 -1
  57. package/browser/{chunk-Bp6uMEC4.js → chunk-Dn1IeSER.js} +1 -1
  58. package/browser/{chunk-BuwCQJib.js → chunk-DpjNfc-X.js} +1 -1
  59. package/browser/{chunk-BrwKLScI.js → chunk-DvkkGOWr.js} +1 -1
  60. package/browser/{chunk-D0hAJFb0.js → chunk-Dy3jpvsK.js} +1 -1
  61. package/browser/chunk-DzRcZL5W.js +4 -0
  62. package/browser/{chunk-DngrH8va.js → chunk-O_d524Nl.js} +1 -1
  63. package/browser/chunk-U55ggdv9.js +1 -0
  64. package/browser/{chunk-DMb_O3oJ.js → chunk-ZnMmRxVz.js} +1 -1
  65. package/browser/{chunk-D2JaJwBk.js → chunk-_pYIE7Vn.js} +1 -1
  66. package/browser/{chunk-DYl74_xV.js → chunk-b-dxVOcr.js} +1 -1
  67. package/browser/{chunk-BJy7Ev8t.js → chunk-e71Ldo0f.js} +1 -1
  68. package/browser/{chunk-gfpawxnm.js → chunk-heXluV0a.js} +1 -1
  69. package/browser/{chunk-zoDBYyjf.js → chunk-iFWDza_l.js} +1 -1
  70. package/browser/{chunk-Dl_uhmYA.js → chunk-qlZmtZOW.js} +1 -1
  71. package/browser/{chunk-Cjnbx8x8.js → chunk-x_UzK7O8.js} +1 -1
  72. package/browser/index.html +1 -1
  73. package/browser/{main-COD2LZKB.js → main-GYSPY3UE.js} +1 -1
  74. package/package.json +1 -1
  75. package/browser/chunk-2e1XJLC3.js +0 -1
  76. package/browser/chunk-DHVomWlH.js +0 -1
  77. package/browser/chunk-DQhceK5b.js +0 -4
  78. package/browser/chunk-DkYkMN4g.js +0 -1
  79. package/browser/chunk-JXiqGD2F.js +0 -1
@@ -1,4 +1,4 @@
1
- import {ct as vi,e as xw,T as Tg,A as Ug,aL as wo,aM as Zn,bE as vt,aO as wt,cZ as fn,cT as Gp,c_ as he$1,cV as vg,bA as yC,k as ws,bB as vC,o as pl,b5 as nT,ad as Hg,J as Jw,y as eC,X as XE,aW as C,bv as Fg,E as EC,I as IC,g,az as Xt$1,c$ as kn,bw as St,bG as p,aP as G,aR as Fs,aU as Ue,aV as U,a as Gi,an as ue,al as vt$1,ae as kt,r as re$1,d0 as Ea,bL as pe,bs as Tl,ap as wd,bu as Ve$1,c2 as ME,aA as an,D as Pg,bt as Qn,aS as K,cO as us,bN as F,bR as Id,cL as vd,bP as Wy,a9 as lC,q as Rg,ac as gC,bV as Zy,aN as Nn,bD as ge,aQ as $a,bM as mr,d1 as lt,d2 as wt$1,d3 as I,b_ as xt,bX as Pt,w,aZ as js,aw as hl,cJ as Og,n as GC,ax as gl,b$ as kC,a8 as Yg,c3 as kt$1,cD as Te,cz as to,aa as If,ab as wf}from'./main-COD2LZKB.js';var Xt=["tooltip"],Ut=20;var qt=new C("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let n=g(pe);return ()=>kt$1(n,{scrollThrottle:Ut})}}),$t=new C("mat-tooltip-default-options",{providedIn:"root",factory:()=>({showDelay:0,hideDelay:0,touchendHideDelay:1500})});var Ht="tooltip-panel",Kt={passive:true},Jt=8,te=8,ee=24,ie=200,ne=(()=>{class n{_elementRef=g(Xt$1);_ngZone=g(G);_platform=g(p);_ariaDescriber=g($a);_focusMonitor=g(St);_dir=g(Qn);_injector=g(pe);_viewContainerRef=g(mr);_mediaMatcher=g(lt);_document=g(U);_renderer=g(Fs);_animationsDisabled=K();_defaultOptions=g($t,{optional:true});_overlayRef=null;_tooltipInstance=null;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=false;_disabled=false;_tooltipClass;_viewInitialized=false;_pointerExitEventsInitialized=false;_tooltipComponent=Gt;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending=false;_dirSubscribed=false;get position(){return this._position}set position(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()));}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(t){this._positionAtOrigin=vi(t),this._detach(),this._overlayRef=null;}get disabled(){return this._disabled}set disabled(t){let e=vi(t);this._disabled!==e&&(this._disabled=e,e?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message));}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=fn(t);}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=fn(t),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay);}_hideDelay;touchGestures="auto";get message(){return this._message}set message(t){let e=this._message;this._message=t!=null?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(e);}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass);}_eventCleanups=[];_touchstartTimeout=null;_destroyed=new ue;_isDestroyed=false;constructor(){let t=this._defaultOptions;t&&(this._showDelay=t.showDelay,this._hideDelay=t.hideDelay,t.position&&(this.position=t.position),t.positionAtOrigin&&(this.positionAtOrigin=t.positionAtOrigin),t.touchGestures&&(this.touchGestures=t.touchGestures),t.tooltipClass&&(this.tooltipClass=t.tooltipClass)),this._viewportMargin=Jt;}ngAfterViewInit(){this._viewInitialized=true,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(wd(this._destroyed)).subscribe(t=>{t?t==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0));});}ngOnDestroy(){let t=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._eventCleanups.forEach(e=>e()),this._eventCleanups.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=true,this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t);}show(t=this.showDelay,e){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let i=this._createOverlay(e);this._detach(),this._portal=this._portal||new wt$1(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=i.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(wd(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(t);}hide(t=this.hideDelay){let e=this._tooltipInstance;e&&(e.isVisible()?e.hide(t):(e._cancelPendingAnimations(),this._detach()));}toggle(t){this._isTooltipVisible()?this.hide():this.show(void 0,t);}_isTooltipVisible(){return !!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(t){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!t)&&a._origin instanceof Xt$1)return this._overlayRef;this._detach();}let e=this._injector.get(I).getAncestorScrollContainers(this._elementRef),i=`${this._cssClassPrefix}-${Ht}`,r=xt(this._injector,this.positionAtOrigin?t||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(false).withViewportMargin(this._viewportMargin).withScrollableContainers(e).withPopoverLocation("global");return r.positionChanges.pipe(wd(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0));}),this._overlayRef=Pt(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,i]:i,scrollStrategy:this._injector.get(qt)(),disableAnimations:this._animationsDisabled,eventPredicate:this._overlayEventPredicate}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(wd(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(wd(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(wd(this._destroyed)).subscribe(a=>{a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0));}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=true,this._dir.change.pipe(wd(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef);})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null;}_updatePosition(t){let e=t.getConfig().positionStrategy,i=this._getOrigin(),r=this._getOverlayPosition();e.withPositions([this._addOffset(w(w({},i.main),r.main)),this._addOffset(w(w({},i.fallback),r.fallback))]);}_addOffset(t){let e=te,i=!this._dir||this._dir.value=="ltr";return t.originY==="top"?t.offsetY=-e:t.originY==="bottom"?t.offsetY=e:t.originX==="start"?t.offsetX=i?-e:e:t.originX==="end"&&(t.offsetX=i?e:-e),t}_getOrigin(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"||e=="below"?i={originX:"center",originY:e=="above"?"top":"bottom"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={originX:"start",originY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(i.originX,i.originY);return {main:i,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"?i={overlayX:"center",overlayY:"bottom"}:e=="below"?i={overlayX:"center",overlayY:"top"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={overlayX:"end",overlayY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(i.overlayX,i.overlayY);return {main:i,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),ME(()=>{this._tooltipInstance&&this._overlayRef.updatePosition();},{injector:this._injector}));}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t instanceof Set?Array.from(t):t,this._tooltipInstance._markForCheck());}_invertPosition(t,e){return this.position==="above"||this.position==="below"?e==="top"?e="bottom":e==="bottom"&&(e="top"):t==="end"?t="start":t==="start"&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){let{overlayY:e,originX:i,originY:r}=t,a;if(e==="center"?this._dir&&this._dir.value==="rtl"?a=i==="end"?"left":"right":a=i==="start"?"left":"right":a=e==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let A=this._overlayRef;if(A){let ut=`${this._cssClassPrefix}-${Ht}-`;A.removePanelClass(ut+this._currentPosition),A.addPanelClass(ut+a);}this._currentPosition=a;}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._eventCleanups.length||(this._isTouchPlatform()?this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._addListener("touchstart",t=>{let e=t.targetTouches?.[0],i=e?{x:e.clientX,y:e.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,i);},this._defaultOptions?.touchLongPressShowDelay??r);})):this._addListener("mouseenter",t=>{this._setupPointerExitEventsIfNeeded();let e;t.x!==void 0&&t.y!==void 0&&(e=t),this.show(void 0,e);}));}_setupPointerExitEventsIfNeeded(){if(!this._pointerExitEventsInitialized){if(this._pointerExitEventsInitialized=true,!this._isTouchPlatform())this._addListener("mouseleave",t=>{let e=t.relatedTarget;(!e||!this._overlayRef?.overlayElement.contains(e))&&this.hide();}),this._addListener("wheel",t=>{if(this._isTooltipVisible()){let e=this._document.elementFromPoint(t.clientX,t.clientY),i=this._elementRef.nativeElement;e!==i&&!i.contains(e)&&this.hide();}});else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let t=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay);};this._addListener("touchend",t),this._addListener("touchcancel",t);}}}_addListener(t,e){this._eventCleanups.push(this._renderer.listen(this._elementRef.nativeElement,t,e,Kt));}_isTouchPlatform(){let t=this._defaultOptions?.detectHoverCapability;return typeof t=="function"?!t():this._platform.IOS||this._platform.ANDROID?true:this._platform.isBrowser?!!t&&this._mediaMatcher.matchMedia("(any-hover: none)").matches:false}_disableNativeGesturesIfNecessary(){let t=this.touchGestures;if(t!=="off"){let e=this._elementRef.nativeElement,i=e.style;(t==="on"||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA")&&(i.userSelect=i.msUserSelect=i.webkitUserSelect=i.MozUserSelect="none"),(t==="on"||!e.draggable)&&(i.webkitUserDrag="none"),i.touchAction="none",i.webkitTapHighlightColor="transparent";}}_syncAriaDescription(t){this._ariaDescriptionPending||(this._ariaDescriptionPending=true,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,t,"tooltip"),this._isDestroyed||ME({write:()=>{this._ariaDescriptionPending=false,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip");}},{injector:this._injector}));}_overlayEventPredicate=t=>t.type==="keydown"?this._isTooltipVisible()&&t.keyCode===27&&!Ve$1(t):true;static \u0275fac=function(e){return new(e||n)};static \u0275dir=js({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(e,i){e&2&&Ug("mat-mdc-tooltip-disabled",i.disabled);},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),Gt=(()=>{class n{_changeDetectorRef=g(Tl);_elementRef=g(Xt$1);_isMultiline=false;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=K();_tooltip;_closeOnInteraction=false;_isVisible=false;_onHide=new ue;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";show(t){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(true),this._showTimeoutId=void 0;},t);}hide(t){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(false),this._hideTimeoutId=void 0;},t);}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null;}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0);}_markForCheck(){this._changeDetectorRef.markForCheck();}_handleMouseLeave({relatedTarget:t}){(!t||!this._triggerElement.contains(t))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(false));}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck();}_isTooltipMultiline(){let t=this._elementRef.nativeElement.getBoundingClientRect();return t.height>ee&&t.width>=ie}_handleAnimationEnd({animationName:t}){(t===this._showAnimation||t===this._hideAnimation)&&this._finalizeAnimation(t===this._showAnimation);}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0;}_finalizeAnimation(t){t?this._closeOnInteraction=true:this.isVisible()||this._onHide.next();}_toggleVisibility(t){let e=this._tooltip.nativeElement,i=this._showAnimation,r=this._hideAnimation;if(e.classList.remove(t?r:i),e.classList.add(t?i:r),this._isVisible!==t&&(this._isVisible=t,this._changeDetectorRef.markForCheck()),t&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(e);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=true);}t&&this._onShow(),this._animationsDisabled&&(e.classList.add("_mat-animation-noopable"),this._finalizeAnimation(t));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(e,i){if(e&1&&Pg(Xt,7),e&2){let r;EC(r=IC())&&(i._tooltip=r.first);}},hostAttrs:["aria-hidden","true"],hostBindings:function(e,i){e&1&&Rg("mouseleave",function(a){return i._handleMouseLeave(a)});},decls:4,vars:5,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(e,i){e&1&&(hl(0,"div",1,0),Og("animationend",function(a){return i._handleAnimationEnd(a)}),hl(2,"div",2),GC(3),gl()()),e&2&&(kC(i.tooltipClass),Ug("mdc-tooltip--multiline",i._isMultiline),XE(3),Yg(i.message));},styles:[`.mat-mdc-tooltip {
1
+ import {ct as vi,e as xw,T as Tg,A as Ug,aL as wo,aM as Zn,bE as vt,aO as wt,cZ as fn,cT as Gp,c_ as he$1,cV as vg,bA as yC,k as ws,bB as vC,o as pl,b5 as nT,ad as Hg,J as Jw,y as eC,X as XE,aW as C,bv as Fg,E as EC,I as IC,g,az as Xt$1,c$ as kn,bw as St,bG as p,aP as G,aR as Fs,aU as Ue,aV as U,a as Gi,an as ue,al as vt$1,ae as kt,r as re$1,d0 as Ea,bL as pe,bs as Tl,ap as wd,bu as Ve$1,c2 as ME,aA as an,D as Pg,bt as Qn,aS as K,cO as us,bN as F,bR as Id,cL as vd,bP as Wy,a9 as lC,q as Rg,ac as gC,bV as Zy,aN as Nn,bD as ge,aQ as $a,bM as mr,d1 as lt,d2 as wt$1,d3 as I,b_ as xt,bX as Pt,w,aZ as js,aw as hl,cJ as Og,n as GC,ax as gl,b$ as kC,a8 as Yg,c3 as kt$1,cD as Te,cz as to,aa as If,ab as wf}from'./main-GYSPY3UE.js';var Xt=["tooltip"],Ut=20;var qt=new C("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let n=g(pe);return ()=>kt$1(n,{scrollThrottle:Ut})}}),$t=new C("mat-tooltip-default-options",{providedIn:"root",factory:()=>({showDelay:0,hideDelay:0,touchendHideDelay:1500})});var Ht="tooltip-panel",Kt={passive:true},Jt=8,te=8,ee=24,ie=200,ne=(()=>{class n{_elementRef=g(Xt$1);_ngZone=g(G);_platform=g(p);_ariaDescriber=g($a);_focusMonitor=g(St);_dir=g(Qn);_injector=g(pe);_viewContainerRef=g(mr);_mediaMatcher=g(lt);_document=g(U);_renderer=g(Fs);_animationsDisabled=K();_defaultOptions=g($t,{optional:true});_overlayRef=null;_tooltipInstance=null;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=false;_disabled=false;_tooltipClass;_viewInitialized=false;_pointerExitEventsInitialized=false;_tooltipComponent=Gt;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending=false;_dirSubscribed=false;get position(){return this._position}set position(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()));}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(t){this._positionAtOrigin=vi(t),this._detach(),this._overlayRef=null;}get disabled(){return this._disabled}set disabled(t){let e=vi(t);this._disabled!==e&&(this._disabled=e,e?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message));}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=fn(t);}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=fn(t),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay);}_hideDelay;touchGestures="auto";get message(){return this._message}set message(t){let e=this._message;this._message=t!=null?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(e);}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass);}_eventCleanups=[];_touchstartTimeout=null;_destroyed=new ue;_isDestroyed=false;constructor(){let t=this._defaultOptions;t&&(this._showDelay=t.showDelay,this._hideDelay=t.hideDelay,t.position&&(this.position=t.position),t.positionAtOrigin&&(this.positionAtOrigin=t.positionAtOrigin),t.touchGestures&&(this.touchGestures=t.touchGestures),t.tooltipClass&&(this.tooltipClass=t.tooltipClass)),this._viewportMargin=Jt;}ngAfterViewInit(){this._viewInitialized=true,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(wd(this._destroyed)).subscribe(t=>{t?t==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0));});}ngOnDestroy(){let t=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._eventCleanups.forEach(e=>e()),this._eventCleanups.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=true,this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t);}show(t=this.showDelay,e){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let i=this._createOverlay(e);this._detach(),this._portal=this._portal||new wt$1(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=i.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(wd(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(t);}hide(t=this.hideDelay){let e=this._tooltipInstance;e&&(e.isVisible()?e.hide(t):(e._cancelPendingAnimations(),this._detach()));}toggle(t){this._isTooltipVisible()?this.hide():this.show(void 0,t);}_isTooltipVisible(){return !!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(t){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!t)&&a._origin instanceof Xt$1)return this._overlayRef;this._detach();}let e=this._injector.get(I).getAncestorScrollContainers(this._elementRef),i=`${this._cssClassPrefix}-${Ht}`,r=xt(this._injector,this.positionAtOrigin?t||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(false).withViewportMargin(this._viewportMargin).withScrollableContainers(e).withPopoverLocation("global");return r.positionChanges.pipe(wd(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0));}),this._overlayRef=Pt(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,i]:i,scrollStrategy:this._injector.get(qt)(),disableAnimations:this._animationsDisabled,eventPredicate:this._overlayEventPredicate}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(wd(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(wd(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(wd(this._destroyed)).subscribe(a=>{a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0));}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=true,this._dir.change.pipe(wd(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef);})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null;}_updatePosition(t){let e=t.getConfig().positionStrategy,i=this._getOrigin(),r=this._getOverlayPosition();e.withPositions([this._addOffset(w(w({},i.main),r.main)),this._addOffset(w(w({},i.fallback),r.fallback))]);}_addOffset(t){let e=te,i=!this._dir||this._dir.value=="ltr";return t.originY==="top"?t.offsetY=-e:t.originY==="bottom"?t.offsetY=e:t.originX==="start"?t.offsetX=i?-e:e:t.originX==="end"&&(t.offsetX=i?e:-e),t}_getOrigin(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"||e=="below"?i={originX:"center",originY:e=="above"?"top":"bottom"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={originX:"start",originY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(i.originX,i.originY);return {main:i,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"?i={overlayX:"center",overlayY:"bottom"}:e=="below"?i={overlayX:"center",overlayY:"top"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={overlayX:"end",overlayY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(i.overlayX,i.overlayY);return {main:i,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),ME(()=>{this._tooltipInstance&&this._overlayRef.updatePosition();},{injector:this._injector}));}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t instanceof Set?Array.from(t):t,this._tooltipInstance._markForCheck());}_invertPosition(t,e){return this.position==="above"||this.position==="below"?e==="top"?e="bottom":e==="bottom"&&(e="top"):t==="end"?t="start":t==="start"&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){let{overlayY:e,originX:i,originY:r}=t,a;if(e==="center"?this._dir&&this._dir.value==="rtl"?a=i==="end"?"left":"right":a=i==="start"?"left":"right":a=e==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let A=this._overlayRef;if(A){let ut=`${this._cssClassPrefix}-${Ht}-`;A.removePanelClass(ut+this._currentPosition),A.addPanelClass(ut+a);}this._currentPosition=a;}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._eventCleanups.length||(this._isTouchPlatform()?this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._addListener("touchstart",t=>{let e=t.targetTouches?.[0],i=e?{x:e.clientX,y:e.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,i);},this._defaultOptions?.touchLongPressShowDelay??r);})):this._addListener("mouseenter",t=>{this._setupPointerExitEventsIfNeeded();let e;t.x!==void 0&&t.y!==void 0&&(e=t),this.show(void 0,e);}));}_setupPointerExitEventsIfNeeded(){if(!this._pointerExitEventsInitialized){if(this._pointerExitEventsInitialized=true,!this._isTouchPlatform())this._addListener("mouseleave",t=>{let e=t.relatedTarget;(!e||!this._overlayRef?.overlayElement.contains(e))&&this.hide();}),this._addListener("wheel",t=>{if(this._isTooltipVisible()){let e=this._document.elementFromPoint(t.clientX,t.clientY),i=this._elementRef.nativeElement;e!==i&&!i.contains(e)&&this.hide();}});else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let t=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay);};this._addListener("touchend",t),this._addListener("touchcancel",t);}}}_addListener(t,e){this._eventCleanups.push(this._renderer.listen(this._elementRef.nativeElement,t,e,Kt));}_isTouchPlatform(){let t=this._defaultOptions?.detectHoverCapability;return typeof t=="function"?!t():this._platform.IOS||this._platform.ANDROID?true:this._platform.isBrowser?!!t&&this._mediaMatcher.matchMedia("(any-hover: none)").matches:false}_disableNativeGesturesIfNecessary(){let t=this.touchGestures;if(t!=="off"){let e=this._elementRef.nativeElement,i=e.style;(t==="on"||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA")&&(i.userSelect=i.msUserSelect=i.webkitUserSelect=i.MozUserSelect="none"),(t==="on"||!e.draggable)&&(i.webkitUserDrag="none"),i.touchAction="none",i.webkitTapHighlightColor="transparent";}}_syncAriaDescription(t){this._ariaDescriptionPending||(this._ariaDescriptionPending=true,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,t,"tooltip"),this._isDestroyed||ME({write:()=>{this._ariaDescriptionPending=false,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip");}},{injector:this._injector}));}_overlayEventPredicate=t=>t.type==="keydown"?this._isTooltipVisible()&&t.keyCode===27&&!Ve$1(t):true;static \u0275fac=function(e){return new(e||n)};static \u0275dir=js({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(e,i){e&2&&Ug("mat-mdc-tooltip-disabled",i.disabled);},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),Gt=(()=>{class n{_changeDetectorRef=g(Tl);_elementRef=g(Xt$1);_isMultiline=false;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=K();_tooltip;_closeOnInteraction=false;_isVisible=false;_onHide=new ue;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";show(t){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(true),this._showTimeoutId=void 0;},t);}hide(t){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(false),this._hideTimeoutId=void 0;},t);}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null;}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0);}_markForCheck(){this._changeDetectorRef.markForCheck();}_handleMouseLeave({relatedTarget:t}){(!t||!this._triggerElement.contains(t))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(false));}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck();}_isTooltipMultiline(){let t=this._elementRef.nativeElement.getBoundingClientRect();return t.height>ee&&t.width>=ie}_handleAnimationEnd({animationName:t}){(t===this._showAnimation||t===this._hideAnimation)&&this._finalizeAnimation(t===this._showAnimation);}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0;}_finalizeAnimation(t){t?this._closeOnInteraction=true:this.isVisible()||this._onHide.next();}_toggleVisibility(t){let e=this._tooltip.nativeElement,i=this._showAnimation,r=this._hideAnimation;if(e.classList.remove(t?r:i),e.classList.add(t?i:r),this._isVisible!==t&&(this._isVisible=t,this._changeDetectorRef.markForCheck()),t&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(e);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=true);}t&&this._onShow(),this._animationsDisabled&&(e.classList.add("_mat-animation-noopable"),this._finalizeAnimation(t));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(e,i){if(e&1&&Pg(Xt,7),e&2){let r;EC(r=IC())&&(i._tooltip=r.first);}},hostAttrs:["aria-hidden","true"],hostBindings:function(e,i){e&1&&Rg("mouseleave",function(a){return i._handleMouseLeave(a)});},decls:4,vars:5,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(e,i){e&1&&(hl(0,"div",1,0),Og("animationend",function(a){return i._handleAnimationEnd(a)}),hl(2,"div",2),GC(3),gl()()),e&2&&(kC(i.tooltipClass),Ug("mdc-tooltip--multiline",i._isMultiline),XE(3),Yg(i.message));},styles:[`.mat-mdc-tooltip {
2
2
  position: relative;
3
3
  transform: scale(0);
4
4
  display: inline-flex;
@@ -1 +1 @@
1
- import {K as Kn,Z as Zn,S as Se}from'./chunk-D1wn67qT.js';import {cb as ZB,cc as qB,a as Gi,e as xw,k as ws,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,a5 as vl,y as eC,a9 as lC,q as Rg,ac as gC,v as bg,aa as If,ab as wf}from'./main-COD2LZKB.js';function A(o,a){if(o&1){let e=lC();ws(0,"span",7),GC(1,"Delete?"),pl(),ws(2,"ds-icon-button",8),Rg("action",function(){If(e);let l=gC();return wf(l.onDeleteConfirmed())}),pl(),ws(3,"ds-icon-button",9),Rg("action",function(){If(e);let l=gC();return wf(l.onDeleteCancelled())}),pl();}}function P(o,a){if(o&1){let e=lC();ws(0,"ds-kebab-menu",10),Rg("itemSelected",function(l){If(e);let O=gC();return wf(O.onMenuAction(l))}),pl();}if(o&2){let e=gC();bg("items",e.menuItems);}}var I=class o{model=ZB.required();namespaceId=ZB(void 0);readOnly=ZB(false);deleteRequested=qB();editRequested=qB();pendingDelete=Gi(false);menuItems=[{key:"edit",label:"Edit model",icon:"edit"},{key:"delete",label:"Delete model",icon:"delete",variant:"danger"}];get displayTitle(){return this.model().alias??this.model().apiModelName}onMenuAction(a){switch(a){case "edit":this.editRequested.emit(this.model());break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.model());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-ai-model-item"]],inputs:{model:[1,"model"],namespaceId:[1,"namespaceId"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested",editRequested:"editRequested"},decls:12,vars:4,consts:[["role","listitem","dsBlueprint","",1,"ai-model-item"],[1,"ai-model-item__body"],[1,"ai-model-item__name"],[1,"ai-model-item__api-name"],[1,"ai-model-item__params"],[1,"ai-model-item__actions"],[3,"items"],[1,"ai-model-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,i){e&1&&(ws(0,"div",0)(1,"div",1)(2,"span",2),GC(3),pl(),ws(4,"span",3),GC(5),pl(),ws(6,"span",4)(7,"span"),GC(8),pl()()(),ws(9,"div",5),Jw(10,A,4,0)(11,P,1,1,"ds-kebab-menu",6),pl()()),e&2&&(XE(3),Yg(i.displayTitle),XE(2),Yg(i.model().apiModelName),XE(3),vl("priority: ",i.model().priority),XE(2),eC(i.pendingDelete()?10:i.readOnly()?-1:11));},dependencies:[Kn,Zn,Se],styles:[".ai-model-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.ai-model-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-model-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__api-name[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__params[_ngcontent-%COMP%]{display:flex;gap:.75rem;font-size:13px;color:var(--color-text-secondary)}.ai-model-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover .ai-model-item__actions[_ngcontent-%COMP%], .ai-model-item[_ngcontent-%COMP%]:focus-within .ai-model-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-model-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"]})};export{I};
1
+ import {K as Kn,Z as Zn,S as Se}from'./chunk-CGjjc55P.js';import {cb as ZB,cc as qB,a as Gi,e as xw,k as ws,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,a5 as vl,y as eC,a9 as lC,q as Rg,ac as gC,v as bg,aa as If,ab as wf}from'./main-GYSPY3UE.js';function A(o,a){if(o&1){let e=lC();ws(0,"span",7),GC(1,"Delete?"),pl(),ws(2,"ds-icon-button",8),Rg("action",function(){If(e);let l=gC();return wf(l.onDeleteConfirmed())}),pl(),ws(3,"ds-icon-button",9),Rg("action",function(){If(e);let l=gC();return wf(l.onDeleteCancelled())}),pl();}}function P(o,a){if(o&1){let e=lC();ws(0,"ds-kebab-menu",10),Rg("itemSelected",function(l){If(e);let O=gC();return wf(O.onMenuAction(l))}),pl();}if(o&2){let e=gC();bg("items",e.menuItems);}}var I=class o{model=ZB.required();namespaceId=ZB(void 0);readOnly=ZB(false);deleteRequested=qB();editRequested=qB();pendingDelete=Gi(false);menuItems=[{key:"edit",label:"Edit model",icon:"edit"},{key:"delete",label:"Delete model",icon:"delete",variant:"danger"}];get displayTitle(){return this.model().alias??this.model().apiModelName}onMenuAction(a){switch(a){case "edit":this.editRequested.emit(this.model());break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.model());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-ai-model-item"]],inputs:{model:[1,"model"],namespaceId:[1,"namespaceId"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested",editRequested:"editRequested"},decls:12,vars:4,consts:[["role","listitem","dsBlueprint","",1,"ai-model-item"],[1,"ai-model-item__body"],[1,"ai-model-item__name"],[1,"ai-model-item__api-name"],[1,"ai-model-item__params"],[1,"ai-model-item__actions"],[3,"items"],[1,"ai-model-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,i){e&1&&(ws(0,"div",0)(1,"div",1)(2,"span",2),GC(3),pl(),ws(4,"span",3),GC(5),pl(),ws(6,"span",4)(7,"span"),GC(8),pl()()(),ws(9,"div",5),Jw(10,A,4,0)(11,P,1,1,"ds-kebab-menu",6),pl()()),e&2&&(XE(3),Yg(i.displayTitle),XE(2),Yg(i.model().apiModelName),XE(3),vl("priority: ",i.model().priority),XE(2),eC(i.pendingDelete()?10:i.readOnly()?-1:11));},dependencies:[Kn,Zn,Se],styles:[".ai-model-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.ai-model-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-model-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__api-name[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__params[_ngcontent-%COMP%]{display:flex;gap:.75rem;font-size:13px;color:var(--color-text-secondary)}.ai-model-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover .ai-model-item__actions[_ngcontent-%COMP%], .ai-model-item[_ngcontent-%COMP%]:focus-within .ai-model-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-model-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"]})};export{I};
@@ -1 +1 @@
1
- import {l}from'./chunk-BvidtKG2.js';import {g,C as Ce,ao as V,G,d5 as D,a as Gi,b as U,e as xw,k as ws,q as Rg,c9 as kf,S as Sg,o as pl,n as GC,ck as Ff,J as Jw,a3 as VI,X as XE,y as eC,v as bg,a6 as UI,d6 as Ce$1,bU as Od,Y as x,ac as gC,a5 as vl,a9 as lC,a8 as Yg,A as Ug,d7 as Pn,aa as If,ab as wf,t as rC,z as oC}from'./main-COD2LZKB.js';import {o as z,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,E as En,p as An}from'./chunk-Bb0cfZpR.js';import'./chunk-KJgXoqSt.js';import'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';var M=class e{api=g(Ce$1);isLoading=Gi(false);result=Gi(null);errorMessage=Gi(null);invoke(t,o,a,s){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:o||void 0,toolName:a,payload:s||void 0}).pipe(Od({next:f=>{this.result.set(f),this.isLoading.set(false);},error:f=>{this.errorMessage.set(ne(f)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(o){return new(o||e)};static \u0275prov=x({token:e,factory:e.\u0275fac,providedIn:"root"})};function ne(e){if(e instanceof Pn){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var ie=(e,t)=>t.id;function re(e,t){e&1&&GC(0," Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins. ");}function ae(e,t){e&1&&GC(0," Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline. ");}function le(e,t){e&1&&(ws(0,"p",17),GC(1,"Loading namespaces\u2026"),pl());}function se(e,t){if(e&1&&(ws(0,"option",27),GC(1),pl()),e&2){let o=t.$implicit;bg("value",o.id),XE(),Yg(o.name);}}function de(e,t){if(e&1&&(ws(0,"select",25)(1,"option",26),GC(2,"Select a namespace"),pl(),rC(3,se,2,2,"option",27,ie),pl(),VI()),e&2){let o=gC(2);UI(),XE(3),oC(o.namespaces());}}function ce(e,t){if(e&1&&Jw(0,le,2,0,"p",17)(1,de,5,0,"select",25),e&2){let o=gC();eC(o.namespacesLoading()?0:1);}}function me(e,t){if(e&1&&(ws(0,"p",11),GC(1),pl()),e&2){let o=gC();XE(),vl(" ",o.namespaceName()??o.namespaceId," ");}}function pe(e,t){e&1&&GC(0," Running\u2026 ");}function _e(e,t){e&1&&GC(0," Run tool ");}function ue(e,t){if(e&1){let o=lC();ws(0,"button",28),Rg("click",function(){If(o);let s=gC();return wf(s.reset())}),GC(1,"Clear result"),pl();}}function fe(e,t){e&1&&(ws(0,"section",23)(1,"h2",29),GC(2,"Error"),pl(),ws(3,"pre",30),GC(4),pl()()),e&2&&(XE(4),Yg(t));}function ve(e,t){e&1&&(ws(0,"h3",34),GC(1,"Metadata"),pl(),ws(2,"pre",30),GC(3),pl()),e&2&&(XE(3),Yg(t));}function ge(e,t){if(e&1&&(ws(0,"dt",36),GC(1,"Type"),pl(),ws(2,"dd",37),GC(3),pl()),e&2){let o=gC(2);XE(3),Yg(o.errorType);}}function ke(e,t){if(e&1&&(ws(0,"dt",36),GC(1,"Message"),pl(),ws(2,"dd",38),GC(3),pl()),e&2){let o=gC(2);XE(3),Yg(o.errorMessage);}}function be(e,t){if(e&1&&(ws(0,"h3",34),GC(1,"Tool error details"),pl(),ws(2,"dl",35),Jw(3,ge,4,1),Jw(4,ke,4,1),pl()),e&2){let o=gC();XE(3),eC(o.errorType?3:-1),XE(),eC(o.errorMessage?4:-1);}}function xe(e,t){if(e&1&&(ws(0,"section",31)(1,"header",32)(2,"h2",29),GC(3),pl(),ws(4,"span",33),GC(5),pl()(),ws(6,"h3",34),GC(7,"Output"),pl(),ws(8,"pre",30),GC(9),pl(),Jw(10,ve,4,1),ws(11,"h3",34),GC(12,"Structured output"),pl(),ws(13,"pre",30),GC(14),pl(),Jw(15,be,5,2),pl()),e&2){let o,a=t,s=gC();Ug("tool-invoke__result--failure",!a.success),XE(3),vl("Result \u2014 ",a.toolName),XE(),Ug("tool-invoke__badge--success",a.success)("tool-invoke__badge--failure",!a.success),XE(),vl(" ",a.success?"Success":"Tool error"," "),XE(4),Yg(a.output),XE(),eC((o=s.formatMetadata(a.metadata))?10:-1,o),XE(4),Yg(s.formatStructuredOutput(a.structuredOutput)??"null"),XE(),eC(a.errorType||a.errorMessage?15:-1);}}var te=class e{destroyRef=g(Ce);route=g(V);router=g(G);namespaceController=g(D);userState=g(l);state=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=Gi([]);namespacesLoading=Gi(true);namespaceName=Gi(null);form=new z({namespaceId:new _t("",{nonNullable:true,validators:[_e$1.required]}),userId:new _t("",{nonNullable:true}),toolName:new _t("",{nonNullable:true,validators:[_e$1.required]}),payload:new _t("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:o=>{o.id&&this.form.controls.userId.patchValue(o.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:o=>{this.namespaces.set(o.map(a=>({id:a.id,name:a.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:o=>this.namespaceName.set(o.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:o,toolName:a,payload:s}=this.form.getRawValue();this.state.invoke(t,o.trim()||void 0,a.trim(),s.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-tool-invoke"]],decls:46,vars:8,consts:[[1,"tool-invoke"],[1,"tool-invoke__header"],["type","button",1,"tool-invoke__back",3,"click"],["width","16","height","16","viewBox","0 0 24 24","fill","none","aria-hidden","true"],["d","M15 18l-6-6 6-6","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],[1,"tool-invoke__title"],[1,"tool-invoke__subtitle"],[1,"tool-invoke__form",3,"ngSubmit","formGroup"],[1,"tool-invoke__field"],["for","ti-namespace",1,"tool-invoke__label"],[1,"tool-invoke__required"],["id","ti-namespace",1,"tool-invoke__namespace-static"],["for","ti-user",1,"tool-invoke__label"],[1,"tool-invoke__optional"],["id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off",1,"tool-invoke__input"],["for","ti-tool",1,"tool-invoke__label"],["id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false",1,"tool-invoke__input","tool-invoke__input--mono"],[1,"tool-invoke__hint"],["for","ti-payload",1,"tool-invoke__label"],["id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"}\\nLeave empty for tools with no input.',"spellcheck","false",1,"tool-invoke__textarea","tool-invoke__input--mono"],[1,"tool-invoke__actions"],["type","submit",1,"tool-invoke__submit",3,"disabled"],["type","button",1,"tool-invoke__reset"],[1,"tool-invoke__result","tool-invoke__result--error"],[1,"tool-invoke__result",3,"tool-invoke__result--failure"],["id","ti-namespace","formControlName","namespaceId",1,"tool-invoke__select"],["value","","disabled",""],[3,"value"],["type","button",1,"tool-invoke__reset",3,"click"],[1,"tool-invoke__result-title"],[1,"tool-invoke__output"],[1,"tool-invoke__result"],[1,"tool-invoke__result-header"],[1,"tool-invoke__badge"],[1,"tool-invoke__section-label"],[1,"tool-invoke__dl"],[1,"tool-invoke__dt"],[1,"tool-invoke__dd","tool-invoke__dd--mono"],[1,"tool-invoke__dd"]],template:function(o,a){if(o&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return a.back()}),kf(),ws(3,"svg",3),Sg(4,"path",4),pl(),GC(5," Back "),pl(),Ff(),ws(6,"h1",5),GC(7,"Tool invoke"),pl(),ws(8,"p",6),Jw(9,re,1,0)(10,ae,1,0),pl()(),ws(11,"form",7),Rg("ngSubmit",function(){return a.submit()}),ws(12,"div",8)(13,"label",9),GC(14,"Namespace "),ws(15,"span",10),GC(16,"*"),pl()(),Jw(17,ce,2,1)(18,me,2,1,"p",11),pl(),ws(19,"div",8)(20,"label",12),GC(21,"User ID "),ws(22,"span",13),GC(23,"(optional)"),pl()(),Sg(24,"input",14),VI(),pl(),ws(25,"div",8)(26,"label",15),GC(27,"Tool name "),ws(28,"span",10),GC(29,"*"),pl()(),Sg(30,"input",16),VI(),ws(31,"p",17),GC(32," Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace. "),pl()(),ws(33,"div",8)(34,"label",18),GC(35,"Payload "),ws(36,"span",13),GC(37,"(optional)"),pl()(),Sg(38,"textarea",19),VI(),pl(),ws(39,"div",20)(40,"button",21),Jw(41,pe,1,0)(42,_e,1,0),pl(),Jw(43,ue,2,0,"button",22),pl()(),Jw(44,fe,5,1,"section",23),Jw(45,xe,16,12,"section",24),pl()),o&2){let s,f;XE(9),eC(a.isPlatformMode?9:10),XE(2),bg("formGroup",a.form),XE(6),eC(a.isPlatformMode?17:18),XE(7),UI(),XE(6),UI(),XE(8),UI(),XE(2),bg("disabled",a.form.invalid||a.state.isLoading()),XE(),eC(a.state.isLoading()?41:42),XE(2),eC(a.state.result()||a.state.errorMessage()?43:-1),XE(),eC((s=a.state.errorMessage())?44:-1,s),XE(),eC((f=a.state.result())?45:-1,f);}},dependencies:[ni,Jn,Qn,ei,Ye,At,Zn,Xn,En,An],styles:[".tool-invoke[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.tool-invoke__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.tool-invoke__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;padding:0;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;font-family:inherit;cursor:pointer;align-self:flex-start}.tool-invoke__back[_ngcontent-%COMP%]:hover{color:var(--color-text, #1d1d1f)}.tool-invoke__namespace-static[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-surface-muted, rgba(0, 0, 0, .04));color:var(--color-text, #1d1d1f);font-size:.9375rem}.tool-invoke__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.tool-invoke__subtitle[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);line-height:1.5}.tool-invoke__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem;padding:1.5rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px}.tool-invoke__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem}.tool-invoke__label[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73)}.tool-invoke__required[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30);margin-left:.1em}.tool-invoke__optional[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.75rem}.tool-invoke__hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.tool-invoke__input[_ngcontent-%COMP%], .tool-invoke__select[_ngcontent-%COMP%], .tool-invoke__textarea[_ngcontent-%COMP%]{padding:.5rem .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-surface, #fff);color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;transition:border-color .15s ease}.tool-invoke__input[_ngcontent-%COMP%]:focus, .tool-invoke__select[_ngcontent-%COMP%]:focus, .tool-invoke__textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.tool-invoke__input--mono[_ngcontent-%COMP%], .tool-invoke__select--mono[_ngcontent-%COMP%], .tool-invoke__textarea--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.tool-invoke__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px}.tool-invoke__select[_ngcontent-%COMP%]{cursor:pointer}.tool-invoke__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;padding-top:.25rem}.tool-invoke__submit[_ngcontent-%COMP%]{padding:.55rem 1.25rem;border-radius:8px;border:none;background:var(--color-primary, #007aff);color:#fff;font-size:.9375rem;font-weight:500;font-family:inherit;cursor:pointer;transition:opacity .15s ease}.tool-invoke__submit[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.tool-invoke__submit[_ngcontent-%COMP%]:not(:disabled):hover{opacity:.88}.tool-invoke__reset[_ngcontent-%COMP%]{padding:.55rem 1rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;font-family:inherit;cursor:pointer}.tool-invoke__reset[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.tool-invoke__result[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px}.tool-invoke__result--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30);background:var(--color-error-bg, #fff5f5)}.tool-invoke__result--failure[_ngcontent-%COMP%]{border-color:var(--color-warning, #ff9500);background:var(--color-warning-bg, #fffaf0)}.tool-invoke__result-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.tool-invoke__result-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.tool-invoke__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500}.tool-invoke__badge--success[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.tool-invoke__badge--failure[_ngcontent-%COMP%]{background:var(--color-warning-bg, #fff3cd);color:var(--color-warning, #ff9500)}.tool-invoke__section-label[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);text-transform:uppercase;letter-spacing:.04em}.tool-invoke__output[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:500px;overflow-y:auto}.tool-invoke__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.4rem 1rem;margin:0}.tool-invoke__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:start}.tool-invoke__dd[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text, #1d1d1f);word-break:break-word}.tool-invoke__dd--mono[_ngcontent-%COMP%]{font-family:monospace}"]})};export{te as ToolInvokeComponent};
1
+ import {l}from'./chunk-DdPOtjZp.js';import {g,C as Ce,ao as V,G,d5 as D,a as Gi,b as U,e as xw,k as ws,q as Rg,c9 as kf,S as Sg,o as pl,n as GC,ck as Ff,J as Jw,a3 as VI,X as XE,y as eC,v as bg,a6 as UI,d6 as Ce$1,bU as Od,Y as x,ac as gC,a5 as vl,a9 as lC,a8 as Yg,A as Ug,d7 as Pn,aa as If,ab as wf,t as rC,z as oC}from'./main-GYSPY3UE.js';import {o as z,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,E as En,p as An}from'./chunk-DS1gnXQd.js';import'./chunk-CXqNbVXr.js';import'./chunk-CGjjc55P.js';import'./chunk-CZe6uHRZ.js';var M=class e{api=g(Ce$1);isLoading=Gi(false);result=Gi(null);errorMessage=Gi(null);invoke(t,o,a,s){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:o||void 0,toolName:a,payload:s||void 0}).pipe(Od({next:f=>{this.result.set(f),this.isLoading.set(false);},error:f=>{this.errorMessage.set(ne(f)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(o){return new(o||e)};static \u0275prov=x({token:e,factory:e.\u0275fac,providedIn:"root"})};function ne(e){if(e instanceof Pn){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var ie=(e,t)=>t.id;function re(e,t){e&1&&GC(0," Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins. ");}function ae(e,t){e&1&&GC(0," Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline. ");}function le(e,t){e&1&&(ws(0,"p",17),GC(1,"Loading namespaces\u2026"),pl());}function se(e,t){if(e&1&&(ws(0,"option",27),GC(1),pl()),e&2){let o=t.$implicit;bg("value",o.id),XE(),Yg(o.name);}}function de(e,t){if(e&1&&(ws(0,"select",25)(1,"option",26),GC(2,"Select a namespace"),pl(),rC(3,se,2,2,"option",27,ie),pl(),VI()),e&2){let o=gC(2);UI(),XE(3),oC(o.namespaces());}}function ce(e,t){if(e&1&&Jw(0,le,2,0,"p",17)(1,de,5,0,"select",25),e&2){let o=gC();eC(o.namespacesLoading()?0:1);}}function me(e,t){if(e&1&&(ws(0,"p",11),GC(1),pl()),e&2){let o=gC();XE(),vl(" ",o.namespaceName()??o.namespaceId," ");}}function pe(e,t){e&1&&GC(0," Running\u2026 ");}function _e(e,t){e&1&&GC(0," Run tool ");}function ue(e,t){if(e&1){let o=lC();ws(0,"button",28),Rg("click",function(){If(o);let s=gC();return wf(s.reset())}),GC(1,"Clear result"),pl();}}function fe(e,t){e&1&&(ws(0,"section",23)(1,"h2",29),GC(2,"Error"),pl(),ws(3,"pre",30),GC(4),pl()()),e&2&&(XE(4),Yg(t));}function ve(e,t){e&1&&(ws(0,"h3",34),GC(1,"Metadata"),pl(),ws(2,"pre",30),GC(3),pl()),e&2&&(XE(3),Yg(t));}function ge(e,t){if(e&1&&(ws(0,"dt",36),GC(1,"Type"),pl(),ws(2,"dd",37),GC(3),pl()),e&2){let o=gC(2);XE(3),Yg(o.errorType);}}function ke(e,t){if(e&1&&(ws(0,"dt",36),GC(1,"Message"),pl(),ws(2,"dd",38),GC(3),pl()),e&2){let o=gC(2);XE(3),Yg(o.errorMessage);}}function be(e,t){if(e&1&&(ws(0,"h3",34),GC(1,"Tool error details"),pl(),ws(2,"dl",35),Jw(3,ge,4,1),Jw(4,ke,4,1),pl()),e&2){let o=gC();XE(3),eC(o.errorType?3:-1),XE(),eC(o.errorMessage?4:-1);}}function xe(e,t){if(e&1&&(ws(0,"section",31)(1,"header",32)(2,"h2",29),GC(3),pl(),ws(4,"span",33),GC(5),pl()(),ws(6,"h3",34),GC(7,"Output"),pl(),ws(8,"pre",30),GC(9),pl(),Jw(10,ve,4,1),ws(11,"h3",34),GC(12,"Structured output"),pl(),ws(13,"pre",30),GC(14),pl(),Jw(15,be,5,2),pl()),e&2){let o,a=t,s=gC();Ug("tool-invoke__result--failure",!a.success),XE(3),vl("Result \u2014 ",a.toolName),XE(),Ug("tool-invoke__badge--success",a.success)("tool-invoke__badge--failure",!a.success),XE(),vl(" ",a.success?"Success":"Tool error"," "),XE(4),Yg(a.output),XE(),eC((o=s.formatMetadata(a.metadata))?10:-1,o),XE(4),Yg(s.formatStructuredOutput(a.structuredOutput)??"null"),XE(),eC(a.errorType||a.errorMessage?15:-1);}}var te=class e{destroyRef=g(Ce);route=g(V);router=g(G);namespaceController=g(D);userState=g(l);state=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=Gi([]);namespacesLoading=Gi(true);namespaceName=Gi(null);form=new z({namespaceId:new _t("",{nonNullable:true,validators:[_e$1.required]}),userId:new _t("",{nonNullable:true}),toolName:new _t("",{nonNullable:true,validators:[_e$1.required]}),payload:new _t("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:o=>{o.id&&this.form.controls.userId.patchValue(o.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:o=>{this.namespaces.set(o.map(a=>({id:a.id,name:a.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:o=>this.namespaceName.set(o.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:o,toolName:a,payload:s}=this.form.getRawValue();this.state.invoke(t,o.trim()||void 0,a.trim(),s.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-tool-invoke"]],decls:46,vars:8,consts:[[1,"tool-invoke"],[1,"tool-invoke__header"],["type","button",1,"tool-invoke__back",3,"click"],["width","16","height","16","viewBox","0 0 24 24","fill","none","aria-hidden","true"],["d","M15 18l-6-6 6-6","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],[1,"tool-invoke__title"],[1,"tool-invoke__subtitle"],[1,"tool-invoke__form",3,"ngSubmit","formGroup"],[1,"tool-invoke__field"],["for","ti-namespace",1,"tool-invoke__label"],[1,"tool-invoke__required"],["id","ti-namespace",1,"tool-invoke__namespace-static"],["for","ti-user",1,"tool-invoke__label"],[1,"tool-invoke__optional"],["id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off",1,"tool-invoke__input"],["for","ti-tool",1,"tool-invoke__label"],["id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false",1,"tool-invoke__input","tool-invoke__input--mono"],[1,"tool-invoke__hint"],["for","ti-payload",1,"tool-invoke__label"],["id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"}\\nLeave empty for tools with no input.',"spellcheck","false",1,"tool-invoke__textarea","tool-invoke__input--mono"],[1,"tool-invoke__actions"],["type","submit",1,"tool-invoke__submit",3,"disabled"],["type","button",1,"tool-invoke__reset"],[1,"tool-invoke__result","tool-invoke__result--error"],[1,"tool-invoke__result",3,"tool-invoke__result--failure"],["id","ti-namespace","formControlName","namespaceId",1,"tool-invoke__select"],["value","","disabled",""],[3,"value"],["type","button",1,"tool-invoke__reset",3,"click"],[1,"tool-invoke__result-title"],[1,"tool-invoke__output"],[1,"tool-invoke__result"],[1,"tool-invoke__result-header"],[1,"tool-invoke__badge"],[1,"tool-invoke__section-label"],[1,"tool-invoke__dl"],[1,"tool-invoke__dt"],[1,"tool-invoke__dd","tool-invoke__dd--mono"],[1,"tool-invoke__dd"]],template:function(o,a){if(o&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return a.back()}),kf(),ws(3,"svg",3),Sg(4,"path",4),pl(),GC(5," Back "),pl(),Ff(),ws(6,"h1",5),GC(7,"Tool invoke"),pl(),ws(8,"p",6),Jw(9,re,1,0)(10,ae,1,0),pl()(),ws(11,"form",7),Rg("ngSubmit",function(){return a.submit()}),ws(12,"div",8)(13,"label",9),GC(14,"Namespace "),ws(15,"span",10),GC(16,"*"),pl()(),Jw(17,ce,2,1)(18,me,2,1,"p",11),pl(),ws(19,"div",8)(20,"label",12),GC(21,"User ID "),ws(22,"span",13),GC(23,"(optional)"),pl()(),Sg(24,"input",14),VI(),pl(),ws(25,"div",8)(26,"label",15),GC(27,"Tool name "),ws(28,"span",10),GC(29,"*"),pl()(),Sg(30,"input",16),VI(),ws(31,"p",17),GC(32," Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace. "),pl()(),ws(33,"div",8)(34,"label",18),GC(35,"Payload "),ws(36,"span",13),GC(37,"(optional)"),pl()(),Sg(38,"textarea",19),VI(),pl(),ws(39,"div",20)(40,"button",21),Jw(41,pe,1,0)(42,_e,1,0),pl(),Jw(43,ue,2,0,"button",22),pl()(),Jw(44,fe,5,1,"section",23),Jw(45,xe,16,12,"section",24),pl()),o&2){let s,f;XE(9),eC(a.isPlatformMode?9:10),XE(2),bg("formGroup",a.form),XE(6),eC(a.isPlatformMode?17:18),XE(7),UI(),XE(6),UI(),XE(8),UI(),XE(2),bg("disabled",a.form.invalid||a.state.isLoading()),XE(),eC(a.state.isLoading()?41:42),XE(2),eC(a.state.result()||a.state.errorMessage()?43:-1),XE(),eC((s=a.state.errorMessage())?44:-1,s),XE(),eC((f=a.state.result())?45:-1,f);}},dependencies:[ni,Jn,Qn,ei,Ye,At,Zn,Xn,En,An],styles:[".tool-invoke[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.tool-invoke__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.tool-invoke__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;padding:0;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;font-family:inherit;cursor:pointer;align-self:flex-start}.tool-invoke__back[_ngcontent-%COMP%]:hover{color:var(--color-text, #1d1d1f)}.tool-invoke__namespace-static[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-surface-muted, rgba(0, 0, 0, .04));color:var(--color-text, #1d1d1f);font-size:.9375rem}.tool-invoke__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.tool-invoke__subtitle[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);line-height:1.5}.tool-invoke__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem;padding:1.5rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px}.tool-invoke__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem}.tool-invoke__label[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73)}.tool-invoke__required[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30);margin-left:.1em}.tool-invoke__optional[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.75rem}.tool-invoke__hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.tool-invoke__input[_ngcontent-%COMP%], .tool-invoke__select[_ngcontent-%COMP%], .tool-invoke__textarea[_ngcontent-%COMP%]{padding:.5rem .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-surface, #fff);color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;transition:border-color .15s ease}.tool-invoke__input[_ngcontent-%COMP%]:focus, .tool-invoke__select[_ngcontent-%COMP%]:focus, .tool-invoke__textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.tool-invoke__input--mono[_ngcontent-%COMP%], .tool-invoke__select--mono[_ngcontent-%COMP%], .tool-invoke__textarea--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.tool-invoke__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px}.tool-invoke__select[_ngcontent-%COMP%]{cursor:pointer}.tool-invoke__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;padding-top:.25rem}.tool-invoke__submit[_ngcontent-%COMP%]{padding:.55rem 1.25rem;border-radius:8px;border:none;background:var(--color-primary, #007aff);color:#fff;font-size:.9375rem;font-weight:500;font-family:inherit;cursor:pointer;transition:opacity .15s ease}.tool-invoke__submit[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.tool-invoke__submit[_ngcontent-%COMP%]:not(:disabled):hover{opacity:.88}.tool-invoke__reset[_ngcontent-%COMP%]{padding:.55rem 1rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;font-family:inherit;cursor:pointer}.tool-invoke__reset[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.tool-invoke__result[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px}.tool-invoke__result--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30);background:var(--color-error-bg, #fff5f5)}.tool-invoke__result--failure[_ngcontent-%COMP%]{border-color:var(--color-warning, #ff9500);background:var(--color-warning-bg, #fffaf0)}.tool-invoke__result-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.tool-invoke__result-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.tool-invoke__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500}.tool-invoke__badge--success[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.tool-invoke__badge--failure[_ngcontent-%COMP%]{background:var(--color-warning-bg, #fff3cd);color:var(--color-warning, #ff9500)}.tool-invoke__section-label[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);text-transform:uppercase;letter-spacing:.04em}.tool-invoke__output[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:500px;overflow-y:auto}.tool-invoke__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.4rem 1rem;margin:0}.tool-invoke__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:start}.tool-invoke__dd[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text, #1d1d1f);word-break:break-word}.tool-invoke__dd--mono[_ngcontent-%COMP%]{font-family:monospace}"]})};export{te as ToolInvokeComponent};
@@ -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-COD2LZKB.js';import {s as se}from'./chunk-ByHd8LOC.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-Bb0cfZpR.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-GYSPY3UE.js';import {s as se}from'./chunk-CJCjJyKP.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-DS1gnXQd.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 {g,H as py,W as br,bU as Od,r as re,Y as x}from'./main-COD2LZKB.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-GYSPY3UE.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 {g,bl as Mt,Y as x}from'./main-COD2LZKB.js';var s=class n{snackBar=g(Mt);success(t,o=2e3){this.snackBar.open(t,"",{duration:o,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-success"]});}error(t,o=3e3){this.snackBar.open(t,"",{duration:o,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-error"]});}info(t,o=2e3){this.snackBar.open(t,"",{duration:o,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-info"]});}static \u0275fac=function(o){return new(o||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};export{s};
1
+ import {g,bl as Mt,Y as x}from'./main-GYSPY3UE.js';var s=class n{snackBar=g(Mt);success(t,o=2e3){this.snackBar.open(t,"",{duration:o,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-success"]});}error(t,o=3e3){this.snackBar.open(t,"",{duration:o,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-error"]});}info(t,o=2e3){this.snackBar.open(t,"",{duration:o,horizontalPosition:"center",verticalPosition:"bottom",panelClass:["snackbar-info"]});}static \u0275fac=function(o){return new(o||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};export{s};
@@ -1 +1 @@
1
- import {R}from'./chunk-BA-NscEe.js';import {c}from'./chunk-ZI_RF6mJ.js';import {g,ao as V$1,G,C as Ce,a as Gi,m as mT,Q as By,a7 as ya,W as br,b as U,e as xw,k as ws,q as Rg,o as pl,af as Eg,u as CC,v as bg,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-COD2LZKB.js';import {W as Wn,S as Se}from'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';function V(i,e){if(i&1){let t=lC();ws(0,"agentos-scheduled-prompt-item",4),Rg("enableRequested",function(n){If(t);let s=gC(2);return wf(s.enablePrompt(n))})("disableRequested",function(n){If(t);let s=gC(2);return wf(s.disablePrompt(n))})("deleteRequested",function(n){If(t);let s=gC(2);return wf(s.deletePrompt(n))}),pl();}if(i&2){let t=gC().$implicit,o=gC();bg("definition",e)("namespaceId",o.namespaceId)("readOnly",o.isPlatformPrompt(t.id));}}function k(i,e){if(i&1&&Jw(0,V,1,3,"agentos-scheduled-prompt-item",3),i&2){let t,o=e.$implicit,n=gC();eC((t=n.resolvePrompt(o.id))?0:-1,t);}}var O="platform",B="namespace",M=class i{route=g(V$1);router=g(G);destroyRef=g(Ce);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;platformPrompts=Gi([]);namespacePrompts=Gi([]);isLoading=Gi(true);promptItems=mT(()=>[...this.platformPrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:O,groupLabel:"Platform (read-only)",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]})),...this.namespacePrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:B,groupLabel:"Namespace",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]}))]);constructor(){By({platform:this.state.listPlatform().pipe(ya(()=>br([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.platformPrompts.set(e),this.namespacePrompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}enablePrompt(e){this.state.enable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t));}disablePrompt(e){this.state.disable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t));}deletePrompt(e){let t=e.id??"";this.state.delete(t).pipe(U(this.destroyRef)).subscribe(()=>this.namespacePrompts.update(o=>o.filter(n=>n.id!==t)));}resolvePrompt(e){return this.platformPrompts().find(t=>t.id===e)??this.namespacePrompts().find(t=>t.id===e)??null}isPlatformPrompt(e){return this.platformPrompts().some(t=>t.id===e)}patchNamespacePrompt(e){this.namespacePrompts.update(t=>t.map(o=>o.id===e.id?e:o));}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-scheduled-prompt-list"]],decls:4,vars:4,consts:[["scheduledPromptItemTpl",""],["title","Scheduled Prompts","emptyMessage","No scheduled prompts yet. Create one to get started.","cardMinWidth","420px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"definition","namespaceId","readOnly"],[3,"enableRequested","disableRequested","deleteRequested","definition","namespaceId","readOnly"]],template:function(t,o){if(t&1&&(ws(0,"ds-entity-list",1),Rg("createRequested",function(){return o.openCreateForm()}),ws(1,"ds-icon-button",2),Rg("action",function(){return o.goBack()}),pl()(),Eg(2,k,1,1,"ng-template",null,0,fT)),t&2){let n=CC(3);bg("items",o.promptItems())("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,R,Se],encapsulation:2})};export{M as ScheduledPromptListComponent};
1
+ import {R}from'./chunk-C7OQXeW9.js';import {c}from'./chunk-B1h8Rr_L.js';import {g,ao as V$1,G,C as Ce,a as Gi,m as mT,Q as By,a7 as ya,W as br,b as U,e as xw,k as ws,q as Rg,o as pl,af as Eg,u as CC,v as bg,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-GYSPY3UE.js';import {$ as $n,S as Se}from'./chunk-CGjjc55P.js';import'./chunk-CZe6uHRZ.js';import'./chunk-DS1gnXQd.js';function V(i,e){if(i&1){let t=lC();ws(0,"agentos-scheduled-prompt-item",4),Rg("enableRequested",function(n){If(t);let s=gC(2);return wf(s.enablePrompt(n))})("disableRequested",function(n){If(t);let s=gC(2);return wf(s.disablePrompt(n))})("deleteRequested",function(n){If(t);let s=gC(2);return wf(s.deletePrompt(n))}),pl();}if(i&2){let t=gC().$implicit,o=gC();bg("definition",e)("namespaceId",o.namespaceId)("readOnly",o.isPlatformPrompt(t.id));}}function k(i,e){if(i&1&&Jw(0,V,1,3,"agentos-scheduled-prompt-item",3),i&2){let t,o=e.$implicit,n=gC();eC((t=n.resolvePrompt(o.id))?0:-1,t);}}var O="platform",B="namespace",M=class i{route=g(V$1);router=g(G);destroyRef=g(Ce);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;platformPrompts=Gi([]);namespacePrompts=Gi([]);isLoading=Gi(true);promptItems=mT(()=>[...this.platformPrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:O,groupLabel:"Platform (read-only)",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]})),...this.namespacePrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:B,groupLabel:"Namespace",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]}))]);constructor(){By({platform:this.state.listPlatform().pipe(ya(()=>br([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:e,namespace:t})=>{this.platformPrompts.set(e),this.namespacePrompts.set(t),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}enablePrompt(e){this.state.enable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t));}disablePrompt(e){this.state.disable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t));}deletePrompt(e){let t=e.id??"";this.state.delete(t).pipe(U(this.destroyRef)).subscribe(()=>this.namespacePrompts.update(o=>o.filter(n=>n.id!==t)));}resolvePrompt(e){return this.platformPrompts().find(t=>t.id===e)??this.namespacePrompts().find(t=>t.id===e)??null}isPlatformPrompt(e){return this.platformPrompts().some(t=>t.id===e)}patchNamespacePrompt(e){this.namespacePrompts.update(t=>t.map(o=>o.id===e.id?e:o));}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-scheduled-prompt-list"]],decls:4,vars:4,consts:[["scheduledPromptItemTpl",""],["title","Scheduled Prompts","emptyMessage","No scheduled prompts yet. Create one to get started.","cardMinWidth","420px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"definition","namespaceId","readOnly"],[3,"enableRequested","disableRequested","deleteRequested","definition","namespaceId","readOnly"]],template:function(t,o){if(t&1&&(ws(0,"ds-entity-list",1),Rg("createRequested",function(){return o.openCreateForm()}),ws(1,"ds-icon-button",2),Rg("action",function(){return o.goBack()}),pl()(),Eg(2,k,1,1,"ng-template",null,0,fT)),t&2){let n=CC(3);bg("items",o.promptItems())("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[$n,R,Se],encapsulation:2})};export{M as ScheduledPromptListComponent};
@@ -1 +1 @@
1
- import {cb as ZB,cc as qB,g,G as G$1,P,m as mT,e as xw,h as hr,j as Gn,k as ws,q as Rg,J as Jw,n as GC,o as pl,b$ as kC,A as Ug,T as Tg,X as XE,y as eC,a8 as Yg,a5 as vl,v as bg,a9 as lC,aa as If,ac as gC,ab as wf,S as Sg}from'./main-COD2LZKB.js';import {v as ve,n as ne}from'./chunk-DmspnNZU.js';import {V as Ve,n as ne$1}from'./chunk-CaZu6-ik.js';import {y as yt,w as wt}from'./chunk-Bb0cfZpR.js';function L(a,e){if(a&1){let n=lC();ws(0,"div",1)(1,"mat-checkbox",21),Rg("click",function(r){return r.stopPropagation()})("change",function(r){If(n);let i=gC();return wf(i.selectionChanged.emit({id:i.task().id,selected:r.checked}))}),pl()();}if(a&2){let n=gC();XE(),bg("checked",n.selected()),Tg("aria-label","Select task: "+n.task().name);}}function Y(a,e){a&1&&(ws(0,"mat-icon",2),GC(1,"star"),pl());}function W(a,e){a&1&&Sg(0,"span",6);}function U(a,e){if(a&1&&(ws(0,"div",7)(1,"mat-icon",22),GC(2,"folder"),pl(),ws(3,"span"),GC(4),pl()()),a&2){let n=gC();XE(4),Yg(n.projectName());}}function B(a,e){if(a&1&&(ws(0,"p",9),GC(1),pl()),a&2){let n=gC();XE(),Yg(n.task().summary);}}function $(a,e){a&1&&(ws(0,"p",10),GC(1,"No summary yet"),pl());}function H(a,e){if(a&1){let n=lC();ws(0,"button",23),Rg("click",function(r){If(n);let i=gC();return wf(i.onOpenDirect(r))}),ws(1,"mat-icon"),GC(2,"open_in_new"),pl()();}}function F(a,e){if(a&1){let n=lC();ws(0,"button",24),Rg("click",function(r){If(n);let i=gC();return wf(i.onStop(r))}),ws(1,"mat-icon"),GC(2,"stop_circle"),pl()();}}function G(a,e){if(a&1){let n=lC();ws(0,"button",25),Rg("click",function(r){If(n);let i=gC();return wf(i.onMarkDone(r))}),ws(1,"mat-icon"),GC(2,"check_circle_outline"),pl()();}}function K(a,e){if(a&1){let n=lC();ws(0,"button",26),Rg("click",function(r){If(n);let i=gC();return wf(i.onMarkActive(r))}),ws(1,"mat-icon"),GC(2,"replay"),pl()();}}function J(a,e){if(a&1){let n=lC();ws(0,"button",27),Rg("click",function(r){If(n);let i=gC();return wf(i.onCloseTask(r))}),ws(1,"mat-icon"),GC(2,"close_fullscreen"),pl()();}}var A=class a{task=ZB.required();projectNameOverride=ZB(null);showProject=ZB(false);previewMode=ZB(false);selectable=ZB(false);selected=ZB(false);stopRequested=qB();deleteRequested=qB();starToggled=qB();closeTaskRequested=qB();markDoneRequested=qB();markActiveRequested=qB();previewRequested=qB();selectionChanged=qB();router=g(G$1);projectState=g(P);projectName=mT(()=>this.projectNameOverride()??this.projectState.getSelectedProjectId());statusLabel=mT(()=>Q[this.task().status]);statusIcon=mT(()=>X[this.task().status]);isWorktree=mT(()=>!!this.task().worktreeProject);navigate(){if(this.previewMode()){this.previewRequested.emit(this.task().id);return}let e=this.projectName();e&&(this.projectState.selectProject(e),this.router.navigate(["project",e,"thread",this.task().id]));}onStop(e){e.stopPropagation(),this.stopRequested.emit(this.task().id);}onDelete(e){e.stopPropagation(),this.deleteRequested.emit(this.task().id);}onStarToggle(e){e.stopPropagation(),this.starToggled.emit(this.task().id);}onCloseTask(e){e.stopPropagation(),this.closeTaskRequested.emit(this.task().id);}onMarkDone(e){e.stopPropagation(),this.markDoneRequested.emit(this.task().id);}onMarkActive(e){e.stopPropagation(),this.markActiveRequested.emit(this.task().id);}onOpenDirect(e){e.stopPropagation();let n=this.projectName();n&&(this.projectState.selectProject(n),this.router.navigate(["project",n,"thread",this.task().id]));}formatRelativeTime(e){let n=Date.now()-new Date(e).getTime(),t=Math.floor(n/6e4);if(t<1)return "just now";if(t<60)return `${t} min ago`;let r=Math.floor(t/60);if(r<24)return `${r}h ago`;let i=Math.floor(r/24);return i===1?"yesterday":i<7?`${i} days ago`:new Date(e).toLocaleDateString("en",{day:"numeric",month:"short"})}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=xw({type:a,selectors:[["app-task-card"]],inputs:{task:[1,"task"],projectNameOverride:[1,"projectNameOverride"],showProject:[1,"showProject"],previewMode:[1,"previewMode"],selectable:[1,"selectable"],selected:[1,"selected"]},outputs:{stopRequested:"stopRequested",deleteRequested:"deleteRequested",starToggled:"starToggled",closeTaskRequested:"closeTaskRequested",markDoneRequested:"markDoneRequested",markActiveRequested:"markActiveRequested",previewRequested:"previewRequested",selectionChanged:"selectionChanged"},decls:29,vars:25,consts:[["role","button","tabindex","0",1,"task-card",3,"click","keydown.enter","keydown.space"],[1,"selection-checkbox"],["aria-label","Starred",1,"starred-indicator"],[1,"status-badge"],[1,"status-icon"],[1,"status-label"],["aria-hidden","true",1,"pulse-ring"],[1,"task-project"],[1,"task-name"],[1,"task-summary"],[1,"task-summary","empty"],[1,"task-footer"],[1,"task-time"],[1,"task-actions"],["mat-icon-button","","matTooltip","Open full view","aria-label","Open task in full view",1,"action-btn","open-btn"],["mat-icon-button","","matTooltip","Stop agent","aria-label","Stop agent",1,"action-btn","stop-btn"],["mat-icon-button","","matTooltip","Mark as done","aria-label","Mark as done",1,"action-btn","mark-done-btn"],["mat-icon-button","","matTooltip","Mark as active","aria-label","Mark as active",1,"action-btn","mark-active-btn"],["mat-icon-button","",1,"action-btn","star-btn",3,"click","matTooltip"],["mat-icon-button","","matTooltip","Close task (removes worktree)","aria-label","Close task",1,"action-btn","close-task-btn"],["mat-icon-button","","matTooltip","Delete task","aria-label","Delete task",1,"action-btn","delete-btn",3,"click"],[3,"click","change","checked"],[1,"project-icon"],["mat-icon-button","","matTooltip","Open full view","aria-label","Open task in full view",1,"action-btn","open-btn",3,"click"],["mat-icon-button","","matTooltip","Stop agent","aria-label","Stop agent",1,"action-btn","stop-btn",3,"click"],["mat-icon-button","","matTooltip","Mark as done","aria-label","Mark as done",1,"action-btn","mark-done-btn",3,"click"],["mat-icon-button","","matTooltip","Mark as active","aria-label","Mark as active",1,"action-btn","mark-active-btn",3,"click"],["mat-icon-button","","matTooltip","Close task (removes worktree)","aria-label","Close task",1,"action-btn","close-task-btn",3,"click"]],template:function(n,t){n&1&&(ws(0,"article",0),Rg("click",function(){return t.navigate()})("keydown.enter",function(){return t.navigate()})("keydown.space",function(i){return t.navigate(),i.preventDefault()}),Jw(1,L,2,2,"div",1),Jw(2,Y,2,0,"mat-icon",2),ws(3,"div",3)(4,"mat-icon",4),GC(5),pl(),ws(6,"span",5),GC(7),pl(),Jw(8,W,1,0,"span",6),pl(),Jw(9,U,5,1,"div",7),ws(10,"h3",8),GC(11),pl(),Jw(12,B,2,1,"p",9)(13,$,2,0,"p",10),ws(14,"footer",11)(15,"span",12),GC(16),pl(),ws(17,"div",13),Jw(18,H,3,0,"button",14),Jw(19,F,3,0,"button",15),Jw(20,G,3,0,"button",16)(21,K,3,0,"button",17),ws(22,"button",18),Rg("click",function(i){return t.onStarToggle(i)}),ws(23,"mat-icon"),GC(24),pl()(),Jw(25,J,3,0,"button",19),ws(26,"button",20),Rg("click",function(i){return t.onDelete(i)}),ws(27,"mat-icon"),GC(28,"delete_outline"),pl()()()()()),n&2&&(kC("status-"+t.task().status),Ug("is-active",t.task().isActive)("is-selected",t.selected()),Tg("aria-label","Open task: "+t.task().name),XE(),eC(t.selectable()?1:-1),XE(),eC(t.task().starring.length>0?2:-1),XE(3),Yg(t.statusIcon()),XE(2),Yg(t.statusLabel()),XE(),eC(t.task().status==="waiting-you"?8:-1),XE(),eC(t.showProject()&&t.projectName()?9:-1),XE(2),vl(" ",t.task().name||"Unnamed task"," "),XE(),eC(t.task().summary?12:13),XE(4),Yg(t.formatRelativeTime(t.task().modifiedDate)),XE(2),eC(t.previewMode()?18:-1),XE(),eC(t.task().status==="in-progress"?19:-1),XE(),eC(t.task().status!=="done"?20:21),XE(2),Ug("starred",t.task().starring.length>0),bg("matTooltip",t.task().starring.length>0?"Unstar":"Star"),Tg("aria-label",t.task().starring.length>0?"Unstar task":"Star task"),XE(2),Yg(t.task().starring.length>0?"star":"star_border"),XE(),eC(t.isWorktree()?25:-1));},dependencies:[ve,ne,yt,wt,hr,Gn,Ve,ne$1],styles:['.glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:block}.task-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:16px;padding:1.25rem;cursor:pointer;position:relative;overflow:hidden;transition:transform .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1),border-color .2s ease;outline:none;display:flex;flex-direction:column;gap:.5rem;min-height:160px}.task-card[_ngcontent-%COMP%]:hover, .task-card[_ngcontent-%COMP%]:focus-visible{transform:translateY(-3px);box-shadow:0 16px 48px #00000026}.task-card[_ngcontent-%COMP%]:active{transform:translateY(-1px)}.task-card[_ngcontent-%COMP%]:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;border-radius:16px 0 0 16px;background:var(--status-color, var(--color-text-secondary))}.task-card.status-waiting-you[_ngcontent-%COMP%]{--status-color: var(--color-error);border-color:#ff3b3040}.task-card.status-in-progress[_ngcontent-%COMP%]{--status-color: var(--color-warning);border-color:#ff950033}.task-card.status-done[_ngcontent-%COMP%]{--status-color: var(--color-success)}.task-card.status-paused[_ngcontent-%COMP%]{--status-color: var(--color-text-secondary)}.task-card.status-error[_ngcontent-%COMP%]{--status-color: var(--color-error)}.task-card.is-active[_ngcontent-%COMP%]{box-shadow:var(--glass-shadow),0 0 0 2px rgba(var(--color-primary),.3)}.selection-checkbox[_ngcontent-%COMP%]{position:absolute;right:.875rem;top:1.125rem;z-index:2}.task-card.is-selected[_ngcontent-%COMP%]{border-color:var(--color-primary);box-shadow:var(--glass-shadow),0 0 0 2px var(--color-primary)}.task-card.is-selected[_ngcontent-%COMP%]:before{background:var(--color-primary)}.starred-indicator[_ngcontent-%COMP%]{position:absolute;top:.75rem;right:.75rem;font-size:1rem;width:1rem;height:1rem;color:#f5a623;pointer-events:none}.status-badge[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;position:relative}.status-badge[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;color:var(--status-color, var(--color-text-secondary))}.status-in-progress[_ngcontent-%COMP%] .status-badge[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 2s linear infinite}.status-badge[_ngcontent-%COMP%] .status-label[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--status-color, var(--color-text-secondary))}.status-badge[_ngcontent-%COMP%] .pulse-ring[_ngcontent-%COMP%]{position:absolute;left:-2px;top:-2px;width:20px;height:20px;border-radius:50%;border:2px solid var(--color-error);animation:_ngcontent-%COMP%_pulse 1.5s ease-out infinite;pointer-events:none}.task-project[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;font-size:.72rem;font-weight:600;color:var(--color-primary);opacity:.8;text-transform:uppercase;letter-spacing:.04em}.task-project[_ngcontent-%COMP%] .project-icon[_ngcontent-%COMP%]{font-size:.75rem;width:.75rem;height:.75rem}.task-name[_ngcontent-%COMP%]{margin:0;font-size:.95rem;font-weight:600;color:var(--color-text);line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.task-summary[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4;flex:1;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.task-summary.empty[_ngcontent-%COMP%]{font-style:italic;opacity:.6}.task-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-top:auto;padding-top:.25rem}.task-time[_ngcontent-%COMP%]{font-size:.72rem;color:var(--color-text-secondary);opacity:.8}.task-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.task-card[_ngcontent-%COMP%]:hover .task-actions[_ngcontent-%COMP%], .task-card[_ngcontent-%COMP%]:focus-within .task-actions[_ngcontent-%COMP%]{opacity:1}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{width:28px;height:28px;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;display:flex;align-items:center;justify-content:center}.task-actions[_ngcontent-%COMP%] .stop-btn[_ngcontent-%COMP%]{color:var(--color-error)}.task-actions[_ngcontent-%COMP%] .mark-done-btn[_ngcontent-%COMP%]{color:var(--color-success)}.task-actions[_ngcontent-%COMP%] .star-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.task-actions[_ngcontent-%COMP%] .star-btn.starred[_ngcontent-%COMP%]{color:#f5a623}.task-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.task-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]:hover{color:var(--color-error)}.task-actions[_ngcontent-%COMP%] .open-btn[_ngcontent-%COMP%]{color:var(--color-primary)}.task-actions[_ngcontent-%COMP%] .open-btn[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover)}@media(max-width:600px){.task-actions[_ngcontent-%COMP%]{opacity:1}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{width:36px;height:36px}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_pulse{0%{transform:scale(.8);opacity:1}to{transform:scale(2.2);opacity:0}}']})},Q={"waiting-you":"Waiting for you","in-progress":"In progress\u2026",done:"Done",paused:"Paused",error:"Error"},X={"waiting-you":"mark_unread_chat_alt","in-progress":"pending",done:"check_circle",paused:"pause_circle",error:"error"};var bt=300*1e3,kt={"waiting-you":0,"in-progress":1,done:2,paused:3,error:4};export{A,bt as b,kt as k};
1
+ import {cb as ZB,cc as qB,g,G as G$1,P,m as mT,e as xw,h as hr,j as Gn,k as ws,q as Rg,J as Jw,n as GC,o as pl,b$ as kC,A as Ug,T as Tg,X as XE,y as eC,a8 as Yg,a5 as vl,v as bg,a9 as lC,aa as If,ac as gC,ab as wf,S as Sg}from'./main-GYSPY3UE.js';import {v as ve,n as ne}from'./chunk-1pMMl5aQ.js';import {V as Ve,n as ne$1}from'./chunk-CZe6uHRZ.js';import {y as yt,w as wt}from'./chunk-DS1gnXQd.js';function L(a,e){if(a&1){let n=lC();ws(0,"div",1)(1,"mat-checkbox",21),Rg("click",function(r){return r.stopPropagation()})("change",function(r){If(n);let i=gC();return wf(i.selectionChanged.emit({id:i.task().id,selected:r.checked}))}),pl()();}if(a&2){let n=gC();XE(),bg("checked",n.selected()),Tg("aria-label","Select task: "+n.task().name);}}function Y(a,e){a&1&&(ws(0,"mat-icon",2),GC(1,"star"),pl());}function W(a,e){a&1&&Sg(0,"span",6);}function U(a,e){if(a&1&&(ws(0,"div",7)(1,"mat-icon",22),GC(2,"folder"),pl(),ws(3,"span"),GC(4),pl()()),a&2){let n=gC();XE(4),Yg(n.projectName());}}function B(a,e){if(a&1&&(ws(0,"p",9),GC(1),pl()),a&2){let n=gC();XE(),Yg(n.task().summary);}}function $(a,e){a&1&&(ws(0,"p",10),GC(1,"No summary yet"),pl());}function H(a,e){if(a&1){let n=lC();ws(0,"button",23),Rg("click",function(r){If(n);let i=gC();return wf(i.onOpenDirect(r))}),ws(1,"mat-icon"),GC(2,"open_in_new"),pl()();}}function F(a,e){if(a&1){let n=lC();ws(0,"button",24),Rg("click",function(r){If(n);let i=gC();return wf(i.onStop(r))}),ws(1,"mat-icon"),GC(2,"stop_circle"),pl()();}}function G(a,e){if(a&1){let n=lC();ws(0,"button",25),Rg("click",function(r){If(n);let i=gC();return wf(i.onMarkDone(r))}),ws(1,"mat-icon"),GC(2,"check_circle_outline"),pl()();}}function K(a,e){if(a&1){let n=lC();ws(0,"button",26),Rg("click",function(r){If(n);let i=gC();return wf(i.onMarkActive(r))}),ws(1,"mat-icon"),GC(2,"replay"),pl()();}}function J(a,e){if(a&1){let n=lC();ws(0,"button",27),Rg("click",function(r){If(n);let i=gC();return wf(i.onCloseTask(r))}),ws(1,"mat-icon"),GC(2,"close_fullscreen"),pl()();}}var A=class a{task=ZB.required();projectNameOverride=ZB(null);showProject=ZB(false);previewMode=ZB(false);selectable=ZB(false);selected=ZB(false);stopRequested=qB();deleteRequested=qB();starToggled=qB();closeTaskRequested=qB();markDoneRequested=qB();markActiveRequested=qB();previewRequested=qB();selectionChanged=qB();router=g(G$1);projectState=g(P);projectName=mT(()=>this.projectNameOverride()??this.projectState.getSelectedProjectId());statusLabel=mT(()=>Q[this.task().status]);statusIcon=mT(()=>X[this.task().status]);isWorktree=mT(()=>!!this.task().worktreeProject);navigate(){if(this.previewMode()){this.previewRequested.emit(this.task().id);return}let e=this.projectName();e&&(this.projectState.selectProject(e),this.router.navigate(["project",e,"thread",this.task().id]));}onStop(e){e.stopPropagation(),this.stopRequested.emit(this.task().id);}onDelete(e){e.stopPropagation(),this.deleteRequested.emit(this.task().id);}onStarToggle(e){e.stopPropagation(),this.starToggled.emit(this.task().id);}onCloseTask(e){e.stopPropagation(),this.closeTaskRequested.emit(this.task().id);}onMarkDone(e){e.stopPropagation(),this.markDoneRequested.emit(this.task().id);}onMarkActive(e){e.stopPropagation(),this.markActiveRequested.emit(this.task().id);}onOpenDirect(e){e.stopPropagation();let n=this.projectName();n&&(this.projectState.selectProject(n),this.router.navigate(["project",n,"thread",this.task().id]));}formatRelativeTime(e){let n=Date.now()-new Date(e).getTime(),t=Math.floor(n/6e4);if(t<1)return "just now";if(t<60)return `${t} min ago`;let r=Math.floor(t/60);if(r<24)return `${r}h ago`;let i=Math.floor(r/24);return i===1?"yesterday":i<7?`${i} days ago`:new Date(e).toLocaleDateString("en",{day:"numeric",month:"short"})}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=xw({type:a,selectors:[["app-task-card"]],inputs:{task:[1,"task"],projectNameOverride:[1,"projectNameOverride"],showProject:[1,"showProject"],previewMode:[1,"previewMode"],selectable:[1,"selectable"],selected:[1,"selected"]},outputs:{stopRequested:"stopRequested",deleteRequested:"deleteRequested",starToggled:"starToggled",closeTaskRequested:"closeTaskRequested",markDoneRequested:"markDoneRequested",markActiveRequested:"markActiveRequested",previewRequested:"previewRequested",selectionChanged:"selectionChanged"},decls:29,vars:25,consts:[["role","button","tabindex","0",1,"task-card",3,"click","keydown.enter","keydown.space"],[1,"selection-checkbox"],["aria-label","Starred",1,"starred-indicator"],[1,"status-badge"],[1,"status-icon"],[1,"status-label"],["aria-hidden","true",1,"pulse-ring"],[1,"task-project"],[1,"task-name"],[1,"task-summary"],[1,"task-summary","empty"],[1,"task-footer"],[1,"task-time"],[1,"task-actions"],["mat-icon-button","","matTooltip","Open full view","aria-label","Open task in full view",1,"action-btn","open-btn"],["mat-icon-button","","matTooltip","Stop agent","aria-label","Stop agent",1,"action-btn","stop-btn"],["mat-icon-button","","matTooltip","Mark as done","aria-label","Mark as done",1,"action-btn","mark-done-btn"],["mat-icon-button","","matTooltip","Mark as active","aria-label","Mark as active",1,"action-btn","mark-active-btn"],["mat-icon-button","",1,"action-btn","star-btn",3,"click","matTooltip"],["mat-icon-button","","matTooltip","Close task (removes worktree)","aria-label","Close task",1,"action-btn","close-task-btn"],["mat-icon-button","","matTooltip","Delete task","aria-label","Delete task",1,"action-btn","delete-btn",3,"click"],[3,"click","change","checked"],[1,"project-icon"],["mat-icon-button","","matTooltip","Open full view","aria-label","Open task in full view",1,"action-btn","open-btn",3,"click"],["mat-icon-button","","matTooltip","Stop agent","aria-label","Stop agent",1,"action-btn","stop-btn",3,"click"],["mat-icon-button","","matTooltip","Mark as done","aria-label","Mark as done",1,"action-btn","mark-done-btn",3,"click"],["mat-icon-button","","matTooltip","Mark as active","aria-label","Mark as active",1,"action-btn","mark-active-btn",3,"click"],["mat-icon-button","","matTooltip","Close task (removes worktree)","aria-label","Close task",1,"action-btn","close-task-btn",3,"click"]],template:function(n,t){n&1&&(ws(0,"article",0),Rg("click",function(){return t.navigate()})("keydown.enter",function(){return t.navigate()})("keydown.space",function(i){return t.navigate(),i.preventDefault()}),Jw(1,L,2,2,"div",1),Jw(2,Y,2,0,"mat-icon",2),ws(3,"div",3)(4,"mat-icon",4),GC(5),pl(),ws(6,"span",5),GC(7),pl(),Jw(8,W,1,0,"span",6),pl(),Jw(9,U,5,1,"div",7),ws(10,"h3",8),GC(11),pl(),Jw(12,B,2,1,"p",9)(13,$,2,0,"p",10),ws(14,"footer",11)(15,"span",12),GC(16),pl(),ws(17,"div",13),Jw(18,H,3,0,"button",14),Jw(19,F,3,0,"button",15),Jw(20,G,3,0,"button",16)(21,K,3,0,"button",17),ws(22,"button",18),Rg("click",function(i){return t.onStarToggle(i)}),ws(23,"mat-icon"),GC(24),pl()(),Jw(25,J,3,0,"button",19),ws(26,"button",20),Rg("click",function(i){return t.onDelete(i)}),ws(27,"mat-icon"),GC(28,"delete_outline"),pl()()()()()),n&2&&(kC("status-"+t.task().status),Ug("is-active",t.task().isActive)("is-selected",t.selected()),Tg("aria-label","Open task: "+t.task().name),XE(),eC(t.selectable()?1:-1),XE(),eC(t.task().starring.length>0?2:-1),XE(3),Yg(t.statusIcon()),XE(2),Yg(t.statusLabel()),XE(),eC(t.task().status==="waiting-you"?8:-1),XE(),eC(t.showProject()&&t.projectName()?9:-1),XE(2),vl(" ",t.task().name||"Unnamed task"," "),XE(),eC(t.task().summary?12:13),XE(4),Yg(t.formatRelativeTime(t.task().modifiedDate)),XE(2),eC(t.previewMode()?18:-1),XE(),eC(t.task().status==="in-progress"?19:-1),XE(),eC(t.task().status!=="done"?20:21),XE(2),Ug("starred",t.task().starring.length>0),bg("matTooltip",t.task().starring.length>0?"Unstar":"Star"),Tg("aria-label",t.task().starring.length>0?"Unstar task":"Star task"),XE(2),Yg(t.task().starring.length>0?"star":"star_border"),XE(),eC(t.isWorktree()?25:-1));},dependencies:[ve,ne,yt,wt,hr,Gn,Ve,ne$1],styles:['.glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:block}.task-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:16px;padding:1.25rem;cursor:pointer;position:relative;overflow:hidden;transition:transform .2s cubic-bezier(.4,0,.2,1),box-shadow .2s cubic-bezier(.4,0,.2,1),border-color .2s ease;outline:none;display:flex;flex-direction:column;gap:.5rem;min-height:160px}.task-card[_ngcontent-%COMP%]:hover, .task-card[_ngcontent-%COMP%]:focus-visible{transform:translateY(-3px);box-shadow:0 16px 48px #00000026}.task-card[_ngcontent-%COMP%]:active{transform:translateY(-1px)}.task-card[_ngcontent-%COMP%]:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;border-radius:16px 0 0 16px;background:var(--status-color, var(--color-text-secondary))}.task-card.status-waiting-you[_ngcontent-%COMP%]{--status-color: var(--color-error);border-color:#ff3b3040}.task-card.status-in-progress[_ngcontent-%COMP%]{--status-color: var(--color-warning);border-color:#ff950033}.task-card.status-done[_ngcontent-%COMP%]{--status-color: var(--color-success)}.task-card.status-paused[_ngcontent-%COMP%]{--status-color: var(--color-text-secondary)}.task-card.status-error[_ngcontent-%COMP%]{--status-color: var(--color-error)}.task-card.is-active[_ngcontent-%COMP%]{box-shadow:var(--glass-shadow),0 0 0 2px rgba(var(--color-primary),.3)}.selection-checkbox[_ngcontent-%COMP%]{position:absolute;right:.875rem;top:1.125rem;z-index:2}.task-card.is-selected[_ngcontent-%COMP%]{border-color:var(--color-primary);box-shadow:var(--glass-shadow),0 0 0 2px var(--color-primary)}.task-card.is-selected[_ngcontent-%COMP%]:before{background:var(--color-primary)}.starred-indicator[_ngcontent-%COMP%]{position:absolute;top:.75rem;right:.75rem;font-size:1rem;width:1rem;height:1rem;color:#f5a623;pointer-events:none}.status-badge[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;position:relative}.status-badge[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;color:var(--status-color, var(--color-text-secondary))}.status-in-progress[_ngcontent-%COMP%] .status-badge[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_spin 2s linear infinite}.status-badge[_ngcontent-%COMP%] .status-label[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--status-color, var(--color-text-secondary))}.status-badge[_ngcontent-%COMP%] .pulse-ring[_ngcontent-%COMP%]{position:absolute;left:-2px;top:-2px;width:20px;height:20px;border-radius:50%;border:2px solid var(--color-error);animation:_ngcontent-%COMP%_pulse 1.5s ease-out infinite;pointer-events:none}.task-project[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;font-size:.72rem;font-weight:600;color:var(--color-primary);opacity:.8;text-transform:uppercase;letter-spacing:.04em}.task-project[_ngcontent-%COMP%] .project-icon[_ngcontent-%COMP%]{font-size:.75rem;width:.75rem;height:.75rem}.task-name[_ngcontent-%COMP%]{margin:0;font-size:.95rem;font-weight:600;color:var(--color-text);line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.task-summary[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4;flex:1;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.task-summary.empty[_ngcontent-%COMP%]{font-style:italic;opacity:.6}.task-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-top:auto;padding-top:.25rem}.task-time[_ngcontent-%COMP%]{font-size:.72rem;color:var(--color-text-secondary);opacity:.8}.task-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.task-card[_ngcontent-%COMP%]:hover .task-actions[_ngcontent-%COMP%], .task-card[_ngcontent-%COMP%]:focus-within .task-actions[_ngcontent-%COMP%]{opacity:1}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{width:28px;height:28px;display:flex!important;align-items:center!important;justify-content:center!important;padding:0!important}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;display:flex;align-items:center;justify-content:center}.task-actions[_ngcontent-%COMP%] .stop-btn[_ngcontent-%COMP%]{color:var(--color-error)}.task-actions[_ngcontent-%COMP%] .mark-done-btn[_ngcontent-%COMP%]{color:var(--color-success)}.task-actions[_ngcontent-%COMP%] .star-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.task-actions[_ngcontent-%COMP%] .star-btn.starred[_ngcontent-%COMP%]{color:#f5a623}.task-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.task-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]:hover{color:var(--color-error)}.task-actions[_ngcontent-%COMP%] .open-btn[_ngcontent-%COMP%]{color:var(--color-primary)}.task-actions[_ngcontent-%COMP%] .open-btn[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover)}@media(max-width:600px){.task-actions[_ngcontent-%COMP%]{opacity:1}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{width:36px;height:36px}.task-actions[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes _ngcontent-%COMP%_pulse{0%{transform:scale(.8);opacity:1}to{transform:scale(2.2);opacity:0}}']})},Q={"waiting-you":"Waiting for you","in-progress":"In progress\u2026",done:"Done",paused:"Paused",error:"Error"},X={"waiting-you":"mark_unread_chat_alt","in-progress":"pending",done:"check_circle",paused:"pause_circle",error:"error"};var bt=300*1e3,kt={"waiting-you":0,"in-progress":1,done:2,paused:3,error:4};export{A,bt as b,kt as k};
@@ -1,2 +1,2 @@
1
- import {v}from'./chunk-CrDpiJQ_.js';import {R,q,J}from'./chunk-qnkDdlfN.js';import {g,ao as V,G,C as Ce$1,a as Gi,F,m as mT,cd as Hf,b as U,x,w,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,y as eC,a9 as lC,t as rC,a4 as nC,a3 as VI,S as Sg,ac as gC,v as bg,a6 as UI,z as oC,a5 as vl,cH as Kw,aa as If,ab as wf,b$ as kC,T as Tg}from'./main-COD2LZKB.js';import'./chunk-BvidtKG2.js';import {k as _t,b as _e$1,o as z,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-Bb0cfZpR.js';import'./chunk-JXiqGD2F.js';import'./chunk-KJgXoqSt.js';import'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';function se(i,t){i&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function ce(i,t){if(i&1&&(ws(0,"label",23),Sg(1,"input",24),VI(),ws(2,"span"),GC(3),pl()()),i&2){let e=t.$implicit,o=gC(3);XE(),bg("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),UI(),XE(2),Yg(e.label);}}function de(i,t){if(i&1&&(ws(0,"fieldset",8)(1,"legend",22),GC(2,"Configuration scope"),pl(),rC(3,ce,4,4,"label",23,Kw().trackByScope,true),pl()),i&2){let e=gC(2);bg("disabled",e.isEditMode()),XE(3),oC(e.scopeOptions);}}function ue(i,t){if(i&1&&(ws(0,"option",13),GC(1),pl()),i&2){let e=t.$implicit,o=gC(2);bg("value",e),XE(),Yg(o.authTypeLabel[e]);}}function pe(i,t){i&1&&GC(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(ws(0,"span",11),GC(1,"*"),pl());}function me(i,t){if(i&1&&(ws(0,"p",28),GC(1),pl()),i&2){let e=gC(2).$implicit;bg("id","as-hint-"+e.key),XE(),Yg(e.hint);}}function ge(i,t){if(i&1&&(Sg(0,"input",27),VI(),Jw(1,me,2,2,"p",28)),i&2){let e=gC().$implicit;kC("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),bg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),Tg("aria-describedby",e.hint?"as-hint-"+e.key:null),UI(),XE(),eC(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(ws(0,"div",9)(1,"label",26),GC(2),Jw(3,he,2,0,"span",11),pl(),Jw(4,ge,2,9),pl()),i&2){let e,o=t.$implicit,l=gC(3);XE(),bg("for","as-cred-"+o.key),XE(),vl(" ",o.label," "),XE(),eC(o.required?3:-1),XE(),eC((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(ws(0,"fieldset",18)(1,"legend",22),GC(2,"Credentials"),pl(),ws(3,"p",25),GC(4," Values are stored encrypted and masked on read. "),Jw(5,pe,1,0),pl(),rC(6,Ce,5,4,"div",9,Kw().trackByField,true),pl()),i&2){let e=gC(2);XE(5),eC(e.isEditMode()?5:-1),XE(),oC(e.credentialFields());}}function ye(i,t){if(i&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let l=gC();return wf(l.submit())}),Jw(1,de,5,1,"fieldset",8),ws(2,"div",9)(3,"label",10),GC(4,"Auth type "),ws(5,"span",11),GC(6,"*"),pl()(),ws(7,"select",12),rC(8,ue,2,2,"option",13,nC),pl(),VI(),pl(),ws(10,"div",9)(11,"label",14),GC(12,"Name "),ws(13,"span",11),GC(14,"*"),pl()(),Sg(15,"input",15),VI(),pl(),ws(16,"div",9)(17,"label",16),GC(18,"Description"),pl(),Sg(19,"input",17),VI(),pl(),Jw(20,fe,8,1,"fieldset",18),ws(21,"div",19)(22,"button",20),GC(23),pl(),ws(24,"button",21),Rg("click",function(){If(e);let l=gC();return wf(l.cancel())}),GC(25,"Cancel"),pl()()();}if(i&2){let e=gC();bg("formGroup",e.form),XE(),eC(e.isPlatformMode?-1:1),XE(6),bg("formControl",e.authTypeControl),UI(),XE(),oC(e.authTypeOptions),XE(7),bg("formControl",e.nameControl),UI(),XE(4),bg("formControl",e.descriptionControl),UI(),XE(),eC(e.credentialFields().length>0?20:-1),XE(2),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},le=class i{route=g(V);router=g(G);destroyRef=g(Ce$1);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Gi(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]});descriptionControl=new _t(null);authTypeControl=new _t("ApiKeyAuthSetting",{nonNullable:true,validators:[_e$1.required]});scopeControl=new _t("namespace",{nonNullable:true});form=new z({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new _t("",{nonNullable:true});usernameControl=new _t("",{nonNullable:true});passwordControl=new _t("",{nonNullable:true});tokenControl=new _t("",{nonNullable:true});discoveryUrlControl=new _t("",{nonNullable:true});authorizationUrlControl=new _t("",{nonNullable:true});tokenUrlControl=new _t("",{nonNullable:true});clientIdControl=new _t("",{nonNullable:true});clientSecretControl=new _t("",{nonNullable:true});scopesControl=new _t("",{nonNullable:true});resourceUrlControl=new _t("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=mT(()=>Se[this.selectedAuthType()]);isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Hf(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return x(w({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},l),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},l),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return o.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Auth Settings "),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,se,2,0,"p",5)(9,ye,26,8,"form",6),pl()),e&2&&(XE(7),Yg(o.isEditMode()?"Edit auth setting":"New auth setting"),XE(),eC(o.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
1
+ import {v}from'./chunk-BECO5DZL.js';import {R,q,J}from'./chunk-DfHrtnxD.js';import {g,ao as V,G,C as Ce$1,a as Gi,F,m as mT,cd as Hf,b as U,x,w,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a8 as Yg,y as eC,a9 as lC,t as rC,a4 as nC,a3 as VI,S as Sg,ac as gC,v as bg,a6 as UI,z as oC,a5 as vl,cH as Kw,aa as If,ab as wf,b$ as kC,T as Tg}from'./main-GYSPY3UE.js';import'./chunk-DdPOtjZp.js';import {k as _t,b as _e$1,o as z,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-DS1gnXQd.js';import'./chunk-DOeIIw1a.js';import'./chunk-CXqNbVXr.js';import'./chunk-CGjjc55P.js';import'./chunk-CZe6uHRZ.js';function se(i,t){i&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function ce(i,t){if(i&1&&(ws(0,"label",23),Sg(1,"input",24),VI(),ws(2,"span"),GC(3),pl()()),i&2){let e=t.$implicit,o=gC(3);XE(),bg("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),UI(),XE(2),Yg(e.label);}}function de(i,t){if(i&1&&(ws(0,"fieldset",8)(1,"legend",22),GC(2,"Configuration scope"),pl(),rC(3,ce,4,4,"label",23,Kw().trackByScope,true),pl()),i&2){let e=gC(2);bg("disabled",e.isEditMode()),XE(3),oC(e.scopeOptions);}}function ue(i,t){if(i&1&&(ws(0,"option",13),GC(1),pl()),i&2){let e=t.$implicit,o=gC(2);bg("value",e),XE(),Yg(o.authTypeLabel[e]);}}function pe(i,t){i&1&&GC(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(ws(0,"span",11),GC(1,"*"),pl());}function me(i,t){if(i&1&&(ws(0,"p",28),GC(1),pl()),i&2){let e=gC(2).$implicit;bg("id","as-hint-"+e.key),XE(),Yg(e.hint);}}function ge(i,t){if(i&1&&(Sg(0,"input",27),VI(),Jw(1,me,2,2,"p",28)),i&2){let e=gC().$implicit;kC("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),bg("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),Tg("aria-describedby",e.hint?"as-hint-"+e.key:null),UI(),XE(),eC(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(ws(0,"div",9)(1,"label",26),GC(2),Jw(3,he,2,0,"span",11),pl(),Jw(4,ge,2,9),pl()),i&2){let e,o=t.$implicit,l=gC(3);XE(),bg("for","as-cred-"+o.key),XE(),vl(" ",o.label," "),XE(),eC(o.required?3:-1),XE(),eC((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(ws(0,"fieldset",18)(1,"legend",22),GC(2,"Credentials"),pl(),ws(3,"p",25),GC(4," Values are stored encrypted and masked on read. "),Jw(5,pe,1,0),pl(),rC(6,Ce,5,4,"div",9,Kw().trackByField,true),pl()),i&2){let e=gC(2);XE(5),eC(e.isEditMode()?5:-1),XE(),oC(e.credentialFields());}}function ye(i,t){if(i&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let l=gC();return wf(l.submit())}),Jw(1,de,5,1,"fieldset",8),ws(2,"div",9)(3,"label",10),GC(4,"Auth type "),ws(5,"span",11),GC(6,"*"),pl()(),ws(7,"select",12),rC(8,ue,2,2,"option",13,nC),pl(),VI(),pl(),ws(10,"div",9)(11,"label",14),GC(12,"Name "),ws(13,"span",11),GC(14,"*"),pl()(),Sg(15,"input",15),VI(),pl(),ws(16,"div",9)(17,"label",16),GC(18,"Description"),pl(),Sg(19,"input",17),VI(),pl(),Jw(20,fe,8,1,"fieldset",18),ws(21,"div",19)(22,"button",20),GC(23),pl(),ws(24,"button",21),Rg("click",function(){If(e);let l=gC();return wf(l.cancel())}),GC(25,"Cancel"),pl()()();}if(i&2){let e=gC();bg("formGroup",e.form),XE(),eC(e.isPlatformMode?-1:1),XE(6),bg("formControl",e.authTypeControl),UI(),XE(),oC(e.authTypeOptions),XE(7),bg("formControl",e.nameControl),UI(),XE(4),bg("formControl",e.descriptionControl),UI(),XE(),eC(e.credentialFields().length>0?20:-1),XE(2),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},le=class i{route=g(V);router=g(G);destroyRef=g(Ce$1);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Gi(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]});descriptionControl=new _t(null);authTypeControl=new _t("ApiKeyAuthSetting",{nonNullable:true,validators:[_e$1.required]});scopeControl=new _t("namespace",{nonNullable:true});form=new z({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new _t("",{nonNullable:true});usernameControl=new _t("",{nonNullable:true});passwordControl=new _t("",{nonNullable:true});tokenControl=new _t("",{nonNullable:true});discoveryUrlControl=new _t("",{nonNullable:true});authorizationUrlControl=new _t("",{nonNullable:true});tokenUrlControl=new _t("",{nonNullable:true});clientIdControl=new _t("",{nonNullable:true});clientSecretControl=new _t("",{nonNullable:true});scopesControl=new _t("",{nonNullable:true});resourceUrlControl=new _t("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=mT(()=>Se[this.selectedAuthType()]);isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Hf(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return x(w({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},l),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},l),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return o.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Auth Settings "),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,se,2,0,"p",5)(9,ye,26,8,"form",6),pl()),e&2&&(XE(7),Yg(o.isEditMode()?"Edit auth setting":"New auth setting"),XE(),eC(o.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
2
2
  export{le as AuthSettingFormComponent};
@@ -1 +1 @@
1
- import {c}from'./chunk-BvidtKG2.js';import {g,ao as V,dr as G,a as Gi,an as ue$1,cd as Hf,e as xw,s as si,cF as Pb,k as ws,n as GC,o as pl,J as Jw,X as XE,y as eC,bR as Id,bS as va,cB as on,Q as By,a7 as ya,a9 as lC,q as Rg,ai as tm,a3 as VI,ac as gC,ak as em,a6 as UI,a8 as Yg,t as rC,z as oC,cg as iT,b4 as oT,bf as aT,bg as uT,b0 as Qg,bi as lT,aa as If,ab as wf,aj as KC,a5 as vl}from'./main-COD2LZKB.js';import {t as ti,J as Jn,Y as Ye,Z as Zn,l as Xn,g as gt,c as cn,d as an}from'./chunk-Bb0cfZpR.js';import'./chunk-KJgXoqSt.js';import'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';var ne=e=>({title:"By agent",rows:e}),ie=e=>({title:"By model",rows:e}),ae=(e,o)=>[e,o],oe=(e,o)=>o.title,re=(e,o)=>o.key;function se(e,o){e&1&&(ws(0,"p",2),GC(1,"Loading usage settings\u2026"),pl());}function le(e,o){if(e&1){let t=lC();ws(0,"p",3),GC(1,"Could not load usage settings. Please try again."),pl(),ws(2,"button",4),Rg("click",function(){If(t);let s=gC();return wf(s.configuration.retry())}),GC(3,"Retry usage settings"),pl();}}function me(e,o){e&1&&(ws(0,"p",2),GC(1,"Usage tracking is disabled."),pl());}function de(e,o){e&1&&(ws(0,"p",3),GC(1),pl()),e&2&&(XE(),Yg(o));}function ce(e,o){e&1&&(ws(0,"p",2),GC(1,"Loading usage\u2026"),pl());}function pe(e,o){e&1&&(ws(0,"p"),GC(1,"No recorded usage for this period."),pl());}function ge(e,o){if(e&1&&(ws(0,"small"),GC(1),pl()),e&2){let t=gC().$implicit;XE(),vl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function ue(e,o){if(e&1&&(ws(0,"tr")(1,"th",11),GC(2),pl(),ws(3,"td"),GC(4),aT(5,"number"),pl(),ws(6,"td"),GC(7),aT(8,"number"),aT(9,"number"),pl(),ws(10,"td"),GC(11),aT(12,"number"),aT(13,"number"),pl(),ws(14,"td"),GC(15),aT(16,"number"),Jw(17,ge,2,1,"small"),pl()()),e&2){let t=o.$implicit;XE(2),Yg(t.key),XE(2),Yg(uT(5,9,t.aggregate.totalTokens)),XE(3),Qg("",uT(8,11,t.aggregate.inputTokens)," / ",uT(9,13,t.aggregate.outputTokens)),XE(4),Qg(" ",uT(12,15,t.aggregate.cacheReadTokens)," / ",uT(13,17,t.aggregate.cacheWriteTokens)," "),XE(4),Qg(" ",t.aggregate.unknownCostCount>0?"At least ":"","",lT(16,19,t.aggregate.cost,"1.2-6")," "),XE(2),eC(t.aggregate.unknownCostCount>0?17:-1);}}function _e(e,o){if(e&1&&(ws(0,"div",9)(1,"table")(2,"thead")(3,"tr")(4,"th",10),GC(5,"Name"),pl(),ws(6,"th",10),GC(7,"Tokens"),pl(),ws(8,"th",10),GC(9,"Input / output"),pl(),ws(10,"th",10),GC(11,"Cache read / write"),pl(),ws(12,"th",10),GC(13,"Estimated cost"),pl()()(),ws(14,"tbody"),rC(15,ue,18,22,"tr",null,re),pl()()()),e&2){let t=gC().$implicit;XE(15),oC(t.rows);}}function Ce(e,o){if(e&1&&(ws(0,"h2"),GC(1),pl(),Jw(2,pe,2,0,"p")(3,_e,17,0,"div",9)),e&2){let t=o.$implicit;XE(),Yg(t.title),XE(),eC(t.rows.length===0?2:3);}}function fe(e,o){if(e&1&&(rC(0,Ce,4,2,null,null,oe),ws(2,"p"),GC(3,"Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish."),pl()),e&2){let t=gC(2);oC(iT(4,ae,oT(0,ne,t.agents()),oT(2,ie,t.models())));}}function ye(e,o){if(e&1){let t=lC();ws(0,"p"),GC(1,"Recorded LLM usage across this namespace. Costs are estimates in the platform currency."),pl(),ws(2,"form",5),Rg("ngSubmit",function(){If(t);let s=gC();return wf(s.load())}),ws(3,"label"),GC(4,"From (UTC)"),ws(5,"input",6),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.from,s)||(d.from=s),wf(s)}),pl(),VI(),pl(),ws(6,"label"),GC(7,"To (UTC)"),ws(8,"input",7),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.to,s)||(d.to=s),wf(s)}),pl(),VI(),pl(),ws(9,"button",8),GC(10,"Refresh"),pl()(),Jw(11,de,2,1,"p",3),Jw(12,ce,2,0,"p",2)(13,fe,4,7);}if(e&2){let t,r=gC();XE(5),em("ngModel",r.from),UI(),XE(3),em("ngModel",r.to),UI(),XE(3),eC((t=r.error())?11:-1,t),XE(),eC(r.loading()?12:r.error()?-1:13);}}var te=class e{route=g(V);api=g(G);configuration=g(c);namespaceId=this.route.snapshot.params.namespaceId;agents=Gi([]);models=Gi([]);error=Gi(null);loading=Gi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ue$1;constructor(){Hf(o=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(Id(void 0),va(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),on):(this.loading.set(true),By({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ya(d=>(this.loading.set(false),this.error.set(d.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),on))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});o(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-namespace-usage"]],decls:9,vars:1,consts:[[1,"report"],["routerLink","/agentos/namespaces"],["role","status"],["role","alert"],["type","button",3,"click"],[1,"filters",3,"ngSubmit"],["type","date","name","from","required","",3,"ngModelChange","ngModel"],["type","date","name","to","required","",3,"ngModelChange","ngModel"],["type","submit"],[1,"table-wrap"],["scope","col"],["scope","row"]],template:function(t,r){t&1&&(ws(0,"section",0)(1,"a",1),GC(2,"\u2190 Namespaces"),pl(),ws(3,"h1"),GC(4,"Usage and costs"),pl(),Jw(5,se,2,0,"p",2)(6,le,4,0)(7,me,2,0,"p",2)(8,ye,14,4),pl()),t&2&&(XE(5),eC(r.configuration.state()==="loading"?5:r.configuration.state()==="error"?6:r.configuration.state()==="disabled"?7:8));},dependencies:[ti,Jn,Ye,Zn,Xn,gt,cn,an,si,Pb],styles:["[_nghost-%COMP%]{display:block}.report[_ngcontent-%COMP%]{max-width:1100px;margin:auto;padding:1.5rem;color:var(--color-text, inherit)}a[_ngcontent-%COMP%]{color:inherit}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;margin:1.5rem 0}label[_ngcontent-%COMP%]{display:grid;gap:.4rem}input[_ngcontent-%COMP%], button[_ngcontent-%COMP%]{font:inherit;color:inherit;background:transparent;border:1px solid var(--color-border, rgba(136, 136, 136, .5333333333));border-radius:.4rem;padding:.5rem .75rem}button[_ngcontent-%COMP%]{cursor:pointer}.table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:collapse;width:100%}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{text-align:left;padding:.75rem;border-bottom:1px solid var(--color-border, rgba(136, 136, 136, .3333333333))}small[_ngcontent-%COMP%]{display:block;margin-top:.3rem}h2[_ngcontent-%COMP%]{margin-top:2rem}"]})};export{te as NamespaceUsageComponent};
1
+ import {c}from'./chunk-DdPOtjZp.js';import {g,ao as V,dr as G,a as Gi,an as ue$1,cd as Hf,e as xw,s as si,cF as Pb,k as ws,n as GC,o as pl,J as Jw,X as XE,y as eC,bR as Id,bS as va,cB as on,Q as By,a7 as ya,a9 as lC,q as Rg,ai as tm,a3 as VI,ac as gC,ak as em,a6 as UI,a8 as Yg,t as rC,z as oC,cg as iT,b4 as oT,bf as aT,bg as uT,b0 as Qg,bi as lT,aa as If,ab as wf,aj as KC,a5 as vl}from'./main-GYSPY3UE.js';import {t as ti,J as Jn,Y as Ye,Z as Zn,l as Xn,g as gt,c as cn,d as an}from'./chunk-DS1gnXQd.js';import'./chunk-CXqNbVXr.js';import'./chunk-CGjjc55P.js';import'./chunk-CZe6uHRZ.js';var ne=e=>({title:"By agent",rows:e}),ie=e=>({title:"By model",rows:e}),ae=(e,o)=>[e,o],oe=(e,o)=>o.title,re=(e,o)=>o.key;function se(e,o){e&1&&(ws(0,"p",2),GC(1,"Loading usage settings\u2026"),pl());}function le(e,o){if(e&1){let t=lC();ws(0,"p",3),GC(1,"Could not load usage settings. Please try again."),pl(),ws(2,"button",4),Rg("click",function(){If(t);let s=gC();return wf(s.configuration.retry())}),GC(3,"Retry usage settings"),pl();}}function me(e,o){e&1&&(ws(0,"p",2),GC(1,"Usage tracking is disabled."),pl());}function de(e,o){e&1&&(ws(0,"p",3),GC(1),pl()),e&2&&(XE(),Yg(o));}function ce(e,o){e&1&&(ws(0,"p",2),GC(1,"Loading usage\u2026"),pl());}function pe(e,o){e&1&&(ws(0,"p"),GC(1,"No recorded usage for this period."),pl());}function ge(e,o){if(e&1&&(ws(0,"small"),GC(1),pl()),e&2){let t=gC().$implicit;XE(),vl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function ue(e,o){if(e&1&&(ws(0,"tr")(1,"th",11),GC(2),pl(),ws(3,"td"),GC(4),aT(5,"number"),pl(),ws(6,"td"),GC(7),aT(8,"number"),aT(9,"number"),pl(),ws(10,"td"),GC(11),aT(12,"number"),aT(13,"number"),pl(),ws(14,"td"),GC(15),aT(16,"number"),Jw(17,ge,2,1,"small"),pl()()),e&2){let t=o.$implicit;XE(2),Yg(t.key),XE(2),Yg(uT(5,9,t.aggregate.totalTokens)),XE(3),Qg("",uT(8,11,t.aggregate.inputTokens)," / ",uT(9,13,t.aggregate.outputTokens)),XE(4),Qg(" ",uT(12,15,t.aggregate.cacheReadTokens)," / ",uT(13,17,t.aggregate.cacheWriteTokens)," "),XE(4),Qg(" ",t.aggregate.unknownCostCount>0?"At least ":"","",lT(16,19,t.aggregate.cost,"1.2-6")," "),XE(2),eC(t.aggregate.unknownCostCount>0?17:-1);}}function _e(e,o){if(e&1&&(ws(0,"div",9)(1,"table")(2,"thead")(3,"tr")(4,"th",10),GC(5,"Name"),pl(),ws(6,"th",10),GC(7,"Tokens"),pl(),ws(8,"th",10),GC(9,"Input / output"),pl(),ws(10,"th",10),GC(11,"Cache read / write"),pl(),ws(12,"th",10),GC(13,"Estimated cost"),pl()()(),ws(14,"tbody"),rC(15,ue,18,22,"tr",null,re),pl()()()),e&2){let t=gC().$implicit;XE(15),oC(t.rows);}}function Ce(e,o){if(e&1&&(ws(0,"h2"),GC(1),pl(),Jw(2,pe,2,0,"p")(3,_e,17,0,"div",9)),e&2){let t=o.$implicit;XE(),Yg(t.title),XE(),eC(t.rows.length===0?2:3);}}function fe(e,o){if(e&1&&(rC(0,Ce,4,2,null,null,oe),ws(2,"p"),GC(3,"Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish."),pl()),e&2){let t=gC(2);oC(iT(4,ae,oT(0,ne,t.agents()),oT(2,ie,t.models())));}}function ye(e,o){if(e&1){let t=lC();ws(0,"p"),GC(1,"Recorded LLM usage across this namespace. Costs are estimates in the platform currency."),pl(),ws(2,"form",5),Rg("ngSubmit",function(){If(t);let s=gC();return wf(s.load())}),ws(3,"label"),GC(4,"From (UTC)"),ws(5,"input",6),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.from,s)||(d.from=s),wf(s)}),pl(),VI(),pl(),ws(6,"label"),GC(7,"To (UTC)"),ws(8,"input",7),tm("ngModelChange",function(s){If(t);let d=gC();return KC(d.to,s)||(d.to=s),wf(s)}),pl(),VI(),pl(),ws(9,"button",8),GC(10,"Refresh"),pl()(),Jw(11,de,2,1,"p",3),Jw(12,ce,2,0,"p",2)(13,fe,4,7);}if(e&2){let t,r=gC();XE(5),em("ngModel",r.from),UI(),XE(3),em("ngModel",r.to),UI(),XE(3),eC((t=r.error())?11:-1,t),XE(),eC(r.loading()?12:r.error()?-1:13);}}var te=class e{route=g(V);api=g(G);configuration=g(c);namespaceId=this.route.snapshot.params.namespaceId;agents=Gi([]);models=Gi([]);error=Gi(null);loading=Gi(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new ue$1;constructor(){Hf(o=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(Id(void 0),va(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),on):(this.loading.set(true),By({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(ya(d=>(this.loading.set(false),this.error.set(d.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),on))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});o(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=xw({type:e,selectors:[["agentos-namespace-usage"]],decls:9,vars:1,consts:[[1,"report"],["routerLink","/agentos/namespaces"],["role","status"],["role","alert"],["type","button",3,"click"],[1,"filters",3,"ngSubmit"],["type","date","name","from","required","",3,"ngModelChange","ngModel"],["type","date","name","to","required","",3,"ngModelChange","ngModel"],["type","submit"],[1,"table-wrap"],["scope","col"],["scope","row"]],template:function(t,r){t&1&&(ws(0,"section",0)(1,"a",1),GC(2,"\u2190 Namespaces"),pl(),ws(3,"h1"),GC(4,"Usage and costs"),pl(),Jw(5,se,2,0,"p",2)(6,le,4,0)(7,me,2,0,"p",2)(8,ye,14,4),pl()),t&2&&(XE(5),eC(r.configuration.state()==="loading"?5:r.configuration.state()==="error"?6:r.configuration.state()==="disabled"?7:8));},dependencies:[ti,Jn,Ye,Zn,Xn,gt,cn,an,si,Pb],styles:["[_nghost-%COMP%]{display:block}.report[_ngcontent-%COMP%]{max-width:1100px;margin:auto;padding:1.5rem;color:var(--color-text, inherit)}a[_ngcontent-%COMP%]{color:inherit}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;margin:1.5rem 0}label[_ngcontent-%COMP%]{display:grid;gap:.4rem}input[_ngcontent-%COMP%], button[_ngcontent-%COMP%]{font:inherit;color:inherit;background:transparent;border:1px solid var(--color-border, rgba(136, 136, 136, .5333333333));border-radius:.4rem;padding:.5rem .75rem}button[_ngcontent-%COMP%]{cursor:pointer}.table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{border-collapse:collapse;width:100%}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{text-align:left;padding:.75rem;border-bottom:1px solid var(--color-border, rgba(136, 136, 136, .3333333333))}small[_ngcontent-%COMP%]{display:block;margin-top:.3rem}h2[_ngcontent-%COMP%]{margin-top:2rem}"]})};export{te as NamespaceUsageComponent};
@@ -0,0 +1 @@
1
+ import {bS as va,a7 as ya,W as br,cE as Ad}from'./main-GYSPY3UE.js';function i(t,o,p){return t.pipe(va(()=>o().pipe(ya(()=>br(p)))),Ad({bufferSize:1,refCount:true}))}export{i};