@whoz-oss/coday-client 3.15.1 → 3.16.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 (78) hide show
  1. package/browser/{chunk-CysW_ro-.js → chunk-0OiZWE88.js} +1 -1
  2. package/browser/{chunk-BhfpLr7-.js → chunk-6gdeYlLc.js} +1 -1
  3. package/browser/{chunk-B5_o_qhk.js → chunk-7jUQT_3F.js} +1 -1
  4. package/browser/{chunk-K-fhwl_z.js → chunk-B0vRsgnD.js} +1 -1
  5. package/browser/{chunk-RxHlNJ_t.js → chunk-BEKR4Un_.js} +1 -1
  6. package/browser/chunk-BEUXx3TO.js +1 -0
  7. package/browser/{chunk-Bnic_hdt.js → chunk-BHZY3TvC.js} +5 -5
  8. package/browser/{chunk-C6RPhP4t.js → chunk-BJYyjaQ6.js} +1 -1
  9. package/browser/chunk-BJeLQooO.js +1 -0
  10. package/browser/{chunk-BIMT-HvS.js → chunk-BNS6Fgaw.js} +1 -1
  11. package/browser/{chunk-BVCQOGLR.js → chunk-BSSDDOqW.js} +2 -2
  12. package/browser/{chunk-Dd2dq7xg.js → chunk-BTS5TBK0.js} +1 -1
  13. package/browser/{chunk-B11WEBEl.js → chunk-BUJoEGsf.js} +1 -1
  14. package/browser/chunk-BY7uKZAo.js +9 -0
  15. package/browser/{chunk-5t7zJzqM.js → chunk-B_9LxHBv.js} +1 -1
  16. package/browser/{chunk-DTZ7N3wC.js → chunk-BdApeECy.js} +1 -1
  17. package/browser/{chunk-BhM0bmJW.js → chunk-BdpJ2ZCM.js} +1 -1
  18. package/browser/{chunk-CyUmCedx.js → chunk-Be1LOFvg.js} +1 -1
  19. package/browser/{chunk-CYMQSJz6.js → chunk-Bhq5earA.js} +1 -1
  20. package/browser/{chunk-C5wr-vqf.js → chunk-Bib1Seeu.js} +1 -1
  21. package/browser/{chunk-C7MXO6BQ.js → chunk-Bn3R3VC2.js} +5 -5
  22. package/browser/{chunk-DxxECdrg.js → chunk-C-aF2_1R.js} +2 -2
  23. package/browser/{chunk-Jv7RGmnK.js → chunk-CBNhmZDS.js} +1 -1
  24. package/browser/{chunk-DzicJow4.js → chunk-CFZbDe5T.js} +3 -3
  25. package/browser/{chunk-mHtuxvLs.js → chunk-CGMAzvSo.js} +1 -1
  26. package/browser/chunk-CPBcDx4G.js +1 -0
  27. package/browser/{chunk-DYUMiAN8.js → chunk-CTuHnJP4.js} +1 -1
  28. package/browser/{chunk-n1eKIk8H.js → chunk-CXLytVC3.js} +1 -1
  29. package/browser/{chunk-5LRyprMF.js → chunk-CYulIMKp.js} +1 -1
  30. package/browser/{chunk-CyxhAtE7.js → chunk-C_s4Z3Dk.js} +1 -1
  31. package/browser/{chunk-D_vvo2qx.js → chunk-CbK5Lcu9.js} +1 -1
  32. package/browser/{chunk-9CSRlx74.js → chunk-CgqDTJ5-.js} +1 -1
  33. package/browser/{chunk-Dg6QAZUw.js → chunk-Ci1jk71f.js} +2 -2
  34. package/browser/{chunk-Bh1p6jDj.js → chunk-CiWu4t_i.js} +1 -1
  35. package/browser/{chunk-CUmS2-ak.js → chunk-CjrWXBiR.js} +1 -1
  36. package/browser/{chunk-BqKdrvcS.js → chunk-Co81dkbz.js} +1 -1
  37. package/browser/{chunk-Ce03Ba0V.js → chunk-CtWMrBfw.js} +1 -1
  38. package/browser/{chunk-l0HLnBLv.js → chunk-CtkiOUdU.js} +6 -6
  39. package/browser/{chunk-BlWlE-Cq.js → chunk-CwaAd8kk.js} +1 -1
  40. package/browser/{chunk-Bgy3uCgK.js → chunk-DDnWPYAA.js} +1 -1
  41. package/browser/{chunk-CHrmSvQM.js → chunk-DOq0u21j.js} +1 -1
  42. package/browser/{chunk-DX2ZzvT5.js → chunk-DQLU3kYb.js} +1 -1
  43. package/browser/{chunk-fP29MqaN.js → chunk-Dcftf7UY.js} +1 -1
  44. package/browser/{chunk-BZMAEe_X.js → chunk-Dfujxxcr.js} +1 -1
  45. package/browser/chunk-DgrvmqY2.js +2 -0
  46. package/browser/{chunk-CebS4RAf.js → chunk-DoKoAMs6.js} +1 -1
  47. package/browser/{chunk-CNIfOUla.js → chunk-Dtu-PLbq.js} +1 -1
  48. package/browser/{chunk-C4U0w8cP.js → chunk-DzlrRiVM.js} +1 -1
  49. package/browser/{chunk-BfD1F12k.js → chunk-HjD5Rk4C.js} +3 -3
  50. package/browser/{chunk-CcLheUaL.js → chunk-IUvEtpfr.js} +1 -1
  51. package/browser/{chunk-DTIhOEG_.js → chunk-S8F5_Te_.js} +6 -6
  52. package/browser/{chunk-HSc9fwVS.js → chunk-SbH2L3h2.js} +1 -1
  53. package/browser/{chunk-BKlwFrFB.js → chunk-UzUd84Qf.js} +1 -1
  54. package/browser/chunk-YS-vAhPY.js +190 -0
  55. package/browser/{chunk-BUEM7g7F.js → chunk-YfG457Nc.js} +3 -3
  56. package/browser/{chunk-DG2FCeMu.js → chunk-axGY7UtD.js} +1 -1
  57. package/browser/chunk-fYErSEXN.js +1 -0
  58. package/browser/{chunk-BgHTiTG2.js → chunk-fhFxOLYS.js} +1 -1
  59. package/browser/{chunk-qARg6ese.js → chunk-gmPqDrDS.js} +1 -1
  60. package/browser/{chunk-DvzNS1Bs.js → chunk-iNIQR015.js} +1 -1
  61. package/browser/{chunk-Dj9y_5pr.js → chunk-izARvh_2.js} +1 -1
  62. package/browser/{chunk-Cf3l2UgA.js → chunk-jv0lz5Ah.js} +1 -1
  63. package/browser/{chunk-nWqZHM4o.js → chunk-kvCfAm7Z.js} +1 -1
  64. package/browser/{chunk-ZvcyZV3G.js → chunk-pH1k_bet.js} +1 -1
  65. package/browser/{chunk-DYE131qf.js → chunk-rwEyLSEP.js} +1 -1
  66. package/browser/{chunk-XgEfnfT0.js → chunk-swj7IkJA.js} +1 -1
  67. package/browser/chunk-tTmeIHGS.js +37 -0
  68. package/browser/index.html +1 -1
  69. package/browser/{main-6K2UFGD2.js → main-5PAOSHSM.js} +19 -19
  70. package/package.json +1 -1
  71. package/browser/chunk-BC0acSZF.js +0 -1
  72. package/browser/chunk-BLa2Gx7h.js +0 -190
  73. package/browser/chunk-B_2kLXvG.js +0 -1
  74. package/browser/chunk-C9tuHQmZ.js +0 -37
  75. package/browser/chunk-CnnGSYzi.js +0 -2
  76. package/browser/chunk-DEsz0fzs.js +0 -1
  77. package/browser/chunk-DXDohTwX.js +0 -1
  78. package/browser/chunk-uPxETzZs.js +0 -9
@@ -1 +1 @@
1
- import {I}from'./chunk-HSc9fwVS.js';import {g,G,w as we,de as M,dd as $,aJ as Tr,z as zi,bS as va,aD as Ly,u as ue,c as U,h as Rw,aK as xb,I as Is,bf as cT,A as Ag,m as pl,af as Dg,r as bC,T as Tg,bg as lT,ah as oT,t as tC,ac as yC,v as nC,a9 as fC,aa as If,ab as wf,ag as pT}from'./main-6K2UFGD2.js';import {W as Wn,S as Se}from'./chunk-l0HLnBLv.js';import'./chunk-DTIhOEG_.js';import'./chunk-C9tuHQmZ.js';var V=()=>[];function F(n,t){if(n&1){let o=fC();Is(0,"agentos-ai-model-item",4),Ag("editRequested",function(e){If(o);let s=yC(2);return wf(s.onEdit(e))})("deleteRequested",function(e){If(o);let s=yC(2);return wf(s.deleteModel(e))}),pl();}n&2&&Tg("model",t);}function O(n,t){if(n&1&&tC(0,F,1,1,"agentos-ai-model-item",3),n&2){let o,i=t.$implicit,e=yC();nC((o=e.resolveModel(i.id))?0:-1,o);}}var S=class n{router=g(G);destroyRef=g(we);aiModelController=g(M);aiProviderController=g($);refresh$=new Tr(void 0);isLoading=zi(true);data$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),Ly([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))));modelItems$=this.data$.pipe(ue(([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=Rw({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&&(Is(0,"ds-entity-list",1),cT(1,"async"),Ag("createRequested",function(){return i.openCreateForm()}),Is(2,"ds-icon-button",2),Ag("action",function(){return i.goBack()}),pl()(),Dg(3,O,1,1,"ng-template",null,0,pT)),o&2){let e=bC(4);Tg("items",lT(1,4,i.modelItems$)??oT(6,V))("loading",i.isLoading())("showCreate",true)("itemTemplate",e);}},dependencies:[Wn,I,Se,xb],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
+ import {I}from'./chunk-SbH2L3h2.js';import {g,G,w as we,de as M,dd as $,aJ as Tr,a as Gi,bS as Da,aD as jy,u as ue,c as U,h as Fw,aK as Ob,m as ws,bf as dT,o as Rg,n as hl,af as Eg,M as MC,v as bg,bg as pT,ah as aT,q as oC,ac as EC,x as iC,a9 as gC,aa as wf,ab as Cf,ag as mT}from'./main-5PAOSHSM.js';import {W as Wn,S as Se}from'./chunk-CtkiOUdU.js';import'./chunk-S8F5_Te_.js';import'./chunk-tTmeIHGS.js';var V=()=>[];function F(n,t){if(n&1){let o=gC();ws(0,"agentos-ai-model-item",4),Rg("editRequested",function(e){wf(o);let s=EC(2);return Cf(s.onEdit(e))})("deleteRequested",function(e){wf(o);let s=EC(2);return Cf(s.deleteModel(e))}),hl();}n&2&&bg("model",t);}function O(n,t){if(n&1&&oC(0,F,1,1,"agentos-ai-model-item",3),n&2){let o,i=t.$implicit,e=EC();iC((o=e.resolveModel(i.id))?0:-1,o);}}var S=class n{router=g(G);destroyRef=g(we);aiModelController=g(M);aiProviderController=g($);refresh$=new Tr(void 0);isLoading=Gi(true);data$=this.refresh$.pipe(Da(()=>(this.isLoading.set(true),jy([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")]))));modelItems$=this.data$.pipe(ue(([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=Fw({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&&(ws(0,"ds-entity-list",1),dT(1,"async"),Rg("createRequested",function(){return i.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return i.goBack()}),hl()(),Eg(3,O,1,1,"ng-template",null,0,mT)),o&2){let e=MC(4);bg("items",pT(1,4,i.modelItems$)??aT(6,V))("loading",i.isLoading())("showCreate",true)("itemTemplate",e);}},dependencies:[Wn,I,Se,Ob],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 +1 @@
1
- import {d}from'./chunk-uPxETzZs.js';import {g,ao as V,G as G$1,w as we,d8 as B$1,z as zi,c as U$1,h as Rw,s as si,I as Is,A as Ag,q as qC,m as pl,t as tC,J as JE,T as Tg,v as nC,a8 as Zg,H as Hg,a5 as vl,a9 as fC,ac as yC,C as Cg,o as iC,x as sC,n as bg,bf as cT,bg as lT,aa as If,ab as wf,bj as cE}from'./main-6K2UFGD2.js';import'./chunk-nWqZHM4o.js';import'./chunk-l0HLnBLv.js';import'./chunk-DTIhOEG_.js';import'./chunk-C9tuHQmZ.js';var F=(n,o)=>o.name;function B(n,o){n&1&&(Is(0,"p",6),qC(1,"Loading\u2026"),pl());}function $(n,o){n&1&&(Is(0,"p",7),qC(1,"Failed to load agent definition."),pl());}function j(n,o){if(n&1&&(Is(0,"dt",12),qC(1,"User context"),pl(),Is(2,"dd",14),qC(3),pl()),n&2){let e=yC();JE(3),Zg(e.userId);}}function H(n,o){if(n&1&&(Is(0,"pre",21),qC(1),pl()),n&2){let e=yC(2);JE(),Zg(e.systemPrompt);}}function J(n,o){if(n&1){let e=fC();Is(0,"section",9)(1,"button",19),Ag("click",function(){If(e);let g=yC(2);return wf(g.toggleSystemPrompt())}),Is(2,"h2",10),qC(3,"System Prompt"),pl(),Is(4,"span",20),qC(5," \u25BC "),pl()(),tC(6,H,2,1,"pre",21),pl();}if(n&2){let e=yC(2);JE(),Cg("aria-expanded",!e.systemPromptCollapsed()),JE(3),Hg("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),JE(2),nC(e.systemPromptCollapsed()?-1:6);}}function U(n,o){if(n&1&&(Is(0,"pre",21),qC(1),pl()),n&2){let e=yC(2);JE(),Zg(e.instructions);}}function G(n,o){if(n&1){let e=fC();Is(0,"section",9)(1,"button",19),Ag("click",function(){If(e);let g=yC(2);return wf(g.toggleInstructions())}),Is(2,"h2",10),qC(3,"Instructions"),pl(),Is(4,"span",20),qC(5," \u25BC "),pl()(),tC(6,U,2,1,"pre",21),pl();}if(n&2){let e=yC(2);JE(),Cg("aria-expanded",!e.instructionsCollapsed()),JE(3),Hg("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),JE(2),nC(e.instructionsCollapsed()?-1:6);}}function q(n,o){n&1&&(Is(0,"p",17),qC(1,"No tools available for this agent."),pl());}function K(n,o){if(n&1&&(bg(0,"div",26),cT(1,"agentosMarkdown")),n&2){let e=yC(2).$implicit;Tg("innerHTML",lT(1,1,e.description),cE);}}function Q(n,o){if(n&1&&(Is(0,"div",25),tC(1,K,2,3,"div",26),Is(2,"pre",27),qC(3),pl()()),n&2){let e=yC().$implicit,c=yC(3);JE(),nC(e.description?1:-1),JE(2),Zg(c.formatSchema(e.inputSchema));}}function W(n,o){if(n&1){let e=fC();Is(0,"li",22)(1,"button",23),Ag("click",function(){let g=If(e).$implicit,V=yC(3);return wf(V.toggleTool(g))}),Is(2,"span",24),qC(3),pl(),Is(4,"span",20),qC(5," \u25BC "),pl()(),tC(6,Q,4,2,"div",25),pl();}if(n&2){let e=o.$implicit,c=yC(3);JE(),Cg("aria-expanded",c.isToolExpanded(e)),JE(2),Zg(e.name),JE(),Hg("agent-config-inspect__chevron--open",c.isToolExpanded(e)),JE(2),nC(c.isToolExpanded(e)?6:-1);}}function X(n,o){if(n&1&&(Is(0,"ul",18),iC(1,W,7,5,"li",22,F),pl()),n&2){let e=yC();JE(),sC(e.tools);}}function Y(n,o){if(n&1&&(Is(0,"div",8)(1,"section",9)(2,"h2",10),qC(3,"General"),pl(),Is(4,"dl",11)(5,"dt",12),qC(6,"Name"),pl(),Is(7,"dd",13),qC(8),pl(),Is(9,"dt",12),qC(10,"Resolved model"),pl(),Is(11,"dd",14),qC(12),pl(),Is(13,"dt",12),qC(14,"Provider"),pl(),Is(15,"dd",13),qC(16),pl(),Is(17,"dt",12),qC(18,"Advanced execution"),pl(),Is(19,"dd",13)(20,"span",15),qC(21),pl()(),tC(22,j,4,1),pl()(),tC(23,J,7,4,"section",9),tC(24,G,7,4,"section",9),Is(25,"section",9)(26,"h2",10),qC(27," Tools "),Is(28,"span",16),qC(29),pl()(),tC(30,q,2,0,"p",17)(31,X,3,0,"ul",18),pl()()),n&2){let e=o;JE(8),Zg(e.name),JE(4),Zg(e.resolvedModelApiName),JE(4),Zg(e.resolvedProviderName),JE(4),Hg("agent-config-inspect__badge--active",e.advancedExecution),JE(),vl(" ",e.advancedExecution?"Enabled":"Disabled"," "),JE(),nC(e.userId?22:-1),JE(),nC(e.systemPrompt?23:-1),JE(),nC(e.instructions?24:-1),JE(5),vl("(",e.tools.length,")"),JE(),nC(e.tools.length===0?30:31);}}var R=class n{route=g(V);router=g(G$1);destroyRef=g(we);agentConfigController=g(B$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=zi(true);hasError=zi(false);definition=zi(null);expandedTools=zi(new Set);systemPromptCollapsed=zi(true);instructionsCollapsed=zi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c});}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o);}toggleInstructions(){this.instructionsCollapsed.update(o=>!o);}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Rw({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(Is(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return c.back()}),Is(3,"span",3),qC(4,"\u2190"),pl(),qC(5," Agent Configs "),pl(),Is(6,"h1",4),qC(7,"Agent definition"),pl(),Is(8,"a",5),qC(9,"Edit config \u2192"),pl()(),tC(10,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),pl()),e&2){let g;JE(8),Tg("routerLink",c.editRoute()),JE(2),nC(c.isLoading()?10:c.hasError()?11:(g=c.definition())?12:-1,g);}},dependencies:[si,d],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__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}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"]})};export{R as AgentConfigInspectComponent};
1
+ import {d}from'./chunk-BY7uKZAo.js';import {g,ao as V,G as G$1,w as we,d8 as B$1,a as Gi,c as U$1,h as Fw,s as si,m as ws,o as Rg,Q as QC,n as hl,q as oC,t as nI,v as bg,x as iC,a8 as Yg,A as Ug,a5 as Dl,a9 as gC,ac as EC,T as Tg,r as cC,y as uC,S as Sg,bf as dT,bg as pT,aa as wf,ab as Cf,bj as dE}from'./main-5PAOSHSM.js';import'./chunk-kvCfAm7Z.js';import'./chunk-CtkiOUdU.js';import'./chunk-S8F5_Te_.js';import'./chunk-tTmeIHGS.js';var F=(n,o)=>o.name;function B(n,o){n&1&&(ws(0,"p",6),QC(1,"Loading\u2026"),hl());}function $(n,o){n&1&&(ws(0,"p",7),QC(1,"Failed to load agent definition."),hl());}function j(n,o){if(n&1&&(ws(0,"dt",12),QC(1,"User context"),hl(),ws(2,"dd",14),QC(3),hl()),n&2){let e=EC();nI(3),Yg(e.userId);}}function H(n,o){if(n&1&&(ws(0,"pre",21),QC(1),hl()),n&2){let e=EC(2);nI(),Yg(e.systemPrompt);}}function J(n,o){if(n&1){let e=gC();ws(0,"section",9)(1,"button",19),Rg("click",function(){wf(e);let g=EC(2);return Cf(g.toggleSystemPrompt())}),ws(2,"h2",10),QC(3,"System Prompt"),hl(),ws(4,"span",20),QC(5," \u25BC "),hl()(),oC(6,H,2,1,"pre",21),hl();}if(n&2){let e=EC(2);nI(),Tg("aria-expanded",!e.systemPromptCollapsed()),nI(3),Ug("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),nI(2),iC(e.systemPromptCollapsed()?-1:6);}}function U(n,o){if(n&1&&(ws(0,"pre",21),QC(1),hl()),n&2){let e=EC(2);nI(),Yg(e.instructions);}}function G(n,o){if(n&1){let e=gC();ws(0,"section",9)(1,"button",19),Rg("click",function(){wf(e);let g=EC(2);return Cf(g.toggleInstructions())}),ws(2,"h2",10),QC(3,"Instructions"),hl(),ws(4,"span",20),QC(5," \u25BC "),hl()(),oC(6,U,2,1,"pre",21),hl();}if(n&2){let e=EC(2);nI(),Tg("aria-expanded",!e.instructionsCollapsed()),nI(3),Ug("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),nI(2),iC(e.instructionsCollapsed()?-1:6);}}function q(n,o){n&1&&(ws(0,"p",17),QC(1,"No tools available for this agent."),hl());}function K(n,o){if(n&1&&(Sg(0,"div",26),dT(1,"agentosMarkdown")),n&2){let e=EC(2).$implicit;bg("innerHTML",pT(1,1,e.description),dE);}}function Q(n,o){if(n&1&&(ws(0,"div",25),oC(1,K,2,3,"div",26),ws(2,"pre",27),QC(3),hl()()),n&2){let e=EC().$implicit,c=EC(3);nI(),iC(e.description?1:-1),nI(2),Yg(c.formatSchema(e.inputSchema));}}function W(n,o){if(n&1){let e=gC();ws(0,"li",22)(1,"button",23),Rg("click",function(){let g=wf(e).$implicit,V=EC(3);return Cf(V.toggleTool(g))}),ws(2,"span",24),QC(3),hl(),ws(4,"span",20),QC(5," \u25BC "),hl()(),oC(6,Q,4,2,"div",25),hl();}if(n&2){let e=o.$implicit,c=EC(3);nI(),Tg("aria-expanded",c.isToolExpanded(e)),nI(2),Yg(e.name),nI(),Ug("agent-config-inspect__chevron--open",c.isToolExpanded(e)),nI(2),iC(c.isToolExpanded(e)?6:-1);}}function X(n,o){if(n&1&&(ws(0,"ul",18),cC(1,W,7,5,"li",22,F),hl()),n&2){let e=EC();nI(),uC(e.tools);}}function Y(n,o){if(n&1&&(ws(0,"div",8)(1,"section",9)(2,"h2",10),QC(3,"General"),hl(),ws(4,"dl",11)(5,"dt",12),QC(6,"Name"),hl(),ws(7,"dd",13),QC(8),hl(),ws(9,"dt",12),QC(10,"Resolved model"),hl(),ws(11,"dd",14),QC(12),hl(),ws(13,"dt",12),QC(14,"Provider"),hl(),ws(15,"dd",13),QC(16),hl(),ws(17,"dt",12),QC(18,"Advanced execution"),hl(),ws(19,"dd",13)(20,"span",15),QC(21),hl()(),oC(22,j,4,1),hl()(),oC(23,J,7,4,"section",9),oC(24,G,7,4,"section",9),ws(25,"section",9)(26,"h2",10),QC(27," Tools "),ws(28,"span",16),QC(29),hl()(),oC(30,q,2,0,"p",17)(31,X,3,0,"ul",18),hl()()),n&2){let e=o;nI(8),Yg(e.name),nI(4),Yg(e.resolvedModelApiName),nI(4),Yg(e.resolvedProviderName),nI(4),Ug("agent-config-inspect__badge--active",e.advancedExecution),nI(),Dl(" ",e.advancedExecution?"Enabled":"Disabled"," "),nI(),iC(e.userId?22:-1),nI(),iC(e.systemPrompt?23:-1),nI(),iC(e.instructions?24:-1),nI(5),Dl("(",e.tools.length,")"),nI(),iC(e.tools.length===0?30:31);}}var R=class n{route=g(V);router=g(G$1);destroyRef=g(we);agentConfigController=g(B$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Gi(true);hasError=Gi(false);definition=Gi(null);expandedTools=Gi(new Set);systemPromptCollapsed=Gi(true);instructionsCollapsed=Gi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c});}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o);}toggleInstructions(){this.instructionsCollapsed.update(o=>!o);}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Fw({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return c.back()}),ws(3,"span",3),QC(4,"\u2190"),hl(),QC(5," Agent Configs "),hl(),ws(6,"h1",4),QC(7,"Agent definition"),hl(),ws(8,"a",5),QC(9,"Edit config \u2192"),hl()(),oC(10,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),hl()),e&2){let g;nI(8),bg("routerLink",c.editRoute()),nI(2),iC(c.isLoading()?10:c.hasError()?11:(g=c.definition())?12:-1,g);}},dependencies:[si,d],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__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}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"]})};export{R as AgentConfigInspectComponent};
@@ -1 +1 @@
1
- import {g,M as dy,P,X as br,u as ue,Y as x}from'./main-6K2UFGD2.js';var d=class i{http=g(dy);projectState=g(P);promptsCache=new Map;getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let r=this.promptsCache.get(t);return r?br(this.filterPromptsForAutocomplete(r,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(ue(p=>(this.promptsCache.set(t,p),this.filterPromptsForAutocomplete(p,e))))}filterPromptsForAutocomplete(t,e){let r=e.toLowerCase();return t.filter(o=>o.name.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)).map(o=>({name:o.name,description:o.description,parameterFormat:o.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear();}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(ue(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(ue(r=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),r)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(ue(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})};export{d};
1
+ import {g,I as fy,P,X as br,u as ue,Y as x}from'./main-5PAOSHSM.js';var d=class i{http=g(fy);projectState=g(P);promptsCache=new Map;getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let r=this.promptsCache.get(t);return r?br(this.filterPromptsForAutocomplete(r,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(ue(p=>(this.promptsCache.set(t,p),this.filterPromptsForAutocomplete(p,e))))}filterPromptsForAutocomplete(t,e){let r=e.toLowerCase();return t.filter(o=>o.name.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)).map(o=>({name:o.name,description:o.description,parameterFormat:o.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear();}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(ue(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(ue(r=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),r)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(ue(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})};export{d};
@@ -1 +1 @@
1
- import {i}from'./chunk-DXDohTwX.js';import {l}from'./chunk-uPxETzZs.js';import {g,d7 as U,di as ce,aJ as Tr,aD as Ly,bS as va,a7 as ya,X as br,u as ue,cE as Rd,bU as Od,Y as x}from'./main-6K2UFGD2.js';var y="none",O="me",N=class f{nsController=g(U);exportService=g(ce);userState=g(l);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(va(([e])=>{let n=this.loadPlatformConfigs().pipe(ya(()=>br([]))),t=this.loadUserConfigs("global").pipe(ya(()=>br([])));return e?Ly([n,this.loadNamespaceConfigs(e).pipe(ya(()=>br([]))),this.loadUserConfigs(e).pipe(ya(()=>br([]))),t]).pipe(ue(([i,r,c,s])=>({platform:i,namespace:r,userOnNs:c,userGlobal:s}))):Ly([n,t]).pipe(ue(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),Rd({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(y)}loadUserConfigs(e){let n=e==="global"?y:e;return this.nsController.listIntegrationConfig(n,O)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):br([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let s={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(s).pipe(Od(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let s={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(s).pipe(Od(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(c).pipe(Od(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0};return this.nsController.updateIntegrationConfig(e,r).pipe(Od(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(Od(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||f)};static \u0275prov=x({token:f,factory:f.\u0275fac,providedIn:"root"})};export{N};
1
+ import {i}from'./chunk-BEUXx3TO.js';import {l}from'./chunk-BY7uKZAo.js';import {g,d7 as U,di as pe,aJ as Tr,aD as jy,bS as Da,a7 as va,X as br,u as ue,cE as Od,bU as kd,Y as x}from'./main-5PAOSHSM.js';var y="none",O="me",N=class f{nsController=g(U);exportService=g(pe);userState=g(l);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=jy([this.namespaceId$,this.refresh$]).pipe(Da(([e])=>{let n=this.loadPlatformConfigs().pipe(va(()=>br([]))),t=this.loadUserConfigs("global").pipe(va(()=>br([])));return e?jy([n,this.loadNamespaceConfigs(e).pipe(va(()=>br([]))),this.loadUserConfigs(e).pipe(va(()=>br([]))),t]).pipe(ue(([i,r,c,s])=>({platform:i,namespace:r,userOnNs:c,userGlobal:s}))):jy([n,t]).pipe(ue(([i,r])=>({platform:i,namespace:[],userOnNs:[],userGlobal:r})))}),Od({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadPlatformConfigs(){return this.nsController.listIntegrationConfig(y)}loadUserConfigs(e){let n=e==="global"?y:e;return this.nsController.listIntegrationConfig(n,O)}userGlobal$=i(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):br([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let r=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!r)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="platform"){let s={name:e.name,integrationType:e.integrationType,description:e.description,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(s).pipe(kd(()=>this.refresh()))}if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let s={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(s).pipe(kd(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let c={name:e.name,integrationType:e.integrationType,description:e.description,userId:r,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters,authSettingName:e.authSettingName??void 0};return this.nsController.createIntegrationConfig(c).pipe(kd(()=>this.refresh()))}update(e,n,t,i){let r={name:n.name,integrationType:n.integrationType,description:n.description,userId:i.userId,namespaceId:i.namespaceId,parameters:n.parameters,authSettingName:n.authSettingName??void 0};return this.nsController.updateIntegrationConfig(e,r).pipe(kd(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(kd(()=>this.refresh()))}exportAsYaml(e){return this.exportService.exportAsYaml(e)}static \u0275fac=function(n){return new(n||f)};static \u0275prov=x({token:f,factory:f.\u0275fac,providedIn:"root"})};export{N};
@@ -1 +1 @@
1
- import {g,G,cb as TB,cc as CB,z as zi,h as Rw,I as Is,q as qC,m as pl,t as tC,H as Hg,J as JE,a8 as Zg,v as nC,ac as yC,a9 as fC,A as Ag,T as Tg,aa as If,ab as wf}from'./main-6K2UFGD2.js';import {Z as Zn,S as Se}from'./chunk-l0HLnBLv.js';function k(t,r){if(t&1&&(Is(0,"span",3),qC(1),pl()),t&2){let e=yC();JE(),Zg(e.prompt().description);}}function S(t,r){if(t&1){let e=fC();Is(0,"span",6),qC(1,"Delete?"),pl(),Is(2,"ds-icon-button",7),Ag("action",function(){If(e);let m=yC();return wf(m.onDeleteConfirmed())}),pl(),Is(3,"ds-icon-button",8),Ag("action",function(){If(e);let m=yC();return wf(m.onDeleteCancelled())}),pl();}}function E(t,r){if(t&1){let e=fC();Is(0,"ds-kebab-menu",9),Ag("itemSelected",function(m){If(e);let O=yC();return wf(O.onMenuAction(m))}),pl();}if(t&2){let e=yC();Tg("items",e.menuItems);}}var I=class t{router=g(G);prompt=TB.required();namespaceId=TB(void 0);platformMode=TB(false);readOnly=TB(false);deleteRequested=CB();pendingDelete=zi(false);menuItems=[{key:"edit",label:"Edit prompt",icon:"edit"},{key:"delete",label:"Delete prompt",icon:"delete",variant:"danger"}];onMenuAction(r){switch(r){case "edit":this.platformMode()?this.router.navigate(["/agentos","admin","prompts",this.prompt().id,"edit"]):this.router.navigate(["/agentos",this.namespaceId(),"prompts",this.prompt().id,"edit"]);break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.prompt());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Rw({type:t,selectors:[["agentos-prompt-item"]],inputs:{prompt:[1,"prompt"],namespaceId:[1,"namespaceId"],platformMode:[1,"platformMode"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested"},decls:8,vars:5,consts:[["role","listitem",1,"prompt-item"],[1,"prompt-item__body"],[1,"prompt-item__name"],[1,"prompt-item__description"],[1,"prompt-item__actions"],[3,"items"],[1,"prompt-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,o){e&1&&(Is(0,"div",0)(1,"div",1)(2,"span",2),qC(3),pl(),tC(4,k,2,1,"span",3),pl(),Is(5,"div",4),tC(6,S,4,0)(7,E,1,1,"ds-kebab-menu",5),pl()()),e&2&&(Hg("prompt-item--pending-delete",o.pendingDelete()),JE(3),Zg(o.prompt().name),JE(),nC(o.prompt().description?4:-1),JE(2),nC(o.pendingDelete()?6:o.readOnly()?-1:7));},dependencies:[Zn,Se],styles:[".prompt-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.prompt-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.prompt-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prompt-item__description[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prompt-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.prompt-item[_ngcontent-%COMP%]:hover .prompt-item__actions[_ngcontent-%COMP%], .prompt-item[_ngcontent-%COMP%]:focus-within .prompt-item__actions[_ngcontent-%COMP%], .prompt-item--pending-delete[_ngcontent-%COMP%] .prompt-item__actions[_ngcontent-%COMP%]{opacity:1}.prompt-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"]})};export{I};
1
+ import {g,G,cb as LB,cc as PB,a as Gi,h as Fw,m as ws,Q as QC,n as hl,q as oC,A as Ug,t as nI,a8 as Yg,x as iC,ac as EC,a9 as gC,o as Rg,v as bg,aa as wf,ab as Cf}from'./main-5PAOSHSM.js';import {Z as Zn,S as Se}from'./chunk-CtkiOUdU.js';function k(t,r){if(t&1&&(ws(0,"span",3),QC(1),hl()),t&2){let e=EC();nI(),Yg(e.prompt().description);}}function S(t,r){if(t&1){let e=gC();ws(0,"span",6),QC(1,"Delete?"),hl(),ws(2,"ds-icon-button",7),Rg("action",function(){wf(e);let m=EC();return Cf(m.onDeleteConfirmed())}),hl(),ws(3,"ds-icon-button",8),Rg("action",function(){wf(e);let m=EC();return Cf(m.onDeleteCancelled())}),hl();}}function E(t,r){if(t&1){let e=gC();ws(0,"ds-kebab-menu",9),Rg("itemSelected",function(m){wf(e);let O=EC();return Cf(O.onMenuAction(m))}),hl();}if(t&2){let e=EC();bg("items",e.menuItems);}}var I=class t{router=g(G);prompt=LB.required();namespaceId=LB(void 0);platformMode=LB(false);readOnly=LB(false);deleteRequested=PB();pendingDelete=Gi(false);menuItems=[{key:"edit",label:"Edit prompt",icon:"edit"},{key:"delete",label:"Delete prompt",icon:"delete",variant:"danger"}];onMenuAction(r){switch(r){case "edit":this.platformMode()?this.router.navigate(["/agentos","admin","prompts",this.prompt().id,"edit"]):this.router.navigate(["/agentos",this.namespaceId(),"prompts",this.prompt().id,"edit"]);break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.prompt());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=Fw({type:t,selectors:[["agentos-prompt-item"]],inputs:{prompt:[1,"prompt"],namespaceId:[1,"namespaceId"],platformMode:[1,"platformMode"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested"},decls:8,vars:5,consts:[["role","listitem",1,"prompt-item"],[1,"prompt-item__body"],[1,"prompt-item__name"],[1,"prompt-item__description"],[1,"prompt-item__actions"],[3,"items"],[1,"prompt-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,o){e&1&&(ws(0,"div",0)(1,"div",1)(2,"span",2),QC(3),hl(),oC(4,k,2,1,"span",3),hl(),ws(5,"div",4),oC(6,S,4,0)(7,E,1,1,"ds-kebab-menu",5),hl()()),e&2&&(Ug("prompt-item--pending-delete",o.pendingDelete()),nI(3),Yg(o.prompt().name),nI(),iC(o.prompt().description?4:-1),nI(2),iC(o.pendingDelete()?6:o.readOnly()?-1:7));},dependencies:[Zn,Se],styles:[".prompt-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.prompt-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.prompt-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prompt-item__description[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.prompt-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.prompt-item[_ngcontent-%COMP%]:hover .prompt-item__actions[_ngcontent-%COMP%], .prompt-item[_ngcontent-%COMP%]:focus-within .prompt-item__actions[_ngcontent-%COMP%], .prompt-item--pending-delete[_ngcontent-%COMP%] .prompt-item__actions[_ngcontent-%COMP%]{opacity:1}.prompt-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"]})};export{I};
@@ -1 +1 @@
1
- import {g,G,cb as TB,cc as CB,z as zi,da as Ce,dk as me,h as Rw,I as Is,q as qC,m as pl,t as tC,J as JE,a8 as Zg,H as Hg,a5 as vl,v as nC,ac as yC,a9 as fC,A as Ag,T as Tg,aa as If,ab as wf}from'./main-6K2UFGD2.js';import {Z as Zn,S as Se}from'./chunk-l0HLnBLv.js';function L(n,t){if(n&1&&(Is(0,"span",5),qC(1),pl()),n&2){let e=yC();JE(),Zg(e.definition().description);}}function q(n,t){if(n&1&&(Is(0,"span",7),qC(1),pl()),n&2){let e=yC();JE(),vl("Next: ",e.nextRunLabel);}}function U(n,t){if(n&1&&(Is(0,"span",8),qC(1),pl()),n&2){let e=yC();JE(),vl("Last run: ",e.lastRunLabel);}}function $(n,t){if(n&1){let e=fC();Is(0,"span",12),qC(1,"Delete?"),pl(),Is(2,"ds-icon-button",13),Ag("action",function(){If(e);let a=yC(2);return wf(a.onDeleteConfirmed())}),pl(),Is(3,"ds-icon-button",14),Ag("action",function(){If(e);let a=yC(2);return wf(a.onDeleteCancelled())}),pl();}}function N(n,t){if(n&1){let e=fC();Is(0,"ds-kebab-menu",15),Ag("itemSelected",function(a){If(e);let p=yC(2);return wf(p.onMenuAction(a))}),pl();}if(n&2){let e=yC(2);Tg("items",e.menuItems);}}function V(n,t){if(n&1&&(Is(0,"div",10),tC(1,$,4,0)(2,N,1,1,"ds-kebab-menu",11),pl()),n&2){let e=yC();Hg("scheduled-prompt-item__actions--confirming",e.pendingDelete()),JE(),nC(e.pendingDelete()?1:2);}}var R=class n{router=g(G);definition=TB.required();namespaceId=TB(void 0);platformMode=TB(false);readOnly=TB(false);enableRequested=CB();disableRequested=CB();deleteRequested=CB();pendingDelete=zi(false);get scheduleLabel(){let{recurrence:t}=this.definition(),e=t.unit,i=t.timeUtc,a=e===Ce.WEEK?"week":"month",p=e===Ce.WEEK&&t.days?.length?` (${t.days.map(_=>me[_]??_).join(", ")})`:"";return `Every ${a}${p} at ${i} UTC`}formatInstant(t){if(!t)return null;let e=new Date(t),i=e.getUTCDate(),a=e.toLocaleString("en-GB",{month:"short",timeZone:"UTC"}),p=e.getUTCFullYear(),_=String(e.getUTCHours()).padStart(2,"0"),T=String(e.getUTCMinutes()).padStart(2,"0");return `${i} ${a} ${p} at ${_}:${T} UTC`}get nextRunLabel(){return this.formatInstant(this.definition().nextRunAt)}get lastRunLabel(){return this.formatInstant(this.definition().lastRunAt)}get menuItems(){let t=this.definition();return [{key:"edit",label:"Edit scheduled prompt",icon:"edit"},{key:"toggle",label:t.enabled?"Disable":"Enable",icon:t.enabled?"toggle_on":"toggle_off"},{key:"delete",label:"Delete scheduled prompt",icon:"delete",variant:"danger"}]}onMenuAction(t){let e=this.definition();switch(t){case "edit":this.platformMode()?this.router.navigate(["/agentos","admin","scheduled-prompts",e.id,"edit"]):this.router.navigate(["/agentos",this.namespaceId(),"scheduled-prompts",e.id,"edit"]);break;case "toggle":e.enabled?this.disableRequested.emit(e):this.enableRequested.emit(e);break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.definition());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Rw({type:n,selectors:[["agentos-scheduled-prompt-item"]],inputs:{definition:[1,"definition"],namespaceId:[1,"namespaceId"],platformMode:[1,"platformMode"],readOnly:[1,"readOnly"]},outputs:{enableRequested:"enableRequested",disableRequested:"disableRequested",deleteRequested:"deleteRequested"},decls:13,vars:11,consts:[["role","listitem",1,"scheduled-prompt-item"],[1,"scheduled-prompt-item__body"],[1,"scheduled-prompt-item__header"],[1,"scheduled-prompt-item__name"],[1,"scheduled-prompt-item__status"],[1,"scheduled-prompt-item__description"],[1,"scheduled-prompt-item__schedule"],[1,"scheduled-prompt-item__next-run"],[1,"scheduled-prompt-item__last-run"],[1,"scheduled-prompt-item__actions",3,"scheduled-prompt-item__actions--confirming"],[1,"scheduled-prompt-item__actions"],[3,"items"],[1,"scheduled-prompt-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,i){e&1&&(Is(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),qC(4),pl(),Is(5,"span",4),qC(6),pl()(),tC(7,L,2,1,"span",5),Is(8,"span",6),qC(9),pl(),tC(10,q,2,1,"span",7),tC(11,U,2,1,"span",8),pl(),tC(12,V,3,3,"div",9),pl()),e&2&&(JE(4),Zg(i.definition().name),JE(),Hg("scheduled-prompt-item__status--enabled",i.definition().enabled)("scheduled-prompt-item__status--disabled",!i.definition().enabled),JE(),vl(" ",i.definition().enabled?"Enabled":"Disabled"," "),JE(),nC(i.definition().description?7:-1),JE(2),Zg(i.scheduleLabel),JE(),nC(i.nextRunLabel?10:-1),JE(),nC(i.lastRunLabel?11:-1),JE(),nC(i.readOnly()?-1:12));},dependencies:[Zn,Se],styles:[".scheduled-prompt-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.scheduled-prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.scheduled-prompt-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.scheduled-prompt-item__header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.scheduled-prompt-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.scheduled-prompt-item__status[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600;padding:.15rem .5rem;border-radius:999px;white-space:nowrap;flex-shrink:0;text-transform:uppercase;letter-spacing:.04em}.scheduled-prompt-item__status--enabled[_ngcontent-%COMP%]{background:var(--color-success-bg, rgba(52, 199, 89, .12));color:var(--color-success, #34c759)}.scheduled-prompt-item__status--disabled[_ngcontent-%COMP%]{background:var(--color-warning-bg, rgba(255, 159, 10, .12));color:var(--color-warning, #ff9f0a)}.scheduled-prompt-item__description[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__schedule[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__next-run[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__last-run[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.scheduled-prompt-item[_ngcontent-%COMP%]:hover .scheduled-prompt-item__actions[_ngcontent-%COMP%], .scheduled-prompt-item[_ngcontent-%COMP%]:focus-within .scheduled-prompt-item__actions[_ngcontent-%COMP%]{opacity:1}.scheduled-prompt-item__actions--confirming[_ngcontent-%COMP%]{opacity:1}.scheduled-prompt-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"]})};export{R};
1
+ import {g,G,cb as LB,cc as PB,a as Gi,da as Ce,dk as me,h as Fw,m as ws,Q as QC,n as hl,q as oC,t as nI,a8 as Yg,A as Ug,a5 as Dl,x as iC,ac as EC,a9 as gC,o as Rg,v as bg,aa as wf,ab as Cf}from'./main-5PAOSHSM.js';import {Z as Zn,S as Se}from'./chunk-CtkiOUdU.js';function L(n,t){if(n&1&&(ws(0,"span",5),QC(1),hl()),n&2){let e=EC();nI(),Yg(e.definition().description);}}function q(n,t){if(n&1&&(ws(0,"span",7),QC(1),hl()),n&2){let e=EC();nI(),Dl("Next: ",e.nextRunLabel);}}function U(n,t){if(n&1&&(ws(0,"span",8),QC(1),hl()),n&2){let e=EC();nI(),Dl("Last run: ",e.lastRunLabel);}}function $(n,t){if(n&1){let e=gC();ws(0,"span",12),QC(1,"Delete?"),hl(),ws(2,"ds-icon-button",13),Rg("action",function(){wf(e);let a=EC(2);return Cf(a.onDeleteConfirmed())}),hl(),ws(3,"ds-icon-button",14),Rg("action",function(){wf(e);let a=EC(2);return Cf(a.onDeleteCancelled())}),hl();}}function N(n,t){if(n&1){let e=gC();ws(0,"ds-kebab-menu",15),Rg("itemSelected",function(a){wf(e);let p=EC(2);return Cf(p.onMenuAction(a))}),hl();}if(n&2){let e=EC(2);bg("items",e.menuItems);}}function V(n,t){if(n&1&&(ws(0,"div",10),oC(1,$,4,0)(2,N,1,1,"ds-kebab-menu",11),hl()),n&2){let e=EC();Ug("scheduled-prompt-item__actions--confirming",e.pendingDelete()),nI(),iC(e.pendingDelete()?1:2);}}var R=class n{router=g(G);definition=LB.required();namespaceId=LB(void 0);platformMode=LB(false);readOnly=LB(false);enableRequested=PB();disableRequested=PB();deleteRequested=PB();pendingDelete=Gi(false);get scheduleLabel(){let{recurrence:t}=this.definition(),e=t.unit,i=t.timeUtc,a=e===Ce.WEEK?"week":"month",p=e===Ce.WEEK&&t.days?.length?` (${t.days.map(_=>me[_]??_).join(", ")})`:"";return `Every ${a}${p} at ${i} UTC`}formatInstant(t){if(!t)return null;let e=new Date(t),i=e.getUTCDate(),a=e.toLocaleString("en-GB",{month:"short",timeZone:"UTC"}),p=e.getUTCFullYear(),_=String(e.getUTCHours()).padStart(2,"0"),T=String(e.getUTCMinutes()).padStart(2,"0");return `${i} ${a} ${p} at ${_}:${T} UTC`}get nextRunLabel(){return this.formatInstant(this.definition().nextRunAt)}get lastRunLabel(){return this.formatInstant(this.definition().lastRunAt)}get menuItems(){let t=this.definition();return [{key:"edit",label:"Edit scheduled prompt",icon:"edit"},{key:"toggle",label:t.enabled?"Disable":"Enable",icon:t.enabled?"toggle_on":"toggle_off"},{key:"delete",label:"Delete scheduled prompt",icon:"delete",variant:"danger"}]}onMenuAction(t){let e=this.definition();switch(t){case "edit":this.platformMode()?this.router.navigate(["/agentos","admin","scheduled-prompts",e.id,"edit"]):this.router.navigate(["/agentos",this.namespaceId(),"scheduled-prompts",e.id,"edit"]);break;case "toggle":e.enabled?this.disableRequested.emit(e):this.enableRequested.emit(e);break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.definition());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Fw({type:n,selectors:[["agentos-scheduled-prompt-item"]],inputs:{definition:[1,"definition"],namespaceId:[1,"namespaceId"],platformMode:[1,"platformMode"],readOnly:[1,"readOnly"]},outputs:{enableRequested:"enableRequested",disableRequested:"disableRequested",deleteRequested:"deleteRequested"},decls:13,vars:11,consts:[["role","listitem",1,"scheduled-prompt-item"],[1,"scheduled-prompt-item__body"],[1,"scheduled-prompt-item__header"],[1,"scheduled-prompt-item__name"],[1,"scheduled-prompt-item__status"],[1,"scheduled-prompt-item__description"],[1,"scheduled-prompt-item__schedule"],[1,"scheduled-prompt-item__next-run"],[1,"scheduled-prompt-item__last-run"],[1,"scheduled-prompt-item__actions",3,"scheduled-prompt-item__actions--confirming"],[1,"scheduled-prompt-item__actions"],[3,"items"],[1,"scheduled-prompt-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,i){e&1&&(ws(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),QC(4),hl(),ws(5,"span",4),QC(6),hl()(),oC(7,L,2,1,"span",5),ws(8,"span",6),QC(9),hl(),oC(10,q,2,1,"span",7),oC(11,U,2,1,"span",8),hl(),oC(12,V,3,3,"div",9),hl()),e&2&&(nI(4),Yg(i.definition().name),nI(),Ug("scheduled-prompt-item__status--enabled",i.definition().enabled)("scheduled-prompt-item__status--disabled",!i.definition().enabled),nI(),Dl(" ",i.definition().enabled?"Enabled":"Disabled"," "),nI(),iC(i.definition().description?7:-1),nI(2),Yg(i.scheduleLabel),nI(),iC(i.nextRunLabel?10:-1),nI(),iC(i.lastRunLabel?11:-1),nI(),iC(i.readOnly()?-1:12));},dependencies:[Zn,Se],styles:[".scheduled-prompt-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.scheduled-prompt-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.scheduled-prompt-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.scheduled-prompt-item__header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.scheduled-prompt-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.scheduled-prompt-item__status[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600;padding:.15rem .5rem;border-radius:999px;white-space:nowrap;flex-shrink:0;text-transform:uppercase;letter-spacing:.04em}.scheduled-prompt-item__status--enabled[_ngcontent-%COMP%]{background:var(--color-success-bg, rgba(52, 199, 89, .12));color:var(--color-success, #34c759)}.scheduled-prompt-item__status--disabled[_ngcontent-%COMP%]{background:var(--color-warning-bg, rgba(255, 159, 10, .12));color:var(--color-warning, #ff9f0a)}.scheduled-prompt-item__description[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__schedule[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__next-run[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__last-run[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scheduled-prompt-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.scheduled-prompt-item[_ngcontent-%COMP%]:hover .scheduled-prompt-item__actions[_ngcontent-%COMP%], .scheduled-prompt-item[_ngcontent-%COMP%]:focus-within .scheduled-prompt-item__actions[_ngcontent-%COMP%]{opacity:1}.scheduled-prompt-item__actions--confirming[_ngcontent-%COMP%]{opacity:1}.scheduled-prompt-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"]})};export{R};
@@ -1,4 +1,4 @@
1
- import {an as ce,g,L,ci as me,ap as Vy,av as dt$1,h as Rw,I as Is,q as qC,m as pl,ai as Jg,aj as XC,A as Ag,a3 as UI,n as bg,t as tC,o as iC,J as JE,ak as Xg,a6 as zI,T as Tg,v as nC,x as sC,a5 as vl,aL as Eo,aM as qn,aO as wt$1,az as Kt,aW as w,cj as Pn,ce as _b,c8 as KT,af as Dg,ag as pT,c9 as kf,ck as Ff,ch as Mg,r as bC,C as Cg,ad as Vg,b$ as PC,H as Hg,D as Fg,E as wC,K as CC,aJ as Tr,aG as fe,cl as be,p as pe,l as le,bU as Od,b9 as T,b8 as B,be as A,b7 as u,bd as h,cm as M,e as O,ba as v,bb as m,d as b,cn as F,f,V,bc as R,co as H,cp as K,ca as _e,Y as x,Z as z$1,_ as Ue,am as Gm,k as Gn,j as pr,a0 as jt,a2 as Nt,a1 as Vt,b0 as Yg,ac as yC}from'./main-6K2UFGD2.js';import {s as se}from'./chunk-BVCQOGLR.js';import {t as ti,Q as Qn,e as ei,Y as Ye$1,h as _n,A as At,m as mn,Z as Zn,c as cn,w as wt}from'./chunk-C9tuHQmZ.js';var Xe=["determinateSpinner"];function et(c,e){if(c&1&&(kf(),Is(0,"svg",11),bg(1,"circle",12),pl()),c&2){let t=yC();Cg("viewBox",t._viewBox()),JE(),Vg("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Cg("r",t._circleRadius());}}var tt=new w("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:qe})}),qe=100,nt=10,yt=(()=>{class c{_elementRef=g(Kt);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t;}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=g(tt),n=Pn(),i=this._elementRef.nativeElement;this._noopAnimations=n==="di-disabled"&&!!t&&!t._forceAnimations,this.mode=i.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&n==="reduced-motion"&&i.classList.add("mat-progress-spinner-reduced-motion"),t&&(t.color&&(this.color=this._defaultColor=t.color),t.diameter&&(this.diameter=t.diameter),t.strokeWidth&&(this.strokeWidth=t.strokeWidth));}mode;get value(){return this.mode==="determinate"?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0));}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0;}_diameter=qe;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0;}_strokeWidth;_circleRadius(){return (this.diameter-nt)/2}_viewBox(){let t=this._circleRadius()*2+this.strokeWidth;return `0 0 ${t} ${t}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(n){return new(n||c)};static \u0275cmp=Rw({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&Fg(Xe,5),n&2){let o;wC(o=CC())&&(i._determinateCircle=o.first);}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(n,i){n&2&&(Cg("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),PC("mat-"+i.color),Vg("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),Hg("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"));},inputs:{color:"color",mode:"mode",value:[2,"value","value",KT],diameter:[2,"diameter","diameter",KT],strokeWidth:[2,"strokeWidth","strokeWidth",KT]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(n,i){if(n&1&&(Dg(0,et,2,8,"ng-template",null,0,pT),Is(2,"div",2,1),kf(),Is(4,"svg",3),bg(5,"circle",4),pl()(),Ff(),Is(6,"div",5)(7,"div",6)(8,"div",7),Mg(9,8),pl(),Is(10,"div",9),Mg(11,8),pl(),Is(12,"div",10),Mg(13,8),pl()()()),n&2){let o=bC(1);JE(4),Cg("viewBox",i._viewBox()),JE(),Vg("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),Cg("r",i._circleRadius()),JE(4),Tg("ngTemplateOutlet",o),JE(2),Tg("ngTemplateOutlet",o),JE(2),Tg("ngTemplateOutlet",o);}},dependencies:[_b],styles:[`.mat-mdc-progress-spinner {
1
+ import {an as ce,g,L,ci as me,ap as Hy,av as dt$1,h as Fw,m as ws,Q as QC,n as hl,ai as em,aj as tT,o as Rg,a3 as GI,S as Sg,q as oC,r as cC,t as nI,ak as Jg,a6 as qI,v as bg,x as iC,y as uC,a5 as Dl,aL as Eo,aM as qn,aO as wt$1,az as Kt,aW as w,cj as Pn,ce as xb,c8 as eb,af as Eg,ag as mT,c9 as Ff,ck as Pf,ch as Ng,M as MC,T as Tg,ad as Hg,b$ as BC,A as Ug,C as Pg,D as bC,H as SC,aJ as Tr,aG as fe,cl as be,p as pe,l as le,bU as kd,b9 as T,b8 as B,be as A,b7 as u,bd as h,cm as M,e as O,ba as v,bb as m,d as b,cn as F,f,V,bc as R,co as H,cp as K,ca as _e,Y as x,Z as z$1,_ as Ue,am as Wm,k as Gn,j as pr,a0 as jt,a2 as Nt,a1 as Vt,b0 as Qg,ac as EC}from'./main-5PAOSHSM.js';import {s as se}from'./chunk-BSSDDOqW.js';import {t as ti,Q as Qn,e as ei,Y as Ye$1,h as _n,A as At,m as mn,Z as Zn,c as cn,w as wt}from'./chunk-tTmeIHGS.js';var Xe=["determinateSpinner"];function et(c,e){if(c&1&&(Ff(),ws(0,"svg",11),Sg(1,"circle",12),hl()),c&2){let t=EC();Tg("viewBox",t._viewBox()),nI(),Hg("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),Tg("r",t._circleRadius());}}var tt=new w("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:qe})}),qe=100,nt=10,yt=(()=>{class c{_elementRef=g(Kt);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t;}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=g(tt),n=Pn(),i=this._elementRef.nativeElement;this._noopAnimations=n==="di-disabled"&&!!t&&!t._forceAnimations,this.mode=i.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&n==="reduced-motion"&&i.classList.add("mat-progress-spinner-reduced-motion"),t&&(t.color&&(this.color=this._defaultColor=t.color),t.diameter&&(this.diameter=t.diameter),t.strokeWidth&&(this.strokeWidth=t.strokeWidth));}mode;get value(){return this.mode==="determinate"?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0));}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0;}_diameter=qe;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0;}_strokeWidth;_circleRadius(){return (this.diameter-nt)/2}_viewBox(){let t=this._circleRadius()*2+this.strokeWidth;return `0 0 ${t} ${t}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(n){return new(n||c)};static \u0275cmp=Fw({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&Pg(Xe,5),n&2){let o;bC(o=SC())&&(i._determinateCircle=o.first);}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(n,i){n&2&&(Tg("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),BC("mat-"+i.color),Hg("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),Ug("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"));},inputs:{color:"color",mode:"mode",value:[2,"value","value",eb],diameter:[2,"diameter","diameter",eb],strokeWidth:[2,"strokeWidth","strokeWidth",eb]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(n,i){if(n&1&&(Eg(0,et,2,8,"ng-template",null,0,mT),ws(2,"div",2,1),Ff(),ws(4,"svg",3),Sg(5,"circle",4),hl()(),Pf(),ws(6,"div",5)(7,"div",6)(8,"div",7),Ng(9,8),hl(),ws(10,"div",9),Ng(11,8),hl(),ws(12,"div",10),Ng(13,8),hl()()()),n&2){let o=MC(1);nI(4),Tg("viewBox",i._viewBox()),nI(),Hg("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),Tg("r",i._circleRadius()),nI(4),bg("ngTemplateOutlet",o),nI(2),bg("ngTemplateOutlet",o),nI(2),bg("ngTemplateOutlet",o);}},dependencies:[xb],styles:[`.mat-mdc-progress-spinner {
2
2
  --mat-progress-spinner-animation-multiplier: 1;
3
3
  display: block;
4
4
  overflow: hidden;
@@ -173,10 +173,10 @@ import {an as ce,g,L,ci as me,ap as Vy,av as dt$1,h as Rw,I as Is,q as qC,m as p
173
173
  transform: rotate(-265deg);
174
174
  }
175
175
  }
176
- `],encapsulation:2})}return c})();var Et=(()=>{class c{static \u0275fac=function(n){return new(n||c)};static \u0275mod=Eo({type:c});static \u0275inj=qn({imports:[wt$1]})}return c})();var z=class c{destroy$=new ce;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new Tr(false);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=g(L);constructor(){this.initializeSpeechSynthesis(),this.subscribeToPreferences();}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopSpeech();}initializeSpeechSynthesis(){if(!("speechSynthesis"in window)){console.warn("[VOICE-SERVICE] Speech synthesis not available"),this.voices=new Promise(e=>e([]));return}this.voices=new Promise((e,t)=>{let n=speechSynthesis.getVoices();if(n.length)e(n);else {let i=setTimeout(()=>{t("no voices found");},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let o=speechSynthesis.getVoices();o.length&&(clearTimeout(i),e(o));});}}),console.log("[VOICE-SERVICE] Speech synthesis initialized");}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(Vy(this.destroy$)).subscribe(e=>{this.volume=e,console.log("[VOICE-SERVICE] Volume updated to:",e);}),this.preferencesService.voiceRate$.pipe(Vy(this.destroy$)).subscribe(e=>{this.rate=e,console.log("[VOICE-SERVICE] Rate updated to:",e);}),this.preferencesService.voiceLanguage$.pipe(Vy(this.destroy$)).subscribe(e=>{this.language=e,console.log("[VOICE-SERVICE] Language updated to:",e),this.updateSelectedVoiceForLanguage();}),this.preferencesService.selectedVoice$.pipe(Vy(this.destroy$)).subscribe(e=>{this.setSelectedVoice(e);}),this.volume=this.preferencesService.getVoiceVolume(),this.rate=this.preferencesService.getVoiceRate(),this.language=this.preferencesService.getVoiceLanguage(),this.setSelectedVoice(this.preferencesService.getSelectedVoice());}isReady(){return "speechSynthesis"in window&&this.selectedVoice!==void 0}isSpeaking(){return speechSynthesis.speaking}speak(e,t){return dt$1(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),false;if(!e.trim())return console.warn("[VOICE-SERVICE] No text to speak"),false;let n=this.extractPlainText(e);if(!n.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),false;this.stopSpeech();try{let i=new SpeechSynthesisUtterance(n);i.voice=this.selectedVoice,i.lang=this.selectedVoice.lang,i.volume=this.volume,i.rate=this.rate,this.currentOnEndCallback=t||null,t&&(i.onend=()=>{this.currentOnEndCallback===t&&(this.currentOnEndCallback=null,t());},i.onerror=()=>{this.currentOnEndCallback===t&&(this.currentOnEndCallback=null,t());}),this.currentUtterance=i,this.speakingSubject.next(!0);let o=i.onend,E=i.onerror;return i.onend=C=>{this.speakingSubject.next(!1),o&&o.call(i,C);},i.onerror=C=>{this.speakingSubject.next(!1),E&&E.call(i,C);},speechSynthesis.speak(i),console.log("[VOICE-SERVICE] Started speaking:",e.substring(0,50)+"..."),!0}catch(i){return console.error("[VOICE-SERVICE] Error speaking:",i),false}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let e=this.currentOnEndCallback;this.currentOnEndCallback=null,e();}this.speakingSubject.next(false),console.log("[VOICE-SERVICE] Speech stopped");}}ding(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.connect(n),n.connect(e.destination),t.frequency.setValueAtTime(800,e.currentTime),n.gain.setValueAtTime(.1,e.currentTime),n.gain.exponentialRampToValueAtTime(.01,e.currentTime+.1),t.start(e.currentTime),t.stop(e.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played");}catch(e){console.error("[VOICE-SERVICE] Notification sound failed:",e);}}getVoicesForLanguage(){return dt$1(this,null,function*(){try{let e=this.language.slice(0,2),t=yield this.voices;if(!t||t.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let n=t.filter(i=>i.lang.toLowerCase().startsWith(e)).sort((i,o)=>i.localService&&!o.localService?-1:!i.localService&&o.localService?1:i.name.localeCompare(o.name));return console.log("[VOICE-SERVICE] Found matching voices:",n.length,"for language:",e),n.map(i=>({name:i.name,lang:i.lang,localService:i.localService,default:i.default,displayName:this.formatVoiceDisplayName(i)}))}catch(e){return console.error("[VOICE-SERVICE] Error getting voices for language:",e),[]}})}formatVoiceDisplayName(e){let t=e.localService?"\u{1F3E0}":"\u2601\uFE0F",n=e.default?" \u2B50":"";return `${t} ${e.name} (${e.lang})${n}`}setSelectedVoice(e){return dt$1(this,null,function*(){if(!e){this.selectedVoice=void 0;return}let[t,n]=e.split("|");if(!t||!n){this.selectedVoice=void 0;return}let i=(yield this.voices)?.find(o=>o.name===t&&o.lang===n);i?(this.selectedVoice=i,console.log("[VOICE-SERVICE] Selected voice:",i.name,i.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",t,n));})}updateSelectedVoiceForLanguage(){return dt$1(this,null,function*(){let e=yield this.getVoicesForLanguage();if(e.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let t=this.preferencesService.getSelectedVoice();if(t){let[i,o]=t.split("|"),E=o?.slice(0,2),C=this.language.slice(0,2);if(E===C&&e.some(q=>q.name===i&&q.lang===o)){console.log("[VOICE-SERVICE] Keeping current voice for language:",t);return}}let n=e[0];if(n){let i=`${n.name}|${n.lang}`;this.preferencesService.setSelectedVoice(i),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",n.displayName);}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let e=this.getTestText();e&&this.speak(e);},100);}getTestText(){let e=this.language.slice(0,2),t={fr:"Bonjour, ceci est un test de la voix s\xE9lectionn\xE9e.",en:"Hello, this is a test of the selected voice.",es:"Hola, esta es una prueba de la voz seleccionada.",de:"Hallo, dies ist ein Test der ausgew\xE4hlten Stimme.",it:"Ciao, questo \xE8 un test della voce selezionata.",pt:"Ol\xE1, este \xE9 um teste da voz selecionada.",ja:"\u3053\u3093\u306B\u3061\u306F\u3001\u3053\u308C\u306F\u9078\u629E\u3055\u308C\u305F\u97F3\u58F0\u306E\u30C6\u30B9\u30C8\u3067\u3059\u3002",ko:"\uC548\uB155\uD558\uC138\uC694, \uC774\uAC83\uC740 \uC120\uD0DD\uB41C \uC74C\uC131\uC758 \uD14C\uC2A4\uD2B8\uC785\uB2C8\uB2E4.",zh:"\u4F60\u597D\uFF0C\u8FD9\u662F\u6240\u9009\u8BED\u97F3\u7684\u6D4B\u8BD5\u3002",ru:"\u041F\u0440\u0438\u0432\u0435\u0442, \u044D\u0442\u043E \u0442\u0435\u0441\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0433\u043E\u043B\u043E\u0441\u0430.",ar:"\u0645\u0631\u062D\u0628\u0627\u060C \u0647\u0630\u0627 \u0627\u062E\u062A\u0628\u0627\u0631 \u0644\u0644\u0635\u0648\u062A \u0627\u0644\u0645\u062D\u062F\u062F."};return t[e]||t.en}extractPlainText(e){let t=e.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/&nbsp;/g," ").replace(/&amp;/g,"and").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');return t=this.addNaturalPunctuation(t),t.replace(/\s+/g," ").trim()}addNaturalPunctuation(e){return e.replace(/\n+/g,`
176
+ `],encapsulation:2})}return c})();var Et=(()=>{class c{static \u0275fac=function(n){return new(n||c)};static \u0275mod=Eo({type:c});static \u0275inj=qn({imports:[wt$1]})}return c})();var z=class c{destroy$=new ce;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new Tr(false);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=g(L);constructor(){this.initializeSpeechSynthesis(),this.subscribeToPreferences();}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopSpeech();}initializeSpeechSynthesis(){if(!("speechSynthesis"in window)){console.warn("[VOICE-SERVICE] Speech synthesis not available"),this.voices=new Promise(e=>e([]));return}this.voices=new Promise((e,t)=>{let n=speechSynthesis.getVoices();if(n.length)e(n);else {let i=setTimeout(()=>{t("no voices found");},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let o=speechSynthesis.getVoices();o.length&&(clearTimeout(i),e(o));});}}),console.log("[VOICE-SERVICE] Speech synthesis initialized");}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(Hy(this.destroy$)).subscribe(e=>{this.volume=e,console.log("[VOICE-SERVICE] Volume updated to:",e);}),this.preferencesService.voiceRate$.pipe(Hy(this.destroy$)).subscribe(e=>{this.rate=e,console.log("[VOICE-SERVICE] Rate updated to:",e);}),this.preferencesService.voiceLanguage$.pipe(Hy(this.destroy$)).subscribe(e=>{this.language=e,console.log("[VOICE-SERVICE] Language updated to:",e),this.updateSelectedVoiceForLanguage();}),this.preferencesService.selectedVoice$.pipe(Hy(this.destroy$)).subscribe(e=>{this.setSelectedVoice(e);}),this.volume=this.preferencesService.getVoiceVolume(),this.rate=this.preferencesService.getVoiceRate(),this.language=this.preferencesService.getVoiceLanguage(),this.setSelectedVoice(this.preferencesService.getSelectedVoice());}isReady(){return "speechSynthesis"in window&&this.selectedVoice!==void 0}isSpeaking(){return speechSynthesis.speaking}speak(e,t){return dt$1(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),false;if(!e.trim())return console.warn("[VOICE-SERVICE] No text to speak"),false;let n=this.extractPlainText(e);if(!n.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),false;this.stopSpeech();try{let i=new SpeechSynthesisUtterance(n);i.voice=this.selectedVoice,i.lang=this.selectedVoice.lang,i.volume=this.volume,i.rate=this.rate,this.currentOnEndCallback=t||null,t&&(i.onend=()=>{this.currentOnEndCallback===t&&(this.currentOnEndCallback=null,t());},i.onerror=()=>{this.currentOnEndCallback===t&&(this.currentOnEndCallback=null,t());}),this.currentUtterance=i,this.speakingSubject.next(!0);let o=i.onend,E=i.onerror;return i.onend=C=>{this.speakingSubject.next(!1),o&&o.call(i,C);},i.onerror=C=>{this.speakingSubject.next(!1),E&&E.call(i,C);},speechSynthesis.speak(i),console.log("[VOICE-SERVICE] Started speaking:",e.substring(0,50)+"..."),!0}catch(i){return console.error("[VOICE-SERVICE] Error speaking:",i),false}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let e=this.currentOnEndCallback;this.currentOnEndCallback=null,e();}this.speakingSubject.next(false),console.log("[VOICE-SERVICE] Speech stopped");}}ding(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.connect(n),n.connect(e.destination),t.frequency.setValueAtTime(800,e.currentTime),n.gain.setValueAtTime(.1,e.currentTime),n.gain.exponentialRampToValueAtTime(.01,e.currentTime+.1),t.start(e.currentTime),t.stop(e.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played");}catch(e){console.error("[VOICE-SERVICE] Notification sound failed:",e);}}getVoicesForLanguage(){return dt$1(this,null,function*(){try{let e=this.language.slice(0,2),t=yield this.voices;if(!t||t.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let n=t.filter(i=>i.lang.toLowerCase().startsWith(e)).sort((i,o)=>i.localService&&!o.localService?-1:!i.localService&&o.localService?1:i.name.localeCompare(o.name));return console.log("[VOICE-SERVICE] Found matching voices:",n.length,"for language:",e),n.map(i=>({name:i.name,lang:i.lang,localService:i.localService,default:i.default,displayName:this.formatVoiceDisplayName(i)}))}catch(e){return console.error("[VOICE-SERVICE] Error getting voices for language:",e),[]}})}formatVoiceDisplayName(e){let t=e.localService?"\u{1F3E0}":"\u2601\uFE0F",n=e.default?" \u2B50":"";return `${t} ${e.name} (${e.lang})${n}`}setSelectedVoice(e){return dt$1(this,null,function*(){if(!e){this.selectedVoice=void 0;return}let[t,n]=e.split("|");if(!t||!n){this.selectedVoice=void 0;return}let i=(yield this.voices)?.find(o=>o.name===t&&o.lang===n);i?(this.selectedVoice=i,console.log("[VOICE-SERVICE] Selected voice:",i.name,i.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",t,n));})}updateSelectedVoiceForLanguage(){return dt$1(this,null,function*(){let e=yield this.getVoicesForLanguage();if(e.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let t=this.preferencesService.getSelectedVoice();if(t){let[i,o]=t.split("|"),E=o?.slice(0,2),C=this.language.slice(0,2);if(E===C&&e.some(q=>q.name===i&&q.lang===o)){console.log("[VOICE-SERVICE] Keeping current voice for language:",t);return}}let n=e[0];if(n){let i=`${n.name}|${n.lang}`;this.preferencesService.setSelectedVoice(i),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",n.displayName);}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let e=this.getTestText();e&&this.speak(e);},100);}getTestText(){let e=this.language.slice(0,2),t={fr:"Bonjour, ceci est un test de la voix s\xE9lectionn\xE9e.",en:"Hello, this is a test of the selected voice.",es:"Hola, esta es una prueba de la voz seleccionada.",de:"Hallo, dies ist ein Test der ausgew\xE4hlten Stimme.",it:"Ciao, questo \xE8 un test della voce selezionata.",pt:"Ol\xE1, este \xE9 um teste da voz selecionada.",ja:"\u3053\u3093\u306B\u3061\u306F\u3001\u3053\u308C\u306F\u9078\u629E\u3055\u308C\u305F\u97F3\u58F0\u306E\u30C6\u30B9\u30C8\u3067\u3059\u3002",ko:"\uC548\uB155\uD558\uC138\uC694, \uC774\uAC83\uC740 \uC120\uD0DD\uB41C \uC74C\uC131\uC758 \uD14C\uC2A4\uD2B8\uC785\uB2C8\uB2E4.",zh:"\u4F60\u597D\uFF0C\u8FD9\u662F\u6240\u9009\u8BED\u97F3\u7684\u6D4B\u8BD5\u3002",ru:"\u041F\u0440\u0438\u0432\u0435\u0442, \u044D\u0442\u043E \u0442\u0435\u0441\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0433\u043E\u043B\u043E\u0441\u0430.",ar:"\u0645\u0631\u062D\u0628\u0627\u060C \u0647\u0630\u0627 \u0627\u062E\u062A\u0628\u0627\u0631 \u0644\u0644\u0635\u0648\u062A \u0627\u0644\u0645\u062D\u062F\u062F."};return t[e]||t.en}extractPlainText(e){let t=e.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/&nbsp;/g," ").replace(/&amp;/g,"and").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');return t=this.addNaturalPunctuation(t),t.replace(/\s+/g," ").trim()}addNaturalPunctuation(e){return e.replace(/\n+/g,`
177
177
  `).split(`
178
- `).map(t=>this.addPeriodIfNeeded(t.trim())).filter(t=>t.length>0).join(" ")}addPeriodIfNeeded(e){return e?/[.!?;:]$/.test(e)?e:e+".":""}static \u0275fac=function(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};var rt=(c,e)=>e.code,at=(c,e)=>e.name+e.lang;function st(c,e){c&1&&(Is(0,"div",17)(1,"mat-icon",39),qC(2,"warning"),pl(),Is(3,"span",40),qC(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),pl()());}function ct(c,e){if(c&1&&(Is(0,"option",25),qC(1),pl()),c&2){let t=e.$implicit;Tg("value",t.code),JE(),Yg("",t.flag," ",t.label);}}function lt(c,e){c&1&&(Is(0,"option",32),qC(1,"Loading voices..."),pl());}function dt(c,e){c&1&&(Is(0,"option",32),qC(1,"No voice available"),pl());}function pt(c,e){if(c&1&&(Is(0,"option",25),qC(1),pl()),c&2){let t=e.$implicit;Tg("value",t.name+"|"+t.lang),JE(),vl(" ",t.displayName," ");}}var Ye=class c{destroy$=new ce;selectedTheme="light";selectedThemeVariant="industry";selectedVoiceLanguage="en-US";useEnterToSend=false;printTechnicalMessages=false;showTechnicalMessages=true;showWarningMessages=true;voiceInputMode="browser";voiceAnnounceEnabled=false;voiceMode="speech";voiceReadFullText=false;voiceVolume=80;voiceRate=120;agentNotificationEnabled=false;notificationSoundEnabled=true;browserNotificationEnabled=false;browserNotificationDenied=false;missionPreviewEnabled=false;availableVoices=[];selectedVoiceId=null;loadingVoices=false;voiceLanguageOptions=[{code:"fr-FR",label:"Fran\xE7ais",flag:"\u{1F1EB}\u{1F1F7}"},{code:"en-US",label:"English (US)",flag:"\u{1F1FA}\u{1F1F8}"},{code:"en-GB",label:"English (UK)",flag:"\u{1F1EC}\u{1F1E7}"},{code:"es-ES",label:"Espa\xF1ol",flag:"\u{1F1EA}\u{1F1F8}"},{code:"de-DE",label:"Deutsch",flag:"\u{1F1E9}\u{1F1EA}"},{code:"it-IT",label:"Italiano",flag:"\u{1F1EE}\u{1F1F9}"},{code:"pt-BR",label:"Portugu\xEAs",flag:"\u{1F1E7}\u{1F1F7}"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",flag:"\u{1F1F0}\u{1F1F7}"},{code:"zh-CN",label:"\u4E2D\u6587 (\u7B80\u4F53)",flag:"\u{1F1E8}\u{1F1F3}"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",flag:"\u{1F1F7}\u{1F1FA}"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",flag:"\u{1F1F8}\u{1F1E6}"}];preferencesService=g(L);voiceSynthesisService=g(z);themeService=g(me);ngOnInit(){let e=this.themeService.getCurrentTheme();this.selectedTheme=e.mode,this.selectedThemeVariant=e.variant,this.selectedVoiceLanguage=this.preferencesService.getVoiceLanguage(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.printTechnicalMessages=this.preferencesService.getPrintTechnicalMessages(),this.showTechnicalMessages=!this.preferencesService.getHideTechnicalMessages(),this.showWarningMessages=!this.preferencesService.getHideWarningMessages(),this.voiceInputMode=this.preferencesService.getVoiceInputMode(),this.voiceAnnounceEnabled=this.preferencesService.getVoiceAnnounceEnabled(),this.voiceMode=this.preferencesService.getVoiceMode(),this.voiceReadFullText=this.preferencesService.getVoiceReadFullText(),this.voiceVolume=Math.round(this.preferencesService.getVoiceVolume()*100),this.voiceRate=Math.round(this.preferencesService.getVoiceRate()*100),this.selectedVoiceId=this.preferencesService.getSelectedVoice(),this.agentNotificationEnabled=this.preferencesService.getAgentNotificationEnabled(),this.notificationSoundEnabled=this.preferencesService.getNotificationSoundEnabled(),this.browserNotificationEnabled=this.preferencesService.getBrowserNotificationEnabled(),this.missionPreviewEnabled=this.preferencesService.getMissionPreviewEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(Vy(this.destroy$)).subscribe(t=>{this.selectedTheme=t.mode,this.selectedThemeVariant=t.variant;}),this.preferencesService.voiceLanguage$.pipe(Vy(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t;}),this.preferencesService.enterToSend$.pipe(Vy(this.destroy$)).subscribe(t=>{this.useEnterToSend=t;}),this.preferencesService.printTechnicalMessages$.pipe(Vy(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t;}),this.preferencesService.hideTechnicalMessages$.pipe(Vy(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t;}),this.preferencesService.hideWarningMessages$.pipe(Vy(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t;}),this.preferencesService.voiceInputMode$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceInputMode=t;}),this.preferencesService.voiceAnnounceEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t;}),this.preferencesService.voiceMode$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceMode=t;}),this.preferencesService.voiceReadFullText$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t;}),this.preferencesService.voiceVolume$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100);}),this.preferencesService.voiceRate$.pipe(Vy(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100);}),this.preferencesService.selectedVoice$.pipe(Vy(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t;}),this.preferencesService.voiceLanguage$.pipe(Vy(this.destroy$)).subscribe(()=>{this.loadAvailableVoices();}),this.preferencesService.agentNotificationEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t;}),this.preferencesService.notificationSoundEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t;}),this.preferencesService.browserNotificationEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission();}),this.preferencesService.missionPreviewEnabled$.pipe(Vy(this.destroy$)).subscribe(t=>{this.missionPreviewEnabled=t;});}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete();}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme({variant:this.selectedThemeVariant,mode:this.selectedTheme});}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage);}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend);}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages);}onShowTechnicalMessagesChange(){let e=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",e,")"),this.preferencesService.setHideTechnicalMessages(e);}onShowWarningMessagesChange(){let e=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",e,")"),this.preferencesService.setHideWarningMessages(e);}onVoiceInputModeChange(e){let t=e.target.value;console.log("[OPTIONS] Voice input mode changed to:",t),this.preferencesService.setVoiceInputMode(t);}onVoiceAnnounceEnabledChange(){console.log("[OPTIONS] Voice announce enabled changed to:",this.voiceAnnounceEnabled),this.preferencesService.setVoiceAnnounceEnabled(this.voiceAnnounceEnabled);}onVoiceModeChange(){console.log("[OPTIONS] Voice mode changed to:",this.voiceMode),this.preferencesService.setVoiceMode(this.voiceMode);}onVoiceReadFullTextChange(){console.log("[OPTIONS] Voice read full text changed to:",this.voiceReadFullText),this.preferencesService.setVoiceReadFullText(this.voiceReadFullText);}onVoiceVolumeChange(){let e=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",e),this.preferencesService.setVoiceVolume(e);}onVoiceRateChange(){let e=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",e),this.preferencesService.setVoiceRate(e);}loadAvailableVoices(){return dt$1(this,null,function*(){this.loadingVoices=true;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language");}catch(e){console.error("[OPTIONS] Error loading voices:",e),this.availableVoices=[];}finally{this.loadingVoices=false;}})}onSelectedVoiceChange(){console.log("[OPTIONS] Selected voice changed to:",this.selectedVoiceId),this.preferencesService.setSelectedVoice(this.selectedVoiceId);}testVoice(){console.log("[OPTIONS] Testing voice with current settings"),this.voiceSynthesisService.testSelectedVoice();}onAgentNotificationEnabledChange(){console.log("[OPTIONS] Agent notification enabled changed to:",this.agentNotificationEnabled),this.preferencesService.setAgentNotificationEnabled(this.agentNotificationEnabled);}onNotificationSoundEnabledChange(){console.log("[OPTIONS] Notification sound enabled changed to:",this.notificationSoundEnabled),this.preferencesService.setNotificationSoundEnabled(this.notificationSoundEnabled);}onBrowserNotificationEnabledChange(){console.log("[OPTIONS] Browser notification enabled changed to:",this.browserNotificationEnabled),this.preferencesService.setBrowserNotificationEnabled(this.browserNotificationEnabled);}onMissionPreviewEnabledChange(){console.log("[OPTIONS] Mission preview panel enabled changed to:",this.missionPreviewEnabled),this.preferencesService.setMissionPreviewEnabled(this.missionPreviewEnabled);}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission));}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=Rw({type:c,selectors:[["app-options-panel"]],decls:168,vars:37,consts:[[1,"options-content"],[1,"option-section"],[1,"section-title"],[1,"option-group"],[1,"radio-group"],[1,"option-radio"],["type","radio","name","theme","value","light",3,"ngModelChange","change","ngModel"],[1,"radio-mark"],["type","radio","name","theme","value","dark",3,"ngModelChange","change","ngModel"],["type","radio","name","theme","value","system",3,"ngModelChange","change","ngModel"],[1,"option-label"],["type","radio","name","enterBehavior",3,"ngModelChange","change","value","ngModel"],[1,"toggle-option"],["color","primary",3,"ngModelChange","change","ngModel"],[1,"option-label-with-hint"],[1,"option-hint"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-input-mode-select",1,"option-label"],["id","voice-input-mode-select",1,"option-select",3,"change","value"],["value","browser"],["value","whisper"],["value","voice-message"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(t,n){t&1&&(Is(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),qC(4,"palette"),pl(),Is(5,"span"),qC(6,"Appearance"),pl()(),Is(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),Jg("ngModelChange",function(o){return XC(n.selectedTheme,o)||(n.selectedTheme=o),o}),Ag("change",function(){return n.onThemeChange()}),pl(),UI(),bg(11,"span",7),qC(12," Light "),pl(),Is(13,"label",5)(14,"input",8),Jg("ngModelChange",function(o){return XC(n.selectedTheme,o)||(n.selectedTheme=o),o}),Ag("change",function(){return n.onThemeChange()}),pl(),UI(),bg(15,"span",7),qC(16," Dark "),pl(),Is(17,"label",5)(18,"input",9),Jg("ngModelChange",function(o){return XC(n.selectedTheme,o)||(n.selectedTheme=o),o}),Ag("change",function(){return n.onThemeChange()}),pl(),UI(),bg(19,"span",7),qC(20," System "),pl()()()(),Is(21,"div",1)(22,"div",2)(23,"mat-icon"),qC(24,"chat_bubble_outline"),pl(),Is(25,"span"),qC(26,"Messaging"),pl()(),Is(27,"div",3)(28,"span",10),qC(29,"Send message behavior:"),pl(),Is(30,"div",4)(31,"label",5)(32,"input",11),Jg("ngModelChange",function(o){return XC(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),Ag("change",function(){return n.onEnterToSendChange()}),pl(),UI(),bg(33,"span",7),qC(34," Enter to send "),pl(),Is(35,"label",5)(36,"input",11),Jg("ngModelChange",function(o){return XC(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),Ag("change",function(){return n.onEnterToSendChange()}),pl(),UI(),bg(37,"span",7),qC(38," Enter for new line "),pl()()(),Is(39,"div",3)(40,"div",12)(41,"span",10),qC(42,"Show technical messages"),pl(),Is(43,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return XC(n.showTechnicalMessages,o)||(n.showTechnicalMessages=o),o}),Ag("change",function(){return n.onShowTechnicalMessagesChange()}),pl(),UI(),pl()(),Is(44,"div",3)(45,"div",12)(46,"span",10),qC(47,"Show warning messages"),pl(),Is(48,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return XC(n.showWarningMessages,o)||(n.showWarningMessages=o),o}),Ag("change",function(){return n.onShowWarningMessagesChange()}),pl(),UI(),pl()(),Is(49,"div",3)(50,"div",12)(51,"span",10),qC(52,"Include technical messages in print"),pl(),Is(53,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return XC(n.printTechnicalMessages,o)||(n.printTechnicalMessages=o),o}),Ag("change",function(){return n.onPrintTechnicalMessagesChange()}),pl(),UI(),pl()()(),Is(54,"div",1)(55,"div",2)(56,"mat-icon"),qC(57,"rocket_launch"),pl(),Is(58,"span"),qC(59,"Mission Control"),pl()(),Is(60,"div",3)(61,"div",12)(62,"div",14)(63,"span",10),qC(64,"Side-by-side thread preview"),pl(),Is(65,"span",15),qC(66,"Click a mission card to open a preview panel. Recommended for large screens."),pl()(),Is(67,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return XC(n.missionPreviewEnabled,o)||(n.missionPreviewEnabled=o),o}),Ag("change",function(){return n.onMissionPreviewEnabledChange()}),pl(),UI(),pl()()(),Is(68,"div",1)(69,"div",2)(70,"mat-icon"),qC(71,"notifications"),pl(),Is(72,"span"),qC(73,"Notifications"),pl()(),Is(74,"div",3)(75,"div",12)(76,"span",10),qC(77,"Notify when the agent answers or requests input"),pl(),Is(78,"mat-slide-toggle",13),Jg("ngModelChange",function(o){return XC(n.agentNotificationEnabled,o)||(n.agentNotificationEnabled=o),o}),Ag("change",function(){return n.onAgentNotificationEnabledChange()}),pl(),UI(),pl()(),Is(79,"div",3)(80,"div",12)(81,"span",10),qC(82,"Notification sound"),pl(),Is(83,"mat-slide-toggle",16),Jg("ngModelChange",function(o){return XC(n.notificationSoundEnabled,o)||(n.notificationSoundEnabled=o),o}),Ag("change",function(){return n.onNotificationSoundEnabledChange()}),pl(),UI(),pl()(),Is(84,"div",3)(85,"div",12)(86,"span",10),qC(87,"Browser notification"),pl(),Is(88,"mat-slide-toggle",16),Jg("ngModelChange",function(o){return XC(n.browserNotificationEnabled,o)||(n.browserNotificationEnabled=o),o}),Ag("change",function(){return n.onBrowserNotificationEnabledChange()}),pl(),UI(),pl(),tC(89,st,5,0,"div",17),pl()(),Is(90,"div",1)(91,"div",2)(92,"mat-icon"),qC(93,"record_voice_over"),pl(),Is(94,"span"),qC(95,"Voice & Speech"),pl()(),Is(96,"div",3)(97,"label",18),qC(98,"Voice input method:"),pl(),Is(99,"select",19),Ag("change",function(o){return n.onVoiceInputModeChange(o)}),Is(100,"option",20),qC(101,"Browser (real-time)"),pl(),Is(102,"option",21),qC(103,"Whisper (higher accuracy)"),pl(),Is(104,"option",22),qC(105,"Voice message (send audio)"),pl()()(),Is(106,"div",3)(107,"label",23),qC(108,"Voice recognition language:"),pl(),Is(109,"select",24),Jg("ngModelChange",function(o){return XC(n.selectedVoiceLanguage,o)||(n.selectedVoiceLanguage=o),o}),Ag("change",function(){return n.onVoiceLanguageChange()}),iC(110,ct,2,3,"option",25,rt),pl(),UI(),pl(),Is(112,"div",3)(113,"span",10),qC(114,"Automatic announcement:"),pl(),Is(115,"div",4)(116,"label",5)(117,"input",26),Jg("ngModelChange",function(o){return XC(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),Ag("change",function(){return n.onVoiceAnnounceEnabledChange()}),pl(),UI(),bg(118,"span",7),qC(119," Enabled "),pl(),Is(120,"label",5)(121,"input",26),Jg("ngModelChange",function(o){return XC(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),Ag("change",function(){return n.onVoiceAnnounceEnabledChange()}),pl(),UI(),bg(122,"span",7),qC(123," Disabled "),pl()()(),Is(124,"div",3)(125,"span",10),qC(126,"Voice mode:"),pl(),Is(127,"div",4)(128,"label",5)(129,"input",27),Jg("ngModelChange",function(o){return XC(n.voiceMode,o)||(n.voiceMode=o),o}),Ag("change",function(){return n.onVoiceModeChange()}),pl(),UI(),bg(130,"span",7),qC(131," Voice synthesis "),pl(),Is(132,"label",5)(133,"input",28),Jg("ngModelChange",function(o){return XC(n.voiceMode,o)||(n.voiceMode=o),o}),Ag("change",function(){return n.onVoiceModeChange()}),pl(),UI(),bg(134,"span",7),qC(135," Sound notification "),pl()()(),Is(136,"div",3)(137,"span",10),qC(138,"Message reading:"),pl(),Is(139,"div",4)(140,"label",5)(141,"input",29),Jg("ngModelChange",function(o){return XC(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),Ag("change",function(){return n.onVoiceReadFullTextChange()}),pl(),UI(),bg(142,"span",7),qC(143," Full message "),pl(),Is(144,"label",5)(145,"input",29),Jg("ngModelChange",function(o){return XC(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),Ag("change",function(){return n.onVoiceReadFullTextChange()}),pl(),UI(),bg(146,"span",7),qC(147," First paragraphs only "),pl()()(),Is(148,"div",3)(149,"label",30),qC(150,"Selected voice:"),pl(),Is(151,"select",31),Jg("ngModelChange",function(o){return XC(n.selectedVoiceId,o)||(n.selectedVoiceId=o),o}),Ag("change",function(){return n.onSelectedVoiceChange()}),tC(152,lt,2,0,"option",32),tC(153,dt,2,0,"option",32),iC(154,pt,2,2,"option",25,at),pl(),UI(),bg(156,"div",10),Is(157,"a",33),Ag("click",function(){return n.testVoice()}),Is(158,"span",34),qC(159,"Test voice"),pl()()(),Is(160,"div",3)(161,"label",35),qC(162),pl(),Is(163,"input",36),Jg("ngModelChange",function(o){return XC(n.voiceVolume,o)||(n.voiceVolume=o),o}),Ag("input",function(){return n.onVoiceVolumeChange()}),pl(),UI(),pl(),Is(164,"div",3)(165,"label",37),qC(166),pl(),Is(167,"input",38),Jg("ngModelChange",function(o){return XC(n.voiceRate,o)||(n.voiceRate=o),o}),Ag("input",function(){return n.onVoiceRateChange()}),pl(),UI(),pl()()()),t&2&&(JE(10),Xg("ngModel",n.selectedTheme),zI(),JE(4),Xg("ngModel",n.selectedTheme),zI(),JE(4),Xg("ngModel",n.selectedTheme),zI(),JE(14),Tg("value",true),Xg("ngModel",n.useEnterToSend),zI(),JE(4),Tg("value",false),Xg("ngModel",n.useEnterToSend),zI(),JE(7),Xg("ngModel",n.showTechnicalMessages),zI(),JE(5),Xg("ngModel",n.showWarningMessages),zI(),JE(5),Xg("ngModel",n.printTechnicalMessages),zI(),JE(14),Xg("ngModel",n.missionPreviewEnabled),zI(),JE(11),Xg("ngModel",n.agentNotificationEnabled),zI(),JE(5),Xg("ngModel",n.notificationSoundEnabled),Tg("disabled",!n.agentNotificationEnabled),zI(),JE(5),Xg("ngModel",n.browserNotificationEnabled),Tg("disabled",!n.agentNotificationEnabled||n.browserNotificationDenied),zI(),JE(),nC(n.browserNotificationDenied?89:-1),JE(10),Tg("value",n.voiceInputMode),JE(10),Xg("ngModel",n.selectedVoiceLanguage),zI(),JE(),sC(n.voiceLanguageOptions),JE(7),Tg("value",true),Xg("ngModel",n.voiceAnnounceEnabled),zI(),JE(4),Tg("value",false),Xg("ngModel",n.voiceAnnounceEnabled),zI(),JE(8),Xg("ngModel",n.voiceMode),zI(),JE(4),Xg("ngModel",n.voiceMode),zI(),JE(8),Tg("value",true),Xg("ngModel",n.voiceReadFullText),zI(),JE(4),Tg("value",false),Xg("ngModel",n.voiceReadFullText),zI(),JE(6),Xg("ngModel",n.selectedVoiceId),Tg("disabled",n.loadingVoices||n.availableVoices.length===0),zI(),JE(),nC(n.loadingVoices?152:-1),JE(),nC(!n.loadingVoices&&n.availableVoices.length===0?153:-1),JE(),sC(n.availableVoices),JE(8),vl("Volume: ",n.voiceVolume,"%"),JE(),Xg("ngModel",n.voiceVolume),zI(),JE(3),vl("Speed: ",n.voiceRate,"%"),JE(),Xg("ngModel",n.voiceRate),zI());},dependencies:[ti,Qn,ei,Ye$1,_n,At,mn,Zn,cn,wt,se],styles:['.options-content[_ngcontent-%COMP%]{padding:0;width:100%}.option-group[_ngcontent-%COMP%]{padding:0 1rem 1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border-light)}.option-group[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.option-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;color:var(--color-text);font-size:.875rem}.toggle-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.toggle-option[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0;flex:1}.toggle-option[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex-shrink:0}.option-label-with-hint[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1}.option-label-with-hint[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0}.option-label-with-hint[_ngcontent-%COMP%] .option-hint[_ngcontent-%COMP%]{font-size:.775rem;color:var(--color-text-secondary);line-height:1.4}.option-select[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-input-bg);color:var(--color-text);font-size:.875rem;cursor:pointer}.option-select[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px #7064fb1a}.option-select[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.option-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{padding:.5rem}.option-checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--color-border);border-radius:3px;margin-right:.75rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";width:10px;height:6px;border-left:2px solid transparent;border-bottom:2px solid transparent;transform:rotate(-45deg);transition:all .2s ease;opacity:0}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]{background-color:var(--color-primary);border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]:after{border-left-color:#fff;border-bottom-color:#fff;opacity:1}.option-checkbox[_ngcontent-%COMP%]:hover .checkmark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%]:focus-within .checkmark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-section[_ngcontent-%COMP%]{padding-top:1rem;margin-top:1rem;border-top:2px solid var(--color-border)}.option-section[_ngcontent-%COMP%]:first-child{border-top:none;padding-top:0;margin-top:0}.section-title[_ngcontent-%COMP%]{margin:0 0 1rem;padding:0 1rem;font-size:.9rem;font-weight:600;color:var(--color-text);display:flex;align-items:center;gap:.5rem}.section-title[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.option-radio[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{display:none}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--color-border);border-radius:50%;margin-right:.5rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0;position:relative}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]:after{content:"";width:8px;height:8px;border-radius:50%;background-color:var(--color-primary);transition:all .2s ease;opacity:0;transform:scale(0)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]:after{opacity:1;transform:scale(1)}.option-radio[_ngcontent-%COMP%]:hover .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%]:focus-within .radio-mark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-slider[_ngcontent-%COMP%]{width:100%;height:6px;border-radius:3px;background:var(--color-bg-solid);outline:none;cursor:pointer;-webkit-appearance:none;appearance:none}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-webkit-slider-track{height:6px;border-radius:3px;background:var(--color-bg-secondary)}.option-slider[_ngcontent-%COMP%]::-moz-range-track{height:6px;border-radius:3px;background:var(--color-bg-secondary);border:none}.option-slider[_ngcontent-%COMP%]:focus{outline:none}.option-slider[_ngcontent-%COMP%]:focus::-webkit-slider-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.option-slider[_ngcontent-%COMP%]:focus::-moz-range-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.test-voice-btn[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;background:var(--color-primary);color:#fff;border:none;border-radius:6px;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:.5rem}.test-voice-btn[_ngcontent-%COMP%]:hover{background:var(--color-primary-hover);transform:translateY(-1px);box-shadow:0 2px 8px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 1px 4px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:focus{outline:none;box-shadow:0 0 0 3px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:disabled{background:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;transform:none;box-shadow:none}.test-voice-link[_ngcontent-%COMP%]{text-decoration-thickness:1.5px;text-underline-offset:3px;background:transparent;border:none;padding:0;font-size:.775rem;font-weight:400;cursor:pointer;transition:all .2s ease;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;text-decoration:underline}.test-voice-link[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover, var(--color-primary));text-decoration-thickness:2px}.test-voice-link[_ngcontent-%COMP%]:active{opacity:.8}.test-voice-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.test-voice-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.notification-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.75rem;margin-top:.75rem;background-color:#d32f2f1a;border:1px solid rgba(211,47,47,.3);border-radius:6px;font-size:.8125rem;line-height:1.5}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#d32f2f;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{color:var(--color-text);flex:1}.notification-error[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;background-color:#f443361a;border:1px solid rgba(244,67,54,.3);border-radius:6px;display:flex;align-items:flex-start;gap:.5rem}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#f44336;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text);line-height:1.5;flex:1}'],changeDetection:1})};function Qe(c){let e=c.args??"",t;try{let n=JSON.parse(e);t=JSON.stringify(n,null,2);}catch(n){t=e;}return `\u{1F527} ${c.name}
178
+ `).map(t=>this.addPeriodIfNeeded(t.trim())).filter(t=>t.length>0).join(" ")}addPeriodIfNeeded(e){return e?/[.!?;:]$/.test(e)?e:e+".":""}static \u0275fac=function(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};var rt=(c,e)=>e.code,at=(c,e)=>e.name+e.lang;function st(c,e){c&1&&(ws(0,"div",17)(1,"mat-icon",39),QC(2,"warning"),hl(),ws(3,"span",40),QC(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),hl()());}function ct(c,e){if(c&1&&(ws(0,"option",25),QC(1),hl()),c&2){let t=e.$implicit;bg("value",t.code),nI(),Qg("",t.flag," ",t.label);}}function lt(c,e){c&1&&(ws(0,"option",32),QC(1,"Loading voices..."),hl());}function dt(c,e){c&1&&(ws(0,"option",32),QC(1,"No voice available"),hl());}function pt(c,e){if(c&1&&(ws(0,"option",25),QC(1),hl()),c&2){let t=e.$implicit;bg("value",t.name+"|"+t.lang),nI(),Dl(" ",t.displayName," ");}}var Ye=class c{destroy$=new ce;selectedTheme="light";selectedThemeVariant="industry";selectedVoiceLanguage="en-US";useEnterToSend=false;printTechnicalMessages=false;showTechnicalMessages=true;showWarningMessages=true;voiceInputMode="browser";voiceAnnounceEnabled=false;voiceMode="speech";voiceReadFullText=false;voiceVolume=80;voiceRate=120;agentNotificationEnabled=false;notificationSoundEnabled=true;browserNotificationEnabled=false;browserNotificationDenied=false;missionPreviewEnabled=false;availableVoices=[];selectedVoiceId=null;loadingVoices=false;voiceLanguageOptions=[{code:"fr-FR",label:"Fran\xE7ais",flag:"\u{1F1EB}\u{1F1F7}"},{code:"en-US",label:"English (US)",flag:"\u{1F1FA}\u{1F1F8}"},{code:"en-GB",label:"English (UK)",flag:"\u{1F1EC}\u{1F1E7}"},{code:"es-ES",label:"Espa\xF1ol",flag:"\u{1F1EA}\u{1F1F8}"},{code:"de-DE",label:"Deutsch",flag:"\u{1F1E9}\u{1F1EA}"},{code:"it-IT",label:"Italiano",flag:"\u{1F1EE}\u{1F1F9}"},{code:"pt-BR",label:"Portugu\xEAs",flag:"\u{1F1E7}\u{1F1F7}"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",flag:"\u{1F1F0}\u{1F1F7}"},{code:"zh-CN",label:"\u4E2D\u6587 (\u7B80\u4F53)",flag:"\u{1F1E8}\u{1F1F3}"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",flag:"\u{1F1F7}\u{1F1FA}"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",flag:"\u{1F1F8}\u{1F1E6}"}];preferencesService=g(L);voiceSynthesisService=g(z);themeService=g(me);ngOnInit(){let e=this.themeService.getCurrentTheme();this.selectedTheme=e.mode,this.selectedThemeVariant=e.variant,this.selectedVoiceLanguage=this.preferencesService.getVoiceLanguage(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.printTechnicalMessages=this.preferencesService.getPrintTechnicalMessages(),this.showTechnicalMessages=!this.preferencesService.getHideTechnicalMessages(),this.showWarningMessages=!this.preferencesService.getHideWarningMessages(),this.voiceInputMode=this.preferencesService.getVoiceInputMode(),this.voiceAnnounceEnabled=this.preferencesService.getVoiceAnnounceEnabled(),this.voiceMode=this.preferencesService.getVoiceMode(),this.voiceReadFullText=this.preferencesService.getVoiceReadFullText(),this.voiceVolume=Math.round(this.preferencesService.getVoiceVolume()*100),this.voiceRate=Math.round(this.preferencesService.getVoiceRate()*100),this.selectedVoiceId=this.preferencesService.getSelectedVoice(),this.agentNotificationEnabled=this.preferencesService.getAgentNotificationEnabled(),this.notificationSoundEnabled=this.preferencesService.getNotificationSoundEnabled(),this.browserNotificationEnabled=this.preferencesService.getBrowserNotificationEnabled(),this.missionPreviewEnabled=this.preferencesService.getMissionPreviewEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(Hy(this.destroy$)).subscribe(t=>{this.selectedTheme=t.mode,this.selectedThemeVariant=t.variant;}),this.preferencesService.voiceLanguage$.pipe(Hy(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t;}),this.preferencesService.enterToSend$.pipe(Hy(this.destroy$)).subscribe(t=>{this.useEnterToSend=t;}),this.preferencesService.printTechnicalMessages$.pipe(Hy(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t;}),this.preferencesService.hideTechnicalMessages$.pipe(Hy(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t;}),this.preferencesService.hideWarningMessages$.pipe(Hy(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t;}),this.preferencesService.voiceInputMode$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceInputMode=t;}),this.preferencesService.voiceAnnounceEnabled$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t;}),this.preferencesService.voiceMode$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceMode=t;}),this.preferencesService.voiceReadFullText$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t;}),this.preferencesService.voiceVolume$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100);}),this.preferencesService.voiceRate$.pipe(Hy(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100);}),this.preferencesService.selectedVoice$.pipe(Hy(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t;}),this.preferencesService.voiceLanguage$.pipe(Hy(this.destroy$)).subscribe(()=>{this.loadAvailableVoices();}),this.preferencesService.agentNotificationEnabled$.pipe(Hy(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t;}),this.preferencesService.notificationSoundEnabled$.pipe(Hy(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t;}),this.preferencesService.browserNotificationEnabled$.pipe(Hy(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission();}),this.preferencesService.missionPreviewEnabled$.pipe(Hy(this.destroy$)).subscribe(t=>{this.missionPreviewEnabled=t;});}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete();}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme({variant:this.selectedThemeVariant,mode:this.selectedTheme});}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage);}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend);}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages);}onShowTechnicalMessagesChange(){let e=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",e,")"),this.preferencesService.setHideTechnicalMessages(e);}onShowWarningMessagesChange(){let e=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",e,")"),this.preferencesService.setHideWarningMessages(e);}onVoiceInputModeChange(e){let t=e.target.value;console.log("[OPTIONS] Voice input mode changed to:",t),this.preferencesService.setVoiceInputMode(t);}onVoiceAnnounceEnabledChange(){console.log("[OPTIONS] Voice announce enabled changed to:",this.voiceAnnounceEnabled),this.preferencesService.setVoiceAnnounceEnabled(this.voiceAnnounceEnabled);}onVoiceModeChange(){console.log("[OPTIONS] Voice mode changed to:",this.voiceMode),this.preferencesService.setVoiceMode(this.voiceMode);}onVoiceReadFullTextChange(){console.log("[OPTIONS] Voice read full text changed to:",this.voiceReadFullText),this.preferencesService.setVoiceReadFullText(this.voiceReadFullText);}onVoiceVolumeChange(){let e=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",e),this.preferencesService.setVoiceVolume(e);}onVoiceRateChange(){let e=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",e),this.preferencesService.setVoiceRate(e);}loadAvailableVoices(){return dt$1(this,null,function*(){this.loadingVoices=true;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language");}catch(e){console.error("[OPTIONS] Error loading voices:",e),this.availableVoices=[];}finally{this.loadingVoices=false;}})}onSelectedVoiceChange(){console.log("[OPTIONS] Selected voice changed to:",this.selectedVoiceId),this.preferencesService.setSelectedVoice(this.selectedVoiceId);}testVoice(){console.log("[OPTIONS] Testing voice with current settings"),this.voiceSynthesisService.testSelectedVoice();}onAgentNotificationEnabledChange(){console.log("[OPTIONS] Agent notification enabled changed to:",this.agentNotificationEnabled),this.preferencesService.setAgentNotificationEnabled(this.agentNotificationEnabled);}onNotificationSoundEnabledChange(){console.log("[OPTIONS] Notification sound enabled changed to:",this.notificationSoundEnabled),this.preferencesService.setNotificationSoundEnabled(this.notificationSoundEnabled);}onBrowserNotificationEnabledChange(){console.log("[OPTIONS] Browser notification enabled changed to:",this.browserNotificationEnabled),this.preferencesService.setBrowserNotificationEnabled(this.browserNotificationEnabled);}onMissionPreviewEnabledChange(){console.log("[OPTIONS] Mission preview panel enabled changed to:",this.missionPreviewEnabled),this.preferencesService.setMissionPreviewEnabled(this.missionPreviewEnabled);}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission));}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=Fw({type:c,selectors:[["app-options-panel"]],decls:168,vars:37,consts:[[1,"options-content"],[1,"option-section"],[1,"section-title"],[1,"option-group"],[1,"radio-group"],[1,"option-radio"],["type","radio","name","theme","value","light",3,"ngModelChange","change","ngModel"],[1,"radio-mark"],["type","radio","name","theme","value","dark",3,"ngModelChange","change","ngModel"],["type","radio","name","theme","value","system",3,"ngModelChange","change","ngModel"],[1,"option-label"],["type","radio","name","enterBehavior",3,"ngModelChange","change","value","ngModel"],[1,"toggle-option"],["color","primary",3,"ngModelChange","change","ngModel"],[1,"option-label-with-hint"],[1,"option-hint"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-input-mode-select",1,"option-label"],["id","voice-input-mode-select",1,"option-select",3,"change","value"],["value","browser"],["value","whisper"],["value","voice-message"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(t,n){t&1&&(ws(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),QC(4,"palette"),hl(),ws(5,"span"),QC(6,"Appearance"),hl()(),ws(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),em("ngModelChange",function(o){return tT(n.selectedTheme,o)||(n.selectedTheme=o),o}),Rg("change",function(){return n.onThemeChange()}),hl(),GI(),Sg(11,"span",7),QC(12," Light "),hl(),ws(13,"label",5)(14,"input",8),em("ngModelChange",function(o){return tT(n.selectedTheme,o)||(n.selectedTheme=o),o}),Rg("change",function(){return n.onThemeChange()}),hl(),GI(),Sg(15,"span",7),QC(16," Dark "),hl(),ws(17,"label",5)(18,"input",9),em("ngModelChange",function(o){return tT(n.selectedTheme,o)||(n.selectedTheme=o),o}),Rg("change",function(){return n.onThemeChange()}),hl(),GI(),Sg(19,"span",7),QC(20," System "),hl()()()(),ws(21,"div",1)(22,"div",2)(23,"mat-icon"),QC(24,"chat_bubble_outline"),hl(),ws(25,"span"),QC(26,"Messaging"),hl()(),ws(27,"div",3)(28,"span",10),QC(29,"Send message behavior:"),hl(),ws(30,"div",4)(31,"label",5)(32,"input",11),em("ngModelChange",function(o){return tT(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),Rg("change",function(){return n.onEnterToSendChange()}),hl(),GI(),Sg(33,"span",7),QC(34," Enter to send "),hl(),ws(35,"label",5)(36,"input",11),em("ngModelChange",function(o){return tT(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),Rg("change",function(){return n.onEnterToSendChange()}),hl(),GI(),Sg(37,"span",7),QC(38," Enter for new line "),hl()()(),ws(39,"div",3)(40,"div",12)(41,"span",10),QC(42,"Show technical messages"),hl(),ws(43,"mat-slide-toggle",13),em("ngModelChange",function(o){return tT(n.showTechnicalMessages,o)||(n.showTechnicalMessages=o),o}),Rg("change",function(){return n.onShowTechnicalMessagesChange()}),hl(),GI(),hl()(),ws(44,"div",3)(45,"div",12)(46,"span",10),QC(47,"Show warning messages"),hl(),ws(48,"mat-slide-toggle",13),em("ngModelChange",function(o){return tT(n.showWarningMessages,o)||(n.showWarningMessages=o),o}),Rg("change",function(){return n.onShowWarningMessagesChange()}),hl(),GI(),hl()(),ws(49,"div",3)(50,"div",12)(51,"span",10),QC(52,"Include technical messages in print"),hl(),ws(53,"mat-slide-toggle",13),em("ngModelChange",function(o){return tT(n.printTechnicalMessages,o)||(n.printTechnicalMessages=o),o}),Rg("change",function(){return n.onPrintTechnicalMessagesChange()}),hl(),GI(),hl()()(),ws(54,"div",1)(55,"div",2)(56,"mat-icon"),QC(57,"rocket_launch"),hl(),ws(58,"span"),QC(59,"Mission Control"),hl()(),ws(60,"div",3)(61,"div",12)(62,"div",14)(63,"span",10),QC(64,"Side-by-side thread preview"),hl(),ws(65,"span",15),QC(66,"Click a mission card to open a preview panel. Recommended for large screens."),hl()(),ws(67,"mat-slide-toggle",13),em("ngModelChange",function(o){return tT(n.missionPreviewEnabled,o)||(n.missionPreviewEnabled=o),o}),Rg("change",function(){return n.onMissionPreviewEnabledChange()}),hl(),GI(),hl()()(),ws(68,"div",1)(69,"div",2)(70,"mat-icon"),QC(71,"notifications"),hl(),ws(72,"span"),QC(73,"Notifications"),hl()(),ws(74,"div",3)(75,"div",12)(76,"span",10),QC(77,"Notify when the agent answers or requests input"),hl(),ws(78,"mat-slide-toggle",13),em("ngModelChange",function(o){return tT(n.agentNotificationEnabled,o)||(n.agentNotificationEnabled=o),o}),Rg("change",function(){return n.onAgentNotificationEnabledChange()}),hl(),GI(),hl()(),ws(79,"div",3)(80,"div",12)(81,"span",10),QC(82,"Notification sound"),hl(),ws(83,"mat-slide-toggle",16),em("ngModelChange",function(o){return tT(n.notificationSoundEnabled,o)||(n.notificationSoundEnabled=o),o}),Rg("change",function(){return n.onNotificationSoundEnabledChange()}),hl(),GI(),hl()(),ws(84,"div",3)(85,"div",12)(86,"span",10),QC(87,"Browser notification"),hl(),ws(88,"mat-slide-toggle",16),em("ngModelChange",function(o){return tT(n.browserNotificationEnabled,o)||(n.browserNotificationEnabled=o),o}),Rg("change",function(){return n.onBrowserNotificationEnabledChange()}),hl(),GI(),hl(),oC(89,st,5,0,"div",17),hl()(),ws(90,"div",1)(91,"div",2)(92,"mat-icon"),QC(93,"record_voice_over"),hl(),ws(94,"span"),QC(95,"Voice & Speech"),hl()(),ws(96,"div",3)(97,"label",18),QC(98,"Voice input method:"),hl(),ws(99,"select",19),Rg("change",function(o){return n.onVoiceInputModeChange(o)}),ws(100,"option",20),QC(101,"Browser (real-time)"),hl(),ws(102,"option",21),QC(103,"Whisper (higher accuracy)"),hl(),ws(104,"option",22),QC(105,"Voice message (send audio)"),hl()()(),ws(106,"div",3)(107,"label",23),QC(108,"Voice recognition language:"),hl(),ws(109,"select",24),em("ngModelChange",function(o){return tT(n.selectedVoiceLanguage,o)||(n.selectedVoiceLanguage=o),o}),Rg("change",function(){return n.onVoiceLanguageChange()}),cC(110,ct,2,3,"option",25,rt),hl(),GI(),hl(),ws(112,"div",3)(113,"span",10),QC(114,"Automatic announcement:"),hl(),ws(115,"div",4)(116,"label",5)(117,"input",26),em("ngModelChange",function(o){return tT(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),Rg("change",function(){return n.onVoiceAnnounceEnabledChange()}),hl(),GI(),Sg(118,"span",7),QC(119," Enabled "),hl(),ws(120,"label",5)(121,"input",26),em("ngModelChange",function(o){return tT(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),Rg("change",function(){return n.onVoiceAnnounceEnabledChange()}),hl(),GI(),Sg(122,"span",7),QC(123," Disabled "),hl()()(),ws(124,"div",3)(125,"span",10),QC(126,"Voice mode:"),hl(),ws(127,"div",4)(128,"label",5)(129,"input",27),em("ngModelChange",function(o){return tT(n.voiceMode,o)||(n.voiceMode=o),o}),Rg("change",function(){return n.onVoiceModeChange()}),hl(),GI(),Sg(130,"span",7),QC(131," Voice synthesis "),hl(),ws(132,"label",5)(133,"input",28),em("ngModelChange",function(o){return tT(n.voiceMode,o)||(n.voiceMode=o),o}),Rg("change",function(){return n.onVoiceModeChange()}),hl(),GI(),Sg(134,"span",7),QC(135," Sound notification "),hl()()(),ws(136,"div",3)(137,"span",10),QC(138,"Message reading:"),hl(),ws(139,"div",4)(140,"label",5)(141,"input",29),em("ngModelChange",function(o){return tT(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),Rg("change",function(){return n.onVoiceReadFullTextChange()}),hl(),GI(),Sg(142,"span",7),QC(143," Full message "),hl(),ws(144,"label",5)(145,"input",29),em("ngModelChange",function(o){return tT(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),Rg("change",function(){return n.onVoiceReadFullTextChange()}),hl(),GI(),Sg(146,"span",7),QC(147," First paragraphs only "),hl()()(),ws(148,"div",3)(149,"label",30),QC(150,"Selected voice:"),hl(),ws(151,"select",31),em("ngModelChange",function(o){return tT(n.selectedVoiceId,o)||(n.selectedVoiceId=o),o}),Rg("change",function(){return n.onSelectedVoiceChange()}),oC(152,lt,2,0,"option",32),oC(153,dt,2,0,"option",32),cC(154,pt,2,2,"option",25,at),hl(),GI(),Sg(156,"div",10),ws(157,"a",33),Rg("click",function(){return n.testVoice()}),ws(158,"span",34),QC(159,"Test voice"),hl()()(),ws(160,"div",3)(161,"label",35),QC(162),hl(),ws(163,"input",36),em("ngModelChange",function(o){return tT(n.voiceVolume,o)||(n.voiceVolume=o),o}),Rg("input",function(){return n.onVoiceVolumeChange()}),hl(),GI(),hl(),ws(164,"div",3)(165,"label",37),QC(166),hl(),ws(167,"input",38),em("ngModelChange",function(o){return tT(n.voiceRate,o)||(n.voiceRate=o),o}),Rg("input",function(){return n.onVoiceRateChange()}),hl(),GI(),hl()()()),t&2&&(nI(10),Jg("ngModel",n.selectedTheme),qI(),nI(4),Jg("ngModel",n.selectedTheme),qI(),nI(4),Jg("ngModel",n.selectedTheme),qI(),nI(14),bg("value",true),Jg("ngModel",n.useEnterToSend),qI(),nI(4),bg("value",false),Jg("ngModel",n.useEnterToSend),qI(),nI(7),Jg("ngModel",n.showTechnicalMessages),qI(),nI(5),Jg("ngModel",n.showWarningMessages),qI(),nI(5),Jg("ngModel",n.printTechnicalMessages),qI(),nI(14),Jg("ngModel",n.missionPreviewEnabled),qI(),nI(11),Jg("ngModel",n.agentNotificationEnabled),qI(),nI(5),Jg("ngModel",n.notificationSoundEnabled),bg("disabled",!n.agentNotificationEnabled),qI(),nI(5),Jg("ngModel",n.browserNotificationEnabled),bg("disabled",!n.agentNotificationEnabled||n.browserNotificationDenied),qI(),nI(),iC(n.browserNotificationDenied?89:-1),nI(10),bg("value",n.voiceInputMode),nI(10),Jg("ngModel",n.selectedVoiceLanguage),qI(),nI(),uC(n.voiceLanguageOptions),nI(7),bg("value",true),Jg("ngModel",n.voiceAnnounceEnabled),qI(),nI(4),bg("value",false),Jg("ngModel",n.voiceAnnounceEnabled),qI(),nI(8),Jg("ngModel",n.voiceMode),qI(),nI(4),Jg("ngModel",n.voiceMode),qI(),nI(8),bg("value",true),Jg("ngModel",n.voiceReadFullText),qI(),nI(4),bg("value",false),Jg("ngModel",n.voiceReadFullText),qI(),nI(6),Jg("ngModel",n.selectedVoiceId),bg("disabled",n.loadingVoices||n.availableVoices.length===0),qI(),nI(),iC(n.loadingVoices?152:-1),nI(),iC(!n.loadingVoices&&n.availableVoices.length===0?153:-1),nI(),uC(n.availableVoices),nI(8),Dl("Volume: ",n.voiceVolume,"%"),nI(),Jg("ngModel",n.voiceVolume),qI(),nI(3),Dl("Speed: ",n.voiceRate,"%"),nI(),Jg("ngModel",n.voiceRate),qI());},dependencies:[ti,Qn,ei,Ye$1,_n,At,mn,Zn,cn,wt,se],styles:['.options-content[_ngcontent-%COMP%]{padding:0;width:100%}.option-group[_ngcontent-%COMP%]{padding:0 1rem 1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border-light)}.option-group[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.option-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;color:var(--color-text);font-size:.875rem}.toggle-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.toggle-option[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0;flex:1}.toggle-option[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex-shrink:0}.option-label-with-hint[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1}.option-label-with-hint[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0}.option-label-with-hint[_ngcontent-%COMP%] .option-hint[_ngcontent-%COMP%]{font-size:.775rem;color:var(--color-text-secondary);line-height:1.4}.option-select[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-input-bg);color:var(--color-text);font-size:.875rem;cursor:pointer}.option-select[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px #7064fb1a}.option-select[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.option-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{padding:.5rem}.option-checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--color-border);border-radius:3px;margin-right:.75rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";width:10px;height:6px;border-left:2px solid transparent;border-bottom:2px solid transparent;transform:rotate(-45deg);transition:all .2s ease;opacity:0}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]{background-color:var(--color-primary);border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]:after{border-left-color:#fff;border-bottom-color:#fff;opacity:1}.option-checkbox[_ngcontent-%COMP%]:hover .checkmark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%]:focus-within .checkmark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-section[_ngcontent-%COMP%]{padding-top:1rem;margin-top:1rem;border-top:2px solid var(--color-border)}.option-section[_ngcontent-%COMP%]:first-child{border-top:none;padding-top:0;margin-top:0}.section-title[_ngcontent-%COMP%]{margin:0 0 1rem;padding:0 1rem;font-size:.9rem;font-weight:600;color:var(--color-text);display:flex;align-items:center;gap:.5rem}.section-title[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.option-radio[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{display:none}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--color-border);border-radius:50%;margin-right:.5rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0;position:relative}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]:after{content:"";width:8px;height:8px;border-radius:50%;background-color:var(--color-primary);transition:all .2s ease;opacity:0;transform:scale(0)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]:after{opacity:1;transform:scale(1)}.option-radio[_ngcontent-%COMP%]:hover .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%]:focus-within .radio-mark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-slider[_ngcontent-%COMP%]{width:100%;height:6px;border-radius:3px;background:var(--color-bg-solid);outline:none;cursor:pointer;-webkit-appearance:none;appearance:none}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-webkit-slider-track{height:6px;border-radius:3px;background:var(--color-bg-secondary)}.option-slider[_ngcontent-%COMP%]::-moz-range-track{height:6px;border-radius:3px;background:var(--color-bg-secondary);border:none}.option-slider[_ngcontent-%COMP%]:focus{outline:none}.option-slider[_ngcontent-%COMP%]:focus::-webkit-slider-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.option-slider[_ngcontent-%COMP%]:focus::-moz-range-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.test-voice-btn[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;background:var(--color-primary);color:#fff;border:none;border-radius:6px;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:.5rem}.test-voice-btn[_ngcontent-%COMP%]:hover{background:var(--color-primary-hover);transform:translateY(-1px);box-shadow:0 2px 8px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 1px 4px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:focus{outline:none;box-shadow:0 0 0 3px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:disabled{background:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;transform:none;box-shadow:none}.test-voice-link[_ngcontent-%COMP%]{text-decoration-thickness:1.5px;text-underline-offset:3px;background:transparent;border:none;padding:0;font-size:.775rem;font-weight:400;cursor:pointer;transition:all .2s ease;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;text-decoration:underline}.test-voice-link[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover, var(--color-primary));text-decoration-thickness:2px}.test-voice-link[_ngcontent-%COMP%]:active{opacity:.8}.test-voice-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.test-voice-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.notification-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.75rem;margin-top:.75rem;background-color:#d32f2f1a;border:1px solid rgba(211,47,47,.3);border-radius:6px;font-size:.8125rem;line-height:1.5}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#d32f2f;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{color:var(--color-text);flex:1}.notification-error[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;background-color:#f443361a;border:1px solid rgba(244,67,54,.3);border-radius:6px;display:flex;align-items:flex-start;gap:.5rem}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#f44336;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text);line-height:1.5;flex:1}'],changeDetection:1})};function Qe(c){let e=c.args??"",t;try{let n=JSON.parse(e);t=JSON.stringify(n,null,2);}catch(n){t=e;}return `\u{1F527} ${c.name}
179
179
 
180
- ${t}`}var Ge=class c{destroy$=new ce;currentProject=null;currentThread=null;messagesSubject=new Tr([]);isThinkingSubject=new Tr(false);currentChoiceSubject=new Tr(null);projectTitleSubject=new Tr("Coday");currentInviteEventSubject=new Tr(null);messageToRestoreSubject=new Tr("");threadUpdateEventSubject=new Tr(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new Tr("");subThreadEventsSubject=new ce;subThreadEvents$=this.subThreadEventsSubject.asObservable();subThreadEventBuffers=new Map;getBufferedSubThreadEvents(e){return this.subThreadEventBuffers.get(e)??[]}messages$=this.messagesSubject.asObservable();streamingText$=this.streamingTextSubject.asObservable();isThinking$=this.isThinkingSubject.asObservable();currentChoice$=this.currentChoiceSubject.asObservable();currentInviteEvent$=this.currentInviteEventSubject.asObservable();messageToRestore$=this.messageToRestoreSubject.asObservable();threadUpdateEvent$=this.threadUpdateEventSubject.asObservable();connectionStatus$;tabTitleService=null;eventStream=g(fe);messageApi=g(be);userService=g(pe);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling();}setTabTitleService(e){this.tabTitleService=e;}connectToThread(e,t){this.currentProject=e,this.currentThread=t,this.eventStream.connectToThread(e,t);}loadHistoryFromRest(e){for(let t of e){let n=le(t);n&&this.handleEvent(n,true);}}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.subThreadEventBuffers.clear(),this.stopThinking();}sendMessage(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}let t=this.currentInviteEventSubject.value;if(t){this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.thinkingTimeout=setTimeout(()=>{this.thinkingTimeout=null,this.stopThinking(),console.warn("[CODAY] Safety timeout: no server response after 30 s, releasing thinking state");},3e4),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let n=t.buildAnswer(e);this.messageApi.sendMessage(n).subscribe({error:i=>{console.error("[CODAY] Send invite answer error:",i),this.currentInviteEventSubject.next(t),this.stopThinking();}});}else this.messageApi.sendFreeMessage(e).subscribe({error:n=>{console.error("[CODAY] Send error:",n);}});}sendChoice(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.thinkingTimeout=setTimeout(()=>{this.thinkingTimeout=null,this.stopThinking(),console.warn("[CODAY] Safety timeout: no server response after 30 s, releasing thinking state");},3e4),this.tabTitleService?.setSystemActive();let t=this.currentChoiceEvent.buildAnswer(e);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(t).subscribe({next:()=>{},error:n=>{console.error("[CODAY-CHOICE] Choice error:",n),this.stopThinking();}});}else console.error("[CODAY-CHOICE] No choice event available for choice:",e);}deleteMessage(e){let t=this.messagesSubject.value.find(i=>i.id===e),n=this.extractTextContentFromMessage(t);return this.messageApi.deleteMessage(e).pipe(Od(i=>{i.success&&(this.removeMessagesFromIndex(e),n.trim()&&this.messageToRestoreSubject.next(n));}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(true),this.tabTitleService?.setSystemActive();}initializeEventHandling(){this.eventStream.events$.pipe(Vy(this.destroy$)).subscribe({next:e=>this.handleEvent(e),error:e=>console.error("[CODAY] Event stream error:",e),complete:()=>console.log("[CODAY] Event stream completed")});}handleEvent(e,t=false){if(e.threadId&&e.threadId!==this.currentThread){let n=this.subThreadEventBuffers.get(e.threadId);n?n.push(e):this.subThreadEventBuffers.set(e.threadId,[e]),this.subThreadEventsSubject.next(e);return}e instanceof T?this.handleMessageEvent(e):e instanceof B?this.handleTextChunkEvent(e):e instanceof A?this.handleTextEvent(e):e instanceof u?this.handleAnswerEvent(e):e instanceof h?this.handleErrorEvent(e):e instanceof M?this.handleWarnEvent(e):e instanceof O?this.handleThinkingEvent(e):e instanceof v?this.handleToolRequestEvent(e):e instanceof m?this.handleToolResponseEvent(e):e instanceof b?this.handleChoiceEvent(e,t):e instanceof F?this.handleHeartBeatEvent(e):e instanceof f?this.handleInviteEvent(e,t):e instanceof V?this.handleThreadUpdateEvent(e):e instanceof R?this.handleDelegationEvent(e):e instanceof H||e instanceof K||console.warn("[CODAY] Unhandled event type:",e.type);}handleDelegationEvent(e){if(console.log("[CODAY] DelegationEvent received:",e.subThreadId,e.agentName),this.messagesSubject.value.findIndex(i=>i.subThreadId===e.subThreadId)===-1){let i={id:e.timestamp,role:"system",speaker:e.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:e.subThreadId,delegationAgentName:e.agentName};this.addMessage(i);}}handleThreadUpdateEvent(e){this.threadUpdateEventSubject.next(e);}handleMessageEvent(e){e.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let t={id:e.timestamp,role:e.role,speaker:e.name,content:e.content,timestamp:e.date,type:"text"};this.addMessage(t);}handleTextChunkEvent(e){this.accumulatedChunks+=e.chunk,this.streamingTextSubject.next(this.accumulatedChunks);}handleTextEvent(e){let t={id:e.timestamp,role:e.speaker?"assistant":"system",speaker:e.speaker??"System",content:[{type:"text",content:e.text}],timestamp:e.date,type:e.speaker?"text":"technical"};this.addMessage(t);}handleAnswerEvent(e){let t=this.currentInviteEventSubject.value;if(t){let i=!!e.parentKey&&e.parentKey===t.timestamp,o=!e.parentKey&&e.date>=t.date;(i||o)&&this.currentInviteEventSubject.next(null);}if(this.currentChoiceEvent){let i=!!e.parentKey&&e.parentKey===this.currentChoiceEvent.timestamp,o=!e.parentKey&&e.date>=this.currentChoiceEvent.date;(i||o)&&(this.currentChoiceEvent=null,this.currentChoiceSubject.next(null));}if(e.silent)return;let n={id:e.timestamp,role:"user",speaker:e.name??this.userService.getUsername()??"User",content:[{type:"text",content:e.answer}],timestamp:e.date,type:"text",parentKey:e.parentKey,invite:e.invite};this.addMessage(n);}handleErrorEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(e.error)}`}],timestamp:e.date,type:"error"};this.addMessage(t);}handleWarnEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(e.warning)}`}],timestamp:e.date,type:"warning"};this.addMessage(t);}handleThinkingEvent(e){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(false),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive();},O.debounce+1e3));}handleToolRequestEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp,fullContent:Qe(e)};this.addMessage(t);}handleToolResponseEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp};this.addMessage(t);}handleChoiceEvent(e,t=false){this.stopThinking();let n={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite}],timestamp:e.date,type:"text"};if(this.addMessage(n),t||this.messagesSubject.value.some(y=>y.parentKey===e.timestamp||y.role==="user"&&y.timestamp>e.date||y.role==="assistant"&&y.timestamp>e.date))return;this.currentChoiceEvent=e,this.tabTitleService?.setSystemInactive();let E=e.options.map(y=>({value:y,label:y})),C=e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite;this.currentChoiceSubject.next({options:E,label:C,allowFreeText:e.allowFreeText});}handleHeartBeatEvent(e){}handleInviteEvent(e,t=false){if(this.stopThinking(),e.invite===_e)t||(this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive());else {let i={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.invite}],timestamp:e.date,type:"text"};this.addMessage(i),this.messagesSubject.value.some(C=>C.parentKey===e.timestamp||C.role==="user"&&C.timestamp>e.date||C.role==="assistant"&&C.timestamp>e.date)||t||(this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive());}}addMessage(e){let t=this.messagesSubject.value;t.some(n=>n.id===e.id)||this.messagesSubject.next([...t,e]);}removeMessagesFromIndex(e){let t=this.messagesSubject.value,n=t.findIndex(o=>o.id===e);if(n===-1||n===0)return;let i=t.slice(0,n);this.messagesSubject.next(i),this.stopThinking();}extractTextContentFromMessage(e){return e?e.content.filter(t=>t.type==="text").map(t=>t.content).join(`
180
+ ${t}`}var Ge=class c{destroy$=new ce;currentProject=null;currentThread=null;messagesSubject=new Tr([]);isThinkingSubject=new Tr(false);currentChoiceSubject=new Tr(null);projectTitleSubject=new Tr("Coday");currentInviteEventSubject=new Tr(null);messageToRestoreSubject=new Tr("");threadUpdateEventSubject=new Tr(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new Tr("");subThreadEventsSubject=new ce;subThreadEvents$=this.subThreadEventsSubject.asObservable();subThreadEventBuffers=new Map;getBufferedSubThreadEvents(e){return this.subThreadEventBuffers.get(e)??[]}messages$=this.messagesSubject.asObservable();streamingText$=this.streamingTextSubject.asObservable();isThinking$=this.isThinkingSubject.asObservable();currentChoice$=this.currentChoiceSubject.asObservable();currentInviteEvent$=this.currentInviteEventSubject.asObservable();messageToRestore$=this.messageToRestoreSubject.asObservable();threadUpdateEvent$=this.threadUpdateEventSubject.asObservable();connectionStatus$;tabTitleService=null;eventStream=g(fe);messageApi=g(be);userService=g(pe);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling();}setTabTitleService(e){this.tabTitleService=e;}connectToThread(e,t){this.currentProject=e,this.currentThread=t,this.eventStream.connectToThread(e,t);}loadHistoryFromRest(e){for(let t of e){let n=le(t);n&&this.handleEvent(n,true);}}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.subThreadEventBuffers.clear(),this.stopThinking();}sendMessage(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}let t=this.currentInviteEventSubject.value;if(t){this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.thinkingTimeout=setTimeout(()=>{this.thinkingTimeout=null,this.stopThinking(),console.warn("[CODAY] Safety timeout: no server response after 30 s, releasing thinking state");},3e4),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let n=t.buildAnswer(e);this.messageApi.sendMessage(n).subscribe({error:i=>{console.error("[CODAY] Send invite answer error:",i),this.currentInviteEventSubject.next(t),this.stopThinking();}});}else this.messageApi.sendFreeMessage(e).subscribe({error:n=>{console.error("[CODAY] Send error:",n);}});}sendChoice(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.thinkingTimeout=setTimeout(()=>{this.thinkingTimeout=null,this.stopThinking(),console.warn("[CODAY] Safety timeout: no server response after 30 s, releasing thinking state");},3e4),this.tabTitleService?.setSystemActive();let t=this.currentChoiceEvent.buildAnswer(e);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(t).subscribe({next:()=>{},error:n=>{console.error("[CODAY-CHOICE] Choice error:",n),this.stopThinking();}});}else console.error("[CODAY-CHOICE] No choice event available for choice:",e);}deleteMessage(e){let t=this.messagesSubject.value.find(i=>i.id===e),n=this.extractTextContentFromMessage(t);return this.messageApi.deleteMessage(e).pipe(kd(i=>{i.success&&(this.removeMessagesFromIndex(e),n.trim()&&this.messageToRestoreSubject.next(n));}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(true),this.tabTitleService?.setSystemActive();}initializeEventHandling(){this.eventStream.events$.pipe(Hy(this.destroy$)).subscribe({next:e=>this.handleEvent(e),error:e=>console.error("[CODAY] Event stream error:",e),complete:()=>console.log("[CODAY] Event stream completed")});}handleEvent(e,t=false){if(e.threadId&&e.threadId!==this.currentThread){let n=this.subThreadEventBuffers.get(e.threadId);n?n.push(e):this.subThreadEventBuffers.set(e.threadId,[e]),this.subThreadEventsSubject.next(e);return}e instanceof T?this.handleMessageEvent(e):e instanceof B?this.handleTextChunkEvent(e):e instanceof A?this.handleTextEvent(e):e instanceof u?this.handleAnswerEvent(e):e instanceof h?this.handleErrorEvent(e):e instanceof M?this.handleWarnEvent(e):e instanceof O?this.handleThinkingEvent(e):e instanceof v?this.handleToolRequestEvent(e):e instanceof m?this.handleToolResponseEvent(e):e instanceof b?this.handleChoiceEvent(e,t):e instanceof F?this.handleHeartBeatEvent(e):e instanceof f?this.handleInviteEvent(e,t):e instanceof V?this.handleThreadUpdateEvent(e):e instanceof R?this.handleDelegationEvent(e):e instanceof H||e instanceof K||console.warn("[CODAY] Unhandled event type:",e.type);}handleDelegationEvent(e){if(console.log("[CODAY] DelegationEvent received:",e.subThreadId,e.agentName),this.messagesSubject.value.findIndex(i=>i.subThreadId===e.subThreadId)===-1){let i={id:e.timestamp,role:"system",speaker:e.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:e.subThreadId,delegationAgentName:e.agentName};this.addMessage(i);}}handleThreadUpdateEvent(e){this.threadUpdateEventSubject.next(e);}handleMessageEvent(e){e.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let t={id:e.timestamp,role:e.role,speaker:e.name,content:e.content,timestamp:e.date,type:"text"};this.addMessage(t);}handleTextChunkEvent(e){this.accumulatedChunks+=e.chunk,this.streamingTextSubject.next(this.accumulatedChunks);}handleTextEvent(e){let t={id:e.timestamp,role:e.speaker?"assistant":"system",speaker:e.speaker??"System",content:[{type:"text",content:e.text}],timestamp:e.date,type:e.speaker?"text":"technical"};this.addMessage(t);}handleAnswerEvent(e){let t=this.currentInviteEventSubject.value;if(t){let i=!!e.parentKey&&e.parentKey===t.timestamp,o=!e.parentKey&&e.date>=t.date;(i||o)&&this.currentInviteEventSubject.next(null);}if(this.currentChoiceEvent){let i=!!e.parentKey&&e.parentKey===this.currentChoiceEvent.timestamp,o=!e.parentKey&&e.date>=this.currentChoiceEvent.date;(i||o)&&(this.currentChoiceEvent=null,this.currentChoiceSubject.next(null));}if(e.silent)return;let n={id:e.timestamp,role:"user",speaker:e.name??this.userService.getUsername()??"User",content:[{type:"text",content:e.answer}],timestamp:e.date,type:"text",parentKey:e.parentKey,invite:e.invite};this.addMessage(n);}handleErrorEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(e.error)}`}],timestamp:e.date,type:"error"};this.addMessage(t);}handleWarnEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(e.warning)}`}],timestamp:e.date,type:"warning"};this.addMessage(t);}handleThinkingEvent(e){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(true),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(false),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive();},O.debounce+1e3));}handleToolRequestEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp,fullContent:Qe(e)};this.addMessage(t);}handleToolResponseEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp};this.addMessage(t);}handleChoiceEvent(e,t=false){this.stopThinking();let n={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite}],timestamp:e.date,type:"text"};if(this.addMessage(n),t||this.messagesSubject.value.some(y=>y.parentKey===e.timestamp||y.role==="user"&&y.timestamp>e.date||y.role==="assistant"&&y.timestamp>e.date))return;this.currentChoiceEvent=e,this.tabTitleService?.setSystemInactive();let E=e.options.map(y=>({value:y,label:y})),C=e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite;this.currentChoiceSubject.next({options:E,label:C,allowFreeText:e.allowFreeText});}handleHeartBeatEvent(e){}handleInviteEvent(e,t=false){if(this.stopThinking(),e.invite===_e)t||(this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive());else {let i={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.invite}],timestamp:e.date,type:"text"};this.addMessage(i),this.messagesSubject.value.some(C=>C.parentKey===e.timestamp||C.role==="user"&&C.timestamp>e.date||C.role==="assistant"&&C.timestamp>e.date)||t||(this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive());}}addMessage(e){let t=this.messagesSubject.value;t.some(n=>n.id===e.id)||this.messagesSubject.next([...t,e]);}removeMessagesFromIndex(e){let t=this.messagesSubject.value,n=t.findIndex(o=>o.id===e);if(n===-1||n===0)return;let i=t.slice(0,n);this.messagesSubject.next(i),this.stopThinking();}extractTextContentFromMessage(e){return e?e.content.filter(t=>t.type==="text").map(t=>t.content).join(`
181
181
 
182
- `):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null);}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(false),this.tabTitleService&&this.tabTitleService.setSystemInactive();}ngOnDestroy(){this.clearThinkingTimeout(),this.destroy$.next(),this.destroy$.complete(),this.currentInviteEventSubject.complete(),this.messageToRestoreSubject.complete(),this.threadUpdateEventSubject.complete(),this.streamingTextSubject.complete(),this.eventStream.disconnect();}static \u0275fac=function(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};function gt(c,e){if(c&1&&(Is(0,"div",3),qC(1),pl()),c&2){let t=yC();JE(),vl("\u274C ",t.errorMessage);}}var Ze=class c{dialogRef=g(z$1);data=g(Ue);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName);}getDefaultTitle(e,t){return e==="user"?"User Configuration":`Project Configuration: ${t||"Unknown"}`}onSave(){this.errorMessage="";let e;try{e=JSON.parse(this.jsonContent);}catch(t){this.errorMessage=`Invalid JSON syntax: ${t instanceof Error?t.message:"Unknown error"}`;return}this.dialogRef.close(e);}onCancel(){this.dialogRef.close();}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=Rw({type:c,selectors:[["app-json-editor"]],decls:13,vars:3,consts:[["mat-dialog-title",""],["mat-icon-button","","title","Close",1,"close-button",3,"click"],["spellcheck","false","placeholder","Enter JSON configuration...",1,"json-textarea",3,"ngModelChange","ngModel"],[1,"error-message"],["align","end"],["matButton","",3,"click"],["matButton","filled","color","primary",3,"click"]],template:function(t,n){t&1&&(Is(0,"div",0),qC(1),Is(2,"button",1),Ag("click",function(){return n.onCancel()}),Is(3,"mat-icon"),qC(4,"close"),pl()()(),Is(5,"mat-dialog-content")(6,"textarea",2),Jg("ngModelChange",function(o){return XC(n.jsonContent,o)||(n.jsonContent=o),o}),pl(),UI(),tC(7,gt,2,1,"div",3),pl(),Is(8,"mat-dialog-actions",4)(9,"button",5),Ag("click",function(){return n.onCancel()}),qC(10,"Cancel"),pl(),Is(11,"button",6),Ag("click",function(){return n.onSave()}),qC(12,"Save"),pl()()),t&2&&(JE(),vl(" ",n.title," "),JE(5),Xg("ngModel",n.jsonContent),zI(),JE(),nC(n.errorMessage?7:-1));},dependencies:[Gm,ti,Ye$1,Zn,cn,wt,Gn,pr,jt,Nt,Vt],styles:["[mat-dialog-title][_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}[mat-dialog-title][_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{margin-left:auto}mat-dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;min-height:400px}.json-textarea[_ngcontent-%COMP%]{flex:1;min-height:300px;max-height:80vh;padding:1rem;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.875rem;line-height:1.5;background:var(--color-code-bg);color:var(--color-text);border:1px solid var(--color-border);border-radius:4px;resize:vertical;outline:none;transition:border-color .2s}.json-textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.json-textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.6}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:4px;font-size:.875rem;line-height:1.4;background:#dc26261a;color:#dc2626;border:1px solid rgba(220,38,38,.3)}"],changeDetection:1})};export{Et as E,Ge as G,Qe as Q,Ye as Y,Ze as Z,yt as y,z};
182
+ `):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null);}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(false),this.tabTitleService&&this.tabTitleService.setSystemInactive();}ngOnDestroy(){this.clearThinkingTimeout(),this.destroy$.next(),this.destroy$.complete(),this.currentInviteEventSubject.complete(),this.messageToRestoreSubject.complete(),this.threadUpdateEventSubject.complete(),this.streamingTextSubject.complete(),this.eventStream.disconnect();}static \u0275fac=function(t){return new(t||c)};static \u0275prov=x({token:c,factory:c.\u0275fac,providedIn:"root"})};function gt(c,e){if(c&1&&(ws(0,"div",3),QC(1),hl()),c&2){let t=EC();nI(),Dl("\u274C ",t.errorMessage);}}var Ze=class c{dialogRef=g(z$1);data=g(Ue);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName);}getDefaultTitle(e,t){return e==="user"?"User Configuration":`Project Configuration: ${t||"Unknown"}`}onSave(){this.errorMessage="";let e;try{e=JSON.parse(this.jsonContent);}catch(t){this.errorMessage=`Invalid JSON syntax: ${t instanceof Error?t.message:"Unknown error"}`;return}this.dialogRef.close(e);}onCancel(){this.dialogRef.close();}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=Fw({type:c,selectors:[["app-json-editor"]],decls:13,vars:3,consts:[["mat-dialog-title",""],["mat-icon-button","","title","Close",1,"close-button",3,"click"],["spellcheck","false","placeholder","Enter JSON configuration...",1,"json-textarea",3,"ngModelChange","ngModel"],[1,"error-message"],["align","end"],["matButton","",3,"click"],["matButton","filled","color","primary",3,"click"]],template:function(t,n){t&1&&(ws(0,"div",0),QC(1),ws(2,"button",1),Rg("click",function(){return n.onCancel()}),ws(3,"mat-icon"),QC(4,"close"),hl()()(),ws(5,"mat-dialog-content")(6,"textarea",2),em("ngModelChange",function(o){return tT(n.jsonContent,o)||(n.jsonContent=o),o}),hl(),GI(),oC(7,gt,2,1,"div",3),hl(),ws(8,"mat-dialog-actions",4)(9,"button",5),Rg("click",function(){return n.onCancel()}),QC(10,"Cancel"),hl(),ws(11,"button",6),Rg("click",function(){return n.onSave()}),QC(12,"Save"),hl()()),t&2&&(nI(),Dl(" ",n.title," "),nI(5),Jg("ngModel",n.jsonContent),qI(),nI(),iC(n.errorMessage?7:-1));},dependencies:[Wm,ti,Ye$1,Zn,cn,wt,Gn,pr,jt,Nt,Vt],styles:["[mat-dialog-title][_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}[mat-dialog-title][_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{margin-left:auto}mat-dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;min-height:400px}.json-textarea[_ngcontent-%COMP%]{flex:1;min-height:300px;max-height:80vh;padding:1rem;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.875rem;line-height:1.5;background:var(--color-code-bg);color:var(--color-text);border:1px solid var(--color-border);border-radius:4px;resize:vertical;outline:none;transition:border-color .2s}.json-textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.json-textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.6}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:4px;font-size:.875rem;line-height:1.4;background:#dc26261a;color:#dc2626;border:1px solid rgba(220,38,38,.3)}"],changeDetection:1})};export{Et as E,Ge as G,Qe as Q,Ye as Y,Ze as Z,yt as y,z};