@whoz-oss/coday-client 3.17.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-ClSDInQq.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-DqC8XT4v.js → chunk-BEdQqXxw.js} +1 -1
- package/browser/{chunk-DMtXGu5h.js → chunk-BGTRsbsl.js} +1 -1
- package/browser/{chunk-DHb3-uKf.js → chunk-BHiaH1Jm.js} +1 -1
- package/browser/chunk-BJld3zB5.js +9 -0
- package/browser/{chunk-BPfJALqU.js → chunk-BVmICoo4.js} +1 -1
- package/browser/chunk-BXCHG0wB.js +1 -0
- package/browser/{chunk-LVItL87L.js → chunk-B_Sx6nwb.js} +1 -1
- package/browser/{chunk-D202v_ff.js → chunk-BbPMe8u2.js} +1 -1
- package/browser/{chunk-Bu5Xq3QT.js → chunk-Bb_J3EoX.js} +1 -1
- package/browser/{chunk-BkN5jb4J.js → chunk-BfE6wTUj.js} +1 -1
- package/browser/chunk-Bnj9Hkqy.js +276 -0
- package/browser/chunk-BqWEyotW.js +55 -0
- package/browser/{chunk-BXkvjekT.js → chunk-Buu9Jf-V.js} +2 -2
- package/browser/{chunk-Brx_KbnM.js → chunk-CJAdjOmi.js} +1 -1
- package/browser/{chunk-DjoW6kqa.js → chunk-CJEW8Ogd.js} +5 -5
- package/browser/chunk-CM1_Z4h5.js +1 -0
- package/browser/{chunk-Bgd8Jkga.js → chunk-CP3b1EMm.js} +1 -1
- package/browser/chunk-CR817PBg.js +1 -0
- package/browser/{chunk-bfpuueWC.js → chunk-CXgj_KJY.js} +3 -3
- package/browser/{chunk-CxUcyBb9.js → chunk-CakkML6n.js} +1 -1
- package/browser/{chunk-mrKeqPKc.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-CKhGzoqa.js → chunk-CmyT-Z4A.js} +1 -1
- package/browser/{chunk-EBW8PloQ.js → chunk-CqJ7rGVY.js} +1 -1
- package/browser/{chunk-Ci9l-k84.js → chunk-CxpHnwnx.js} +1 -1
- package/browser/{chunk-DFQuWS_F.js → chunk-D1ZnLng-.js} +1 -1
- package/browser/{chunk-DO3lSvop.js → chunk-D26Y186i.js} +1 -1
- package/browser/chunk-D2zGvbD2.js +190 -0
- package/browser/{chunk-DKllQ3Ve.js → chunk-D30bRRTP.js} +1 -1
- package/browser/{chunk-DQtoh8wv.js → chunk-D4dmZgr6.js} +1 -1
- package/browser/{chunk-b6g-uBR5.js → chunk-D6nkbOg1.js} +1 -1
- package/browser/chunk-D8nXP3jN.js +2 -0
- package/browser/{chunk-CUz5MHdA.js → chunk-D92adUD_.js} +1 -1
- package/browser/{chunk-BtEXE3Xz.js → chunk-DDu5Ufv3.js} +1 -1
- package/browser/{chunk-C5WD0UQE.js → chunk-DFjZf9oL.js} +3 -3
- package/browser/{chunk-B626-rya.js → chunk-DJjbZAaS.js} +1 -1
- package/browser/{chunk-B1OTuTxt.js → chunk-DKQvH1hP.js} +1 -1
- package/browser/{chunk-BHvLB-pV.js → chunk-DMUiJ7oP.js} +1 -1
- package/browser/chunk-DMyGIjcZ.js +1 -0
- package/browser/chunk-DOHvMo5p.js +1 -0
- package/browser/{chunk-ClEmA_ih.js → chunk-DVTNoWCQ.js} +1 -1
- package/browser/chunk-DV_7IOl_.js +1 -0
- package/browser/chunk-DaoWXYMw.js +1 -0
- package/browser/{chunk-B7kKWG4P.js → chunk-DmaEv05C.js} +1 -1
- package/browser/{chunk-CpZK7G-Q.js → chunk-DoqL_RuM.js} +2 -2
- package/browser/chunk-FMHkoXwM.js +37 -0
- package/browser/{chunk-CXTwGKdl.js → chunk-Fr6-w83-.js} +1 -1
- package/browser/{chunk-DxrynR3o.js → chunk-HHPhxe9B.js} +1 -1
- package/browser/{chunk-DpHEu7EG.js → chunk-IYMfBoNU.js} +1 -1
- package/browser/chunk-PQu4_Hy2.js +2 -0
- package/browser/chunk-Qpb04pBJ.js +1 -0
- package/browser/{chunk-BVAD9f9s.js → chunk-W5DNK5PC.js} +1 -1
- package/browser/{chunk-B6BZBDSv.js → chunk-WSA7xa0h.js} +5 -5
- package/browser/{chunk-D-jBfPIO.js → chunk-lX2E6ugr.js} +1 -1
- package/browser/{chunk-C2VdQfMJ.js → chunk-o2LY9dfG.js} +1 -1
- package/browser/{chunk-CI760KmO.js → chunk-py_Q_oQH.js} +1 -1
- package/browser/{chunk-DCwEaE_b.js → chunk-t87lD8bQ.js} +1 -1
- package/browser/{chunk-B3-4EW3s.js → chunk-vL7dLM7S.js} +1 -1
- package/browser/{chunk-CI7wYBKk.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-0njD_aMa.js +0 -2
- package/browser/chunk-6WIaUDav.js +0 -1
- package/browser/chunk-B7yga-a4.js +0 -1
- package/browser/chunk-BAWubWk8.js +0 -1
- package/browser/chunk-BDaTUrH4.js +0 -1
- package/browser/chunk-BJ5G7Y-a.js +0 -276
- package/browser/chunk-BTX631I3.js +0 -5
- package/browser/chunk-BYyTBqh4.js +0 -37
- package/browser/chunk-B_49KV6W.js +0 -1
- package/browser/chunk-BaO2vi_O.js +0 -675
- package/browser/chunk-BcT0wYqu.js +0 -2
- package/browser/chunk-BdJzYh5V.js +0 -190
- package/browser/chunk-BwDJA6_r.js +0 -55
- package/browser/chunk-C49BBPGm.js +0 -1
- package/browser/chunk-CNAj5Eon.js +0 -1
- package/browser/chunk-DMRb150M.js +0 -2
- package/browser/chunk-DjMtxVWg.js +0 -508
- package/browser/chunk-DqioJb1X.js +0 -1
- package/browser/chunk-DrzvCb86.js +0 -1
- package/browser/chunk-DwFGK2iu.js +0 -1
- package/browser/chunk-DxvmpOv5.js +0 -1
- package/browser/chunk-P8B5rz7L.js +0 -1
- package/browser/chunk-R-GmZrHu.js +0 -9
- package/browser/main-LBRSRTYI.js +0 -1811
|
@@ -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 {g,B as gy,bU as Fd,K as x,aL as wo,aM as Zn,aO as wt,az as Xt,bw as St,bs as bl,aW as C,aS as K,al as vt,aX as D,bx as on,by as dm,aT as Ut,j as jw,bz as Oi,aC as bu,a_ as rb,bA as bC,k as Cs,n as kg,M as Mg,m as hl,o as aC,bB as SC,A as AC,_ as _g,t as sI,w as zg,S as Sg,u as cC,b5 as lT,bC as _i,c8 as ob,c0 as Rg,b$ as UC,x as jg,y as MC,N as NC,c9 as Pf}from'./main-YYHD6X7H.js';var ae=["switch"],ie=["*"];function ne(a,s){a&1&&(Cs(0,"span",11),Pf(),Cs(1,"svg",13),Mg(2,"path",14),hl(),Cs(3,"svg",15),Mg(4,"path",16),hl()());}var ce=new C("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:false,hideIcon:false,disabledInteractive:false})}),b=class{source;checked;constructor(s,e){this.source=s,this.checked=e;}},se=(()=>{class a{_elementRef=g(Xt);_focusMonitor=g(St);_changeDetectorRef=g(bl);defaults=g(ce);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=false;_createChangeEvent(e){return new b(this,e)}_labelId;get buttonId(){return `${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus();}_noopAnimations=K();_focused=false;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required=false;color;disabled=false;disableRipple=false;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck();}hideIcon;disabledInteractive;change=new vt;toggleChange=new vt;get inputId(){return `${this.id||this._uniqueId}-input`}constructor(){g(D).load(on);let e=g(new dm("tabindex"),{optional:true}),i=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=i.color||"accent",this.id=this._uniqueId=g(Ut).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??false,this.disabledInteractive=i.disabledInteractive??false,this._labelId=this._uniqueId+"-label";}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,true).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=true,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=false,this._onTouched(),this._changeDetectorRef.markForCheck();});});}ngOnChanges(e){e.required&&this._validatorOnChange();}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef);}writeValue(e){this.checked=!!e;}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}validate(e){return this.required&&e.value!==true?{required:true}:null}registerOnValidatorChange(e){this._validatorOnChange=e;}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck();}toggle(){this.checked=!this.checked,this._onChange(this.checked);}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked));}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new b(this,this.checked))));}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=jw({type:a,selectors:[["mat-slide-toggle"]],viewQuery:function(i,t){if(i&1&&jg(ae,5),i&2){let r;MC(r=NC())&&(t._switchElement=r.first);}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,t){i&2&&(Rg("id",t.id),Sg("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),UC(t.color?"mat-"+t.color:""),zg("mat-mdc-slide-toggle-focused",t._focused)("mat-mdc-slide-toggle-checked",t.checked)("_mat-animation-noopable",t._noopAnimations));},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",rb],color:"color",disabled:[2,"disabled","disabled",rb],disableRipple:[2,"disableRipple","disableRipple",rb],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:ob(e)],checked:[2,"checked","checked",rb],hideIcon:[2,"hideIcon","hideIcon",rb],disabledInteractive:[2,"disabledInteractive","disabledInteractive",rb]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[lT([{provide:D$1,useExisting:_i(()=>a),multi:true},{provide:y,useExisting:a,multi:true}]),bu],ngContentSelectors:ie,decls:14,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mat-mdc-slide-toggle-touch-target"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,t){if(i&1&&(bC(),Cs(0,"div",1)(1,"button",2,0),kg("click",function(){return t._handleClick()}),Mg(3,"div",3)(4,"span",4),Cs(5,"span",5)(6,"span",6)(7,"span",7),Mg(8,"span",8),hl(),Cs(9,"span",9),Mg(10,"span",10),hl(),aC(11,ne,5,0,"span",11),hl()()(),Cs(12,"label",12),kg("click",function(ee){return ee.stopPropagation()}),SC(13),hl()()),i&2){let r=AC(2);_g("labelPosition",t.labelPosition),sI(),zg("mdc-switch--selected",t.checked)("mdc-switch--unselected",!t.checked)("mdc-switch--checked",t.checked)("mdc-switch--disabled",t.disabled)("mat-mdc-slide-toggle-disabled-interactive",t.disabledInteractive),_g("tabIndex",t.disabled&&!t.disabledInteractive?-1:t.tabIndex)("disabled",t.disabled&&!t.disabledInteractive),Sg("id",t.buttonId)("name",t.name)("aria-label",t.ariaLabel)("aria-labelledby",t._getAriaLabelledBy())("aria-describedby",t.ariaDescribedby)("aria-required",t.required||null)("aria-checked",t.checked)("aria-disabled",t.disabled&&t.disabledInteractive?"true":null),sI(9),_g("matRippleTrigger",r)("matRippleDisabled",t.disableRipple||t.disabled)("matRippleCentered",true),sI(),cC(t.hideIcon?-1:11),sI(),_g("for",t.buttonId),Sg("id",t._labelId);}},dependencies:[Oi,Qe],styles:[`.mdc-switch {
|
|
2
2
|
align-items: center;
|
|
3
3
|
background: none;
|
|
4
4
|
border: none;
|
|
@@ -426,4 +426,4 @@ import {b as Qe}from'./chunk-DjMtxVWg.js';import {D as D$1,i as y}from'./chunk-B
|
|
|
426
426
|
right: 50%;
|
|
427
427
|
transform: translate(50%, -50%);
|
|
428
428
|
}
|
|
429
|
-
`],encapsulation:2})}return a})(),ke=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=
|
|
429
|
+
`],encapsulation:2})}return a})(),ke=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=wo({type:a});static \u0275inj=Zn({imports:[se,wt]})}return a})();var W=class a{http=g(gy);getUserConfig(){return this.http.get("/api/config/user").pipe(Fd(s=>console.log("[CONFIG-API] User config retrieved:",s)))}updateUserConfig(s){return this.http.put("/api/config/user",s).pipe(Fd(e=>console.log("[CONFIG-API] User config updated:",e)))}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};export{W,ke as k,se as s};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {cN as kn,z as z$1,a as P,aW as C$1,aL as wo,aM as Zn$1,aZ as Bs,dp as ge,aR as Ps,az as Xt$1,cT as qp,al as vt$1,bL as pe,g,cX as yr,C as Ce$1,bs as bl,c2 as PE,a_ as rb,T as TT,W as Wi,an as ue$1,$ as $y,r as re$1,dq as Mt$1,bF as J$1,cd as $f,cD as Te,dr as Io,ds as Ke$1,bC as _i,cV as Eg,b5 as lT,n as kg,aC as bu,S as Sg,w as zg,dt as zw,du as m,dv as _e$1,by as dm,aA as an$1,j as jw,bA as bC,bB as SC,b$ as UC,dw as ke,dx as vn$1,I as br,bU as Fd,bh as Gy,a7 as va,dy as hi,dz as Ta,dA as b,B as gy,aV as U$1,K as x,aO as wt$2,aI as RS}from'./main-YYHD6X7H.js';var Xe=(()=>{class n{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,i){this._renderer=e,this._elementRef=i;}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i);}registerOnTouched(e){this.onTouched=e;}registerOnChange(e){this.onChange=e;}setDisabledState(e){this.setProperty("disabled",e);}static \u0275fac=function(i){return new(i||n)(ge(Ps),ge(Xt$1))};static \u0275dir=Bs({type:n})}return n})(),S=(()=>{class n extends Xe{static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,features:[Eg]})}return n})(),D=new C$1(""),Ft={provide:D,useExisting:_i(()=>wt$1),multi:true},wt$1=(()=>{class n extends S{writeValue(e){this.setProperty("checked",e);}static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,selectors:[["input","type","checkbox","formControlName","",3,"ngNoCva",""],["input","type","checkbox","formControl","",3,"ngNoCva",""],["input","type","checkbox","ngModel","",3,"ngNoCva",""]],hostBindings:function(i,r){i&1&&kg("change",function(a){return r.onChange(a.target.checked)})("blur",function(){return r.onTouched()});},standalone:false,features:[lT([Ft]),Eg]})}return n})(),Nt={provide:D,useExisting:_i(()=>Ye),multi:true};function St(){let n=Mt$1()?Mt$1().getUserAgent():"";return /android (\d+)/.test(n.toLowerCase())}var It=new C$1(""),Ye=(()=>{class n extends Xe{_compositionMode;_composing=false;constructor(e,i,r){super(e,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!St());}writeValue(e){let i=e??"";this.setProperty("value",i);}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e);}_compositionStart(){this._composing=true;}_compositionEnd(e){this._composing=false,this._compositionMode&&this.onChange(e);}static \u0275fac=function(i){return new(i||n)(ge(Ps),ge(Xt$1),ge(It,8))};static \u0275dir=Bs({type:n,selectors:[["input","formControlName","",3,"type","checkbox",3,"ngNoCva",""],["textarea","formControlName","",3,"ngNoCva",""],["input","formControl","",3,"type","checkbox",3,"ngNoCva",""],["textarea","formControl","",3,"ngNoCva",""],["input","ngModel","",3,"type","checkbox",3,"ngNoCva",""],["textarea","ngModel","",3,"ngNoCva",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&kg("input",function(a){return r._handleInput(a.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(a){return r._compositionEnd(a.target.value)});},standalone:false,features:[lT([Nt]),Eg]})}return n})();function Ve(n){return n==null||De(n)===0}function De(n){return n==null?null:Array.isArray(n)||typeof n=="string"?n.length:n instanceof Set?n.size:null}var y=new C$1(""),I=new C$1(""),Ot=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,_e=class{static min(t){return Ke(t)}static max(t){return Je(t)}static required(t){return Qe(t)}static requiredTrue(t){return xt(t)}static email(t){return Rt(t)}static minLength(t){return Pt(t)}static maxLength(t){return et$1(t)}static pattern(t){return kt(t)}static nullValidator(t){return te()}static compose(t){return ot$1(t)}static composeAsync(t){return at(t)}};function Ke(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return !isNaN(e)&&e<n?{min:{min:n,actual:t.value}}:null}}function Je(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return !isNaN(e)&&e>n?{max:{max:n,actual:t.value}}:null}}function Qe(n){return Ve(n.value)?{required:true}:null}function xt(n){return n.value===true?null:{required:true}}function Rt(n){return Ve(n.value)||Ot.test(n.value)?null:{email:true}}function Pt(n){return t=>{let e=t.value?.length??De(t.value);return e===null||e===0?null:e<n?{minlength:{requiredLength:n,actualLength:e}}:null}}function et$1(n){return t=>{let e=t.value?.length??De(t.value);return e!==null&&e>n?{maxlength:{requiredLength:n,actualLength:e}}:null}}function kt(n){if(!n)return te;let t,e;return typeof n=="string"?(e="",n.charAt(0)!=="^"&&(e+="^"),e+=n,n.charAt(n.length-1)!=="$"&&(e+="$"),t=new RegExp(e)):(e=n.toString(),t=n),i=>{if(Ve(i.value))return null;let r=i.value;return t.test(r)?null:{pattern:{requiredPattern:e,actualValue:r}}}}function te(n){return null}function tt$1(n){return n!=null}function nt$1(n){return Io(n)?Ke$1(n):n}function it(n){let t={};return n.forEach(e=>{t=e!=null?P(P({},t),e):t;}),Object.keys(t).length===0?null:t}function rt$1(n,t){return t.map(e=>e(n))}function Tt(n){return !n.validate}function st(n){return n.map(t=>Tt(t)?t:e=>t.validate(e))}function ot$1(n){if(!n)return null;let t=n.filter(tt$1);return t.length==0?null:function(e){return it(rt$1(e,t))}}function be(n){return n!=null?ot$1(st(n)):null}function at(n){if(!n)return null;let t=n.filter(tt$1);return t.length==0?null:function(e){let i=rt$1(e,t).map(nt$1);return $y(i).pipe(re$1(it))}}function Ae(n){return n!=null?at(st(n)):null}function Ue(n,t){return n===null?[t]:Array.isArray(n)?[...n,t]:[n,t]}function lt(n){return n._rawValidators}function ut(n){return n._rawAsyncValidators}function ye(n){return n?Array.isArray(n)?n:[n]:[]}function ne(n,t){return Array.isArray(n)?n.includes(t):n===t}function He(n,t){let e=ye(t);return ye(n).forEach(r=>{ne(e,r)||e.push(r);}),e}function Le(n,t){return ye(t).filter(e=>!ne(n,e))}var ie=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=be(this._rawValidators);}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=Ae(this._rawAsyncValidators);}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t);}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[];}reset(t=void 0){this.control?.reset(t);}hasError(t,e){return this.control?this.control.hasError(t,e):false}getError(t,e){return this.control?this.control.getError(t,e):null}},h=class extends ie{name;get formDirective(){return null}get path(){return null}};var U="VALID",ee="INVALID",k="PENDING",H="DISABLED",E=class{},re=class extends E{value;source;constructor(t,e){super(),this.value=t,this.source=e;}},W=class extends E{pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e;}},q$1=class q extends E{touched;source;constructor(t,e){super(),this.touched=t,this.source=e;}},T=class extends E{status;source;constructor(t,e){super(),this.status=t,this.source=e;}},se=class extends E{source;constructor(t){super(),this.source=t;}},N=class extends E{source;constructor(t){super(),this.source=t;}};function Me(n){return (ce(n)?n.validators:n)||null}function jt(n){return Array.isArray(n)?be(n):n||null}function Ee(n,t){return (ce(t)?t.asyncValidators:n)||null}function Bt(n){return Array.isArray(n)?Ae(n):n||null}function ce(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function dt(n,t,e){let i=n.controls;if(!(t?Object.keys(i):i).length)throw new m(1e3,"");if(!ht(i,e))throw new m(1001,"")}function ct(n,t,e){n._forEachChild((i,r)=>{if(e[r]===void 0)throw new m(-1002,"")});}var $=class{_pendingDirty=false;_hasOwnPendingAsyncValidator=null;_pendingTouched=false;_onCollectionChange=()=>{};_updateOn;_hasRequired=Wi(false);_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e);}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t,this._updateHasRequiredValidator();}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t;}get parent(){return this._parent}get status(){return kn(this.statusReactive)}set status(t){kn(()=>this.statusReactive.set(t));}_status=TT(()=>this.statusReactive());statusReactive=Wi(void 0);get valid(){return this.status===U}get invalid(){return this.status===ee}get pending(){return this.status===k}get disabled(){return this.status===H}get enabled(){return this.status!==H}errors;get pristine(){return kn(this.pristineReactive)}set pristine(t){kn(()=>this.pristineReactive.set(t));}_pristine=TT(()=>this.pristineReactive());pristineReactive=Wi(true);get dirty(){return !this.pristine}get touched(){return kn(this.touchedReactive)}set touched(t){kn(()=>this.touchedReactive.set(t));}_touched=TT(()=>this.touchedReactive());touchedReactive=Wi(false);get untouched(){return !this.touched}_events=new ue$1;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t);}setAsyncValidators(t){this._assignAsyncValidators(t);}addValidators(t){this.setValidators(He(t,this._rawValidators));}addAsyncValidators(t){this.setAsyncValidators(He(t,this._rawAsyncValidators));}removeValidators(t){this.setValidators(Le(t,this._rawValidators));}removeAsyncValidators(t){this.setAsyncValidators(Le(t,this._rawAsyncValidators));}hasValidator(t){return ne(this._rawValidators,t)}hasAsyncValidator(t){return ne(this._rawAsyncValidators,t)}clearValidators(){this.validator=null;}clearAsyncValidators(){this.asyncValidator=null;}markAsTouched(t={}){let e=this.touched===false;this.touched=true;let i=t.sourceControl??this;t.onlySelf||this._parent?.markAsTouched(z$1(P({},t),{sourceControl:i})),e&&t.emitEvent!==false&&this._events.next(new q$1(true,i));}markAllAsDirty(t={}){this.markAsDirty({onlySelf:true,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(t));}markAllAsTouched(t={}){this.markAsTouched({onlySelf:true,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t));}markAsUntouched(t={}){let e=this.touched===true;this.touched=false,this._pendingTouched=false;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:true,emitEvent:t.emitEvent,sourceControl:i});}),t.onlySelf||this._parent?._updateTouched(t,i),e&&t.emitEvent!==false&&this._events.next(new q$1(false,i));}markAsDirty(t={}){let e=this.pristine===true;this.pristine=false;let i=t.sourceControl??this;t.onlySelf||this._parent?.markAsDirty(z$1(P({},t),{sourceControl:i})),e&&t.emitEvent!==false&&this._events.next(new W(false,i));}markAsPristine(t={}){let e=this.pristine===false;this.pristine=true,this._pendingDirty=false;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:true,emitEvent:t.emitEvent});}),t.onlySelf||this._parent?._updatePristine(t,i),e&&t.emitEvent!==false&&this._events.next(new W(true,i));}markAsPending(t={}){this.status=k;let e=t.sourceControl??this;t.emitEvent!==false&&(this._events.next(new T(this.status,e)),this.statusChanges.emit(this.status)),t.onlySelf||this._parent?.markAsPending(z$1(P({},t),{sourceControl:e}));}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=H,this.errors=null,this._forEachChild(r=>{r.disable(z$1(P({},t),{onlySelf:true}));}),this._updateValue();let i=t.sourceControl??this;t.emitEvent!==false&&(this._events.next(new re(this.value,i)),this._events.next(new T(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(z$1(P({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(r=>r(true));}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=U,this._forEachChild(i=>{i.enable(z$1(P({},t),{onlySelf:true}));}),this.updateValueAndValidity({onlySelf:true,emitEvent:t.emitEvent}),this._updateAncestors(z$1(P({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(false));}_updateAncestors(t,e){t.onlySelf||(this._parent?.updateValueAndValidity(t),t.skipPristineCheck||this._parent?._updatePristine({},e),this._parent?._updateTouched({},e));}setParent(t){this._parent=t;}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===U||this.status===k)&&this._runAsyncValidator(i,t.emitEvent);}let e=t.sourceControl??this;t.emitEvent!==false&&(this._events.next(new re(this.value,e)),this._events.next(new T(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),t.onlySelf||this._parent?.updateValueAndValidity(z$1(P({},t),{sourceControl:e}));}_updateTreeValidity(t={emitEvent:true}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:true,emitEvent:t.emitEvent});}_setInitialStatus(){this.status=this._allControlsDisabled()?H:U;}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=k,this._hasOwnPendingAsyncValidator={emitEvent:e!==false,shouldHaveEmitted:t!==false};let i=nt$1(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:e,shouldHaveEmitted:t});});}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??false;return this._hasOwnPendingAsyncValidator=null,t}return false}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==false,this,e.shouldHaveEmitted);}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((i,r)=>i&&i._find(r),this)}getError(t,e){let i=e?this.get(e):this;return i?.errors?i.errors[t]:null}hasError(t,e){return !!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,i){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||i)&&this._events.next(new T(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,i);}_initObservables(){this.valueChanges=new vt$1,this.statusChanges=new vt$1;}_calculateStatus(){return this._allControlsDisabled()?H:this.errors?ee:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(k)?k:this._anyControlsHaveStatus(ee)?ee:U}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,t.onlySelf||this._parent?._updatePristine(t,e),r&&this._events.next(new W(this.pristine,e));}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new q$1(this.touched,e)),t.onlySelf||this._parent?._updateTouched(t,e);}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t;}_setUpdateStrategy(t){ce(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn);}_parentMarkedDirty(t){return !t&&!!this._parent?.dirty&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=jt(this._rawValidators),this._updateHasRequiredValidator();}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=Bt(this._rawAsyncValidators);}_updateHasRequiredValidator(){kn(()=>this._hasRequired.set(this.hasValidator(_e.required)));}};function ht(n,t){return Object.hasOwn(n,t)}function Gt(n){return n.tagName==="INPUT"||n.tagName==="SELECT"||n.tagName==="TEXTAREA"}function Ut(n,t,e,i){switch(e){case "name":n.setAttribute(t,e,i);break;case "disabled":case "readonly":case "required":i?n.setAttribute(t,e,""):n.removeAttribute(t,e);break;case "max":case "min":case "minLength":case "maxLength":i!==void 0?n.setAttribute(t,e,i.toString()):n.removeAttribute(t,e);break}}var Ce=class{kind;context;control;message;constructor({kind:t,context:e,control:i}){this.kind=t,this.context=e,this.control=i;}};function Ht(n){return typeof n=="number"?n:parseInt(n,10)}function ft(n){return typeof n=="number"?n:parseFloat(n)}var he=(()=>{class n{_validator=te;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){let i=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(i),this._validator=this._enabled?this.createValidator(i):te,this._onChange?.();}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e;}enabled(e){return e!=null}static \u0275fac=function(i){return new(i||n)};static \u0275dir=Bs({type:n,features:[bu]})}return n})(),Lt={provide:y,useExisting:_i(()=>Wt),multi:true},Wt=(()=>{class n extends he{max;inputName="max";normalizeInput=e=>ft(e);createValidator=e=>Je(e);static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&Sg("max",r._enabled?r.max:null);},inputs:{max:"max"},standalone:false,features:[lT([Lt]),Eg]})}return n})(),qt={provide:y,useExisting:_i(()=>$t),multi:true},$t=(()=>{class n extends he{min;inputName="min";normalizeInput=e=>ft(e);createValidator=e=>Ke(e);static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&Sg("min",r._enabled?r.min:null);},inputs:{min:"min"},standalone:false,features:[lT([qt]),Eg]})}return n})(),zt={provide:y,useExisting:_i(()=>gt),multi:true};var gt=(()=>{class n extends he{required;inputName="required";normalizeInput=rb;createValidator=e=>Qe;enabled(e){return e}static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(i,r){i&2&&Sg("required",r._enabled?"":null);},inputs:{required:"required"},standalone:false,features:[lT([zt]),Eg]})}return n})();var Zt={provide:y,useExisting:_i(()=>Xt),multi:true},Xt=(()=>{class n extends he{maxlength;inputName="maxlength";normalizeInput=e=>Ht(e);createValidator=e=>et$1(e);static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&Sg("maxlength",r._enabled?r.maxlength:null);},inputs:{maxlength:"maxlength"},standalone:false,features:[lT([Zt]),Eg]})}return n})();var Yt=new C$1(""),O=new C$1("",{factory:()=>Z$1}),Z$1="always";function fe(n,t){return [...t.path,n]}function oe(n,t,e=Z$1){Fe(n,t),t.valueAccessor.writeValue(n.value),(n.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(n.disabled),Jt(n,t),en(n,t),Qt(n,t),Kt(n,t);}function ae(n,t,e=true){let i=()=>{};t?.valueAccessor?.registerOnChange(i),t?.valueAccessor?.registerOnTouched(i),ue(n,t),n&&(t._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}));}function le(n,t){n.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t);});}function Kt(n,t){if(t.valueAccessor.setDisabledState){let e=i=>{t.valueAccessor.setDisabledState(i);};n.registerOnDisabledChange(e),t._registerOnDestroy(()=>{n._unregisterOnDisabledChange(e);});}}function Fe(n,t){let e=lt(n);t.validator!==null?n.setValidators(Ue(e,t.validator)):typeof e=="function"&&n.setValidators([e]);let i=ut(n);t.asyncValidator!==null?n.setAsyncValidators(Ue(i,t.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();le(t._rawValidators,r),le(t._rawAsyncValidators,r);}function ue(n,t){let e=false;if(n!==null){if(t.validator!==null){let r=lt(n);if(Array.isArray(r)&&r.length>0){let s=r.filter(a=>a!==t.validator);s.length!==r.length&&(e=true,n.setValidators(s));}}if(t.asyncValidator!==null){let r=ut(n);if(Array.isArray(r)&&r.length>0){let s=r.filter(a=>a!==t.asyncValidator);s.length!==r.length&&(e=true,n.setAsyncValidators(s));}}}let i=()=>{};return le(t._rawValidators,i),le(t._rawAsyncValidators,i),e}function Jt(n,t){t.valueAccessor.registerOnChange(e=>{n._pendingValue=e,n._pendingChange=true,n._pendingDirty=true,n.updateOn==="change"&&pt(n,t);});}function Qt(n,t){t.valueAccessor.registerOnTouched(()=>{n._pendingTouched=true,n.updateOn==="blur"&&n._pendingChange&&pt(n,t),n.updateOn!=="submit"&&n.markAsTouched();});}function pt(n,t){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:false}),t.viewToModelUpdate(n._pendingValue),n._pendingChange=false;}function en(n,t){let e=(i,r)=>{t.valueAccessor.writeValue(i),r&&t.viewToModelUpdate(i);};n.registerOnChange(e),t._registerOnDestroy(()=>{n._unregisterOnChange(e);});}function mt(n,t){Fe(n,t);}function tn(n,t){return ue(n,t)}function we(n,t){if(!n.hasOwnProperty("model"))return false;let e=n.model;return e.isFirstChange()?true:!Object.is(t,e.currentValue)}function nn(n){return Object.getPrototypeOf(n.constructor)===S}function vt(n,t){n._syncPendingControls(),t.forEach(e=>{let i=e.control;i.updateOn==="submit"&&i._pendingChange&&(e.viewToModelUpdate(i._pendingValue),i._pendingChange=false);});}function rn(n,t){if(!t)return null;let e,i,r;return t.forEach(s=>{s.constructor===Ye?e=s:nn(s)?i=s:r=s;}),r||i||e||null}function sn(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1);}var Ne={provide:Yt,useFactory:()=>{let n=g(_,{self:true});return {setParseErrors:t=>{n.setParseErrorSource(t);},set onReset(t){n.onReset=t;}}}},_=class extends ie{_parent=null;name=null;valueAccessor=null;isCustomControlBased=false;userOnReset;resetSubscription;set onReset(t){this.userOnReset=t,this.resetSubscription?.unsubscribe(),this.resetSubscription=void 0,this.control&&(this.resetSubscription=this.control.events.subscribe(e=>{e instanceof N&&this.control&&this.userOnReset?.(this.control.value);}),this.subscription?.add(this.resetSubscription));}isNativeFormElement=false;rawValueAccessors;_selectedValueAccessor=null;get selectedValueAccessor(){return this._selectedValueAccessor??=rn(this,this.rawValueAccessors)}parseErrorsValidator=null;renderer;injector;requiredValidatorViaDi;subscription;customControlBindings=null;constructor(t,e,i){super(),this.injector=t,this.renderer=e,this.rawValueAccessors=i,this.injector?.get(Ce$1)?.onDestroy(()=>{this.removeParseErrorsValidator(this.control),this.subscription?.unsubscribe();});}setupCustomControl(){this.subscription?.unsubscribe();let t=this.injector?.get(bl);if(!this.control||!t)return;let e=t.markForCheck.bind(t);this.subscription=new J$1,this.subscription.add(this.control.valueChanges.subscribe(e)),this.subscription.add(this.control.statusChanges.subscribe(e)),this.resetSubscription?.unsubscribe(),this.resetSubscription=void 0,this.userOnReset&&(this.resetSubscription=this.control.events.subscribe(i=>{i instanceof N&&this.control&&this.userOnReset?.(this.control.value);}),this.subscription.add(this.resetSubscription)),this.parseErrorsValidator&&this.control.addValidators(this.parseErrorsValidator);}ngControlCreate(t){!t.nativeElement.hasAttribute?.("ngNoCva")&&(this.rawValueAccessors&&this.rawValueAccessors.length>0||this.valueAccessor!==null)||!t.customControl||(this.isCustomControlBased=true,t.listenToCustomControlModel(r=>{this.control?.setValue(r,{emitModelToViewChange:false}),this.control?.markAsDirty(),this.viewToModelUpdate(r);}),t.listenToCustomControlOutput("touch",()=>{this.control?.markAsTouched();}),this.customControlBindings={},this.isNativeFormElement=Gt(t.nativeElement),this.requiredValidatorViaDi=this._rawValidators.find(r=>r instanceof gt));}ngControlUpdate(t,e){if(!this.isCustomControlBased)return;let i=this.control,r=this.customControlBindings;Object.is(r.value,i.value)||(r.value=i.value,t.setCustomControlModelInput(i.value)),this.bindControlProperty(t,r,"touched",i.touched),this.bindControlProperty(t,r,"dirty",i.dirty),this.bindControlProperty(t,r,"valid",i.valid),this.bindControlProperty(t,r,"invalid",i.invalid),this.bindControlProperty(t,r,"pending",i.pending),this.bindControlProperty(t,r,"disabled",i.disabled),this.shouldBindRequired&&this.bindControlProperty(t,r,"required",this.isRequired);let s=i.errors;if(r.errors!==s){r.errors=s;let a=this._convertErrors(s);t.setInputOnDirectives("errors",a);}}get isRequired(){return (this.requiredValidatorViaDi?._enabled||this.control?._hasRequired())??false}get shouldBindRequired(){return true}bindControlProperty(t,e,i,r){if(e[i]===r)return;e[i]=r;let s=t.setInputOnDirectives(i,r);this.isNativeFormElement&&!s&&(i==="disabled"||i==="required")&&this.renderer&&Ut(this.renderer,t.nativeElement,i,r);}_convertErrors(t){if(t===null)return [];let e=this.control;return Object.entries(t).map(([i,r])=>new Ce({context:r,kind:i,control:e}))}setParseErrorSource(t){if(t===void 0)return;let e=null,i=TT(()=>{let r=t();return r.length===0?null:r.reduce((s,a)=>(s[a.kind]=a,s),{})});this.parseErrorsValidator=(()=>e).bind(this),$f(()=>{e=i(),this.control?.updateValueAndValidity({emitEvent:false});},{injector:this.injector});}removeParseErrorsValidator(t){this.parseErrorsValidator&&(t?.removeValidators(this.parseErrorsValidator),t?.updateValueAndValidity({emitEvent:false}));}},de=class{_cd;constructor(t){this._cd=t;}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return !!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return !!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return !!this._cd?.control?.invalid}get isPending(){return !!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}};var Zn=(()=>{class n extends de{constructor(e){super(e);}static \u0275fac=function(i){return new(i||n)(ge(_,2))};static \u0275dir=Bs({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&zg("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending);},standalone:false,features:[Eg]})}return n})(),Xn=(()=>{class n extends de{constructor(e){super(e);}static \u0275fac=function(i){return new(i||n)(ge(h,10))};static \u0275dir=Bs({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["","formArray",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,r){i&2&&zg("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted);},standalone:false,features:[Eg]})}return n})(),z=class extends ${constructor(t,e,i){super(Me(e),Ee(i,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:true,emitEvent:!!this.asyncValidator});}controls;registerControl(t,e){let i=this._find(t);return i||(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,i={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange();}removeControl(t,e={}){let i=this._find(t);i&&i._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange();}setControl(t,e,i={}){let r=this._find(t);r&&r._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange();}contains(t){return this._find(t)?.enabled===true}setValue(t,e={}){kn(()=>{ct(this,true,t),Object.keys(t).forEach(i=>{dt(this,true,i),this.controls[i].setValue(t[i],{onlySelf:true,emitEvent:e.emitEvent});}),this.updateValueAndValidity(e);});}patchValue(t,e={}){t!=null&&(Object.keys(t).forEach(i=>{let r=this._find(i);r&&r.patchValue(t[i],{onlySelf:true,emitEvent:e.emitEvent});}),this.updateValueAndValidity(e));}reset(t={},e={}){this._forEachChild((i,r)=>{i.reset(t?t[r]:null,z$1(P({},e),{onlySelf:true}));}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==false&&this._events.next(new N(this));}getRawValue(){return this._reduceChildren({},(t,e,i)=>(t[i]=e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(false,(e,i)=>i._syncPendingControls()?true:e);return t&&this.updateValueAndValidity({onlySelf:true}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{let i=this.controls[e];i&&t(i,e);});}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange);});}_updateValue(){this.value=this._reduceValue();}_anyControls(t){for(let[e,i]of Object.entries(this.controls))if(this.contains(e)&&t(i))return true;return false}_reduceValue(){let t={};return this._reduceChildren(t,(e,i,r)=>((i.enabled||this.disabled)&&(e[r]=i.value),e))}_reduceChildren(t,e){let i=t;return this._forEachChild((r,s)=>{i=e(i,r,s);}),i}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return false;return Object.keys(this.controls).length>0||this.disabled}_find(t){return ht(this.controls,t)?this.controls[t]:null}};var Yn=z;var on={provide:h,useExisting:_i(()=>an)},L=Promise.resolve(),an=(()=>{class n extends h{callSetDisabledState;get submitted(){return kn(this.submittedReactive)}_submitted=TT(()=>this.submittedReactive());submittedReactive=Wi(false);_directives=new Set;form;ngSubmit=new vt$1;options;constructor(e,i,r){super(),this.callSetDisabledState=r,this.form=new z({},be(e),Ae(i));}ngAfterViewInit(){this._setUpdateStrategy();}get formDirective(){return this}get control(){return this.form}get path(){return []}get controls(){return this.form.controls}addControl(e){L.then(()=>{let i=this._findContainer(e.path);e.control=i.registerControl(e.name,e.control),e._setupWithForm(this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:false}),this._directives.add(e);});}getControl(e){return this.form.get(e.path)}removeControl(e){L.then(()=>{this._findContainer(e.path)?.removeControl(e.name),this._directives.delete(e);});}addFormGroup(e){L.then(()=>{let i=this._findContainer(e.path),r=new z({});mt(r,e),i.registerControl(e.name,r),r.updateValueAndValidity({emitEvent:false});});}removeFormGroup(e){L.then(()=>{this._findContainer(e.path)?.removeControl?.(e.name);});}getFormGroup(e){return this.form.get(e.path)}updateModel(e,i){L.then(()=>{this.form.get(e.path).setValue(i);});}setValue(e){this.control.setValue(e);}onSubmit(e){return this.submittedReactive.set(true),vt(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new se(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm();}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(false);}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn);}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(i){return new(i||n)(ge(y,10),ge(I,10),ge(O,8))};static \u0275dir=Bs({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup","",3,"formArray",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,r){i&1&&kg("submit",function(a){return r.onSubmit(a)})("reset",function(){return r.onReset()});},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:false,features:[lT([on]),Eg]})}return n})();function We(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1);}function qe(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var _t=class extends ${defaultValue=null;_onChange=[];_pendingValue;_pendingChange=false;constructor(t=null,e,i){super(Me(e),Ee(i,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:true,emitEvent:!!this.asyncValidator}),ce(e)&&(e.nonNullable||e.initialValueIsDefault)&&(qe(t)?this.defaultValue=t.value:this.defaultValue=t);}setValue(t,e={}){kn(()=>{this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==false&&this._onChange.forEach(i=>i(this.value,e.emitViewToModelChange!==false)),this.updateValueAndValidity(e);});}patchValue(t,e={}){this.setValue(t,e);}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),e.overwriteDefaultValue&&(this.defaultValue=this.value),this._pendingChange=false,e?.emitEvent!==false&&this._events.next(new N(this));}_updateValue(){}_anyControls(t){return false}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t);}_unregisterOnChange(t){We(this._onChange,t);}registerOnDisabledChange(t){this._onDisabledChange.push(t);}_unregisterOnDisabledChange(t){We(this._onDisabledChange,t);}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:true,emitModelToViewChange:false}),true):false}_applyFormState(t){qe(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:true,emitEvent:false}):this.enable({onlySelf:true,emitEvent:false})):this.value=this._pendingValue=t;}};var ln=n=>n instanceof _t,un=(()=>{class n extends h{_parent;ngOnInit(){this._checkParentType(),this.formDirective.addFormGroup(this);}ngOnDestroy(){this.formDirective?.removeFormGroup(this);}get control(){return this.formDirective.getFormGroup(this)}get path(){return fe(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_checkParentType(){}static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,standalone:false,features:[Eg]})}return n})();var dn={provide:_,useExisting:_i(()=>cn)},$e=Promise.resolve(),cn=(()=>{class n extends _{_changeDetectorRef;callSetDisabledState;control=new _t;static ngAcceptInputType_isDisabled;_registered=false;viewModel;name="";isDisabled;model;options;update=new vt$1;constructor(e,i,r,s,a,f,C,j){super(C,j,s),this._changeDetectorRef=a,this.callSetDisabledState=f,this._parent=e,this._setValidators(i),this._setAsyncValidators(r);}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let i=e.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)});}this._setUpControl();}"isDisabled"in e&&this._updateDisabled(e),we(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model);}ngOnDestroy(){this.formDirective?.removeControl(this);}\u0275ngControlCreate(e){super.ngControlCreate(e);}\u0275ngControlUpdate(e){super.ngControlUpdate(e,false);}get shouldBindRequired(){return false}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e);}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=true;}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn);}_isStandalone(){return !this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){this.isCustomControlBased?this.setupCustomControl():(this.valueAccessor??=this.selectedValueAccessor,oe(this.control,this,this.callSetDisabledState)),this.control.updateValueAndValidity({emitEvent:false});}_setupWithForm(e){this.isCustomControlBased?this.setupCustomControl():(this.valueAccessor??=this.selectedValueAccessor,oe(this.control,this,e));}_checkForErrors(){this._checkName();}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name;}_updateValue(e){$e.then(()=>{this.control.setValue(e,{emitViewToModelChange:false}),this._changeDetectorRef?.markForCheck();});}_updateDisabled(e){let i=e.isDisabled.currentValue,r=i!==0&&rb(i);$e.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck();});}_getPath(e){return this._parent?fe(e,this._parent):[e]}static \u0275fac=function(i){return new(i||n)(ge(h,9),ge(y,10),ge(I,10),ge(D,10),ge(bl,8),ge(O,8),ge(pe,8),ge(Ps,8))};static \u0275dir=Bs({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:false,features:[lT([dn,Ne]),Eg,bu,zw(null)]})}return n})();var Jn=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=Bs({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:false})}return n})(),hn={provide:D,useExisting:_i(()=>fn),multi:true},fn=(()=>{class n extends S{writeValue(e){let i=e??"";this.setProperty("value",i);}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i));};}static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,selectors:[["input","type","number","formControlName","",3,"ngNoCva",""],["input","type","number","formControl","",3,"ngNoCva",""],["input","type","number","ngModel","",3,"ngNoCva",""]],hostBindings:function(i,r){i&1&&kg("input",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()});},standalone:false,features:[lT([hn]),Eg]})}return n})(),gn={provide:D,useExisting:_i(()=>mn),multi:true};var pn=(()=>{class n{_accessors=[];add(e,i){this._accessors.push([e,i]);}remove(e){for(let i=this._accessors.length-1;i>=0;--i)if(this._accessors[i][1]===e){this._accessors.splice(i,1);return}}select(e){this._accessors.forEach(i=>{this._isSameGroup(i,e)&&i[1]!==e&&i[1].fireUncheck(e.value);});}_isSameGroup(e,i){return e[0].control?e[0]._parent===i._control._parent&&e[1].name===i.name:false}static \u0275fac=function(i){return new(i||n)};static \u0275prov=Te({token:n,factory:n.\u0275fac})}return n})(),mn=(()=>{class n extends S{_registry;_injector;_state;_control;_fn;setDisabledStateFired=false;onChange=()=>{};name;formControlName;value;callSetDisabledState=g(O,{optional:true})??Z$1;constructor(e,i,r,s){super(e,i),this._registry=r,this._injector=s;}ngOnInit(){this._control=this._injector.get(_),this._checkName(),this._registry.add(this._control,this);}ngOnDestroy(){this._registry.remove(this);}writeValue(e){this._state=e===this.value,this.setProperty("checked",this._state);}registerOnChange(e){this._fn=e,this.onChange=()=>{e(this.value),this._registry.select(this);};}setDisabledState(e){(this.setDisabledStateFired||e||this.callSetDisabledState==="whenDisabledForLegacyCode")&&this.setProperty("disabled",e),this.setDisabledStateFired=true;}fireUncheck(e){this.writeValue(e);}_checkName(){this.name&&this.formControlName&&(this.name,this.formControlName),!this.name&&this.formControlName&&(this.name=this.formControlName);}static \u0275fac=function(i){return new(i||n)(ge(Ps),ge(Xt$1),ge(pn),ge(pe))};static \u0275dir=Bs({type:n,selectors:[["input","type","radio","formControlName","",3,"ngNoCva",""],["input","type","radio","formControl","",3,"ngNoCva",""],["input","type","radio","ngModel","",3,"ngNoCva",""]],hostBindings:function(i,r){i&1&&kg("change",function(){return r.onChange()})("blur",function(){return r.onTouched()});},inputs:{name:"name",formControlName:"formControlName",value:"value"},standalone:false,features:[lT([gn]),Eg]})}return n})(),vn={provide:D,useExisting:_i(()=>_n),multi:true},_n=(()=>{class n extends S{writeValue(e){this.setProperty("value",parseFloat(e));}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i));};}static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,selectors:[["input","type","range","formControlName","",3,"ngNoCva",""],["input","type","range","formControl","",3,"ngNoCva",""],["input","type","range","ngModel","",3,"ngNoCva",""]],hostBindings:function(i,r){i&1&&kg("change",function(a){return r.onChange(a.target.value)})("input",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()});},standalone:false,features:[lT([vn]),Eg]})}return n})(),ze=class extends ${constructor(t,e,i){super(Me(e),Ee(i,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:true,emitEvent:!!this.asyncValidator});}controls;at(t){return this.controls[this._adjustIndex(t)]}push(t,e={}){Array.isArray(t)?t.forEach(i=>{this.controls.push(i),this._registerControl(i);}):(this.controls.push(t),this._registerControl(t)),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange();}insert(t,e,i={}){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity({emitEvent:i.emitEvent});}removeAt(t,e={}){let i=this._adjustIndex(t);i<0&&(i=0),this.controls[i]&&this.controls[i]._registerOnCollectionChange(()=>{}),this.controls.splice(i,1),this.updateValueAndValidity({emitEvent:e.emitEvent});}setControl(t,e,i={}){let r=this._adjustIndex(t);r<0&&(r=0),this.controls[r]&&this.controls[r]._registerOnCollectionChange(()=>{}),this.controls.splice(r,1),e&&(this.controls.splice(r,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange();}get length(){return this.controls.length}setValue(t,e={}){kn(()=>{ct(this,false,t),t.forEach((i,r)=>{dt(this,false,r),this.at(r).setValue(i,{onlySelf:true,emitEvent:e.emitEvent});}),this.updateValueAndValidity(e);});}patchValue(t,e={}){t!=null&&(t.forEach((i,r)=>{this.at(r)&&this.at(r).patchValue(i,{onlySelf:true,emitEvent:e.emitEvent});}),this.updateValueAndValidity(e));}reset(t=[],e={}){this._forEachChild((i,r)=>{i.reset(t[r],z$1(P({},e),{onlySelf:true}));}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==false&&this._events.next(new N(this));}getRawValue(){return this.controls.map(t=>t.getRawValue())}clear(t={}){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:t.emitEvent}));}_adjustIndex(t){return t<0?t+this.length:t}_syncPendingControls(){let t=this.controls.reduce((e,i)=>i._syncPendingControls()?true:e,false);return t&&this.updateValueAndValidity({onlySelf:true}),t}_forEachChild(t){this.controls.forEach((e,i)=>{t(e,i);});}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value);}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t));}_allControlsDisabled(){for(let t of this.controls)if(t.enabled)return false;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange);}_find(t){return this.at(t)??null}};var yt$1=(()=>{class n extends h{callSetDisabledState;get submitted(){return kn(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e);}_submitted=TT(()=>this._submittedReactive());_submittedReactive=Wi(false);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];constructor(e,i,r){super(),this.callSetDisabledState=r,this._setValidators(e),this._setAsyncValidators(i);}ngOnChanges(e){this.onChanges(e);}ngOnDestroy(){this.onDestroy();}onChanges(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form);}onDestroy(){this.form&&(ue(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}));}get formDirective(){return this}get path(){return []}addControl(e){let i=this.form.get(e.path);return e._setupWithForm(i,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:false}),this.directives.push(e),i}getControl(e){return this.form.get(e.path)}removeControl(e){ae(e.control||null,e,false),sn(this.directives,e);}addFormGroup(e){this._setUpFormContainer(e);}removeFormGroup(e){this._cleanUpFormContainer(e);}getFormGroup(e){return this.form.get(e.path)}getFormArray(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e);}removeFormArray(e){this._cleanUpFormContainer(e);}updateModel(e,i){this.form.get(e.path).setValue(i);}onReset(){this.resetForm();}resetForm(e=void 0,i={}){this.form.reset(e,i),this._submittedReactive.set(false);}onSubmit(e){return this.submitted=true,vt(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new se(this.control)),e?.target?.method==="dialog"}_updateDomValue(){this.directives.forEach(e=>{let i=e.control,r=this.form.get(e.path);i!==r&&(ae(i||null,e),ln(r)&&e._setupWithForm(r,this.callSetDisabledState));}),this.form._updateTreeValidity({emitEvent:false});}_setUpFormContainer(e){let i=this.form.get(e.path);mt(i,e),i.updateValueAndValidity({emitEvent:false});}_cleanUpFormContainer(e){let i=this.form?.get(e.path);i&&tn(i,e)&&i.updateValueAndValidity({emitEvent:false});}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm?._registerOnCollectionChange(()=>{});}_updateValidators(){Fe(this.form,this),this._oldForm&&ue(this._oldForm,this);}_checkFormPresent(){this.form;}static \u0275fac=function(i){return new(i||n)(ge(y,10),ge(I,10),ge(O,8))};static \u0275dir=Bs({type:n,features:[Eg,bu]})}return n})();var Se=new C$1(""),yn={provide:_,useExisting:_i(()=>Cn)},Cn=(()=>{class n extends _{_ngModelWarningConfig;callSetDisabledState;viewModel;form;set isDisabled(e){}model;update=new vt$1;static _ngModelWarningSentOnce=false;_ngModelWarningSent=false;constructor(e,i,r,s,a,f,C){super(C,f,r),this._ngModelWarningConfig=s,this.callSetDisabledState=a,this._setValidators(e),this._setAsyncValidators(i);}ngOnChanges(e){if(this._isControlChanged(e)){let i=e.form.previousValue;i&&(ae(i,this,false),this.removeParseErrorsValidator(i)),this.isCustomControlBased?this.setupCustomControl():(this.valueAccessor??=this.selectedValueAccessor,oe(this.form,this,this.callSetDisabledState)),this.form.updateValueAndValidity({emitEvent:false});}we(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model);}ngOnDestroy(){this.form&&ae(this.form,this,false);}get path(){return []}get control(){return this.form}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e);}_isControlChanged(e){return e.hasOwnProperty("form")}\u0275ngControlCreate(e){super.ngControlCreate(e);}\u0275ngControlUpdate(e){super.ngControlUpdate(e,true);}static \u0275fac=function(i){return new(i||n)(ge(y,10),ge(I,10),ge(D,10),ge(Se,8),ge(O,8),ge(Ps,8),ge(pe,8))};static \u0275dir=Bs({type:n,selectors:[["","formControl",""]],inputs:{form:[0,"formControl","form"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],standalone:false,features:[lT([yn,Ne]),Eg,bu,zw(null)]})}return n})(),Vn={provide:h,useExisting:_i(()=>Ct)},Ct=(()=>{class n extends un{name=null;constructor(e,i,r){super(),this._parent=e,this._setValidators(i),this._setAsyncValidators(r);}_checkParentType(){Dt(this._parent);}static \u0275fac=function(i){return new(i||n)(ge(h,13),ge(y,10),ge(I,10))};static \u0275dir=Bs({type:n,selectors:[["","formGroupName",""]],inputs:{name:[0,"formGroupName","name"]},standalone:false,features:[lT([Vn]),Eg]})}return n})(),Dn={provide:h,useExisting:_i(()=>Vt)},Vt=(()=>{class n extends h{_parent;name=null;constructor(e,i,r){super(),this._parent=e,this._setValidators(i),this._setAsyncValidators(r);}ngOnInit(){Dt(this._parent),this.formDirective.addFormArray(this);}ngOnDestroy(){this.formDirective?.removeFormArray(this);}get control(){return this.formDirective.getFormArray(this)}get formDirective(){return this._parent?this._parent.formDirective:null}get path(){return fe(this.name==null?this.name:this.name.toString(),this._parent)}static \u0275fac=function(i){return new(i||n)(ge(h,13),ge(y,10),ge(I,10))};static \u0275dir=Bs({type:n,selectors:[["","formArrayName",""]],inputs:{name:[0,"formArrayName","name"]},standalone:false,features:[lT([Dn]),Eg]})}return n})();function Dt(n){return !(n instanceof Ct)&&!(n instanceof yt$1)&&!(n instanceof Vt)}var bn={provide:_,useExisting:_i(()=>An)},An=(()=>{class n extends _{_ngModelWarningConfig;_added=false;viewModel;control;name=null;set isDisabled(e){}model;update=new vt$1;static _ngModelWarningSentOnce=false;_ngModelWarningSent=false;constructor(e,i,r,s,a,f,C){super(C,f,s),this._ngModelWarningConfig=a,this._parent=e,this._setValidators(i),this._setAsyncValidators(r);}_setupWithForm(e,i){this.control=e,this.isCustomControlBased?this.setupCustomControl():(this.valueAccessor??=this.selectedValueAccessor,oe(e,this,i));}ngOnChanges(e){this._added||this._setUpControl(),we(e,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model));}ngOnDestroy(){this.formDirective?.removeControl(this);}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e);}get path(){return fe(this.name==null?this.name:this.name.toString(),this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}_setUpControl(){this.control=this.formDirective.addControl(this),this._added=true;}\u0275ngControlCreate(e){super.ngControlCreate(e);}\u0275ngControlUpdate(e){this.isCustomControlBased&&(this._added||this._setUpControl(),super.ngControlUpdate(e,true));}static \u0275fac=function(i){return new(i||n)(ge(h,13),ge(y,10),ge(I,10),ge(D,10),ge(Se,8),ge(Ps,8),ge(pe,8))};static \u0275dir=Bs({type:n,selectors:[["","formControlName",""]],inputs:{name:[0,"formControlName","name"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},standalone:false,features:[lT([bn,Ne]),Eg,bu,zw(null)]})}return n})();var Mn={provide:h,useExisting:_i(()=>En)},En=(()=>{class n extends yt$1{form=null;ngSubmit=new vt$1;get control(){return this.form}static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,selectors:[["","formGroup",""]],hostBindings:function(i,r){i&1&&kg("submit",function(a){return r.onSubmit(a)})("reset",function(){return r.onReset()});},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:false,features:[lT([Mn]),Eg]})}return n})(),Fn={provide:D,useExisting:_i(()=>At),multi:true};function bt(n,t){return n==null?`${t}`:(t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function wn(n){return n.split(":")[0]}var At=(()=>{class n extends S{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e;}_compareWith=Object.is;appRefInjector=g(yr).injector;destroyRef=g(Ce$1);cdr=g(bl);_queuedWrite=false;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=true,PE({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=false,this.writeValue(this.value));}},{injector:this.appRefInjector}));}writeValue(e){this.cdr.markForCheck(),this.value=e;let i=this._getOptionId(e),r=bt(i,e);this.setProperty("value",r);}registerOnChange(e){this.onChange=i=>{this.value=this._getOptionValue(i),e(this.value);};}_registerOption(){return (this._idCounter++).toString()}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),e))return i;return null}_getOptionValue(e){let i=wn(e);return this._optionMap.has(i)?this._optionMap.get(i):e}static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,selectors:[["select","formControlName","",3,"multiple","",3,"ngNoCva",""],["select","formControl","",3,"multiple","",3,"ngNoCva",""],["select","ngModel","",3,"multiple","",3,"ngNoCva",""]],hostBindings:function(i,r){i&1&&kg("change",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()});},inputs:{compareWith:"compareWith"},standalone:false,features:[lT([Fn]),Eg]})}return n})(),Qn=(()=>{class n{_element;_renderer;_select;id;constructor(e,i,r){this._element=e,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption());}set ngValue(e){this._select!=null&&(this._select._optionMap.set(this.id,e),this._setElementValue(bt(this.id,e)),this._select._writeValueAfterRender());}set value(e){this._setElementValue(e),this._select?._writeValueAfterRender();}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e);}ngOnDestroy(){this._select?._optionMap.delete(this.id),this._select?._writeValueAfterRender();}static \u0275fac=function(i){return new(i||n)(ge(Xt$1),ge(Ps),ge(At,9))};static \u0275dir=Bs({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:false})}return n})(),Nn={provide:D,useExisting:_i(()=>Mt),multi:true};function Ze(n,t){return n==null?`${t}`:(typeof t=="string"&&(t=`'${t}'`),t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function Sn(n){return n.split(":")[0]}var Mt=(()=>{class n extends S{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e;}_compareWith=Object.is;writeValue(e){this.value=e;let i;if(Array.isArray(e)){let r=e.map(s=>this._getOptionId(s));i=(s,a)=>{s._setSelected(r.indexOf(a)>-1);};}else i=r=>{r._setSelected(false);};this._optionMap.forEach(i);}registerOnChange(e){this.onChange=i=>{let r=[],s=i.selectedOptions;if(s!==void 0){let a=s;for(let f=0;f<a.length;f++){let C=a[f],j=this._getOptionValue(C.value);r.push(j);}}else {let a=i.options;for(let f=0;f<a.length;f++){let C=a[f];if(C.selected){let j=this._getOptionValue(C.value);r.push(j);}}}this.value=r,e(r);};}_registerOption(e){let i=(this._idCounter++).toString();return this._optionMap.set(i,e),i}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,e))return i;return null}_getOptionValue(e){let i=Sn(e);return this._optionMap.has(i)?this._optionMap.get(i)._value:e}static \u0275fac=(()=>{let e;return function(r){return (e||(e=qp(n)))(r||n)}})();static \u0275dir=Bs({type:n,selectors:[["select","multiple","","formControlName","",3,"ngNoCva",""],["select","multiple","","formControl","",3,"ngNoCva",""],["select","multiple","","ngModel","",3,"ngNoCva",""]],hostBindings:function(i,r){i&1&&kg("change",function(a){return r.onChange(a.target)})("blur",function(){return r.onTouched()});},inputs:{compareWith:"compareWith"},standalone:false,features:[lT([Nn]),Eg]})}return n})(),ei=(()=>{class n{_element;_renderer;_select;id;_value;constructor(e,i,r){this._element=e,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption(this));}set ngValue(e){this._select!=null&&(this._value=e,this._setElementValue(Ze(this.id,e)),this._select.writeValue(this._select.value));}set value(e){this._select?(this._value=e,this._setElementValue(Ze(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e);}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e);}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e);}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value));}static \u0275fac=function(i){return new(i||n)(ge(Xt$1),ge(Ps),ge(Mt,9))};static \u0275dir=Bs({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:false})}return n})();var Et=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=wo({type:n});static \u0275inj=Zn$1({})}return n})();var ti=(()=>{class n{static withConfig(e){return {ngModule:n,providers:[{provide:O,useValue:e.callSetDisabledState??Z$1}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=wo({type:n});static \u0275inj=Zn$1({imports:[Et]})}return n})(),ni=(()=>{class n{static withConfig(e){return {ngModule:n,providers:[{provide:Se,useValue:e.warnOnNgModelWithFormControl??"always"},{provide:O,useValue:e.callSetDisabledState??Z$1}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=wo({type:n});static \u0275inj=Zn$1({imports:[Et]})}return n})();function V(i){return Error(`Unable to find icon with the name "${i}"`)}function X(){return Error("Could not find HttpClient for use with Angular Material icons. Please add provideHttpClient() to your providers.")}function q(i){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${i}".`)}function Y(i){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${i}".`)}var a=class{url;svgText;options;svgElement=null;constructor(l,t,e){this.url=l,this.svgText=t,this.options=e;}},K=(()=>{class i{_httpClient;_sanitizer;_errorHandler;_document;_svgIconConfigs=new Map;_iconSetConfigs=new Map;_cachedIconsByUrl=new Map;_inProgressUrlFetches=new Map;_fontCssClassesByAlias=new Map;_resolvers=[];_defaultFontSetClass=["material-icons","mat-ligature-font"];constructor(t,e,n,o){this._httpClient=t,this._sanitizer=e,this._errorHandler=o,this._document=n;}addSvgIcon(t,e,n){return this.addSvgIconInNamespace("",t,e,n)}addSvgIconLiteral(t,e,n){return this.addSvgIconLiteralInNamespace("",t,e,n)}addSvgIconInNamespace(t,e,n,o){return this._addSvgIconConfig(t,e,new a(n,null,o))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,e,n,o){let r=this._sanitizer.sanitize(ke.HTML,n);if(!r)throw Y(n);let s=vn$1(r);return this._addSvgIconConfig(t,e,new a("",s,o))}addSvgIconSet(t,e){return this.addSvgIconSetInNamespace("",t,e)}addSvgIconSetLiteral(t,e){return this.addSvgIconSetLiteralInNamespace("",t,e)}addSvgIconSetInNamespace(t,e,n){return this._addSvgIconSetConfig(t,new a(e,null,n))}addSvgIconSetLiteralInNamespace(t,e,n){let o=this._sanitizer.sanitize(ke.HTML,e);if(!o)throw Y(e);let r=vn$1(o);return this._addSvgIconSetConfig(t,new a("",r,n))}registerFontClassAlias(t,e=t){return this._fontCssClassesByAlias.set(t,e),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(...t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){let e=this._sanitizer.sanitize(ke.RESOURCE_URL,t);if(!e)throw q(t);let n=this._cachedIconsByUrl.get(e);return n?br(C(n)):this._loadSvgIconFromConfig(new a(t,null)).pipe(Fd(o=>this._cachedIconsByUrl.set(e,o)),re$1(o=>C(o)))}getNamedSvgIcon(t,e=""){let n=J(e,t),o=this._svgIconConfigs.get(n);if(o)return this._getSvgFromConfig(o);if(o=this._getIconConfigFromResolvers(e,t),o)return this._svgIconConfigs.set(n,o),this._getSvgFromConfig(o);let r=this._iconSetConfigs.get(e);return r?this._getSvgFromIconSetConfigs(t,r):Gy(V(n))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear();}_getSvgFromConfig(t){return t.svgText?br(C(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(re$1(e=>C(e)))}_getSvgFromIconSetConfigs(t,e){let n=this._extractIconWithNameFromAnySet(t,e);if(n)return br(n);let o=e.filter(r=>!r.svgText).map(r=>this._loadSvgIconSetFromConfig(r).pipe(va(s=>{let f=`Loading icon set URL: ${this._sanitizer.sanitize(ke.RESOURCE_URL,r.url)} failed: ${s.message}`;return this._errorHandler.handleError(new Error(f)),br(null)})));return $y(o).pipe(re$1(()=>{let r=this._extractIconWithNameFromAnySet(t,e);if(!r)throw V(t);return r}))}_extractIconWithNameFromAnySet(t,e){for(let n=e.length-1;n>=0;n--){let o=e[n];if(o.svgText&&o.svgText.toString().indexOf(t)>-1){let r=this._svgElementFromConfig(o),s=this._extractSvgIconFromSet(r,t,o.options);if(s)return s}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(Fd(e=>t.svgText=e),re$1(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?br(null):this._fetchIcon(t).pipe(Fd(e=>t.svgText=e))}_extractSvgIconFromSet(t,e,n){let o=t.querySelector(`[id="${e}"]`);if(!o)return null;let r=o.cloneNode(true);if(r.removeAttribute("id"),r.nodeName.toLowerCase()==="svg")return this._setSvgAttributes(r,n);if(r.nodeName.toLowerCase()==="symbol")return this._setSvgAttributes(this._toSvgElement(r),n);let s=this._svgElementFromString(vn$1("<svg></svg>"));return s.appendChild(r),this._setSvgAttributes(s,n)}_svgElementFromString(t){let e=this._document.createElement("DIV");e.innerHTML=t;let n=e.querySelector("svg");if(!n)throw Error("<svg> tag not found");return n}_toSvgElement(t){let e=this._svgElementFromString(vn$1("<svg></svg>")),n=t.attributes;for(let o=0;o<n.length;o++){let{name:r,value:s}=n[o];r!=="id"&&e.setAttribute(r,s);}for(let o=0;o<t.childNodes.length;o++)t.childNodes[o].nodeType===this._document.ELEMENT_NODE&&e.appendChild(t.childNodes[o].cloneNode(true));return e}_setSvgAttributes(t,e){return t.setAttribute("fit",""),t.setAttribute("height","100%"),t.setAttribute("width","100%"),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.setAttribute("focusable","false"),e&&e.viewBox&&t.setAttribute("viewBox",e.viewBox),t}_fetchIcon(t){let{url:e,options:n}=t,o=n?.withCredentials??false;if(!this._httpClient)throw X();if(e==null)throw Error(`Cannot fetch icon from URL "${e}".`);let r=this._sanitizer.sanitize(ke.RESOURCE_URL,e);if(!r)throw q(e);let s=this._inProgressUrlFetches.get(r);if(s)return s;let h=this._httpClient.get(r,{responseType:"text",withCredentials:o}).pipe(re$1(f=>vn$1(f)),hi(()=>this._inProgressUrlFetches.delete(r)),Ta());return this._inProgressUrlFetches.set(r,h),h}_addSvgIconConfig(t,e,n){return this._svgIconConfigs.set(J(t,e),n),this}_addSvgIconSetConfig(t,e){let n=this._iconSetConfigs.get(t);return n?n.push(e):this._iconSetConfigs.set(t,[e]),this}_svgElementFromConfig(t){if(!t.svgElement){let e=this._svgElementFromString(t.svgText);this._setSvgAttributes(e,t.options),t.svgElement=e;}return t.svgElement}_getIconConfigFromResolvers(t,e){for(let n=0;n<this._resolvers.length;n++){let o=this._resolvers[n](e,t);if(o)return Z(o)?new a(o.url,null,o.options):new a(o,null)}}static \u0275fac=function(e){return new(e||i)(b(gy,8),b(RS),b(U$1,8),b(_e$1))};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function C(i){return i.cloneNode(true)}function J(i,l){return i+":"+l}function Z(i){return !!(i.url&&i.options)}var tt=["*"],et=new C$1("MAT_ICON_DEFAULT_OPTIONS"),nt=new C$1("mat-icon-location",{providedIn:"root",factory:()=>{let i=g(U$1),l=i?i.location:null;return {getPathname:()=>l?l.pathname+l.search:""}}}),G=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],ot=G.map(i=>`[${i}]`).join(", "),rt=/^url\(['"]?#(.*?)['"]?\)$/,wt=(()=>{class i{_elementRef=g(Xt$1);_iconRegistry=g(K);_location=g(nt);_errorHandler=g(_e$1);_defaultColor;get color(){return this._color||this._defaultColor}set color(t){this._color=t;}_color;inline=false;get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t);}_svgIcon;get fontSet(){return this._fontSet}set fontSet(t){let e=this._cleanupFontValue(t);e!==this._fontSet&&(this._fontSet=e,this._updateFontIconClasses());}_fontSet;get fontIcon(){return this._fontIcon}set fontIcon(t){let e=this._cleanupFontValue(t);e!==this._fontIcon&&(this._fontIcon=e,this._updateFontIconClasses());}_fontIcon;_previousFontSetClass=[];_previousFontIconClass;_svgName=null;_svgNamespace=null;_previousPath;_elementsWithExternalReferences;_currentIconFetch=J$1.EMPTY;constructor(){let t=g(new dm("aria-hidden"),{optional:true}),e=g(et,{optional:true});e&&(e.color&&(this.color=this._defaultColor=e.color),e.fontSet&&(this.fontSet=e.fontSet)),t||this._elementRef.nativeElement.setAttribute("aria-hidden","true");}_splitIconName(t){if(!t)return ["",""];let e=t.split(":");switch(e.length){case 1:return ["",e[0]];case 2:return e;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses();}ngAfterViewChecked(){let t=this._elementsWithExternalReferences;if(t&&t.size){let e=this._location.getPathname();e!==this._previousPath&&(this._previousPath=e,this._prependPathToReferences(e));}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();}_usingFontIcon(){return !this.svgIcon}_setSvgElement(t){this._clearSvgElement();let e=this._location.getPathname();this._previousPath=e,this._cacheChildrenWithExternalReferences(t),this._prependPathToReferences(e),this._elementRef.nativeElement.appendChild(t);}_clearSvgElement(){let t=this._elementRef.nativeElement,e=t.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();e--;){let n=t.childNodes[e];(n.nodeType!==1||n.nodeName.toLowerCase()==="svg")&&n.remove();}}_updateFontIconClasses(){if(!this._usingFontIcon())return;let t=this._elementRef.nativeElement,e=(this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/):this._iconRegistry.getDefaultFontSetClass()).filter(n=>n.length>0);this._previousFontSetClass.forEach(n=>t.classList.remove(n)),e.forEach(n=>t.classList.add(n)),this._previousFontSetClass=e,this.fontIcon!==this._previousFontIconClass&&!e.includes("mat-ligature-font")&&(this._previousFontIconClass&&t.classList.remove(this._previousFontIconClass),this.fontIcon&&t.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon);}_cleanupFontValue(t){return typeof t=="string"?t.trim().split(" ")[0]:t}_prependPathToReferences(t){let e=this._elementsWithExternalReferences;e&&e.forEach((n,o)=>{n.forEach(r=>{o.setAttribute(r.name,`url('${t}#${r.value}')`);});});}_cacheChildrenWithExternalReferences(t){let e=t.querySelectorAll(ot),n=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let o=0;o<e.length;o++)G.forEach(r=>{let s=e[o],h=s.getAttribute(r),f=h?h.match(rt):null;if(f){let p=n.get(s);p||(p=[],n.set(s,p)),p.push({name:r,value:f[1]});}});}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){let[e,n]=this._splitIconName(t);e&&(this._svgNamespace=e),n&&(this._svgName=n),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(n,e).pipe(an$1(1)).subscribe(o=>this._setSvgElement(o),o=>{let r=`Error retrieving icon ${e}:${n}! ${o.message}`;this._errorHandler.handleError(new Error(r));});}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=jw({type:i,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:10,hostBindings:function(e,n){e&2&&(Sg("data-mat-icon-type",n._usingFontIcon()?"font":"svg")("data-mat-icon-name",n._svgName||n.fontIcon)("data-mat-icon-namespace",n._svgNamespace||n.fontSet)("fontIcon",n._usingFontIcon()?n.fontIcon:null),UC(n.color?"mat-"+n.color:""),zg("mat-icon-inline",n.inline)("mat-icon-no-color",n.color!=="primary"&&n.color!=="accent"&&n.color!=="warn"));},inputs:{color:"color",inline:[2,"inline","inline",rb],svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],ngContentSelectors:tt,decls:1,vars:0,template:function(e,n){e&1&&(bC(),SC(0));},styles:[`mat-icon, mat-icon.mat-primary, mat-icon.mat-accent, mat-icon.mat-warn {
|
|
2
|
+
color: var(--mat-icon-color, inherit);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.mat-icon {
|
|
6
|
+
-webkit-user-select: none;
|
|
7
|
+
user-select: none;
|
|
8
|
+
background-repeat: no-repeat;
|
|
9
|
+
display: inline-block;
|
|
10
|
+
fill: currentColor;
|
|
11
|
+
height: 24px;
|
|
12
|
+
width: 24px;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
.mat-icon.mat-icon-inline {
|
|
16
|
+
font-size: inherit;
|
|
17
|
+
height: inherit;
|
|
18
|
+
line-height: inherit;
|
|
19
|
+
width: inherit;
|
|
20
|
+
}
|
|
21
|
+
.mat-icon.mat-ligature-font[fontIcon]::before {
|
|
22
|
+
content: attr(fontIcon);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[dir=rtl] .mat-icon-rtl-mirror {
|
|
26
|
+
transform: scale(-1, 1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,
|
|
30
|
+
.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon {
|
|
31
|
+
display: block;
|
|
32
|
+
}
|
|
33
|
+
.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,
|
|
34
|
+
.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon {
|
|
35
|
+
margin: auto;
|
|
36
|
+
}
|
|
37
|
+
`],encapsulation:2})}return i})(),yt=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=wo({type:i});static \u0275inj=Zn$1({imports:[wt$2]})}return i})();export{$t as $,At as A,Cn as C,D,En as E,Jn as J,Qn as Q,Vt as V,Wt as W,Xt as X,Ye as Y,Zn as Z,_,wt$1 as a,_e as b,cn as c,an as d,ei as e,fn as f,gt as g,_n as h,y as i,Yn as j,_t as k,Xn as l,mn as m,ni as n,z as o,An as p,Ct as q,ti as t,wt as w,yt as y,ze as z};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {R}from'./chunk-BAWubWk8.js';import {g,ao as V,G,dm as k,w as we,a as Gi,E as ET,W as Vy,a7 as va,X as br,c as U,h as Fw,m as ws,o as Rg,Q as QC,n as hl,q as oC,t as nI,x as iC,a9 as gC,a3 as GI,r as cC,ac as EC,v as bg,a6 as qI,y as uC,a5 as Dl,a8 as Yg,A as Ug,b0 as Qg,aa as wf,ab as Cf}from'./main-LBRSRTYI.js';import'./chunk-R-GmZrHu.js';import {t as ti,Q as Qn,e as ei,Y as Ye,A as At,Z as Zn,c as cn}from'./chunk-BYyTBqh4.js';import'./chunk-BDaTUrH4.js';import'./chunk-ClSDInQq.js';import'./chunk-BaO2vi_O.js';import'./chunk-DjMtxVWg.js';var $=(i,e)=>e.id;function J(i,e){i&1&&(ws(0,"p",5),QC(1,"Loading\u2026"),hl());}function q(i,e){if(i&1&&(ws(0,"p",8),QC(1),hl()),i&2){let t=EC(2);nI(),Yg(t.errorMessage());}}function Q(i,e){if(i&1&&(ws(0,"span",26),QC(1),hl()),i&2){let t=EC(3);nI(),Yg(t.association()?.checkoutFailureReason);}}function W(i,e){if(i&1&&(ws(0,"p",25),QC(1),oC(2,Q,2,1,"span",26),hl()),i&2){let t=EC(2);Ug("namespace-git__status--failed",t.checkoutStatus()==="FAILED")("namespace-git__status--ready",t.checkoutStatus()==="READY"),nI(),Dl(" Repository: ",t.checkoutStatus()," "),nI(),iC(t.association()?.checkoutFailureReason?2:-1);}}function X(i,e){if(i&1&&(ws(0,"option",19),QC(1),hl()),i&2){let t=e.$implicit,l=EC(2);bg("value",t.id),nI(),Qg("",t.name," (",l.authTypeLabel(t.authType),")");}}function Z(i,e){i&1&&(ws(0,"span",20),QC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),hl());}function ee(i,e){if(i&1){let t=gC();ws(0,"button",27),Rg("click",function(){wf(t);let c=EC(2);return Cf(c.remove())}),QC(1," Remove association "),hl();}if(i&2){let t=EC(2);bg("disabled",t.isSaving());}}function te(i,e){if(i&1){let t=gC();ws(0,"div",6)(1,"p",7),QC(2," Associate a repository with this namespace and prepare an internal clone. Namespace files remain shared documents outside Git. "),hl(),oC(3,q,2,1,"p",8),oC(4,W,3,6,"p",9),ws(5,"fieldset",10)(6,"legend",11),QC(7,"Repository"),hl(),ws(8,"label",12)(9,"span",13),QC(10,"Repository URL"),hl(),ws(11,"input",14),Rg("ngModelChange",function(c){wf(t);let v=EC();return Cf(v.repositoryUrl.set(c))}),hl(),GI(),ws(12,"span",15),QC(13,"HTTPS only, without credentials in the URL."),hl()(),ws(14,"label",12)(15,"span",13),QC(16,"Main branch"),hl(),ws(17,"input",16),Rg("ngModelChange",function(c){wf(t);let v=EC();return Cf(v.mainBranch.set(c))}),hl(),GI(),ws(18,"span",15),QC(19,"The internal clone starts from this remote branch."),hl()(),ws(20,"label",12)(21,"span",13),QC(22,"Service account"),hl(),ws(23,"select",17),Rg("ngModelChange",function(c){wf(t);let v=EC();return Cf(v.serviceAuthSettingId.set(c))}),ws(24,"option",18),QC(25,"Select an auth setting\u2026"),hl(),cC(26,X,2,3,"option",19,$),hl(),GI(),ws(28,"span",15),QC(29," Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case. "),hl(),oC(30,Z,2,0,"span",20),hl()(),ws(31,"div",21)(32,"button",22),Rg("click",function(){wf(t);let c=EC();return Cf(c.save())}),QC(33),hl(),oC(34,ee,2,1,"button",23),ws(35,"button",24),Rg("click",function(){wf(t);let c=EC();return Cf(c.cancel())}),QC(36,"Cancel"),hl()()();}if(i&2){let t=EC();nI(3),iC(t.errorMessage()?3:-1),nI(),iC(t.isAssociated()&&t.checkoutStatus()?4:-1),nI(7),bg("ngModel",t.repositoryUrl()),qI(),nI(6),bg("ngModel",t.mainBranch()),qI(),nI(6),bg("ngModel",t.serviceAuthSettingId()),qI(),nI(3),uC(t.eligibleAuthSettings()),nI(4),iC(t.eligibleAuthSettings().length===0?30:-1),nI(2),bg("disabled",!t.canSave()),nI(),Dl(" ",t.isSaving()?"Saving\u2026":t.isAssociated()?"Update":"Associate"," "),nI(),iC(t.isAssociated()?34:-1);}}var ne=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],ie={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},j=class i{route=g(V);router=g(G);gitApi=g(k);authSettingState=g(R);destroyRef=g(we);isLoading=Gi(true);isSaving=Gi(false);errorMessage=Gi(null);association=Gi(null);authSettings=Gi([]);repositoryUrl=Gi("");mainBranch=Gi("main");serviceAuthSettingId=Gi("");namespaceId="";isAssociated=ET(()=>this.association()?.associated===true);eligibleAuthSettings=ET(()=>this.authSettings().filter(e=>ne.includes(e.authType)));authTypeLabel(e){return ie[e??""]??e??"unknown"}canSave=ET(()=>this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0&&!this.isSaving());checkoutStatus=ET(()=>this.association()?.checkoutStatus??null);ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}load(){this.isLoading.set(true),Vy({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId).pipe(va(e=>(console.error("Failed to load the Git association",e),this.errorMessage.set(this.messageOf(e)),br(null)))),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId).pipe(va(e=>(console.error("Failed to load namespace auth settings",e),br([]))))}).pipe(U(this.destroyRef)).subscribe(({association:e,authSettings:t})=>{this.authSettings.set(t??[]),e&&(this.association.set(e),this.applyToForm(e)),this.isLoading.set(false);});}applyToForm(e){this.repositoryUrl.set(e.repositoryUrl??""),this.mainBranch.set(e.mainBranch??"main"),this.serviceAuthSettingId.set(e.serviceAuthSettingId??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId()}).pipe(U(this.destroyRef),va(e=>(console.error("Failed to save the Git association",e),this.errorMessage.set(this.messageOf(e)),this.isSaving.set(false),br(null)))).subscribe(e=>{e&&(this.association.set(e),this.applyToForm(e)),this.isSaving.set(false);}));}remove(){confirm("Remove the repository association? The internal clone is preserved.")&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),va(e=>(console.error("Failed to remove the Git association",e),this.errorMessage.set(this.messageOf(e)),this.isSaving.set(false),br(null)))).subscribe(e=>{e&&(this.association.set(e),this.applyToForm(e)),this.isSaving.set(false);}));}cancel(){this.router.navigate(["/agentos/namespaces"]);}messageOf(e){return e.error?.message??e.message??"Unexpected error"}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Fw({type:i,selectors:[["agentos-namespace-git"]],decls:10,vars:1,consts:[[1,"namespace-git"],[1,"namespace-git__header"],["type","button","title","Back to namespaces",1,"namespace-git__back",3,"click"],[1,"namespace-git__back-icon"],[1,"namespace-git__title"],[1,"namespace-git__loading"],[1,"namespace-git__body"],[1,"namespace-git__hint"],["role","alert",1,"namespace-git__error"],[1,"namespace-git__status",3,"namespace-git__status--failed","namespace-git__status--ready"],[1,"namespace-git__section"],[1,"namespace-git__label"],[1,"namespace-git__field"],[1,"namespace-git__field-label"],["type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__field-hint"],["type","text","placeholder","main","name","mainBranch",1,"namespace-git__input",3,"ngModelChange","ngModel"],["name","serviceAuthSettingId",1,"namespace-git__input",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"namespace-git__field-hint","namespace-git__field-hint--warn"],[1,"namespace-git__actions"],["type","button",1,"namespace-git__save",3,"click","disabled"],["type","button",1,"namespace-git__remove",3,"disabled"],["type","button",1,"namespace-git__cancel",3,"click"],[1,"namespace-git__status"],[1,"namespace-git__status-reason"],["type","button",1,"namespace-git__remove",3,"click","disabled"]],template:function(t,l){t&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return l.cancel()}),ws(3,"span",3),QC(4,"\u2190"),hl(),QC(5," Namespaces "),hl(),ws(6,"h1",4),QC(7,"Git repository"),hl()(),oC(8,J,2,0,"p",5)(9,te,37,9,"div",6),hl()),t&2&&(nI(8),iC(l.isLoading()?8:9));},dependencies:[ti,Qn,ei,Ye,At,Zn,cn],styles:[".namespace-git[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.namespace-git__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-git__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-primary, #007aff);font-family:inherit}.namespace-git__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-git__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem}.namespace-git__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.namespace-git__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__error[_ngcontent-%COMP%]{margin:0;padding:.75rem;border-radius:.375rem;background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c);font-size:.875rem}.namespace-git__status[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:.375rem;background:var(--color-surface-secondary, #f3f4f6);font-size:.875rem;display:flex;flex-direction:column;gap:.25rem}.namespace-git__status--ready[_ngcontent-%COMP%]{background:var(--color-success-bg, #ecfdf5);color:var(--color-success, #047857)}.namespace-git__status--failed[_ngcontent-%COMP%]{background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c)}.namespace-git__status-reason[_ngcontent-%COMP%]{font-size:.8125rem;opacity:.9}.namespace-git__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.5rem;padding:1rem;margin:0}.namespace-git__label[_ngcontent-%COMP%]{font-weight:600;font-size:.9375rem;padding:0 .25rem}.namespace-git__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-git__field-label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500}.namespace-git__field-hint[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__field-hint--warn[_ngcontent-%COMP%]{color:var(--color-warning, #b45309)}.namespace-git__input[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem .625rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.375rem;background:var(--color-surface, #fff);color:inherit}.namespace-git__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.namespace-git__save[_ngcontent-%COMP%], .namespace-git__remove[_ngcontent-%COMP%], .namespace-git__cancel[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem 1rem;border-radius:.375rem;cursor:pointer;border:1px solid transparent}.namespace-git__save[_ngcontent-%COMP%]:disabled, .namespace-git__remove[_ngcontent-%COMP%]:disabled, .namespace-git__cancel[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.namespace-git__save[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.namespace-git__remove[_ngcontent-%COMP%]{background:none;border-color:var(--color-error, #b91c1c);color:var(--color-error, #b91c1c)}.namespace-git__cancel[_ngcontent-%COMP%]{background:none;border-color:var(--color-border, #e5e7eb);color:inherit}"]})};
|
|
1
|
+
import {R}from'./chunk-CR817PBg.js';import {g,ao as V,G,dn as k,C as Ce,W as Wi,T as TT,$ as $y,a7 as va,I as br,b as U,j as jw,k as Cs,n as kg,J as JC,m as hl,o as aC,t as sI,u as cC,a9 as vC,a3 as ZI,q as dC,ac as CC,_ as _g,a6 as QI,v as fC,a5 as Dl,a8 as Kg,w as zg,b0 as Xg,aa as Cf,ab as Tf}from'./main-YYHD6X7H.js';import'./chunk-BJld3zB5.js';import {t as ti,Q as Qn,e as ei,Y as Ye,A as At,Z as Zn,c as cn}from'./chunk-FMHkoXwM.js';import'./chunk-DaoWXYMw.js';import'./chunk-4uEZjTft.js';import'./chunk-B13_C_P9.js';import'./chunk-CgNkwpQ7.js';var $=(i,e)=>e.id;function J(i,e){i&1&&(Cs(0,"p",5),JC(1,"Loading\u2026"),hl());}function q(i,e){if(i&1&&(Cs(0,"p",8),JC(1),hl()),i&2){let t=CC(2);sI(),Kg(t.errorMessage());}}function Q(i,e){if(i&1&&(Cs(0,"span",26),JC(1),hl()),i&2){let t=CC(3);sI(),Kg(t.association()?.checkoutFailureReason);}}function W(i,e){if(i&1&&(Cs(0,"p",25),JC(1),aC(2,Q,2,1,"span",26),hl()),i&2){let t=CC(2);zg("namespace-git__status--failed",t.checkoutStatus()==="FAILED")("namespace-git__status--ready",t.checkoutStatus()==="READY"),sI(),Dl(" Repository: ",t.checkoutStatus()," "),sI(),cC(t.association()?.checkoutFailureReason?2:-1);}}function X(i,e){if(i&1&&(Cs(0,"option",19),JC(1),hl()),i&2){let t=e.$implicit,l=CC(2);_g("value",t.id),sI(),Xg("",t.name," (",l.authTypeLabel(t.authType),")");}}function Z(i,e){i&1&&(Cs(0,"span",20),JC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),hl());}function ee(i,e){if(i&1){let t=vC();Cs(0,"button",27),kg("click",function(){Cf(t);let c=CC(2);return Tf(c.remove())}),JC(1," Remove association "),hl();}if(i&2){let t=CC(2);_g("disabled",t.isSaving());}}function te(i,e){if(i&1){let t=vC();Cs(0,"div",6)(1,"p",7),JC(2," Associate a repository with this namespace and prepare an internal clone. Namespace files remain shared documents outside Git. "),hl(),aC(3,q,2,1,"p",8),aC(4,W,3,6,"p",9),Cs(5,"fieldset",10)(6,"legend",11),JC(7,"Repository"),hl(),Cs(8,"label",12)(9,"span",13),JC(10,"Repository URL"),hl(),Cs(11,"input",14),kg("ngModelChange",function(c){Cf(t);let v=CC();return Tf(v.repositoryUrl.set(c))}),hl(),ZI(),Cs(12,"span",15),JC(13,"HTTPS only, without credentials in the URL."),hl()(),Cs(14,"label",12)(15,"span",13),JC(16,"Main branch"),hl(),Cs(17,"input",16),kg("ngModelChange",function(c){Cf(t);let v=CC();return Tf(v.mainBranch.set(c))}),hl(),ZI(),Cs(18,"span",15),JC(19,"The internal clone starts from this remote branch."),hl()(),Cs(20,"label",12)(21,"span",13),JC(22,"Service account"),hl(),Cs(23,"select",17),kg("ngModelChange",function(c){Cf(t);let v=CC();return Tf(v.serviceAuthSettingId.set(c))}),Cs(24,"option",18),JC(25,"Select an auth setting\u2026"),hl(),dC(26,X,2,3,"option",19,$),hl(),ZI(),Cs(28,"span",15),JC(29," Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case. "),hl(),aC(30,Z,2,0,"span",20),hl()(),Cs(31,"div",21)(32,"button",22),kg("click",function(){Cf(t);let c=CC();return Tf(c.save())}),JC(33),hl(),aC(34,ee,2,1,"button",23),Cs(35,"button",24),kg("click",function(){Cf(t);let c=CC();return Tf(c.cancel())}),JC(36,"Cancel"),hl()()();}if(i&2){let t=CC();sI(3),cC(t.errorMessage()?3:-1),sI(),cC(t.isAssociated()&&t.checkoutStatus()?4:-1),sI(7),_g("ngModel",t.repositoryUrl()),QI(),sI(6),_g("ngModel",t.mainBranch()),QI(),sI(6),_g("ngModel",t.serviceAuthSettingId()),QI(),sI(3),fC(t.eligibleAuthSettings()),sI(4),cC(t.eligibleAuthSettings().length===0?30:-1),sI(2),_g("disabled",!t.canSave()),sI(),Dl(" ",t.isSaving()?"Saving\u2026":t.isAssociated()?"Update":"Associate"," "),sI(),cC(t.isAssociated()?34:-1);}}var ne=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],ie={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},j=class i{route=g(V);router=g(G);gitApi=g(k);authSettingState=g(R);destroyRef=g(Ce);isLoading=Wi(true);isSaving=Wi(false);errorMessage=Wi(null);association=Wi(null);authSettings=Wi([]);repositoryUrl=Wi("");mainBranch=Wi("main");serviceAuthSettingId=Wi("");namespaceId="";isAssociated=TT(()=>this.association()?.associated===true);eligibleAuthSettings=TT(()=>this.authSettings().filter(e=>ne.includes(e.authType)));authTypeLabel(e){return ie[e??""]??e??"unknown"}canSave=TT(()=>this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0&&!this.isSaving());checkoutStatus=TT(()=>this.association()?.checkoutStatus??null);ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}load(){this.isLoading.set(true),$y({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId).pipe(va(e=>(console.error("Failed to load the Git association",e),this.errorMessage.set(this.messageOf(e)),br(null)))),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId).pipe(va(e=>(console.error("Failed to load namespace auth settings",e),br([]))))}).pipe(U(this.destroyRef)).subscribe(({association:e,authSettings:t})=>{this.authSettings.set(t??[]),e&&(this.association.set(e),this.applyToForm(e)),this.isLoading.set(false);});}applyToForm(e){this.repositoryUrl.set(e.repositoryUrl??""),this.mainBranch.set(e.mainBranch??"main"),this.serviceAuthSettingId.set(e.serviceAuthSettingId??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId()}).pipe(U(this.destroyRef),va(e=>(console.error("Failed to save the Git association",e),this.errorMessage.set(this.messageOf(e)),this.isSaving.set(false),br(null)))).subscribe(e=>{e&&(this.association.set(e),this.applyToForm(e)),this.isSaving.set(false);}));}remove(){confirm("Remove the repository association? The internal clone is preserved.")&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),va(e=>(console.error("Failed to remove the Git association",e),this.errorMessage.set(this.messageOf(e)),this.isSaving.set(false),br(null)))).subscribe(e=>{e&&(this.association.set(e),this.applyToForm(e)),this.isSaving.set(false);}));}cancel(){this.router.navigate(["/agentos/namespaces"]);}messageOf(e){return e.error?.message??e.message??"Unexpected error"}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=jw({type:i,selectors:[["agentos-namespace-git"]],decls:10,vars:1,consts:[[1,"namespace-git"],[1,"namespace-git__header"],["type","button","title","Back to namespaces",1,"namespace-git__back",3,"click"],[1,"namespace-git__back-icon"],[1,"namespace-git__title"],[1,"namespace-git__loading"],[1,"namespace-git__body"],[1,"namespace-git__hint"],["role","alert",1,"namespace-git__error"],[1,"namespace-git__status",3,"namespace-git__status--failed","namespace-git__status--ready"],[1,"namespace-git__section"],[1,"namespace-git__label"],[1,"namespace-git__field"],[1,"namespace-git__field-label"],["type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__field-hint"],["type","text","placeholder","main","name","mainBranch",1,"namespace-git__input",3,"ngModelChange","ngModel"],["name","serviceAuthSettingId",1,"namespace-git__input",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"namespace-git__field-hint","namespace-git__field-hint--warn"],[1,"namespace-git__actions"],["type","button",1,"namespace-git__save",3,"click","disabled"],["type","button",1,"namespace-git__remove",3,"disabled"],["type","button",1,"namespace-git__cancel",3,"click"],[1,"namespace-git__status"],[1,"namespace-git__status-reason"],["type","button",1,"namespace-git__remove",3,"click","disabled"]],template:function(t,l){t&1&&(Cs(0,"div",0)(1,"header",1)(2,"button",2),kg("click",function(){return l.cancel()}),Cs(3,"span",3),JC(4,"\u2190"),hl(),JC(5," Namespaces "),hl(),Cs(6,"h1",4),JC(7,"Git repository"),hl()(),aC(8,J,2,0,"p",5)(9,te,37,9,"div",6),hl()),t&2&&(sI(8),cC(l.isLoading()?8:9));},dependencies:[ti,Qn,ei,Ye,At,Zn,cn],styles:[".namespace-git[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.namespace-git__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-git__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-primary, #007aff);font-family:inherit}.namespace-git__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-git__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem}.namespace-git__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.namespace-git__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__error[_ngcontent-%COMP%]{margin:0;padding:.75rem;border-radius:.375rem;background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c);font-size:.875rem}.namespace-git__status[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:.375rem;background:var(--color-surface-secondary, #f3f4f6);font-size:.875rem;display:flex;flex-direction:column;gap:.25rem}.namespace-git__status--ready[_ngcontent-%COMP%]{background:var(--color-success-bg, #ecfdf5);color:var(--color-success, #047857)}.namespace-git__status--failed[_ngcontent-%COMP%]{background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c)}.namespace-git__status-reason[_ngcontent-%COMP%]{font-size:.8125rem;opacity:.9}.namespace-git__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.5rem;padding:1rem;margin:0}.namespace-git__label[_ngcontent-%COMP%]{font-weight:600;font-size:.9375rem;padding:0 .25rem}.namespace-git__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-git__field-label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500}.namespace-git__field-hint[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__field-hint--warn[_ngcontent-%COMP%]{color:var(--color-warning, #b45309)}.namespace-git__input[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem .625rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.375rem;background:var(--color-surface, #fff);color:inherit}.namespace-git__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.namespace-git__save[_ngcontent-%COMP%], .namespace-git__remove[_ngcontent-%COMP%], .namespace-git__cancel[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem 1rem;border-radius:.375rem;cursor:pointer;border:1px solid transparent}.namespace-git__save[_ngcontent-%COMP%]:disabled, .namespace-git__remove[_ngcontent-%COMP%]:disabled, .namespace-git__cancel[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.namespace-git__save[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.namespace-git__remove[_ngcontent-%COMP%]{background:none;border-color:var(--color-error, #b91c1c);color:var(--color-error, #b91c1c)}.namespace-git__cancel[_ngcontent-%COMP%]{background:none;border-color:var(--color-border, #e5e7eb);color:inherit}"]})};
|
|
2
2
|
export{j as NamespaceGitComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f}from'./chunk-BHvLB-pV.js';import {g,bm as _m,R as Re,a as Gi,E as ET,h as Fw,i as hr,k as Gn,m as ws,o as Rg,Q as QC,n as hl,q as oC,af as Eg,ag as mT,M as MC,t as nI,v as bg,x as iC,I as fy,P,aF as A,Y as x,Z as z,_ as Ue,$ as zt,a0 as jt,a1 as Vt,a2 as Nt,j as pr,bn as Xt,ai as em,aj as tT,a3 as GI,r as cC,bo as sC,a8 as Yg,ak as Jg,a6 as qI,y as uC,a5 as Dl,ac as EC,a9 as gC,aa as wf,ab as Cf,bp as yl,bq as vl,ah as aT,b4 as cT,A as Ug,b0 as Qg,a4 as aC,T as Tg,S as Sg}from'./main-LBRSRTYI.js';import {P as Pt}from'./chunk-BdJzYh5V.js';import {T as Tn,S as Sn,n as nt$1,a as ae,l as le,c as ce}from'./chunk-bfpuueWC.js';import {W as Wn,o as ot$1,i as it$1,I as In,D as De,B as Be,y as ya,E as En}from'./chunk-BaO2vi_O.js';import'./chunk-DjMtxVWg.js';import {y as yt,w as wt,t as ti,Q as Qn,e as ei,Y as Ye$1,f as fn,m as mn,Z as Zn,g as gt,$ as $t,W as Wt,c as cn}from'./chunk-BYyTBqh4.js';var w=class s{http=g(fy);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${encodeURIComponent(t)}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new A(n=>{let a=new FileReader;a.onload=()=>{let r=a.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(n);},a.onerror=()=>n.error(a.error),a.readAsDataURL(e);})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"})};function ze(s,t){s&1&&(ws(0,"p",15),QC(1,"No integrations defined \u2014 agent will have access to all tools."),hl());}function qe(s,t){if(s&1){let e=gC();ws(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),QC(3,"Integration"),hl(),ws(4,"input",23),em("ngModelChange",function(a){let r=wf(e).$implicit;return tT(r.integration,a)||(r.integration=a),Cf(a)}),hl(),GI(),hl(),ws(5,"mat-form-field",24)(6,"mat-label"),QC(7,"Tools (comma-separated)"),hl(),ws(8,"input",25),em("ngModelChange",function(a){let r=wf(e).$implicit;return tT(r.tools,a)||(r.tools=a),Cf(a)}),hl(),GI(),hl(),ws(9,"button",26),Rg("click",function(){let a=wf(e).$index,r=EC();return Cf(r.removeIntegrationRow(a))}),ws(10,"mat-icon"),QC(11,"delete"),hl()()();}if(s&2){let e=t.$implicit;nI(4),Jg("ngModel",e.integration),qI(),nI(4),Jg("ngModel",e.tools),qI();}}function He(s,t){if(s&1&&(ws(0,"p",30),QC(1),hl()),s&2){let e=EC(2);nI(),Yg(e.docUploadError);}}function Ge(s,t){s&1&&(ws(0,"p",15),QC(1,"No mandatory documents defined."),hl());}function Ze(s,t){if(s&1&&Sg(0,"option",35),s&2){let e=t.$implicit;bg("value","documents/"+e);}}function Ke(s,t){if(s&1){let e=gC();ws(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),QC(3,"Document path"),hl(),ws(4,"input",33),em("ngModelChange",function(a){let r=wf(e).$index,j=EC(2);return tT(j.mandatoryDocs[r],a)||(j.mandatoryDocs[r]=a),Cf(a)}),hl(),GI(),ws(5,"datalist",34),cC(6,Ze,1,1,"option",35,aC),hl()(),ws(8,"button",26),Rg("click",function(){let a=wf(e).$index,r=EC(2);return Cf(r.removeDocRow(a))}),ws(9,"mat-icon"),QC(10,"delete"),hl()()();}if(s&2){let e=t.$index,n=EC(2);nI(4),Jg("ngModel",n.mandatoryDocs[e]),Tg("list","docs-list-"+e),qI(),nI(),bg("id","docs-list-"+e),nI(),uC(n.availableDocuments);}}function Je(s,t){if(s&1){let e=gC();ws(0,"div",6)(1,"span"),QC(2,"Mandatory Documents"),hl(),ws(3,"button",27),Rg("click",function(){wf(e);let a=EC();return Cf(a.addDocRow())}),ws(4,"mat-icon"),QC(5,"add"),hl()(),ws(6,"label",28)(7,"mat-icon"),QC(8,"upload_file"),hl(),ws(9,"input",29),Rg("change",function(a){wf(e);let r=EC();return Cf(r.onDocFileSelected(a))}),hl()()(),oC(10,He,2,1,"p",30),oC(11,Ge,2,0,"p",15),cC(12,Ke,11,3,"div",31,sC);}if(s&2){let e=EC();nI(6),Ug("uploading",e.isUploadingDoc),nI(3),bg("disabled",e.isUploadingDoc),nI(),iC(e.docUploadError?10:-1),nI(),iC(e.mandatoryDocs.length===0?11:-1),nI(),uC(e.mandatoryDocs);}}function Qe(s,t){s&1&&(ws(0,"p",15),QC(1,"\u{1F4A1} Documents can be added after the agent is created."),hl());}function Xe(s,t){if(s&1){let e=gC();ws(0,"div",6),QC(1,"Save to"),hl(),ws(2,"div",36)(3,"label",37)(4,"input",38),em("ngModelChange",function(a){wf(e);let r=EC();return tT(r.location,a)||(r.location=a),Cf(a)}),hl(),GI(),ws(5,"div",39)(6,"div",40)(7,"span",41),QC(8,"\u{1F464}"),hl(),ws(9,"span",42),QC(10,"Project config"),hl()(),ws(11,"p",43),QC(12),hl()()(),ws(13,"label",37)(14,"input",44),em("ngModelChange",function(a){wf(e);let r=EC();return tT(r.location,a)||(r.location=a),Cf(a)}),hl(),GI(),ws(15,"div",39)(16,"div",40)(17,"span",41),QC(18,"\u{1F4E6}"),hl(),ws(19,"span",42),QC(20,"Colocated"),hl()(),ws(21,"p",43),QC(22,"Next to coday.yaml in ./agents/ (committable)"),hl()()()(),ws(23,"p",15),QC(24,"Storage location is permanent and cannot be changed after creation."),hl();}if(s&2){let e=EC();nI(3),Ug("selected",e.location==="project"),nI(),Jg("ngModel",e.location),qI(),nI(8),Qg("~/.coday/projects/","{","name","}","/agents/ (not committed)"),nI(),Ug("selected",e.location==="colocated"),nI(),Jg("ngModel",e.location),qI();}}function Ye(s,t){if(s&1&&(ws(0,"div",17)(1,"span",6),QC(2,"Storage Location"),hl(),ws(3,"span",45),QC(4),hl(),ws(5,"p",15),QC(6,"Cannot be changed after creation."),hl()()),s&2){let e=EC();nI(3),Ug("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),nI(),Dl(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ");}}function $e(s,t){if(s&1&&(ws(0,"div",18)(1,"mat-icon"),QC(2,"error"),hl(),ws(3,"span"),QC(4),hl()()),s&2){let e=EC();nI(4),Yg(e.errorMessage);}}var E=class s{agentCrudApi=g(w);agentApi=g(f);dialogRef=g(z);data=g(Ue);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=false;docUploadError="";location="project";isSaving=false;errorMessage="";isEditMode=false;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,n])=>({integration:e,tools:n?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments();}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]});}addDocRow(){this.mandatoryDocs.push("");}removeDocRow(t){this.mandatoryDocs.splice(t,1);}onDocFileSelected(t){let e=t.target,n=e.files?.[0];n&&(this.isUploadingDoc=true,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,n).subscribe({next:a=>{this.isUploadingDoc=false,this.mandatoryDocs.push(a.relativePath),this.loadAvailableDocuments(),e.value="";},error:a=>{this.isUploadingDoc=false,this.docUploadError=a?.error?.error??a?.message??"Upload failed",e.value="";}}));}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""});}removeIntegrationRow(t){this.integrationRows.splice(t,1);}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",false;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",false;if(!this.description.trim())return this.errorMessage="Description is required",false;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",false;return true}buildDefinition(){let t=this.mandatoryDocs.map(n=>n.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(n=>n.integration.trim()).map(n=>[n.integration.trim(),n.tools.split(",").map(a=>a.trim()).filter(Boolean)])):void 0;return {name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=true,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=false,this.agentApi.clearAllCache(),this.dialogRef.close(true);},error:n=>{this.isSaving=false,this.errorMessage=n?.error?.error||n?.message||"Failed to save agent";}});}cancel(){this.dialogRef.close(false);}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=Fw({type:s,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,n){e&1&&(ws(0,"h2",0),QC(1),hl(),ws(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),QC(6,"Name"),hl(),ws(7,"input",3),em("ngModelChange",function(r){return tT(n.name,r)||(n.name=r),r}),hl(),GI(),ws(8,"mat-hint"),QC(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),hl()(),ws(10,"mat-form-field",2)(11,"mat-label"),QC(12,"Description"),hl(),ws(13,"textarea",4),em("ngModelChange",function(r){return tT(n.description,r)||(n.description=r),r}),hl(),GI(),hl(),ws(14,"mat-form-field",2)(15,"mat-label"),QC(16,"Instructions"),hl(),ws(17,"textarea",5),em("ngModelChange",function(r){return tT(n.instructions,r)||(n.instructions=r),r}),hl(),GI(),ws(18,"mat-hint"),QC(19,"System prompt / instructions sent to the AI model"),hl()(),ws(20,"div",6),QC(21,"AI Configuration"),hl(),ws(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),QC(25,"AI Provider"),hl(),ws(26,"input",9),em("ngModelChange",function(r){return tT(n.aiProvider,r)||(n.aiProvider=r),r}),hl(),GI(),hl(),ws(27,"mat-form-field",8)(28,"mat-label"),QC(29,"Model Name"),hl(),ws(30,"input",10),em("ngModelChange",function(r){return tT(n.modelName,r)||(n.modelName=r),r}),hl(),GI(),hl()(),ws(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),QC(34,"Temperature"),hl(),ws(35,"input",11),em("ngModelChange",function(r){return tT(n.temperature,r)||(n.temperature=r),r}),hl(),GI(),ws(36,"mat-hint"),QC(37,"Leave empty for model default"),hl()(),ws(38,"mat-form-field",8)(39,"mat-label"),QC(40,"Max Output Tokens"),hl(),ws(41,"input",12),em("ngModelChange",function(r){return tT(n.maxOutputTokens,r)||(n.maxOutputTokens=r),r}),hl(),GI(),ws(42,"mat-hint"),QC(43,"Leave empty for model default"),hl()()(),ws(44,"mat-form-field",2)(45,"mat-label"),QC(46,"OpenAI Assistant ID"),hl(),ws(47,"input",13),em("ngModelChange",function(r){return tT(n.openaiAssistantId,r)||(n.openaiAssistantId=r),r}),hl(),GI(),ws(48,"mat-hint"),QC(49,"If set, forces aiProvider to openai"),hl()(),ws(50,"div",6)(51,"span"),QC(52,"Integrations"),hl(),ws(53,"button",14),Rg("click",function(){return n.addIntegrationRow()}),ws(54,"mat-icon"),QC(55,"add"),hl()()(),oC(56,ze,2,0,"p",15),cC(57,qe,12,2,"div",16,sC),oC(59,Je,14,5)(60,Qe,2,0,"p",15),oC(61,Xe,25,8),oC(62,Ye,7,5,"div",17),oC(63,$e,5,1,"div",18),hl()(),ws(64,"mat-dialog-actions",19)(65,"button",20),Rg("click",function(){return n.cancel()}),QC(66,"Cancel"),hl(),ws(67,"button",21),Rg("click",function(){return n.save()}),QC(68),hl()()),e&2&&(nI(),Yg(n.isEditMode?"Edit Agent":"Create Agent"),nI(6),Jg("ngModel",n.name),bg("readonly",n.isEditMode),qI(),nI(6),Jg("ngModel",n.description),qI(),nI(4),Jg("ngModel",n.instructions),qI(),nI(9),Jg("ngModel",n.aiProvider),qI(),nI(4),Jg("ngModel",n.modelName),qI(),nI(5),Jg("ngModel",n.temperature),qI(),nI(6),Jg("ngModel",n.maxOutputTokens),qI(),nI(6),Jg("ngModel",n.openaiAssistantId),qI(),nI(9),iC(n.integrationRows.length===0?56:-1),nI(),uC(n.integrationRows),nI(2),iC(n.isEditMode?59:60),nI(2),iC(n.isEditMode?-1:61),nI(),iC(n.isEditMode?62:-1),nI(),iC(n.errorMessage?63:-1),nI(2),bg("disabled",n.isSaving),nI(2),bg("disabled",n.isSaving),nI(),Dl(" ",n.isSaving?"Saving...":"Save"," "));},dependencies:[ti,Qn,ei,Ye$1,fn,mn,Zn,gt,$t,Wt,cn,zt,jt,Vt,Nt,hr,pr,Gn,Tn,Sn,nt$1,ae,le,ce,yt,wt,Pt,Xt],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media(max-width:768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media(max-width:768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"],changeDetection:1})};var et=()=>[],tt=s=>({id:s});function nt(s,t){if(s&1&&(ws(0,"div",5),QC(1),hl()),s&2){let e=EC();nI(),Yg(e.errorMessage());}}function it(s,t){if(s&1){let e=gC();ws(0,"ds-entity-card",7),Rg("selected",function(a){wf(e);let r=EC();return Cf(r.onEdit(a))}),yl(1,8),ws(2,"button",9),Rg("click",function(a){return a.stopPropagation()}),ws(3,"mat-icon"),QC(4,"more_vert"),hl()(),vl(),hl();}if(s&2){let e=t.$implicit;EC();let n=MC(9);bg("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??aT(6,et)),nI(2),bg("matMenuTriggerFor",n)("matMenuTriggerData",cT(7,tt,e.id));}}function ot(s,t){if(s&1){let e=gC();ws(0,"button",10),Rg("click",function(){let a=wf(e).id,r=EC();return Cf(r.onEdit(a))}),ws(1,"mat-icon"),QC(2,"edit"),hl(),QC(3," Edit "),hl(),ws(4,"button",11),Rg("click",function(){let a=wf(e).id,r=EC();return Cf(r.onDelete(a))}),ws(5,"mat-icon"),QC(6,"delete"),hl(),QC(7," Delete "),hl();}}var Ve=class s{agentCrudApi=g(w);location=g(_m);dialog=g(Re);agents=Gi([]);isLoading=Gi(false);errorMessage=Gi(null);agentItems=ET(()=>this.agents().map(t=>({id:t.name,name:t.name,description:t.description,badges:this.buildBadges(t),groupKey:t.source,groupLabel:t.source==="project"?"Project (~/.coday/)":"Colocated (next to coday.yaml)"})));ngOnInit(){this.loadAgents();}loadAgents(){this.isLoading.set(true),this.errorMessage.set(null),this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents.set(t),this.isLoading.set(false);},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to load agents"),this.isLoading.set(false);}});}onBack(){this.location.back();}onCreate(){this.dialog.open(E,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents();});}onEdit(t){this.agentCrudApi.getAgent(t).subscribe({next:e=>{this.dialog.open(E,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(a=>{a&&this.loadAgents();});},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load agent")});}onDelete(t){confirm(`Are you sure you want to delete agent "${t}"?`)&&this.agentCrudApi.deleteAgent(t).subscribe({next:()=>this.loadAgents(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete agent")});}buildBadges(t){return [t.source==="project"?{label:"project",variant:"info"}:{label:"colocated",variant:"success"}]}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=Fw({type:s,selectors:[["app-agent-list"]],decls:11,vars:5,consts:[["agentCard",""],["cardMenu","matMenu"],[1,"agent-list-page"],["title","Agents","cardMinWidth","260px","contentMaxWidth","1400px","searchPlaceholder","Filter agents\u2026","emptyMessage","No file-based agents found.",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],[1,"agent-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item","",1,"agent-list__delete-item",3,"click"]],template:function(e,n){if(e&1&&(ws(0,"div",2)(1,"ds-entity-list",3),Rg("createRequested",function(){return n.onCreate()}),ws(2,"button",4),Rg("click",function(){return n.onBack()}),ws(3,"mat-icon"),QC(4,"chevron_left"),hl()()(),oC(5,nt,2,1,"div",5),hl(),Eg(6,it,5,9,"ng-template",null,0,mT),ws(8,"mat-menu",null,1),Eg(10,ot,8,0,"ng-template",6),hl()),e&2){let a=MC(7);nI(),bg("items",n.agentItems())("loading",n.isLoading())("showCreate",true)("itemTemplate",a),nI(4),iC(n.errorMessage()?5:-1);}},dependencies:[Wn,ot$1,it$1,hr,Gn,yt,wt,In,De,Be,ya,En],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.agent-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.agent-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"],changeDetection:1})};export{Ve as AgentListComponent};
|
|
1
|
+
import {f}from'./chunk-DMUiJ7oP.js';import {g,bm as xm,R as Re,W as Wi,T as TT,j as jw,h as hr,i as Gn,k as Cs,n as kg,J as JC,m as hl,o as aC,af as wg,ag as ET,A as AC,t as sI,_ as _g,u as cC,B as gy,P,aF as R,K as x,X as z,Y as Ue,Z as zt,a0 as jt,a1 as Vt,a2 as Nt,e as pr,bn as Xt,ai as rm,aj as iT,a3 as ZI,q as dC,bo as uC,a8 as Kg,ak as nm,a6 as QI,v as fC,a5 as Dl,ac as CC,a9 as vC,aa as Cf,ab as Tf,bp as yl,bq as vl,ah as dT,b4 as fT,w as zg,b0 as Xg,a4 as lC,S as Sg,M as Mg}from'./main-YYHD6X7H.js';import {P as Pt}from'./chunk-D2zGvbD2.js';import {T as Tn,S as Sn,n as nt$1,a as ae,l as le,c as ce}from'./chunk-CXgj_KJY.js';import {W as Wn,o as ot$1,i as it$1,I as In,D as De,B as Be,y as ya,E as En}from'./chunk-B13_C_P9.js';import'./chunk-CgNkwpQ7.js';import {y as yt,w as wt,t as ti,Q as Qn,e as ei,Y as Ye$1,f as fn,m as mn,Z as Zn,g as gt,$ as $t,W as Wt,c as cn}from'./chunk-FMHkoXwM.js';var w=class s{http=g(gy);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${encodeURIComponent(t)}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new R(n=>{let a=new FileReader;a.onload=()=>{let r=a.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(n);},a.onerror=()=>n.error(a.error),a.readAsDataURL(e);})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=x({token:s,factory:s.\u0275fac,providedIn:"root"})};function ze(s,t){s&1&&(Cs(0,"p",15),JC(1,"No integrations defined \u2014 agent will have access to all tools."),hl());}function qe(s,t){if(s&1){let e=vC();Cs(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),JC(3,"Integration"),hl(),Cs(4,"input",23),rm("ngModelChange",function(a){let r=Cf(e).$implicit;return iT(r.integration,a)||(r.integration=a),Tf(a)}),hl(),ZI(),hl(),Cs(5,"mat-form-field",24)(6,"mat-label"),JC(7,"Tools (comma-separated)"),hl(),Cs(8,"input",25),rm("ngModelChange",function(a){let r=Cf(e).$implicit;return iT(r.tools,a)||(r.tools=a),Tf(a)}),hl(),ZI(),hl(),Cs(9,"button",26),kg("click",function(){let a=Cf(e).$index,r=CC();return Tf(r.removeIntegrationRow(a))}),Cs(10,"mat-icon"),JC(11,"delete"),hl()()();}if(s&2){let e=t.$implicit;sI(4),nm("ngModel",e.integration),QI(),sI(4),nm("ngModel",e.tools),QI();}}function He(s,t){if(s&1&&(Cs(0,"p",30),JC(1),hl()),s&2){let e=CC(2);sI(),Kg(e.docUploadError);}}function Ge(s,t){s&1&&(Cs(0,"p",15),JC(1,"No mandatory documents defined."),hl());}function Ze(s,t){if(s&1&&Mg(0,"option",35),s&2){let e=t.$implicit;_g("value","documents/"+e);}}function Ke(s,t){if(s&1){let e=vC();Cs(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),JC(3,"Document path"),hl(),Cs(4,"input",33),rm("ngModelChange",function(a){let r=Cf(e).$index,j=CC(2);return iT(j.mandatoryDocs[r],a)||(j.mandatoryDocs[r]=a),Tf(a)}),hl(),ZI(),Cs(5,"datalist",34),dC(6,Ze,1,1,"option",35,lC),hl()(),Cs(8,"button",26),kg("click",function(){let a=Cf(e).$index,r=CC(2);return Tf(r.removeDocRow(a))}),Cs(9,"mat-icon"),JC(10,"delete"),hl()()();}if(s&2){let e=t.$index,n=CC(2);sI(4),nm("ngModel",n.mandatoryDocs[e]),Sg("list","docs-list-"+e),QI(),sI(),_g("id","docs-list-"+e),sI(),fC(n.availableDocuments);}}function Je(s,t){if(s&1){let e=vC();Cs(0,"div",6)(1,"span"),JC(2,"Mandatory Documents"),hl(),Cs(3,"button",27),kg("click",function(){Cf(e);let a=CC();return Tf(a.addDocRow())}),Cs(4,"mat-icon"),JC(5,"add"),hl()(),Cs(6,"label",28)(7,"mat-icon"),JC(8,"upload_file"),hl(),Cs(9,"input",29),kg("change",function(a){Cf(e);let r=CC();return Tf(r.onDocFileSelected(a))}),hl()()(),aC(10,He,2,1,"p",30),aC(11,Ge,2,0,"p",15),dC(12,Ke,11,3,"div",31,uC);}if(s&2){let e=CC();sI(6),zg("uploading",e.isUploadingDoc),sI(3),_g("disabled",e.isUploadingDoc),sI(),cC(e.docUploadError?10:-1),sI(),cC(e.mandatoryDocs.length===0?11:-1),sI(),fC(e.mandatoryDocs);}}function Qe(s,t){s&1&&(Cs(0,"p",15),JC(1,"\u{1F4A1} Documents can be added after the agent is created."),hl());}function Xe(s,t){if(s&1){let e=vC();Cs(0,"div",6),JC(1,"Save to"),hl(),Cs(2,"div",36)(3,"label",37)(4,"input",38),rm("ngModelChange",function(a){Cf(e);let r=CC();return iT(r.location,a)||(r.location=a),Tf(a)}),hl(),ZI(),Cs(5,"div",39)(6,"div",40)(7,"span",41),JC(8,"\u{1F464}"),hl(),Cs(9,"span",42),JC(10,"Project config"),hl()(),Cs(11,"p",43),JC(12),hl()()(),Cs(13,"label",37)(14,"input",44),rm("ngModelChange",function(a){Cf(e);let r=CC();return iT(r.location,a)||(r.location=a),Tf(a)}),hl(),ZI(),Cs(15,"div",39)(16,"div",40)(17,"span",41),JC(18,"\u{1F4E6}"),hl(),Cs(19,"span",42),JC(20,"Colocated"),hl()(),Cs(21,"p",43),JC(22,"Next to coday.yaml in ./agents/ (committable)"),hl()()()(),Cs(23,"p",15),JC(24,"Storage location is permanent and cannot be changed after creation."),hl();}if(s&2){let e=CC();sI(3),zg("selected",e.location==="project"),sI(),nm("ngModel",e.location),QI(),sI(8),Xg("~/.coday/projects/","{","name","}","/agents/ (not committed)"),sI(),zg("selected",e.location==="colocated"),sI(),nm("ngModel",e.location),QI();}}function Ye(s,t){if(s&1&&(Cs(0,"div",17)(1,"span",6),JC(2,"Storage Location"),hl(),Cs(3,"span",45),JC(4),hl(),Cs(5,"p",15),JC(6,"Cannot be changed after creation."),hl()()),s&2){let e=CC();sI(3),zg("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),sI(),Dl(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ");}}function $e(s,t){if(s&1&&(Cs(0,"div",18)(1,"mat-icon"),JC(2,"error"),hl(),Cs(3,"span"),JC(4),hl()()),s&2){let e=CC();sI(4),Kg(e.errorMessage);}}var E=class s{agentCrudApi=g(w);agentApi=g(f);dialogRef=g(z);data=g(Ue);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=false;docUploadError="";location="project";isSaving=false;errorMessage="";isEditMode=false;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,n])=>({integration:e,tools:n?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments();}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]});}addDocRow(){this.mandatoryDocs.push("");}removeDocRow(t){this.mandatoryDocs.splice(t,1);}onDocFileSelected(t){let e=t.target,n=e.files?.[0];n&&(this.isUploadingDoc=true,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,n).subscribe({next:a=>{this.isUploadingDoc=false,this.mandatoryDocs.push(a.relativePath),this.loadAvailableDocuments(),e.value="";},error:a=>{this.isUploadingDoc=false,this.docUploadError=a?.error?.error??a?.message??"Upload failed",e.value="";}}));}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""});}removeIntegrationRow(t){this.integrationRows.splice(t,1);}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",false;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",false;if(!this.description.trim())return this.errorMessage="Description is required",false;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",false;return true}buildDefinition(){let t=this.mandatoryDocs.map(n=>n.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(n=>n.integration.trim()).map(n=>[n.integration.trim(),n.tools.split(",").map(a=>a.trim()).filter(Boolean)])):void 0;return {name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=true,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=false,this.agentApi.clearAllCache(),this.dialogRef.close(true);},error:n=>{this.isSaving=false,this.errorMessage=n?.error?.error||n?.message||"Failed to save agent";}});}cancel(){this.dialogRef.close(false);}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=jw({type:s,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,n){e&1&&(Cs(0,"h2",0),JC(1),hl(),Cs(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),JC(6,"Name"),hl(),Cs(7,"input",3),rm("ngModelChange",function(r){return iT(n.name,r)||(n.name=r),r}),hl(),ZI(),Cs(8,"mat-hint"),JC(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),hl()(),Cs(10,"mat-form-field",2)(11,"mat-label"),JC(12,"Description"),hl(),Cs(13,"textarea",4),rm("ngModelChange",function(r){return iT(n.description,r)||(n.description=r),r}),hl(),ZI(),hl(),Cs(14,"mat-form-field",2)(15,"mat-label"),JC(16,"Instructions"),hl(),Cs(17,"textarea",5),rm("ngModelChange",function(r){return iT(n.instructions,r)||(n.instructions=r),r}),hl(),ZI(),Cs(18,"mat-hint"),JC(19,"System prompt / instructions sent to the AI model"),hl()(),Cs(20,"div",6),JC(21,"AI Configuration"),hl(),Cs(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),JC(25,"AI Provider"),hl(),Cs(26,"input",9),rm("ngModelChange",function(r){return iT(n.aiProvider,r)||(n.aiProvider=r),r}),hl(),ZI(),hl(),Cs(27,"mat-form-field",8)(28,"mat-label"),JC(29,"Model Name"),hl(),Cs(30,"input",10),rm("ngModelChange",function(r){return iT(n.modelName,r)||(n.modelName=r),r}),hl(),ZI(),hl()(),Cs(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),JC(34,"Temperature"),hl(),Cs(35,"input",11),rm("ngModelChange",function(r){return iT(n.temperature,r)||(n.temperature=r),r}),hl(),ZI(),Cs(36,"mat-hint"),JC(37,"Leave empty for model default"),hl()(),Cs(38,"mat-form-field",8)(39,"mat-label"),JC(40,"Max Output Tokens"),hl(),Cs(41,"input",12),rm("ngModelChange",function(r){return iT(n.maxOutputTokens,r)||(n.maxOutputTokens=r),r}),hl(),ZI(),Cs(42,"mat-hint"),JC(43,"Leave empty for model default"),hl()()(),Cs(44,"mat-form-field",2)(45,"mat-label"),JC(46,"OpenAI Assistant ID"),hl(),Cs(47,"input",13),rm("ngModelChange",function(r){return iT(n.openaiAssistantId,r)||(n.openaiAssistantId=r),r}),hl(),ZI(),Cs(48,"mat-hint"),JC(49,"If set, forces aiProvider to openai"),hl()(),Cs(50,"div",6)(51,"span"),JC(52,"Integrations"),hl(),Cs(53,"button",14),kg("click",function(){return n.addIntegrationRow()}),Cs(54,"mat-icon"),JC(55,"add"),hl()()(),aC(56,ze,2,0,"p",15),dC(57,qe,12,2,"div",16,uC),aC(59,Je,14,5)(60,Qe,2,0,"p",15),aC(61,Xe,25,8),aC(62,Ye,7,5,"div",17),aC(63,$e,5,1,"div",18),hl()(),Cs(64,"mat-dialog-actions",19)(65,"button",20),kg("click",function(){return n.cancel()}),JC(66,"Cancel"),hl(),Cs(67,"button",21),kg("click",function(){return n.save()}),JC(68),hl()()),e&2&&(sI(),Kg(n.isEditMode?"Edit Agent":"Create Agent"),sI(6),nm("ngModel",n.name),_g("readonly",n.isEditMode),QI(),sI(6),nm("ngModel",n.description),QI(),sI(4),nm("ngModel",n.instructions),QI(),sI(9),nm("ngModel",n.aiProvider),QI(),sI(4),nm("ngModel",n.modelName),QI(),sI(5),nm("ngModel",n.temperature),QI(),sI(6),nm("ngModel",n.maxOutputTokens),QI(),sI(6),nm("ngModel",n.openaiAssistantId),QI(),sI(9),cC(n.integrationRows.length===0?56:-1),sI(),fC(n.integrationRows),sI(2),cC(n.isEditMode?59:60),sI(2),cC(n.isEditMode?-1:61),sI(),cC(n.isEditMode?62:-1),sI(),cC(n.errorMessage?63:-1),sI(2),_g("disabled",n.isSaving),sI(2),_g("disabled",n.isSaving),sI(),Dl(" ",n.isSaving?"Saving...":"Save"," "));},dependencies:[ti,Qn,ei,Ye$1,fn,mn,Zn,gt,$t,Wt,cn,zt,jt,Vt,Nt,hr,pr,Gn,Tn,Sn,nt$1,ae,le,ce,yt,wt,Pt,Xt],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media(max-width:768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media(max-width:768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"],changeDetection:1})};var et=()=>[],tt=s=>({id:s});function nt(s,t){if(s&1&&(Cs(0,"div",5),JC(1),hl()),s&2){let e=CC();sI(),Kg(e.errorMessage());}}function it(s,t){if(s&1){let e=vC();Cs(0,"ds-entity-card",7),kg("selected",function(a){Cf(e);let r=CC();return Tf(r.onEdit(a))}),yl(1,8),Cs(2,"button",9),kg("click",function(a){return a.stopPropagation()}),Cs(3,"mat-icon"),JC(4,"more_vert"),hl()(),vl(),hl();}if(s&2){let e=t.$implicit;CC();let n=AC(9);_g("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??dT(6,et)),sI(2),_g("matMenuTriggerFor",n)("matMenuTriggerData",fT(7,tt,e.id));}}function ot(s,t){if(s&1){let e=vC();Cs(0,"button",10),kg("click",function(){let a=Cf(e).id,r=CC();return Tf(r.onEdit(a))}),Cs(1,"mat-icon"),JC(2,"edit"),hl(),JC(3," Edit "),hl(),Cs(4,"button",11),kg("click",function(){let a=Cf(e).id,r=CC();return Tf(r.onDelete(a))}),Cs(5,"mat-icon"),JC(6,"delete"),hl(),JC(7," Delete "),hl();}}var Ve=class s{agentCrudApi=g(w);location=g(xm);dialog=g(Re);agents=Wi([]);isLoading=Wi(false);errorMessage=Wi(null);agentItems=TT(()=>this.agents().map(t=>({id:t.name,name:t.name,description:t.description,badges:this.buildBadges(t),groupKey:t.source,groupLabel:t.source==="project"?"Project (~/.coday/)":"Colocated (next to coday.yaml)"})));ngOnInit(){this.loadAgents();}loadAgents(){this.isLoading.set(true),this.errorMessage.set(null),this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents.set(t),this.isLoading.set(false);},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to load agents"),this.isLoading.set(false);}});}onBack(){this.location.back();}onCreate(){this.dialog.open(E,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents();});}onEdit(t){this.agentCrudApi.getAgent(t).subscribe({next:e=>{this.dialog.open(E,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(a=>{a&&this.loadAgents();});},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load agent")});}onDelete(t){confirm(`Are you sure you want to delete agent "${t}"?`)&&this.agentCrudApi.deleteAgent(t).subscribe({next:()=>this.loadAgents(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete agent")});}buildBadges(t){return [t.source==="project"?{label:"project",variant:"info"}:{label:"colocated",variant:"success"}]}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=jw({type:s,selectors:[["app-agent-list"]],decls:11,vars:5,consts:[["agentCard",""],["cardMenu","matMenu"],[1,"agent-list-page"],["title","Agents","cardMinWidth","260px","contentMaxWidth","1400px","searchPlaceholder","Filter agents\u2026","emptyMessage","No file-based agents found.",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],[1,"agent-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item","",1,"agent-list__delete-item",3,"click"]],template:function(e,n){if(e&1&&(Cs(0,"div",2)(1,"ds-entity-list",3),kg("createRequested",function(){return n.onCreate()}),Cs(2,"button",4),kg("click",function(){return n.onBack()}),Cs(3,"mat-icon"),JC(4,"chevron_left"),hl()()(),aC(5,nt,2,1,"div",5),hl(),wg(6,it,5,9,"ng-template",null,0,ET),Cs(8,"mat-menu",null,1),wg(10,ot,8,0,"ng-template",6),hl()),e&2){let a=AC(7);sI(),_g("items",n.agentItems())("loading",n.isLoading())("showCreate",true)("itemTemplate",a),sI(4),cC(n.errorMessage()?5:-1);}},dependencies:[Wn,ot$1,it$1,hr,Gn,yt,wt,In,De,Be,ya,En],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.agent-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.agent-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"],changeDetection:1})};export{Ve as AgentListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p}from'./chunk-
|
|
1
|
+
import {p}from'./chunk-BJld3zB5.js';import {g,ao as V,B as gy,d4 as y,j as jw,aw as gl,J as JC,ax as ml,t as sI,a8 as Kg}from'./main-YYHD6X7H.js';import'./chunk-4uEZjTft.js';import'./chunk-B13_C_P9.js';import'./chunk-CgNkwpQ7.js';import'./chunk-FMHkoXwM.js';var A=class r{route=g(V);http=g(gy);config=g(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(p,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(p,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=jw({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(gl(0,"p",0),JC(1),ml()),t&2&&(sI(),Kg(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {v}from'./chunk-DV_7IOl_.js';import {R,q,J}from'./chunk-CR817PBg.js';import {g,ao as V,G,C as Ce$1,W as Wi,F,T as TT,cd as $f,b as U,z as z$1,a as P$1,j as jw,k as Cs,n as kg,J as JC,m as hl,o as aC,t as sI,a8 as Kg,u as cC,a9 as vC,q as dC,a4 as lC,a3 as ZI,M as Mg,ac as CC,_ as _g,a6 as QI,v as fC,a5 as Dl,cH as iC,aa as Cf,ab as Tf,b$ as UC,S as Sg}from'./main-YYHD6X7H.js';import'./chunk-BJld3zB5.js';import {k as _t,b as _e$1,o as z,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,m as mn,Z as Zn,l as Xn,C as Cn,E as En}from'./chunk-FMHkoXwM.js';import'./chunk-DaoWXYMw.js';import'./chunk-4uEZjTft.js';import'./chunk-B13_C_P9.js';import'./chunk-CgNkwpQ7.js';function se(i,t){i&1&&(Cs(0,"p",5),JC(1,"Loading\u2026"),hl());}function ce(i,t){if(i&1&&(Cs(0,"label",23),Mg(1,"input",24),ZI(),Cs(2,"span"),JC(3),hl()()),i&2){let e=t.$implicit,o=CC(3);sI(),_g("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),QI(),sI(2),Kg(e.label);}}function de(i,t){if(i&1&&(Cs(0,"fieldset",8)(1,"legend",22),JC(2,"Configuration scope"),hl(),dC(3,ce,4,4,"label",23,iC().trackByScope,true),hl()),i&2){let e=CC(2);_g("disabled",e.isEditMode()),sI(3),fC(e.scopeOptions);}}function ue(i,t){if(i&1&&(Cs(0,"option",13),JC(1),hl()),i&2){let e=t.$implicit,o=CC(2);_g("value",e),sI(),Kg(o.authTypeLabel[e]);}}function pe(i,t){i&1&&JC(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(Cs(0,"span",11),JC(1,"*"),hl());}function me(i,t){if(i&1&&(Cs(0,"p",28),JC(1),hl()),i&2){let e=CC(2).$implicit;_g("id","as-hint-"+e.key),sI(),Kg(e.hint);}}function ge(i,t){if(i&1&&(Mg(0,"input",27),ZI(),aC(1,me,2,2,"p",28)),i&2){let e=CC().$implicit;UC("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),_g("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),Sg("aria-describedby",e.hint?"as-hint-"+e.key:null),QI(),sI(),cC(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(Cs(0,"div",9)(1,"label",26),JC(2),aC(3,he,2,0,"span",11),hl(),aC(4,ge,2,9),hl()),i&2){let e,o=t.$implicit,l=CC(3);sI(),_g("for","as-cred-"+o.key),sI(),Dl(" ",o.label," "),sI(),cC(o.required?3:-1),sI(),cC((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(Cs(0,"fieldset",18)(1,"legend",22),JC(2,"Credentials"),hl(),Cs(3,"p",25),JC(4," Values are stored encrypted and masked on read. "),aC(5,pe,1,0),hl(),dC(6,Ce,5,4,"div",9,iC().trackByField,true),hl()),i&2){let e=CC(2);sI(5),cC(e.isEditMode()?5:-1),sI(),fC(e.credentialFields());}}function ye(i,t){if(i&1){let e=vC();Cs(0,"form",7),kg("ngSubmit",function(){Cf(e);let l=CC();return Tf(l.submit())}),aC(1,de,5,1,"fieldset",8),Cs(2,"div",9)(3,"label",10),JC(4,"Auth type "),Cs(5,"span",11),JC(6,"*"),hl()(),Cs(7,"select",12),dC(8,ue,2,2,"option",13,lC),hl(),ZI(),hl(),Cs(10,"div",9)(11,"label",14),JC(12,"Name "),Cs(13,"span",11),JC(14,"*"),hl()(),Mg(15,"input",15),ZI(),hl(),Cs(16,"div",9)(17,"label",16),JC(18,"Description"),hl(),Mg(19,"input",17),ZI(),hl(),aC(20,fe,8,1,"fieldset",18),Cs(21,"div",19)(22,"button",20),JC(23),hl(),Cs(24,"button",21),kg("click",function(){Cf(e);let l=CC();return Tf(l.cancel())}),JC(25,"Cancel"),hl()()();}if(i&2){let e=CC();_g("formGroup",e.form),sI(),cC(e.isPlatformMode?-1:1),sI(6),_g("formControl",e.authTypeControl),QI(),sI(),fC(e.authTypeOptions),sI(7),_g("formControl",e.nameControl),QI(),sI(4),_g("formControl",e.descriptionControl),QI(),sI(),cC(e.credentialFields().length>0?20:-1),sI(2),_g("disabled",e.form.invalid||e.isSubmitting()),sI(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},le=class i{route=g(V);router=g(G);destroyRef=g(Ce$1);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?Wi(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]});descriptionControl=new _t(null);authTypeControl=new _t("ApiKeyAuthSetting",{nonNullable:true,validators:[_e$1.required]});scopeControl=new _t("namespace",{nonNullable:true});form=new z({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new _t("",{nonNullable:true});usernameControl=new _t("",{nonNullable:true});passwordControl=new _t("",{nonNullable:true});tokenControl=new _t("",{nonNullable:true});discoveryUrlControl=new _t("",{nonNullable:true});authorizationUrlControl=new _t("",{nonNullable:true});tokenUrlControl=new _t("",{nonNullable:true});clientIdControl=new _t("",{nonNullable:true});clientSecretControl=new _t("",{nonNullable:true});scopesControl=new _t("",{nonNullable:true});resourceUrlControl=new _t("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=TT(()=>Se[this.selectedAuthType()]);isEditMode=Wi(false);isSubmitting=Wi(false);isLoading=Wi(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||$f(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return z$1(P$1({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return z$1(P$1({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return z$1(P$1({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return z$1(P$1({},l),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return z$1(P$1({},l),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return z$1(P$1({},l),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return z$1(P$1({},l),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=jw({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(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," Auth Settings "),hl(),Cs(6,"h1",4),JC(7),hl()(),aC(8,se,2,0,"p",5)(9,ye,26,8,"form",6),hl()),e&2&&(sI(7),Kg(o.isEditMode()?"Edit auth setting":"New auth setting"),sI(),cC(o.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,mn,Zn,Xn,Cn,En],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
|
|
2
|
+
export{le as AuthSettingFormComponent};
|