@whoz-oss/coday-client 0.248.2 → 0.249.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-UF3D3UUD.js → chunk-3FDPLGME.js} +1 -1
- package/browser/{chunk-Y52DC76K.js → chunk-4KA7TIB4.js} +1 -1
- package/browser/{chunk-V63CBJL3.js → chunk-4NPMNHQN.js} +1 -1
- package/browser/{chunk-Z34N3CUS.js → chunk-4OSUCDSF.js} +1 -1
- package/browser/{chunk-WC55KAEC.js → chunk-4U47ZPZP.js} +1 -1
- package/browser/{chunk-EZSEUOCV.js → chunk-6PGRBK22.js} +2 -2
- package/browser/{chunk-RSGZ7YWF.js → chunk-7HQ3TFIP.js} +1 -1
- package/browser/{chunk-2TDFGQ4U.js → chunk-7P7KJUWV.js} +1 -1
- package/browser/{chunk-2QDRHKK5.js → chunk-7SEGP55P.js} +1 -1
- package/browser/{chunk-VVFVGWIQ.js → chunk-AKLSF437.js} +1 -1
- package/browser/{chunk-5PVR7BPQ.js → chunk-AZOMCTR7.js} +1 -1
- package/browser/chunk-AZSB2H23.js +1 -0
- package/browser/{chunk-XRGYHVGI.js → chunk-B5ZVUFND.js} +1 -1
- package/browser/{chunk-UEGZX4MW.js → chunk-BK6WNBAO.js} +1 -1
- package/browser/{chunk-B4UTEYRE.js → chunk-C7VJCZQE.js} +2 -2
- package/browser/{chunk-TFW43ZTS.js → chunk-CJQ4FDXR.js} +1 -1
- package/browser/{chunk-NMKUE2VW.js → chunk-CLTMZI2I.js} +1 -1
- package/browser/{chunk-NGMAQNX3.js → chunk-CNUJJQAG.js} +3 -3
- package/browser/{chunk-OFAUBLZA.js → chunk-DIJGQPPG.js} +1 -1
- package/browser/{chunk-LVRSSQUD.js → chunk-EMVHTOJY.js} +1 -1
- package/browser/{chunk-KB2ABAWC.js → chunk-F7UYEPIO.js} +1 -1
- package/browser/{chunk-KY3GI5KF.js → chunk-FELDR7HF.js} +1 -1
- package/browser/{chunk-Y42FQQZC.js → chunk-FL2HNVMC.js} +1 -1
- package/browser/chunk-GFK56P4B.js +3 -0
- package/browser/{chunk-PDUSJ4QD.js → chunk-IPWNT3U4.js} +1 -1
- package/browser/{chunk-MWXEF4QG.js → chunk-IWVV3FNS.js} +1 -1
- package/browser/{chunk-GTCP3EYX.js → chunk-J6NBYNRX.js} +1 -1
- package/browser/chunk-JVZA4C5U.js +1 -0
- package/browser/{chunk-H5R3SW7B.js → chunk-KHCLVVXY.js} +1 -1
- package/browser/{chunk-DFU2RM36.js → chunk-KSZNM45C.js} +1 -1
- package/browser/{chunk-J7LPPELB.js → chunk-LPIKNWWZ.js} +1 -1
- package/browser/{chunk-MK6PPMBU.js → chunk-LVZVGPMV.js} +1 -1
- package/browser/{chunk-DIN6OQ3X.js → chunk-MHOEYCWL.js} +1 -1
- package/browser/{chunk-5KKUKGZH.js → chunk-MIVM4FAD.js} +1 -1
- package/browser/{chunk-JYYG7ZUT.js → chunk-MXD6ICBN.js} +1 -1
- package/browser/{chunk-TIO4RSPY.js → chunk-NHUXMXD2.js} +1 -1
- package/browser/{chunk-TCHHDPN6.js → chunk-NLCT6PBH.js} +1 -1
- package/browser/{chunk-OIFNN56R.js → chunk-NQHQFPW5.js} +2 -2
- package/browser/{chunk-DZ2M3NQD.js → chunk-OCMS2KMG.js} +1 -1
- package/browser/{chunk-E6T6QLQT.js → chunk-OO2H5F7U.js} +3 -3
- package/browser/{chunk-YZ7HJLJI.js → chunk-P4UYIBTK.js} +1 -1
- package/browser/{chunk-C3GZ6PYA.js → chunk-P5FCG3WF.js} +1 -1
- package/browser/{chunk-WLQB3UUA.js → chunk-PGEMQVT2.js} +1 -1
- package/browser/{chunk-DPLTZQJN.js → chunk-QYUULQIF.js} +1 -1
- package/browser/{chunk-SGNDHUEQ.js → chunk-ROOPYJTV.js} +1 -1
- package/browser/{chunk-QH6RTNNU.js → chunk-RSTB4RTA.js} +1 -1
- package/browser/{chunk-6JMDCL65.js → chunk-RUXH3KF5.js} +1 -1
- package/browser/{chunk-2XANOO7Y.js → chunk-SN27D3CH.js} +1 -1
- package/browser/{chunk-RXH3NNTB.js → chunk-SVOSTUY5.js} +1 -1
- package/browser/{chunk-WAGXU26A.js → chunk-SXFAR5TU.js} +1 -1
- package/browser/{chunk-VNO76B3S.js → chunk-TTHFWEW7.js} +3 -3
- package/browser/chunk-UAC4ZZCA.js +1 -0
- package/browser/{chunk-J4UAEXFM.js → chunk-UAVOIVZW.js} +1 -1
- package/browser/{chunk-OITCRMRM.js → chunk-VN2SNJFT.js} +1 -1
- package/browser/{chunk-CRODJUF7.js → chunk-WARAZYNV.js} +1 -1
- package/browser/{chunk-BHAZO7U5.js → chunk-WNJYWSOR.js} +1 -1
- package/browser/{chunk-LYDUBL3X.js → chunk-WVXEP3PL.js} +1 -1
- package/browser/{chunk-SKBEA6VH.js → chunk-XIV35L24.js} +1 -1
- package/browser/{chunk-HT3AURU3.js → chunk-XORVTVXX.js} +1 -1
- package/browser/{chunk-CRXIMHRG.js → chunk-XXVFHAN5.js} +1 -1
- package/browser/{chunk-FIDRP4UY.js → chunk-YV2SJQAM.js} +1 -1
- package/browser/{chunk-55CLK4XC.js → chunk-Z3AHFIZF.js} +1 -1
- package/browser/{chunk-JF7QMQ4U.js → chunk-ZEQWC4IU.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-TPEZWDPT.js → main-7VP3QZBV.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-5WX43L4B.js +0 -1
- package/browser/chunk-GS2CQHR7.js +0 -3
- package/browser/chunk-I2ONTIJI.js +0 -1
- package/browser/chunk-TASSC2XX.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-4QBMPKYR.js";import{a as te}from"./chunk-EWQMM44H.js";import"./chunk-NWFFZ2FW.js";import"./chunk-K2ZZYRVT.js";import{e as B,i as G}from"./chunk-VCUQMGKI.js";import{a as D,c as L}from"./chunk-6XX7GME4.js";import{v as Z}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as u,c as O}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import{F as X,c as z,e as P,g as $,h as j,i as q,l as _,n as U,p as W,s as J,w as Y,x as H,y as K,z as Q}from"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as M,Db as f,Fb as p,Ka as a,Tb as l,Ub as C,Vb as N,Wa as V,ca as d,ga as h,ha as b,kb as k,lb as v,m as F,ma as T,mb as y,mc as R,ob as A,pb as x,qb as S,rb as c,sb as i,ta as g,tb as o,ua as w,ub as I}from"./chunk-CHEXA6RY.js";function ie(r,t){r&1&&(i(0,"p",5),l(1,"Loading\u2026"),o())}function re(r,t){if(r&1&&(i(0,"label",10),I(1,"input",29),i(2,"span"),l(3),o()()),r&2){let e=t.$implicit,n=p(2);a(),c("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),a(2),C(e.label)}}function ae(r,t){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let e=t.$implicit;c("value",e.type),a(),C(e.displayName)}}function le(r,t){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let e=t.$implicit;c("value",e),a(),C(e)}}function se(r,t){if(r&1){let e=M();i(0,"div",24)(1,"ds-json-schema-form",30),f("valueChange",function(s){h(e);let m=p(2);return b(m.onParamsChange(s))}),o()()}if(r&2){let e=p(2);a(),c("schema",t)("value",e.initialParams())}}function ce(r,t){if(r&1){let e=M();i(0,"button",31),f("click",function(){h(e);let s=p(2);return b(s.exportYaml())}),l(1),o()}if(r&2){let e=p(2);c("disabled",e.isExporting()),a(),N(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ")}}function me(r,t){if(r&1){let e=M();i(0,"form",7),f("ngSubmit",function(){h(e);let s=p();return b(s.submit())}),i(1,"fieldset",8)(2,"legend",9),l(3,"Scope"),o(),x(4,re,4,4,"label",10,k().trackByScope,!0),o(),i(6,"div",11)(7,"label",12),l(8,"Type "),i(9,"span",13),l(10,"*"),o()(),i(11,"select",14)(12,"option",15),l(13,"Select type"),o(),x(14,ae,2,2,"option",16,k().trackByType,!0),o()(),i(16,"div",11)(17,"label",17),l(18,"Name "),i(19,"span",13),l(20,"*"),o()(),I(21,"input",18),o(),i(22,"div",11)(23,"label",19),l(24,"Description"),o(),I(25,"textarea",20),o(),i(26,"div",11)(27,"label",21),l(28,"Auth Setting"),o(),i(29,"select",22)(30,"option",23),l(31,"None"),o(),x(32,le,2,2,"option",16,A),o()(),v(34,se,2,2,"div",24),i(35,"div",25)(36,"button",26),l(37),o(),v(38,ce,2,2,"button",27),i(39,"button",28),f("click",function(){h(e);let s=p();return b(s.cancel())}),l(40,"Cancel"),o()()()}if(r&2){let e,n=p();c("formGroup",n.form),a(),c("disabled",n.isEditMode()),a(3),S(n.scopeOptions),a(7),c("formControl",n.typeControl),a(3),S(n.integrationTypes()),a(7),c("formControl",n.nameControl),a(4),c("formControl",n.descriptionControl),a(4),c("formControl",n.authSettingNameControl),a(),c("ngValue",null),a(2),S(n.availableAuthSettings()),a(2),y((e=n.schema())?34:-1,e),a(2),c("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),a(),N(" ",n.isEditMode()?"Save changes":"Create"," "),a(),y(n.isEditMode()?38:-1)}}var pe=new Set(["platform","namespace","userOnNs","userGlobal"]),E=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ne=class r{route=d(D);router=d(L);destroyRef=d(T);state=d(ee);integrationTypeController=d(G);authSettingController=d(B);namespaceRole=d(te);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=O(this.isPlatformMode?F(!0):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new q({name:new _("",{nonNullable:!0,validators:[P.required,P.minLength(1)]}),description:new _(null),type:new _("",{nonNullable:!0,validators:[P.required]}),scope:new _("namespace",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=g(!1);isSubmitting=g(!1);isLoading=g(!1);isExporting=g(!1);scopeOptions=[{value:"platform",label:E.platform},{value:"namespace",label:E.namespace},{value:"userOnNs",label:E.userOnNs},{value:"userGlobal",label:E.userGlobal}];authSettingNameControl=new _(null);availableAuthSettings=g([]);paramsValue=g(null);initialParams=g(null);integrationTypes=O(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=O(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=R(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});existingConfig=null;constructor(){w(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(!0),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(u(this.destroyRef)).subscribe(oe=>{this.loadAuthSettingsForScope(oe)});let m=e.get("template");m&&this.hydrateFromTemplate(m)}parseScope(t){return t&&pe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return!t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(!0),this.state.getById(t).pipe(u(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(t){this.isLoading.set(!0),this.state.getById(t).pipe(u(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null)}loadAuthSettingsForScope(t){let e;switch(t){case"platform":e=this.authSettingController.listAuthSetting();break;case"namespace":e=this.authSettingController.listAuthSetting(this.namespaceId);break;case"userOnNs":e=this.authSettingController.listAuthSetting(this.namespaceId,"me");break;case"userGlobal":e=this.authSettingController.listAuthSetting("none","me");break}e.pipe(u(this.destroyRef)).subscribe({next:n=>{let s=n.map(m=>m.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)])},error:()=>this.availableAuthSettings.set([])})}onParamsChange(t){this.paramsValue.set(t)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(u(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(!0),this.state.exportAsYaml(t).pipe(u(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"integration"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(!1)},error:()=>this.isExporting.set(!1)}))}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=V({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],["for","integration-auth-setting",1,"integration-form__label"],["id","integration-auth-setting",1,"integration-form__select",3,"formControl"],[3,"ngValue"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return n.cancel()}),i(3,"span",3),l(4,"\u2190"),o(),l(5," Integrations "),o(),i(6,"h1",4),l(7),o()(),v(8,ie,2,0,"p",5)(9,me,41,11,"form",6),o()),e&2&&(a(7),C(n.isEditMode()?"Edit integration":"New integration"),a(),y(n.isLoading()?8:9))},dependencies:[X,U,K,Q,z,H,W,$,j,J,Y,Z],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"],changeDetection:0})};export{ne as IntegrationFormComponent};
|
|
1
|
+
import{a as ee}from"./chunk-4QBMPKYR.js";import{a as te}from"./chunk-EWQMM44H.js";import"./chunk-NWFFZ2FW.js";import"./chunk-K2ZZYRVT.js";import{e as B,i as G}from"./chunk-VCUQMGKI.js";import{a as D,c as L}from"./chunk-6XX7GME4.js";import{v as Z}from"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import"./chunk-SPV5SLNS.js";import{a as u,c as O}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import{F as X,c as z,e as P,g as $,h as j,i as q,l as _,n as U,p as W,s as J,w as Y,x as H,y as K,z as Q}from"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as M,Db as f,Fb as p,Ka as a,Tb as l,Ub as C,Vb as N,Wa as V,ca as d,ga as h,ha as b,kb as k,lb as v,m as F,ma as T,mb as y,mc as R,ob as A,pb as x,qb as S,rb as c,sb as i,ta as g,tb as o,ua as w,ub as I}from"./chunk-CHEXA6RY.js";function ie(r,t){r&1&&(i(0,"p",5),l(1,"Loading\u2026"),o())}function re(r,t){if(r&1&&(i(0,"label",10),I(1,"input",29),i(2,"span"),l(3),o()()),r&2){let e=t.$implicit,n=p(2);a(),c("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),a(2),C(e.label)}}function ae(r,t){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let e=t.$implicit;c("value",e.type),a(),C(e.displayName)}}function le(r,t){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let e=t.$implicit;c("value",e),a(),C(e)}}function se(r,t){if(r&1){let e=M();i(0,"div",24)(1,"ds-json-schema-form",30),f("valueChange",function(s){h(e);let m=p(2);return b(m.onParamsChange(s))}),o()()}if(r&2){let e=p(2);a(),c("schema",t)("value",e.initialParams())}}function ce(r,t){if(r&1){let e=M();i(0,"button",31),f("click",function(){h(e);let s=p(2);return b(s.exportYaml())}),l(1),o()}if(r&2){let e=p(2);c("disabled",e.isExporting()),a(),N(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ")}}function me(r,t){if(r&1){let e=M();i(0,"form",7),f("ngSubmit",function(){h(e);let s=p();return b(s.submit())}),i(1,"fieldset",8)(2,"legend",9),l(3,"Scope"),o(),x(4,re,4,4,"label",10,k().trackByScope,!0),o(),i(6,"div",11)(7,"label",12),l(8,"Type "),i(9,"span",13),l(10,"*"),o()(),i(11,"select",14)(12,"option",15),l(13,"Select type"),o(),x(14,ae,2,2,"option",16,k().trackByType,!0),o()(),i(16,"div",11)(17,"label",17),l(18,"Name "),i(19,"span",13),l(20,"*"),o()(),I(21,"input",18),o(),i(22,"div",11)(23,"label",19),l(24,"Description"),o(),I(25,"textarea",20),o(),i(26,"div",11)(27,"label",21),l(28,"Auth Setting"),o(),i(29,"select",22)(30,"option",23),l(31,"None"),o(),x(32,le,2,2,"option",16,A),o()(),v(34,se,2,2,"div",24),i(35,"div",25)(36,"button",26),l(37),o(),v(38,ce,2,2,"button",27),i(39,"button",28),f("click",function(){h(e);let s=p();return b(s.cancel())}),l(40,"Cancel"),o()()()}if(r&2){let e,n=p();c("formGroup",n.form),a(),c("disabled",n.isEditMode()),a(3),S(n.scopeOptions),a(7),c("formControl",n.typeControl),a(3),S(n.integrationTypes()),a(7),c("formControl",n.nameControl),a(4),c("formControl",n.descriptionControl),a(4),c("formControl",n.authSettingNameControl),a(),c("ngValue",null),a(2),S(n.availableAuthSettings()),a(2),y((e=n.schema())?34:-1,e),a(2),c("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),a(),N(" ",n.isEditMode()?"Save changes":"Create"," "),a(),y(n.isEditMode()?38:-1)}}var pe=new Set(["platform","namespace","userOnNs","userGlobal"]),E=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ne=class r{route=d(D);router=d(L);destroyRef=d(T);state=d(ee);integrationTypeController=d(G);authSettingController=d(B);namespaceRole=d(te);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=O(this.isPlatformMode?F(!0):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new q({name:new _("",{nonNullable:!0,validators:[P.required,P.minLength(1)]}),description:new _(null),type:new _("",{nonNullable:!0,validators:[P.required]}),scope:new _("namespace",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=g(!1);isSubmitting=g(!1);isLoading=g(!1);isExporting=g(!1);scopeOptions=[{value:"platform",label:E.platform},{value:"namespace",label:E.namespace},{value:"userOnNs",label:E.userOnNs},{value:"userGlobal",label:E.userGlobal}];authSettingNameControl=new _(null);availableAuthSettings=g([]);paramsValue=g(null);initialParams=g(null);integrationTypes=O(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=O(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=R(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});existingConfig=null;constructor(){w(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(!0),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s),this.loadAuthSettingsForScope(s),this.scopeControl.valueChanges.pipe(u(this.destroyRef)).subscribe(oe=>{this.loadAuthSettingsForScope(oe)});let m=e.get("template");m&&this.hydrateFromTemplate(m)}parseScope(t){return t&&pe.has(t)?t:"namespace"}deriveScopeFromConfig(t){return!t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(!0),this.state.getById(t).pipe(u(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e;let n=this.deriveScopeFromConfig(e);this.scopeControl.setValue(n),this.applyConfigToForm(e),this.loadAuthSettingsForScope(n),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(t){this.isLoading.set(!0),this.state.getById(t).pipe(u(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters),this.authSettingNameControl.setValue(t.authSettingName??null)}loadAuthSettingsForScope(t){let e;switch(t){case"platform":e=this.authSettingController.listAuthSetting();break;case"namespace":e=this.authSettingController.listAuthSetting(this.namespaceId);break;case"userOnNs":e=this.authSettingController.listAuthSetting(this.namespaceId,"me");break;case"userGlobal":e=this.authSettingController.listAuthSetting("none","me");break}e.pipe(u(this.destroyRef)).subscribe({next:n=>{let s=n.map(m=>m.name).filter(Boolean);this.availableAuthSettings.set([...new Set(s)])},error:()=>this.availableAuthSettings.set([])})}onParamsChange(t){this.paramsValue.set(t)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(u(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(!0),this.state.exportAsYaml(t).pipe(u(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),m=document.createElement("a");m.href=s,m.download=`${this.existingConfig?.name??"integration"}.yaml`,m.click(),URL.revokeObjectURL(s),this.isExporting.set(!1)},error:()=>this.isExporting.set(!1)}))}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=V({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],["for","integration-auth-setting",1,"integration-form__label"],["id","integration-auth-setting",1,"integration-form__select",3,"formControl"],[3,"ngValue"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return n.cancel()}),i(3,"span",3),l(4,"\u2190"),o(),l(5," Integrations "),o(),i(6,"h1",4),l(7),o()(),v(8,ie,2,0,"p",5)(9,me,41,11,"form",6),o()),e&2&&(a(7),C(n.isEditMode()?"Edit integration":"New integration"),a(),y(n.isLoading()?8:9))},dependencies:[X,U,K,Q,z,H,W,$,j,J,Y,Z],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"],changeDetection:0})};export{ne as IntegrationFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as X}from"./chunk-XZIT26QS.js";import{c as T}from"./chunk-6XX7GME4.js";import{A as Q,s as W,z as J}from"./chunk-
|
|
1
|
+
import{a as X}from"./chunk-XZIT26QS.js";import{c as T}from"./chunk-6XX7GME4.js";import{A as Q,s as W,z as J}from"./chunk-TTHFWEW7.js";import{a as j,b as N,c as H}from"./chunk-VMYKE4ZC.js";import{Bb as b,Cb as S,D as R,Db as c,Eb as A,Fb as u,Ka as l,Pb as B,Rb as F,S as P,Tb as p,Ub as M,Vb as z,Wa as y,Xb as K,ab as L,ca as v,ga as d,ha as g,jc as $,lb as _,m as U,ma as O,mb as f,mc as k,pb as q,pc as C,qb as V,qc as i,rb as h,sb as a,ta as I,tb as s,u as E,vb as x,wb as G}from"./chunk-CHEXA6RY.js";var te=(n,t)=>t.id;function ne(n,t){n&1&&(x(0,"option",3),p(1,"All namespaces"),G())}function oe(n,t){if(n&1&&(x(0,"option",4),p(1),G()),n&2){let e=t.$implicit;S("value",e.id),l(),M(e.name)}}var w=class n{namespaces=i.required();value=i(null);includeAllOption=i(!1);valueChange=C();onChange(t){let e=t.target.value;this.valueChange.emit(e===""?null:e)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=y({type:n,selectors:[["agentos-namespace-select"]],inputs:{namespaces:[1,"namespaces"],value:[1,"value"],includeAllOption:[1,"includeAllOption"]},outputs:{valueChange:"valueChange"},decls:7,vars:2,consts:[[1,"namespace-select"],[1,"namespace-select__label"],[1,"namespace-select__control",3,"change","value"],["value",""],[3,"value"]],template:function(e,o){e&1&&(x(0,"label",0)(1,"span",1),p(2,"Namespace"),G(),x(3,"select",2),A("change",function(m){return o.onChange(m)}),_(4,ne,2,0,"option",3),q(5,oe,2,2,"option",4,te),G()()),e&2&&(l(3),S("value",o.value()??""),l(),f(o.includeAllOption()?4:-1),l(),V(o.namespaces()))},styles:[".namespace-select[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem}.namespace-select__label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);white-space:nowrap}.namespace-select__control[_ngcontent-%COMP%]{padding:.35rem .6rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.875rem;font-family:inherit;cursor:pointer}.namespace-select__control[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}"],changeDetection:0})};function re(n,t){if(n&1){let e=b();a(0,"span",6),p(1,"Delete?"),s(),a(2,"ds-icon-button",7),c("action",function(){d(e);let r=u();return g(r.onDeleteConfirmed())}),s(),a(3,"ds-icon-button",8),c("action",function(){d(e);let r=u();return g(r.onDeleteCancelled())}),s()}}function ie(n,t){if(n&1){let e=b();a(0,"ds-kebab-menu",9),c("itemSelected",function(r){d(e);let m=u();return g(m.onMenuAction(r))}),s()}if(n&2){let e=u();h("items",e.menuItems)}}var D=class n{router=v(T);userGroup=i.required();namespaceId=i.required();returnTo=i(void 0);deleteRequested=C();pendingDelete=I(!1);menuItems=[{key:"edit",label:"Edit group",icon:"edit"},{key:"delete",label:"Delete group",icon:"delete",variant:"danger"}];get agentCount(){return this.userGroup().agentIds.length}onMenuAction(t){switch(t){case"edit":this.router.navigate(["/agentos",this.namespaceId(),"user-groups",this.userGroup().userGroupId,"edit"],{queryParams:this.returnTo()?{returnTo:this.returnTo()}:{}});break;case"delete":this.pendingDelete.set(!0);break}}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.userGroup())}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=y({type:n,selectors:[["agentos-user-group-item"]],inputs:{userGroup:[1,"userGroup"],namespaceId:[1,"namespaceId"],returnTo:[1,"returnTo"]},outputs:{deleteRequested:"deleteRequested"},decls:9,vars:8,consts:[["role","listitem",1,"user-group-item"],[1,"user-group-item__body"],[1,"user-group-item__name"],[1,"user-group-item__meta"],[1,"user-group-item__actions"],[3,"items"],[1,"user-group-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,o){e&1&&(a(0,"div",0)(1,"div",1)(2,"span",2),p(3),s(),a(4,"span",3),p(5),s()(),a(6,"div",4),_(7,re,4,0)(8,ie,1,1,"ds-kebab-menu",5),s()()),e&2&&(F("user-group-item--pending-delete",o.pendingDelete()),l(3),M(o.userGroup().name),l(2),K(" ",o.agentCount," ",o.agentCount===1?"agent":"agents"," \xB7 ",o.userGroup().userCount," ",o.userGroup().userCount===1?"member":"members"," "),l(2),f(o.pendingDelete()?7:8))},dependencies:[Q,W],styles:[".user-group-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.user-group-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.user-group-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.user-group-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-group-item__meta[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-group-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.user-group-item[_ngcontent-%COMP%]:hover .user-group-item__actions[_ngcontent-%COMP%], .user-group-item[_ngcontent-%COMP%]:focus-within .user-group-item__actions[_ngcontent-%COMP%], .user-group-item--pending-delete[_ngcontent-%COMP%] .user-group-item__actions[_ngcontent-%COMP%]{opacity:1}.user-group-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};function ae(n,t){if(n&1){let e=b();a(0,"button",4),c("click",function(){d(e);let r=u();return g(r.onBack())}),p(1),s()}n&2&&(l(),z("\u2190 ",t))}function se(n,t){if(n&1){let e=b();a(0,"agentos-namespace-select",5),c("valueChange",function(r){d(e);let m=u();return g(m.onNamespaceChange(r))}),s()}if(n&2){let e=u();h("namespaces",t)("value",e.namespaceId())}}function le(n,t){if(n&1){let e=b();a(0,"agentos-user-group-item",7),c("deleteRequested",function(r){d(e);let m=u(2);return g(m.deleteGroup(r))}),s()}if(n&2){let e=u(2);h("userGroup",t)("namespaceId",e.namespaceId())("returnTo",e.returnTo())}}function ue(n,t){if(n&1&&_(0,le,1,3,"agentos-user-group-item",6),n&2){let e,o=t.$implicit,r=u();f((e=r.resolveGroup(o.id))?0:-1,e)}}var ee=class n{router=v(T);destroyRef=v(O);userGroupState=v(X);namespaceId=i.required();backLabel=i(void 0);namespaces=i(void 0);hideTitle=i(!1);returnTo=i(void 0);backRequested=C();namespaceChange=C();refresh=I(0);groups=H(E([N(this.namespaceId),N(this.refresh)]).pipe(P(([t])=>this.userGroupState.listByNamespace(t).pipe(R(e=>(console.error("[UserGroupList] Failed to load user groups",e),U([])))))),{initialValue:[]});groupItems=k(()=>this.groups().map(t=>({id:t.userGroupId,name:t.name})));groupsById=k(()=>new Map(this.groups().map(t=>[t.userGroupId,t])));resolveGroup(t){return this.groupsById().get(t)??null}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId(),"user-groups","new"],{queryParams:this.returnTo()?{returnTo:this.returnTo()}:{}})}deleteGroup(t){this.userGroupState.delete(t.userGroupId).pipe(j(this.destroyRef)).subscribe(()=>this.refresh.update(e=>e+1))}onBack(){this.backRequested.emit()}onNamespaceChange(t){t&&this.namespaceChange.emit(t)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=y({type:n,selectors:[["agentos-user-group-list"]],inputs:{namespaceId:[1,"namespaceId"],backLabel:[1,"backLabel"],namespaces:[1,"namespaces"],hideTitle:[1,"hideTitle"],returnTo:[1,"returnTo"]},outputs:{backRequested:"backRequested",namespaceChange:"namespaceChange"},decls:5,vars:5,consts:[["groupItemTpl",""],["title","User Groups","emptyMessage","No user groups yet. Create one above.","cardMinWidth","400px",3,"createRequested","hideTitle","items","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"user-group-list__back"],["toolbar-start","",3,"namespaces","value"],["toolbar-start","","type","button",1,"user-group-list__back",3,"click"],["toolbar-start","",3,"valueChange","namespaces","value"],[3,"userGroup","namespaceId","returnTo"],[3,"deleteRequested","userGroup","namespaceId","returnTo"]],template:function(e,o){if(e&1&&(a(0,"ds-entity-list",1),c("createRequested",function(){return o.openCreateForm()}),_(1,ae,2,1,"button",2)(2,se,1,2,"agentos-namespace-select",3),s(),L(3,ue,1,1,"ng-template",null,0,$)),e&2){let r,m=B(4);h("hideTitle",o.hideTitle())("items",o.groupItems())("showCreate",!0)("itemTemplate",m),l(),f((r=o.backLabel())?1:(r=o.namespaces())?2:-1,r)}},dependencies:[J,D,w],styles:[".user-group-list__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.user-group-list__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};export{w as a,D as b,ee as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as J,c as Q}from"./chunk-C3GZ6PYA.js";import{a as H}from"./chunk-C6PO7H3U.js";import{j as G,k as V}from"./chunk-VCUQMGKI.js";import{a as q,c as U}from"./chunk-6XX7GME4.js";import{A as W,o as j,s as K,z as $}from"./chunk-VNO76B3S.js";import{a as T,b as F,c as z}from"./chunk-VMYKE4ZC.js";import{Bb as C,D as R,Db as m,Fb as l,Ka as d,Pb as P,Rb as D,S as E,Tb as u,Ub as A,Wa as v,ab as O,ca as p,ga as g,ha as _,jb as N,jc as L,lb as b,m as S,ma as w,mb as f,mc as M,pc as x,qc as h,rb as c,sb as o,t as B,ta as y,tb as r}from"./chunk-CHEXA6RY.js";function ee(s,t){if(s&1&&(o(0,"span",3),u(1),r()),s&2){let e=l();d(),A(e.subtitle)}}var I=class s{user=h.required();editRequested=x();deleteRequested=x();menuItems=[{key:"edit",label:"Edit user",icon:"edit"},{key:"delete",label:"Delete user",icon:"delete",variant:"danger"}];get displayName(){let{firstname:t,lastname:e,email:n}=this.user();return[t,e].filter(Boolean).join(" ")||n||"\u2014"}get subtitle(){return this.user().email??this.user().externalId??""}onMenuAction(t){switch(t){case"edit":this.editRequested.emit(this.user());break;case"delete":confirm(`Delete user "${this.displayName}"?`)&&this.deleteRequested.emit(this.user());break}}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=v({type:s,selectors:[["agentos-user-item"]],inputs:{user:[1,"user"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem","dsBlueprint","",1,"user-item"],[1,"user-item__body"],[1,"user-item__name"],[1,"user-item__subtitle"],[1,"user-item__actions"],[3,"itemSelected","items"]],template:function(e,n){e&1&&(o(0,"div",0)(1,"div",1)(2,"span",2),u(3),r(),b(4,ee,2,1,"span",3),r(),o(5,"div",4)(6,"ds-kebab-menu",5),m("itemSelected",function(a){return n.onMenuAction(a)}),r()()()),e&2&&(d(3),A(n.displayName),d(),f(n.subtitle?4:-1),d(2),c("items",n.menuItems))},dependencies:[j,W],styles:[".user-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;width:100%;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);box-sizing:border-box;overflow:visible;transition:border-color .15s ease}.user-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.user-item__body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.user-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__subtitle[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;flex-shrink:0;opacity:0;transition:opacity .15s ease}.user-item[_ngcontent-%COMP%]:hover .user-item__actions[_ngcontent-%COMP%], .user-item[_ngcontent-%COMP%]:focus-within .user-item__actions[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})};function te(s,t){if(s&1){let e=C();o(0,"agentos-namespace-select",4),m("valueChange",function(i){g(e);let a=l();return _(a.onNamespaceChange(i))}),r()}if(s&2){let e=l();c("namespaces",t)("value",e.selectedNamespaceId())("includeAllOption",!0)}}function ne(s,t){if(s&1){let e=C();o(0,"ds-icon-button",5),m("action",function(){g(e);let i=l();return _(i.goBack())}),r()}}function se(s,t){if(s&1){let e=C();o(0,"agentos-user-item",7),m("editRequested",function(i){g(e);let a=l(2);return _(a.navigateToEdit(i))})("deleteRequested",function(i){g(e);let a=l(2);return _(a.deleteUser(i))}),r()}s&2&&c("user",t)}function ie(s,t){if(s&1&&b(0,se,1,1,"agentos-user-item",6),s&2){let e,n=t.$implicit,i=l();f((e=i.resolveUser(n.id))?0:-1,e)}}var k=class s{router=p(U);destroyRef=p(w);userAdminState=p(H);namespaceMembership=p(V);showBackButton=h(!0);namespaces=h(void 0);selectedNamespaceId=h(null);hideTitle=h(!1);namespaceFilterChange=x();isLoading=this.userAdminState.isLoading;namespaceUserIds=z(F(this.selectedNamespaceId).pipe(E(t=>t?this.namespaceMembership.getMembersNamespaceMembership(t).pipe(B(e=>new Set(e.map(n=>n.id))),R(e=>(console.error("[UserList] Failed to load namespace users",e),S(null)))):S(null))),{initialValue:null});userItems=M(()=>{let t=this.namespaceUserIds();return this.userAdminState.users().filter(e=>t===null||t.has(e.id??"")).map(e=>({id:e.id??"",name:[e.firstname,e.lastname].filter(Boolean).join(" ")||e.email||"\u2014",description:e.email}))});get usersById(){return new Map(this.userAdminState.users().map(t=>[t.id??"",t]))}ngOnInit(){this.userAdminState.loadAll().pipe(T(this.destroyRef)).subscribe()}onNamespaceChange(t){this.namespaceFilterChange.emit(t)}goBack(){this.router.navigate(["/agentos","admin"])}navigateToCreate(){this.router.navigate(["/agentos/admin/users/new"])}navigateToEdit(t){this.router.navigate(["/agentos/admin/users",t.id??"","edit"])}deleteUser(t){this.userAdminState.deleteUser(t.id??"").pipe(T(this.destroyRef)).subscribe()}resolveUser(t){return this.usersById.get(t)??null}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=v({type:s,selectors:[["agentos-user-list"]],inputs:{showBackButton:[1,"showBackButton"],namespaces:[1,"namespaces"],selectedNamespaceId:[1,"selectedNamespaceId"],hideTitle:[1,"hideTitle"]},outputs:{namespaceFilterChange:"namespaceFilterChange"},decls:5,vars:5,consts:[["userItemTpl",""],["title","Users","emptyMessage","No users found.","cardMinWidth","320px",3,"createRequested","hideTitle","items","showCreate","itemTemplate"],["toolbar-start","",3,"namespaces","value","includeAllOption"],["toolbar-start","","icon","arrow_back","title","Back"],["toolbar-start","",3,"valueChange","namespaces","value","includeAllOption"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"user"],[3,"editRequested","deleteRequested","user"]],template:function(e,n){if(e&1&&(o(0,"ds-entity-list",1),m("createRequested",function(){return n.navigateToCreate()}),b(1,te,1,3,"agentos-namespace-select",2)(2,ne,1,0,"ds-icon-button",3),r(),O(3,ie,1,1,"ng-template",null,0,L)),e&2){let i,a=P(4);c("hideTitle",n.hideTitle())("items",n.userItems())("showCreate",!0)("itemTemplate",a),d(),f((i=n.namespaces())?1:n.showBackButton()?2:-1,i)}},dependencies:[$,I,K,J],encapsulation:2,changeDetection:0})};function re(s,t){if(s&1){let e=C();o(0,"agentos-user-list",9),m("namespaceFilterChange",function(i){g(e);let a=l();return _(a.onUsersNamespaceChange(i))}),r()}if(s&2){let e=l();c("showBackButton",!1)("hideTitle",!0)("namespaces",e.namespaces())("selectedNamespaceId",e.usersNamespaceFilter())}}function oe(s,t){s&1&&(o(0,"p",10),u(1,"No namespaces yet. Create one before managing groups."),r())}function ae(s,t){if(s&1){let e=C();o(0,"agentos-user-group-list",12),m("namespaceChange",function(i){g(e);let a=l(2);return _(a.onGroupsNamespaceChange(i))}),r()}if(s&2){let e=l(2);c("namespaceId",t)("hideTitle",!0)("namespaces",e.namespaces())("returnTo",e.returnTo())}}function le(s,t){if(s&1&&b(0,oe,2,0,"p",10)(1,ae,1,4,"agentos-user-group-list",11),s&2){let e,n=l();f(n.namespaces().length===0?0:(e=n.groupsNamespaceId())?1:-1,e)}}var Z=class s{router=p(U);route=p(q);destroyRef=p(w);namespaceController=p(G);activeTab=y(this.route.snapshot.queryParamMap.get("tab")==="groups"?"groups":"users");namespaces=y([]);usersNamespaceFilter=y(null);groupsNamespaceId=y(null);returnTo=M(()=>{let t=this.groupsNamespaceId();return t?`/agentos/admin/users?tab=groups&ns=${t}`:"/agentos/admin/users?tab=groups"});constructor(){let t=this.route.snapshot.queryParamMap.get("ns");this.namespaceController.listAllNamespace().pipe(T(this.destroyRef)).subscribe(e=>{let n=e.filter(a=>a.role!=="MEMBER");this.namespaces.set(n);let i=t&&n.some(a=>a.id===t)?t:n[0]?.id??null;this.groupsNamespaceId.set(i)})}setTab(t){this.activeTab.set(t)}onUsersNamespaceChange(t){this.usersNamespaceFilter.set(t)}onGroupsNamespaceChange(t){this.groupsNamespaceId.set(t)}goBack(){this.router.navigate(["/agentos","admin"])}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=v({type:s,selectors:[["agentos-admin-users-groups"]],decls:14,vars:8,consts:[[1,"admin-users-groups"],[1,"admin-users-groups__header"],["type","button",1,"admin-users-groups__back",3,"click"],[1,"admin-users-groups__title"],["role","tablist","aria-label","Users and Groups",1,"admin-users-groups__tabs"],["id","admin-tab-users","type","button","role","tab","aria-controls","admin-users-groups-panel",1,"admin-users-groups__tab",3,"click"],["id","admin-tab-groups","type","button","role","tab","aria-controls","admin-users-groups-panel",1,"admin-users-groups__tab",3,"click"],["id","admin-users-groups-panel","role","tabpanel","tabindex","0",1,"admin-users-groups__panel"],[3,"showBackButton","hideTitle","namespaces","selectedNamespaceId"],[3,"namespaceFilterChange","showBackButton","hideTitle","namespaces","selectedNamespaceId"],[1,"admin-users-groups__empty"],[3,"namespaceId","hideTitle","namespaces","returnTo"],[3,"namespaceChange","namespaceId","hideTitle","namespaces","returnTo"]],template:function(e,n){e&1&&(o(0,"div",0)(1,"header",1)(2,"button",2),m("click",function(){return n.goBack()}),u(3,"\u2190 Admin"),r(),o(4,"h1",3),u(5,"Users & Groups"),r()(),o(6,"div",4)(7,"button",5),m("click",function(){return n.setTab("users")}),u(8," Users "),r(),o(9,"button",6),m("click",function(){return n.setTab("groups")}),u(10," Groups "),r()(),o(11,"div",7),b(12,re,1,4,"agentos-user-list",8)(13,le,2,1),r()()),e&2&&(d(7),D("admin-users-groups__tab--active",n.activeTab()==="users"),N("aria-selected",n.activeTab()==="users"),d(2),D("admin-users-groups__tab--active",n.activeTab()==="groups"),N("aria-selected",n.activeTab()==="groups"),d(2),N("aria-labelledby",n.activeTab()==="users"?"admin-tab-users":"admin-tab-groups"),d(),f(n.activeTab()==="users"?12:13))},dependencies:[k,Q],styles:[".admin-users-groups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1.5rem 1rem 0;--entity-list-toolbar-max-width: 900px}.admin-users-groups__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;max-width:900px;margin:0 auto;width:100%}.admin-users-groups__back[_ngcontent-%COMP%]{align-self:flex-start;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.admin-users-groups__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.admin-users-groups__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.admin-users-groups__tabs[_ngcontent-%COMP%]{display:inline-flex;gap:.25rem;padding:.25rem;border-radius:10px;background:var(--color-surface-hover, rgba(0, 0, 0, .05));border:1px solid var(--color-border, rgba(0, 0, 0, .08));max-width:900px;margin:0 auto;width:fit-content;align-self:center}.admin-users-groups__tab[_ngcontent-%COMP%]{padding:.4rem 1.25rem;border-radius:8px;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.9rem;font-family:inherit;font-weight:500;cursor:pointer;transition:background .15s ease,color .15s ease}.admin-users-groups__tab[_ngcontent-%COMP%]:hover{color:var(--color-text, #1d1d1f)}.admin-users-groups__tab--active[_ngcontent-%COMP%]{background:var(--color-bg-surface, #fff);color:var(--color-text, #1d1d1f);box-shadow:0 1px 2px #00000014}.admin-users-groups__empty[_ngcontent-%COMP%]{max-width:900px;margin:1rem auto;width:100%;color:var(--color-text-secondary, #6e6e73);font-size:.9rem}"],changeDetection:0})};export{I as a,k as b,Z as c};
|
|
1
|
+
import{a as J,c as Q}from"./chunk-P5FCG3WF.js";import{a as H}from"./chunk-C6PO7H3U.js";import{j as G,k as V}from"./chunk-VCUQMGKI.js";import{a as q,c as U}from"./chunk-6XX7GME4.js";import{A as W,o as j,s as K,z as $}from"./chunk-TTHFWEW7.js";import{a as T,b as F,c as z}from"./chunk-VMYKE4ZC.js";import{Bb as C,D as R,Db as m,Fb as l,Ka as d,Pb as P,Rb as D,S as E,Tb as u,Ub as A,Wa as v,ab as O,ca as p,ga as g,ha as _,jb as N,jc as L,lb as b,m as S,ma as w,mb as f,mc as M,pc as x,qc as h,rb as c,sb as o,t as B,ta as y,tb as r}from"./chunk-CHEXA6RY.js";function ee(s,t){if(s&1&&(o(0,"span",3),u(1),r()),s&2){let e=l();d(),A(e.subtitle)}}var I=class s{user=h.required();editRequested=x();deleteRequested=x();menuItems=[{key:"edit",label:"Edit user",icon:"edit"},{key:"delete",label:"Delete user",icon:"delete",variant:"danger"}];get displayName(){let{firstname:t,lastname:e,email:n}=this.user();return[t,e].filter(Boolean).join(" ")||n||"\u2014"}get subtitle(){return this.user().email??this.user().externalId??""}onMenuAction(t){switch(t){case"edit":this.editRequested.emit(this.user());break;case"delete":confirm(`Delete user "${this.displayName}"?`)&&this.deleteRequested.emit(this.user());break}}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=v({type:s,selectors:[["agentos-user-item"]],inputs:{user:[1,"user"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem","dsBlueprint","",1,"user-item"],[1,"user-item__body"],[1,"user-item__name"],[1,"user-item__subtitle"],[1,"user-item__actions"],[3,"itemSelected","items"]],template:function(e,n){e&1&&(o(0,"div",0)(1,"div",1)(2,"span",2),u(3),r(),b(4,ee,2,1,"span",3),r(),o(5,"div",4)(6,"ds-kebab-menu",5),m("itemSelected",function(a){return n.onMenuAction(a)}),r()()()),e&2&&(d(3),A(n.displayName),d(),f(n.subtitle?4:-1),d(2),c("items",n.menuItems))},dependencies:[j,W],styles:[".user-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;width:100%;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);box-sizing:border-box;overflow:visible;transition:border-color .15s ease}.user-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.user-item__body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.user-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__subtitle[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;flex-shrink:0;opacity:0;transition:opacity .15s ease}.user-item[_ngcontent-%COMP%]:hover .user-item__actions[_ngcontent-%COMP%], .user-item[_ngcontent-%COMP%]:focus-within .user-item__actions[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})};function te(s,t){if(s&1){let e=C();o(0,"agentos-namespace-select",4),m("valueChange",function(i){g(e);let a=l();return _(a.onNamespaceChange(i))}),r()}if(s&2){let e=l();c("namespaces",t)("value",e.selectedNamespaceId())("includeAllOption",!0)}}function ne(s,t){if(s&1){let e=C();o(0,"ds-icon-button",5),m("action",function(){g(e);let i=l();return _(i.goBack())}),r()}}function se(s,t){if(s&1){let e=C();o(0,"agentos-user-item",7),m("editRequested",function(i){g(e);let a=l(2);return _(a.navigateToEdit(i))})("deleteRequested",function(i){g(e);let a=l(2);return _(a.deleteUser(i))}),r()}s&2&&c("user",t)}function ie(s,t){if(s&1&&b(0,se,1,1,"agentos-user-item",6),s&2){let e,n=t.$implicit,i=l();f((e=i.resolveUser(n.id))?0:-1,e)}}var k=class s{router=p(U);destroyRef=p(w);userAdminState=p(H);namespaceMembership=p(V);showBackButton=h(!0);namespaces=h(void 0);selectedNamespaceId=h(null);hideTitle=h(!1);namespaceFilterChange=x();isLoading=this.userAdminState.isLoading;namespaceUserIds=z(F(this.selectedNamespaceId).pipe(E(t=>t?this.namespaceMembership.getMembersNamespaceMembership(t).pipe(B(e=>new Set(e.map(n=>n.id))),R(e=>(console.error("[UserList] Failed to load namespace users",e),S(null)))):S(null))),{initialValue:null});userItems=M(()=>{let t=this.namespaceUserIds();return this.userAdminState.users().filter(e=>t===null||t.has(e.id??"")).map(e=>({id:e.id??"",name:[e.firstname,e.lastname].filter(Boolean).join(" ")||e.email||"\u2014",description:e.email}))});get usersById(){return new Map(this.userAdminState.users().map(t=>[t.id??"",t]))}ngOnInit(){this.userAdminState.loadAll().pipe(T(this.destroyRef)).subscribe()}onNamespaceChange(t){this.namespaceFilterChange.emit(t)}goBack(){this.router.navigate(["/agentos","admin"])}navigateToCreate(){this.router.navigate(["/agentos/admin/users/new"])}navigateToEdit(t){this.router.navigate(["/agentos/admin/users",t.id??"","edit"])}deleteUser(t){this.userAdminState.deleteUser(t.id??"").pipe(T(this.destroyRef)).subscribe()}resolveUser(t){return this.usersById.get(t)??null}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=v({type:s,selectors:[["agentos-user-list"]],inputs:{showBackButton:[1,"showBackButton"],namespaces:[1,"namespaces"],selectedNamespaceId:[1,"selectedNamespaceId"],hideTitle:[1,"hideTitle"]},outputs:{namespaceFilterChange:"namespaceFilterChange"},decls:5,vars:5,consts:[["userItemTpl",""],["title","Users","emptyMessage","No users found.","cardMinWidth","320px",3,"createRequested","hideTitle","items","showCreate","itemTemplate"],["toolbar-start","",3,"namespaces","value","includeAllOption"],["toolbar-start","","icon","arrow_back","title","Back"],["toolbar-start","",3,"valueChange","namespaces","value","includeAllOption"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"user"],[3,"editRequested","deleteRequested","user"]],template:function(e,n){if(e&1&&(o(0,"ds-entity-list",1),m("createRequested",function(){return n.navigateToCreate()}),b(1,te,1,3,"agentos-namespace-select",2)(2,ne,1,0,"ds-icon-button",3),r(),O(3,ie,1,1,"ng-template",null,0,L)),e&2){let i,a=P(4);c("hideTitle",n.hideTitle())("items",n.userItems())("showCreate",!0)("itemTemplate",a),d(),f((i=n.namespaces())?1:n.showBackButton()?2:-1,i)}},dependencies:[$,I,K,J],encapsulation:2,changeDetection:0})};function re(s,t){if(s&1){let e=C();o(0,"agentos-user-list",9),m("namespaceFilterChange",function(i){g(e);let a=l();return _(a.onUsersNamespaceChange(i))}),r()}if(s&2){let e=l();c("showBackButton",!1)("hideTitle",!0)("namespaces",e.namespaces())("selectedNamespaceId",e.usersNamespaceFilter())}}function oe(s,t){s&1&&(o(0,"p",10),u(1,"No namespaces yet. Create one before managing groups."),r())}function ae(s,t){if(s&1){let e=C();o(0,"agentos-user-group-list",12),m("namespaceChange",function(i){g(e);let a=l(2);return _(a.onGroupsNamespaceChange(i))}),r()}if(s&2){let e=l(2);c("namespaceId",t)("hideTitle",!0)("namespaces",e.namespaces())("returnTo",e.returnTo())}}function le(s,t){if(s&1&&b(0,oe,2,0,"p",10)(1,ae,1,4,"agentos-user-group-list",11),s&2){let e,n=l();f(n.namespaces().length===0?0:(e=n.groupsNamespaceId())?1:-1,e)}}var Z=class s{router=p(U);route=p(q);destroyRef=p(w);namespaceController=p(G);activeTab=y(this.route.snapshot.queryParamMap.get("tab")==="groups"?"groups":"users");namespaces=y([]);usersNamespaceFilter=y(null);groupsNamespaceId=y(null);returnTo=M(()=>{let t=this.groupsNamespaceId();return t?`/agentos/admin/users?tab=groups&ns=${t}`:"/agentos/admin/users?tab=groups"});constructor(){let t=this.route.snapshot.queryParamMap.get("ns");this.namespaceController.listAllNamespace().pipe(T(this.destroyRef)).subscribe(e=>{let n=e.filter(a=>a.role!=="MEMBER");this.namespaces.set(n);let i=t&&n.some(a=>a.id===t)?t:n[0]?.id??null;this.groupsNamespaceId.set(i)})}setTab(t){this.activeTab.set(t)}onUsersNamespaceChange(t){this.usersNamespaceFilter.set(t)}onGroupsNamespaceChange(t){this.groupsNamespaceId.set(t)}goBack(){this.router.navigate(["/agentos","admin"])}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=v({type:s,selectors:[["agentos-admin-users-groups"]],decls:14,vars:8,consts:[[1,"admin-users-groups"],[1,"admin-users-groups__header"],["type","button",1,"admin-users-groups__back",3,"click"],[1,"admin-users-groups__title"],["role","tablist","aria-label","Users and Groups",1,"admin-users-groups__tabs"],["id","admin-tab-users","type","button","role","tab","aria-controls","admin-users-groups-panel",1,"admin-users-groups__tab",3,"click"],["id","admin-tab-groups","type","button","role","tab","aria-controls","admin-users-groups-panel",1,"admin-users-groups__tab",3,"click"],["id","admin-users-groups-panel","role","tabpanel","tabindex","0",1,"admin-users-groups__panel"],[3,"showBackButton","hideTitle","namespaces","selectedNamespaceId"],[3,"namespaceFilterChange","showBackButton","hideTitle","namespaces","selectedNamespaceId"],[1,"admin-users-groups__empty"],[3,"namespaceId","hideTitle","namespaces","returnTo"],[3,"namespaceChange","namespaceId","hideTitle","namespaces","returnTo"]],template:function(e,n){e&1&&(o(0,"div",0)(1,"header",1)(2,"button",2),m("click",function(){return n.goBack()}),u(3,"\u2190 Admin"),r(),o(4,"h1",3),u(5,"Users & Groups"),r()(),o(6,"div",4)(7,"button",5),m("click",function(){return n.setTab("users")}),u(8," Users "),r(),o(9,"button",6),m("click",function(){return n.setTab("groups")}),u(10," Groups "),r()(),o(11,"div",7),b(12,re,1,4,"agentos-user-list",8)(13,le,2,1),r()()),e&2&&(d(7),D("admin-users-groups__tab--active",n.activeTab()==="users"),N("aria-selected",n.activeTab()==="users"),d(2),D("admin-users-groups__tab--active",n.activeTab()==="groups"),N("aria-selected",n.activeTab()==="groups"),d(2),N("aria-labelledby",n.activeTab()==="users"?"admin-tab-users":"admin-tab-groups"),d(),f(n.activeTab()==="users"?12:13))},dependencies:[k,Q],styles:[".admin-users-groups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1.5rem 1rem 0;--entity-list-toolbar-max-width: 900px}.admin-users-groups__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;max-width:900px;margin:0 auto;width:100%}.admin-users-groups__back[_ngcontent-%COMP%]{align-self:flex-start;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.admin-users-groups__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.admin-users-groups__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.admin-users-groups__tabs[_ngcontent-%COMP%]{display:inline-flex;gap:.25rem;padding:.25rem;border-radius:10px;background:var(--color-surface-hover, rgba(0, 0, 0, .05));border:1px solid var(--color-border, rgba(0, 0, 0, .08));max-width:900px;margin:0 auto;width:fit-content;align-self:center}.admin-users-groups__tab[_ngcontent-%COMP%]{padding:.4rem 1.25rem;border-radius:8px;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.9rem;font-family:inherit;font-weight:500;cursor:pointer;transition:background .15s ease,color .15s ease}.admin-users-groups__tab[_ngcontent-%COMP%]:hover{color:var(--color-text, #1d1d1f)}.admin-users-groups__tab--active[_ngcontent-%COMP%]{background:var(--color-bg-surface, #fff);color:var(--color-text, #1d1d1f);box-shadow:0 1px 2px #00000014}.admin-users-groups__empty[_ngcontent-%COMP%]{max-width:900px;margin:1rem auto;width:100%;color:var(--color-text-secondary, #6e6e73);font-size:.9rem}"],changeDetection:0})};export{I as a,k as b,Z as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ne}from"./chunk-RSGZ7YWF.js";import{a as ze}from"./chunk-SGNDHUEQ.js";import{a as De,b as Be}from"./chunk-JF7QMQ4U.js";import{a as Se,b as Ie}from"./chunk-Y52DC76K.js";import{a as Pe,b as ye}from"./chunk-Y42FQQZC.js";import{a as Me}from"./chunk-NXINMPV4.js";import{a as Te,b as He,c as Ue}from"./chunk-WLQB3UUA.js";import{a as we,b as Fe,c as Ee}from"./chunk-C3GZ6PYA.js";import{a as Oe}from"./chunk-XZIT26QS.js";import{a as ke}from"./chunk-C6PO7H3U.js";import{a as Q}from"./chunk-46V5PCBB.js";import{a as ee,b as te,c as ne,d as oe,e as ae,f as re,g as ie,h as me,i as pe,j as de,k as ce,l as le,m as ge,n as he,o as ue,p as fe,q as Ce,r as be,s as ve,t as _e,u as xe}from"./chunk-MK6PPMBU.js";import{a as se}from"./chunk-KHMEGI4Z.js";import{a as X,b as Z,c as $}from"./chunk-RB7N2NWN.js";import"./chunk-7TO465TS.js";import"./chunk-PI7ZIR5W.js";import{a as Ae}from"./chunk-YGUO4DH3.js";import"./chunk-PNPPZSOI.js";import{a as H}from"./chunk-K2ZZYRVT.js";import{a as Y,b as q,c as J,d as K}from"./chunk-YFCRBVWD.js";import{l as F}from"./chunk-VCUQMGKI.js";import"./chunk-TSYL5EEO.js";import{c as w}from"./chunk-6XX7GME4.js";import{s as T}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as E}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as k,Db as c,Fb as C,Ka as p,Rb as M,Tb as r,Ub as x,Wa as h,ca as g,ga as A,ha as P,lb as s,ma as y,mb as l,mc as O,rb as v,sb as n,ta as b,tb as o,ub as f,vb as S,wb as I,xb as _}from"./chunk-CHEXA6RY.js";var t=()=>!0;var Ge=[{path:"oauth/callback",loadComponent:()=>import("./chunk-SQACXL4U.js").then(e=>e.OAuthCallbackComponent)},{path:"",loadComponent:()=>import("./chunk-FAHNOZ4S.js").then(e=>e.AgentosShellComponent),children:[{path:"home",canActivate:[t],loadComponent:()=>import("./chunk-JYYG7ZUT.js").then(e=>e.CaseShellComponent)},{path:"",loadComponent:()=>import("./chunk-WRMHUQWQ.js").then(e=>e.LayoutComponent),children:[{path:"namespaces/new",canActivate:[t],loadComponent:()=>import("./chunk-JOFWSHOO.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces/:namespaceId/edit",canActivate:[t],loadComponent:()=>import("./chunk-JOFWSHOO.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces",canActivate:[t],loadComponent:()=>import("./chunk-Z34N3CUS.js").then(e=>e.NamespaceListComponent)},{path:"admin",canActivate:[t],loadComponent:()=>import("./chunk-WC55KAEC.js").then(e=>e.AdminHomeComponent)},{path:"admin/users/new",canActivate:[t],loadComponent:()=>import("./chunk-WLOUHJRC.js").then(e=>e.UserFormComponent)},{path:"admin/users/:userId/edit",canActivate:[t],loadComponent:()=>import("./chunk-WLOUHJRC.js").then(e=>e.UserFormComponent)},{path:"admin/users",canActivate:[t],loadComponent:()=>import("./chunk-KY3GI5KF.js").then(e=>e.AdminUsersGroupsComponent)},{path:"admin/integration-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-YZ7HJLJI.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-YZ7HJLJI.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs",canActivate:[t],loadComponent:()=>import("./chunk-H5R3SW7B.js").then(e=>e.PlatformIntegrationConfigsComponent)},{path:"admin/scheduled-prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-5GITXCTT.js").then(e=>e.ScheduledPromptFormComponent)},{path:"admin/scheduled-prompts/:scheduledPromptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-5GITXCTT.js").then(e=>e.ScheduledPromptFormComponent)},{path:"admin/scheduled-prompts",canActivate:[t],loadComponent:()=>import("./chunk-PDUSJ4QD.js").then(e=>e.PlatformScheduledPromptsComponent)},{path:"admin/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-GOERELOH.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-GOERELOH.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts",canActivate:[t],loadComponent:()=>import("./chunk-BHAZO7U5.js").then(e=>e.PlatformPromptsComponent)},{path:"admin/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-FFXIBE7G.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-FFXIBE7G.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-2TDFGQ4U.js").then(e=>e.PlatformAiProvidersComponent)},{path:"admin/auth-settings/new",canActivate:[t],loadComponent:()=>import("./chunk-ABU55DK2.js").then(e=>e.AuthSettingFormComponent)},{path:"admin/auth-settings/:authSettingId/edit",canActivate:[t],loadComponent:()=>import("./chunk-ABU55DK2.js").then(e=>e.AuthSettingFormComponent)},{path:"admin/auth-settings",canActivate:[t],loadComponent:()=>import("./chunk-5KKUKGZH.js").then(e=>e.PlatformAuthSettingsComponent)},{path:"admin/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-UKR2PSUI.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-UKR2PSUI.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-CRODJUF7.js").then(e=>e.PlatformAiModelsComponent)},{path:"admin/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-L2LMV4CM.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-L2LMV4CM.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-GS52HX7Q.js").then(e=>e.AgentConfigInspectComponent)},{path:"admin/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-OFAUBLZA.js").then(e=>e.PlatformAgentConfigsComponent)},{path:"me",canActivate:[t],loadComponent:()=>import("./chunk-DIN6OQ3X.js").then(e=>e.UserProfileComponent)},{path:"user",canActivate:[t],loadComponent:()=>import("./chunk-DIN6OQ3X.js").then(e=>e.UserProfileComponent)},{path:":namespaceId/auth-settings/new",canActivate:[t],loadComponent:()=>import("./chunk-ABU55DK2.js").then(e=>e.AuthSettingFormComponent)},{path:":namespaceId/auth-settings/:authSettingId/edit",canActivate:[t],loadComponent:()=>import("./chunk-ABU55DK2.js").then(e=>e.AuthSettingFormComponent)},{path:":namespaceId/auth-settings",canActivate:[t],loadComponent:()=>import("./chunk-HT3AURU3.js").then(e=>e.AuthSettingsAllScopesComponent)},{path:":namespaceId/integrations/new",canActivate:[t],loadComponent:()=>import("./chunk-YZ7HJLJI.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-YZ7HJLJI.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations",canActivate:[t],loadComponent:()=>import("./chunk-XRGYHVGI.js").then(e=>e.IntegrationsAllScopesComponent)},{path:":namespaceId/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-FFXIBE7G.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-FFXIBE7G.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-J7LPPELB.js").then(e=>e.AiProvidersAllScopesComponent)},{path:":namespaceId/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-UKR2PSUI.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-UKR2PSUI.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-2XANOO7Y.js").then(e=>e.NamespaceAiModelsComponent)},{path:":namespaceId/scheduled-prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-5GITXCTT.js").then(e=>e.ScheduledPromptFormComponent)},{path:":namespaceId/scheduled-prompts/:scheduledPromptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-5GITXCTT.js").then(e=>e.ScheduledPromptFormComponent)},{path:":namespaceId/scheduled-prompts",canActivate:[t],loadComponent:()=>import("./chunk-FIDRP4UY.js").then(e=>e.ScheduledPromptListComponent)},{path:":namespaceId/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-GOERELOH.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-GOERELOH.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts",canActivate:[t],loadComponent:()=>import("./chunk-QH6RTNNU.js").then(e=>e.NamespacePromptsComponent)},{path:":namespaceId/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-L2LMV4CM.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-L2LMV4CM.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-GS52HX7Q.js").then(e=>e.AgentConfigInspectComponent)},{path:":namespaceId/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-LYDUBL3X.js").then(e=>e.NamespaceAgentConfigsComponent)},{path:":namespaceId/user-groups/new",canActivate:[t],loadComponent:()=>import("./chunk-V63CBJL3.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups/:userGroupId/edit",canActivate:[t],loadComponent:()=>import("./chunk-V63CBJL3.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups",canActivate:[t],loadComponent:()=>import("./chunk-55CLK4XC.js").then(e=>e.NamespaceUserGroupsComponent)},{path:":namespaceId/members",canActivate:[t],loadComponent:()=>import("./chunk-RXH3NNTB.js").then(e=>e.NamespaceMembersComponent)},{path:"",redirectTo:"namespaces",pathMatch:"full"}]}]}];function B(e,i){e&1&&_(0,"span",1)}function R(e,i){e&1&&_(0,"span",2)}function j(e,i){e&1&&_(0,"span",3)}var u=class e{pluginService=g(F);online=b(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(a,m){if(a&1&&(S(0,"div",0),s(1,B,1,0,"span",1)(2,R,1,0,"span",2)(3,j,1,0,"span",3),I()),a&2){let d;p(),l((d=m.online())===!0?1:d===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};function G(e,i){if(e&1){let a=k();n(0,"button",9),c("click",function(){A(a);let d=C();return P(d.navigateToAdmin())}),n(1,"span",10),r(2,"\u2699\uFE0F"),o()()}}function L(e,i){if(e&1&&(n(0,"span",7),r(1),o()),e&2){let a=C();p(),x(a.userInitials)}}function V(e,i){e&1&&(n(0,"span",8),r(1,"\u25EF"),o())}var z=class e{router=g(w);userState=g(H);destroyRef=g(y);currentUser=this.userState.currentUser;navigateHome(){this.router.navigate(["/agentos/home"])}isAdmin=O(()=>this.userState.currentUser()?.isAdmin===!0);navigateToAdmin(){this.router.navigate(["/agentos/admin"])}ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(E(this.destroyRef)).subscribe()}get userInitials(){let i=this.currentUser();if(!i)return"";let a=i.firstname?.[0]??"",m=i.lastname?.[0]??"";return(a+m).toUpperCase()||i.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-header"]],decls:11,vars:5,consts:[[1,"header"],["type","button","title","Home",1,"header__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button","title","Admin",1,"header__admin-btn"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"],["type","button","title","Admin",1,"header__admin-btn",3,"click"],[1,"header__admin-icon"]],template:function(a,m){a&1&&(n(0,"header",0)(1,"button",1),c("click",function(){return m.navigateHome()}),f(2,"img",2),n(3,"span",3),r(4,"Coday"),o()(),n(5,"nav",4),f(6,"agentos-backend-status"),s(7,G,3,0,"button",5),n(8,"button",6),c("click",function(){return m.toggleProfile()}),s(9,L,2,1,"span",7)(10,V,2,0,"span",8),o()()()),a&2&&(p(7),l(m.isAdmin()?7:-1),p(),M("header__user-btn--active",m.isOnProfilePage),v("title",m.isOnProfilePage?"Back":"My profile"),p(),l(m.userInitials?9:10))},dependencies:[u],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;background:none;border:none;padding:0;cursor:pointer;border-radius:6px;transition:opacity .15s ease}.header__brand[_ngcontent-%COMP%]:hover{opacity:.7}.header__logo-img[_ngcontent-%COMP%]{width:32px;height:32px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;letter-spacing:-.01em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__admin-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit;font-size:1rem;line-height:1}.header__admin-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__admin-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};function W(e,i){if(e&1&&(n(0,"p",11),r(1," Last action: "),n(2,"strong"),r(3),o()()),e&2){let a=C();p(3),x(a.lastAction())}}var D=class e{lastAction=b(null);onSend(){this.lastAction.set("send")}onStop(){this.lastAction.set("stop")}onAttach(){this.lastAction.set("attach")}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-hello"]],decls:35,vars:2,consts:[[1,"hello-agentos"],[1,"card"],[1,"badge"],[1,"principles"],[1,"demo"],[1,"demo-label"],[1,"demo-buttons"],["icon","send","variant","primary","title","Send",3,"action"],["icon","stop","variant","danger","title","Stop",3,"action"],["icon","attach_file","variant","default","title","Attach",3,"action"],["icon","mic","variant","default","title","Record",3,"action","disabled"],[1,"demo-feedback"]],template:function(a,m){a&1&&(n(0,"div",0)(1,"div",1)(2,"div",2),r(3,"AgentOS UI"),o(),n(4,"h1"),r(5,"Hello AgentOS"),o(),n(6,"p"),r(7," This component lives in "),n(8,"code"),r(9,"libs/agentos-ui"),o(),r(10," \u2014 isolated from Coday internals, ready to be published as "),n(11,"code"),r(12,"@whoz-oss/agentos-ui"),o(),r(13,". "),o(),f(14,"agentos-backend-status"),n(15,"ul",3)(16,"li"),r(17,"\u2726 No imports from Coday app"),o(),n(18,"li"),r(19,"\u2726 CSS custom properties as host contract"),o(),n(20,"li"),r(21,"\u2726 Standalone Angular components"),o(),n(22,"li"),r(23,"\u2726 Signals-first reactive state"),o()(),n(24,"div",4)(25,"p",5),r(26,"ds-icon-button from "),n(27,"code"),r(28,"@whoz-oss/design-system"),o()(),n(29,"div",6)(30,"ds-icon-button",7),c("action",function(){return m.onSend()}),o(),n(31,"ds-icon-button",8),c("action",function(){return m.onStop()}),o(),n(32,"ds-icon-button",9),c("action",function(){return m.onAttach()}),o(),n(33,"ds-icon-button",10),c("action",function(){return m.onAttach()}),o()(),s(34,W,4,1,"p",11),o()()()),a&2&&(p(33),v("disabled",!0),p(),l(m.lastAction()?34:-1))},dependencies:[T,u],styles:['@charset "UTF-8";.hello-agentos[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:2rem}.card[_ngcontent-%COMP%]{background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .15));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:20px;padding:3rem;max-width:480px;width:100%;text-align:center}.badge[_ngcontent-%COMP%]{display:inline-block;background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.25rem .75rem;border-radius:100px;margin-bottom:1.5rem}h1[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f);font-size:2rem;font-weight:700;margin:0 0 1rem;letter-spacing:-.02em}p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);line-height:1.6;margin:0 0 1.5rem}p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.principles[_ngcontent-%COMP%]{list-style:none;margin:0 0 1.5rem;padding:0;text-align:left;display:flex;flex-direction:column;gap:.5rem}.principles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;padding:.5rem .75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:8px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%]{border-top:1px solid var(--color-border-light, rgba(40, 40, 40, .08));padding-top:1.25rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.8rem;margin:0 0 .75rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.demo[_ngcontent-%COMP%] .demo-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:12px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73)}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}']})};export{Ge as AGENTOS_ROUTES,Pe as ActionCardChipsDirective,ye as ActionCardComponent,Ue as AdminUsersGroupsComponent,Q as AgentosShellComponent,J as AgentosThemeService,Z as AgentosUserPreferencesService,u as BackendStatusComponent,Ce as CaseChatComponent,_e as CaseDrawerComponent,be as CaseHomeComponent,ve as CaseItemComponent,xe as CaseShellComponent,X as ENTER_KEY_BEHAVIORS,le as ExchangeContentViewerComponent,ue as ExchangeDrawerComponent,he as ExchangeFileListComponent,ge as ExchangeItemComponent,fe as ExchangeShellComponent,ee as ExchangeStateService,z as HeaderComponent,D as HelloAgentosComponent,Ae as LayoutComponent,te as MAX_VIEWABLE_SIZE,se as MarkdownPipe,Se as NamespaceItemComponent,Ie as NamespaceListComponent,De as NamespaceMemberStateService,Be as NamespaceMembersComponent,we as NamespaceSelectComponent,ze as NamespaceUserGroupsComponent,q as THEME_MODES,K as THEME_PORT,Y as THEME_VARIANTS,$ as USER_PREFERENCES_PORT,ke as UserAdminStateService,Me as UserFormComponent,Ne as UserGroupFormComponent,Fe as UserGroupItemComponent,Ee as UserGroupListComponent,Oe as UserGroupStateService,Te as UserItemComponent,He as UserListComponent,H as UserStateService,t as agentosReadyGuard,pe as canViewFile,re as detectFormat,ce as exchangeMutationScope,ae as formatDate,oe as formatSize,ne as getFileIcon,ie as isFormatViewable,me as isViewable,de as reindentJson};
|
|
1
|
+
import{a as Ne}from"./chunk-7HQ3TFIP.js";import{a as ze}from"./chunk-ROOPYJTV.js";import{a as De,b as Be}from"./chunk-ZEQWC4IU.js";import{a as Se,b as Ie}from"./chunk-4KA7TIB4.js";import{a as Pe,b as ye}from"./chunk-FL2HNVMC.js";import{a as Me}from"./chunk-NXINMPV4.js";import{a as Te,b as He,c as Ue}from"./chunk-PGEMQVT2.js";import{a as we,b as Fe,c as Ee}from"./chunk-P5FCG3WF.js";import{a as Oe}from"./chunk-XZIT26QS.js";import{a as ke}from"./chunk-C6PO7H3U.js";import{a as Q}from"./chunk-46V5PCBB.js";import{a as ee,b as te,c as ne,d as oe,e as ae,f as re,g as ie,h as me,i as pe,j as de,k as ce,l as le,m as ge,n as he,o as ue,p as fe,q as Ce,r as be,s as ve,t as _e,u as xe}from"./chunk-LVZVGPMV.js";import{a as se}from"./chunk-KHMEGI4Z.js";import{a as X,b as Z,c as $}from"./chunk-RB7N2NWN.js";import"./chunk-7TO465TS.js";import"./chunk-PI7ZIR5W.js";import{a as Ae}from"./chunk-YGUO4DH3.js";import"./chunk-PNPPZSOI.js";import{a as H}from"./chunk-K2ZZYRVT.js";import{a as Y,b as q,c as J,d as K}from"./chunk-YFCRBVWD.js";import{l as F}from"./chunk-VCUQMGKI.js";import"./chunk-TSYL5EEO.js";import{c as w}from"./chunk-6XX7GME4.js";import{s as T}from"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import"./chunk-SPV5SLNS.js";import{a as E}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as k,Db as c,Fb as C,Ka as p,Rb as M,Tb as r,Ub as x,Wa as h,ca as g,ga as A,ha as P,lb as s,ma as y,mb as l,mc as O,rb as v,sb as n,ta as b,tb as o,ub as f,vb as S,wb as I,xb as _}from"./chunk-CHEXA6RY.js";var t=()=>!0;var Ge=[{path:"oauth/callback",loadComponent:()=>import("./chunk-SQACXL4U.js").then(e=>e.OAuthCallbackComponent)},{path:"",loadComponent:()=>import("./chunk-FAHNOZ4S.js").then(e=>e.AgentosShellComponent),children:[{path:"home",canActivate:[t],loadComponent:()=>import("./chunk-MXD6ICBN.js").then(e=>e.CaseShellComponent)},{path:"",loadComponent:()=>import("./chunk-WRMHUQWQ.js").then(e=>e.LayoutComponent),children:[{path:"namespaces/new",canActivate:[t],loadComponent:()=>import("./chunk-JOFWSHOO.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces/:namespaceId/edit",canActivate:[t],loadComponent:()=>import("./chunk-JOFWSHOO.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces",canActivate:[t],loadComponent:()=>import("./chunk-4OSUCDSF.js").then(e=>e.NamespaceListComponent)},{path:"admin",canActivate:[t],loadComponent:()=>import("./chunk-4U47ZPZP.js").then(e=>e.AdminHomeComponent)},{path:"admin/users/new",canActivate:[t],loadComponent:()=>import("./chunk-WLOUHJRC.js").then(e=>e.UserFormComponent)},{path:"admin/users/:userId/edit",canActivate:[t],loadComponent:()=>import("./chunk-WLOUHJRC.js").then(e=>e.UserFormComponent)},{path:"admin/users",canActivate:[t],loadComponent:()=>import("./chunk-FELDR7HF.js").then(e=>e.AdminUsersGroupsComponent)},{path:"admin/integration-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-P4UYIBTK.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-P4UYIBTK.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs",canActivate:[t],loadComponent:()=>import("./chunk-KHCLVVXY.js").then(e=>e.PlatformIntegrationConfigsComponent)},{path:"admin/scheduled-prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-5GITXCTT.js").then(e=>e.ScheduledPromptFormComponent)},{path:"admin/scheduled-prompts/:scheduledPromptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-5GITXCTT.js").then(e=>e.ScheduledPromptFormComponent)},{path:"admin/scheduled-prompts",canActivate:[t],loadComponent:()=>import("./chunk-IPWNT3U4.js").then(e=>e.PlatformScheduledPromptsComponent)},{path:"admin/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-GOERELOH.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-GOERELOH.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts",canActivate:[t],loadComponent:()=>import("./chunk-WNJYWSOR.js").then(e=>e.PlatformPromptsComponent)},{path:"admin/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-FFXIBE7G.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-FFXIBE7G.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-7P7KJUWV.js").then(e=>e.PlatformAiProvidersComponent)},{path:"admin/auth-settings/new",canActivate:[t],loadComponent:()=>import("./chunk-ABU55DK2.js").then(e=>e.AuthSettingFormComponent)},{path:"admin/auth-settings/:authSettingId/edit",canActivate:[t],loadComponent:()=>import("./chunk-ABU55DK2.js").then(e=>e.AuthSettingFormComponent)},{path:"admin/auth-settings",canActivate:[t],loadComponent:()=>import("./chunk-MIVM4FAD.js").then(e=>e.PlatformAuthSettingsComponent)},{path:"admin/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-UKR2PSUI.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-UKR2PSUI.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-WARAZYNV.js").then(e=>e.PlatformAiModelsComponent)},{path:"admin/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-L2LMV4CM.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-L2LMV4CM.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-GS52HX7Q.js").then(e=>e.AgentConfigInspectComponent)},{path:"admin/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-DIJGQPPG.js").then(e=>e.PlatformAgentConfigsComponent)},{path:"me",canActivate:[t],loadComponent:()=>import("./chunk-MHOEYCWL.js").then(e=>e.UserProfileComponent)},{path:"user",canActivate:[t],loadComponent:()=>import("./chunk-MHOEYCWL.js").then(e=>e.UserProfileComponent)},{path:":namespaceId/auth-settings/new",canActivate:[t],loadComponent:()=>import("./chunk-ABU55DK2.js").then(e=>e.AuthSettingFormComponent)},{path:":namespaceId/auth-settings/:authSettingId/edit",canActivate:[t],loadComponent:()=>import("./chunk-ABU55DK2.js").then(e=>e.AuthSettingFormComponent)},{path:":namespaceId/auth-settings",canActivate:[t],loadComponent:()=>import("./chunk-XORVTVXX.js").then(e=>e.AuthSettingsAllScopesComponent)},{path:":namespaceId/integrations/new",canActivate:[t],loadComponent:()=>import("./chunk-P4UYIBTK.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-P4UYIBTK.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations",canActivate:[t],loadComponent:()=>import("./chunk-B5ZVUFND.js").then(e=>e.IntegrationsAllScopesComponent)},{path:":namespaceId/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-FFXIBE7G.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-FFXIBE7G.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-LPIKNWWZ.js").then(e=>e.AiProvidersAllScopesComponent)},{path:":namespaceId/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-UKR2PSUI.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-UKR2PSUI.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-SN27D3CH.js").then(e=>e.NamespaceAiModelsComponent)},{path:":namespaceId/scheduled-prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-5GITXCTT.js").then(e=>e.ScheduledPromptFormComponent)},{path:":namespaceId/scheduled-prompts/:scheduledPromptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-5GITXCTT.js").then(e=>e.ScheduledPromptFormComponent)},{path:":namespaceId/scheduled-prompts",canActivate:[t],loadComponent:()=>import("./chunk-YV2SJQAM.js").then(e=>e.ScheduledPromptListComponent)},{path:":namespaceId/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-GOERELOH.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-GOERELOH.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts",canActivate:[t],loadComponent:()=>import("./chunk-RSTB4RTA.js").then(e=>e.NamespacePromptsComponent)},{path:":namespaceId/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-L2LMV4CM.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-L2LMV4CM.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-GS52HX7Q.js").then(e=>e.AgentConfigInspectComponent)},{path:":namespaceId/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-WVXEP3PL.js").then(e=>e.NamespaceAgentConfigsComponent)},{path:":namespaceId/user-groups/new",canActivate:[t],loadComponent:()=>import("./chunk-4NPMNHQN.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups/:userGroupId/edit",canActivate:[t],loadComponent:()=>import("./chunk-4NPMNHQN.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups",canActivate:[t],loadComponent:()=>import("./chunk-Z3AHFIZF.js").then(e=>e.NamespaceUserGroupsComponent)},{path:":namespaceId/members",canActivate:[t],loadComponent:()=>import("./chunk-SVOSTUY5.js").then(e=>e.NamespaceMembersComponent)},{path:"",redirectTo:"namespaces",pathMatch:"full"}]}]}];function B(e,i){e&1&&_(0,"span",1)}function R(e,i){e&1&&_(0,"span",2)}function j(e,i){e&1&&_(0,"span",3)}var u=class e{pluginService=g(F);online=b(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(a,m){if(a&1&&(S(0,"div",0),s(1,B,1,0,"span",1)(2,R,1,0,"span",2)(3,j,1,0,"span",3),I()),a&2){let d;p(),l((d=m.online())===!0?1:d===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};function G(e,i){if(e&1){let a=k();n(0,"button",9),c("click",function(){A(a);let d=C();return P(d.navigateToAdmin())}),n(1,"span",10),r(2,"\u2699\uFE0F"),o()()}}function L(e,i){if(e&1&&(n(0,"span",7),r(1),o()),e&2){let a=C();p(),x(a.userInitials)}}function V(e,i){e&1&&(n(0,"span",8),r(1,"\u25EF"),o())}var z=class e{router=g(w);userState=g(H);destroyRef=g(y);currentUser=this.userState.currentUser;navigateHome(){this.router.navigate(["/agentos/home"])}isAdmin=O(()=>this.userState.currentUser()?.isAdmin===!0);navigateToAdmin(){this.router.navigate(["/agentos/admin"])}ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(E(this.destroyRef)).subscribe()}get userInitials(){let i=this.currentUser();if(!i)return"";let a=i.firstname?.[0]??"",m=i.lastname?.[0]??"";return(a+m).toUpperCase()||i.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-header"]],decls:11,vars:5,consts:[[1,"header"],["type","button","title","Home",1,"header__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button","title","Admin",1,"header__admin-btn"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"],["type","button","title","Admin",1,"header__admin-btn",3,"click"],[1,"header__admin-icon"]],template:function(a,m){a&1&&(n(0,"header",0)(1,"button",1),c("click",function(){return m.navigateHome()}),f(2,"img",2),n(3,"span",3),r(4,"Coday"),o()(),n(5,"nav",4),f(6,"agentos-backend-status"),s(7,G,3,0,"button",5),n(8,"button",6),c("click",function(){return m.toggleProfile()}),s(9,L,2,1,"span",7)(10,V,2,0,"span",8),o()()()),a&2&&(p(7),l(m.isAdmin()?7:-1),p(),M("header__user-btn--active",m.isOnProfilePage),v("title",m.isOnProfilePage?"Back":"My profile"),p(),l(m.userInitials?9:10))},dependencies:[u],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;background:none;border:none;padding:0;cursor:pointer;border-radius:6px;transition:opacity .15s ease}.header__brand[_ngcontent-%COMP%]:hover{opacity:.7}.header__logo-img[_ngcontent-%COMP%]{width:32px;height:32px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;letter-spacing:-.01em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__admin-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit;font-size:1rem;line-height:1}.header__admin-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__admin-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};function W(e,i){if(e&1&&(n(0,"p",11),r(1," Last action: "),n(2,"strong"),r(3),o()()),e&2){let a=C();p(3),x(a.lastAction())}}var D=class e{lastAction=b(null);onSend(){this.lastAction.set("send")}onStop(){this.lastAction.set("stop")}onAttach(){this.lastAction.set("attach")}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=h({type:e,selectors:[["agentos-hello"]],decls:35,vars:2,consts:[[1,"hello-agentos"],[1,"card"],[1,"badge"],[1,"principles"],[1,"demo"],[1,"demo-label"],[1,"demo-buttons"],["icon","send","variant","primary","title","Send",3,"action"],["icon","stop","variant","danger","title","Stop",3,"action"],["icon","attach_file","variant","default","title","Attach",3,"action"],["icon","mic","variant","default","title","Record",3,"action","disabled"],[1,"demo-feedback"]],template:function(a,m){a&1&&(n(0,"div",0)(1,"div",1)(2,"div",2),r(3,"AgentOS UI"),o(),n(4,"h1"),r(5,"Hello AgentOS"),o(),n(6,"p"),r(7," This component lives in "),n(8,"code"),r(9,"libs/agentos-ui"),o(),r(10," \u2014 isolated from Coday internals, ready to be published as "),n(11,"code"),r(12,"@whoz-oss/agentos-ui"),o(),r(13,". "),o(),f(14,"agentos-backend-status"),n(15,"ul",3)(16,"li"),r(17,"\u2726 No imports from Coday app"),o(),n(18,"li"),r(19,"\u2726 CSS custom properties as host contract"),o(),n(20,"li"),r(21,"\u2726 Standalone Angular components"),o(),n(22,"li"),r(23,"\u2726 Signals-first reactive state"),o()(),n(24,"div",4)(25,"p",5),r(26,"ds-icon-button from "),n(27,"code"),r(28,"@whoz-oss/design-system"),o()(),n(29,"div",6)(30,"ds-icon-button",7),c("action",function(){return m.onSend()}),o(),n(31,"ds-icon-button",8),c("action",function(){return m.onStop()}),o(),n(32,"ds-icon-button",9),c("action",function(){return m.onAttach()}),o(),n(33,"ds-icon-button",10),c("action",function(){return m.onAttach()}),o()(),s(34,W,4,1,"p",11),o()()()),a&2&&(p(33),v("disabled",!0),p(),l(m.lastAction()?34:-1))},dependencies:[T,u],styles:['@charset "UTF-8";.hello-agentos[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:2rem}.card[_ngcontent-%COMP%]{background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .15));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:20px;padding:3rem;max-width:480px;width:100%;text-align:center}.badge[_ngcontent-%COMP%]{display:inline-block;background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.25rem .75rem;border-radius:100px;margin-bottom:1.5rem}h1[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f);font-size:2rem;font-weight:700;margin:0 0 1rem;letter-spacing:-.02em}p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);line-height:1.6;margin:0 0 1.5rem}p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.principles[_ngcontent-%COMP%]{list-style:none;margin:0 0 1.5rem;padding:0;text-align:left;display:flex;flex-direction:column;gap:.5rem}.principles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;padding:.5rem .75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:8px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%]{border-top:1px solid var(--color-border-light, rgba(40, 40, 40, .08));padding-top:1.25rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.8rem;margin:0 0 .75rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.demo[_ngcontent-%COMP%] .demo-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:12px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73)}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}']})};export{Ge as AGENTOS_ROUTES,Pe as ActionCardChipsDirective,ye as ActionCardComponent,Ue as AdminUsersGroupsComponent,Q as AgentosShellComponent,J as AgentosThemeService,Z as AgentosUserPreferencesService,u as BackendStatusComponent,Ce as CaseChatComponent,_e as CaseDrawerComponent,be as CaseHomeComponent,ve as CaseItemComponent,xe as CaseShellComponent,X as ENTER_KEY_BEHAVIORS,le as ExchangeContentViewerComponent,ue as ExchangeDrawerComponent,he as ExchangeFileListComponent,ge as ExchangeItemComponent,fe as ExchangeShellComponent,ee as ExchangeStateService,z as HeaderComponent,D as HelloAgentosComponent,Ae as LayoutComponent,te as MAX_VIEWABLE_SIZE,se as MarkdownPipe,Se as NamespaceItemComponent,Ie as NamespaceListComponent,De as NamespaceMemberStateService,Be as NamespaceMembersComponent,we as NamespaceSelectComponent,ze as NamespaceUserGroupsComponent,q as THEME_MODES,K as THEME_PORT,Y as THEME_VARIANTS,$ as USER_PREFERENCES_PORT,ke as UserAdminStateService,Me as UserFormComponent,Ne as UserGroupFormComponent,Fe as UserGroupItemComponent,Ee as UserGroupListComponent,Oe as UserGroupStateService,Te as UserItemComponent,He as UserListComponent,H as UserStateService,t as agentosReadyGuard,pe as canViewFile,re as detectFormat,ce as exchangeMutationScope,ae as formatDate,oe as formatSize,ne as getFileIcon,ie as isFormatViewable,me as isViewable,de as reindentJson};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u}from"./chunk-
|
|
1
|
+
import{c as u}from"./chunk-P5FCG3WF.js";import{a as i,c as m}from"./chunk-6XX7GME4.js";import{Db as c,Wa as n,ca as t,rb as o,sb as r,tb as p}from"./chunk-CHEXA6RY.js";var d=class s{route=t(i);router=t(m);namespaceId=this.route.snapshot.params.namespaceId;goBack(){this.router.navigate(["/agentos","namespaces"])}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=n({type:s,selectors:[["agentos-namespace-user-groups"]],decls:1,vars:1,consts:[["backLabel","Namespaces",3,"backRequested","namespaceId"]],template:function(e,a){e&1&&(r(0,"agentos-user-group-list",0),c("backRequested",function(){return a.goBack()}),p()),e&2&&o("namespaceId",a.namespaceId)},dependencies:[u],encapsulation:2,changeDetection:0})};export{d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-RUXH3KF5.js";import{a as D}from"./chunk-7TO465TS.js";import"./chunk-VCUQMGKI.js";import{a as E,c as $}from"./chunk-6XX7GME4.js";import{z as O}from"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import"./chunk-SPV5SLNS.js";import{a as l}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as x,D as y,Db as m,Fb as a,Lc as T,Pb as N,S as P,Tb as w,Wa as b,ab as v,ca as p,cc as M,fc as B,ga as g,gc as S,ha as h,i as d,jc as k,lb as I,m as u,ma as C,mb as R,rb as s,sb as i,t as f,tb as c,z as _}from"./chunk-CHEXA6RY.js";var F=()=>[];function U(r,t){if(r&1){let o=x();i(0,"agentos-prompt-item",4),m("deleteRequested",function(n){g(o);let A=a(2);return h(A.deletePrompt(n))}),c()}if(r&2){let o=a().$implicit,e=a();s("prompt",t)("namespaceId",e.namespaceId)("readOnly",e.isPlatformPrompt(o.id))}}function V(r,t){if(r&1&&I(0,U,1,3,"agentos-prompt-item",3),r&2){let o,e=t.$implicit,n=a();R((o=n.resolvePrompt(e.id))?0:-1,o)}}var j="platform",G="namespace",q=class r{route=p(E);router=p($);destroyRef=p(C);promptState=p(D);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new d(void 0);allPrompts$=this.refresh$.pipe(P(()=>_({platform:this.promptState.listPlatform().pipe(y(()=>u([]))),namespace:this.promptState.listByNamespace(this.namespaceId)})));promptItems$=this.allPrompts$.pipe(f(({platform:t,namespace:o})=>[...t.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:j,groupLabel:"Platform (read-only)"})),...o.map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:G,groupLabel:"Namespace"}))]));namespacePromptsById=new Map;platformPromptsById=new Map;constructor(){this.allPrompts$.pipe(l(this.destroyRef)).subscribe(({platform:t,namespace:o})=>{this.platformPromptsById=new Map(t.map(e=>[e.id??"",e])),this.namespacePromptsById=new Map(o.map(e=>[e.id??"",e]))})}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"prompts","new"])}deletePrompt(t){this.promptState.delete(t.id??"").pipe(l(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolvePrompt(t){return this.platformPromptsById.get(t)??this.namespacePromptsById.get(t)??null}isPlatformPrompt(t){return this.platformPromptsById.has(t)}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=b({type:r,selectors:[["agentos-namespace-prompts"]],decls:6,vars:6,consts:[["promptItemTpl",""],["title","Prompts","emptyMessage","No prompts defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"namespace-prompts__back",3,"click"],[3,"prompt","namespaceId","readOnly"],[3,"deleteRequested","prompt","namespaceId","readOnly"]],template:function(o,e){if(o&1&&(i(0,"ds-entity-list",1),B(1,"async"),m("createRequested",function(){return e.openCreateForm()}),i(2,"button",2),m("click",function(){return e.goBack()}),w(3,"\u2190 Namespaces"),c()(),v(4,V,1,1,"ng-template",null,0,k)),o&2){let n=N(5);s("items",S(1,3,e.promptItems$)??M(5,F))("showCreate",!0)("itemTemplate",n)}},dependencies:[O,L,T],styles:[".namespace-prompts__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-prompts__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};export{q as NamespacePromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as P}from"./chunk-6XX7GME4.js";import{A as D,s as w}from"./chunk-
|
|
1
|
+
import{c as P}from"./chunk-6XX7GME4.js";import{A as D,s as w}from"./chunk-TTHFWEW7.js";import{Bb as f,Db as c,Fb as a,Ka as p,Rb as h,Tb as _,Ub as b,Wa as y,ca as C,ga as d,ha as s,lb as g,mb as u,pc as M,qc as l,rb as x,sb as i,ta as v,tb as n}from"./chunk-CHEXA6RY.js";function k(t,r){if(t&1&&(i(0,"span",3),_(1),n()),t&2){let e=a();p(),b(e.prompt().description)}}function S(t,r){if(t&1){let e=f();i(0,"span",6),_(1,"Delete?"),n(),i(2,"ds-icon-button",7),c("action",function(){d(e);let m=a();return s(m.onDeleteConfirmed())}),n(),i(3,"ds-icon-button",8),c("action",function(){d(e);let m=a();return s(m.onDeleteCancelled())}),n()}}function E(t,r){if(t&1){let e=f();i(0,"ds-kebab-menu",9),c("itemSelected",function(m){d(e);let O=a();return s(O.onMenuAction(m))}),n()}if(t&2){let e=a();x("items",e.menuItems)}}var I=class t{router=C(P);prompt=l.required();namespaceId=l(void 0);platformMode=l(!1);readOnly=l(!1);deleteRequested=M();pendingDelete=v(!1);menuItems=[{key:"edit",label:"Edit prompt",icon:"edit"},{key:"delete",label:"Delete prompt",icon:"delete",variant:"danger"}];onMenuAction(r){switch(r){case"edit":this.platformMode()?this.router.navigate(["/agentos","admin","prompts",this.prompt().id,"edit"]):this.router.navigate(["/agentos",this.namespaceId(),"prompts",this.prompt().id,"edit"]);break;case"delete":this.pendingDelete.set(!0);break}}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.prompt())}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=y({type:t,selectors:[["agentos-prompt-item"]],inputs:{prompt:[1,"prompt"],namespaceId:[1,"namespaceId"],platformMode:[1,"platformMode"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested"},decls:8,vars:5,consts:[["role","listitem",1,"prompt-item"],[1,"prompt-item__body"],[1,"prompt-item__name"],[1,"prompt-item__description"],[1,"prompt-item__actions"],[3,"items"],[1,"prompt-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,o){e&1&&(i(0,"div",0)(1,"div",1)(2,"span",2),_(3),n(),g(4,k,2,1,"span",3),n(),i(5,"div",4),g(6,S,4,0)(7,E,1,1,"ds-kebab-menu",5),n()()),e&2&&(h("prompt-item--pending-delete",o.pendingDelete()),p(3),b(o.prompt().name),p(),u(o.prompt().description?4:-1),p(2),u(o.pendingDelete()?6:o.readOnly()?-1:7))},dependencies:[D,w],styles:[".prompt-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.prompt-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.prompt-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prompt-item__description[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prompt-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.prompt-item[_ngcontent-%COMP%]:hover .prompt-item__actions[_ngcontent-%COMP%], .prompt-item[_ngcontent-%COMP%]:focus-within .prompt-item__actions[_ngcontent-%COMP%], .prompt-item--pending-delete[_ngcontent-%COMP%] .prompt-item__actions[_ngcontent-%COMP%]{opacity:1}.prompt-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};export{I as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
1
|
+
import{a as k}from"./chunk-NHUXMXD2.js";import{c as q,d as O}from"./chunk-VCUQMGKI.js";import{a as E,c as $}from"./chunk-6XX7GME4.js";import{s as D,z as S}from"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import"./chunk-SPV5SLNS.js";import{a as M}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as R,D as g,Db as l,Fb as s,Lc as L,Pb as N,S as A,Wa as h,ab as I,ca as r,cc as w,fc as x,ga as p,gc as B,ha as m,i as u,jc as T,lb as b,m as f,ma as C,mb as P,rb as c,sb as d,t as y,tb as _,z as v}from"./chunk-CHEXA6RY.js";var V=()=>[];function K(n,t){if(n&1){let i=R();d(0,"agentos-ai-model-item",4),l("deleteRequested",function(a){p(i);let e=s(2);return m(e.deleteModel(a))})("editRequested",function(a){p(i);let e=s(2);return m(e.editModel(a))}),_()}if(n&2){let i=s().$implicit,o=s();c("model",t)("namespaceId",o.namespaceId)("readOnly",o.isPlatformModel(i.id))}}function U(n,t){if(n&1&&b(0,K,1,3,"agentos-ai-model-item",3),n&2){let i,o=t.$implicit,a=s();P((i=a.resolveModel(o.id))?0:-1,i)}}var j="__platform__",G="Platform (read-only)",F=class n{route=r(E);router=r($);destroyRef=r(C);aiModelController=r(q);aiProviderController=r(O);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new u(void 0);data$=this.refresh$.pipe(A(()=>v({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(g(()=>f([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)})));modelItems$=this.data$.pipe(y(({namespace:t,platform:i,providers:o})=>{let a=new Map(o.map(e=>[e.id??"",e.name]));return[...i.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:j,groupLabel:G})),...t.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:e.aiProviderId,groupLabel:a.get(e.aiProviderId)??e.aiProviderId}))]}));namespaceModelsById=new Map;platformModelsById=new Map;constructor(){this.data$.pipe(M(this.destroyRef)).subscribe(({namespace:t,platform:i})=>{this.namespaceModelsById=new Map(t.map(o=>[o.id??"",o])),this.platformModelsById=new Map(i.map(o=>[o.id??"",o]))})}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"])}editModel(t){this.router.navigate(["/agentos",this.namespaceId,"ai-models",t.id,"edit"])}deleteModel(t){this.aiModelController.deleteAiModel(t.id??"").pipe(M(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveModel(t){return this.namespaceModelsById.get(t)??this.platformModelsById.get(t)??null}isPlatformModel(t){return this.platformModelsById.has(t)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=h({type:n,selectors:[["agentos-namespace-ai-models"]],decls:5,vars:6,consts:[["aiModelItemTpl",""],["title","AI models","emptyMessage","No AI models configured yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model","namespaceId","readOnly"],[3,"deleteRequested","editRequested","model","namespaceId","readOnly"]],template:function(i,o){if(i&1&&(d(0,"ds-entity-list",1),x(1,"async"),l("createRequested",function(){return o.openCreateForm()}),d(2,"ds-icon-button",2),l("action",function(){return o.goBack()}),_()(),I(3,U,1,1,"ng-template",null,0,T)),i&2){let a=N(4);c("items",B(1,3,o.modelItems$)??w(5,V))("showCreate",!0)("itemTemplate",a)}},dependencies:[S,k,D,L],encapsulation:2,changeDetection:0})};export{F as NamespaceAiModelsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-ZEQWC4IU.js";import"./chunk-K2ZZYRVT.js";import"./chunk-VCUQMGKI.js";import"./chunk-6XX7GME4.js";import"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import"./chunk-SPV5SLNS.js";import"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import"./chunk-CHEXA6RY.js";export{a as NamespaceMembersComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as O,o as M,s as D}from"./chunk-
|
|
1
|
+
import{A as O,o as M,s as D}from"./chunk-TTHFWEW7.js";import{Bb as u,Db as g,Fb as a,Ka as r,Tb as c,Ub as b,Vb as P,Wa as y,ga as s,ha as m,jb as h,lb as p,mb as _,mc as C,pc as f,qc as v,rb as w,sb as n,ta as x,tb as i}from"./chunk-CHEXA6RY.js";function I(t,d){if(t&1&&(n(0,"span",4),c(1),i()),t&2){let e=a();h("data-variant",e.badge().variant)("aria-label",e.badge().ariaLabel),r(),P(" ",e.badge().label," ")}}function E(t,d){if(t&1&&(n(0,"span",6),c(1),i()),t&2){let e=a();r(),b(e.config().baseUrl)}}function R(t,d){if(t&1){let e=u();n(0,"span",8),c(1,"Delete?"),i(),n(2,"ds-icon-button",9),g("action",function(){s(e);let l=a();return m(l.onDeleteConfirmed())}),i(),n(3,"ds-icon-button",10),g("action",function(){s(e);let l=a();return m(l.onDeleteCancelled())}),i()}}function k(t,d){if(t&1){let e=u();n(0,"ds-kebab-menu",13),g("itemSelected",function(l){s(e);let A=a(2);return m(A.onMenuAction(l))}),i()}if(t&2){let e=a(2);w("items",e.menuItems())}}function q(t,d){if(t&1){let e=u();n(0,"ds-icon-button",11),g("action",function(){s(e);let l=a();return m(l.onDuplicate())}),i(),p(1,k,1,1,"ds-kebab-menu",12)}if(t&2){let e=a();r(),_(e.readOnly()?-1:1)}}var B=Object.freeze({platform:{label:"PLATFORM",ariaLabel:"Configuration de niveau plateforme (lecture seule)",variant:"neutral"},namespace:{label:"NS",ariaLabel:"Configuration partag\xE9e du namespace",variant:"neutral"},userOnNs:{label:"USER \xD7 NS",ariaLabel:"Configuration utilisateur sur ce namespace",variant:"info"},userGlobal:{label:"USER GLOBAL",ariaLabel:"Configuration utilisateur globale",variant:"warning"}}),S=class t{config=v.required();scope=v.required();readOnly=v(!1);showBadge=v(!0);editRequested=f();deleteRequested=f();duplicateRequested=f();pendingDelete=x(!1);badge=C(()=>B[this.scope()]);menuItems=C(()=>[{key:"edit",label:"Edit provider",icon:"edit"},{key:"delete",label:"Delete provider",icon:"delete",variant:"danger"}]);onMenuAction(d){switch(d){case"edit":this.editRequested.emit(this.config());break;case"delete":this.pendingDelete.set(!0);break}}onDuplicate(){this.duplicateRequested.emit(this.config())}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.config())}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=y({type:t,selectors:[["agentos-ai-provider-item"]],inputs:{config:[1,"config"],scope:[1,"scope"],readOnly:[1,"readOnly"],showBadge:[1,"showBadge"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested",duplicateRequested:"duplicateRequested"},decls:12,vars:5,consts:[["role","listitem","dsBlueprint","",1,"ai-provider-item"],[1,"ai-provider-item__body"],[1,"ai-provider-item__heading"],[1,"ai-provider-item__name"],[1,"ai-provider-item__badge"],[1,"ai-provider-item__type"],[1,"ai-provider-item__url"],[1,"ai-provider-item__actions"],[1,"ai-provider-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","content_copy","title","Duplicate this provider",3,"action"],[3,"items"],[3,"itemSelected","items"]],template:function(e,o){e&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),c(4),i(),p(5,I,2,3,"span",4),i(),n(6,"span",5),c(7),i(),p(8,E,2,1,"span",6),i(),n(9,"div",7),p(10,R,4,0)(11,q,2,1),i()()),e&2&&(r(4),b(o.config().name),r(),_(o.showBadge()?5:-1),r(2),b(o.config().apiType),r(),_(o.config().baseUrl?8:-1),r(2),_(o.pendingDelete()?10:11))},dependencies:[M,O,D],styles:[".ai-provider-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.ai-provider-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.ai-provider-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-provider-item__heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.ai-provider-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.ai-provider-item__badge[_ngcontent-%COMP%]{flex-shrink:0;font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;border-radius:0;padding:.1rem .4rem;line-height:1.2;white-space:nowrap}.ai-provider-item__badge[data-variant=neutral][_ngcontent-%COMP%]{border:1px solid var(--color-divider);color:var(--color-neutral-600);background:transparent}.ai-provider-item__badge[data-variant=info][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-info) 40%,transparent);color:var(--color-info);background:color-mix(in srgb,var(--color-info) 10%,transparent)}.ai-provider-item__badge[data-variant=warning][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-warning) 40%,transparent);color:var(--color-warning);background:color-mix(in srgb,var(--color-warning) 10%,transparent)}.ai-provider-item__type[_ngcontent-%COMP%], .ai-provider-item__url[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-provider-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-provider-item[_ngcontent-%COMP%]:hover .ai-provider-item__actions[_ngcontent-%COMP%], .ai-provider-item[_ngcontent-%COMP%]:focus-within .ai-provider-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-provider-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};export{S as a};
|