@whoz-oss/coday-client 3.16.0 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/chunk--yaU4Sri.js +1 -0
- package/browser/{chunk-kvCfAm7Z.js → chunk-4uEZjTft.js} +1 -1
- package/browser/chunk-4v7WiOTx.js +1 -0
- package/browser/chunk-B-UKlpjJ.js +1 -0
- package/browser/chunk-B13_C_P9.js +675 -0
- package/browser/chunk-B17Inq8D.js +2 -0
- package/browser/chunk-B1vuv-dv.js +1 -0
- package/browser/{chunk-Bhq5earA.js → chunk-BEdQqXxw.js} +1 -1
- package/browser/{chunk-B_9LxHBv.js → chunk-BGTRsbsl.js} +1 -1
- package/browser/{chunk-pH1k_bet.js → chunk-BHiaH1Jm.js} +1 -1
- package/browser/chunk-BJld3zB5.js +9 -0
- package/browser/{chunk-7jUQT_3F.js → chunk-BVmICoo4.js} +1 -1
- package/browser/chunk-BXCHG0wB.js +1 -0
- package/browser/{chunk-DOq0u21j.js → chunk-B_Sx6nwb.js} +1 -1
- package/browser/{chunk-CXLytVC3.js → chunk-BbPMe8u2.js} +1 -1
- package/browser/{chunk-6gdeYlLc.js → chunk-Bb_J3EoX.js} +1 -1
- package/browser/chunk-BfE6wTUj.js +1 -0
- package/browser/chunk-Bnj9Hkqy.js +276 -0
- package/browser/chunk-BqWEyotW.js +55 -0
- package/browser/{chunk-Dcftf7UY.js → chunk-Buu9Jf-V.js} +2 -2
- package/browser/{chunk-0OiZWE88.js → chunk-CJAdjOmi.js} +1 -1
- package/browser/{chunk-Bn3R3VC2.js → chunk-CJEW8Ogd.js} +5 -5
- package/browser/chunk-CM1_Z4h5.js +1 -0
- package/browser/{chunk-BTS5TBK0.js → chunk-CP3b1EMm.js} +1 -1
- package/browser/chunk-CR817PBg.js +1 -0
- package/browser/{chunk-YfG457Nc.js → chunk-CXgj_KJY.js} +3 -3
- package/browser/{chunk-CYulIMKp.js → chunk-CakkML6n.js} +1 -1
- package/browser/{chunk-DQLU3kYb.js → chunk-CfPmQ0Fw.js} +1 -1
- package/browser/chunk-CgNkwpQ7.js +508 -0
- package/browser/chunk-Cjk-zAXy.js +1 -0
- package/browser/chunk-ClCDsg8D.js +5 -0
- package/browser/{chunk-BdpJ2ZCM.js → chunk-CmyT-Z4A.js} +1 -1
- package/browser/{chunk-C_s4Z3Dk.js → chunk-CqJ7rGVY.js} +1 -1
- package/browser/{chunk-SbH2L3h2.js → chunk-CxpHnwnx.js} +1 -1
- package/browser/{chunk-CtWMrBfw.js → chunk-D1ZnLng-.js} +1 -1
- package/browser/{chunk-swj7IkJA.js → chunk-D26Y186i.js} +1 -1
- package/browser/chunk-D2zGvbD2.js +190 -0
- package/browser/{chunk-IUvEtpfr.js → chunk-D30bRRTP.js} +1 -1
- package/browser/{chunk-CTuHnJP4.js → chunk-D4dmZgr6.js} +1 -1
- package/browser/{chunk-CiWu4t_i.js → chunk-D6nkbOg1.js} +1 -1
- package/browser/chunk-D8nXP3jN.js +2 -0
- package/browser/{chunk-BNS6Fgaw.js → chunk-D92adUD_.js} +1 -1
- package/browser/{chunk-Bib1Seeu.js → chunk-DDu5Ufv3.js} +1 -1
- package/browser/{chunk-HjD5Rk4C.js → chunk-DFjZf9oL.js} +3 -3
- package/browser/{chunk-B0vRsgnD.js → chunk-DJjbZAaS.js} +1 -1
- package/browser/{chunk-CgqDTJ5-.js → chunk-DKQvH1hP.js} +1 -1
- package/browser/{chunk-UzUd84Qf.js → chunk-DMUiJ7oP.js} +1 -1
- package/browser/chunk-DMyGIjcZ.js +1 -0
- package/browser/chunk-DOHvMo5p.js +1 -0
- package/browser/{chunk-CbK5Lcu9.js → chunk-DVTNoWCQ.js} +1 -1
- package/browser/chunk-DV_7IOl_.js +1 -0
- package/browser/chunk-DaoWXYMw.js +1 -0
- package/browser/{chunk-jv0lz5Ah.js → chunk-DmaEv05C.js} +1 -1
- package/browser/{chunk-BSSDDOqW.js → chunk-DoqL_RuM.js} +2 -2
- package/browser/chunk-FMHkoXwM.js +37 -0
- package/browser/{chunk-axGY7UtD.js → chunk-Fr6-w83-.js} +1 -1
- package/browser/{chunk-iNIQR015.js → chunk-HHPhxe9B.js} +1 -1
- package/browser/{chunk-fhFxOLYS.js → chunk-IYMfBoNU.js} +1 -1
- package/browser/chunk-PQu4_Hy2.js +2 -0
- package/browser/chunk-Qpb04pBJ.js +1 -0
- package/browser/{chunk-CBNhmZDS.js → chunk-W5DNK5PC.js} +1 -1
- package/browser/{chunk-BHZY3TvC.js → chunk-WSA7xa0h.js} +5 -5
- package/browser/{chunk-BJYyjaQ6.js → chunk-lX2E6ugr.js} +1 -1
- package/browser/{chunk-CGMAzvSo.js → chunk-o2LY9dfG.js} +1 -1
- package/browser/{chunk-DzlrRiVM.js → chunk-py_Q_oQH.js} +1 -1
- package/browser/{chunk-BUJoEGsf.js → chunk-t87lD8bQ.js} +1 -1
- package/browser/{chunk-Be1LOFvg.js → chunk-vL7dLM7S.js} +1 -1
- package/browser/{chunk-Co81dkbz.js → chunk-zvR-rokl.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/main-YYHD6X7H.js +1811 -0
- package/package.json +1 -1
- package/browser/chunk-BEKR4Un_.js +0 -1
- package/browser/chunk-BEUXx3TO.js +0 -1
- package/browser/chunk-BJeLQooO.js +0 -1
- package/browser/chunk-BY7uKZAo.js +0 -9
- package/browser/chunk-BdApeECy.js +0 -1
- package/browser/chunk-C-aF2_1R.js +0 -55
- package/browser/chunk-CFZbDe5T.js +0 -5
- package/browser/chunk-CPBcDx4G.js +0 -1
- package/browser/chunk-Ci1jk71f.js +0 -276
- package/browser/chunk-CjrWXBiR.js +0 -2
- package/browser/chunk-CtkiOUdU.js +0 -675
- package/browser/chunk-CwaAd8kk.js +0 -1
- package/browser/chunk-DDnWPYAA.js +0 -2
- package/browser/chunk-Dfujxxcr.js +0 -1
- package/browser/chunk-DgrvmqY2.js +0 -2
- package/browser/chunk-DoKoAMs6.js +0 -1
- package/browser/chunk-Dtu-PLbq.js +0 -1
- package/browser/chunk-S8F5_Te_.js +0 -508
- package/browser/chunk-YS-vAhPY.js +0 -190
- package/browser/chunk-fYErSEXN.js +0 -1
- package/browser/chunk-gmPqDrDS.js +0 -1
- package/browser/chunk-izARvh_2.js +0 -1
- package/browser/chunk-rwEyLSEP.js +0 -1
- package/browser/chunk-tTmeIHGS.js +0 -37
- package/browser/main-5PAOSHSM.js +0 -1811
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {s as se}from'./chunk-CXgj_KJY.js';import {a as Dr,z as zi,F as Fn,H as Hi,h as ht,b as gr,_ as _r}from'./chunk-B13_C_P9.js';import {g,B as gy,P,K as x,aL as wo,aM as Zn,bD as ge,bE as vt,aO as wt,bs as bl,az as Xt,aW as C,aS as K,bF as J,al as vt$1,aT as Ut,bG as p,bH as Pt,j as jw,a_ as rb,bA as bC,bI as Cg,b5 as lT,x as jg,bJ as dr,y as MC,N as NC,bv as Lg,bK as fe,bL as pe,bM as mr,aP as G,bt as Qn,bN as F,aR as Ps,an as ue,O as Ot,bO as mt,bP as Jy,ae as kt$1,I as br,r as re,bQ as Xy,bR as Sd,bS as Da,aF as R$1,bu as Ve$1,bT as pn,bU as Fd,bV as tv,aA as an,bW as Y,bX as Pt$1,bY as po,bZ as X,b_ as xt,aZ as Bs,aC as bu,n as kg,S as Sg,aw as gl,bB as SC,ax as ml,ac as CC,b$ as UC,w as zg,c0 as Rg,c1 as E,c2 as PE,c3 as kt$2,bC as _i}from'./main-YYHD6X7H.js';import {D}from'./chunk-FMHkoXwM.js';var xe=class a{http=g(gy);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(gl(0,"div",1,0),SC(2),ml()),a&2){let e=o.id,t=CC();UC(t._classList),zg("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),Rg("id",t.id),Sg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new C("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(bl);_elementRef=g(Xt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=J.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new vt$1;opened=new vt$1;closed=new vt$1;optionActivated=new vt$1;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=jw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&Lg(n,Fn,5)(n,Hi,5),t&2){let s;MC(s=NC())&&(i.options=s),MC(s=NC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&jg(dr,7)(Ke,5),t&2){let n;MC(n=NC())&&(i.template=n.first),MC(n=NC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",rb],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",rb],requireSelection:[2,"requireSelection","requireSelection",rb],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",rb],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",rb]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[lT([{provide:zi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(bC(),Cg(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
|
|
2
|
+
width: 100%;
|
|
3
|
+
max-height: 256px;
|
|
4
|
+
visibility: hidden;
|
|
5
|
+
transform-origin: center top;
|
|
6
|
+
overflow: auto;
|
|
7
|
+
padding: 8px 0;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
position: relative;
|
|
10
|
+
border-radius: var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));
|
|
11
|
+
box-shadow: var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));
|
|
12
|
+
background-color: var(--mat-autocomplete-background-color, var(--mat-sys-surface-container));
|
|
13
|
+
}
|
|
14
|
+
@media (forced-colors: active) {
|
|
15
|
+
div.mat-mdc-autocomplete-panel {
|
|
16
|
+
outline: solid 1px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel {
|
|
20
|
+
border-top-left-radius: 0;
|
|
21
|
+
border-top-right-radius: 0;
|
|
22
|
+
}
|
|
23
|
+
.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel {
|
|
24
|
+
border-bottom-left-radius: 0;
|
|
25
|
+
border-bottom-right-radius: 0;
|
|
26
|
+
transform-origin: center bottom;
|
|
27
|
+
}
|
|
28
|
+
div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible {
|
|
29
|
+
visibility: visible;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden,
|
|
33
|
+
.cdk-overlay-pane:has(> .mat-mdc-autocomplete-hidden) {
|
|
34
|
+
visibility: hidden;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@keyframes _mat-autocomplete-enter {
|
|
39
|
+
from {
|
|
40
|
+
opacity: 0;
|
|
41
|
+
transform: scaleY(0.8);
|
|
42
|
+
}
|
|
43
|
+
to {
|
|
44
|
+
opacity: 1;
|
|
45
|
+
transform: none;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
.mat-autocomplete-panel-animations-enabled {
|
|
49
|
+
animation: _mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
mat-autocomplete {
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
55
|
+
`],encapsulation:2})}return a})();var Ye={provide:D,useExisting:_i(()=>ze),multi:true};var Ge=new C("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let a=g(pe);return ()=>kt$2(a)}}),ze=(()=>{class a{_environmentInjector=g(fe);_element=g(Xt);_injector=g(pe);_viewContainerRef=g(mr);_zone=g(G);_changeDetectorRef=g(bl);_dir=g(Qn,{optional:true});_formField=g(se,{optional:true,host:true});_viewportRuler=g(F);_scrollStrategy=g(Ge);_renderer=g(Ps);_animationsDisabled=K();_defaults=g(Ve,{optional:true});_overlayRef=null;_portal;_componentDestroyed=false;_initialized=new ue;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue=null;_valueOnAttach=null;_valueOnLastKeydown=null;_positionStrategy;_manuallyFloatingLabel=false;_closingActionsSubscription;_viewportSubscription=J.EMPTY;_breakpointObserver=g(Ot);_handsetLandscapeSubscription=J.EMPTY;_canOpenOnNextFocus=true;_valueBeforeAutoSelection;_pendingAutoselectedOption=null;_closeKeyEventStream=new ue;_overlayPanelClass=mt(this._defaults?.overlayPanelClass||[]);_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus();};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled=false;_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler);}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition());}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=true,this._destroyPanel(),this._closeKeyEventStream.complete();}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=false;openPanel(){this._openPanelInternal();}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit();}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=false,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=false,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges());}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition();}get panelClosingActions(){return Jy(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(kt$1(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(kt$1(()=>this._overlayAttached)):br()).pipe(re(e=>e instanceof ht?e:null))}optionSelections=Xy(()=>{let e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(Sd(e),Da(()=>Jy(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(Da(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new R$1(e=>{let t=n=>{let s=E(n),l=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,E$1=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&s!==this._element.nativeElement&&!this._hasFocus()&&(!l||!l.contains(s))&&(!E$1||!E$1.contains(s))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(s)&&e.next(n);},i=[this._renderer.listen("document","click",t),this._renderer.listen("document","auxclick",t),this._renderer.listen("document","touchend",t)];return ()=>{i.forEach(n=>n());}})}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e));}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this._element.nativeElement.disabled=e;}_handleKeydown(e){let t=e,i=t.keyCode,n=Ve$1(t);if(i===27&&!n&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&i===13&&this.panelOpen&&!n)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let s=this.autocomplete._keyManager.activeItem,l=i===38||i===40;i===9||l&&!n&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):l&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(l||this.autocomplete._keyManager.activeItem!==s)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)));}}_handleInput(e){let t=e.target,i=t.value;if(t.type==="number"&&(i=i==""?null:parseFloat(i)),this._previousValue!==i){if(this._previousValue=i,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(i),!i)this._clearPreviousSelectedOption(null,false);else if(this.panelOpen&&!this.autocomplete.requireSelection){let n=this.autocomplete.options?.find(s=>s.selected);if(n){let s=this._getDisplayValue(n.value);i!==s&&n.deselect(false);}}if(this._canOpen()&&this._hasFocus()){let n=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(n);}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(true)):this._canOpenOnNextFocus=true;}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal();}_hasFocus(){return pn()===this._element.nativeElement}_floatLabel(e=false){this._formField&&this._formField.floatLabel==="auto"&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=true);}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=false);}_subscribeToClosingActions(){let e=new R$1(i=>{PE(()=>{i.next();},{injector:this._environmentInjector});}),t=this.autocomplete.options?.changes.pipe(Fd(()=>this._positionStrategy.reapplyLastPosition()),tv(0))??br();return Jy(e,t).pipe(Da(()=>this._zone.run(()=>{let i=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),i!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),an(1)).subscribe(i=>this._setValueAndClose(i))}_emitOpened(){this.autocomplete.opened.emit();}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null);}_getDisplayValue(e){let t=this.autocomplete;return t&&t.displayWith?t.displayWith(e):e}_assignOptionValue(e){let t=this._getDisplayValue(e);e==null&&this._clearPreviousSelectedOption(null,false),this._updateNativeInputValue(t??"");}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e;}_setValueAndClose(e){let t=this.autocomplete,i=e?e.source:this._pendingAutoselectedOption;i?(this._clearPreviousSelectedOption(i),this._assignOptionValue(i.value),this._onChange(i.value),t._emitSelectEvent(i),this._element.nativeElement.focus()):t.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),this._onChange(null)),this.closePanel();}_clearPreviousSelectedOption(e,t){this.autocomplete?.options?.forEach(i=>{i!==e&&i.selected&&i.deselect(t);});}_openPanelInternal(e=this._element.nativeElement.value){this._attachOverlay(e),this._floatLabel();}_attachOverlay(e){if(!this.autocomplete)return;let t=this._overlayRef;t?(this._positionStrategy.setOrigin(this._getConnectedElement()),t.updateSize({width:this._getPanelWidth()})):(this._portal=new Y(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),t=Pt$1(this._injector,this._getOverlayConfig()),this._overlayRef=t,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&t&&t.updateSize({width:this._getPanelWidth()});}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(po.HandsetLandscape).subscribe(n=>{n.matches?this._positionStrategy.withFlexibleDimensions(true).withGrowAfterOpen(true).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(false).withGrowAfterOpen(false).withViewportMargin(0);})),t&&!t.hasAttached()&&(t.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let i=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=true,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this.panelOpen&&i!==this.panelOpen&&this._emitOpened();}_handlePanelKeydown=e=>{(e.keyCode===27&&!Ve$1(e)||e.keyCode===38&&Ve$1(e,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),e.stopPropagation(),e.preventDefault());};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe());}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=void 0;}_getOverlayConfig(){return new X({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,hasBackdrop:this._defaults?.hasBackdrop,backdropClass:this._defaults?.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:this._overlayPanelClass,disableAnimations:this._animationsDisabled})}_getOverlayPosition(){let e=xt(this._injector,this._getConnectedElement()).withFlexibleDimensions(false).withPush(false).withPopoverLocation("inline");return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){let t=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],i=this._aboveClass,n=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:i},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:i}],s;this.position==="above"?s=n:this.position==="below"?s=t:s=[...t,...n],e.withPositions(s);}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let e=this.autocomplete;if(e.autoActiveFirstOption){let t=-1;for(let i=0;i<e.options.length;i++)if(!e.options.get(i).disabled){t=i;break}e._keyManager.setActiveItem(t);}else e._keyManager.setActiveItem(-1);}_canOpen(){let e=this._element.nativeElement;return !e.readOnly&&!e.disabled&&!this.autocompleteDisabled}_scrollToOption(e){let t=this.autocomplete,i=gr(e,t.options,t.optionGroups);if(e===0&&i===1)t._setScrollTop(0);else if(t.panel){let n=t.options.toArray()[e];if(n){let s=n._getHostElement(),l=_r(s.offsetTop,s.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(l);}}}static \u0275fac=function(t){return new(t||a)};static \u0275dir=Bs({type:a,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(t,i){t&1&&kg("focusin",function(){return i._handleFocus()})("blur",function(){return i._onTouched()})("input",function(s){return i._handleInput(s)})("keydown",function(s){return i._handleKeydown(s)})("click",function(){return i._handleClick()}),t&2&&Sg("autocomplete",i.autocompleteAttribute)("role",i.autocompleteDisabled?null:"combobox")("aria-autocomplete",i.autocompleteDisabled?null:"list")("aria-activedescendant",i.panelOpen&&i.activeOption?i.activeOption.id:null)("aria-expanded",i.autocompleteDisabled?null:i.panelOpen.toString())("aria-controls",i.autocompleteDisabled||!i.panelOpen?null:i.autocomplete?.id)("aria-haspopup",i.autocompleteDisabled?null:"listbox");},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",rb]},exportAs:["matAutocompleteTrigger"],features:[lT([Ye]),bu]})}return a})(),kt=(()=>{class a{static \u0275fac=function(t){return new(t||a)};static \u0275mod=wo({type:a});static \u0275inj=Zn({imports:[ge,Dr,vt,Dr,wt]})}return a})();export{Ct as C,kt as k,xe as x,ze as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b as Qe}from'./chunk-
|
|
1
|
+
import {b as Qe}from'./chunk-CgNkwpQ7.js';import {D as D$1,i as y}from'./chunk-FMHkoXwM.js';import {aL as wo,aM as Zn,aO as wt,g as g$1,az as Xt,bs as bl,aP as G,aS as K,aW as C,al as vt,aX as D,bx as on,by as dm,aT as Ut,W as Wi,j as jw,bz as Oi,aC as bu,a_ as rb,bA as bC,k as Cs,n as kg,m as hl,M as Mg,c9 as Pf,ck as Lf,bB as SC,A as AC,_ as _g,t as sI,w as zg,S as Sg,b5 as lT,bC as _i,c8 as ob,c0 as Rg,b$ as UC,x as jg,y as MC,N as NC}from'./main-YYHD6X7H.js';var W=["input"],Y=["label"],ee=["*"],f={color:"accent",clickAction:"check-indeterminate",disabledInteractive:false},ce=new C("mat-checkbox-default-options",{providedIn:"root",factory:()=>f}),a=(function(t){return t[t.Init=0]="Init",t[t.Checked=1]="Checked",t[t.Unchecked=2]="Unchecked",t[t.Indeterminate=3]="Indeterminate",t})(a||{}),g=class{source;checked},ne=(()=>{class t{_elementRef=g$1(Xt);_changeDetectorRef=g$1(bl);_ngZone=g$1(G);_animationsDisabled=K();_options=g$1(ce,{optional:true});focus(){this._inputElement.nativeElement.focus();}_createChangeEvent(e){let n=new g;return n.source=this,n.checked=e,n}_getAnimationTargetElement(){return this._inputElement?.nativeElement}_animationClasses={uncheckedToChecked:"mdc-checkbox--anim-unchecked-checked",uncheckedToIndeterminate:"mdc-checkbox--anim-unchecked-indeterminate",checkedToUnchecked:"mdc-checkbox--anim-checked-unchecked",checkedToIndeterminate:"mdc-checkbox--anim-checked-indeterminate",indeterminateToChecked:"mdc-checkbox--anim-indeterminate-checked",indeterminateToUnchecked:"mdc-checkbox--anim-indeterminate-unchecked"};ariaLabel="";ariaLabelledby=null;ariaDescribedby;ariaExpanded;ariaControls;ariaOwns;_uniqueId;id;get inputId(){return `${this.id||this._uniqueId}-input`}required=false;labelPosition="after";name=null;change=new vt;indeterminateChange=new vt;value;disableRipple=false;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=a.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){g$1(D).load(on);let e=g$1(new dm("tabindex"),{optional:true});this._options=this._options||f,this.color=this._options.color||f.color,this.tabIndex=e==null?0:parseInt(e)||0,this.id=this._uniqueId=g$1(Ut).getId("mat-mdc-checkbox-"),this.disabledInteractive=this._options?.disabledInteractive??false;}ngOnChanges(e){e.required&&this._validatorChangeFn();}ngAfterViewInit(){this._syncIndeterminate(this.indeterminate);}get checked(){return this._checked}set checked(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck());}_checked=false;get disabled(){return this._disabled}set disabled(e){e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck());}_disabled=false;get indeterminate(){return this._indeterminate()}set indeterminate(e){let n=e!=this._indeterminate();this._indeterminate.set(e),n&&(e?this._transitionCheckState(a.Indeterminate):this._transitionCheckState(this.checked?a.Checked:a.Unchecked),this.indeterminateChange.emit(e)),this._syncIndeterminate(e);}_indeterminate=Wi(false);_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges();}writeValue(e){this.checked=!!e;}registerOnChange(e){this._controlValueAccessorChangeFn=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this.disabled=e;}validate(e){return this.required&&e.value!==true?{required:true}:null}registerOnValidatorChange(e){this._validatorChangeFn=e;}_transitionCheckState(e){let n=this._currentCheckState,c=this._getAnimationTargetElement();if(!(n===e||!c)&&(this._currentAnimationClass&&c.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(n,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){c.classList.add(this._currentAnimationClass);let o=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{c.classList.remove(o);},1e3);});}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked);}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked);}_handleInputClick(){let e=this._options?.clickAction;!this.disabled&&e!=="noop"?(this.indeterminate&&e!=="check"&&Promise.resolve().then(()=>{this._indeterminate.set(false),this.indeterminateChange.emit(false);}),this._checked=!this._checked,this._transitionCheckState(this._checked?a.Checked:a.Unchecked),this._emitChangeEvent()):(this.disabled&&this.disabledInteractive||!this.disabled&&e==="noop")&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate);}_onInteractionEvent(e){e.stopPropagation();}_onBlur(){Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck();});}_getAnimationClassForCheckStateTransition(e,n){if(this._animationsDisabled)return "";switch(e){case a.Init:if(n===a.Checked)return this._animationClasses.uncheckedToChecked;if(n==a.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case a.Unchecked:return n===a.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case a.Checked:return n===a.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case a.Indeterminate:return n===a.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return ""}_syncIndeterminate(e){let n=this._inputElement;n&&(n.nativeElement.indeterminate=e);}_onInputClick(){this._handleInputClick();}_onTouchTargetClick(){this._handleInputClick(),this.disabled||this._inputElement.nativeElement.focus();}_preventBubblingFromLabel(e){e.target&&this._labelElement.nativeElement.contains(e.target)&&e.stopPropagation();}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=jw({type:t,selectors:[["mat-checkbox"]],viewQuery:function(n,c){if(n&1&&jg(W,5)(Y,5),n&2){let o;MC(o=NC())&&(c._inputElement=o.first),MC(o=NC())&&(c._labelElement=o.first);}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(n,c){n&2&&(Rg("id",c.id),Sg("tabindex",null)("aria-label",null)("aria-labelledby",null),UC(c.color?"mat-"+c.color:"mat-accent"),zg("_mat-animation-noopable",c._animationsDisabled)("mdc-checkbox--disabled",c.disabled)("mat-mdc-checkbox-disabled",c.disabled)("mat-mdc-checkbox-checked",c.checked)("mat-mdc-checkbox-disabled-interactive",c.disabledInteractive));},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",rb],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",rb],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",rb],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?void 0:ob(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",rb],checked:[2,"checked","checked",rb],disabled:[2,"disabled","disabled",rb],indeterminate:[2,"indeterminate","indeterminate",rb]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[lT([{provide:D$1,useExisting:_i(()=>t),multi:true},{provide:y,useExisting:t,multi:true}]),bu],ngContentSelectors:ee,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],["aria-hidden","true",1,"mat-mdc-checkbox-touch-target",3,"click"],["type","checkbox",1,"mdc-checkbox__native-control",3,"blur","click","change","checked","indeterminate","disabled","id","required","tabIndex"],["aria-hidden","true",1,"mdc-checkbox__ripple"],["aria-hidden","true",1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24",1,"mdc-checkbox__checkmark"],["fill","none","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-checkbox__checkmark-path"],[1,"mdc-checkbox__mixedmark"],["mat-ripple","","aria-hidden","true",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(n,c){if(n&1&&(bC(),Cs(0,"div",3),kg("click",function(k){return c._preventBubblingFromLabel(k)}),Cs(1,"div",4,0)(3,"div",5),kg("click",function(){return c._onTouchTargetClick()}),hl(),Cs(4,"input",6,1),kg("blur",function(){return c._onBlur()})("click",function(){return c._onInputClick()})("change",function(k){return c._onInteractionEvent(k)}),hl(),Mg(6,"div",7),Cs(7,"div",8),Pf(),Cs(8,"svg",9),Mg(9,"path",10),hl(),Lf(),Mg(10,"div",11),hl(),Mg(11,"div",12),hl(),Cs(12,"label",13,2),SC(14),hl()()),n&2){let o=AC(2);_g("labelPosition",c.labelPosition),sI(4),zg("mdc-checkbox--selected",c.checked),_g("checked",c.checked)("indeterminate",c.indeterminate)("disabled",c.disabled&&!c.disabledInteractive)("id",c.inputId)("required",c.required)("tabIndex",c.disabled&&!c.disabledInteractive?-1:c.tabIndex),Sg("aria-label",c.ariaLabel||null)("aria-labelledby",c.ariaLabelledby)("aria-describedby",c.ariaDescribedby)("aria-checked",c.indeterminate?"mixed":null)("aria-controls",c.ariaControls)("aria-disabled",c.disabled&&c.disabledInteractive?true:null)("aria-expanded",c.ariaExpanded)("aria-owns",c.ariaOwns)("name",c.name)("value",c.value),sI(7),_g("matRippleTrigger",o)("matRippleDisabled",c.disableRipple||c.disabled)("matRippleCentered",true),sI(),_g("for",c.inputId);}},dependencies:[Oi,Qe],styles:[`.mdc-checkbox {
|
|
2
2
|
display: inline-block;
|
|
3
3
|
position: relative;
|
|
4
4
|
flex: 0 0 18px;
|
|
@@ -471,4 +471,4 @@ import {b as Qe}from'./chunk-S8F5_Te_.js';import {D as D$1,i as y}from'./chunk-t
|
|
|
471
471
|
.mdc-checkbox__native-control:focus-visible ~ .mat-focus-indicator::before {
|
|
472
472
|
content: "";
|
|
473
473
|
}
|
|
474
|
-
`],encapsulation:2})}return t})(),ve=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=
|
|
474
|
+
`],encapsulation:2})}return t})(),ve=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=wo({type:t});static \u0275inj=Zn({imports:[ne,wt]})}return t})();export{ne as n,ve as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {S as S$1}from'./chunk-
|
|
1
|
+
import {S as S$1}from'./chunk-CakkML6n.js';import {g,G,C as Ce,dd as $,aJ as Tr,W as Wi,bS as Da,r as re,b as U,j as jw,aK as Lb,k as Cs,bf as gT,n as kg,m as hl,af as wg,A as AC,_ as _g,bg as yT,ah as dT,o as aC,ac as CC,u as cC,a9 as vC,aa as Cf,ab as Tf,ag as ET}from'./main-YYHD6X7H.js';import {W as Wn,S as Se}from'./chunk-B13_C_P9.js';import'./chunk-CgNkwpQ7.js';import'./chunk-FMHkoXwM.js';var S=()=>[];function V(r,e){if(r&1){let t=vC();Cs(0,"agentos-ai-provider-item",4),kg("editRequested",function(i){Cf(t);let p=CC(2);return Tf(p.onEdit(i))})("deleteRequested",function(i){Cf(t);let p=CC(2);return Tf(p.onDelete(i))}),hl();}r&2&&_g("config",e)("showBadge",false);}function F(r,e){if(r&1&&aC(0,V,1,2,"agentos-ai-provider-item",3),r&2){let t,o=e.$implicit,i=CC();cC((t=i.resolveProvider(o.id))?0:-1,t);}}var E=class r{router=g(G);destroyRef=g(Ce);aiProviderController=g($);refresh$=new Tr(void 0);isLoading=Wi(true);providers$=this.refresh$.pipe(Da(()=>(this.isLoading.set(true),this.aiProviderController.listAiProvider("none"))));providerItems$=this.providers$.pipe(re(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.apiType}))));providersById=new Map;constructor(){this.providers$.pipe(U(this.destroyRef)).subscribe({next:e=>{this.providersById=new Map(e.map(t=>[t.id??"",t])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"]);}onEdit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"]);}onDelete(e){e.id&&this.aiProviderController.deleteAiProvider(e.id).pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveProvider(e){return this.providersById.get(e)??null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=jw({type:r,selectors:[["agentos-platform-ai-providers"]],decls:5,vars:7,consts:[["aiProviderItemTpl",""],["title","Platform AI Providers","emptyMessage","No platform AI providers defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(t,o){if(t&1&&(Cs(0,"ds-entity-list",1),gT(1,"async"),kg("createRequested",function(){return o.openCreateForm()}),Cs(2,"ds-icon-button",2),kg("action",function(){return o.goBack()}),hl()(),wg(3,F,1,1,"ng-template",null,0,ET)),t&2){let i=AC(4);_g("items",yT(1,4,o.providerItems$)??dT(6,S))("loading",o.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[Wn,S$1,Se,Lb],styles:[".platform-ai-providers__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-providers__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"]})};export{E as PlatformAiProvidersComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {an as
|
|
1
|
+
import {an as ue,g,L,ci as me,ap as zy,av as dt$1,j as jw,k as Cs,J as JC,m as hl,ai as rm,aj as iT,n as kg,a3 as ZI,M as Mg,o as aC,q as dC,t as sI,ak as nm,a6 as QI,_ as _g,u as cC,v as fC,a5 as Dl,aL as wo,aM as Zn$1,aO as wt$1,az as Xt,aW as C,cj as Pn,ce as kb,c8 as ob,af as wg,ag as ET,c9 as Pf,ck as Lf,ch as Ag,A as AC,S as Sg,ad as $g,b$ as UC,w as zg,x as jg,y as MC,N as NC,aJ as Tr,aG as fe,cl as be,p as pe,l as le,bU as Fd,b9 as T,b8 as B,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,K as x,X as z$1,Y as Ue,am as Ym,i as Gn,e as pr,a0 as jt,a2 as Nt,a1 as Vt,b0 as Xg,ac as CC}from'./main-YYHD6X7H.js';import {s as se}from'./chunk-DoqL_RuM.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-FMHkoXwM.js';var Xe=["determinateSpinner"];function et(c,e){if(c&1&&(Pf(),Cs(0,"svg",11),Mg(1,"circle",12),hl()),c&2){let t=CC();Sg("viewBox",t._viewBox()),sI(),$g("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Sg("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=jw({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&jg(Xe,5),n&2){let o;MC(o=NC())&&(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&&(Sg("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),UC("mat-"+i.color),$g("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),zg("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"));},inputs:{color:"color",mode:"mode",value:[2,"value","value",ob],diameter:[2,"diameter","diameter",ob],strokeWidth:[2,"strokeWidth","strokeWidth",ob]},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&&(wg(0,et,2,8,"ng-template",null,0,ET),Cs(2,"div",2,1),Pf(),Cs(4,"svg",3),Mg(5,"circle",4),hl()(),Lf(),Cs(6,"div",5)(7,"div",6)(8,"div",7),Ag(9,8),hl(),Cs(10,"div",9),Ag(11,8),hl(),Cs(12,"div",10),Ag(13,8),hl()()()),n&2){let o=AC(1);sI(4),Sg("viewBox",i._viewBox()),sI(),$g("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),Sg("r",i._circleRadius()),sI(4),_g("ngTemplateOutlet",o),sI(2),_g("ngTemplateOutlet",o),sI(2),_g("ngTemplateOutlet",o);}},dependencies:[kb],styles:[`.mat-mdc-progress-spinner {
|
|
2
2
|
--mat-progress-spinner-animation-multiplier: 1;
|
|
3
3
|
display: block;
|
|
4
4
|
overflow: hidden;
|
|
@@ -173,10 +173,10 @@ import {an as ce,g,L,ci as me,ap as Hy,av as dt$1,h as Fw,m as ws,Q as QC,n as h
|
|
|
173
173
|
transform: rotate(-265deg);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
`],encapsulation:2})}return c})();var Et=(()=>{class c{static \u0275fac=function(n){return new(n||c)};static \u0275mod=
|
|
176
|
+
`],encapsulation:2})}return c})();var Et=(()=>{class c{static \u0275fac=function(n){return new(n||c)};static \u0275mod=wo({type:c});static \u0275inj=Zn$1({imports:[wt$1]})}return c})();var z=class c{destroy$=new ue;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new Tr(false);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=g(L);constructor(){this.initializeSpeechSynthesis(),this.subscribeToPreferences();}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopSpeech();}initializeSpeechSynthesis(){if(!("speechSynthesis"in window)){console.warn("[VOICE-SERVICE] Speech synthesis not available"),this.voices=new Promise(e=>e([]));return}this.voices=new Promise((e,t)=>{let n=speechSynthesis.getVoices();if(n.length)e(n);else {let i=setTimeout(()=>{t("no voices found");},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let o=speechSynthesis.getVoices();o.length&&(clearTimeout(i),e(o));});}}),console.log("[VOICE-SERVICE] Speech synthesis initialized");}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(zy(this.destroy$)).subscribe(e=>{this.volume=e,console.log("[VOICE-SERVICE] Volume updated to:",e);}),this.preferencesService.voiceRate$.pipe(zy(this.destroy$)).subscribe(e=>{this.rate=e,console.log("[VOICE-SERVICE] Rate updated to:",e);}),this.preferencesService.voiceLanguage$.pipe(zy(this.destroy$)).subscribe(e=>{this.language=e,console.log("[VOICE-SERVICE] Language updated to:",e),this.updateSelectedVoiceForLanguage();}),this.preferencesService.selectedVoice$.pipe(zy(this.destroy$)).subscribe(e=>{this.setSelectedVoice(e);}),this.volume=this.preferencesService.getVoiceVolume(),this.rate=this.preferencesService.getVoiceRate(),this.language=this.preferencesService.getVoiceLanguage(),this.setSelectedVoice(this.preferencesService.getSelectedVoice());}isReady(){return "speechSynthesis"in window&&this.selectedVoice!==void 0}isSpeaking(){return speechSynthesis.speaking}speak(e,t){return dt$1(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),false;if(!e.trim())return console.warn("[VOICE-SERVICE] No text to speak"),false;let n=this.extractPlainText(e);if(!n.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),false;this.stopSpeech();try{let i=new SpeechSynthesisUtterance(n);i.voice=this.selectedVoice,i.lang=this.selectedVoice.lang,i.volume=this.volume,i.rate=this.rate,this.currentOnEndCallback=t||null,t&&(i.onend=()=>{this.currentOnEndCallback===t&&(this.currentOnEndCallback=null,t());},i.onerror=()=>{this.currentOnEndCallback===t&&(this.currentOnEndCallback=null,t());}),this.currentUtterance=i,this.speakingSubject.next(!0);let o=i.onend,E=i.onerror;return i.onend=C=>{this.speakingSubject.next(!1),o&&o.call(i,C);},i.onerror=C=>{this.speakingSubject.next(!1),E&&E.call(i,C);},speechSynthesis.speak(i),console.log("[VOICE-SERVICE] Started speaking:",e.substring(0,50)+"..."),!0}catch(i){return console.error("[VOICE-SERVICE] Error speaking:",i),false}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let e=this.currentOnEndCallback;this.currentOnEndCallback=null,e();}this.speakingSubject.next(false),console.log("[VOICE-SERVICE] Speech stopped");}}ding(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.connect(n),n.connect(e.destination),t.frequency.setValueAtTime(800,e.currentTime),n.gain.setValueAtTime(.1,e.currentTime),n.gain.exponentialRampToValueAtTime(.01,e.currentTime+.1),t.start(e.currentTime),t.stop(e.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played");}catch(e){console.error("[VOICE-SERVICE] Notification sound failed:",e);}}getVoicesForLanguage(){return dt$1(this,null,function*(){try{let e=this.language.slice(0,2),t=yield this.voices;if(!t||t.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let n=t.filter(i=>i.lang.toLowerCase().startsWith(e)).sort((i,o)=>i.localService&&!o.localService?-1:!i.localService&&o.localService?1:i.name.localeCompare(o.name));return console.log("[VOICE-SERVICE] Found matching voices:",n.length,"for language:",e),n.map(i=>({name:i.name,lang:i.lang,localService:i.localService,default:i.default,displayName:this.formatVoiceDisplayName(i)}))}catch(e){return console.error("[VOICE-SERVICE] Error getting voices for language:",e),[]}})}formatVoiceDisplayName(e){let t=e.localService?"\u{1F3E0}":"\u2601\uFE0F",n=e.default?" \u2B50":"";return `${t} ${e.name} (${e.lang})${n}`}setSelectedVoice(e){return dt$1(this,null,function*(){if(!e){this.selectedVoice=void 0;return}let[t,n]=e.split("|");if(!t||!n){this.selectedVoice=void 0;return}let i=(yield this.voices)?.find(o=>o.name===t&&o.lang===n);i?(this.selectedVoice=i,console.log("[VOICE-SERVICE] Selected voice:",i.name,i.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",t,n));})}updateSelectedVoiceForLanguage(){return dt$1(this,null,function*(){let e=yield this.getVoicesForLanguage();if(e.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let t=this.preferencesService.getSelectedVoice();if(t){let[i,o]=t.split("|"),E=o?.slice(0,2),C=this.language.slice(0,2);if(E===C&&e.some(q=>q.name===i&&q.lang===o)){console.log("[VOICE-SERVICE] Keeping current voice for language:",t);return}}let n=e[0];if(n){let i=`${n.name}|${n.lang}`;this.preferencesService.setSelectedVoice(i),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",n.displayName);}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let e=this.getTestText();e&&this.speak(e);},100);}getTestText(){let e=this.language.slice(0,2),t={fr:"Bonjour, ceci est un test de la voix s\xE9lectionn\xE9e.",en:"Hello, this is a test of the selected voice.",es:"Hola, esta es una prueba de la voz seleccionada.",de:"Hallo, dies ist ein Test der ausgew\xE4hlten Stimme.",it:"Ciao, questo \xE8 un test della voce selezionata.",pt:"Ol\xE1, este \xE9 um teste da voz selecionada.",ja:"\u3053\u3093\u306B\u3061\u306F\u3001\u3053\u308C\u306F\u9078\u629E\u3055\u308C\u305F\u97F3\u58F0\u306E\u30C6\u30B9\u30C8\u3067\u3059\u3002",ko:"\uC548\uB155\uD558\uC138\uC694, \uC774\uAC83\uC740 \uC120\uD0DD\uB41C \uC74C\uC131\uC758 \uD14C\uC2A4\uD2B8\uC785\uB2C8\uB2E4.",zh:"\u4F60\u597D\uFF0C\u8FD9\u662F\u6240\u9009\u8BED\u97F3\u7684\u6D4B\u8BD5\u3002",ru:"\u041F\u0440\u0438\u0432\u0435\u0442, \u044D\u0442\u043E \u0442\u0435\u0441\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0433\u043E\u043B\u043E\u0441\u0430.",ar:"\u0645\u0631\u062D\u0628\u0627\u060C \u0647\u0630\u0627 \u0627\u062E\u062A\u0628\u0627\u0631 \u0644\u0644\u0635\u0648\u062A \u0627\u0644\u0645\u062D\u062F\u062F."};return t[e]||t.en}extractPlainText(e){let t=e.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/ /g," ").replace(/&/g,"and").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"');return t=this.addNaturalPunctuation(t),t.replace(/\s+/g," ").trim()}addNaturalPunctuation(e){return e.replace(/\n+/g,`
|
|
177
177
|
`).split(`
|
|
178
|
-
`).map(t=>this.addPeriodIfNeeded(t.trim())).filter(t=>t.length>0).join(" ")}addPeriodIfNeeded(e){return e?/[.!?;:]$/.test(e)?e:e+".":""}static \u0275fac=function(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};var rt=(c,e)=>e.code,at=(c,e)=>e.name+e.lang;function st(c,e){c&1&&(ws(0,"div",17)(1,"mat-icon",39),QC(2,"warning"),hl(),ws(3,"span",40),QC(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),hl()());}function ct(c,e){if(c&1&&(ws(0,"option",25),QC(1),hl()),c&2){let t=e.$implicit;bg("value",t.code),nI(),Qg("",t.flag," ",t.label);}}function lt(c,e){c&1&&(ws(0,"option",32),QC(1,"Loading voices..."),hl());}function dt(c,e){c&1&&(ws(0,"option",32),QC(1,"No voice available"),hl());}function pt(c,e){if(c&1&&(ws(0,"option",25),QC(1),hl()),c&2){let t=e.$implicit;bg("value",t.name+"|"+t.lang),nI(),Dl(" ",t.displayName," ");}}var Ye=class c{destroy$=new ce;selectedTheme="light";selectedThemeVariant="industry";selectedVoiceLanguage="en-US";useEnterToSend=false;printTechnicalMessages=false;showTechnicalMessages=true;showWarningMessages=true;voiceInputMode="browser";voiceAnnounceEnabled=false;voiceMode="speech";voiceReadFullText=false;voiceVolume=80;voiceRate=120;agentNotificationEnabled=false;notificationSoundEnabled=true;browserNotificationEnabled=false;browserNotificationDenied=false;missionPreviewEnabled=false;availableVoices=[];selectedVoiceId=null;loadingVoices=false;voiceLanguageOptions=[{code:"fr-FR",label:"Fran\xE7ais",flag:"\u{1F1EB}\u{1F1F7}"},{code:"en-US",label:"English (US)",flag:"\u{1F1FA}\u{1F1F8}"},{code:"en-GB",label:"English (UK)",flag:"\u{1F1EC}\u{1F1E7}"},{code:"es-ES",label:"Espa\xF1ol",flag:"\u{1F1EA}\u{1F1F8}"},{code:"de-DE",label:"Deutsch",flag:"\u{1F1E9}\u{1F1EA}"},{code:"it-IT",label:"Italiano",flag:"\u{1F1EE}\u{1F1F9}"},{code:"pt-BR",label:"Portugu\xEAs",flag:"\u{1F1E7}\u{1F1F7}"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",flag:"\u{1F1F0}\u{1F1F7}"},{code:"zh-CN",label:"\u4E2D\u6587 (\u7B80\u4F53)",flag:"\u{1F1E8}\u{1F1F3}"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",flag:"\u{1F1F7}\u{1F1FA}"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",flag:"\u{1F1F8}\u{1F1E6}"}];preferencesService=g(L);voiceSynthesisService=g(z);themeService=g(me);ngOnInit(){let e=this.themeService.getCurrentTheme();this.selectedTheme=e.mode,this.selectedThemeVariant=e.variant,this.selectedVoiceLanguage=this.preferencesService.getVoiceLanguage(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.printTechnicalMessages=this.preferencesService.getPrintTechnicalMessages(),this.showTechnicalMessages=!this.preferencesService.getHideTechnicalMessages(),this.showWarningMessages=!this.preferencesService.getHideWarningMessages(),this.voiceInputMode=this.preferencesService.getVoiceInputMode(),this.voiceAnnounceEnabled=this.preferencesService.getVoiceAnnounceEnabled(),this.voiceMode=this.preferencesService.getVoiceMode(),this.voiceReadFullText=this.preferencesService.getVoiceReadFullText(),this.voiceVolume=Math.round(this.preferencesService.getVoiceVolume()*100),this.voiceRate=Math.round(this.preferencesService.getVoiceRate()*100),this.selectedVoiceId=this.preferencesService.getSelectedVoice(),this.agentNotificationEnabled=this.preferencesService.getAgentNotificationEnabled(),this.notificationSoundEnabled=this.preferencesService.getNotificationSoundEnabled(),this.browserNotificationEnabled=this.preferencesService.getBrowserNotificationEnabled(),this.missionPreviewEnabled=this.preferencesService.getMissionPreviewEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(Hy(this.destroy$)).subscribe(t=>{this.selectedTheme=t.mode,this.selectedThemeVariant=t.variant;}),this.preferencesService.voiceLanguage$.pipe(Hy(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t;}),this.preferencesService.enterToSend$.pipe(Hy(this.destroy$)).subscribe(t=>{this.useEnterToSend=t;}),this.preferencesService.printTechnicalMessages$.pipe(Hy(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t;}),this.preferencesService.hideTechnicalMessages$.pipe(Hy(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t;}),this.preferencesService.hideWarningMessages$.pipe(Hy(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t;}),this.preferencesService.voiceInputMode$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceInputMode=t;}),this.preferencesService.voiceAnnounceEnabled$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t;}),this.preferencesService.voiceMode$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceMode=t;}),this.preferencesService.voiceReadFullText$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t;}),this.preferencesService.voiceVolume$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100);}),this.preferencesService.voiceRate$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100);}),this.preferencesService.selectedVoice$.pipe(Hy(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t;}),this.preferencesService.voiceLanguage$.pipe(Hy(this.destroy$)).subscribe(()=>{this.loadAvailableVoices();}),this.preferencesService.agentNotificationEnabled$.pipe(Hy(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t;}),this.preferencesService.notificationSoundEnabled$.pipe(Hy(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t;}),this.preferencesService.browserNotificationEnabled$.pipe(Hy(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission();}),this.preferencesService.missionPreviewEnabled$.pipe(Hy(this.destroy$)).subscribe(t=>{this.missionPreviewEnabled=t;});}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete();}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme({variant:this.selectedThemeVariant,mode:this.selectedTheme});}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage);}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend);}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages);}onShowTechnicalMessagesChange(){let e=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",e,")"),this.preferencesService.setHideTechnicalMessages(e);}onShowWarningMessagesChange(){let e=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",e,")"),this.preferencesService.setHideWarningMessages(e);}onVoiceInputModeChange(e){let t=e.target.value;console.log("[OPTIONS] Voice input mode changed to:",t),this.preferencesService.setVoiceInputMode(t);}onVoiceAnnounceEnabledChange(){console.log("[OPTIONS] Voice announce enabled changed to:",this.voiceAnnounceEnabled),this.preferencesService.setVoiceAnnounceEnabled(this.voiceAnnounceEnabled);}onVoiceModeChange(){console.log("[OPTIONS] Voice mode changed to:",this.voiceMode),this.preferencesService.setVoiceMode(this.voiceMode);}onVoiceReadFullTextChange(){console.log("[OPTIONS] Voice read full text changed to:",this.voiceReadFullText),this.preferencesService.setVoiceReadFullText(this.voiceReadFullText);}onVoiceVolumeChange(){let e=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",e),this.preferencesService.setVoiceVolume(e);}onVoiceRateChange(){let e=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",e),this.preferencesService.setVoiceRate(e);}loadAvailableVoices(){return dt$1(this,null,function*(){this.loadingVoices=true;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language");}catch(e){console.error("[OPTIONS] Error loading voices:",e),this.availableVoices=[];}finally{this.loadingVoices=false;}})}onSelectedVoiceChange(){console.log("[OPTIONS] Selected voice changed to:",this.selectedVoiceId),this.preferencesService.setSelectedVoice(this.selectedVoiceId);}testVoice(){console.log("[OPTIONS] Testing voice with current settings"),this.voiceSynthesisService.testSelectedVoice();}onAgentNotificationEnabledChange(){console.log("[OPTIONS] Agent notification enabled changed to:",this.agentNotificationEnabled),this.preferencesService.setAgentNotificationEnabled(this.agentNotificationEnabled);}onNotificationSoundEnabledChange(){console.log("[OPTIONS] Notification sound enabled changed to:",this.notificationSoundEnabled),this.preferencesService.setNotificationSoundEnabled(this.notificationSoundEnabled);}onBrowserNotificationEnabledChange(){console.log("[OPTIONS] Browser notification enabled changed to:",this.browserNotificationEnabled),this.preferencesService.setBrowserNotificationEnabled(this.browserNotificationEnabled);}onMissionPreviewEnabledChange(){console.log("[OPTIONS] Mission preview panel enabled changed to:",this.missionPreviewEnabled),this.preferencesService.setMissionPreviewEnabled(this.missionPreviewEnabled);}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission));}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=Fw({type:c,selectors:[["app-options-panel"]],decls:168,vars:37,consts:[[1,"options-content"],[1,"option-section"],[1,"section-title"],[1,"option-group"],[1,"radio-group"],[1,"option-radio"],["type","radio","name","theme","value","light",3,"ngModelChange","change","ngModel"],[1,"radio-mark"],["type","radio","name","theme","value","dark",3,"ngModelChange","change","ngModel"],["type","radio","name","theme","value","system",3,"ngModelChange","change","ngModel"],[1,"option-label"],["type","radio","name","enterBehavior",3,"ngModelChange","change","value","ngModel"],[1,"toggle-option"],["color","primary",3,"ngModelChange","change","ngModel"],[1,"option-label-with-hint"],[1,"option-hint"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-input-mode-select",1,"option-label"],["id","voice-input-mode-select",1,"option-select",3,"change","value"],["value","browser"],["value","whisper"],["value","voice-message"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(t,n){t&1&&(ws(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),QC(4,"palette"),hl(),ws(5,"span"),QC(6,"Appearance"),hl()(),ws(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),em("ngModelChange",function(o){return tT(n.selectedTheme,o)||(n.selectedTheme=o),o}),Rg("change",function(){return n.onThemeChange()}),hl(),GI(),Sg(11,"span",7),QC(12," Light "),hl(),ws(13,"label",5)(14,"input",8),em("ngModelChange",function(o){return tT(n.selectedTheme,o)||(n.selectedTheme=o),o}),Rg("change",function(){return n.onThemeChange()}),hl(),GI(),Sg(15,"span",7),QC(16," Dark "),hl(),ws(17,"label",5)(18,"input",9),em("ngModelChange",function(o){return tT(n.selectedTheme,o)||(n.selectedTheme=o),o}),Rg("change",function(){return n.onThemeChange()}),hl(),GI(),Sg(19,"span",7),QC(20," System "),hl()()()(),ws(21,"div",1)(22,"div",2)(23,"mat-icon"),QC(24,"chat_bubble_outline"),hl(),ws(25,"span"),QC(26,"Messaging"),hl()(),ws(27,"div",3)(28,"span",10),QC(29,"Send message behavior:"),hl(),ws(30,"div",4)(31,"label",5)(32,"input",11),em("ngModelChange",function(o){return tT(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),Rg("change",function(){return n.onEnterToSendChange()}),hl(),GI(),Sg(33,"span",7),QC(34," Enter to send "),hl(),ws(35,"label",5)(36,"input",11),em("ngModelChange",function(o){return tT(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),Rg("change",function(){return n.onEnterToSendChange()}),hl(),GI(),Sg(37,"span",7),QC(38," Enter for new line "),hl()()(),ws(39,"div",3)(40,"div",12)(41,"span",10),QC(42,"Show technical messages"),hl(),ws(43,"mat-slide-toggle",13),em("ngModelChange",function(o){return tT(n.showTechnicalMessages,o)||(n.showTechnicalMessages=o),o}),Rg("change",function(){return n.onShowTechnicalMessagesChange()}),hl(),GI(),hl()(),ws(44,"div",3)(45,"div",12)(46,"span",10),QC(47,"Show warning messages"),hl(),ws(48,"mat-slide-toggle",13),em("ngModelChange",function(o){return tT(n.showWarningMessages,o)||(n.showWarningMessages=o),o}),Rg("change",function(){return n.onShowWarningMessagesChange()}),hl(),GI(),hl()(),ws(49,"div",3)(50,"div",12)(51,"span",10),QC(52,"Include technical messages in print"),hl(),ws(53,"mat-slide-toggle",13),em("ngModelChange",function(o){return tT(n.printTechnicalMessages,o)||(n.printTechnicalMessages=o),o}),Rg("change",function(){return n.onPrintTechnicalMessagesChange()}),hl(),GI(),hl()()(),ws(54,"div",1)(55,"div",2)(56,"mat-icon"),QC(57,"rocket_launch"),hl(),ws(58,"span"),QC(59,"Mission Control"),hl()(),ws(60,"div",3)(61,"div",12)(62,"div",14)(63,"span",10),QC(64,"Side-by-side thread preview"),hl(),ws(65,"span",15),QC(66,"Click a mission card to open a preview panel. Recommended for large screens."),hl()(),ws(67,"mat-slide-toggle",13),em("ngModelChange",function(o){return tT(n.missionPreviewEnabled,o)||(n.missionPreviewEnabled=o),o}),Rg("change",function(){return n.onMissionPreviewEnabledChange()}),hl(),GI(),hl()()(),ws(68,"div",1)(69,"div",2)(70,"mat-icon"),QC(71,"notifications"),hl(),ws(72,"span"),QC(73,"Notifications"),hl()(),ws(74,"div",3)(75,"div",12)(76,"span",10),QC(77,"Notify when the agent answers or requests input"),hl(),ws(78,"mat-slide-toggle",13),em("ngModelChange",function(o){return tT(n.agentNotificationEnabled,o)||(n.agentNotificationEnabled=o),o}),Rg("change",function(){return n.onAgentNotificationEnabledChange()}),hl(),GI(),hl()(),ws(79,"div",3)(80,"div",12)(81,"span",10),QC(82,"Notification sound"),hl(),ws(83,"mat-slide-toggle",16),em("ngModelChange",function(o){return tT(n.notificationSoundEnabled,o)||(n.notificationSoundEnabled=o),o}),Rg("change",function(){return n.onNotificationSoundEnabledChange()}),hl(),GI(),hl()(),ws(84,"div",3)(85,"div",12)(86,"span",10),QC(87,"Browser notification"),hl(),ws(88,"mat-slide-toggle",16),em("ngModelChange",function(o){return tT(n.browserNotificationEnabled,o)||(n.browserNotificationEnabled=o),o}),Rg("change",function(){return n.onBrowserNotificationEnabledChange()}),hl(),GI(),hl(),oC(89,st,5,0,"div",17),hl()(),ws(90,"div",1)(91,"div",2)(92,"mat-icon"),QC(93,"record_voice_over"),hl(),ws(94,"span"),QC(95,"Voice & Speech"),hl()(),ws(96,"div",3)(97,"label",18),QC(98,"Voice input method:"),hl(),ws(99,"select",19),Rg("change",function(o){return n.onVoiceInputModeChange(o)}),ws(100,"option",20),QC(101,"Browser (real-time)"),hl(),ws(102,"option",21),QC(103,"Whisper (higher accuracy)"),hl(),ws(104,"option",22),QC(105,"Voice message (send audio)"),hl()()(),ws(106,"div",3)(107,"label",23),QC(108,"Voice recognition language:"),hl(),ws(109,"select",24),em("ngModelChange",function(o){return tT(n.selectedVoiceLanguage,o)||(n.selectedVoiceLanguage=o),o}),Rg("change",function(){return n.onVoiceLanguageChange()}),cC(110,ct,2,3,"option",25,rt),hl(),GI(),hl(),ws(112,"div",3)(113,"span",10),QC(114,"Automatic announcement:"),hl(),ws(115,"div",4)(116,"label",5)(117,"input",26),em("ngModelChange",function(o){return tT(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),Rg("change",function(){return n.onVoiceAnnounceEnabledChange()}),hl(),GI(),Sg(118,"span",7),QC(119," Enabled "),hl(),ws(120,"label",5)(121,"input",26),em("ngModelChange",function(o){return tT(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),Rg("change",function(){return n.onVoiceAnnounceEnabledChange()}),hl(),GI(),Sg(122,"span",7),QC(123," Disabled "),hl()()(),ws(124,"div",3)(125,"span",10),QC(126,"Voice mode:"),hl(),ws(127,"div",4)(128,"label",5)(129,"input",27),em("ngModelChange",function(o){return tT(n.voiceMode,o)||(n.voiceMode=o),o}),Rg("change",function(){return n.onVoiceModeChange()}),hl(),GI(),Sg(130,"span",7),QC(131," Voice synthesis "),hl(),ws(132,"label",5)(133,"input",28),em("ngModelChange",function(o){return tT(n.voiceMode,o)||(n.voiceMode=o),o}),Rg("change",function(){return n.onVoiceModeChange()}),hl(),GI(),Sg(134,"span",7),QC(135," Sound notification "),hl()()(),ws(136,"div",3)(137,"span",10),QC(138,"Message reading:"),hl(),ws(139,"div",4)(140,"label",5)(141,"input",29),em("ngModelChange",function(o){return tT(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),Rg("change",function(){return n.onVoiceReadFullTextChange()}),hl(),GI(),Sg(142,"span",7),QC(143," Full message "),hl(),ws(144,"label",5)(145,"input",29),em("ngModelChange",function(o){return tT(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),Rg("change",function(){return n.onVoiceReadFullTextChange()}),hl(),GI(),Sg(146,"span",7),QC(147," First paragraphs only "),hl()()(),ws(148,"div",3)(149,"label",30),QC(150,"Selected voice:"),hl(),ws(151,"select",31),em("ngModelChange",function(o){return tT(n.selectedVoiceId,o)||(n.selectedVoiceId=o),o}),Rg("change",function(){return n.onSelectedVoiceChange()}),oC(152,lt,2,0,"option",32),oC(153,dt,2,0,"option",32),cC(154,pt,2,2,"option",25,at),hl(),GI(),Sg(156,"div",10),ws(157,"a",33),Rg("click",function(){return n.testVoice()}),ws(158,"span",34),QC(159,"Test voice"),hl()()(),ws(160,"div",3)(161,"label",35),QC(162),hl(),ws(163,"input",36),em("ngModelChange",function(o){return tT(n.voiceVolume,o)||(n.voiceVolume=o),o}),Rg("input",function(){return n.onVoiceVolumeChange()}),hl(),GI(),hl(),ws(164,"div",3)(165,"label",37),QC(166),hl(),ws(167,"input",38),em("ngModelChange",function(o){return tT(n.voiceRate,o)||(n.voiceRate=o),o}),Rg("input",function(){return n.onVoiceRateChange()}),hl(),GI(),hl()()()),t&2&&(nI(10),Jg("ngModel",n.selectedTheme),qI(),nI(4),Jg("ngModel",n.selectedTheme),qI(),nI(4),Jg("ngModel",n.selectedTheme),qI(),nI(14),bg("value",true),Jg("ngModel",n.useEnterToSend),qI(),nI(4),bg("value",false),Jg("ngModel",n.useEnterToSend),qI(),nI(7),Jg("ngModel",n.showTechnicalMessages),qI(),nI(5),Jg("ngModel",n.showWarningMessages),qI(),nI(5),Jg("ngModel",n.printTechnicalMessages),qI(),nI(14),Jg("ngModel",n.missionPreviewEnabled),qI(),nI(11),Jg("ngModel",n.agentNotificationEnabled),qI(),nI(5),Jg("ngModel",n.notificationSoundEnabled),bg("disabled",!n.agentNotificationEnabled),qI(),nI(5),Jg("ngModel",n.browserNotificationEnabled),bg("disabled",!n.agentNotificationEnabled||n.browserNotificationDenied),qI(),nI(),iC(n.browserNotificationDenied?89:-1),nI(10),bg("value",n.voiceInputMode),nI(10),Jg("ngModel",n.selectedVoiceLanguage),qI(),nI(),uC(n.voiceLanguageOptions),nI(7),bg("value",true),Jg("ngModel",n.voiceAnnounceEnabled),qI(),nI(4),bg("value",false),Jg("ngModel",n.voiceAnnounceEnabled),qI(),nI(8),Jg("ngModel",n.voiceMode),qI(),nI(4),Jg("ngModel",n.voiceMode),qI(),nI(8),bg("value",true),Jg("ngModel",n.voiceReadFullText),qI(),nI(4),bg("value",false),Jg("ngModel",n.voiceReadFullText),qI(),nI(6),Jg("ngModel",n.selectedVoiceId),bg("disabled",n.loadingVoices||n.availableVoices.length===0),qI(),nI(),iC(n.loadingVoices?152:-1),nI(),iC(!n.loadingVoices&&n.availableVoices.length===0?153:-1),nI(),uC(n.availableVoices),nI(8),Dl("Volume: ",n.voiceVolume,"%"),nI(),Jg("ngModel",n.voiceVolume),qI(),nI(3),Dl("Speed: ",n.voiceRate,"%"),nI(),Jg("ngModel",n.voiceRate),qI());},dependencies:[ti,Qn,ei,Ye$1,_n,At,mn,Zn,cn,wt,se],styles:['.options-content[_ngcontent-%COMP%]{padding:0;width:100%}.option-group[_ngcontent-%COMP%]{padding:0 1rem 1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border-light)}.option-group[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.option-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;color:var(--color-text);font-size:.875rem}.toggle-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.toggle-option[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0;flex:1}.toggle-option[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex-shrink:0}.option-label-with-hint[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1}.option-label-with-hint[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0}.option-label-with-hint[_ngcontent-%COMP%] .option-hint[_ngcontent-%COMP%]{font-size:.775rem;color:var(--color-text-secondary);line-height:1.4}.option-select[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-input-bg);color:var(--color-text);font-size:.875rem;cursor:pointer}.option-select[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px #7064fb1a}.option-select[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.option-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{padding:.5rem}.option-checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--color-border);border-radius:3px;margin-right:.75rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";width:10px;height:6px;border-left:2px solid transparent;border-bottom:2px solid transparent;transform:rotate(-45deg);transition:all .2s ease;opacity:0}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]{background-color:var(--color-primary);border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]:after{border-left-color:#fff;border-bottom-color:#fff;opacity:1}.option-checkbox[_ngcontent-%COMP%]:hover .checkmark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%]:focus-within .checkmark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-section[_ngcontent-%COMP%]{padding-top:1rem;margin-top:1rem;border-top:2px solid var(--color-border)}.option-section[_ngcontent-%COMP%]:first-child{border-top:none;padding-top:0;margin-top:0}.section-title[_ngcontent-%COMP%]{margin:0 0 1rem;padding:0 1rem;font-size:.9rem;font-weight:600;color:var(--color-text);display:flex;align-items:center;gap:.5rem}.section-title[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.option-radio[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{display:none}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--color-border);border-radius:50%;margin-right:.5rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0;position:relative}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]:after{content:"";width:8px;height:8px;border-radius:50%;background-color:var(--color-primary);transition:all .2s ease;opacity:0;transform:scale(0)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]:after{opacity:1;transform:scale(1)}.option-radio[_ngcontent-%COMP%]:hover .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%]:focus-within .radio-mark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-slider[_ngcontent-%COMP%]{width:100%;height:6px;border-radius:3px;background:var(--color-bg-solid);outline:none;cursor:pointer;-webkit-appearance:none;appearance:none}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-webkit-slider-track{height:6px;border-radius:3px;background:var(--color-bg-secondary)}.option-slider[_ngcontent-%COMP%]::-moz-range-track{height:6px;border-radius:3px;background:var(--color-bg-secondary);border:none}.option-slider[_ngcontent-%COMP%]:focus{outline:none}.option-slider[_ngcontent-%COMP%]:focus::-webkit-slider-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.option-slider[_ngcontent-%COMP%]:focus::-moz-range-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.test-voice-btn[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;background:var(--color-primary);color:#fff;border:none;border-radius:6px;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:.5rem}.test-voice-btn[_ngcontent-%COMP%]:hover{background:var(--color-primary-hover);transform:translateY(-1px);box-shadow:0 2px 8px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 1px 4px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:focus{outline:none;box-shadow:0 0 0 3px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:disabled{background:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;transform:none;box-shadow:none}.test-voice-link[_ngcontent-%COMP%]{text-decoration-thickness:1.5px;text-underline-offset:3px;background:transparent;border:none;padding:0;font-size:.775rem;font-weight:400;cursor:pointer;transition:all .2s ease;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;text-decoration:underline}.test-voice-link[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover, var(--color-primary));text-decoration-thickness:2px}.test-voice-link[_ngcontent-%COMP%]:active{opacity:.8}.test-voice-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.test-voice-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.notification-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.75rem;margin-top:.75rem;background-color:#d32f2f1a;border:1px solid rgba(211,47,47,.3);border-radius:6px;font-size:.8125rem;line-height:1.5}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#d32f2f;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{color:var(--color-text);flex:1}.notification-error[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;background-color:#f443361a;border:1px solid rgba(244,67,54,.3);border-radius:6px;display:flex;align-items:flex-start;gap:.5rem}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#f44336;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text);line-height:1.5;flex:1}'],changeDetection:1})};function Qe(c){let e=c.args??"",t;try{let n=JSON.parse(e);t=JSON.stringify(n,null,2);}catch(n){t=e;}return `\u{1F527} ${c.name}
|
|
178
|
+
`).map(t=>this.addPeriodIfNeeded(t.trim())).filter(t=>t.length>0).join(" ")}addPeriodIfNeeded(e){return e?/[.!?;:]$/.test(e)?e:e+".":""}static \u0275fac=function(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};var rt=(c,e)=>e.code,at=(c,e)=>e.name+e.lang;function st(c,e){c&1&&(Cs(0,"div",17)(1,"mat-icon",39),JC(2,"warning"),hl(),Cs(3,"span",40),JC(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),hl()());}function ct(c,e){if(c&1&&(Cs(0,"option",25),JC(1),hl()),c&2){let t=e.$implicit;_g("value",t.code),sI(),Xg("",t.flag," ",t.label);}}function lt(c,e){c&1&&(Cs(0,"option",32),JC(1,"Loading voices..."),hl());}function dt(c,e){c&1&&(Cs(0,"option",32),JC(1,"No voice available"),hl());}function pt(c,e){if(c&1&&(Cs(0,"option",25),JC(1),hl()),c&2){let t=e.$implicit;_g("value",t.name+"|"+t.lang),sI(),Dl(" ",t.displayName," ");}}var Ye=class c{destroy$=new ue;selectedTheme="light";selectedThemeVariant="industry";selectedVoiceLanguage="en-US";useEnterToSend=false;printTechnicalMessages=false;showTechnicalMessages=true;showWarningMessages=true;voiceInputMode="browser";voiceAnnounceEnabled=false;voiceMode="speech";voiceReadFullText=false;voiceVolume=80;voiceRate=120;agentNotificationEnabled=false;notificationSoundEnabled=true;browserNotificationEnabled=false;browserNotificationDenied=false;missionPreviewEnabled=false;availableVoices=[];selectedVoiceId=null;loadingVoices=false;voiceLanguageOptions=[{code:"fr-FR",label:"Fran\xE7ais",flag:"\u{1F1EB}\u{1F1F7}"},{code:"en-US",label:"English (US)",flag:"\u{1F1FA}\u{1F1F8}"},{code:"en-GB",label:"English (UK)",flag:"\u{1F1EC}\u{1F1E7}"},{code:"es-ES",label:"Espa\xF1ol",flag:"\u{1F1EA}\u{1F1F8}"},{code:"de-DE",label:"Deutsch",flag:"\u{1F1E9}\u{1F1EA}"},{code:"it-IT",label:"Italiano",flag:"\u{1F1EE}\u{1F1F9}"},{code:"pt-BR",label:"Portugu\xEAs",flag:"\u{1F1E7}\u{1F1F7}"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",flag:"\u{1F1F0}\u{1F1F7}"},{code:"zh-CN",label:"\u4E2D\u6587 (\u7B80\u4F53)",flag:"\u{1F1E8}\u{1F1F3}"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",flag:"\u{1F1F7}\u{1F1FA}"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",flag:"\u{1F1F8}\u{1F1E6}"}];preferencesService=g(L);voiceSynthesisService=g(z);themeService=g(me);ngOnInit(){let e=this.themeService.getCurrentTheme();this.selectedTheme=e.mode,this.selectedThemeVariant=e.variant,this.selectedVoiceLanguage=this.preferencesService.getVoiceLanguage(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.printTechnicalMessages=this.preferencesService.getPrintTechnicalMessages(),this.showTechnicalMessages=!this.preferencesService.getHideTechnicalMessages(),this.showWarningMessages=!this.preferencesService.getHideWarningMessages(),this.voiceInputMode=this.preferencesService.getVoiceInputMode(),this.voiceAnnounceEnabled=this.preferencesService.getVoiceAnnounceEnabled(),this.voiceMode=this.preferencesService.getVoiceMode(),this.voiceReadFullText=this.preferencesService.getVoiceReadFullText(),this.voiceVolume=Math.round(this.preferencesService.getVoiceVolume()*100),this.voiceRate=Math.round(this.preferencesService.getVoiceRate()*100),this.selectedVoiceId=this.preferencesService.getSelectedVoice(),this.agentNotificationEnabled=this.preferencesService.getAgentNotificationEnabled(),this.notificationSoundEnabled=this.preferencesService.getNotificationSoundEnabled(),this.browserNotificationEnabled=this.preferencesService.getBrowserNotificationEnabled(),this.missionPreviewEnabled=this.preferencesService.getMissionPreviewEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(zy(this.destroy$)).subscribe(t=>{this.selectedTheme=t.mode,this.selectedThemeVariant=t.variant;}),this.preferencesService.voiceLanguage$.pipe(zy(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t;}),this.preferencesService.enterToSend$.pipe(zy(this.destroy$)).subscribe(t=>{this.useEnterToSend=t;}),this.preferencesService.printTechnicalMessages$.pipe(zy(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t;}),this.preferencesService.hideTechnicalMessages$.pipe(zy(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t;}),this.preferencesService.hideWarningMessages$.pipe(zy(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t;}),this.preferencesService.voiceInputMode$.pipe(zy(this.destroy$)).subscribe(t=>{this.voiceInputMode=t;}),this.preferencesService.voiceAnnounceEnabled$.pipe(zy(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t;}),this.preferencesService.voiceMode$.pipe(zy(this.destroy$)).subscribe(t=>{this.voiceMode=t;}),this.preferencesService.voiceReadFullText$.pipe(zy(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t;}),this.preferencesService.voiceVolume$.pipe(zy(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100);}),this.preferencesService.voiceRate$.pipe(zy(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100);}),this.preferencesService.selectedVoice$.pipe(zy(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t;}),this.preferencesService.voiceLanguage$.pipe(zy(this.destroy$)).subscribe(()=>{this.loadAvailableVoices();}),this.preferencesService.agentNotificationEnabled$.pipe(zy(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t;}),this.preferencesService.notificationSoundEnabled$.pipe(zy(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t;}),this.preferencesService.browserNotificationEnabled$.pipe(zy(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission();}),this.preferencesService.missionPreviewEnabled$.pipe(zy(this.destroy$)).subscribe(t=>{this.missionPreviewEnabled=t;});}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete();}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme({variant:this.selectedThemeVariant,mode:this.selectedTheme});}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage);}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend);}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages);}onShowTechnicalMessagesChange(){let e=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",e,")"),this.preferencesService.setHideTechnicalMessages(e);}onShowWarningMessagesChange(){let e=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",e,")"),this.preferencesService.setHideWarningMessages(e);}onVoiceInputModeChange(e){let t=e.target.value;console.log("[OPTIONS] Voice input mode changed to:",t),this.preferencesService.setVoiceInputMode(t);}onVoiceAnnounceEnabledChange(){console.log("[OPTIONS] Voice announce enabled changed to:",this.voiceAnnounceEnabled),this.preferencesService.setVoiceAnnounceEnabled(this.voiceAnnounceEnabled);}onVoiceModeChange(){console.log("[OPTIONS] Voice mode changed to:",this.voiceMode),this.preferencesService.setVoiceMode(this.voiceMode);}onVoiceReadFullTextChange(){console.log("[OPTIONS] Voice read full text changed to:",this.voiceReadFullText),this.preferencesService.setVoiceReadFullText(this.voiceReadFullText);}onVoiceVolumeChange(){let e=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",e),this.preferencesService.setVoiceVolume(e);}onVoiceRateChange(){let e=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",e),this.preferencesService.setVoiceRate(e);}loadAvailableVoices(){return dt$1(this,null,function*(){this.loadingVoices=true;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language");}catch(e){console.error("[OPTIONS] Error loading voices:",e),this.availableVoices=[];}finally{this.loadingVoices=false;}})}onSelectedVoiceChange(){console.log("[OPTIONS] Selected voice changed to:",this.selectedVoiceId),this.preferencesService.setSelectedVoice(this.selectedVoiceId);}testVoice(){console.log("[OPTIONS] Testing voice with current settings"),this.voiceSynthesisService.testSelectedVoice();}onAgentNotificationEnabledChange(){console.log("[OPTIONS] Agent notification enabled changed to:",this.agentNotificationEnabled),this.preferencesService.setAgentNotificationEnabled(this.agentNotificationEnabled);}onNotificationSoundEnabledChange(){console.log("[OPTIONS] Notification sound enabled changed to:",this.notificationSoundEnabled),this.preferencesService.setNotificationSoundEnabled(this.notificationSoundEnabled);}onBrowserNotificationEnabledChange(){console.log("[OPTIONS] Browser notification enabled changed to:",this.browserNotificationEnabled),this.preferencesService.setBrowserNotificationEnabled(this.browserNotificationEnabled);}onMissionPreviewEnabledChange(){console.log("[OPTIONS] Mission preview panel enabled changed to:",this.missionPreviewEnabled),this.preferencesService.setMissionPreviewEnabled(this.missionPreviewEnabled);}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission));}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=jw({type:c,selectors:[["app-options-panel"]],decls:168,vars:37,consts:[[1,"options-content"],[1,"option-section"],[1,"section-title"],[1,"option-group"],[1,"radio-group"],[1,"option-radio"],["type","radio","name","theme","value","light",3,"ngModelChange","change","ngModel"],[1,"radio-mark"],["type","radio","name","theme","value","dark",3,"ngModelChange","change","ngModel"],["type","radio","name","theme","value","system",3,"ngModelChange","change","ngModel"],[1,"option-label"],["type","radio","name","enterBehavior",3,"ngModelChange","change","value","ngModel"],[1,"toggle-option"],["color","primary",3,"ngModelChange","change","ngModel"],[1,"option-label-with-hint"],[1,"option-hint"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-input-mode-select",1,"option-label"],["id","voice-input-mode-select",1,"option-select",3,"change","value"],["value","browser"],["value","whisper"],["value","voice-message"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(t,n){t&1&&(Cs(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),JC(4,"palette"),hl(),Cs(5,"span"),JC(6,"Appearance"),hl()(),Cs(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),rm("ngModelChange",function(o){return iT(n.selectedTheme,o)||(n.selectedTheme=o),o}),kg("change",function(){return n.onThemeChange()}),hl(),ZI(),Mg(11,"span",7),JC(12," Light "),hl(),Cs(13,"label",5)(14,"input",8),rm("ngModelChange",function(o){return iT(n.selectedTheme,o)||(n.selectedTheme=o),o}),kg("change",function(){return n.onThemeChange()}),hl(),ZI(),Mg(15,"span",7),JC(16," Dark "),hl(),Cs(17,"label",5)(18,"input",9),rm("ngModelChange",function(o){return iT(n.selectedTheme,o)||(n.selectedTheme=o),o}),kg("change",function(){return n.onThemeChange()}),hl(),ZI(),Mg(19,"span",7),JC(20," System "),hl()()()(),Cs(21,"div",1)(22,"div",2)(23,"mat-icon"),JC(24,"chat_bubble_outline"),hl(),Cs(25,"span"),JC(26,"Messaging"),hl()(),Cs(27,"div",3)(28,"span",10),JC(29,"Send message behavior:"),hl(),Cs(30,"div",4)(31,"label",5)(32,"input",11),rm("ngModelChange",function(o){return iT(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),kg("change",function(){return n.onEnterToSendChange()}),hl(),ZI(),Mg(33,"span",7),JC(34," Enter to send "),hl(),Cs(35,"label",5)(36,"input",11),rm("ngModelChange",function(o){return iT(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),kg("change",function(){return n.onEnterToSendChange()}),hl(),ZI(),Mg(37,"span",7),JC(38," Enter for new line "),hl()()(),Cs(39,"div",3)(40,"div",12)(41,"span",10),JC(42,"Show technical messages"),hl(),Cs(43,"mat-slide-toggle",13),rm("ngModelChange",function(o){return iT(n.showTechnicalMessages,o)||(n.showTechnicalMessages=o),o}),kg("change",function(){return n.onShowTechnicalMessagesChange()}),hl(),ZI(),hl()(),Cs(44,"div",3)(45,"div",12)(46,"span",10),JC(47,"Show warning messages"),hl(),Cs(48,"mat-slide-toggle",13),rm("ngModelChange",function(o){return iT(n.showWarningMessages,o)||(n.showWarningMessages=o),o}),kg("change",function(){return n.onShowWarningMessagesChange()}),hl(),ZI(),hl()(),Cs(49,"div",3)(50,"div",12)(51,"span",10),JC(52,"Include technical messages in print"),hl(),Cs(53,"mat-slide-toggle",13),rm("ngModelChange",function(o){return iT(n.printTechnicalMessages,o)||(n.printTechnicalMessages=o),o}),kg("change",function(){return n.onPrintTechnicalMessagesChange()}),hl(),ZI(),hl()()(),Cs(54,"div",1)(55,"div",2)(56,"mat-icon"),JC(57,"rocket_launch"),hl(),Cs(58,"span"),JC(59,"Mission Control"),hl()(),Cs(60,"div",3)(61,"div",12)(62,"div",14)(63,"span",10),JC(64,"Side-by-side thread preview"),hl(),Cs(65,"span",15),JC(66,"Click a mission card to open a preview panel. Recommended for large screens."),hl()(),Cs(67,"mat-slide-toggle",13),rm("ngModelChange",function(o){return iT(n.missionPreviewEnabled,o)||(n.missionPreviewEnabled=o),o}),kg("change",function(){return n.onMissionPreviewEnabledChange()}),hl(),ZI(),hl()()(),Cs(68,"div",1)(69,"div",2)(70,"mat-icon"),JC(71,"notifications"),hl(),Cs(72,"span"),JC(73,"Notifications"),hl()(),Cs(74,"div",3)(75,"div",12)(76,"span",10),JC(77,"Notify when the agent answers or requests input"),hl(),Cs(78,"mat-slide-toggle",13),rm("ngModelChange",function(o){return iT(n.agentNotificationEnabled,o)||(n.agentNotificationEnabled=o),o}),kg("change",function(){return n.onAgentNotificationEnabledChange()}),hl(),ZI(),hl()(),Cs(79,"div",3)(80,"div",12)(81,"span",10),JC(82,"Notification sound"),hl(),Cs(83,"mat-slide-toggle",16),rm("ngModelChange",function(o){return iT(n.notificationSoundEnabled,o)||(n.notificationSoundEnabled=o),o}),kg("change",function(){return n.onNotificationSoundEnabledChange()}),hl(),ZI(),hl()(),Cs(84,"div",3)(85,"div",12)(86,"span",10),JC(87,"Browser notification"),hl(),Cs(88,"mat-slide-toggle",16),rm("ngModelChange",function(o){return iT(n.browserNotificationEnabled,o)||(n.browserNotificationEnabled=o),o}),kg("change",function(){return n.onBrowserNotificationEnabledChange()}),hl(),ZI(),hl(),aC(89,st,5,0,"div",17),hl()(),Cs(90,"div",1)(91,"div",2)(92,"mat-icon"),JC(93,"record_voice_over"),hl(),Cs(94,"span"),JC(95,"Voice & Speech"),hl()(),Cs(96,"div",3)(97,"label",18),JC(98,"Voice input method:"),hl(),Cs(99,"select",19),kg("change",function(o){return n.onVoiceInputModeChange(o)}),Cs(100,"option",20),JC(101,"Browser (real-time)"),hl(),Cs(102,"option",21),JC(103,"Whisper (higher accuracy)"),hl(),Cs(104,"option",22),JC(105,"Voice message (send audio)"),hl()()(),Cs(106,"div",3)(107,"label",23),JC(108,"Voice recognition language:"),hl(),Cs(109,"select",24),rm("ngModelChange",function(o){return iT(n.selectedVoiceLanguage,o)||(n.selectedVoiceLanguage=o),o}),kg("change",function(){return n.onVoiceLanguageChange()}),dC(110,ct,2,3,"option",25,rt),hl(),ZI(),hl(),Cs(112,"div",3)(113,"span",10),JC(114,"Automatic announcement:"),hl(),Cs(115,"div",4)(116,"label",5)(117,"input",26),rm("ngModelChange",function(o){return iT(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),kg("change",function(){return n.onVoiceAnnounceEnabledChange()}),hl(),ZI(),Mg(118,"span",7),JC(119," Enabled "),hl(),Cs(120,"label",5)(121,"input",26),rm("ngModelChange",function(o){return iT(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),kg("change",function(){return n.onVoiceAnnounceEnabledChange()}),hl(),ZI(),Mg(122,"span",7),JC(123," Disabled "),hl()()(),Cs(124,"div",3)(125,"span",10),JC(126,"Voice mode:"),hl(),Cs(127,"div",4)(128,"label",5)(129,"input",27),rm("ngModelChange",function(o){return iT(n.voiceMode,o)||(n.voiceMode=o),o}),kg("change",function(){return n.onVoiceModeChange()}),hl(),ZI(),Mg(130,"span",7),JC(131," Voice synthesis "),hl(),Cs(132,"label",5)(133,"input",28),rm("ngModelChange",function(o){return iT(n.voiceMode,o)||(n.voiceMode=o),o}),kg("change",function(){return n.onVoiceModeChange()}),hl(),ZI(),Mg(134,"span",7),JC(135," Sound notification "),hl()()(),Cs(136,"div",3)(137,"span",10),JC(138,"Message reading:"),hl(),Cs(139,"div",4)(140,"label",5)(141,"input",29),rm("ngModelChange",function(o){return iT(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),kg("change",function(){return n.onVoiceReadFullTextChange()}),hl(),ZI(),Mg(142,"span",7),JC(143," Full message "),hl(),Cs(144,"label",5)(145,"input",29),rm("ngModelChange",function(o){return iT(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),kg("change",function(){return n.onVoiceReadFullTextChange()}),hl(),ZI(),Mg(146,"span",7),JC(147," First paragraphs only "),hl()()(),Cs(148,"div",3)(149,"label",30),JC(150,"Selected voice:"),hl(),Cs(151,"select",31),rm("ngModelChange",function(o){return iT(n.selectedVoiceId,o)||(n.selectedVoiceId=o),o}),kg("change",function(){return n.onSelectedVoiceChange()}),aC(152,lt,2,0,"option",32),aC(153,dt,2,0,"option",32),dC(154,pt,2,2,"option",25,at),hl(),ZI(),Mg(156,"div",10),Cs(157,"a",33),kg("click",function(){return n.testVoice()}),Cs(158,"span",34),JC(159,"Test voice"),hl()()(),Cs(160,"div",3)(161,"label",35),JC(162),hl(),Cs(163,"input",36),rm("ngModelChange",function(o){return iT(n.voiceVolume,o)||(n.voiceVolume=o),o}),kg("input",function(){return n.onVoiceVolumeChange()}),hl(),ZI(),hl(),Cs(164,"div",3)(165,"label",37),JC(166),hl(),Cs(167,"input",38),rm("ngModelChange",function(o){return iT(n.voiceRate,o)||(n.voiceRate=o),o}),kg("input",function(){return n.onVoiceRateChange()}),hl(),ZI(),hl()()()),t&2&&(sI(10),nm("ngModel",n.selectedTheme),QI(),sI(4),nm("ngModel",n.selectedTheme),QI(),sI(4),nm("ngModel",n.selectedTheme),QI(),sI(14),_g("value",true),nm("ngModel",n.useEnterToSend),QI(),sI(4),_g("value",false),nm("ngModel",n.useEnterToSend),QI(),sI(7),nm("ngModel",n.showTechnicalMessages),QI(),sI(5),nm("ngModel",n.showWarningMessages),QI(),sI(5),nm("ngModel",n.printTechnicalMessages),QI(),sI(14),nm("ngModel",n.missionPreviewEnabled),QI(),sI(11),nm("ngModel",n.agentNotificationEnabled),QI(),sI(5),nm("ngModel",n.notificationSoundEnabled),_g("disabled",!n.agentNotificationEnabled),QI(),sI(5),nm("ngModel",n.browserNotificationEnabled),_g("disabled",!n.agentNotificationEnabled||n.browserNotificationDenied),QI(),sI(),cC(n.browserNotificationDenied?89:-1),sI(10),_g("value",n.voiceInputMode),sI(10),nm("ngModel",n.selectedVoiceLanguage),QI(),sI(),fC(n.voiceLanguageOptions),sI(7),_g("value",true),nm("ngModel",n.voiceAnnounceEnabled),QI(),sI(4),_g("value",false),nm("ngModel",n.voiceAnnounceEnabled),QI(),sI(8),nm("ngModel",n.voiceMode),QI(),sI(4),nm("ngModel",n.voiceMode),QI(),sI(8),_g("value",true),nm("ngModel",n.voiceReadFullText),QI(),sI(4),_g("value",false),nm("ngModel",n.voiceReadFullText),QI(),sI(6),nm("ngModel",n.selectedVoiceId),_g("disabled",n.loadingVoices||n.availableVoices.length===0),QI(),sI(),cC(n.loadingVoices?152:-1),sI(),cC(!n.loadingVoices&&n.availableVoices.length===0?153:-1),sI(),fC(n.availableVoices),sI(8),Dl("Volume: ",n.voiceVolume,"%"),sI(),nm("ngModel",n.voiceVolume),QI(),sI(3),Dl("Speed: ",n.voiceRate,"%"),sI(),nm("ngModel",n.voiceRate),QI());},dependencies:[ti,Qn,ei,Ye$1,_n,At,mn,Zn,cn,wt,se],styles:['.options-content[_ngcontent-%COMP%]{padding:0;width:100%}.option-group[_ngcontent-%COMP%]{padding:0 1rem 1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border-light)}.option-group[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.option-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;color:var(--color-text);font-size:.875rem}.toggle-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.toggle-option[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0;flex:1}.toggle-option[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex-shrink:0}.option-label-with-hint[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1}.option-label-with-hint[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0}.option-label-with-hint[_ngcontent-%COMP%] .option-hint[_ngcontent-%COMP%]{font-size:.775rem;color:var(--color-text-secondary);line-height:1.4}.option-select[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-input-bg);color:var(--color-text);font-size:.875rem;cursor:pointer}.option-select[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px #7064fb1a}.option-select[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.option-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{padding:.5rem}.option-checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--color-border);border-radius:3px;margin-right:.75rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";width:10px;height:6px;border-left:2px solid transparent;border-bottom:2px solid transparent;transform:rotate(-45deg);transition:all .2s ease;opacity:0}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]{background-color:var(--color-primary);border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]:after{border-left-color:#fff;border-bottom-color:#fff;opacity:1}.option-checkbox[_ngcontent-%COMP%]:hover .checkmark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%]:focus-within .checkmark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-section[_ngcontent-%COMP%]{padding-top:1rem;margin-top:1rem;border-top:2px solid var(--color-border)}.option-section[_ngcontent-%COMP%]:first-child{border-top:none;padding-top:0;margin-top:0}.section-title[_ngcontent-%COMP%]{margin:0 0 1rem;padding:0 1rem;font-size:.9rem;font-weight:600;color:var(--color-text);display:flex;align-items:center;gap:.5rem}.section-title[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.option-radio[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{display:none}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--color-border);border-radius:50%;margin-right:.5rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0;position:relative}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]:after{content:"";width:8px;height:8px;border-radius:50%;background-color:var(--color-primary);transition:all .2s ease;opacity:0;transform:scale(0)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]:after{opacity:1;transform:scale(1)}.option-radio[_ngcontent-%COMP%]:hover .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%]:focus-within .radio-mark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-slider[_ngcontent-%COMP%]{width:100%;height:6px;border-radius:3px;background:var(--color-bg-solid);outline:none;cursor:pointer;-webkit-appearance:none;appearance:none}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-webkit-slider-track{height:6px;border-radius:3px;background:var(--color-bg-secondary)}.option-slider[_ngcontent-%COMP%]::-moz-range-track{height:6px;border-radius:3px;background:var(--color-bg-secondary);border:none}.option-slider[_ngcontent-%COMP%]:focus{outline:none}.option-slider[_ngcontent-%COMP%]:focus::-webkit-slider-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.option-slider[_ngcontent-%COMP%]:focus::-moz-range-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.test-voice-btn[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;background:var(--color-primary);color:#fff;border:none;border-radius:6px;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:.5rem}.test-voice-btn[_ngcontent-%COMP%]:hover{background:var(--color-primary-hover);transform:translateY(-1px);box-shadow:0 2px 8px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 1px 4px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:focus{outline:none;box-shadow:0 0 0 3px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:disabled{background:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;transform:none;box-shadow:none}.test-voice-link[_ngcontent-%COMP%]{text-decoration-thickness:1.5px;text-underline-offset:3px;background:transparent;border:none;padding:0;font-size:.775rem;font-weight:400;cursor:pointer;transition:all .2s ease;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;text-decoration:underline}.test-voice-link[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover, var(--color-primary));text-decoration-thickness:2px}.test-voice-link[_ngcontent-%COMP%]:active{opacity:.8}.test-voice-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.test-voice-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.notification-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.75rem;margin-top:.75rem;background-color:#d32f2f1a;border:1px solid rgba(211,47,47,.3);border-radius:6px;font-size:.8125rem;line-height:1.5}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#d32f2f;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{color:var(--color-text);flex:1}.notification-error[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;background-color:#f443361a;border:1px solid rgba(244,67,54,.3);border-radius:6px;display:flex;align-items:flex-start;gap:.5rem}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#f44336;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text);line-height:1.5;flex:1}'],changeDetection:1})};function Qe(c){let e=c.args??"",t;try{let n=JSON.parse(e);t=JSON.stringify(n,null,2);}catch(n){t=e;}return `\u{1F527} ${c.name}
|
|
179
179
|
|
|
180
|
-
${t}`}var Ge=class c{destroy$=new
|
|
180
|
+
${t}`}var Ge=class c{destroy$=new ue;currentProject=null;currentThread=null;messagesSubject=new Tr([]);isThinkingSubject=new Tr(false);currentChoiceSubject=new Tr(null);projectTitleSubject=new Tr("Coday");currentInviteEventSubject=new Tr(null);messageToRestoreSubject=new Tr("");threadUpdateEventSubject=new Tr(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new Tr("");subThreadEventsSubject=new ue;subThreadEvents$=this.subThreadEventsSubject.asObservable();subThreadEventBuffers=new Map;getBufferedSubThreadEvents(e){return this.subThreadEventBuffers.get(e)??[]}messages$=this.messagesSubject.asObservable();streamingText$=this.streamingTextSubject.asObservable();isThinking$=this.isThinkingSubject.asObservable();currentChoice$=this.currentChoiceSubject.asObservable();currentInviteEvent$=this.currentInviteEventSubject.asObservable();messageToRestore$=this.messageToRestoreSubject.asObservable();threadUpdateEvent$=this.threadUpdateEventSubject.asObservable();connectionStatus$;tabTitleService=null;eventStream=g(fe);messageApi=g(be);userService=g(pe);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling();}setTabTitleService(e){this.tabTitleService=e;}connectToThread(e,t){this.currentProject=e,this.currentThread=t,this.eventStream.connectToThread(e,t);}loadHistoryFromRest(e){for(let t of e){let n=le(t);n&&this.handleEvent(n,true);}}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.subThreadEventBuffers.clear(),this.stopThinking();}sendMessage(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}let t=this.currentInviteEventSubject.value;if(t){this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.thinkingTimeout=setTimeout(()=>{this.thinkingTimeout=null,this.stopThinking(),console.warn("[CODAY] Safety timeout: no server response after 30 s, releasing thinking state");},3e4),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let n=t.buildAnswer(e);this.messageApi.sendMessage(n).subscribe({error:i=>{console.error("[CODAY] Send invite answer error:",i),this.currentInviteEventSubject.next(t),this.stopThinking();}});}else this.messageApi.sendFreeMessage(e).subscribe({error:n=>{console.error("[CODAY] Send error:",n);}});}sendChoice(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.thinkingTimeout=setTimeout(()=>{this.thinkingTimeout=null,this.stopThinking(),console.warn("[CODAY] Safety timeout: no server response after 30 s, releasing thinking state");},3e4),this.tabTitleService?.setSystemActive();let t=this.currentChoiceEvent.buildAnswer(e);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(t).subscribe({next:()=>{},error:n=>{console.error("[CODAY-CHOICE] Choice error:",n),this.stopThinking();}});}else console.error("[CODAY-CHOICE] No choice event available for choice:",e);}deleteMessage(e){let t=this.messagesSubject.value.find(i=>i.id===e),n=this.extractTextContentFromMessage(t);return this.messageApi.deleteMessage(e).pipe(Fd(i=>{i.success&&(this.removeMessagesFromIndex(e),n.trim()&&this.messageToRestoreSubject.next(n));}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(true),this.tabTitleService?.setSystemActive();}initializeEventHandling(){this.eventStream.events$.pipe(zy(this.destroy$)).subscribe({next:e=>this.handleEvent(e),error:e=>console.error("[CODAY] Event stream error:",e),complete:()=>console.log("[CODAY] Event stream completed")});}handleEvent(e,t=false){if(e.threadId&&e.threadId!==this.currentThread){let n=this.subThreadEventBuffers.get(e.threadId);n?n.push(e):this.subThreadEventBuffers.set(e.threadId,[e]),this.subThreadEventsSubject.next(e);return}e instanceof T?this.handleMessageEvent(e):e instanceof B?this.handleTextChunkEvent(e):e instanceof A?this.handleTextEvent(e):e instanceof u?this.handleAnswerEvent(e):e instanceof h?this.handleErrorEvent(e):e instanceof M?this.handleWarnEvent(e):e instanceof O?this.handleThinkingEvent(e):e instanceof v?this.handleToolRequestEvent(e):e instanceof m?this.handleToolResponseEvent(e):e instanceof b?this.handleChoiceEvent(e,t):e instanceof F?this.handleHeartBeatEvent(e):e instanceof f?this.handleInviteEvent(e,t):e instanceof V?this.handleThreadUpdateEvent(e):e instanceof R?this.handleDelegationEvent(e):e instanceof H||e instanceof K||console.warn("[CODAY] Unhandled event type:",e.type);}handleDelegationEvent(e){if(console.log("[CODAY] DelegationEvent received:",e.subThreadId,e.agentName),this.messagesSubject.value.findIndex(i=>i.subThreadId===e.subThreadId)===-1){let i={id:e.timestamp,role:"system",speaker:e.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:e.subThreadId,delegationAgentName:e.agentName};this.addMessage(i);}}handleThreadUpdateEvent(e){this.threadUpdateEventSubject.next(e);}handleMessageEvent(e){e.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let t={id:e.timestamp,role:e.role,speaker:e.name,content:e.content,timestamp:e.date,type:"text"};this.addMessage(t);}handleTextChunkEvent(e){this.accumulatedChunks+=e.chunk,this.streamingTextSubject.next(this.accumulatedChunks);}handleTextEvent(e){let t={id:e.timestamp,role:e.speaker?"assistant":"system",speaker:e.speaker??"System",content:[{type:"text",content:e.text}],timestamp:e.date,type:e.speaker?"text":"technical"};this.addMessage(t);}handleAnswerEvent(e){let t=this.currentInviteEventSubject.value;if(t){let i=!!e.parentKey&&e.parentKey===t.timestamp,o=!e.parentKey&&e.date>=t.date;(i||o)&&this.currentInviteEventSubject.next(null);}if(this.currentChoiceEvent){let i=!!e.parentKey&&e.parentKey===this.currentChoiceEvent.timestamp,o=!e.parentKey&&e.date>=this.currentChoiceEvent.date;(i||o)&&(this.currentChoiceEvent=null,this.currentChoiceSubject.next(null));}if(e.silent)return;let n={id:e.timestamp,role:"user",speaker:e.name??this.userService.getUsername()??"User",content:[{type:"text",content:e.answer}],timestamp:e.date,type:"text",parentKey:e.parentKey,invite:e.invite};this.addMessage(n);}handleErrorEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(e.error)}`}],timestamp:e.date,type:"error"};this.addMessage(t);}handleWarnEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(e.warning)}`}],timestamp:e.date,type:"warning"};this.addMessage(t);}handleThinkingEvent(e){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(false),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive();},O.debounce+1e3));}handleToolRequestEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp,fullContent:Qe(e)};this.addMessage(t);}handleToolResponseEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp};this.addMessage(t);}handleChoiceEvent(e,t=false){this.stopThinking();let n={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite}],timestamp:e.date,type:"text"};if(this.addMessage(n),t||this.messagesSubject.value.some(y=>y.parentKey===e.timestamp||y.role==="user"&&y.timestamp>e.date||y.role==="assistant"&&y.timestamp>e.date))return;this.currentChoiceEvent=e,this.tabTitleService?.setSystemInactive();let E=e.options.map(y=>({value:y,label:y})),C=e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite;this.currentChoiceSubject.next({options:E,label:C,allowFreeText:e.allowFreeText});}handleHeartBeatEvent(e){}handleInviteEvent(e,t=false){if(this.stopThinking(),e.invite===_e)t||(this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive());else {let i={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.invite}],timestamp:e.date,type:"text"};this.addMessage(i),this.messagesSubject.value.some(C=>C.parentKey===e.timestamp||C.role==="user"&&C.timestamp>e.date||C.role==="assistant"&&C.timestamp>e.date)||t||(this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive());}}addMessage(e){let t=this.messagesSubject.value;t.some(n=>n.id===e.id)||this.messagesSubject.next([...t,e]);}removeMessagesFromIndex(e){let t=this.messagesSubject.value,n=t.findIndex(o=>o.id===e);if(n===-1||n===0)return;let i=t.slice(0,n);this.messagesSubject.next(i),this.stopThinking();}extractTextContentFromMessage(e){return e?e.content.filter(t=>t.type==="text").map(t=>t.content).join(`
|
|
181
181
|
|
|
182
|
-
`):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null);}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(false),this.tabTitleService&&this.tabTitleService.setSystemInactive();}ngOnDestroy(){this.clearThinkingTimeout(),this.destroy$.next(),this.destroy$.complete(),this.currentInviteEventSubject.complete(),this.messageToRestoreSubject.complete(),this.threadUpdateEventSubject.complete(),this.streamingTextSubject.complete(),this.eventStream.disconnect();}static \u0275fac=function(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};function gt(c,e){if(c&1&&(
|
|
182
|
+
`):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null);}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(false),this.tabTitleService&&this.tabTitleService.setSystemInactive();}ngOnDestroy(){this.clearThinkingTimeout(),this.destroy$.next(),this.destroy$.complete(),this.currentInviteEventSubject.complete(),this.messageToRestoreSubject.complete(),this.threadUpdateEventSubject.complete(),this.streamingTextSubject.complete(),this.eventStream.disconnect();}static \u0275fac=function(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};function gt(c,e){if(c&1&&(Cs(0,"div",3),JC(1),hl()),c&2){let t=CC();sI(),Dl("\u274C ",t.errorMessage);}}var Ze=class c{dialogRef=g(z$1);data=g(Ue);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName);}getDefaultTitle(e,t){return e==="user"?"User Configuration":`Project Configuration: ${t||"Unknown"}`}onSave(){this.errorMessage="";let e;try{e=JSON.parse(this.jsonContent);}catch(t){this.errorMessage=`Invalid JSON syntax: ${t instanceof Error?t.message:"Unknown error"}`;return}this.dialogRef.close(e);}onCancel(){this.dialogRef.close();}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=jw({type:c,selectors:[["app-json-editor"]],decls:13,vars:3,consts:[["mat-dialog-title",""],["mat-icon-button","","title","Close",1,"close-button",3,"click"],["spellcheck","false","placeholder","Enter JSON configuration...",1,"json-textarea",3,"ngModelChange","ngModel"],[1,"error-message"],["align","end"],["matButton","",3,"click"],["matButton","filled","color","primary",3,"click"]],template:function(t,n){t&1&&(Cs(0,"div",0),JC(1),Cs(2,"button",1),kg("click",function(){return n.onCancel()}),Cs(3,"mat-icon"),JC(4,"close"),hl()()(),Cs(5,"mat-dialog-content")(6,"textarea",2),rm("ngModelChange",function(o){return iT(n.jsonContent,o)||(n.jsonContent=o),o}),hl(),ZI(),aC(7,gt,2,1,"div",3),hl(),Cs(8,"mat-dialog-actions",4)(9,"button",5),kg("click",function(){return n.onCancel()}),JC(10,"Cancel"),hl(),Cs(11,"button",6),kg("click",function(){return n.onSave()}),JC(12,"Save"),hl()()),t&2&&(sI(),Dl(" ",n.title," "),sI(5),nm("ngModel",n.jsonContent),QI(),sI(),cC(n.errorMessage?7:-1));},dependencies:[Ym,ti,Ye$1,Zn,cn,wt,Gn,pr,jt,Nt,Vt],styles:["[mat-dialog-title][_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}[mat-dialog-title][_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{margin-left:auto}mat-dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;min-height:400px}.json-textarea[_ngcontent-%COMP%]{flex:1;min-height:300px;max-height:80vh;padding:1rem;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.875rem;line-height:1.5;background:var(--color-code-bg);color:var(--color-text);border:1px solid var(--color-border);border-radius:4px;resize:vertical;outline:none;transition:border-color .2s}.json-textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.json-textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.6}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:4px;font-size:.875rem;line-height:1.4;background:#dc26261a;color:#dc2626;border:1px solid rgba(220,38,38,.3)}"],changeDetection:1})};export{Et as E,Ge as G,Qe as Q,Ye as Y,Ze as Z,yt as y,z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {N}from'./chunk-vL7dLM7S.js';import {g,ao as V,G,C as Ce$1,d8 as M,dl as D,d6 as F,W as Wi,$ as $y,I as br,b as U,r as re,a7 as va,z as z$1,a as P,j as jw,s as si,k as Cs,n as kg,J as JC,m as hl,o as aC,t as sI,a8 as Kg,u as cC,ac as CC,_ as _g,a9 as vC,M as Mg,a3 as ZI,a6 as QI,a5 as Dl,q as dC,v as fC,bo as uC,aa as Cf,ab as Tf,S as Sg}from'./main-YYHD6X7H.js';import'./chunk-BJld3zB5.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 wt,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-FMHkoXwM.js';import'./chunk-DaoWXYMw.js';import'./chunk-4uEZjTft.js';import'./chunk-B13_C_P9.js';import'./chunk-CgNkwpQ7.js';var le=(r,t)=>t.config.id,ce=(r,t)=>t.type;function ge(r,t){if(r&1&&(Cs(0,"a",5),JC(1,"View resolved definition \u2192"),hl()),r&2){let e=CC();_g("routerLink",e.inspectRoute());}}function se(r,t){r&1&&(Cs(0,"span",6),JC(1,"Platform level"),hl());}function de(r,t){r&1&&(Cs(0,"p",7),JC(1,"Loading\u2026"),hl());}function me(r,t){if(r&1&&(Cs(0,"span",41),JC(1),hl()),r&2){let e=CC().$implicit;sI(),Kg(e.config.integrationType);}}function fe(r,t){if(r&1&&(Mg(0,"input",42),ZI()),r&2){let e=CC().$implicit;_g("formControl",e.toolsControl),QI();}}function pe(r,t){if(r&1){let e=vC();Cs(0,"div",37)(1,"label",38)(2,"input",39),kg("change",function(){let l=Cf(e).$implicit,g=CC(3);return Tf(g.toggleIntegration(l))}),hl(),Cs(3,"span",40),JC(4),hl(),aC(5,me,2,1,"span",41),hl(),aC(6,fe,1,1,"input",42),hl();}if(r&2){let e=t.$implicit;sI(2),_g("checked",e.enabled()),sI(2),Kg(e.config.name),sI(),cC(e.config.integrationType?5:-1),sI(),cC(e.enabled()?6:-1);}}function _e(r,t){if(r&1&&(Cs(0,"p",48),JC(1),hl()),r&2){let e=CC().$implicit;sI(),Dl(" Restricted to: ",e.restrictedTools.join(", ")," (set outside this form, preserved on save) ");}}function ue(r,t){if(r&1){let e=vC();Cs(0,"div",37)(1,"label",38)(2,"span",40),JC(3),hl(),Cs(4,"span",41),JC(5,"built-in"),hl()(),Cs(6,"select",44),kg("change",function(l){let g=Cf(e).$implicit,m=CC(4);return Tf(m.setBuiltInState(g,l.target.value))}),Cs(7,"option",45),JC(8),hl(),Cs(9,"option",46),JC(10,"Enabled"),hl(),Cs(11,"option",47),JC(12,"Disabled"),hl()(),aC(13,_e,2,1,"p",48),Cs(14,"p",49),JC(15),hl()();}if(r&2){let e=t.$implicit,o=CC(4);sI(),Sg("for","built-in-"+e.type),sI(2),Kg(e.displayName),sI(3),_g("id","built-in-"+e.type)("value",e.state()),sI(2),Kg(o.builtInDefaultLabel(e)),sI(5),cC(e.state()==="on"&&e.restrictedTools?13:-1),sI(2),Kg(e.description);}}function be(r,t){if(r&1&&(Cs(0,"p",43),JC(1,"Built-in integrations"),hl(),dC(2,ue,16,7,"div",37,ce)),r&2){let e=CC(3);sI(2),fC(e.builtInRows());}}function Ce(r,t){if(r&1&&(Cs(0,"fieldset",20)(1,"legend",25),JC(2,"Integrations"),hl(),Cs(3,"p",36),JC(4," Select which integrations this agent can use. Leave tool names empty to allow all tools from an integration. "),hl(),dC(5,pe,7,4,"div",37,le),aC(7,be,4,0),hl()),r&2){let e=CC(2);sI(5),fC(e.integrationRows()),sI(2),cC(e.builtInRows().length>0?7:-1);}}function xe(r,t){if(r&1){let e=vC();Cs(0,"li",50),Mg(1,"input",51),ZI(),Cs(2,"button",52),kg("click",function(){let l=Cf(e).$implicit,g=CC(3);return Tf(g.removeSubAgent(l))}),JC(3," \u{1F5D1} "),hl()();}if(r&2){let e=t.$implicit;sI(),_g("formControl",e.control),QI();}}function ye(r,t){if(r&1&&(Cs(0,"ul",28),dC(1,xe,4,1,"li",50,uC),hl()),r&2){let e=CC(2);sI(),fC(e.subAgentRows());}}function he(r,t){if(r&1){let e=vC();Cs(0,"button",53),kg("click",function(){Cf(e);let l=CC(2);return Tf(l.exportYaml())}),JC(1),hl();}if(r&2){let e=CC(2);_g("disabled",e.isExporting()),sI(),Dl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ve(r,t){if(r&1){let e=vC();Cs(0,"form",9),kg("ngSubmit",function(){Cf(e);let l=CC();return Tf(l.submit())}),Cs(1,"div",10)(2,"label",11),JC(3,"Name "),Cs(4,"span",12),JC(5,"*"),hl()(),Mg(6,"input",13),ZI(),hl(),Cs(7,"div",10)(8,"label",14),JC(9,"Description"),hl(),Mg(10,"input",15),ZI(),hl(),Cs(11,"div",10)(12,"label",16),JC(13,"Model name"),hl(),Mg(14,"input",17),ZI(),hl(),Cs(15,"div",10)(16,"label",18),JC(17,"Instructions"),hl(),Mg(18,"textarea",19),ZI(),hl(),aC(19,Ce,8,1,"fieldset",20),Cs(20,"div",10)(21,"label",21),Mg(22,"input",22),ZI(),Cs(23,"span",23),JC(24,"Advanced mode"),hl()(),Cs(25,"p",24),JC(26," When enabled, this agent uses a multi-step reasoning loop instead of a single LLM call. "),hl()(),Cs(27,"div",10)(28,"label",21),Mg(29,"input",22),ZI(),Cs(30,"span",23),JC(31,"Enabled"),hl()(),Cs(32,"p",24),JC(33,"Disabled agents are excluded from namespace resolution."),hl()(),Cs(34,"div",10)(35,"span",25),JC(36,"Sub-agents"),hl(),Cs(37,"p",26),JC(38," Glob patterns for agents this agent may delegate to. "),Cs(39,"code",27),JC(40,"*"),hl(),JC(41," matches any sequence of characters (e.g.\xA0"),Cs(42,"code",27),JC(43,"*Fixer"),hl(),JC(44,", "),Cs(45,"code",27),JC(46,"*"),hl(),JC(47," for all). Leave empty to disable delegation. "),hl(),aC(48,ye,3,0,"ul",28),Cs(49,"div",29)(50,"input",30),kg("keydown.enter",function(){Cf(e);let l=CC();return Tf(l.addSubAgent())}),hl(),ZI(),Cs(51,"button",31),kg("click",function(){Cf(e);let l=CC();return Tf(l.addSubAgent())}),JC(52," + "),hl()()(),Cs(53,"div",32)(54,"button",33),JC(55),hl(),aC(56,he,2,2,"button",34),Cs(57,"button",35),kg("click",function(){Cf(e);let l=CC();return Tf(l.cancel())}),JC(58,"Cancel"),hl()()();}if(r&2){let e=CC();_g("formGroup",e.form),sI(6),_g("formControl",e.nameControl),QI(),sI(4),_g("formControl",e.descriptionControl),QI(),sI(4),_g("formControl",e.modelNameControl),QI(),sI(4),_g("formControl",e.instructionsControl),QI(),sI(),cC(e.integrationRows().length>0||e.builtInRows().length>0?19:-1),sI(3),_g("formControl",e.advancedExecutionControl),QI(),sI(7),_g("formControl",e.enabledControl),QI(),sI(19),cC(e.subAgentRows().length>0?48:-1),sI(2),_g("formControl",e.newSubAgentControl),QI(),sI(),_g("disabled",!e.newSubAgentControl.value.trim()),sI(3),_g("disabled",e.form.invalid||e.isSubmitting()),sI(),Dl(" ",e.isEditMode()?"Save changes":"Create"," "),sI(),cC(e.isEditMode()?56:-1);}}var ae=class r{route=g(V);router=g(G);destroyRef=g(Ce$1);agentConfigController=g(M);exportService=g(D);integrationConfigState=g(N);integrationTypeController=g(F);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(null),modelName:new _t(null),instructions:new _t(null),advancedExecution:new _t(false,{nonNullable:true}),enabled:new _t(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get modelNameControl(){return this.form.controls.modelName}get instructionsControl(){return this.form.controls.instructions}get advancedExecutionControl(){return this.form.controls.advancedExecution}get enabledControl(){return this.form.controls.enabled}subAgentRows=Wi([]);newSubAgentControl=new _t("",{nonNullable:true});isEditMode=Wi(false);isSubmitting=Wi(false);isLoading=Wi(false);isExporting=Wi(false);builtInRows=Wi([]);inspectRoute(){let t=this.route.snapshot.paramMap.get("agentConfigId")??"";return this.isPlatformMode?["/agentos","admin","agent-configs",t,"inspect"]:["/agentos",this.namespaceId,"agent-configs",t,"inspect"]}integrationRows=Wi([]);existingConfig=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("agentConfigId");t?(this.isEditMode.set(true),this.loadConfigAndIntegrations(t)):this.loadIntegrations(void 0);}loadConfigAndIntegrations(t){this.isLoading.set(true),$y({config:this.agentConfigController.getByIdAgentConfig(t),namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes()}).pipe(U(this.destroyRef)).subscribe({next:({config:e,namespaceIntegrations:o,platformIntegrations:l,builtInTypes:g})=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.modelNameControl.setValue(e.modelName??null),this.instructionsControl.setValue(e.instructions??null),this.advancedExecutionControl.setValue(e.advancedExecution??false),this.enabledControl.setValue(e.enabled??true);let m=[...l,...o];this.integrationRows.set(this.buildIntegrationRows(m,e.integrations??void 0)),this.builtInRows.set(this.buildBuiltInRows(g,e.integrations??void 0)),this.subAgentRows.set((e.subAgents??[]).map(P=>({control:new _t(P,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadIntegrations(t){$y({namespaceIntegrations:this.namespaceId?this.integrationConfigState.loadNamespaceConfigs(this.namespaceId):br([]),platformIntegrations:this.integrationConfigState.loadPlatformConfigs(),builtInTypes:this.loadBuiltInTypes()}).pipe(U(this.destroyRef)).subscribe({next:({namespaceIntegrations:e,platformIntegrations:o,builtInTypes:l})=>{let g=[...o,...e];this.integrationRows.set(this.buildIntegrationRows(g,t??void 0)),this.builtInRows.set(this.buildBuiltInRows(l,t??void 0));}});}loadBuiltInTypes(){return this.integrationTypeController.listTypesIntegrationType().pipe(re(t=>t.filter(e=>!e.configSchema)),va(t=>(console.error("[agent-config-form] failed to load integration types",t),br([]))))}buildIntegrationRows(t,e){return t.map(o=>{let l=o.name??"",g=e?.[l],m=e!=null&&l in e,P=Array.isArray(g)?g.join(", "):"";return {config:o,enabled:Wi(m),toolsControl:new _t(P,{nonNullable:true})}})}buildBuiltInRows(t,e){return t.map(o=>{let l=e!=null&&o.type in e,g=e?.[o.type],m=l?Array.isArray(g)&&g.length===0?"off":"on":"default";return {type:o.type,displayName:o.displayName,description:o.description,enabledByDefault:o.enabledByDefault===true,state:Wi(m),restrictedTools:Array.isArray(g)&&g.length>0?g:null}})}toggleIntegration(t){t.enabled.update(e=>!e);}setBuiltInState(t,e){t.state.set(e);}builtInDefaultLabel(t){return t.enabledByDefault?"Platform default (enabled)":"Platform default (disabled)"}addSubAgent(){let t=this.newSubAgentControl.value.trim();t&&(this.subAgentRows.update(e=>[...e,{control:new _t(t,{nonNullable:true})}]),this.newSubAgentControl.reset(""));}removeSubAgent(t){this.subAgentRows.update(e=>e.filter(o=>o!==t));}buildSubAgentsPayload(){let t=this.subAgentRows().map(e=>e.control.value.trim()).filter(e=>e.length>0);return t.length>0?t:void 0}buildIntegrationsPayload(){let t={};for(let o of this.integrationRows().filter(l=>l.enabled())){let l=o.config.name??"",g=o.toolsControl.value.trim();t[l]=g===""?null:g.split(",").map(m=>m.trim()).filter(m=>m.length>0);}for(let o of this.builtInRows()){let l=o.state();l==="on"?t[o.type]=o.restrictedTools??null:l==="off"&&(t[o.type]=[]);}let e=new Set([...this.integrationRows().map(o=>o.config.name??""),...this.builtInRows().map(o=>o.type)]);for(let[o,l]of Object.entries(this.existingConfig?.integrations??{}))e.has(o)||(t[o]=l);return Object.keys(t).length>0?t:void 0}submit(){if(this.form.invalid||this.isSubmitting())return;this.addSubAgent(),this.isSubmitting.set(true);let t=z$1(P({},this.existingConfig??{}),{createdOn:this.existingConfig?.createdOn,updatedOn:this.existingConfig?.updatedOn,namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,modelName:this.modelNameControl.value?.trim()||void 0,instructions:this.instructionsControl.value?.trim()||void 0,integrations:this.buildIntegrationsPayload(),advancedExecution:this.advancedExecutionControl.value,enabled:this.enabledControl.value,subAgents:this.buildSubAgentsPayload()});(this.isEditMode()?this.agentConfigController.updateAgentConfig(this.existingConfig.id??"",t):this.agentConfigController.createAgentConfig(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(true),this.exportService.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let o=new Blob([e],{type:"application/yaml"}),l=URL.createObjectURL(o),g=document.createElement("a");g.href=l,g.download=`${this.existingConfig?.name??"agent"}.yaml`,g.click(),URL.revokeObjectURL(l),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=jw({type:r,selectors:[["agentos-agent-config-form"]],decls:12,vars:4,consts:[[1,"agent-config-form"],[1,"agent-config-form__header"],["type","button","title","Back to agent configs",1,"agent-config-form__back",3,"click"],[1,"agent-config-form__back-icon"],[1,"agent-config-form__title"],[1,"agent-config-form__sibling-link",3,"routerLink"],[1,"agent-config-form__platform-badge"],[1,"agent-config-form__loading"],[1,"agent-config-form__form",3,"formGroup"],[1,"agent-config-form__form",3,"ngSubmit","formGroup"],[1,"agent-config-form__field"],["for","agent-config-name",1,"agent-config-form__label"],["aria-hidden","true"],["id","agent-config-name","type","text","placeholder","e.g. Support agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-description",1,"agent-config-form__label"],["id","agent-config-description","type","text","placeholder","Optional \u2014 short description of this agent","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-model-name",1,"agent-config-form__label"],["id","agent-config-model-name","type","text","placeholder","Optional \u2014 model alias or name to use","autocomplete","off",1,"agent-config-form__input",3,"formControl"],["for","agent-config-instructions",1,"agent-config-form__label"],["id","agent-config-instructions","rows","6","placeholder","Optional \u2014 system instructions for this agent",1,"agent-config-form__textarea",3,"formControl"],[1,"agent-config-form__integrations"],[1,"agent-config-form__toggle-label"],["type","checkbox",1,"agent-config-form__toggle-checkbox",3,"formControl"],[1,"agent-config-form__toggle-text"],[1,"agent-config-form__toggle-hint"],[1,"agent-config-form__label"],[1,"agent-config-form__field-hint"],[1,"agent-config-form__code"],[1,"agent-config-form__sub-agent-list"],[1,"agent-config-form__sub-agent-add"],["type","text","placeholder","e.g. *Fixer or *","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"keydown.enter","formControl"],["type","button","title","Add pattern",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--add",3,"click","disabled"],[1,"agent-config-form__actions"],["type","submit",1,"agent-config-form__btn","agent-config-form__btn--primary",3,"disabled"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"disabled"],["type","button",1,"agent-config-form__btn",3,"click"],[1,"agent-config-form__integrations-hint"],[1,"agent-config-form__integration-row"],[1,"agent-config-form__integration-toggle"],["type","checkbox",1,"agent-config-form__integration-checkbox",3,"change","checked"],[1,"agent-config-form__integration-name"],[1,"agent-config-form__integration-type"],["type","text","placeholder","Tool names, comma-separated (empty = all tools)","autocomplete","off",1,"agent-config-form__input","agent-config-form__integration-tools",3,"formControl"],[1,"agent-config-form__integrations-separator"],[1,"agent-config-form__integration-state",3,"change","id","value"],["value","default"],["value","on"],["value","off"],[1,"agent-config-form__integration-restriction"],[1,"agent-config-form__integration-builtin-desc"],[1,"agent-config-form__sub-agent-row"],["type","text","autocomplete","off",1,"agent-config-form__input","agent-config-form__sub-agent-input",3,"formControl"],["type","button","title","Remove",1,"agent-config-form__sub-agent-btn","agent-config-form__sub-agent-btn--danger",3,"click"],["type","button",1,"agent-config-form__btn","agent-config-form__btn--export",3,"click","disabled"]],template:function(e,o){e&1&&(Cs(0,"div",0)(1,"header",1)(2,"button",2),kg("click",function(){return o.cancel()}),Cs(3,"span",3),JC(4,"\u2190"),hl(),JC(5," Agent Configs "),hl(),Cs(6,"h1",4),JC(7),hl(),aC(8,ge,2,1,"a",5),aC(9,se,2,0,"span",6),hl(),aC(10,de,2,0,"p",7)(11,ve,59,14,"form",8),hl()),e&2&&(sI(7),Kg(o.isEditMode()?"Edit agent config":"New agent config"),sI(),cC(o.isEditMode()?8:-1),sI(),cC(o.isPlatformMode?9:-1),sI(),cC(o.isLoading()?10:11));},dependencies:[ni,Jn,Qn,ei,Ye,wt,Zn,Xn,Cn,En,si],styles:[".agent-config-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.agent-config-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.agent-config-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.agent-config-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-accent);text-decoration:none}.agent-config-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-form__platform-badge[_ngcontent-%COMP%]{display:inline-block;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:var(--color-surface);border:1px solid var(--color-divider);border-radius:0;padding:.125rem .5rem;letter-spacing:.02em;align-self:flex-start}.agent-config-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.agent-config-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.agent-config-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.agent-config-form__input[_ngcontent-%COMP%], .agent-config-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.agent-config-form__input[_ngcontent-%COMP%]:focus, .agent-config-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.agent-config-form__input[_ngcontent-%COMP%]::placeholder, .agent-config-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.agent-config-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px;line-height:1.5}.agent-config-form__integrations[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.agent-config-form__integrations-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__integration-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.agent-config-form__integration-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__integration-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__integration-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__integration-type[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:monospace}.agent-config-form__integration-tools[_ngcontent-%COMP%]{margin-left:1.5rem;font-size:.875rem}.agent-config-form__integrations-separator[_ngcontent-%COMP%]{margin:.25rem 0 0;padding-top:.5rem;border-top:1px solid var(--color-divider);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);font-family:var(--font-heading)}.agent-config-form__integration-state[_ngcontent-%COMP%]{margin-left:1.5rem;padding:.375rem .625rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.875rem;font-family:inherit;outline:none;transition:border-color .15s ease}.agent-config-form__integration-state[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.agent-config-form__integration-restriction[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;font-style:italic;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-form__integration-builtin-desc[_ngcontent-%COMP%]{margin:0 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__field-hint[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:0}.agent-config-form__sub-agent-list[_ngcontent-%COMP%]{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.375rem}.agent-config-form__sub-agent-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem}.agent-config-form__sub-agent-input[_ngcontent-%COMP%]{flex:1;min-width:0}.agent-config-form__sub-agent-add[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;margin-top:.5rem}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]{flex-shrink:0;width:2rem;height:2rem;padding:0;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text-secondary);font-size:.9rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s ease,border-color .15s ease,color .15s ease}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500);color:var(--color-text)}.agent-config-form__sub-agent-btn[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:not-allowed}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]{width:2rem;height:2rem;font-size:1.25rem;font-weight:300;border-color:var(--color-accent);color:var(--color-accent)}.agent-config-form__sub-agent-btn--add[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent);color:#fff}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]{border:1px solid transparent;color:var(--color-neutral-500)}.agent-config-form__sub-agent-btn--danger[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--red);color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent)}.agent-config-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.agent-config-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-accent);cursor:pointer}.agent-config-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text)}.agent-config-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.agent-config-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.agent-config-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.agent-config-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.agent-config-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.agent-config-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.agent-config-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{ae as AgentConfigFormComponent};
|