@whoz-oss/coday-client 3.22.0 → 3.24.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.
Files changed (85) hide show
  1. package/browser/{chunk-DeRNr5E2.js → chunk-15rAOoZz.js} +2 -2
  2. package/browser/chunk-16yQFy5_.js +1 -0
  3. package/browser/{chunk-NNu6xUAE.js → chunk-4XIlyOr9.js} +2 -2
  4. package/browser/{chunk-afcQqtlz.js → chunk-7-d3g3_Q.js} +1 -1
  5. package/browser/{chunk-GG036UVD.js → chunk-B-t2KLMQ.js} +1 -1
  6. package/browser/chunk-B3xYeZtG.js +1 -0
  7. package/browser/chunk-B4l5qLZ6.js +1 -0
  8. package/browser/{chunk-BKBTovXz.js → chunk-B52iVZ-n.js} +5 -5
  9. package/browser/chunk-B7GIYsvs.js +1 -0
  10. package/browser/{chunk-KoKdufNA.js → chunk-BBRGEWfs.js} +1 -1
  11. package/browser/{chunk-D1v8TfDX.js → chunk-BHb31ndI.js} +1 -1
  12. package/browser/{chunk-C_OF_Yht.js → chunk-BK_05kmN.js} +1 -1
  13. package/browser/chunk-BLSD82nL.js +1 -0
  14. package/browser/{chunk-MecHdK4O.js → chunk-BOArVQMu.js} +1 -1
  15. package/browser/{chunk-Bg-7wA2s.js → chunk-BPAPWlpQ.js} +1 -1
  16. package/browser/{chunk-Duk6Ikve.js → chunk-BQmHxval.js} +1 -1
  17. package/browser/{chunk-DqDzCK-6.js → chunk-BYJTaU4n.js} +1 -1
  18. package/browser/{chunk-C5Sn2M5w.js → chunk-BYg1TwUC.js} +1 -1
  19. package/browser/{chunk-D2fwi0Hc.js → chunk-BqhCkR9t.js} +1 -1
  20. package/browser/{chunk-DBUR_gpS.js → chunk-BqxwtKFs.js} +1 -1
  21. package/browser/{chunk-DXd3i3QM.js → chunk-Byin_63d.js} +5 -5
  22. package/browser/{chunk-C1X5uZwT.js → chunk-BzZbVcon.js} +3 -3
  23. package/browser/{chunk-CU4qkq0J.js → chunk-C11du_uP.js} +1 -1
  24. package/browser/chunk-C1RU8zia.js +9 -0
  25. package/browser/{chunk-I_PMkbKO.js → chunk-C2Rueaad.js} +1 -1
  26. package/browser/{chunk-DCkYfo8J.js → chunk-C2agnPiQ.js} +1 -1
  27. package/browser/{chunk-B8IQI7aT.js → chunk-C93ZXc5y.js} +1 -1
  28. package/browser/{chunk-B69a5iLl.js → chunk-C9dkqMA4.js} +1 -1
  29. package/browser/{chunk-BCGN7Bq-.js → chunk-CBYDDKYs.js} +1 -1
  30. package/browser/{chunk-CxXOCgTg.js → chunk-CIcEtCxk.js} +1 -1
  31. package/browser/{chunk-CPlR5wjp.js → chunk-CIfgFQUQ.js} +3 -3
  32. package/browser/chunk-CKBQdAGJ.js +1 -0
  33. package/browser/chunk-CKEgNNXU.js +1 -0
  34. package/browser/{chunk-BNNLW7hd.js → chunk-CPI0Zzv3.js} +1 -1
  35. package/browser/{chunk-DmbNv5OX.js → chunk-CPt7Uw3a.js} +1 -1
  36. package/browser/{chunk-DkqPRNv1.js → chunk-CaH-AtD3.js} +2 -2
  37. package/browser/{chunk-C9nbDemu.js → chunk-CbCwwL-W.js} +1 -1
  38. package/browser/{chunk-D4w4_Vsw.js → chunk-Cf7f_94t.js} +1 -1
  39. package/browser/{chunk-Dipwr8Xn.js → chunk-CjPIJIB-.js} +1 -1
  40. package/browser/{chunk-CJKwH7Qd.js → chunk-Co5BFbll.js} +1 -1
  41. package/browser/{chunk-Dwp6OoVJ.js → chunk-CqM-2yCQ.js} +2 -2
  42. package/browser/{chunk-CFD2_xIF.js → chunk-CzDFGxwY.js} +1 -1
  43. package/browser/{chunk-dNACuqx8.js → chunk-D-5Imhde.js} +1 -1
  44. package/browser/{chunk-gaa6JiT9.js → chunk-D4DTIvDf.js} +1 -1
  45. package/browser/chunk-D4_R7aqN.js +1 -0
  46. package/browser/{chunk-3KjG4Ivh.js → chunk-DCjMvdvV.js} +1 -1
  47. package/browser/{chunk-CtVgyQBm.js → chunk-DCx8SlS-.js} +1 -1
  48. package/browser/{chunk-OuaG8E_K.js → chunk-DDertr1B.js} +1 -1
  49. package/browser/{chunk-CNz7zaTq.js → chunk-DFjiy89D.js} +1 -1
  50. package/browser/{chunk-BD91wN51.js → chunk-DIuETvVC.js} +1 -1
  51. package/browser/{chunk-DAxRjiEx.js → chunk-DK1hp0WW.js} +6 -6
  52. package/browser/chunk-DNVNXvsJ.js +1 -0
  53. package/browser/{chunk-CYOKxOkd.js → chunk-DeXXr4BL.js} +6 -6
  54. package/browser/{chunk-DNRaKymp.js → chunk-DgYr3Diz.js} +1 -1
  55. package/browser/{chunk-DH88xB_s.js → chunk-DpkO3_bQ.js} +1 -1
  56. package/browser/{chunk-BLF3w_iN.js → chunk-DuXr-yGB.js} +1 -1
  57. package/browser/{chunk-DUCSH1q7.js → chunk-DwQ0v-xH.js} +1 -1
  58. package/browser/{chunk-B1VIKLB-.js → chunk-I8YepFsn.js} +2 -2
  59. package/browser/{chunk-kUdwsgzt.js → chunk-IXLj2Qpp.js} +1 -1
  60. package/browser/{chunk-A12eXtlW.js → chunk-KXiD_ZK3.js} +1 -1
  61. package/browser/chunk-TkSR4UzV.js +1 -0
  62. package/browser/{chunk-32YJp-72.js → chunk-XBakzM_b.js} +1 -1
  63. package/browser/chunk-buoxjd5i.js +1 -0
  64. package/browser/{chunk-CxnQWVA-.js → chunk-g2nkIubB.js} +1 -1
  65. package/browser/{chunk-CHP4jN9Z.js → chunk-j5aTABHx.js} +1 -1
  66. package/browser/chunk-kNbhE9tu.js +2 -0
  67. package/browser/{chunk-Bf3fjpOn.js → chunk-mUd43Vo8.js} +1 -1
  68. package/browser/{chunk-cyIUrL9y.js → chunk-nSYjfmpf.js} +1 -1
  69. package/browser/{chunk-DsnIWrL1.js → chunk-sLJinEtR.js} +1 -1
  70. package/browser/index.html +1 -1
  71. package/browser/{main-P72KGKGP.js → main-JTU33H5D.js} +18 -18
  72. package/package.json +1 -1
  73. package/browser/chunk-BIeOmcVm.js +0 -2
  74. package/browser/chunk-BRwhmCei.js +0 -1
  75. package/browser/chunk-BWJO7VDR.js +0 -1
  76. package/browser/chunk-BgdV8OdP.js +0 -1
  77. package/browser/chunk-C9ckXqnn.js +0 -1
  78. package/browser/chunk-CPOlQJvd.js +0 -1
  79. package/browser/chunk-CThn4VXH.js +0 -1
  80. package/browser/chunk-CUv3B-19.js +0 -9
  81. package/browser/chunk-CoPepxeH.js +0 -1
  82. package/browser/chunk-DJaf3eTF.js +0 -1
  83. package/browser/chunk-Dpnh8sS8.js +0 -1
  84. package/browser/chunk-DzcV-nhe.js +0 -1
  85. package/browser/chunk-NBeBKSWy.js +0 -1
@@ -1 +0,0 @@
1
- import {I}from'./chunk-DCkYfo8J.js';import {g,G,C as Ce,dm as B,df as $,aJ as Tr,W as Wi,bS as Da,aD as Hy,r as re,b as U,j as jw,aK as Lb,k as Cs,bf as gT,n as kg,m as hl,af as wg,A as AC,_ as _g,bg as yT,ah as dT,o as aC,ac as CC,u as cC,a9 as vC,aa as Cf,ab as Tf,ag as ET}from'./main-P72KGKGP.js';import {W as Wn,S as Se}from'./chunk-CYOKxOkd.js';import'./chunk-DAxRjiEx.js';import'./chunk-BLF3w_iN.js';var V=()=>[];function F(n,t){if(n&1){let o=vC();Cs(0,"agentos-ai-model-item",4),kg("editRequested",function(e){Cf(o);let s=CC(2);return Tf(s.onEdit(e))})("deleteRequested",function(e){Cf(o);let s=CC(2);return Tf(s.deleteModel(e))}),hl();}n&2&&_g("model",t);}function O(n,t){if(n&1&&aC(0,F,1,1,"agentos-ai-model-item",3),n&2){let o,i=t.$implicit,e=CC();cC((o=e.resolveModel(i.id))?0:-1,o);}}var S=class n{router=g(G);destroyRef=g(Ce);aiModelController=g(B);aiProviderController=g($);refresh$=new Tr(void 0);isLoading=Wi(true);data$=this.refresh$.pipe(Da(()=>(this.isLoading.set(true),Hy([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))));modelItems$=this.data$.pipe(re(([t,o])=>{let i=new Map(o.map(e=>[e.id??"",e.name]));return t.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:e.aiProviderId,groupLabel:i.get(e.aiProviderId)??e.aiProviderId}))}));modelsById=new Map;constructor(){this.data$.pipe(U(this.destroyRef)).subscribe({next:([t])=>{this.modelsById=new Map(t.map(o=>[o.id??"",o])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"]);}deleteModel(t){this.aiModelController.deleteAiModel(t.id??"").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","ai-models",t.id,"edit"]);}resolveModel(t){return this.modelsById.get(t)??null}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=jw({type:n,selectors:[["agentos-platform-ai-models"]],decls:5,vars:7,consts:[["aiModelItemTpl",""],["title","Platform AI Models","emptyMessage","No platform AI models defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model"],[3,"editRequested","deleteRequested","model"]],template:function(o,i){if(o&1&&(Cs(0,"ds-entity-list",1),gT(1,"async"),kg("createRequested",function(){return i.openCreateForm()}),Cs(2,"ds-icon-button",2),kg("action",function(){return i.goBack()}),hl()(),wg(3,O,1,1,"ng-template",null,0,ET)),o&2){let e=AC(4);_g("items",yT(1,4,i.modelItems$)??dT(6,V))("loading",i.isLoading())("showCreate",true)("itemTemplate",e);}},dependencies:[Wn,I,Se,Lb],styles:[".platform-ai-models__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-models__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"]})};export{S as PlatformAiModelsComponent};
@@ -1 +0,0 @@
1
- import {g,ao as V,G,C as Ce,dm as B,df as $,F,a7 as va,I as br,W as Wi,T as TT,b as U,z as z$1,a as P,j as jw,k as Cs,n as kg,J as JC,m as hl,o as aC,t as sI,a8 as Kg,u as cC,a9 as vC,M as Mg,a3 as ZI,ac as CC,_ as _g,a6 as QI,a5 as Dl,q as dC,cH as iC,v as fC,b0 as Xg,aa as Cf,ab as Tf}from'./main-P72KGKGP.js';import {o as z,k as _t,b as _e,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,A as At,Z as Zn,l as Xn,$ as $t,W as Wt,C as Cn,E as En,p as An}from'./chunk-BLF3w_iN.js';function le(l,t){l&1&&(Cs(0,"p",5),JC(1,"Loading\u2026"),hl());}function ae(l,t){if(l&1&&Mg(0,"input",11),l&2){let e=CC(2);_g("value",e.selectedProviderLabel());}}function de(l,t){if(l&1&&(Cs(0,"option",43),JC(1),hl()),l&2){let e=t.$implicit;_g("value",e.id),sI(),Xg("",e.name," (",e.apiType,")");}}function me(l,t){if(l&1&&(Cs(0,"select",12)(1,"option",42),JC(2,"Select provider"),hl(),dC(3,de,2,3,"option",43,iC().trackByProvider,true),hl(),ZI()),l&2){let e=CC(2);_g("formControl",e.aiProviderIdControl),QI(),sI(3),fC(e.providers());}}function ce(l,t){if(l&1){let e=vC();Cs(0,"form",7),kg("ngSubmit",function(){Cf(e);let u=CC();return Tf(u.submit())}),Cs(1,"div",8)(2,"label",9),JC(3," Provider "),Cs(4,"span",10),JC(5,"*"),hl()(),aC(6,ae,1,1,"input",11)(7,me,5,1,"select",12),hl(),Cs(8,"div",8)(9,"label",13),JC(10," API name "),Cs(11,"span",10),JC(12,"*"),hl()(),Mg(13,"input",14),ZI(),hl(),Cs(14,"div",8)(15,"label",15),JC(16,"Description"),hl(),Mg(17,"input",16),ZI(),hl(),Cs(18,"div",8)(19,"label",17),JC(20,"Alias"),hl(),Mg(21,"input",18),ZI(),hl(),Cs(22,"div",8)(23,"label",19),JC(24,"Priority"),hl(),Mg(25,"input",20),ZI(),hl(),Cs(26,"div",21)(27,"div",8)(28,"label",22),JC(29,"Temperature"),hl(),Mg(30,"input",23),ZI(),hl(),Cs(31,"div",8)(32,"label",24),JC(33,"Context window"),hl(),Mg(34,"input",25),ZI(),hl()(),Cs(35,"div",8)(36,"label",26),JC(37,"Max completion tokens"),hl(),Mg(38,"input",27),ZI(),hl(),Cs(39,"fieldset",28)(40,"legend",29),JC(41," Pricing "),Cs(42,"span",30),JC(43,"(per million tokens \u2014 leave blank to skip cost monitoring)"),hl()(),Cs(44,"div",21)(45,"div",8)(46,"label",31),JC(47,"Input"),hl(),Mg(48,"input",32),ZI(),hl(),Cs(49,"div",8)(50,"label",33),JC(51,"Output"),hl(),Mg(52,"input",34),ZI(),hl()(),Cs(53,"div",21)(54,"div",8)(55,"label",35),JC(56,"Cache write"),hl(),Mg(57,"input",36),ZI(),hl(),Cs(58,"div",8)(59,"label",37),JC(60,"Cache read"),hl(),Mg(61,"input",38),ZI(),hl()()(),Cs(62,"div",39)(63,"button",40),JC(64),hl(),Cs(65,"button",41),kg("click",function(){Cf(e);let u=CC();return Tf(u.cancel())}),JC(66,"Cancel"),hl()()();}if(l&2){let e=CC();_g("formGroup",e.form),sI(6),cC(e.isEditMode()?6:7),sI(7),_g("formControl",e.apiModelNameControl),QI(),sI(4),_g("formControl",e.descriptionControl),QI(),sI(4),_g("formControl",e.aliasControl),QI(),sI(4),_g("formControl",e.priorityControl),QI(),sI(5),_g("formControl",e.temperatureControl),QI(),sI(4),_g("formControl",e.contextWindowControl),QI(),sI(4),_g("formControl",e.maxCompletionTokensControl),QI(),sI(),_g("formGroup",e.pricingGroup),sI(9),QI(),sI(4),QI(),sI(5),QI(),sI(4),QI(),sI(2),_g("disabled",e.form.invalid||e.isSubmitting()),sI(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var re=class l{route=g(V);router=g(G);destroyRef=g(Ce);aiModelController=g(B);aiProviderController=g($);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=F(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(va(()=>br([]))),{initialValue:[]});form=new z({aiProviderId:new _t("",{nonNullable:true,validators:[_e.required]}),apiModelName:new _t("",{nonNullable:true,validators:[_e.required,_e.minLength(1)]}),description:new _t(null),alias:new _t("",{nonNullable:true}),priority:new _t(0,{nonNullable:true}),temperature:new _t(null),contextWindow:new _t(null),maxCompletionTokens:new _t(null),pricing:new z({inputMTokens:new _t(null),outputMTokens:new _t(null),cacheWrite:new _t(null),cacheRead:new _t(null)})});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get contextWindowControl(){return this.form.controls.contextWindow}get maxCompletionTokensControl(){return this.form.controls.maxCompletionTokens}get pricingGroup(){return this.form.controls.pricing}isEditMode=Wi(false);isSubmitting=Wi(false);isLoading=Wi(false);selectedProviderLabel=TT(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(p=>p.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(true),this.loadModel(t));}loadModel(t){this.isLoading.set(true),this.aiModelController.getByIdAiModel(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.contextWindowControl.setValue(e.contextWindow??null),this.maxCompletionTokensControl.setValue(e.maxCompletionTokens??null),this.pricingGroup.setValue({inputMTokens:e.pricing?.inputMTokens??null,outputMTokens:e.pricing?.outputMTokens??null,cacheWrite:e.pricing?.cacheWrite??null,cacheRead:e.pricing?.cacheRead??null}),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.form.getRawValue(),e=t.pricing,u=e.inputMTokens!=null||e.outputMTokens!=null||e.cacheWrite!=null||e.cacheRead!=null?{isEmpty:false,inputMTokens:e.inputMTokens??void 0,outputMTokens:e.outputMTokens??void 0,cacheWrite:e.cacheWrite??void 0,cacheRead:e.cacheRead??void 0}:void 0,k=z$1(P({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,contextWindow:t.contextWindow??void 0,maxCompletionTokens:t.maxCompletionTokens??void 0,pricing:u});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",k):this.aiModelController.createAiModel(k)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"]);}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=jw({type:l,selectors:[["agentos-ai-model-form"]],decls:10,vars:2,consts:[[1,"ai-model-form"],[1,"ai-model-form__header"],["type","button","title","Back to AI models",1,"ai-model-form__back",3,"click"],[1,"ai-model-form__back-icon"],[1,"ai-model-form__title"],[1,"ai-model-form__loading"],[1,"ai-model-form__form",3,"formGroup"],[1,"ai-model-form__form",3,"ngSubmit","formGroup"],[1,"ai-model-form__field"],["for","model-provider",1,"ai-model-form__label"],["aria-hidden","true"],["id","model-provider","type","text","readonly","","tabindex","-1",1,"ai-model-form__input","ai-model-form__input--readonly",3,"value"],["id","model-provider",1,"ai-model-form__select",3,"formControl"],["for","model-api-name",1,"ai-model-form__label"],["id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",1,"ai-model-form__input","ai-model-form__input--mono",3,"formControl"],["for","model-description",1,"ai-model-form__label"],["id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-alias",1,"ai-model-form__label"],["id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-priority",1,"ai-model-form__label"],["id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",1,"ai-model-form__input",3,"formControl"],[1,"ai-model-form__row"],["for","model-temperature",1,"ai-model-form__label"],["id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",1,"ai-model-form__input",3,"formControl"],["for","model-context-window",1,"ai-model-form__label"],["id","model-context-window","type","number","placeholder","e.g. 128000","min","1","step","1",1,"ai-model-form__input",3,"formControl"],["for","model-max-completion-tokens",1,"ai-model-form__label"],["id","model-max-completion-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",1,"ai-model-form__input",3,"formControl"],[1,"ai-model-form__section",3,"formGroup"],[1,"ai-model-form__section-title"],[1,"ai-model-form__section-hint"],["for","pricing-input",1,"ai-model-form__label"],["id","pricing-input","type","number","placeholder","e.g. 2.50","min","0","step","0.01","formControlName","inputMTokens",1,"ai-model-form__input"],["for","pricing-output",1,"ai-model-form__label"],["id","pricing-output","type","number","placeholder","e.g. 10.00","min","0","step","0.01","formControlName","outputMTokens",1,"ai-model-form__input"],["for","pricing-cache-write",1,"ai-model-form__label"],["id","pricing-cache-write","type","number","placeholder","e.g. 3.75","min","0","step","0.01","formControlName","cacheWrite",1,"ai-model-form__input"],["for","pricing-cache-read",1,"ai-model-form__label"],["id","pricing-cache-read","type","number","placeholder","e.g. 0.30","min","0","step","0.01","formControlName","cacheRead",1,"ai-model-form__input"],[1,"ai-model-form__actions"],["type","submit",1,"ai-model-form__btn","ai-model-form__btn--primary",3,"disabled"],["type","button",1,"ai-model-form__btn",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,p){e&1&&(Cs(0,"div",0)(1,"header",1)(2,"button",2),kg("click",function(){return p.cancel()}),Cs(3,"span",3),JC(4,"\u2190"),hl(),JC(5," AI models "),hl(),Cs(6,"h1",4),JC(7),hl()(),aC(8,le,2,0,"p",5)(9,ce,67,12,"form",6),hl()),e&2&&(sI(7),Kg(p.isEditMode()?"Edit AI model":"New AI model"),sI(),cC(p.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,fn,At,Zn,Xn,$t,Wt,Cn,En,An],styles:[".ai-model-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-model-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-model-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.ai-model-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-model-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-model-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.ai-model-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.ai-model-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-model-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.ai-model-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-model-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.ai-model-form__input[_ngcontent-%COMP%], .ai-model-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.ai-model-form__input[_ngcontent-%COMP%]:focus, .ai-model-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.ai-model-form__input[_ngcontent-%COMP%]::placeholder, .ai-model-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.ai-model-form__input--mono[_ngcontent-%COMP%]{font-family:monospace}.ai-model-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:1rem}.ai-model-form__section-title[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;color:var(--color-text);padding:0 .25rem}.ai-model-form__section-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary);font-size:.8125rem}.ai-model-form__input--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);cursor:default;background:var(--color-surface-muted, rgba(0, 0, 0, .03))}.ai-model-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-model-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.ai-model-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.ai-model-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-model-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.ai-model-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"]})};export{re as AiModelFormComponent};
@@ -1 +0,0 @@
1
- import {bS as Da,a7 as va,I as br,cE as kd}from'./main-P72KGKGP.js';function i(t,o,p){return t.pipe(Da(()=>o().pipe(va(()=>br(p)))),kd({bufferSize:1,refCount:true}))}export{i};
@@ -1 +0,0 @@
1
- import {l}from'./chunk-CUv3B-19.js';import {g,dg as Z,dh as T,I as br,bS as Da,r as re,a7 as va,cE as kd,K as x}from'./main-P72KGKGP.js';var v=class i{userState=g(l);membership=g(Z);currentUser$=T(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return br(false);let t=this.cache.get(e);if(t)return t;let s=this.currentUser$.pipe(Da(a=>a?a.isAdmin?br(true):this.membership.getMembersNamespaceMembership(e).pipe(re(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),va(()=>br(false))):br(false)),kd({bufferSize:1,refCount:false}));return this.cache.set(e,s),s}static \u0275fac=function(t){return new(t||i)};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v};
@@ -1 +0,0 @@
1
- import {c}from'./chunk-kUdwsgzt.js';import {g,ao as V,G,C as Ce$1,da as M,db as ye$1,dc as me$1,W as Wi,dd as Ae$1,F,bR as Sd,T as TT,$ as $y,b as U,a7 as va,I as br,z as z$1,a as P,j as jw,k as Cs,n as kg,J as JC,m as hl,o as aC,t as sI,a5 as Dl,u as cC,a9 as vC,M as Mg,a3 as ZI,q as dC,ac as CC,_ as _g,w as zg,a6 as QI,v as fC,a8 as Kg,aa as Cf,ab as Tf,bk as Dh}from'./main-P72KGKGP.js';import {o as z,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,C as Cn,E as En}from'./chunk-BLF3w_iN.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&(Cs(0,"p",5),JC(1,"Loading\u2026"),hl());}function ue(n,t){n&1&&(Cs(0,"span",12),JC(1," Name is required. "),hl());}function fe(n,t){if(n&1&&(Cs(0,"p",42),JC(1),hl(),Cs(2,"span",13),JC(3,"Agent Config cannot be changed after creation."),hl()),n&2){let e=CC(2);sI(),Kg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(Cs(0,"a",43),JC(1,"Add an agent config"),hl(),JC(2," first. ")),n&2){let e=CC(3);_g("href","/agentos/"+e.namespaceId+"/agent-configs/new",Dh);}}function he(n,t){if(n&1&&(Cs(0,"p",13),JC(1," No agent configs available in this scope yet. "),aC(2,_e,3,1),hl()),n&2){let e=CC(2);sI(2),cC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(Cs(0,"option",23),JC(1),hl()),n&2){let e=t.$implicit;_g("value",e.id),sI(),Kg(e.name);}}function Ce(n,t){n&1&&(Cs(0,"span",12),JC(1,"Agent Config is required."),hl());}function ve(n,t){if(n&1&&(Cs(0,"select",44)(1,"option",45),JC(2,"Select an agent config\u2026"),hl(),dC(3,ge,2,2,"option",23,me),hl(),ZI(),aC(5,Ce,2,0,"span",12),Cs(6,"span",13),JC(7,"Immutable after creation."),hl()),n&2){let e=CC(2);_g("formControl",e.agentConfigIdControl),QI(),sI(3),fC(e.availableAgentConfigs()),sI(2),cC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&(Cs(0,"span",12),JC(1,"Opening message is required."),hl());}function ye(n,t){if(n&1&&(Cs(0,"option",23),JC(1),hl()),n&2){let e=t.$implicit;_g("value",e.value),sI(),Kg(e.label);}}function be(n,t){if(n&1){let e=vC();Cs(0,"label",48)(1,"input",49),kg("change",function(){let g=Cf(e).$implicit,v=CC(3);return Tf(v.toggleDay(g.value))}),hl(),Cs(2,"span",50),JC(3),hl()();}if(n&2){let e=t.$implicit,d=CC(3);sI(),_g("checked",d.isDaySelected(e.value)),sI(2),Kg(e.label);}}function Se(n,t){if(n&1&&(Cs(0,"div",8)(1,"span",46),JC(2,"Days of week"),hl(),Cs(3,"div",47),dC(4,be,4,2,"label",48,A),hl(),Cs(6,"span",13),JC(7,"Leave empty to run every day of the week."),hl()()),n&2){let e=CC(2);sI(4),fC(e.dayOptions);}}function Ee(n,t){n&1&&(Cs(0,"span",12),JC(1,"Valid time is required (HH:mm)."),hl());}function Pe(n,t){n&1&&(Cs(0,"span",12),JC(1,"Start date is required."),hl());}function Me(n,t){if(n&1&&(Cs(0,"option",23),JC(1),hl()),n&2){let e=t.$implicit;_g("value",e.value),sI(),Kg(e.label);}}function Oe(n,t){n&1&&(Cs(0,"span",12),JC(1,"End date is required."),hl());}function De(n,t){if(n&1&&(Cs(0,"div",8)(1,"label",51),JC(2," End date "),Cs(3,"span",10),JC(4,"*"),hl()(),Mg(5,"input",52),ZI(),aC(6,Oe,2,0,"span",12),hl()),n&2){let e=CC(2);sI(5),zg("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),_g("formControl",e.endDateControl),QI(),sI(),cC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(Cs(0,"span",12),JC(1,"Must be at least 1."),hl());}function we(n,t){if(n&1&&(Cs(0,"div",8)(1,"label",53),JC(2," Number of occurrences "),Cs(3,"span",10),JC(4,"*"),hl()(),Mg(5,"input",54),ZI(),aC(6,Te,2,0,"span",12),hl()),n&2){let e=CC(2);sI(5),zg("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),_g("formControl",e.occurrenceCountControl),QI(),sI(),cC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&(Cs(0,"span",12),JC(1,"Invalid JSON."),hl());}function Ne(n,t){if(n&1&&(Cs(0,"p",38),JC(1),hl()),n&2){let e=CC(2);sI(),Kg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=vC();Cs(0,"form",7),kg("ngSubmit",function(){Cf(e);let g=CC();return Tf(g.submit())}),Cs(1,"div",8)(2,"label",9),JC(3," Name "),Cs(4,"span",10),JC(5,"*"),hl()(),Mg(6,"input",11),ZI(),aC(7,ue,2,0,"span",12),Cs(8,"span",13),JC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),hl()(),Cs(10,"div",8)(11,"label",14),JC(12,"Description"),hl(),Mg(13,"input",15),ZI(),hl(),Cs(14,"div",8)(15,"label",16),JC(16," Agent Config "),Cs(17,"span",10),JC(18,"*"),hl()(),aC(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),hl(),Cs(22,"div",8)(23,"label",17),JC(24," Opening message "),Cs(25,"span",10),JC(26,"*"),hl()(),Mg(27,"textarea",18),ZI(),aC(28,xe,2,0,"span",12),Cs(29,"span",13),JC(30," The message sent to the agent when the scheduled prompt fires. "),hl()(),Cs(31,"fieldset",19)(32,"legend",20),JC(33,"Recurrence"),hl(),Cs(34,"div",8)(35,"label",21),JC(36," Unit "),Cs(37,"span",10),JC(38,"*"),hl()(),Cs(39,"select",22),dC(40,ye,2,2,"option",23,A),hl(),ZI(),hl(),aC(42,Se,8,0,"div",8),Cs(43,"div",8)(44,"label",24),JC(45," Time (UTC) "),Cs(46,"span",10),JC(47,"*"),hl()(),Cs(48,"div",25),Mg(49,"input",26),ZI(),Cs(50,"span",27),JC(51,"UTC"),hl()(),aC(52,Ee,2,0,"span",12),hl()(),Cs(53,"fieldset",19)(54,"legend",20),JC(55,"Planning"),hl(),Cs(56,"div",8)(57,"label",28),JC(58," Start date "),Cs(59,"span",10),JC(60,"*"),hl()(),Mg(61,"input",29),ZI(),aC(62,Pe,2,0,"span",12),hl(),Cs(63,"div",8)(64,"label",30),JC(65," Ends "),Cs(66,"span",10),JC(67,"*"),hl()(),Cs(68,"select",31),dC(69,Me,2,2,"option",23,A),hl(),ZI(),hl(),aC(71,De,7,4,"div",8),aC(72,we,7,4,"div",8),hl(),Cs(73,"div",8)(74,"label",32),Mg(75,"input",33),ZI(),Cs(76,"span",34),JC(77,"Enabled"),hl()(),Cs(78,"p",35),JC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),hl()(),Cs(80,"div",8)(81,"label",36),JC(82,"External Metadata"),hl(),Mg(83,"textarea",37),ZI(),aC(84,ke,2,0,"span",12),Cs(85,"span",13),JC(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),hl()(),aC(87,Ne,2,1,"p",38),Cs(88,"div",39)(89,"button",40),JC(90),hl(),Cs(91,"button",41),kg("click",function(){Cf(e);let g=CC();return Tf(g.cancel())}),JC(92,"Cancel"),hl()()();}if(n&2){let e=CC();_g("formGroup",e.form),sI(6),zg("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),_g("formControl",e.nameControl),QI(),sI(),cC(e.nameControl.invalid&&e.nameControl.touched?7:-1),sI(6),_g("formControl",e.descriptionControl),QI(),sI(6),cC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),sI(8),zg("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),_g("formControl",e.promptContentControl),QI(),sI(),cC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),sI(11),_g("formControl",e.unitControl),QI(),sI(),fC(e.schedulerUnits),sI(2),cC(e.showDayFilter()?42:-1),sI(7),_g("formControl",e.timeUtcControl),QI(),sI(3),cC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),sI(9),zg("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),_g("formControl",e.startDateControl),QI(),sI(),cC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),sI(6),_g("formControl",e.endTypeControl),QI(),sI(),fC(e.endTypes),sI(2),cC(e.showEndDate()?71:-1),sI(),cC(e.showOccurrenceCount()?72:-1),sI(3),_g("formControl",e.enabledControl),QI(),sI(8),_g("formControl",e.externalMetadataJsonControl),QI(),sI(),cC(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),sI(3),cC(e.errorMessage()?87:-1),sI(2),_g("disabled",e.form.invalid||e.isSubmitting()),sI(),Dl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=g(V);router=g(G);destroyRef=g(Ce$1);state=g(c);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required]}),description:new _t(null),agentConfigId:new _t("",{nonNullable:true,validators:[_e$1.required]}),promptContent:new _t("",{nonNullable:true,validators:[_e$1.required]}),unit:new _t(me$1.WEEK,{nonNullable:true,validators:[_e$1.required]}),days:new _t([],{nonNullable:true}),timeUtc:new _t("09:00",{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new _t("",{nonNullable:true,validators:[_e$1.required]}),endType:new _t(ye$1.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true}),externalMetadataJson:new _t("",{nonNullable:true,validators:[Ae]})},{validators:[Ie,Ve]});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}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=Wi(false);isSubmitting=Wi(false);isLoading=Wi(false);errorMessage=Wi(null);SchedulerUnit=me$1;SchedulerEndType=ye$1;schedulerUnits=[{value:me$1.WEEK,label:"Week(s)"},{value:me$1.MONTH,label:"Month(s)"}];endTypes=[{value:ye$1.NEVER,label:"Never"},{value:ye$1.ON_DATE,label:"On date"},{value:ye$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Ae$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(Sd(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Sd(this.endTypeControl.value)));showDayFilter=TT(()=>this.unitSignal()===me$1.WEEK);showEndDate=TT(()=>this.endTypeSignal()===ye$1.ON_DATE);showOccurrenceCount=TT(()=>this.endTypeSignal()===ye$1.OCCURRENCES);agentConfigs=Wi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),$y({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:d})=>{this.existingPrompt=e,this.agentConfigs.set(d),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(va(()=>br([])))}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),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,d=e.includes(t)?e.filter(g=>g!==t):[...e,t];this.daysControl.setValue(d);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,d=z$1(P({},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===ye$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===ye$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let v=this.externalMetadataJsonControl.value.trim();return v?JSON.parse(v):null})()});(t?this.state.update(this.existingPrompt.id,d):this.state.create(d)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:v=>{this.isSubmitting.set(false),v.status===409?this.errorMessage.set(`A scheduled prompt named "${d.name}" already exists in this scope.`):v.status===400?this.errorMessage.set(v.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=jw({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"],["for","sp-external-metadata",1,"scheduled-prompt-form__label"],["id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"scheduled-prompt-form__textarea","scheduled-prompt-form__textarea--code",3,"formControl"],[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,d){e&1&&(Cs(0,"div",0)(1,"header",1)(2,"button",2),kg("click",function(){return d.cancel()}),Cs(3,"span",3),JC(4,"\u2190"),hl(),JC(5),hl(),Cs(6,"h1",4),JC(7),hl()(),aC(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),hl()),e&2&&(sI(5),Dl(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),sI(2),Dl(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),sI(),cC(d.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Cn,En],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)}"]})};function Ie(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===ye$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===ye$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ae(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),d=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${d}`}export{se as ScheduledPromptFormComponent};