@whoz-oss/coday-client 0.244.1 → 0.245.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-LHKOA7FX.js → chunk-2BMHZNQA.js} +1 -1
- package/browser/{chunk-ADEIEQGJ.js → chunk-2IN2N6PV.js} +1 -1
- package/browser/{chunk-AK746XRX.js → chunk-45MC2DTD.js} +1 -1
- package/browser/{chunk-WMHS3NSI.js → chunk-4QVEFNE3.js} +1 -1
- package/browser/{chunk-4CNY7Z64.js → chunk-4QXUUAXS.js} +1 -1
- package/browser/{chunk-VZOBZ3DD.js → chunk-6QJAB37Y.js} +1 -1
- package/browser/chunk-6UZOFA34.js +1 -0
- package/browser/{chunk-76HYDFUL.js → chunk-7QFIBIYY.js} +1 -1
- package/browser/{chunk-LUB22VNT.js → chunk-AGUXPJDD.js} +1 -1
- package/browser/{chunk-UO7SKQEC.js → chunk-AMWKKZG5.js} +1 -1
- package/browser/{chunk-X73LZ3QV.js → chunk-ARAXWPWU.js} +1 -1
- package/browser/{chunk-5OGZHNUE.js → chunk-BSYMLXS6.js} +1 -1
- package/browser/{chunk-UQTA3ACH.js → chunk-C2LUO2MP.js} +1 -1
- package/browser/{chunk-F4ZRQ6MH.js → chunk-CQANBPMP.js} +1 -1
- package/browser/{chunk-VLDPXI7G.js → chunk-CWVJWHAD.js} +1 -1
- package/browser/{chunk-U7ZJFIOR.js → chunk-D67AF7QL.js} +1 -1
- package/browser/{chunk-CSHG3PLJ.js → chunk-DGCILIN5.js} +1 -1
- package/browser/{chunk-U3AHBQTX.js → chunk-EG5EQQU3.js} +1 -1
- package/browser/{chunk-CU7SABOQ.js → chunk-EHQPUQEI.js} +1 -1
- package/browser/{chunk-QXBTTCPM.js → chunk-FCEVFEIX.js} +1 -1
- package/browser/{chunk-ONZVOEJQ.js → chunk-FCFKY56K.js} +1 -1
- package/browser/{chunk-X5ZRXGFA.js → chunk-FSUOGZGO.js} +1 -1
- package/browser/{chunk-QTXEWRHZ.js → chunk-GLZG7RKF.js} +1 -1
- package/browser/{chunk-W7A7CPWM.js → chunk-HD2F6BMJ.js} +1 -1
- package/browser/{chunk-NYUYHMIH.js → chunk-IMS7HQGJ.js} +1 -1
- package/browser/chunk-KCFDTF3A.js +1 -0
- package/browser/{chunk-GLFQ37PU.js → chunk-KYYI3JSI.js} +1 -1
- package/browser/{chunk-KWJJEVAI.js → chunk-LIBCKDBU.js} +1 -1
- package/browser/{chunk-5Y2Q6WKL.js → chunk-LRIDOWQT.js} +1 -1
- package/browser/{chunk-I4RHXOIC.js → chunk-M6HAWZVC.js} +1 -1
- package/browser/chunk-MBQHFE5U.js +1 -0
- package/browser/{chunk-BWBZLC7A.js → chunk-NT57GO6D.js} +1 -1
- package/browser/{chunk-N2NJQ7DJ.js → chunk-NYQXGX3Y.js} +1 -1
- package/browser/{chunk-XAEUGARN.js → chunk-OTZDQE5T.js} +1 -1
- package/browser/{chunk-ZXQEKBPA.js → chunk-PEPRUAAU.js} +1 -1
- package/browser/{chunk-7H4TBVB7.js → chunk-PKLY5FK2.js} +1 -1
- package/browser/{chunk-S5QSZK6N.js → chunk-Q3UQBBUS.js} +1 -1
- package/browser/{chunk-MIAKSSSF.js → chunk-QCLAOYIL.js} +1 -1
- package/browser/chunk-QKICZGWX.js +1 -0
- package/browser/{chunk-7O6TY5IW.js → chunk-QTGBG7IF.js} +1 -1
- package/browser/{chunk-SZM3NJVZ.js → chunk-SC7BP3G3.js} +1 -1
- package/browser/{chunk-5N6DUZII.js → chunk-SI42WXFB.js} +1 -1
- package/browser/{chunk-TNSH3NBF.js → chunk-T4R5WSRE.js} +1 -1
- package/browser/chunk-UJ2IGPRI.js +1 -0
- package/browser/{chunk-RQKLSUW5.js → chunk-W34FCJM7.js} +1 -1
- package/browser/{chunk-H6NBS4JE.js → chunk-W7ONGRS7.js} +1 -1
- package/browser/{chunk-NNUJIQ6R.js → chunk-WJZ4NXIG.js} +1 -1
- package/browser/{chunk-GSUU7JSY.js → chunk-WTBQIOPQ.js} +1 -1
- package/browser/{chunk-FA2MVU23.js → chunk-XC5W65K7.js} +1 -1
- package/browser/{chunk-4FGWE3EW.js → chunk-XKHDPUML.js} +1 -1
- package/browser/{chunk-ECISS7V2.js → chunk-XS4CC6GG.js} +1 -1
- package/browser/{chunk-UWYJO2DN.js → chunk-YCZCEQQL.js} +1 -1
- package/browser/chunk-YFQUZF2M.js +1 -0
- package/browser/{chunk-ZQZHBROX.js → chunk-ZEN5PJJE.js} +1 -1
- package/browser/{chunk-KJJPVCIH.js → chunk-ZJLDJUUY.js} +1 -1
- package/browser/{chunk-MFSY4HYK.js → chunk-ZM4HUO26.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-JHPNU2VL.js → main-5JFQENOY.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-ENRRDIUM.js +0 -1
- package/browser/chunk-P6WNH2KJ.js +0 -1
- package/browser/chunk-XJYEZL5J.js +0 -1
- package/browser/chunk-XZRVHU66.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-6JMDCL65.js";import{a as k}from"./chunk-
|
|
1
|
+
import{a as D}from"./chunk-6JMDCL65.js";import{a as k}from"./chunk-LIBCKDBU.js";import"./chunk-C2LUO2MP.js";import{c as x}from"./chunk-6XX7GME4.js";import{s as B,z as $}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as d}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as b,Db as m,Fb as l,Lc as T,Pb as w,S as _,Wa as g,ab as C,ca as i,cc as I,fc as M,ga as u,gc as R,ha as y,i as c,jc as S,lb as h,ma as P,mb as v,rb as a,sb as p,t as f,tb as s}from"./chunk-CHEXA6RY.js";var F=()=>[];function L(o,e){if(o&1){let t=b();p(0,"agentos-prompt-item",4),m("deleteRequested",function(r){u(t);let E=l(2);return y(E.deletePrompt(r))}),s()}o&2&&a("prompt",e)("platformMode",!0)}function N(o,e){if(o&1&&h(0,L,1,2,"agentos-prompt-item",3),o&2){let t,n=e.$implicit,r=l();v((t=r.resolvePrompt(n.id))?0:-1,t)}}var q=class o{router=i(x);destroyRef=i(P);promptState=i(k);refresh$=new c(void 0);prompts$=this.refresh$.pipe(_(()=>this.promptState.listPlatform()));promptItems$=this.prompts$.pipe(f(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.description}))));promptsById=new Map;constructor(){this.prompts$.pipe(d(this.destroyRef)).subscribe(e=>{this.promptsById=new Map(e.map(t=>[t.id??"",t]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"])}deletePrompt(e){this.promptState.delete(e.id??"").pipe(d(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolvePrompt(e){return this.promptsById.get(e)??null}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=g({type:o,selectors:[["agentos-platform-prompts"]],decls:5,vars:6,consts:[["promptItemTpl",""],["title","Platform Prompts","emptyMessage","No platform prompts defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"prompt","platformMode"],[3,"deleteRequested","prompt","platformMode"]],template:function(t,n){if(t&1&&(p(0,"ds-entity-list",1),M(1,"async"),m("createRequested",function(){return n.openCreateForm()}),p(2,"ds-icon-button",2),m("action",function(){return n.goBack()}),s()(),C(3,N,1,1,"ng-template",null,0,S)),t&2){let r=w(4);a("items",R(1,3,n.promptItems$)??I(5,F))("showCreate",!0)("itemTemplate",r)}},dependencies:[$,D,B,T],styles:[".platform-prompts__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-prompts__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};export{q as PlatformPromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./chunk-TFW43ZTS.js";import{c as $}from"./chunk-
|
|
1
|
+
import{a as E}from"./chunk-TFW43ZTS.js";import{c as $}from"./chunk-4QVEFNE3.js";import"./chunk-NWFFZ2FW.js";import"./chunk-6QJAB37Y.js";import"./chunk-C2LUO2MP.js";import{c as B}from"./chunk-6XX7GME4.js";import{z as q}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as g}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as b,Db as a,Fb as m,Lc as I,Pb as w,S as _,Tb as D,Wa as S,ab as C,ca as s,cc as R,fc as P,ga as l,gc as x,ha as u,i as f,jc as T,lb as v,ma as y,mb as A,rb as d,sb as r,t as h,tb as c}from"./chunk-CHEXA6RY.js";var M=()=>[];function V(i,t){if(i&1){let e=b();r(0,"agentos-auth-setting-item",4),a("editRequested",function(n){l(e);let p=m(2);return u(p.onEdit(n))})("deleteRequested",function(n){l(e);let p=m(2);return u(p.onDelete(n))}),c()}i&2&&d("config",t)("showBadge",!1)}function F(i,t){if(i&1&&v(0,V,1,2,"agentos-auth-setting-item",3),i&2){let e,o=t.$implicit,n=m();A((e=n.resolveSetting(o.id))?0:-1,e)}}var k=class i{router=s(B);destroyRef=s(y);state=s($);refresh$=new f(void 0);settings$=this.refresh$.pipe(_(()=>this.state.loadPlatformSettings()));settingItems$=this.settings$.pipe(h(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.authType}))));settingsById=new Map;constructor(){this.settings$.pipe(g(this.destroyRef)).subscribe(t=>{this.settingsById=new Map(t.map(e=>[e.id??"",e]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"])}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"])}onDelete(t){t.id&&this.state.delete(t.id,"platform").pipe(g(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveSetting(t){return this.settingsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=S({type:i,selectors:[["agentos-platform-auth-settings"]],decls:6,vars:6,consts:[["authSettingItemTpl",""],["title","Platform Auth Settings","emptyMessage","No platform auth settings defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"platform-auth-settings__back",3,"click"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(e,o){if(e&1&&(r(0,"ds-entity-list",1),P(1,"async"),a("createRequested",function(){return o.openCreateForm()}),r(2,"button",2),a("click",function(){return o.goBack()}),D(3,"\u2190 Admin"),c()(),C(4,F,1,1,"ng-template",null,0,T)),e&2){let n=w(5);d("items",x(1,3,o.settingItems$)??R(5,M))("showCreate",!0)("itemTemplate",n)}},dependencies:[q,E,I],encapsulation:2,changeDetection:0})};export{k as PlatformAuthSettingsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-QCLAOYIL.js";import"./chunk-SI42WXFB.js";import"./chunk-C2LUO2MP.js";import"./chunk-6XX7GME4.js";import"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.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 UserGroupFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L}from"./chunk-6JMDCL65.js";import{a as D}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-6JMDCL65.js";import{a as D}from"./chunk-LIBCKDBU.js";import"./chunk-C2LUO2MP.js";import{a as E,c as $}from"./chunk-6XX7GME4.js";import{z as O}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.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{a as I}from"./chunk-
|
|
1
|
+
import{a as I}from"./chunk-7QFIBIYY.js";import{a as T}from"./chunk-AMWKKZG5.js";import"./chunk-C2LUO2MP.js";import{c as w}from"./chunk-6XX7GME4.js";import{s as x,z as q}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as p}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as C,Db as c,Fb as s,Pb as S,Wa as P,ab as b,ca as m,ga as d,ha as a,jc as v,lb as g,ma as f,mb as y,mc as R,rb as u,sb as l,ta as h,tb as _}from"./chunk-CHEXA6RY.js";function M(i,e){if(i&1){let t=C();l(0,"agentos-scheduled-prompt-item",4),c("enableRequested",function(n){d(t);let r=s(2);return a(r.enablePrompt(n))})("disableRequested",function(n){d(t);let r=s(2);return a(r.disablePrompt(n))})("deleteRequested",function(n){d(t);let r=s(2);return a(r.deletePrompt(n))}),_()}i&2&&u("definition",e)("platformMode",!0)}function E(i,e){if(i&1&&g(0,M,1,2,"agentos-scheduled-prompt-item",3),i&2){let t,o=e.$implicit,n=s();y((t=n.resolvePrompt(o.id))?0:-1,t)}}var D=class i{router=m(w);destroyRef=m(f);state=m(T);prompts=h([]);promptItems=R(()=>this.prompts().map(e=>({id:e.id??"",name:e.name,description:e.description,badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]})));constructor(){this.state.listPlatform().pipe(p(this.destroyRef)).subscribe(e=>this.prompts.set(e))}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","scheduled-prompts","new"])}enablePrompt(e){this.state.enable(e.id??"").pipe(p(this.destroyRef)).subscribe(t=>this.patchPrompt(t))}disablePrompt(e){this.state.disable(e.id??"").pipe(p(this.destroyRef)).subscribe(t=>this.patchPrompt(t))}deletePrompt(e){let t=e.id??"";this.state.delete(t).pipe(p(this.destroyRef)).subscribe(()=>this.prompts.update(o=>o.filter(n=>n.id!==t)))}resolvePrompt(e){return this.prompts().find(t=>t.id===e)??null}patchPrompt(e){this.prompts.update(t=>t.map(o=>o.id===e.id?e:o))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=P({type:i,selectors:[["agentos-platform-scheduled-prompts"]],decls:4,vars:3,consts:[["scheduledPromptItemTpl",""],["title","Platform Scheduled Prompts","emptyMessage","No platform scheduled prompts defined yet. Add one above.","cardMinWidth","420px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"definition","platformMode"],[3,"enableRequested","disableRequested","deleteRequested","definition","platformMode"]],template:function(t,o){if(t&1&&(l(0,"ds-entity-list",1),c("createRequested",function(){return o.openCreateForm()}),l(1,"ds-icon-button",2),c("action",function(){return o.goBack()}),_()(),b(2,E,1,1,"ng-template",null,0,v)),t&2){let n=S(3);u("items",o.promptItems())("showCreate",!0)("itemTemplate",n)}},dependencies:[q,I,x],encapsulation:2,changeDetection:0})};export{D as PlatformScheduledPromptsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k}from"./chunk-WAGXU26A.js";import{d as D}from"./chunk-
|
|
1
|
+
import{a as k}from"./chunk-WAGXU26A.js";import{d as D}from"./chunk-C2LUO2MP.js";import{c as q}from"./chunk-6XX7GME4.js";import{s as M,z as $}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as _}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as b,Db as s,Fb as d,Lc as T,Pb as w,S as P,Wa as y,ab as C,ca as n,cc as R,fc as I,ga as m,gc as x,ha as l,i as f,jc as B,lb as h,ma as g,mb as A,rb as c,sb as a,t as u,tb as v}from"./chunk-CHEXA6RY.js";var S=()=>[];function V(r,e){if(r&1){let t=b();a(0,"agentos-ai-provider-item",4),s("editRequested",function(i){m(t);let p=d(2);return l(p.onEdit(i))})("deleteRequested",function(i){m(t);let p=d(2);return l(p.onDelete(i))}),v()}r&2&&c("config",e)("showBadge",!1)}function F(r,e){if(r&1&&h(0,V,1,2,"agentos-ai-provider-item",3),r&2){let t,o=e.$implicit,i=d();A((t=i.resolveProvider(o.id))?0:-1,t)}}var E=class r{router=n(q);destroyRef=n(g);aiProviderController=n(D);refresh$=new f(void 0);providers$=this.refresh$.pipe(P(()=>this.aiProviderController.listAiProvider("none")));providerItems$=this.providers$.pipe(u(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.apiType}))));providersById=new Map;constructor(){this.providers$.pipe(_(this.destroyRef)).subscribe(e=>{this.providersById=new Map(e.map(t=>[t.id??"",t]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"])}onEdit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"])}onDelete(e){e.id&&this.aiProviderController.deleteAiProvider(e.id).pipe(_(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveProvider(e){return this.providersById.get(e)??null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=y({type:r,selectors:[["agentos-platform-ai-providers"]],decls:5,vars:6,consts:[["aiProviderItemTpl",""],["title","Platform AI Providers","emptyMessage","No platform AI providers defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(t,o){if(t&1&&(a(0,"ds-entity-list",1),I(1,"async"),s("createRequested",function(){return o.openCreateForm()}),a(2,"ds-icon-button",2),s("action",function(){return o.goBack()}),v()(),C(3,F,1,1,"ng-template",null,0,B)),t&2){let i=w(4);c("items",x(1,3,o.providerItems$)??R(5,S))("showCreate",!0)("itemTemplate",i)}},dependencies:[$,k,M,T],styles:[".platform-ai-providers__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-providers__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"],changeDetection:0})};export{E as PlatformAiProvidersComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk-NWFFZ2FW.js";import{a as f}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-NWFFZ2FW.js";import{a as f}from"./chunk-6QJAB37Y.js";import{d as m}from"./chunk-C2LUO2MP.js";import{D as a,P as h,S as A,V as d,Z as b,a as P,ca as c,i as v,m as o,t as u,u as l}from"./chunk-CHEXA6RY.js";var g="none",N="me",O=class p{nsController=c(m);userState=c(f);refresh$=new v(void 0);namespaceId$=new v(null);vm$=l([this.namespaceId$,this.refresh$]).pipe(A(([e])=>{let r=this.loadPlatformProviders().pipe(a(()=>o([])));return e?l([r,this.loadNamespaceProviders(e).pipe(a(()=>o([]))),this.loadUserProviders(e).pipe(a(()=>o([]))),this.loadUserProviders("global").pipe(a(()=>o([])))]).pipe(u(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):l([r,this.loadNamespaceProviders("").pipe(a(()=>o([]))),this.loadUserProviders("global").pipe(a(()=>o([])))]).pipe(u(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),h({bufferSize:1,refCount:!0}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e)}refresh(){this.refresh$.next()}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=y(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):o([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(d(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(d(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=P({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(d(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(d(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=b({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-QXBTTCPM.js";import{c as te}from"./chunk-WMHS3NSI.js";import{a as Z}from"./chunk-ADEIEQGJ.js";import"./chunk-NWFFZ2FW.js";import{c as X}from"./chunk-RB7N2NWN.js";import{a as W}from"./chunk-VZOBZ3DD.js";import{d as Q}from"./chunk-YFCRBVWD.js";import"./chunk-UQTA3ACH.js";import{c as N}from"./chunk-6XX7GME4.js";import{s as q}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as k,c as K}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import{F as J,c as B,g as R,h as A,i as L,l as O,n as j,v as Y,w as H}from"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as f,Db as c,Fb as l,Hc as $,Ka as _,Rb as E,Tb as r,Ub as u,Vb as S,Wa as z,ca as x,ga as p,ha as m,jb as P,kb as w,lb as g,ma as G,mb as v,mc as T,pb as b,qb as h,rb as U,sb as n,t as F,ta as y,tb as t,u as I,ub as M}from"./chunk-CHEXA6RY.js";var V=(o,i)=>i.value;function ie(o,i){o&1&&(n(0,"p",4),r(1,"Loading\u2026"),t())}function oe(o,i){if(o&1){let e=f();n(0,"button",18),c("click",function(){let s=p(e).$implicit,d=l(2);return m(d.setThemeVariant(s.value))}),n(1,"span",19),r(2),t(),n(3,"span",20),r(4),t()()}if(o&2){let e=i.$implicit,a=l(2);E("user-profile__theme-variant--active",a.themeVariant()===e.value),P("aria-pressed",a.themeVariant()===e.value),_(2),u(e.label),_(2),u(e.description)}}function re(o,i){if(o&1){let e=f();n(0,"button",21),c("click",function(){let s=p(e).$implicit,d=l(2);return m(d.setTheme(s.value))}),r(1),t()}if(o&2){let e=i.$implicit,a=l(2);E("user-profile__segmented-option--active",a.themeMode()===e.value),P("aria-pressed",a.themeMode()===e.value),_(),S(" ",e.label," ")}}function ae(o,i){if(o&1){let e=f();n(0,"button",21),c("click",function(){let s=p(e).$implicit,d=l(2);return m(d.setEnterKeyBehavior(s.value))}),r(1),t()}if(o&2){let e=i.$implicit,a=l(2);E("user-profile__segmented-option--active",a.enterKeyBehavior()===e.value),P("aria-pressed",a.enterKeyBehavior()===e.value),_(),S(" ",e.label," ")}}function le(o,i){if(o&1){let e=f();n(0,"form",22),c("ngSubmit",function(){p(e);let s=l(2);return m(s.save())}),n(1,"div",5)(2,"h2",6),r(3,"Identity"),t(),n(4,"div",7)(5,"span",8),r(6,"Email"),t(),n(7,"span",23),r(8),t()(),n(9,"div",7)(10,"span",8),r(11,"External ID"),t(),n(12,"span",23),r(13),t()()(),n(14,"div",5)(15,"h2",6),r(16,"Profile"),t(),n(17,"div",7)(18,"label",24),r(19,"First name"),t(),M(20,"input",25),t(),n(21,"div",7)(22,"label",26),r(23,"Last name"),t(),M(24,"input",27),t(),n(25,"div",7)(26,"label",28),r(27,"Bio"),t(),M(28,"textarea",29),t()(),n(29,"div",30)(30,"button",31),r(31),t(),n(32,"button",32),c("click",function(){p(e);let s=l(2);return m(s.cancelEditing())}),r(33,"Cancel"),t()()()}if(o&2){let e=l(),a=l();U("formGroup",a.form),_(8),u(e.email),_(5),u(e.externalId),_(17),U("disabled",a.isSaving()),_(),S(" ",a.isSaving()?"Saving\u2026":"Save changes"," ")}}function se(o,i){o&1&&(n(0,"p",40),r(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),t())}function _e(o,i){if(o&1){let e=f();n(0,"span",47),r(1,"Delete?"),t(),n(2,"button",48),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.confirmDelete(s))}),r(3," Confirm "),t(),n(4,"button",49),c("click",function(){p(e);let s=l(7);return m(s.cancelDelete())}),r(5," Cancel "),t()}}function de(o,i){if(o&1){let e=f();n(0,"button",49),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.armDelete(s))}),r(1," Delete "),t()}}function ce(o,i){if(o&1&&(n(0,"li",43)(1,"span",44),r(2),t(),n(3,"span",45),r(4),t(),g(5,_e,6,0)(6,de,2,0,"button",46),t()),o&2){let e=i.$implicit,a=l(6);_(2),u(e.name),_(2),u(e.subtitle),_(),v(a.isPendingDelete(e)?5:6)}}function pe(o,i){if(o&1&&(n(0,"h3",41),r(1,"Integrations"),t(),n(2,"ul",42),b(3,ce,7,3,"li",43,w().trackEntry,!0),t()),o&2){let e=l(5);_(3),h(e.recap().integrations)}}function me(o,i){if(o&1){let e=f();n(0,"span",47),r(1,"Delete?"),t(),n(2,"button",48),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.confirmDelete(s))}),r(3," Confirm "),t(),n(4,"button",49),c("click",function(){p(e);let s=l(7);return m(s.cancelDelete())}),r(5," Cancel "),t()}}function ue(o,i){if(o&1){let e=f();n(0,"button",49),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.armDelete(s))}),r(1," Delete "),t()}}function fe(o,i){if(o&1&&(n(0,"li",43)(1,"span",44),r(2),t(),n(3,"span",45),r(4),t(),g(5,me,6,0)(6,ue,2,0,"button",46),t()),o&2){let e=i.$implicit,a=l(6);_(2),u(e.name),_(2),u(e.subtitle),_(),v(a.isPendingDelete(e)?5:6)}}function Ce(o,i){if(o&1&&(n(0,"h3",41),r(1,"AI Providers"),t(),n(2,"ul",42),b(3,fe,7,3,"li",43,w().trackEntry,!0),t()),o&2){let e=l(5);_(3),h(e.recap().aiProviders)}}function ge(o,i){if(o&1){let e=f();n(0,"span",47),r(1,"Delete?"),t(),n(2,"button",48),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.confirmDelete(s))}),r(3," Confirm "),t(),n(4,"button",49),c("click",function(){p(e);let s=l(7);return m(s.cancelDelete())}),r(5," Cancel "),t()}}function ve(o,i){if(o&1){let e=f();n(0,"button",49),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.armDelete(s))}),r(1," Delete "),t()}}function xe(o,i){if(o&1&&(n(0,"li",43)(1,"span",44),r(2),t(),n(3,"span",45),r(4),t(),g(5,ge,6,0)(6,ve,2,0,"button",46),t()),o&2){let e=i.$implicit,a=l(6);_(2),u(e.name),_(2),u(e.subtitle),_(),v(a.isPendingDelete(e)?5:6)}}function be(o,i){if(o&1&&(n(0,"h3",41),r(1,"My global auth settings"),t(),n(2,"ul",42),b(3,xe,7,3,"li",43,w().trackEntry,!0),t()),o&2){let e=l(5);_(3),h(e.recap().authSettings)}}function he(o,i){if(o&1&&(g(0,pe,5,0),g(1,Ce,5,0),g(2,be,5,0)),o&2){let e=l(4);v(e.recap().integrations.length>0?0:-1),_(),v(e.recap().aiProviders.length>0?1:-1),_(),v(e.recap().authSettings.length>0?2:-1)}}function ye(o,i){if(o&1&&g(0,se,2,0,"p",40)(1,he,3,3),o&2){let e=l(3);v(e.recap().total===0?0:1)}}function Pe(o,i){if(o&1){let e=f();n(0,"div",17)(1,"div",5)(2,"h2",6),r(3,"Identity"),t(),n(4,"div",7)(5,"span",8),r(6,"Email"),t(),n(7,"span",33),r(8),t()(),n(9,"div",7)(10,"span",8),r(11,"External ID"),t(),n(12,"span",33),r(13),t()()(),n(14,"div",5)(15,"h2",6),r(16,"Profile"),t(),n(17,"div",7)(18,"span",8),r(19,"First name"),t(),n(20,"span",33),r(21),t()(),n(22,"div",7)(23,"span",8),r(24,"Last name"),t(),n(25,"span",33),r(26),t()(),n(27,"div",34)(28,"span",8),r(29,"Bio"),t(),n(30,"span",33),r(31),t()()(),n(32,"div",30)(33,"button",35),c("click",function(){p(e);let s=l(2);return m(s.startEditing())}),r(34," Edit profile "),t()(),n(35,"div",36)(36,"button",37),c("click",function(){p(e);let s=l(2);return m(s.toggleOverrides())}),n(37,"span",38),r(38,"\u25B6"),t(),r(39," My global user configurations "),n(40,"span",39),r(41),t()(),g(42,ye,2,1),t()()}if(o&2){let e=l(),a=l();_(8),u(e.email),_(5),u(e.externalId),_(8),u(e.firstname||"\u2014"),_(5),u(e.lastname||"\u2014"),_(5),u(e.bio||"\u2014"),_(5),P("aria-expanded",a.isOverridesExpanded()),_(),E("user-profile__overrides-arrow--open",a.isOverridesExpanded()),_(4),S("(",a.recap().total,")"),_(),v(a.isOverridesExpanded()?42:-1)}}function Ee(o,i){if(o&1&&(n(0,"div",5)(1,"h2",6),r(2,"Appearance"),t(),n(3,"div",7)(4,"span",8),r(5,"Skin"),t(),n(6,"div",9),b(7,oe,5,5,"button",10,V),t()(),n(9,"div",7)(10,"span",8),r(11,"Mode"),t(),n(12,"div",11),b(13,re,2,4,"button",12,V),t()()(),n(15,"div",5)(16,"h2",6),r(17,"Composer"),t(),n(18,"div",7)(19,"span",8),r(20,"Enter key"),t(),n(21,"div",13)(22,"div",14),b(23,ae,2,4,"button",12,V),t(),n(25,"p",15),r(26,'In "New line" mode, press Ctrl or Cmd + Enter to send.'),t()()()(),g(27,le,34,5,"form",16)(28,Pe,43,10,"div",17)),o&2){let e=l();_(7),h(e.themeVariantOptions),_(6),h(e.themeOptions),_(10),h(e.enterKeyOptions),_(4),v(e.isEditing()?27:28)}}function Se(o,i){o&1&&(n(0,"p",4),r(1,"Unable to load profile."),t())}var ne=class o{userState=x(W);router=x(N);location=x($);destroyRef=x(G);integrationState=x(Z);providerState=x(ee);authSettingState=x(te);themePort=x(Q);preferencesPort=x(X);isEditing=y(!1);isLoading=y(!1);isSaving=y(!1);isOverridesExpanded=y(!1);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=T(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=T(()=>this.themePort.theme().variant);themeVariantOptions=[{value:"industry",label:"Industry",description:"Bleu acier, Barlow"},{value:"terminal",label:"Terminal",description:"Ambre CRT, JetBrains Mono"}];enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];form=new L({firstname:new O("",{nonNullable:!0}),lastname:new O("",{nonNullable:!0}),bio:new O("",{nonNullable:!0})});recap=K(I([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(F(([i,e,a])=>{let s=i.map(C=>({category:"integration",id:C.id??"",name:C.name,subtitle:C.integrationType})),d=e.map(C=>({category:"aiProvider",id:C.id??"",name:C.name,subtitle:C.apiType})),D=a.map(C=>({category:"authSetting",id:C.id??"",name:C.name,subtitle:C.authType}));return{integrations:s,aiProviders:d,authSettings:D,total:s.length+d.length+D.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(!0),this.userState.loadMe().pipe(k(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)})}startEditing(){this.syncFormFromState(),this.isEditing.set(!0)}cancelEditing(){this.isEditing.set(!1)}setTheme(i){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:i})}setThemeVariant(i){this.themePort.setTheme({variant:i,mode:this.themePort.theme().mode})}setEnterKeyBehavior(i){this.preferencesPort.setEnterKeyBehavior(i)}save(){this.isSaving()||(this.isSaving.set(!0),this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0}).pipe(k(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(!1),this.isEditing.set(!1)},error:()=>this.isSaving.set(!1)}))}toggleOverrides(){this.isOverridesExpanded.update(i=>!i),this.pendingDeleteKey.set(null)}pendingDeleteKey=y(null);isPendingDelete(i){return this.pendingDeleteKey()===this.entryKey(i)}armDelete(i){i.id&&this.pendingDeleteKey.set(this.entryKey(i))}cancelDelete(){this.pendingDeleteKey.set(null)}confirmDelete(i){if(!i.id)return;this.pendingDeleteKey.set(null),(i.category==="integration"?this.integrationState.delete(i.id,"userGlobal"):i.category==="authSetting"?this.authSettingState.delete(i.id,"userGlobal"):this.providerState.delete(i.id,"userGlobal")).pipe(k(this.destroyRef)).subscribe({error:a=>{console.error(`[UserProfile] Delete failed for ${i.category}:${i.id}:`,a)}})}entryKey(i){return`${i.category}:${i.id}`}goBack(){window.history.length>1?this.location.back():this.router.navigate(["/agentos"])}trackEntry(i,e){return this.entryKey(e)}syncFormFromState(){let i=this.currentUser();i&&this.form.setValue({firstname:i.firstname??"",lastname:i.lastname??"",bio:i.bio??""})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=z({type:o,selectors:[["agentos-user-profile"]],decls:8,vars:1,consts:[[1,"user-profile"],[1,"user-profile__header"],["icon","arrow_back","title","Back",3,"action"],[1,"user-profile__title"],[1,"user-profile__loading"],[1,"user-profile__section"],[1,"user-profile__section-title"],[1,"user-profile__field"],[1,"user-profile__label"],[1,"user-profile__theme-variants"],["type","button",1,"user-profile__theme-variant",3,"user-profile__theme-variant--active"],["role","group","aria-label","Color mode",1,"user-profile__segmented"],["type","button",1,"user-profile__segmented-option",3,"user-profile__segmented-option--active"],[1,"user-profile__field-control"],["role","group","aria-label","Enter key behavior",1,"user-profile__segmented"],[1,"user-profile__hint"],[1,"user-profile__form",3,"formGroup"],[1,"user-profile__view"],["type","button",1,"user-profile__theme-variant",3,"click"],[1,"user-profile__theme-variant-name"],[1,"user-profile__theme-variant-desc"],["type","button",1,"user-profile__segmented-option",3,"click"],[1,"user-profile__form",3,"ngSubmit","formGroup"],[1,"user-profile__value","user-profile__value--readonly"],["for","up-firstname",1,"user-profile__label"],["id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name",1,"user-profile__input"],["for","up-lastname",1,"user-profile__label"],["id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name",1,"user-profile__input"],["for","up-bio",1,"user-profile__label"],["id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4",1,"user-profile__input","user-profile__input--textarea"],[1,"user-profile__actions"],["type","submit",1,"user-profile__btn","user-profile__btn--primary",3,"disabled"],["type","button",1,"user-profile__btn",3,"click"],[1,"user-profile__value"],[1,"user-profile__field","user-profile__field--bio"],["type","button",1,"user-profile__btn","user-profile__btn--primary",3,"click"],[1,"user-profile__overrides"],["type","button",1,"user-profile__overrides-toggle",3,"click"],[1,"user-profile__overrides-arrow"],[1,"user-profile__overrides-count"],[1,"user-profile__overrides-empty"],[1,"user-profile__overrides-subtitle"],[1,"user-profile__overrides-list"],[1,"user-profile__overrides-row"],[1,"user-profile__overrides-name"],[1,"user-profile__overrides-subtitle-text"],["type","button",1,"user-profile__overrides-delete"],[1,"user-profile__overrides-confirm-label"],["type","button",1,"user-profile__overrides-delete","user-profile__overrides-delete--confirm",3,"click"],["type","button",1,"user-profile__overrides-delete",3,"click"]],template:function(e,a){if(e&1&&(n(0,"div",0)(1,"header",1)(2,"ds-icon-button",2),c("action",function(){return a.goBack()}),t(),n(3,"h1",3),r(4,"My profile"),t()(),g(5,ie,2,0,"p",4)(6,Ee,29,1)(7,Se,2,0,"p",4),t()),e&2){let s;_(5),v(a.isLoading()?5:(s=a.currentUser())?6:7,s)}},dependencies:[J,j,B,R,A,H,Y,q],styles:[".user-profile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-profile__header[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.5rem}.user-profile__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)}.user-profile__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-profile__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-profile__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.user-profile__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.user-profile__view[_ngcontent-%COMP%], .user-profile__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-profile__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-profile__section-title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);border-bottom:1px solid var(--color-divider);padding-bottom:.5rem}.user-profile__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-profile__field--bio[_ngcontent-%COMP%]{align-items:start}.user-profile__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary);white-space:nowrap}.user-profile__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text);word-break:break-word;white-space:pre-wrap}.user-profile__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.875rem}.user-profile__segmented[_ngcontent-%COMP%]{display:inline-flex;justify-self:start;border:1px solid var(--color-divider);overflow:hidden}.user-profile__segmented-option[_ngcontent-%COMP%]{padding:.4rem .85rem;background:transparent;border:none;border-right:1px solid var(--color-divider);color:var(--color-text-secondary);font-size:.875rem;cursor:pointer;transition:background .15s ease,color .15s ease}.user-profile__segmented-option[_ngcontent-%COMP%]:last-child{border-right:none}.user-profile__segmented-option[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__segmented-option--active[_ngcontent-%COMP%]{background:var(--color-accent);color:#fff}.user-profile__segmented-option--active[_ngcontent-%COMP%]:hover{background:var(--color-accent-700)}.user-profile__field-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.4rem}.user-profile__hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary)}.user-profile__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;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;border-radius:0;transition:border-color .15s ease;resize:none}.user-profile__input[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.user-profile__input[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.user-profile__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-profile__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-profile__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;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;border-radius:0;transition:background .15s ease,border-color .15s ease}.user-profile__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-profile__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.user-profile__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.user-profile__theme-variants[_ngcontent-%COMP%]{display:flex;gap:8px;justify-self:start}.user-profile__theme-variant[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:10px 16px;border:1px solid var(--color-divider);background:transparent;cursor:pointer;min-width:120px;transition:background .12s,border-color .12s}.user-profile__theme-variant[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__theme-variant--active[_ngcontent-%COMP%]{border-color:var(--color-accent);background:color-mix(in srgb,var(--color-accent) 8%,transparent)}.user-profile__theme-variant-name[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:13px;font-weight:600;color:var(--color-text)}.user-profile__theme-variant-desc[_ngcontent-%COMP%]{font-size:11px;color:var(--color-text-secondary);font-family:var(--font-body)}.user-profile__overrides[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--color-divider)}.user-profile__overrides-toggle[_ngcontent-%COMP%]{background:transparent;border:none;padding:.25rem 0;font-size:.85rem;color:var(--color-text-secondary);cursor:pointer;display:flex;align-items:center;gap:.4rem}.user-profile__overrides-toggle[_ngcontent-%COMP%]:hover{color:var(--color-text)}.user-profile__overrides-arrow[_ngcontent-%COMP%]{display:inline-block;font-size:.65rem;transition:transform .15s ease}.user-profile__overrides-arrow--open[_ngcontent-%COMP%]{transform:rotate(90deg)}.user-profile__overrides-count[_ngcontent-%COMP%]{color:var(--color-text-tertiary)}.user-profile__overrides-empty[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);font-style:italic;padding:.5rem 0 0;margin:0}.user-profile__overrides-subtitle[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);margin:.75rem 0 .25rem}.user-profile__overrides-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.25rem}.user-profile__overrides-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem;font-size:.85rem;border-radius:0}.user-profile__overrides-row[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__overrides-name[_ngcontent-%COMP%]{flex:1;color:var(--color-text);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-profile__overrides-subtitle-text[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:var(--font-heading)}.user-profile__overrides-confirm-label[_ngcontent-%COMP%]{font-size:11px;font-family:var(--font-heading);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);white-space:nowrap}.user-profile__overrides-delete[_ngcontent-%COMP%]{background:transparent;border:1px solid transparent;font-size:11px;font-family:var(--font-heading);font-weight:600;color:var(--color-neutral-500);cursor:pointer;padding:3px 8px;border-radius:0;transition:color .12s,background .12s,border-color .12s}.user-profile__overrides-delete[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]{border-color:var(--red);background:var(--red);color:#fff}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]:hover{background:var(--red-deep);border-color:var(--red-deep)}"],changeDetection:0})};export{ne as UserProfileComponent};
|
|
1
|
+
import{a as ee}from"./chunk-FCEVFEIX.js";import{c as te}from"./chunk-4QVEFNE3.js";import{a as Z}from"./chunk-2IN2N6PV.js";import"./chunk-NWFFZ2FW.js";import{c as X}from"./chunk-RB7N2NWN.js";import{a as W}from"./chunk-6QJAB37Y.js";import{d as Q}from"./chunk-YFCRBVWD.js";import"./chunk-C2LUO2MP.js";import{c as N}from"./chunk-6XX7GME4.js";import{s as q}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as k,c as K}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import{F as J,c as B,g as R,h as A,i as L,l as O,n as j,v as Y,w as H}from"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as f,Db as c,Fb as l,Hc as $,Ka as _,Rb as E,Tb as r,Ub as u,Vb as S,Wa as z,ca as x,ga as p,ha as m,jb as P,kb as w,lb as g,ma as G,mb as v,mc as T,pb as b,qb as h,rb as U,sb as n,t as F,ta as y,tb as t,u as I,ub as M}from"./chunk-CHEXA6RY.js";var V=(o,i)=>i.value;function ie(o,i){o&1&&(n(0,"p",4),r(1,"Loading\u2026"),t())}function oe(o,i){if(o&1){let e=f();n(0,"button",18),c("click",function(){let s=p(e).$implicit,d=l(2);return m(d.setThemeVariant(s.value))}),n(1,"span",19),r(2),t(),n(3,"span",20),r(4),t()()}if(o&2){let e=i.$implicit,a=l(2);E("user-profile__theme-variant--active",a.themeVariant()===e.value),P("aria-pressed",a.themeVariant()===e.value),_(2),u(e.label),_(2),u(e.description)}}function re(o,i){if(o&1){let e=f();n(0,"button",21),c("click",function(){let s=p(e).$implicit,d=l(2);return m(d.setTheme(s.value))}),r(1),t()}if(o&2){let e=i.$implicit,a=l(2);E("user-profile__segmented-option--active",a.themeMode()===e.value),P("aria-pressed",a.themeMode()===e.value),_(),S(" ",e.label," ")}}function ae(o,i){if(o&1){let e=f();n(0,"button",21),c("click",function(){let s=p(e).$implicit,d=l(2);return m(d.setEnterKeyBehavior(s.value))}),r(1),t()}if(o&2){let e=i.$implicit,a=l(2);E("user-profile__segmented-option--active",a.enterKeyBehavior()===e.value),P("aria-pressed",a.enterKeyBehavior()===e.value),_(),S(" ",e.label," ")}}function le(o,i){if(o&1){let e=f();n(0,"form",22),c("ngSubmit",function(){p(e);let s=l(2);return m(s.save())}),n(1,"div",5)(2,"h2",6),r(3,"Identity"),t(),n(4,"div",7)(5,"span",8),r(6,"Email"),t(),n(7,"span",23),r(8),t()(),n(9,"div",7)(10,"span",8),r(11,"External ID"),t(),n(12,"span",23),r(13),t()()(),n(14,"div",5)(15,"h2",6),r(16,"Profile"),t(),n(17,"div",7)(18,"label",24),r(19,"First name"),t(),M(20,"input",25),t(),n(21,"div",7)(22,"label",26),r(23,"Last name"),t(),M(24,"input",27),t(),n(25,"div",7)(26,"label",28),r(27,"Bio"),t(),M(28,"textarea",29),t()(),n(29,"div",30)(30,"button",31),r(31),t(),n(32,"button",32),c("click",function(){p(e);let s=l(2);return m(s.cancelEditing())}),r(33,"Cancel"),t()()()}if(o&2){let e=l(),a=l();U("formGroup",a.form),_(8),u(e.email),_(5),u(e.externalId),_(17),U("disabled",a.isSaving()),_(),S(" ",a.isSaving()?"Saving\u2026":"Save changes"," ")}}function se(o,i){o&1&&(n(0,"p",40),r(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),t())}function _e(o,i){if(o&1){let e=f();n(0,"span",47),r(1,"Delete?"),t(),n(2,"button",48),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.confirmDelete(s))}),r(3," Confirm "),t(),n(4,"button",49),c("click",function(){p(e);let s=l(7);return m(s.cancelDelete())}),r(5," Cancel "),t()}}function de(o,i){if(o&1){let e=f();n(0,"button",49),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.armDelete(s))}),r(1," Delete "),t()}}function ce(o,i){if(o&1&&(n(0,"li",43)(1,"span",44),r(2),t(),n(3,"span",45),r(4),t(),g(5,_e,6,0)(6,de,2,0,"button",46),t()),o&2){let e=i.$implicit,a=l(6);_(2),u(e.name),_(2),u(e.subtitle),_(),v(a.isPendingDelete(e)?5:6)}}function pe(o,i){if(o&1&&(n(0,"h3",41),r(1,"Integrations"),t(),n(2,"ul",42),b(3,ce,7,3,"li",43,w().trackEntry,!0),t()),o&2){let e=l(5);_(3),h(e.recap().integrations)}}function me(o,i){if(o&1){let e=f();n(0,"span",47),r(1,"Delete?"),t(),n(2,"button",48),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.confirmDelete(s))}),r(3," Confirm "),t(),n(4,"button",49),c("click",function(){p(e);let s=l(7);return m(s.cancelDelete())}),r(5," Cancel "),t()}}function ue(o,i){if(o&1){let e=f();n(0,"button",49),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.armDelete(s))}),r(1," Delete "),t()}}function fe(o,i){if(o&1&&(n(0,"li",43)(1,"span",44),r(2),t(),n(3,"span",45),r(4),t(),g(5,me,6,0)(6,ue,2,0,"button",46),t()),o&2){let e=i.$implicit,a=l(6);_(2),u(e.name),_(2),u(e.subtitle),_(),v(a.isPendingDelete(e)?5:6)}}function Ce(o,i){if(o&1&&(n(0,"h3",41),r(1,"AI Providers"),t(),n(2,"ul",42),b(3,fe,7,3,"li",43,w().trackEntry,!0),t()),o&2){let e=l(5);_(3),h(e.recap().aiProviders)}}function ge(o,i){if(o&1){let e=f();n(0,"span",47),r(1,"Delete?"),t(),n(2,"button",48),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.confirmDelete(s))}),r(3," Confirm "),t(),n(4,"button",49),c("click",function(){p(e);let s=l(7);return m(s.cancelDelete())}),r(5," Cancel "),t()}}function ve(o,i){if(o&1){let e=f();n(0,"button",49),c("click",function(){p(e);let s=l().$implicit,d=l(6);return m(d.armDelete(s))}),r(1," Delete "),t()}}function xe(o,i){if(o&1&&(n(0,"li",43)(1,"span",44),r(2),t(),n(3,"span",45),r(4),t(),g(5,ge,6,0)(6,ve,2,0,"button",46),t()),o&2){let e=i.$implicit,a=l(6);_(2),u(e.name),_(2),u(e.subtitle),_(),v(a.isPendingDelete(e)?5:6)}}function be(o,i){if(o&1&&(n(0,"h3",41),r(1,"My global auth settings"),t(),n(2,"ul",42),b(3,xe,7,3,"li",43,w().trackEntry,!0),t()),o&2){let e=l(5);_(3),h(e.recap().authSettings)}}function he(o,i){if(o&1&&(g(0,pe,5,0),g(1,Ce,5,0),g(2,be,5,0)),o&2){let e=l(4);v(e.recap().integrations.length>0?0:-1),_(),v(e.recap().aiProviders.length>0?1:-1),_(),v(e.recap().authSettings.length>0?2:-1)}}function ye(o,i){if(o&1&&g(0,se,2,0,"p",40)(1,he,3,3),o&2){let e=l(3);v(e.recap().total===0?0:1)}}function Pe(o,i){if(o&1){let e=f();n(0,"div",17)(1,"div",5)(2,"h2",6),r(3,"Identity"),t(),n(4,"div",7)(5,"span",8),r(6,"Email"),t(),n(7,"span",33),r(8),t()(),n(9,"div",7)(10,"span",8),r(11,"External ID"),t(),n(12,"span",33),r(13),t()()(),n(14,"div",5)(15,"h2",6),r(16,"Profile"),t(),n(17,"div",7)(18,"span",8),r(19,"First name"),t(),n(20,"span",33),r(21),t()(),n(22,"div",7)(23,"span",8),r(24,"Last name"),t(),n(25,"span",33),r(26),t()(),n(27,"div",34)(28,"span",8),r(29,"Bio"),t(),n(30,"span",33),r(31),t()()(),n(32,"div",30)(33,"button",35),c("click",function(){p(e);let s=l(2);return m(s.startEditing())}),r(34," Edit profile "),t()(),n(35,"div",36)(36,"button",37),c("click",function(){p(e);let s=l(2);return m(s.toggleOverrides())}),n(37,"span",38),r(38,"\u25B6"),t(),r(39," My global user configurations "),n(40,"span",39),r(41),t()(),g(42,ye,2,1),t()()}if(o&2){let e=l(),a=l();_(8),u(e.email),_(5),u(e.externalId),_(8),u(e.firstname||"\u2014"),_(5),u(e.lastname||"\u2014"),_(5),u(e.bio||"\u2014"),_(5),P("aria-expanded",a.isOverridesExpanded()),_(),E("user-profile__overrides-arrow--open",a.isOverridesExpanded()),_(4),S("(",a.recap().total,")"),_(),v(a.isOverridesExpanded()?42:-1)}}function Ee(o,i){if(o&1&&(n(0,"div",5)(1,"h2",6),r(2,"Appearance"),t(),n(3,"div",7)(4,"span",8),r(5,"Skin"),t(),n(6,"div",9),b(7,oe,5,5,"button",10,V),t()(),n(9,"div",7)(10,"span",8),r(11,"Mode"),t(),n(12,"div",11),b(13,re,2,4,"button",12,V),t()()(),n(15,"div",5)(16,"h2",6),r(17,"Composer"),t(),n(18,"div",7)(19,"span",8),r(20,"Enter key"),t(),n(21,"div",13)(22,"div",14),b(23,ae,2,4,"button",12,V),t(),n(25,"p",15),r(26,'In "New line" mode, press Ctrl or Cmd + Enter to send.'),t()()()(),g(27,le,34,5,"form",16)(28,Pe,43,10,"div",17)),o&2){let e=l();_(7),h(e.themeVariantOptions),_(6),h(e.themeOptions),_(10),h(e.enterKeyOptions),_(4),v(e.isEditing()?27:28)}}function Se(o,i){o&1&&(n(0,"p",4),r(1,"Unable to load profile."),t())}var ne=class o{userState=x(W);router=x(N);location=x($);destroyRef=x(G);integrationState=x(Z);providerState=x(ee);authSettingState=x(te);themePort=x(Q);preferencesPort=x(X);isEditing=y(!1);isLoading=y(!1);isSaving=y(!1);isOverridesExpanded=y(!1);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=T(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=T(()=>this.themePort.theme().variant);themeVariantOptions=[{value:"industry",label:"Industry",description:"Bleu acier, Barlow"},{value:"terminal",label:"Terminal",description:"Ambre CRT, JetBrains Mono"}];enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];form=new L({firstname:new O("",{nonNullable:!0}),lastname:new O("",{nonNullable:!0}),bio:new O("",{nonNullable:!0})});recap=K(I([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(F(([i,e,a])=>{let s=i.map(C=>({category:"integration",id:C.id??"",name:C.name,subtitle:C.integrationType})),d=e.map(C=>({category:"aiProvider",id:C.id??"",name:C.name,subtitle:C.apiType})),D=a.map(C=>({category:"authSetting",id:C.id??"",name:C.name,subtitle:C.authType}));return{integrations:s,aiProviders:d,authSettings:D,total:s.length+d.length+D.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(!0),this.userState.loadMe().pipe(k(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)})}startEditing(){this.syncFormFromState(),this.isEditing.set(!0)}cancelEditing(){this.isEditing.set(!1)}setTheme(i){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:i})}setThemeVariant(i){this.themePort.setTheme({variant:i,mode:this.themePort.theme().mode})}setEnterKeyBehavior(i){this.preferencesPort.setEnterKeyBehavior(i)}save(){this.isSaving()||(this.isSaving.set(!0),this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0}).pipe(k(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(!1),this.isEditing.set(!1)},error:()=>this.isSaving.set(!1)}))}toggleOverrides(){this.isOverridesExpanded.update(i=>!i),this.pendingDeleteKey.set(null)}pendingDeleteKey=y(null);isPendingDelete(i){return this.pendingDeleteKey()===this.entryKey(i)}armDelete(i){i.id&&this.pendingDeleteKey.set(this.entryKey(i))}cancelDelete(){this.pendingDeleteKey.set(null)}confirmDelete(i){if(!i.id)return;this.pendingDeleteKey.set(null),(i.category==="integration"?this.integrationState.delete(i.id,"userGlobal"):i.category==="authSetting"?this.authSettingState.delete(i.id,"userGlobal"):this.providerState.delete(i.id,"userGlobal")).pipe(k(this.destroyRef)).subscribe({error:a=>{console.error(`[UserProfile] Delete failed for ${i.category}:${i.id}:`,a)}})}entryKey(i){return`${i.category}:${i.id}`}goBack(){window.history.length>1?this.location.back():this.router.navigate(["/agentos"])}trackEntry(i,e){return this.entryKey(e)}syncFormFromState(){let i=this.currentUser();i&&this.form.setValue({firstname:i.firstname??"",lastname:i.lastname??"",bio:i.bio??""})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=z({type:o,selectors:[["agentos-user-profile"]],decls:8,vars:1,consts:[[1,"user-profile"],[1,"user-profile__header"],["icon","arrow_back","title","Back",3,"action"],[1,"user-profile__title"],[1,"user-profile__loading"],[1,"user-profile__section"],[1,"user-profile__section-title"],[1,"user-profile__field"],[1,"user-profile__label"],[1,"user-profile__theme-variants"],["type","button",1,"user-profile__theme-variant",3,"user-profile__theme-variant--active"],["role","group","aria-label","Color mode",1,"user-profile__segmented"],["type","button",1,"user-profile__segmented-option",3,"user-profile__segmented-option--active"],[1,"user-profile__field-control"],["role","group","aria-label","Enter key behavior",1,"user-profile__segmented"],[1,"user-profile__hint"],[1,"user-profile__form",3,"formGroup"],[1,"user-profile__view"],["type","button",1,"user-profile__theme-variant",3,"click"],[1,"user-profile__theme-variant-name"],[1,"user-profile__theme-variant-desc"],["type","button",1,"user-profile__segmented-option",3,"click"],[1,"user-profile__form",3,"ngSubmit","formGroup"],[1,"user-profile__value","user-profile__value--readonly"],["for","up-firstname",1,"user-profile__label"],["id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name",1,"user-profile__input"],["for","up-lastname",1,"user-profile__label"],["id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name",1,"user-profile__input"],["for","up-bio",1,"user-profile__label"],["id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4",1,"user-profile__input","user-profile__input--textarea"],[1,"user-profile__actions"],["type","submit",1,"user-profile__btn","user-profile__btn--primary",3,"disabled"],["type","button",1,"user-profile__btn",3,"click"],[1,"user-profile__value"],[1,"user-profile__field","user-profile__field--bio"],["type","button",1,"user-profile__btn","user-profile__btn--primary",3,"click"],[1,"user-profile__overrides"],["type","button",1,"user-profile__overrides-toggle",3,"click"],[1,"user-profile__overrides-arrow"],[1,"user-profile__overrides-count"],[1,"user-profile__overrides-empty"],[1,"user-profile__overrides-subtitle"],[1,"user-profile__overrides-list"],[1,"user-profile__overrides-row"],[1,"user-profile__overrides-name"],[1,"user-profile__overrides-subtitle-text"],["type","button",1,"user-profile__overrides-delete"],[1,"user-profile__overrides-confirm-label"],["type","button",1,"user-profile__overrides-delete","user-profile__overrides-delete--confirm",3,"click"],["type","button",1,"user-profile__overrides-delete",3,"click"]],template:function(e,a){if(e&1&&(n(0,"div",0)(1,"header",1)(2,"ds-icon-button",2),c("action",function(){return a.goBack()}),t(),n(3,"h1",3),r(4,"My profile"),t()(),g(5,ie,2,0,"p",4)(6,Ee,29,1)(7,Se,2,0,"p",4),t()),e&2){let s;_(5),v(a.isLoading()?5:(s=a.currentUser())?6:7,s)}},dependencies:[J,j,B,R,A,H,Y,q],styles:[".user-profile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-profile__header[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.5rem}.user-profile__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)}.user-profile__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-profile__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-profile__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.user-profile__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.user-profile__view[_ngcontent-%COMP%], .user-profile__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-profile__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-profile__section-title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);border-bottom:1px solid var(--color-divider);padding-bottom:.5rem}.user-profile__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-profile__field--bio[_ngcontent-%COMP%]{align-items:start}.user-profile__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary);white-space:nowrap}.user-profile__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text);word-break:break-word;white-space:pre-wrap}.user-profile__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.875rem}.user-profile__segmented[_ngcontent-%COMP%]{display:inline-flex;justify-self:start;border:1px solid var(--color-divider);overflow:hidden}.user-profile__segmented-option[_ngcontent-%COMP%]{padding:.4rem .85rem;background:transparent;border:none;border-right:1px solid var(--color-divider);color:var(--color-text-secondary);font-size:.875rem;cursor:pointer;transition:background .15s ease,color .15s ease}.user-profile__segmented-option[_ngcontent-%COMP%]:last-child{border-right:none}.user-profile__segmented-option[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__segmented-option--active[_ngcontent-%COMP%]{background:var(--color-accent);color:#fff}.user-profile__segmented-option--active[_ngcontent-%COMP%]:hover{background:var(--color-accent-700)}.user-profile__field-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.4rem}.user-profile__hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary)}.user-profile__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;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;border-radius:0;transition:border-color .15s ease;resize:none}.user-profile__input[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.user-profile__input[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.user-profile__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-profile__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-profile__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;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;border-radius:0;transition:background .15s ease,border-color .15s ease}.user-profile__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-profile__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.user-profile__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.user-profile__theme-variants[_ngcontent-%COMP%]{display:flex;gap:8px;justify-self:start}.user-profile__theme-variant[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:10px 16px;border:1px solid var(--color-divider);background:transparent;cursor:pointer;min-width:120px;transition:background .12s,border-color .12s}.user-profile__theme-variant[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__theme-variant--active[_ngcontent-%COMP%]{border-color:var(--color-accent);background:color-mix(in srgb,var(--color-accent) 8%,transparent)}.user-profile__theme-variant-name[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:13px;font-weight:600;color:var(--color-text)}.user-profile__theme-variant-desc[_ngcontent-%COMP%]{font-size:11px;color:var(--color-text-secondary);font-family:var(--font-body)}.user-profile__overrides[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--color-divider)}.user-profile__overrides-toggle[_ngcontent-%COMP%]{background:transparent;border:none;padding:.25rem 0;font-size:.85rem;color:var(--color-text-secondary);cursor:pointer;display:flex;align-items:center;gap:.4rem}.user-profile__overrides-toggle[_ngcontent-%COMP%]:hover{color:var(--color-text)}.user-profile__overrides-arrow[_ngcontent-%COMP%]{display:inline-block;font-size:.65rem;transition:transform .15s ease}.user-profile__overrides-arrow--open[_ngcontent-%COMP%]{transform:rotate(90deg)}.user-profile__overrides-count[_ngcontent-%COMP%]{color:var(--color-text-tertiary)}.user-profile__overrides-empty[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);font-style:italic;padding:.5rem 0 0;margin:0}.user-profile__overrides-subtitle[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);margin:.75rem 0 .25rem}.user-profile__overrides-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.25rem}.user-profile__overrides-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem;font-size:.85rem;border-radius:0}.user-profile__overrides-row[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__overrides-name[_ngcontent-%COMP%]{flex:1;color:var(--color-text);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-profile__overrides-subtitle-text[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:var(--font-heading)}.user-profile__overrides-confirm-label[_ngcontent-%COMP%]{font-size:11px;font-family:var(--font-heading);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);white-space:nowrap}.user-profile__overrides-delete[_ngcontent-%COMP%]{background:transparent;border:1px solid transparent;font-size:11px;font-family:var(--font-heading);font-weight:600;color:var(--color-neutral-500);cursor:pointer;padding:3px 8px;border-radius:0;transition:color .12s,background .12s,border-color .12s}.user-profile__overrides-delete[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]{border-color:var(--red);background:var(--red);color:#fff}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]:hover{background:var(--red-deep);border-color:var(--red-deep)}"],changeDetection:0})};export{ne as UserProfileComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as N}from"./chunk-
|
|
1
|
+
import{a as N}from"./chunk-7QFIBIYY.js";import{a as D}from"./chunk-AMWKKZG5.js";import"./chunk-C2LUO2MP.js";import{a as w,c as E}from"./chunk-6XX7GME4.js";import{s as T,z as q}from"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.js";import"./chunk-SPV5SLNS.js";import{a as p}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as R,D as b,Db as c,Fb as r,Pb as I,Wa as y,ab as C,ca as a,ga as m,ha as d,jc as x,lb as S,m as P,ma as g,mb as v,mc as L,rb as _,sb as l,ta as u,tb as h,z as f}from"./chunk-CHEXA6RY.js";function V(i,e){if(i&1){let t=R();l(0,"agentos-scheduled-prompt-item",4),c("enableRequested",function(n){m(t);let s=r(2);return d(s.enablePrompt(n))})("disableRequested",function(n){m(t);let s=r(2);return d(s.disablePrompt(n))})("deleteRequested",function(n){m(t);let s=r(2);return d(s.deletePrompt(n))}),h()}if(i&2){let t=r().$implicit,o=r();_("definition",e)("namespaceId",o.namespaceId)("readOnly",o.isPlatformPrompt(t.id))}}function k(i,e){if(i&1&&S(0,V,1,3,"agentos-scheduled-prompt-item",3),i&2){let t,o=e.$implicit,n=r();v((t=n.resolvePrompt(o.id))?0:-1,t)}}var O="platform",B="namespace",M=class i{route=a(w);router=a(E);destroyRef=a(g);state=a(D);namespaceId=this.route.snapshot.params.namespaceId;platformPrompts=u([]);namespacePrompts=u([]);promptItems=L(()=>[...this.platformPrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:O,groupLabel:"Platform (read-only)",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]})),...this.namespacePrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:B,groupLabel:"Namespace",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]}))]);constructor(){f({platform:this.state.listPlatform().pipe(b(()=>P([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(p(this.destroyRef)).subscribe(({platform:e,namespace:t})=>{this.platformPrompts.set(e),this.namespacePrompts.set(t)})}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"])}enablePrompt(e){this.state.enable(e.id??"").pipe(p(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t))}disablePrompt(e){this.state.disable(e.id??"").pipe(p(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t))}deletePrompt(e){let t=e.id??"";this.state.delete(t).pipe(p(this.destroyRef)).subscribe(()=>this.namespacePrompts.update(o=>o.filter(n=>n.id!==t)))}resolvePrompt(e){return this.platformPrompts().find(t=>t.id===e)??this.namespacePrompts().find(t=>t.id===e)??null}isPlatformPrompt(e){return this.platformPrompts().some(t=>t.id===e)}patchNamespacePrompt(e){this.namespacePrompts.update(t=>t.map(o=>o.id===e.id?e:o))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=y({type:i,selectors:[["agentos-scheduled-prompt-list"]],decls:4,vars:3,consts:[["scheduledPromptItemTpl",""],["title","Scheduled Prompts","emptyMessage","No scheduled prompts yet. Create one to get started.","cardMinWidth","420px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"definition","namespaceId","readOnly"],[3,"enableRequested","disableRequested","deleteRequested","definition","namespaceId","readOnly"]],template:function(t,o){if(t&1&&(l(0,"ds-entity-list",1),c("createRequested",function(){return o.openCreateForm()}),l(1,"ds-icon-button",2),c("action",function(){return o.goBack()}),h()(),C(2,k,1,1,"ng-template",null,0,x)),t&2){let n=I(3);_("items",o.promptItems())("showCreate",!0)("itemTemplate",n)}},dependencies:[q,N,T],encapsulation:2,changeDetection:0})};export{M as ScheduledPromptListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a}from"./chunk-
|
|
1
|
+
import{c as a}from"./chunk-PKLY5FK2.js";import"./chunk-ARAXWPWU.js";import"./chunk-SI42WXFB.js";import"./chunk-W7ONGRS7.js";import"./chunk-C2LUO2MP.js";import"./chunk-6XX7GME4.js";import"./chunk-VNO76B3S.js";import"./chunk-E6T6QLQT.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 AdminUsersGroupsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as le}from"./chunk-UO7SKQEC.js";import{A as H,b as G,y as x,z as u}from"./chunk-UQTA3ACH.js";import{a as L,c as B}from"./chunk-6XX7GME4.js";import{a as w,c as N}from"./chunk-VMYKE4ZC.js";import{B as ie,F as ae,b as K,c as j,e as h,g as Y,h as J,i as Q,l as p,n as X,o as Z,s as ee,w as te,x as ne,y as oe,z as re}from"./chunk-7OGOI6WM.js";import{Bb as F,D as q,Db as E,Fb as s,Ha as $,Ka as a,R as k,Rb as b,Tb as i,Ub as g,Vb as D,Wa as W,a as V,b as A,ca as C,ga as M,ha as O,lb as c,m as R,ma as z,mb as m,mc as T,pb as S,qb as P,rb as d,sb as o,ta as v,tb as r,ub as _,z as U}from"./chunk-CHEXA6RY.js";var I=(n,t)=>t.value,ce=(n,t)=>t.id;function me(n,t){n&1&&(o(0,"p",5),i(1,"Loading\u2026"),r())}function se(n,t){n&1&&(o(0,"span",12),i(1," Name is required. "),r())}function pe(n,t){if(n&1&&(o(0,"p",40),i(1),r(),o(2,"span",13),i(3,"Agent Config cannot be changed after creation."),r()),n&2){let e=s(2);a(),g(e.resolveAgentConfigName(e.agentConfigIdControl.value))}}function ue(n,t){if(n&1&&(o(0,"a",41),i(1,"Add an agent config"),r(),i(2," first. ")),n&2){let e=s(3);d("href","/agentos/"+e.namespaceId+"/agent-configs/new",$)}}function fe(n,t){if(n&1&&(o(0,"p",13),i(1," No agent configs available in this scope yet. "),c(2,ue,3,1),r()),n&2){let e=s(2);a(2),m(e.isPlatformMode?-1:2)}}function _e(n,t){if(n&1&&(o(0,"option",23),i(1),r()),n&2){let e=t.$implicit;d("value",e.id),a(),g(e.name)}}function he(n,t){n&1&&(o(0,"span",12),i(1,"Agent Config is required."),r())}function ge(n,t){if(n&1&&(o(0,"select",42)(1,"option",43),i(2,"Select an agent config\u2026"),r(),S(3,_e,2,2,"option",23,ce),r(),c(5,he,2,0,"span",12),o(6,"span",13),i(7,"Immutable after creation."),r()),n&2){let e=s(2);d("formControl",e.agentConfigIdControl),a(3),P(e.availableAgentConfigs()),a(2),m(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1)}}function Ce(n,t){n&1&&(o(0,"span",12),i(1,"Opening message is required."),r())}function ve(n,t){if(n&1&&(o(0,"option",23),i(1),r()),n&2){let e=t.$implicit;d("value",e.value),a(),g(e.label)}}function be(n,t){if(n&1){let e=F();o(0,"label",46)(1,"input",47),E("change",function(){let f=M(e).$implicit,y=s(3);return O(y.toggleDay(f.value))}),r(),o(2,"span",48),i(3),r()()}if(n&2){let e=t.$implicit,l=s(3);a(),d("checked",l.isDaySelected(e.value)),a(2),g(e.label)}}function xe(n,t){if(n&1&&(o(0,"div",8)(1,"span",44),i(2,"Days of week"),r(),o(3,"div",45),S(4,be,4,2,"label",46,I),r(),o(6,"span",13),i(7,"Leave empty to run every day of the week."),r()()),n&2){let e=s(2);a(4),P(e.dayOptions)}}function ye(n,t){n&1&&(o(0,"span",12),i(1,"Valid time is required (HH:mm)."),r())}function Se(n,t){n&1&&(o(0,"span",12),i(1,"Start date is required."),r())}function Pe(n,t){if(n&1&&(o(0,"option",23),i(1),r()),n&2){let e=t.$implicit;d("value",e.value),a(),g(e.label)}}function Ee(n,t){n&1&&(o(0,"span",12),i(1,"End date is required."),r())}function Me(n,t){if(n&1&&(o(0,"div",8)(1,"label",49),i(2," End date "),o(3,"span",10),i(4,"*"),r()(),_(5,"input",50),c(6,Ee,2,0,"span",12),r()),n&2){let e=s(2);a(5),b("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),d("formControl",e.endDateControl),a(),m(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1)}}function Oe(n,t){n&1&&(o(0,"span",12),i(1,"Must be at least 1."),r())}function De(n,t){if(n&1&&(o(0,"div",8)(1,"label",51),i(2," Number of occurrences "),o(3,"span",10),i(4,"*"),r()(),_(5,"input",52),c(6,Oe,2,0,"span",12),r()),n&2){let e=s(2);a(5),b("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),d("formControl",e.occurrenceCountControl),a(),m(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1)}}function Te(n,t){if(n&1&&(o(0,"p",36),i(1),r()),n&2){let e=s(2);a(),g(e.errorMessage())}}function we(n,t){if(n&1){let e=F();o(0,"form",7),E("ngSubmit",function(){M(e);let f=s();return O(f.submit())}),o(1,"div",8)(2,"label",9),i(3," Name "),o(4,"span",10),i(5,"*"),r()(),_(6,"input",11),c(7,se,2,0,"span",12),o(8,"span",13),i(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),r()(),o(10,"div",8)(11,"label",14),i(12,"Description"),r(),_(13,"input",15),r(),o(14,"div",8)(15,"label",16),i(16," Agent Config "),o(17,"span",10),i(18,"*"),r()(),c(19,pe,4,1)(20,fe,3,1,"p",13)(21,ge,8,2),r(),o(22,"div",8)(23,"label",17),i(24," Opening message "),o(25,"span",10),i(26,"*"),r()(),_(27,"textarea",18),c(28,Ce,2,0,"span",12),o(29,"span",13),i(30," The message sent to the agent when the scheduled prompt fires. "),r()(),o(31,"fieldset",19)(32,"legend",20),i(33,"Recurrence"),r(),o(34,"div",8)(35,"label",21),i(36," Unit "),o(37,"span",10),i(38,"*"),r()(),o(39,"select",22),S(40,ve,2,2,"option",23,I),r()(),c(42,xe,8,0,"div",8),o(43,"div",8)(44,"label",24),i(45," Time (UTC) "),o(46,"span",10),i(47,"*"),r()(),o(48,"div",25),_(49,"input",26),o(50,"span",27),i(51,"UTC"),r()(),c(52,ye,2,0,"span",12),r()(),o(53,"fieldset",19)(54,"legend",20),i(55,"Planning"),r(),o(56,"div",8)(57,"label",28),i(58," Start date "),o(59,"span",10),i(60,"*"),r()(),_(61,"input",29),c(62,Se,2,0,"span",12),r(),o(63,"div",8)(64,"label",30),i(65," Ends "),o(66,"span",10),i(67,"*"),r()(),o(68,"select",31),S(69,Pe,2,2,"option",23,I),r()(),c(71,Me,7,4,"div",8),c(72,De,7,4,"div",8),r(),o(73,"div",8)(74,"label",32),_(75,"input",33),o(76,"span",34),i(77,"Enabled"),r()(),o(78,"p",35),i(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),r()(),c(80,Te,2,1,"p",36),o(81,"div",37)(82,"button",38),i(83),r(),o(84,"button",39),E("click",function(){M(e);let f=s();return O(f.cancel())}),i(85,"Cancel"),r()()()}if(n&2){let e=s();d("formGroup",e.form),a(6),b("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),d("formControl",e.nameControl),a(),m(e.nameControl.invalid&&e.nameControl.touched?7:-1),a(6),d("formControl",e.descriptionControl),a(6),m(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),a(8),b("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),d("formControl",e.promptContentControl),a(),m(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),a(11),d("formControl",e.unitControl),a(),P(e.schedulerUnits),a(2),m(e.showDayFilter()?42:-1),a(7),d("formControl",e.timeUtcControl),a(3),m(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),a(9),b("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),d("formControl",e.startDateControl),a(),m(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),a(6),d("formControl",e.endTypeControl),a(),P(e.endTypes),a(2),m(e.showEndDate()?71:-1),a(),m(e.showOccurrenceCount()?72:-1),a(3),d("formControl",e.enabledControl),a(5),m(e.errorMessage()?80:-1),a(2),d("disabled",e.form.invalid||e.isSubmitting()),a(),D(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ")}}var de=class n{route=C(L);router=C(B);destroyRef=C(z);state=C(le);agentConfigController=C(G);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new Q({name:new p("",{nonNullable:!0,validators:[h.required]}),description:new p(null),agentConfigId:new p("",{nonNullable:!0,validators:[h.required]}),promptContent:new p("",{nonNullable:!0,validators:[h.required]}),unit:new p(x.WEEK,{nonNullable:!0,validators:[h.required]}),days:new p([],{nonNullable:!0}),timeUtc:new p("09:00",{nonNullable:!0,validators:[h.required,h.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new p("",{nonNullable:!0,validators:[h.required]}),endType:new p(u.NEVER,{nonNullable:!0,validators:[h.required]}),endDate:new p(null),occurrenceCount:new p(null),enabled:new p(!0,{nonNullable:!0})},{validators:[ke,Fe]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}isEditMode=v(!1);isSubmitting=v(!1);isLoading=v(!1);errorMessage=v(null);SchedulerUnit=x;SchedulerEndType=u;schedulerUnits=[{value:x.WEEK,label:"Week(s)"},{value:x.MONTH,label:"Month(s)"}];endTypes=[{value:u.NEVER,label:"Never"},{value:u.ON_DATE,label:"On date"},{value:u.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(H).map(([t,e])=>({value:t,label:e}));unitSignal=N(this.unitControl.valueChanges.pipe(k(this.unitControl.value)));endTypeSignal=N(this.endTypeControl.valueChanges.pipe(k(this.endTypeControl.value)));showDayFilter=T(()=>this.unitSignal()===x.WEEK);showEndDate=T(()=>this.endTypeSignal()===u.ON_DATE);showOccurrenceCount=T(()=>this.endTypeSignal()===u.OCCURRENCES);agentConfigs=v([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Ne());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(!0),this.loadPromptAndResources(t)):this.loadResources()}loadPromptAndResources(t){this.isLoading.set(!0),U({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(w(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}loadResources(){this.agentConfigs$().pipe(w(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t))}agentConfigs$(){return(this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(q(()=>R([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled)}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(f=>f!==t):[...e,t];this.daysControl.setValue(l)}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=A(V({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===u.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===u.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(w(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:y=>{this.isSubmitting.set(!1),y.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):y.status===400?this.errorMessage.set(y.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.")}})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"])}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=W({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,l){e&1&&(o(0,"div",0)(1,"header",1)(2,"button",2),E("click",function(){return l.cancel()}),o(3,"span",3),i(4,"\u2190"),r(),i(5),r(),o(6,"h1",4),i(7),r()(),c(8,me,2,0,"p",5)(9,we,86,26,"form",6),r()),e&2&&(a(5),D(" ",l.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),a(2),D(" ",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),a(),m(l.isLoading()?8:9))},dependencies:[ae,X,oe,re,j,Z,K,ne,Y,J,ie,ee,te],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};function ke(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===u.ON_DATE&&!e?{endDateRequired:!0}:null}function Fe(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===u.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:!0}:null}function Ne(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return`${t}-${e}-${l}`}export{de as ScheduledPromptFormComponent};
|
|
1
|
+
import{a as le}from"./chunk-AMWKKZG5.js";import{A as H,b as G,y as x,z as u}from"./chunk-C2LUO2MP.js";import{a as L,c as B}from"./chunk-6XX7GME4.js";import{a as w,c as N}from"./chunk-VMYKE4ZC.js";import{B as ie,F as ae,b as K,c as j,e as h,g as Y,h as J,i as Q,l as p,n as X,o as Z,s as ee,w as te,x as ne,y as oe,z as re}from"./chunk-7OGOI6WM.js";import{Bb as F,D as q,Db as E,Fb as s,Ha as $,Ka as a,R as k,Rb as b,Tb as i,Ub as g,Vb as D,Wa as W,a as V,b as A,ca as C,ga as M,ha as O,lb as c,m as R,ma as z,mb as m,mc as T,pb as S,qb as P,rb as d,sb as o,ta as v,tb as r,ub as _,z as U}from"./chunk-CHEXA6RY.js";var I=(n,t)=>t.value,ce=(n,t)=>t.id;function me(n,t){n&1&&(o(0,"p",5),i(1,"Loading\u2026"),r())}function se(n,t){n&1&&(o(0,"span",12),i(1," Name is required. "),r())}function pe(n,t){if(n&1&&(o(0,"p",40),i(1),r(),o(2,"span",13),i(3,"Agent Config cannot be changed after creation."),r()),n&2){let e=s(2);a(),g(e.resolveAgentConfigName(e.agentConfigIdControl.value))}}function ue(n,t){if(n&1&&(o(0,"a",41),i(1,"Add an agent config"),r(),i(2," first. ")),n&2){let e=s(3);d("href","/agentos/"+e.namespaceId+"/agent-configs/new",$)}}function fe(n,t){if(n&1&&(o(0,"p",13),i(1," No agent configs available in this scope yet. "),c(2,ue,3,1),r()),n&2){let e=s(2);a(2),m(e.isPlatformMode?-1:2)}}function _e(n,t){if(n&1&&(o(0,"option",23),i(1),r()),n&2){let e=t.$implicit;d("value",e.id),a(),g(e.name)}}function he(n,t){n&1&&(o(0,"span",12),i(1,"Agent Config is required."),r())}function ge(n,t){if(n&1&&(o(0,"select",42)(1,"option",43),i(2,"Select an agent config\u2026"),r(),S(3,_e,2,2,"option",23,ce),r(),c(5,he,2,0,"span",12),o(6,"span",13),i(7,"Immutable after creation."),r()),n&2){let e=s(2);d("formControl",e.agentConfigIdControl),a(3),P(e.availableAgentConfigs()),a(2),m(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1)}}function Ce(n,t){n&1&&(o(0,"span",12),i(1,"Opening message is required."),r())}function ve(n,t){if(n&1&&(o(0,"option",23),i(1),r()),n&2){let e=t.$implicit;d("value",e.value),a(),g(e.label)}}function be(n,t){if(n&1){let e=F();o(0,"label",46)(1,"input",47),E("change",function(){let f=M(e).$implicit,y=s(3);return O(y.toggleDay(f.value))}),r(),o(2,"span",48),i(3),r()()}if(n&2){let e=t.$implicit,l=s(3);a(),d("checked",l.isDaySelected(e.value)),a(2),g(e.label)}}function xe(n,t){if(n&1&&(o(0,"div",8)(1,"span",44),i(2,"Days of week"),r(),o(3,"div",45),S(4,be,4,2,"label",46,I),r(),o(6,"span",13),i(7,"Leave empty to run every day of the week."),r()()),n&2){let e=s(2);a(4),P(e.dayOptions)}}function ye(n,t){n&1&&(o(0,"span",12),i(1,"Valid time is required (HH:mm)."),r())}function Se(n,t){n&1&&(o(0,"span",12),i(1,"Start date is required."),r())}function Pe(n,t){if(n&1&&(o(0,"option",23),i(1),r()),n&2){let e=t.$implicit;d("value",e.value),a(),g(e.label)}}function Ee(n,t){n&1&&(o(0,"span",12),i(1,"End date is required."),r())}function Me(n,t){if(n&1&&(o(0,"div",8)(1,"label",49),i(2," End date "),o(3,"span",10),i(4,"*"),r()(),_(5,"input",50),c(6,Ee,2,0,"span",12),r()),n&2){let e=s(2);a(5),b("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),d("formControl",e.endDateControl),a(),m(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1)}}function Oe(n,t){n&1&&(o(0,"span",12),i(1,"Must be at least 1."),r())}function De(n,t){if(n&1&&(o(0,"div",8)(1,"label",51),i(2," Number of occurrences "),o(3,"span",10),i(4,"*"),r()(),_(5,"input",52),c(6,Oe,2,0,"span",12),r()),n&2){let e=s(2);a(5),b("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),d("formControl",e.occurrenceCountControl),a(),m(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1)}}function Te(n,t){if(n&1&&(o(0,"p",36),i(1),r()),n&2){let e=s(2);a(),g(e.errorMessage())}}function we(n,t){if(n&1){let e=F();o(0,"form",7),E("ngSubmit",function(){M(e);let f=s();return O(f.submit())}),o(1,"div",8)(2,"label",9),i(3," Name "),o(4,"span",10),i(5,"*"),r()(),_(6,"input",11),c(7,se,2,0,"span",12),o(8,"span",13),i(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),r()(),o(10,"div",8)(11,"label",14),i(12,"Description"),r(),_(13,"input",15),r(),o(14,"div",8)(15,"label",16),i(16," Agent Config "),o(17,"span",10),i(18,"*"),r()(),c(19,pe,4,1)(20,fe,3,1,"p",13)(21,ge,8,2),r(),o(22,"div",8)(23,"label",17),i(24," Opening message "),o(25,"span",10),i(26,"*"),r()(),_(27,"textarea",18),c(28,Ce,2,0,"span",12),o(29,"span",13),i(30," The message sent to the agent when the scheduled prompt fires. "),r()(),o(31,"fieldset",19)(32,"legend",20),i(33,"Recurrence"),r(),o(34,"div",8)(35,"label",21),i(36," Unit "),o(37,"span",10),i(38,"*"),r()(),o(39,"select",22),S(40,ve,2,2,"option",23,I),r()(),c(42,xe,8,0,"div",8),o(43,"div",8)(44,"label",24),i(45," Time (UTC) "),o(46,"span",10),i(47,"*"),r()(),o(48,"div",25),_(49,"input",26),o(50,"span",27),i(51,"UTC"),r()(),c(52,ye,2,0,"span",12),r()(),o(53,"fieldset",19)(54,"legend",20),i(55,"Planning"),r(),o(56,"div",8)(57,"label",28),i(58," Start date "),o(59,"span",10),i(60,"*"),r()(),_(61,"input",29),c(62,Se,2,0,"span",12),r(),o(63,"div",8)(64,"label",30),i(65," Ends "),o(66,"span",10),i(67,"*"),r()(),o(68,"select",31),S(69,Pe,2,2,"option",23,I),r()(),c(71,Me,7,4,"div",8),c(72,De,7,4,"div",8),r(),o(73,"div",8)(74,"label",32),_(75,"input",33),o(76,"span",34),i(77,"Enabled"),r()(),o(78,"p",35),i(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),r()(),c(80,Te,2,1,"p",36),o(81,"div",37)(82,"button",38),i(83),r(),o(84,"button",39),E("click",function(){M(e);let f=s();return O(f.cancel())}),i(85,"Cancel"),r()()()}if(n&2){let e=s();d("formGroup",e.form),a(6),b("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),d("formControl",e.nameControl),a(),m(e.nameControl.invalid&&e.nameControl.touched?7:-1),a(6),d("formControl",e.descriptionControl),a(6),m(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),a(8),b("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),d("formControl",e.promptContentControl),a(),m(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),a(11),d("formControl",e.unitControl),a(),P(e.schedulerUnits),a(2),m(e.showDayFilter()?42:-1),a(7),d("formControl",e.timeUtcControl),a(3),m(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),a(9),b("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),d("formControl",e.startDateControl),a(),m(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),a(6),d("formControl",e.endTypeControl),a(),P(e.endTypes),a(2),m(e.showEndDate()?71:-1),a(),m(e.showOccurrenceCount()?72:-1),a(3),d("formControl",e.enabledControl),a(5),m(e.errorMessage()?80:-1),a(2),d("disabled",e.form.invalid||e.isSubmitting()),a(),D(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ")}}var de=class n{route=C(L);router=C(B);destroyRef=C(z);state=C(le);agentConfigController=C(G);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new Q({name:new p("",{nonNullable:!0,validators:[h.required]}),description:new p(null),agentConfigId:new p("",{nonNullable:!0,validators:[h.required]}),promptContent:new p("",{nonNullable:!0,validators:[h.required]}),unit:new p(x.WEEK,{nonNullable:!0,validators:[h.required]}),days:new p([],{nonNullable:!0}),timeUtc:new p("09:00",{nonNullable:!0,validators:[h.required,h.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new p("",{nonNullable:!0,validators:[h.required]}),endType:new p(u.NEVER,{nonNullable:!0,validators:[h.required]}),endDate:new p(null),occurrenceCount:new p(null),enabled:new p(!0,{nonNullable:!0})},{validators:[ke,Fe]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}isEditMode=v(!1);isSubmitting=v(!1);isLoading=v(!1);errorMessage=v(null);SchedulerUnit=x;SchedulerEndType=u;schedulerUnits=[{value:x.WEEK,label:"Week(s)"},{value:x.MONTH,label:"Month(s)"}];endTypes=[{value:u.NEVER,label:"Never"},{value:u.ON_DATE,label:"On date"},{value:u.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(H).map(([t,e])=>({value:t,label:e}));unitSignal=N(this.unitControl.valueChanges.pipe(k(this.unitControl.value)));endTypeSignal=N(this.endTypeControl.valueChanges.pipe(k(this.endTypeControl.value)));showDayFilter=T(()=>this.unitSignal()===x.WEEK);showEndDate=T(()=>this.endTypeSignal()===u.ON_DATE);showOccurrenceCount=T(()=>this.endTypeSignal()===u.OCCURRENCES);agentConfigs=v([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Ne());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(!0),this.loadPromptAndResources(t)):this.loadResources()}loadPromptAndResources(t){this.isLoading.set(!0),U({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(w(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}loadResources(){this.agentConfigs$().pipe(w(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t))}agentConfigs$(){return(this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(q(()=>R([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled)}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(f=>f!==t):[...e,t];this.daysControl.setValue(l)}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=A(V({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===u.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===u.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(w(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:y=>{this.isSubmitting.set(!1),y.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):y.status===400?this.errorMessage.set(y.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.")}})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"])}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=W({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,l){e&1&&(o(0,"div",0)(1,"header",1)(2,"button",2),E("click",function(){return l.cancel()}),o(3,"span",3),i(4,"\u2190"),r(),i(5),r(),o(6,"h1",4),i(7),r()(),c(8,me,2,0,"p",5)(9,we,86,26,"form",6),r()),e&2&&(a(5),D(" ",l.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),a(2),D(" ",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),a(),m(l.isLoading()?8:9))},dependencies:[ae,X,oe,re,j,Z,K,ne,Y,J,ie,ee,te],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};function ke(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===u.ON_DATE&&!e?{endDateRequired:!0}:null}function Fe(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===u.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:!0}:null}function Ne(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return`${t}-${e}-${l}`}export{de as ScheduledPromptFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P,b as O}from"./chunk-
|
|
1
|
+
import{a as P,b as O}from"./chunk-YCZCEQQL.js";import{a as x}from"./chunk-6QJAB37Y.js";import{d as S}from"./chunk-YFCRBVWD.js";import{b as C,c as M}from"./chunk-6XX7GME4.js";import{Db as d,Fb as y,Ka as _,Tb as u,Vb as T,Wa as c,ca as s,lb as b,mb as f,mc as p,rb as v,sb as a,ta as g,tb as l,ub as m}from"./chunk-CHEXA6RY.js";function N(o,e){if(o&1&&u(0),o&2){let t=y();T(" ",t.userInitials()," ")}}function V(o,e){o&1&&u(0," \u2022\u2022\u2022 ")}var h=class o{router=s(M);userState=s(x);themePort=s(S);namespaceState=s(P);menuOpen=g(!1);isAdmin=p(()=>this.userState.currentUser()?.isAdmin===!0);isDark=p(()=>{let{mode:e}=this.themePort.theme();return e==="dark"?!0:e==="light"?!1:typeof document<"u"&&document.documentElement.getAttribute("data-theme")?.includes("dark")===!0});themeVariant=p(()=>this.themePort.theme().variant);userInitials=p(()=>{let e=this.userState.currentUser();if(!e)return"";let t=e.firstname?.[0]??"",n=e.lastname?.[0]??"";return(t+n).toUpperCase()||e.email?.[0]?.toUpperCase()||""});showTechnical=g(!1);navigateHome(){let e=this.namespaceState.activeNamespaceId();this.router.navigate(["/agentos/home"],e?{queryParams:{ns:e}}:{})}toggleMenu(e){e.stopPropagation(),this.menuOpen.update(t=>!t)}closeMenu(e){e.stopPropagation(),this.menuOpen.set(!1)}onNavigate(e){this.menuOpen.set(!1),this.router.navigate([e])}onThemeToggle(){this.menuOpen.set(!1);let e=this.isDark()?"light":"dark";this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e})}onThemeVariantChanged(e){this.menuOpen.set(!1);let t=this.themePort.theme();this.themePort.setTheme({variant:e,mode:t.mode})}onLogsToggle(){this.menuOpen.set(!1)}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=c({type:o,selectors:[["agentos-shell-topbar"]],decls:10,vars:6,consts:[[1,"shell-topbar"],["type","button","title","Home",1,"shell-topbar__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"shell-topbar__logo-img"],[1,"shell-topbar__logo-text"],[1,"shell-topbar__user-menu"],["type","button","title","Menu",1,"shell-topbar__user-btn",3,"click"],["variant","topbar",3,"navigateTo","themeToggled","themeVariantChanged","logsToggled","closed","open","isAdmin","isDark","themeVariant","showTechnical"]],template:function(t,n){t&1&&(a(0,"div",0)(1,"button",1),d("click",function(){return n.navigateHome()}),m(2,"img",2),a(3,"span",3),u(4,"Coday"),l()(),a(5,"div",4)(6,"button",5),d("click",function(r){return n.toggleMenu(r)}),b(7,N,1,1)(8,V,1,0),l(),a(9,"agentos-shell-user-menu",6),d("navigateTo",function(r){return n.onNavigate(r)})("themeToggled",function(){return n.onThemeToggle()})("themeVariantChanged",function(r){return n.onThemeVariantChanged(r)})("logsToggled",function(){return n.onLogsToggle()})("closed",function(r){return n.closeMenu(r)}),l()()()),t&2&&(_(7),f(n.userInitials()?7:8),_(2),v("open",n.menuOpen())("isAdmin",n.isAdmin())("isDark",n.isDark())("themeVariant",n.themeVariant())("showTechnical",n.showTechnical()))},dependencies:[O],styles:[".shell-topbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 12px;border-bottom:1px solid var(--color-divider);background:var(--color-bg);flex-shrink:0}.shell-topbar__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:0;border:none;background:transparent;cursor:pointer;transition:opacity .14s ease}.shell-topbar__brand[_ngcontent-%COMP%]:hover{opacity:.8}.shell-topbar__logo-img[_ngcontent-%COMP%]{height:28px;width:auto;object-fit:contain;display:block;flex:none}.shell-topbar__logo-text[_ngcontent-%COMP%]{font-weight:700;font-size:18px;color:var(--color-text);letter-spacing:-.02em;white-space:nowrap}.shell-topbar__user-menu[_ngcontent-%COMP%]{position:relative;flex-shrink:0}.shell-topbar__user-btn[_ngcontent-%COMP%]{width:32px;height:32px;flex:none;display:grid;place-items:center;border:1px solid var(--color-divider);background:var(--color-surface);font-family:var(--font-heading);font-weight:600;font-size:13px;color:var(--color-accent-700);cursor:pointer;transition:border-color .14s;border-radius:0}.shell-topbar__user-btn[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}"],changeDetection:0})};var k=class o{static \u0275fac=function(t){return new(t||o)};static \u0275cmp=c({type:o,selectors:[["agentos-layout"]],decls:4,vars:0,consts:[[1,"layout"],[1,"layout__content"]],template:function(t,n){t&1&&(a(0,"div",0),m(1,"agentos-shell-topbar"),a(2,"main",1),m(3,"router-outlet"),l()())},dependencies:[C,h],styles:[".layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100vh}.layout__content[_ngcontent-%COMP%]{flex:1;overflow-y:auto}"]})};export{k as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as $}from"./chunk-6QJAB37Y.js";import{k as V,o as B}from"./chunk-C2LUO2MP.js";import{a as T,c as z}from"./chunk-6XX7GME4.js";import{w as F}from"./chunk-VNO76B3S.js";import{a as I}from"./chunk-VMYKE4ZC.js";import{Bb as C,D as U,Db as g,Fb as d,Ka as l,Tb as m,Ub as S,Wa as R,Z as O,a as y,b as N,ca as p,ga as M,ha as h,jb as D,lb as b,m as f,ma as k,mb as u,pb as P,qb as L,rb as v,sb as a,ta as _,tb as i,z as A}from"./chunk-CHEXA6RY.js";var E=class r{permissions=p(V);userController=p(B);listMembers(t){return this.permissions.listNamespaceUsers(t)}listAllUsers(){return this.userController.listAllUser()}updateMembers(t,e){let o=e.map(n=>y({userId:n.userId},n.role!==void 0?{role:n.role}:{}));return this.permissions.updateMembers(t,o)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=O({token:r,factory:r.\u0275fac,providedIn:"root"})};function j(r,t){let e=new Map(r.map(c=>[c.userId,c.role])),o=new Set(t.map(c=>c.userId)),n=t.filter(c=>e.get(c.userId)!==c.role),s=r.filter(c=>!o.has(c.userId)).map(c=>c.userId);return{toUpsert:n,toRemove:s}}function H(r){return r.some(t=>t.role==="ADMIN")}function x(r){return[r.firstname,r.lastname].filter(Boolean).join(" ").trim()||r.email||r.externalId||""}var J=20,w=class{constructor(t,e){this.candidates=t;this.excludedUserIds=e}search(t){let e=t.toLowerCase(),o=this.excludedUserIds(),n=this.candidates().filter(s=>!!s.id&&!o.has(s.id)).filter(s=>this.matches(s,e)).slice(0,J).map(s=>({id:s.id,name:x(s),description:s.email}));return f(n)}matches(t,e){return(t.externalId??"").toLowerCase().includes(e)||(t.email??"").toLowerCase().includes(e)||x(t).toLowerCase().includes(e)}};var X=(r,t)=>t.userId;function q(r,t){r&1&&(a(0,"p",5),m(1,"Loading\u2026"),i())}function K(r,t){r&1&&(a(0,"p",7),m(1," You can change roles or remove existing members. Only a platform super-admin can add a new user to this namespace. "),i())}function W(r,t){r&1&&(a(0,"p",11),m(1,"No members yet."),i())}function Z(r,t){if(r&1&&(a(0,"span",22),m(1),i()),r&2){let e=d().$implicit;l(),S(e.email)}}function Q(r,t){if(r&1){let e=C();a(0,"li",19)(1,"div",20)(2,"span",21),m(3),i(),b(4,Z,2,1,"span",22),i(),a(5,"select",23),g("change",function(n){let s=M(e).$implicit,c=d(3);return h(c.setMemberRole(s.userId,n.target.value))}),a(6,"option",24),m(7,"Member"),i(),a(8,"option",25),m(9,"Admin"),i()(),a(10,"button",26),g("click",function(){let n=M(e).$implicit,s=d(3);return h(s.removeMember(n.userId))}),m(11," \xD7 "),i()()}if(r&2){let e=t.$implicit;l(3),S(e.label),l(),u(e.email&&e.email!==e.label?4:-1),l(),v("value",e.role),D("aria-label","Role of "+e.label),l(5),v("title","Remove "+e.label)}}function ee(r,t){if(r&1&&(a(0,"ul",12),P(1,Q,12,5,"li",19,X),i()),r&2){let e=d(2);l(),L(e.selectedMembers())}}function te(r,t){r&1&&(a(0,"p",13),m(1," At least one ADMIN must remain on the namespace. Assign ADMIN to someone before saving. "),i())}function re(r,t){if(r&1){let e=C();a(0,"ds-autocomplete-input",27),g("itemSelected",function(n){M(e);let s=d(2);return h(s.onMemberSelected(n))}),i()}if(r&2){let e=d(2);v("dataSource",e.memberDataSource)}}function ne(r,t){if(r&1&&(a(0,"p",15),m(1),i()),r&2){let e=d(2);l(),S(e.errorMessage())}}function oe(r,t){if(r&1){let e=C();a(0,"div",6),b(1,K,2,0,"p",7),a(2,"fieldset",8)(3,"legend",9),m(4," Roster "),a(5,"span",10),m(6,"Exactly one role per user: ADMIN or MEMBER"),i()(),b(7,W,2,0,"p",11)(8,ee,3,0,"ul",12),b(9,te,2,0,"p",13),b(10,re,1,1,"ds-autocomplete-input",14),i(),b(11,ne,2,1,"p",15),a(12,"div",16)(13,"button",17),g("click",function(){M(e);let n=d();return h(n.submit())}),m(14," Save changes "),i(),a(15,"button",18),g("click",function(){M(e);let n=d();return h(n.cancel())}),m(16,"Cancel"),i()()()}if(r&2){let e=d();l(),u(e.isSuperAdmin()?-1:1),l(6),u(e.selectedMembers().length===0?7:8),l(2),u(e.wouldLockOutAdmins()?9:-1),l(),u(e.isSuperAdmin()?10:-1),l(),u(e.errorMessage()?11:-1),l(2),v("disabled",e.isSubmitting()||e.wouldLockOutAdmins())}}var Y=class r{route=p(T);router=p(z);destroyRef=p(k);memberState=p(E);userState=p($);namespaceId=this.route.snapshot.params.namespaceId;isLoading=_(!1);isSubmitting=_(!1);errorMessage=_(null);isSuperAdmin=_(!1);selectedMembers=_([]);originalMembers=[];candidateUsers=_([]);memberDataSource=new w(()=>this.candidateUsers(),()=>new Set(this.selectedMembers().map(t=>t.userId)));ngOnInit(){this.loadData()}loadData(){this.isLoading.set(!0),(this.userState.currentUser()?f(this.userState.currentUser()):this.userState.loadMe()).pipe(U(e=>(console.error("[NamespaceMembers] Failed to load current user",e),f(null))),I(this.destroyRef)).subscribe(e=>{let o=e?.isAdmin===!0;this.isSuperAdmin.set(o),this.loadMembersAndCandidates(o)})}loadMembersAndCandidates(t){A({members:this.memberState.listMembers(this.namespaceId),allUsers:t?this.memberState.listAllUsers():f([])}).pipe(I(this.destroyRef)).subscribe({next:({members:e,allUsers:o})=>{this.applyMembers(e),this.candidateUsers.set(o),this.isLoading.set(!1)},error:e=>{console.error("[NamespaceMembers] Failed to load namespace members",e),this.isLoading.set(!1),this.errorMessage.set("Failed to load namespace members. Please try again.")}})}applyMembers(t){this.originalMembers=t.map(e=>({userId:e.id,role:e.role})),this.selectedMembers.set(t.map(e=>({userId:e.id,label:x(e),email:e.email,role:e.role})))}onMemberSelected(t){this.selectedMembers().some(e=>e.userId===t.id)||this.selectedMembers.update(e=>[...e,{userId:t.id,label:t.name,email:t.description,role:"MEMBER"}])}removeMember(t){this.selectedMembers.update(e=>e.filter(o=>o.userId!==t))}setMemberRole(t,e){let o=e==="ADMIN"?"ADMIN":"MEMBER";this.selectedMembers.update(n=>n.map(s=>s.userId===t?N(y({},s),{role:o}):s))}wouldLockOutAdmins=()=>!H(this.selectedMembers());submit(){if(this.isSubmitting())return;if(this.wouldLockOutAdmins()){this.errorMessage.set("At least one ADMIN must remain on the namespace. Assign ADMIN to someone before saving.");return}this.isSubmitting.set(!0),this.errorMessage.set(null);let{toUpsert:t,toRemove:e}=j(this.originalMembers,this.selectedMembers().map(n=>({userId:n.userId,role:n.role})));if(t.length===0&&e.length===0){this.isSubmitting.set(!1),this.navigateBack();return}let o=[...t.map(n=>({userId:n.userId,role:n.role})),...e.map(n=>({userId:n}))];this.memberState.updateMembers(this.namespaceId,o).pipe(I(this.destroyRef)).subscribe({next:n=>{this.applyMembers(n),this.isSubmitting.set(!1),this.navigateBack()},error:n=>{this.isSubmitting.set(!1),this.errorMessage.set(this.describeError(n))}})}describeError(t){return t.status===403?"You do not have permission to add a new user to this namespace \u2014 only a platform super-admin can add someone new. You can still change roles or remove existing members.":t.status===422?t.error?.message??"This change would leave the namespace without any ADMIN. Assign ADMIN to at least one member and try again.":"An unexpected error occurred while saving namespace members. Please try again."}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos","namespaces"])}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=R({type:r,selectors:[["agentos-namespace-members"]],decls:10,vars:1,consts:[[1,"namespace-members"],[1,"namespace-members__header"],["type","button","title","Back to namespaces",1,"namespace-members__back",3,"click"],[1,"namespace-members__back-icon"],[1,"namespace-members__title"],[1,"namespace-members__loading"],[1,"namespace-members__body"],[1,"namespace-members__hint"],[1,"namespace-members__section"],[1,"namespace-members__label"],[1,"namespace-members__label-hint"],[1,"namespace-members__empty-hint"],[1,"namespace-members__members"],[1,"namespace-members__warning"],["placeholder","Add a member\u2026",3,"dataSource"],[1,"namespace-members__error"],[1,"namespace-members__actions"],["type","button",1,"namespace-members__btn","namespace-members__btn--primary",3,"click","disabled"],["type","button",1,"namespace-members__btn",3,"click"],[1,"namespace-members__member"],[1,"namespace-members__member-info"],[1,"namespace-members__member-name"],[1,"namespace-members__member-email"],[1,"namespace-members__member-role",3,"change","value"],["value","MEMBER"],["value","ADMIN"],["type","button",1,"namespace-members__member-remove",3,"click","title"],["placeholder","Add a member\u2026",3,"itemSelected","dataSource"]],template:function(e,o){e&1&&(a(0,"div",0)(1,"header",1)(2,"button",2),g("click",function(){return o.cancel()}),a(3,"span",3),m(4,"\u2190"),i(),m(5," Namespaces "),i(),a(6,"h1",4),m(7,"Members"),i()(),b(8,q,2,0,"p",5)(9,oe,17,6,"div",6),i()),e&2&&(l(8),u(o.isLoading()?8:9))},dependencies:[F],styles:[".namespace-members[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.namespace-members__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-members__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-members__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-members__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.namespace-members__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.namespace-members__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.namespace-members__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.namespace-members__hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.namespace-members__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.namespace-members__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);margin-left:.375rem}.namespace-members__section[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.namespace-members__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73);font-style:italic}.namespace-members__members[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.375rem}.namespace-members__member[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:.4rem .5rem;border-radius:8px;background:var(--color-surface-hover, rgba(0, 0, 0, .03));border:1px solid var(--color-border, rgba(0, 0, 0, .08))}.namespace-members__member-info[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.1rem;min-width:0}.namespace-members__member-name[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.namespace-members__member-email[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.namespace-members__member-role[_ngcontent-%COMP%]{flex-shrink:0;padding:.3rem .5rem;border-radius:6px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.8rem;font-family:inherit;cursor:pointer}.namespace-members__member-role[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.namespace-members__member-remove[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:50%;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease}.namespace-members__member-remove[_ngcontent-%COMP%]:hover{background:var(--color-error-light, rgba(255, 59, 48, .12));color:var(--color-error, #ff3b30)}.namespace-members__warning[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:8px;background:var(--color-warning-light, rgba(255, 149, 0, .1));border:1px solid var(--color-warning, #ff9500);color:var(--color-warning, #ff9500);font-size:.8rem;line-height:1.4}.namespace-members__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:8px;background:var(--color-error-light, rgba(255, 59, 48, .08));border:1px solid var(--color-error, #ff3b30);color:var(--color-error, #ff3b30);font-size:.875rem;line-height:1.4}.namespace-members__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.namespace-members__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.namespace-members__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.namespace-members__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.namespace-members__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.namespace-members__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{E as a,Y as b};
|