@whoz-oss/coday-client 3.15.1 → 3.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-CUmS2-ak.js → chunk-0njD_aMa.js} +1 -1
- package/browser/{chunk-CNIfOUla.js → chunk-6WIaUDav.js} +1 -1
- package/browser/{chunk-9CSRlx74.js → chunk-B1OTuTxt.js} +1 -1
- package/browser/{chunk-CyUmCedx.js → chunk-B3-4EW3s.js} +1 -1
- package/browser/{chunk-K-fhwl_z.js → chunk-B626-rya.js} +1 -1
- package/browser/{chunk-Bnic_hdt.js → chunk-B6BZBDSv.js} +5 -5
- package/browser/{chunk-Cf3l2UgA.js → chunk-B7kKWG4P.js} +1 -1
- package/browser/chunk-B7yga-a4.js +1 -0
- package/browser/{chunk-DYE131qf.js → chunk-BAWubWk8.js} +1 -1
- package/browser/chunk-BDaTUrH4.js +1 -0
- package/browser/{chunk-BKlwFrFB.js → chunk-BHvLB-pV.js} +1 -1
- package/browser/{chunk-Dg6QAZUw.js → chunk-BJ5G7Y-a.js} +2 -2
- package/browser/{chunk-B5_o_qhk.js → chunk-BPfJALqU.js} +1 -1
- package/browser/{chunk-DzicJow4.js → chunk-BTX631I3.js} +3 -3
- package/browser/{chunk-Jv7RGmnK.js → chunk-BVAD9f9s.js} +1 -1
- package/browser/{chunk-fP29MqaN.js → chunk-BXkvjekT.js} +1 -1
- package/browser/chunk-BYyTBqh4.js +37 -0
- package/browser/chunk-B_49KV6W.js +1 -0
- package/browser/{chunk-l0HLnBLv.js → chunk-BaO2vi_O.js} +6 -6
- package/browser/{chunk-Bgy3uCgK.js → chunk-BcT0wYqu.js} +1 -1
- package/browser/chunk-BdJzYh5V.js +190 -0
- package/browser/{chunk-Dd2dq7xg.js → chunk-Bgd8Jkga.js} +1 -1
- package/browser/chunk-BkN5jb4J.js +1 -0
- package/browser/{chunk-CysW_ro-.js → chunk-Brx_KbnM.js} +1 -1
- package/browser/{chunk-C5wr-vqf.js → chunk-BtEXE3Xz.js} +1 -1
- package/browser/{chunk-BhfpLr7-.js → chunk-Bu5Xq3QT.js} +1 -1
- package/browser/{chunk-DxxECdrg.js → chunk-BwDJA6_r.js} +2 -2
- package/browser/{chunk-mHtuxvLs.js → chunk-C2VdQfMJ.js} +1 -1
- package/browser/{chunk-BZMAEe_X.js → chunk-C49BBPGm.js} +1 -1
- package/browser/{chunk-BfD1F12k.js → chunk-C5WD0UQE.js} +3 -3
- package/browser/{chunk-C4U0w8cP.js → chunk-CI760KmO.js} +1 -1
- package/browser/{chunk-BqKdrvcS.js → chunk-CI7wYBKk.js} +1 -1
- package/browser/{chunk-BhM0bmJW.js → chunk-CKhGzoqa.js} +1 -1
- package/browser/{chunk-Dj9y_5pr.js → chunk-CNAj5Eon.js} +1 -1
- package/browser/{chunk-BIMT-HvS.js → chunk-CUz5MHdA.js} +1 -1
- package/browser/{chunk-DG2FCeMu.js → chunk-CXTwGKdl.js} +1 -1
- package/browser/{chunk-HSc9fwVS.js → chunk-Ci9l-k84.js} +1 -1
- package/browser/{chunk-D_vvo2qx.js → chunk-ClEmA_ih.js} +1 -1
- package/browser/{chunk-nWqZHM4o.js → chunk-ClSDInQq.js} +1 -1
- package/browser/{chunk-BVCQOGLR.js → chunk-CpZK7G-Q.js} +2 -2
- package/browser/{chunk-5LRyprMF.js → chunk-CxUcyBb9.js} +1 -1
- package/browser/{chunk-C6RPhP4t.js → chunk-D-jBfPIO.js} +1 -1
- package/browser/{chunk-n1eKIk8H.js → chunk-D202v_ff.js} +1 -1
- package/browser/{chunk-B11WEBEl.js → chunk-DCwEaE_b.js} +1 -1
- package/browser/{chunk-Ce03Ba0V.js → chunk-DFQuWS_F.js} +1 -1
- package/browser/{chunk-ZvcyZV3G.js → chunk-DHb3-uKf.js} +1 -1
- package/browser/{chunk-CcLheUaL.js → chunk-DKllQ3Ve.js} +1 -1
- package/browser/chunk-DMRb150M.js +2 -0
- package/browser/{chunk-5t7zJzqM.js → chunk-DMtXGu5h.js} +1 -1
- package/browser/{chunk-XgEfnfT0.js → chunk-DO3lSvop.js} +1 -1
- package/browser/{chunk-DYUMiAN8.js → chunk-DQtoh8wv.js} +1 -1
- package/browser/{chunk-DTIhOEG_.js → chunk-DjMtxVWg.js} +6 -6
- package/browser/{chunk-C7MXO6BQ.js → chunk-DjoW6kqa.js} +5 -5
- package/browser/{chunk-BgHTiTG2.js → chunk-DpHEu7EG.js} +1 -1
- package/browser/{chunk-CYMQSJz6.js → chunk-DqC8XT4v.js} +1 -1
- package/browser/{chunk-qARg6ese.js → chunk-DqioJb1X.js} +1 -1
- package/browser/chunk-DrzvCb86.js +1 -0
- package/browser/{chunk-BlWlE-Cq.js → chunk-DwFGK2iu.js} +1 -1
- package/browser/{chunk-DvzNS1Bs.js → chunk-DxrynR3o.js} +1 -1
- package/browser/chunk-DxvmpOv5.js +1 -0
- package/browser/{chunk-CyxhAtE7.js → chunk-EBW8PloQ.js} +1 -1
- package/browser/{chunk-CHrmSvQM.js → chunk-LVItL87L.js} +1 -1
- package/browser/{chunk-RxHlNJ_t.js → chunk-P8B5rz7L.js} +1 -1
- package/browser/chunk-R-GmZrHu.js +9 -0
- package/browser/{chunk-Bh1p6jDj.js → chunk-b6g-uBR5.js} +1 -1
- package/browser/{chunk-BUEM7g7F.js → chunk-bfpuueWC.js} +3 -3
- package/browser/{chunk-DX2ZzvT5.js → chunk-mrKeqPKc.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-6K2UFGD2.js → main-LBRSRTYI.js} +19 -19
- package/package.json +1 -1
- package/browser/chunk-BC0acSZF.js +0 -1
- package/browser/chunk-BLa2Gx7h.js +0 -190
- package/browser/chunk-B_2kLXvG.js +0 -1
- package/browser/chunk-C9tuHQmZ.js +0 -37
- package/browser/chunk-CebS4RAf.js +0 -1
- package/browser/chunk-CnnGSYzi.js +0 -2
- package/browser/chunk-DEsz0fzs.js +0 -1
- package/browser/chunk-DTZ7N3wC.js +0 -1
- package/browser/chunk-DXDohTwX.js +0 -1
- package/browser/chunk-uPxETzZs.js +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {an as ce,g,L,ci as me,ap as
|
|
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-LBRSRTYI.js';import {s as se}from'./chunk-CpZK7G-Q.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-BYyTBqh4.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(
|
|
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(/ /g," ").replace(/&/g,"and").replace(/</g,"<").replace(/>/g,">").replace(/"/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(
|
|
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&&(
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p}from'./chunk-
|
|
1
|
+
import {p}from'./chunk-R-GmZrHu.js';import {g,ao as V,I as fy,d4 as y,h as Fw,aw as gl,Q as QC,ax as ml,t as nI,a8 as Yg}from'./main-LBRSRTYI.js';import'./chunk-ClSDInQq.js';import'./chunk-BaO2vi_O.js';import'./chunk-DjMtxVWg.js';import'./chunk-BYyTBqh4.js';var A=class r{route=g(V);http=g(fy);config=g(y);message="Authentication in progress\u2026";ngOnInit(){let e=this.route.snapshot.queryParamMap.get("code"),t=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),i=this.route.snapshot.queryParamMap.get("error_description");if(o){console.warn("[AgentOS OAuth Callback] OAuth error:",o,i),this.notifyParentAndClose({success:false,error:i||o});return}if(!e){console.error("[AgentOS OAuth Callback] Missing authorization code"),this.message="OAuth callback error: missing authorization code.",this.notifyParentAndClose({success:false,error:"Missing authorization code"});return}this.http.post(`${this.config.basePath}/api/oauth/callback`,{code:e,state:t}).subscribe({next:()=>{console.log("[AgentOS OAuth Callback] Backend callback resolved"),this.notifyParentAndClose({success:true});},error:a=>{console.error("[AgentOS OAuth Callback] Backend callback failed:",a),this.notifyParentAndClose({success:false,error:a?.error?.message||a?.message||"Token exchange failed"});}});}notifyParentAndClose(e){if(this.message=e.success?"Authentication complete. You can close this window.":`Authentication failed: ${e.error??"unknown error"}. You can close this window.`,window.opener)try{window.opener.postMessage(e,window.location.origin);}catch(t){console.error("[AgentOS OAuth Callback] postMessage failed:",t),localStorage.setItem(p,JSON.stringify(e));}else console.warn("[AgentOS OAuth Callback] No window.opener \u2014 localStorage fallback"),localStorage.setItem(p,JSON.stringify(e));setTimeout(()=>window.close(),1e3);}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Fw({type:r,selectors:[["agentos-oauth-callback"]],decls:2,vars:1,consts:[[2,"font-family","sans-serif","padding","2rem","text-align","center"]],template:function(t,o){t&1&&(gl(0,"p",0),QC(1),ml()),t&2&&(nI(),Yg(o.message));},encapsulation:2,changeDetection:1})};export{A as OAuthCallbackComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,G,cb as
|
|
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-LBRSRTYI.js';import {Z as Zn,S as Se}from'./chunk-BaO2vi_O.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 {m}from'./chunk-uPxETzZs.js';import {g,ao as V,G,w as we,d8 as B,z as zi,c as U,a7 as ya,X as br,a as z$1,b as P,h as Rw,I as Is,A as Ag,q as qC,m as pl,t as tC,J as JE,a5 as vl,a8 as Zg,v as nC,a9 as fC,n as bg,a3 as UI,o as iC,bo as rC,ac as yC,T as Tg,H as Hg,a6 as zI,x as sC,aa as If,ab as wf}from'./main-6K2UFGD2.js';import {o as z,z as ze,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,Z as Zn,l as Xn,C as Cn,E as En,p as An,q as Ct,V as Vt}from'./chunk-C9tuHQmZ.js';import'./chunk-nWqZHM4o.js';import'./chunk-l0HLnBLv.js';import'./chunk-DTIhOEG_.js';var ne=(i,t)=>t.id;function ie(i,t){i&1&&(Is(0,"p",5),qC(1,"Loading\u2026"),pl());}function ae(i,t){i&1&&(Is(0,"span",12),qC(1,"Name is required."),pl());}function le(i,t){if(i&1&&(Is(0,"p",32),qC(1),pl(),Is(2,"span",26),qC(3,"Agent Config cannot be changed after creation."),pl()),i&2){let e=yC(3);JE(),Zg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function me(i,t){if(i&1&&(Is(0,"option",34),qC(1),pl()),i&2){let e=t.$implicit;Tg("ngValue",e.id),JE(),Zg(e.name);}}function pe(i,t){if(i&1&&(Is(0,"select",33)(1,"option",34),qC(2,"\u2014 None \u2014"),pl(),iC(3,me,2,2,"option",34,ne),pl(),UI(),Is(5,"span",26),qC(6,"Optional. Links this prompt to an agent as a starter. Immutable after creation."),pl()),i&2){let e=yC(3);Tg("formControl",e.agentConfigIdControl),zI(),JE(),Tg("ngValue",null),JE(2),sC(e.availableAgentConfigs());}}function de(i,t){if(i&1&&(Is(0,"div",8)(1,"label",31),qC(2,"Agent Config"),pl(),tC(3,le,4,1)(4,pe,7,2),pl()),i&2){let e=yC(2);JE(3),nC(e.isEditMode()&&e.agentConfigIdControl.value?3:e.isEditMode()?-1:4);}}function ce(i,t){i&1&&(Is(0,"p",19),qC(1,"No parameters defined."),pl());}function se(i,t){i&1&&(Is(0,"span",12),qC(1,"Parameter name is required."),pl());}function _e(i,t){if(i&1){let e=fC();Is(0,"div",20)(1,"div",35)(2,"div",36)(3,"label",37),qC(4,"Name "),Is(5,"span",10),qC(6,"*"),pl()(),bg(7,"input",38),UI(),tC(8,se,2,0,"span",12),pl(),Is(9,"div",36)(10,"label",37),qC(11,"Description"),pl(),bg(12,"input",39),UI(),pl(),Is(13,"div",36)(14,"label",37),qC(15,"Default value"),pl(),bg(16,"input",40),UI(),pl()(),Is(17,"button",41),Ag("click",function(){let m=If(e).$index,d=yC(2);return wf(d.removeParameter(m))}),qC(18," \xD7 "),pl()();}if(i&2){let e=t.$implicit,l=t.$index;Tg("formGroupName",l),JE(3),Tg("for","param-name-"+l),JE(4),Hg("prompt-form__input--invalid",e.controls.name.invalid&&e.controls.name.touched),Tg("id","param-name-"+l),zI(),JE(),nC(e.controls.name.invalid&&e.controls.name.touched?8:-1),JE(2),Tg("for","param-desc-"+l),JE(2),Tg("id","param-desc-"+l),zI(),JE(2),Tg("for","param-default-"+l),JE(2),Tg("id","param-default-"+l),zI();}}function fe(i,t){i&1&&(Is(0,"span",12),qC(1,"Content entry must not be blank."),pl());}function ue(i,t){if(i&1){let e=fC();Is(0,"div",22)(1,"span",42),qC(2),pl(),Is(3,"div",43),bg(4,"textarea",44),UI(),tC(5,fe,2,0,"span",12),pl(),Is(6,"button",45),Ag("click",function(){let m=If(e).$index,d=yC(2);return wf(d.removeContentEntry(m))}),qC(7," \xD7 "),pl()();}if(i&2){let e=t.$implicit,l=t.$index,m=yC(2);JE(2),Zg(l+1),JE(2),Hg("prompt-form__textarea--invalid",e.invalid&&e.touched),Tg("formControlName",l),zI(),JE(),nC(e.invalid&&e.touched?5:-1),JE(),Tg("disabled",m.contentArray.length===1);}}function ge(i,t){if(i&1&&(Is(0,"p",23),qC(1),pl()),i&2){let e=yC(2);JE(),Zg(e.errorMessage());}}function Ce(i,t){i&1&&(Is(0,"span",12),qC(1,"Invalid JSON."),pl());}function xe(i,t){if(i&1){let e=fC();Is(0,"button",46),Ag("click",function(){If(e);let m=yC(2);return wf(m.exportYaml())}),qC(1),pl();}if(i&2){let e=yC(2);Tg("disabled",e.isExporting()),JE(),vl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ve(i,t){if(i&1){let e=fC();Is(0,"form",7),Ag("ngSubmit",function(){If(e);let m=yC();return wf(m.submit())}),Is(1,"div",8)(2,"label",9),qC(3,"Name "),Is(4,"span",10),qC(5,"*"),pl()(),bg(6,"input",11),UI(),tC(7,ae,2,0,"span",12),pl(),Is(8,"div",8)(9,"label",13),qC(10,"Description"),pl(),bg(11,"input",14),UI(),pl(),tC(12,de,5,1,"div",8),Is(13,"fieldset",15)(14,"legend",16),qC(15," Parameters "),Is(16,"span",17),qC(17,"Named placeholders used in content"),pl()(),Is(18,"p",18),qC(19," Each parameter must have a name and a default value. Use "),Is(20,"code"),qC(21),pl(),qC(22," in content entries to reference them. "),pl(),tC(23,ce,2,0,"p",19),iC(24,_e,19,10,"div",20,rC),Is(26,"button",21),Ag("click",function(){If(e);let m=yC();return wf(m.addParameter())}),qC(27,"+ Add parameter"),pl()(),Is(28,"fieldset",15)(29,"legend",16),qC(30," Content "),Is(31,"span",10),qC(32,"*"),pl(),Is(33,"span",17),qC(34,"Ordered list of text commands"),pl()(),Is(35,"p",18),qC(36," Each content entry is a command. Use "),Is(37,"code"),qC(38,"@AgentName"),pl(),qC(39," to target an agent, "),Is(40,"code"),qC(41,"/promptName param1 param2"),pl(),qC(42," to call another prompt, and "),Is(43,"code"),qC(44),pl(),qC(45," for parameter placeholders. "),pl(),iC(46,ue,8,6,"div",22,rC),Is(48,"button",21),Ag("click",function(){If(e);let m=yC();return wf(m.addContentEntry())}),qC(49,"+ Add content entry"),pl()(),tC(50,ge,2,1,"p",23),Is(51,"div",8)(52,"label",24),qC(53,"External Metadata"),pl(),bg(54,"textarea",25),UI(),tC(55,Ce,2,0,"span",12),Is(56,"span",26),qC(57,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),pl()(),Is(58,"div",27)(59,"button",28),qC(60),pl(),tC(61,xe,2,2,"button",29),Is(62,"button",30),Ag("click",function(){If(e);let m=yC();return wf(m.cancel())}),qC(63,"Cancel"),pl()()();}if(i&2){let e=yC();Tg("formGroup",e.form),JE(6),Hg("prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),Tg("formControl",e.nameControl),zI(),JE(),nC(e.nameControl.invalid&&e.nameControl.touched?7:-1),JE(4),Tg("formControl",e.descriptionControl),zI(),JE(),nC(e.availableAgentConfigs().length>0?12:-1),JE(),Tg("formArrayName","parameters"),JE(8),Zg(e.paramPlaceholderSyntax),JE(2),nC(e.parametersArray.length===0?23:-1),JE(),sC(e.parametersArray.controls),JE(4),Tg("formArrayName","content"),JE(16),Zg(e.paramPlaceholderSyntax),JE(2),sC(e.contentArray.controls),JE(4),nC(e.errorMessage()?50:-1),JE(4),Tg("formControl",e.externalMetadataJsonControl),zI(),JE(),nC(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?55:-1),JE(4),Tg("disabled",e.form.invalid||e.isSubmitting()),JE(),vl(" ",e.isEditMode()?"Save changes":"Create"," "),JE(),nC(e.isEditMode()?61:-1);}}var re=class i{route=g(V);router=g(G);destroyRef=g(we);promptState=g(m);agentConfigController=g(B);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(null),agentConfigId:new _t(null),externalMetadataJson:new _t("",{nonNullable:true,validators:[be]}),content:new ze([this.createContentControl()],{validators:[_e$1.required]}),parameters:new ze([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=zi(false);isSubmitting=zi(false);isLoading=zi(false);isExporting=zi(false);errorMessage=zi(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=zi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U(this.destroyRef),ya(()=>br([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U(this.destroyRef),ya(()=>br([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(l=>this.contentArray.push(this.createContentControl(l))),this.parametersArray.clear(),(t.parameters??[]).forEach(l=>this.parametersArray.push(this.createParameterGroup(l))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new _t(t,{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new z({name:new _t(t?.name??"",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(t?.description??null),defaultValue:new _t(t?.defaultValue??"",{nonNullable:true,validators:[_e$1.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=z$1(P({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(d=>d.value.trim()),parameters:this.parametersArray.controls.map(d=>({name:d.controls.name.value.trim(),description:d.controls.description.value?.trim()||void 0,defaultValue:d.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let l=this.externalMetadataJsonControl.value.trim();e.externalMetadata=l?JSON.parse(l):null;let m=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),m.pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:d=>{this.isSubmitting.set(false),d.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):d.status===400?this.errorMessage.set(d.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let l=new Blob([e],{type:"application/yaml"}),m=URL.createObjectURL(l),d=document.createElement("a");d.href=m,d.download=`${this.existingPrompt?.name??"prompt"}.yaml`,d.click(),URL.revokeObjectURL(m),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Rw({type:i,selectors:[["agentos-prompt-form"]],decls:10,vars:3,consts:[[1,"prompt-form"],[1,"prompt-form__header"],["type","button","title","Back to prompts",1,"prompt-form__back",3,"click"],[1,"prompt-form__back-icon"],[1,"prompt-form__title"],[1,"prompt-form__loading"],[1,"prompt-form__form",3,"formGroup"],[1,"prompt-form__form",3,"ngSubmit","formGroup"],[1,"prompt-form__field"],["for","prompt-name",1,"prompt-form__label"],["aria-hidden","true"],["id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__field-error"],["for","prompt-description",1,"prompt-form__label"],["id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__section",3,"formArrayName"],[1,"prompt-form__label"],[1,"prompt-form__label-hint"],[1,"prompt-form__section-hint"],[1,"prompt-form__empty-hint"],[1,"prompt-form__param-row",3,"formGroupName"],["type","button",1,"prompt-form__add-btn",3,"click"],[1,"prompt-form__content-row"],[1,"prompt-form__error"],["for","prompt-external-metadata",1,"prompt-form__label"],["id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"prompt-form__textarea","prompt-form__textarea--code",3,"formControl"],[1,"prompt-form__field-hint"],[1,"prompt-form__actions"],["type","submit",1,"prompt-form__btn","prompt-form__btn--primary",3,"disabled"],["type","button",1,"prompt-form__btn","prompt-form__btn--export",3,"disabled"],["type","button",1,"prompt-form__btn",3,"click"],["for","prompt-agent-config",1,"prompt-form__label"],[1,"prompt-form__readonly-value"],["id","prompt-agent-config",1,"prompt-form__select",3,"formControl"],[3,"ngValue"],[1,"prompt-form__param-fields"],[1,"prompt-form__field","prompt-form__field--inline"],[1,"prompt-form__label",3,"for"],["type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","Optional","formControlName","description","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",1,"prompt-form__input",3,"id"],["type","button","title","Remove this parameter",1,"prompt-form__remove-btn",3,"click"],[1,"prompt-form__content-index"],[1,"prompt-form__content-field"],["rows","4","placeholder","Enter a command\u2026",1,"prompt-form__textarea",3,"formControlName"],["type","button","title","Remove this entry",1,"prompt-form__remove-btn",3,"click","disabled"],["type","button",1,"prompt-form__btn","prompt-form__btn--export",3,"click","disabled"]],template:function(e,l){e&1&&(Is(0,"div",0)(1,"header",1)(2,"button",2),Ag("click",function(){return l.cancel()}),Is(3,"span",3),qC(4,"\u2190"),pl(),qC(5),pl(),Is(6,"h1",4),qC(7),pl()(),tC(8,ie,2,0,"p",5)(9,ve,64,18,"form",6),pl()),e&2&&(JE(5),vl(" ",l.isPlatformMode?"Platform prompts":"Prompts"," "),JE(2),Zg(l.isEditMode()?"Edit prompt":"New prompt"),JE(),nC(l.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,Zn,Xn,Cn,En,An,Ct,Vt],styles:[".prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.prompt-form__field--inline[_ngcontent-%COMP%]{flex:1}.prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.prompt-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary);margin-left:.375rem}.prompt-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;cursor:pointer;appearance:auto;transition:border-color .15s ease}.prompt-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;padding:.5rem .875rem;border-radius:0;background:var(--color-bg-hover);border:1px solid var(--color-divider);color:var(--color-text);font-size:.9375rem}.prompt-form__input[_ngcontent-%COMP%], .prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.prompt-form__input[_ngcontent-%COMP%]:focus, .prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__input[_ngcontent-%COMP%]::placeholder, .prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.prompt-form__textarea--code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85rem;resize:vertical}.prompt-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.prompt-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.prompt-form__content-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-start}.prompt-form__content-field[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem}.prompt-form__content-index[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;padding-top:.6rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary);text-align:right;-webkit-user-select:none;user-select:none}.prompt-form__param-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end;padding:.75rem;border-radius:0;background:var(--color-bg-hover)}.prompt-form__param-fields[_ngcontent-%COMP%]{flex:1;display:flex;gap:.75rem;flex-wrap:wrap}.prompt-form__add-btn[_ngcontent-%COMP%]{align-self:flex-start;padding:.4rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-accent);font-size:.875rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__add-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-accent)}.prompt-form__remove-btn[_ngcontent-%COMP%]{flex-shrink:0;width:1.75rem;height:1.75rem;display:flex;align-items:center;justify-content:center;border-radius:0;border:1px solid transparent;background:transparent;color:var(--color-neutral-500);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.prompt-form__remove-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:color-mix(in srgb,var(--red) 10%,transparent);color:var(--red);border-color:var(--red)}.prompt-form__remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.prompt-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:0;background:color-mix(in srgb,var(--red) 10%,transparent);border:1px solid var(--red);color:var(--red);font-size:.875rem;line-height:1.4}.prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--red);line-height:1.3}.prompt-form__input--invalid[_ngcontent-%COMP%], .prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--red)}.prompt-form__input--invalid[_ngcontent-%COMP%]:focus, .prompt-form__textarea--invalid[_ngcontent-%COMP%]:focus{border-color:var(--red)}.prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.prompt-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.prompt-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};function be(i){let t=i.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{re as PromptFormComponent};
|
|
1
|
+
import {m}from'./chunk-R-GmZrHu.js';import {g,ao as V,G,w as we,d8 as M,a as Gi,c as U,a7 as va,X as br,z as z$1,b as P,h as Fw,m as ws,o as Rg,Q as QC,n as hl,q as oC,t as nI,a5 as Dl,a8 as Yg,x as iC,a9 as gC,S as Sg,a3 as GI,r as cC,bo as sC,ac as EC,v as bg,A as Ug,a6 as qI,y as uC,aa as wf,ab as Cf}from'./main-LBRSRTYI.js';import {o as z,z as ze,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,A as At,Z as Zn,l as Xn,C as Cn,E as En,p as An,q as Ct,V as Vt}from'./chunk-BYyTBqh4.js';import'./chunk-ClSDInQq.js';import'./chunk-BaO2vi_O.js';import'./chunk-DjMtxVWg.js';var ne=(i,t)=>t.id;function ie(i,t){i&1&&(ws(0,"p",5),QC(1,"Loading\u2026"),hl());}function ae(i,t){i&1&&(ws(0,"span",12),QC(1,"Name is required."),hl());}function le(i,t){if(i&1&&(ws(0,"p",32),QC(1),hl(),ws(2,"span",26),QC(3,"Agent Config cannot be changed after creation."),hl()),i&2){let e=EC(3);nI(),Yg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function me(i,t){if(i&1&&(ws(0,"option",34),QC(1),hl()),i&2){let e=t.$implicit;bg("ngValue",e.id),nI(),Yg(e.name);}}function pe(i,t){if(i&1&&(ws(0,"select",33)(1,"option",34),QC(2,"\u2014 None \u2014"),hl(),cC(3,me,2,2,"option",34,ne),hl(),GI(),ws(5,"span",26),QC(6,"Optional. Links this prompt to an agent as a starter. Immutable after creation."),hl()),i&2){let e=EC(3);bg("formControl",e.agentConfigIdControl),qI(),nI(),bg("ngValue",null),nI(2),uC(e.availableAgentConfigs());}}function de(i,t){if(i&1&&(ws(0,"div",8)(1,"label",31),QC(2,"Agent Config"),hl(),oC(3,le,4,1)(4,pe,7,2),hl()),i&2){let e=EC(2);nI(3),iC(e.isEditMode()&&e.agentConfigIdControl.value?3:e.isEditMode()?-1:4);}}function ce(i,t){i&1&&(ws(0,"p",19),QC(1,"No parameters defined."),hl());}function se(i,t){i&1&&(ws(0,"span",12),QC(1,"Parameter name is required."),hl());}function _e(i,t){if(i&1){let e=gC();ws(0,"div",20)(1,"div",35)(2,"div",36)(3,"label",37),QC(4,"Name "),ws(5,"span",10),QC(6,"*"),hl()(),Sg(7,"input",38),GI(),oC(8,se,2,0,"span",12),hl(),ws(9,"div",36)(10,"label",37),QC(11,"Description"),hl(),Sg(12,"input",39),GI(),hl(),ws(13,"div",36)(14,"label",37),QC(15,"Default value"),hl(),Sg(16,"input",40),GI(),hl()(),ws(17,"button",41),Rg("click",function(){let m=wf(e).$index,d=EC(2);return Cf(d.removeParameter(m))}),QC(18," \xD7 "),hl()();}if(i&2){let e=t.$implicit,l=t.$index;bg("formGroupName",l),nI(3),bg("for","param-name-"+l),nI(4),Ug("prompt-form__input--invalid",e.controls.name.invalid&&e.controls.name.touched),bg("id","param-name-"+l),qI(),nI(),iC(e.controls.name.invalid&&e.controls.name.touched?8:-1),nI(2),bg("for","param-desc-"+l),nI(2),bg("id","param-desc-"+l),qI(),nI(2),bg("for","param-default-"+l),nI(2),bg("id","param-default-"+l),qI();}}function fe(i,t){i&1&&(ws(0,"span",12),QC(1,"Content entry must not be blank."),hl());}function ue(i,t){if(i&1){let e=gC();ws(0,"div",22)(1,"span",42),QC(2),hl(),ws(3,"div",43),Sg(4,"textarea",44),GI(),oC(5,fe,2,0,"span",12),hl(),ws(6,"button",45),Rg("click",function(){let m=wf(e).$index,d=EC(2);return Cf(d.removeContentEntry(m))}),QC(7," \xD7 "),hl()();}if(i&2){let e=t.$implicit,l=t.$index,m=EC(2);nI(2),Yg(l+1),nI(2),Ug("prompt-form__textarea--invalid",e.invalid&&e.touched),bg("formControlName",l),qI(),nI(),iC(e.invalid&&e.touched?5:-1),nI(),bg("disabled",m.contentArray.length===1);}}function ge(i,t){if(i&1&&(ws(0,"p",23),QC(1),hl()),i&2){let e=EC(2);nI(),Yg(e.errorMessage());}}function Ce(i,t){i&1&&(ws(0,"span",12),QC(1,"Invalid JSON."),hl());}function xe(i,t){if(i&1){let e=gC();ws(0,"button",46),Rg("click",function(){wf(e);let m=EC(2);return Cf(m.exportYaml())}),QC(1),hl();}if(i&2){let e=EC(2);bg("disabled",e.isExporting()),nI(),Dl(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function ve(i,t){if(i&1){let e=gC();ws(0,"form",7),Rg("ngSubmit",function(){wf(e);let m=EC();return Cf(m.submit())}),ws(1,"div",8)(2,"label",9),QC(3,"Name "),ws(4,"span",10),QC(5,"*"),hl()(),Sg(6,"input",11),GI(),oC(7,ae,2,0,"span",12),hl(),ws(8,"div",8)(9,"label",13),QC(10,"Description"),hl(),Sg(11,"input",14),GI(),hl(),oC(12,de,5,1,"div",8),ws(13,"fieldset",15)(14,"legend",16),QC(15," Parameters "),ws(16,"span",17),QC(17,"Named placeholders used in content"),hl()(),ws(18,"p",18),QC(19," Each parameter must have a name and a default value. Use "),ws(20,"code"),QC(21),hl(),QC(22," in content entries to reference them. "),hl(),oC(23,ce,2,0,"p",19),cC(24,_e,19,10,"div",20,sC),ws(26,"button",21),Rg("click",function(){wf(e);let m=EC();return Cf(m.addParameter())}),QC(27,"+ Add parameter"),hl()(),ws(28,"fieldset",15)(29,"legend",16),QC(30," Content "),ws(31,"span",10),QC(32,"*"),hl(),ws(33,"span",17),QC(34,"Ordered list of text commands"),hl()(),ws(35,"p",18),QC(36," Each content entry is a command. Use "),ws(37,"code"),QC(38,"@AgentName"),hl(),QC(39," to target an agent, "),ws(40,"code"),QC(41,"/promptName param1 param2"),hl(),QC(42," to call another prompt, and "),ws(43,"code"),QC(44),hl(),QC(45," for parameter placeholders. "),hl(),cC(46,ue,8,6,"div",22,sC),ws(48,"button",21),Rg("click",function(){wf(e);let m=EC();return Cf(m.addContentEntry())}),QC(49,"+ Add content entry"),hl()(),oC(50,ge,2,1,"p",23),ws(51,"div",8)(52,"label",24),QC(53,"External Metadata"),hl(),Sg(54,"textarea",25),GI(),oC(55,Ce,2,0,"span",12),ws(56,"span",26),QC(57,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),hl()(),ws(58,"div",27)(59,"button",28),QC(60),hl(),oC(61,xe,2,2,"button",29),ws(62,"button",30),Rg("click",function(){wf(e);let m=EC();return Cf(m.cancel())}),QC(63,"Cancel"),hl()()();}if(i&2){let e=EC();bg("formGroup",e.form),nI(6),Ug("prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),bg("formControl",e.nameControl),qI(),nI(),iC(e.nameControl.invalid&&e.nameControl.touched?7:-1),nI(4),bg("formControl",e.descriptionControl),qI(),nI(),iC(e.availableAgentConfigs().length>0?12:-1),nI(),bg("formArrayName","parameters"),nI(8),Yg(e.paramPlaceholderSyntax),nI(2),iC(e.parametersArray.length===0?23:-1),nI(),uC(e.parametersArray.controls),nI(4),bg("formArrayName","content"),nI(16),Yg(e.paramPlaceholderSyntax),nI(2),uC(e.contentArray.controls),nI(4),iC(e.errorMessage()?50:-1),nI(4),bg("formControl",e.externalMetadataJsonControl),qI(),nI(),iC(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?55:-1),nI(4),bg("disabled",e.form.invalid||e.isSubmitting()),nI(),Dl(" ",e.isEditMode()?"Save changes":"Create"," "),nI(),iC(e.isEditMode()?61:-1);}}var re=class i{route=g(V);router=g(G);destroyRef=g(we);promptState=g(m);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(null),agentConfigId:new _t(null),externalMetadataJson:new _t("",{nonNullable:true,validators:[be]}),content:new ze([this.createContentControl()],{validators:[_e$1.required]}),parameters:new ze([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);isExporting=Gi(false);errorMessage=Gi(null);paramPlaceholderSyntax="{{paramName}}";agentConfigs=Gi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(true),this.loadPrompt(t)),this.isPlatformMode?this.loadPlatformAgentConfigs():this.namespaceId&&this.loadAgentConfigs(this.namespaceId);}loadPrompt(t){this.isLoading.set(true),this.promptState.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadAgentConfigs(t){this.agentConfigController.listByParentAgentConfig(t).pipe(U(this.destroyRef),va(()=>br([]))).subscribe(e=>this.agentConfigs.set(e));}loadPlatformAgentConfigs(){this.agentConfigController.listPlatformAgentsAgentConfig().pipe(U(this.destroyRef),va(()=>br([]))).subscribe(t=>this.agentConfigs.set(t));}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(l=>this.contentArray.push(this.createContentControl(l))),this.parametersArray.clear(),(t.parameters??[]).forEach(l=>this.parametersArray.push(this.createParameterGroup(l))),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}createContentControl(t=""){return new _t(t,{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl());}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t);}createParameterGroup(t){return new z({name:new _t(t?.name??"",{nonNullable:true,validators:[_e$1.required,_e$1.minLength(1)]}),description:new _t(t?.description??null),defaultValue:new _t(t?.defaultValue??"",{nonNullable:true,validators:[_e$1.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup());}removeParameter(t){this.parametersArray.removeAt(t);}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=z$1(P({},this.existingPrompt??{}),{namespaceId:this.namespaceId,sourceLanguage:this.existingPrompt?.sourceLanguage??"en",name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(d=>d.value.trim()),parameters:this.parametersArray.controls.map(d=>({name:d.controls.name.value.trim(),description:d.controls.description.value?.trim()||void 0,defaultValue:d.controls.defaultValue.value.trim()}))});t||(e.agentConfigId=this.agentConfigIdControl.value||null);let l=this.externalMetadataJsonControl.value.trim();e.externalMetadata=l?JSON.parse(l):null;let m=t?this.promptState.update(this.existingPrompt.id,e):this.promptState.create(e);this.errorMessage.set(null),m.pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:d=>{this.isSubmitting.set(false),d.status===409?this.errorMessage.set(`A prompt named "${e.name}" already exists in this scope.`):d.status===400?this.errorMessage.set(d.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}exportYaml(){let t=this.existingPrompt?.id;!t||this.isExporting()||(this.isExporting.set(true),this.promptState.exportAsYaml(t).pipe(U(this.destroyRef)).subscribe({next:e=>{let l=new Blob([e],{type:"application/yaml"}),m=URL.createObjectURL(l),d=document.createElement("a");d.href=m,d.download=`${this.existingPrompt?.name??"prompt"}.yaml`,d.click(),URL.revokeObjectURL(m),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Fw({type:i,selectors:[["agentos-prompt-form"]],decls:10,vars:3,consts:[[1,"prompt-form"],[1,"prompt-form__header"],["type","button","title","Back to prompts",1,"prompt-form__back",3,"click"],[1,"prompt-form__back-icon"],[1,"prompt-form__title"],[1,"prompt-form__loading"],[1,"prompt-form__form",3,"formGroup"],[1,"prompt-form__form",3,"ngSubmit","formGroup"],[1,"prompt-form__field"],["for","prompt-name",1,"prompt-form__label"],["aria-hidden","true"],["id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__field-error"],["for","prompt-description",1,"prompt-form__label"],["id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__section",3,"formArrayName"],[1,"prompt-form__label"],[1,"prompt-form__label-hint"],[1,"prompt-form__section-hint"],[1,"prompt-form__empty-hint"],[1,"prompt-form__param-row",3,"formGroupName"],["type","button",1,"prompt-form__add-btn",3,"click"],[1,"prompt-form__content-row"],[1,"prompt-form__error"],["for","prompt-external-metadata",1,"prompt-form__label"],["id","prompt-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"prompt-form__textarea","prompt-form__textarea--code",3,"formControl"],[1,"prompt-form__field-hint"],[1,"prompt-form__actions"],["type","submit",1,"prompt-form__btn","prompt-form__btn--primary",3,"disabled"],["type","button",1,"prompt-form__btn","prompt-form__btn--export",3,"disabled"],["type","button",1,"prompt-form__btn",3,"click"],["for","prompt-agent-config",1,"prompt-form__label"],[1,"prompt-form__readonly-value"],["id","prompt-agent-config",1,"prompt-form__select",3,"formControl"],[3,"ngValue"],[1,"prompt-form__param-fields"],[1,"prompt-form__field","prompt-form__field--inline"],[1,"prompt-form__label",3,"for"],["type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","Optional","formControlName","description","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",1,"prompt-form__input",3,"id"],["type","button","title","Remove this parameter",1,"prompt-form__remove-btn",3,"click"],[1,"prompt-form__content-index"],[1,"prompt-form__content-field"],["rows","4","placeholder","Enter a command\u2026",1,"prompt-form__textarea",3,"formControlName"],["type","button","title","Remove this entry",1,"prompt-form__remove-btn",3,"click","disabled"],["type","button",1,"prompt-form__btn","prompt-form__btn--export",3,"click","disabled"]],template:function(e,l){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return l.cancel()}),ws(3,"span",3),QC(4,"\u2190"),hl(),QC(5),hl(),ws(6,"h1",4),QC(7),hl()(),oC(8,ie,2,0,"p",5)(9,ve,64,18,"form",6),hl()),e&2&&(nI(5),Dl(" ",l.isPlatformMode?"Platform prompts":"Prompts"," "),nI(2),Yg(l.isEditMode()?"Edit prompt":"New prompt"),nI(),iC(l.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,At,Zn,Xn,Cn,En,An,Ct,Vt],styles:[".prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.prompt-form__field--inline[_ngcontent-%COMP%]{flex:1}.prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.prompt-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary);margin-left:.375rem}.prompt-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;cursor:pointer;appearance:auto;transition:border-color .15s ease}.prompt-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;padding:.5rem .875rem;border-radius:0;background:var(--color-bg-hover);border:1px solid var(--color-divider);color:var(--color-text);font-size:.9375rem}.prompt-form__input[_ngcontent-%COMP%], .prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.prompt-form__input[_ngcontent-%COMP%]:focus, .prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.prompt-form__input[_ngcontent-%COMP%]::placeholder, .prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.prompt-form__textarea--code[_ngcontent-%COMP%]{font-family:monospace;font-size:.85rem;resize:vertical}.prompt-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-divider);border-radius:0;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.prompt-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary);line-height:1.4}.prompt-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.prompt-form__content-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-start}.prompt-form__content-field[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem}.prompt-form__content-index[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;padding-top:.6rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary);text-align:right;-webkit-user-select:none;user-select:none}.prompt-form__param-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end;padding:.75rem;border-radius:0;background:var(--color-bg-hover)}.prompt-form__param-fields[_ngcontent-%COMP%]{flex:1;display:flex;gap:.75rem;flex-wrap:wrap}.prompt-form__add-btn[_ngcontent-%COMP%]{align-self:flex-start;padding:.4rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-accent);font-size:.875rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__add-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-accent)}.prompt-form__remove-btn[_ngcontent-%COMP%]{flex-shrink:0;width:1.75rem;height:1.75rem;display:flex;align-items:center;justify-content:center;border-radius:0;border:1px solid transparent;background:transparent;color:var(--color-neutral-500);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.prompt-form__remove-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:color-mix(in srgb,var(--red) 10%,transparent);color:var(--red);border-color:var(--red)}.prompt-form__remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.prompt-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:0;background:color-mix(in srgb,var(--red) 10%,transparent);border:1px solid var(--red);color:var(--red);font-size:.875rem;line-height:1.4}.prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--red);line-height:1.3}.prompt-form__input--invalid[_ngcontent-%COMP%], .prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--red)}.prompt-form__input--invalid[_ngcontent-%COMP%]:focus, .prompt-form__textarea--invalid[_ngcontent-%COMP%]:focus{border-color:var(--red)}.prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.prompt-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.prompt-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"]})};function be(i){let t=i.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}export{re as PromptFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {I}from'./chunk-DqC8XT4v.js';import {m}from'./chunk-R-GmZrHu.js';import {g,G,w as we,aJ as Tr,a as Gi,bS as Da,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-LBRSRTYI.js';import {W as Wn,S as Se}from'./chunk-BaO2vi_O.js';import'./chunk-DjMtxVWg.js';import'./chunk-BYyTBqh4.js';import'./chunk-ClSDInQq.js';var F=()=>[];function N(o,e){if(o&1){let t=gC();ws(0,"agentos-prompt-item",4),Rg("deleteRequested",function(n){wf(t);let E=EC(2);return Cf(E.deletePrompt(n))}),hl();}o&2&&bg("prompt",e)("platformMode",true);}function V(o,e){if(o&1&&oC(0,N,1,2,"agentos-prompt-item",3),o&2){let t,r=e.$implicit,n=EC();iC((t=n.resolvePrompt(r.id))?0:-1,t);}}var q=class o{router=g(G);destroyRef=g(we);promptState=g(m);refresh$=new Tr(void 0);isLoading=Gi(true);prompts$=this.refresh$.pipe(Da(()=>(this.isLoading.set(true),this.promptState.listPlatform())));promptItems$=this.prompts$.pipe(ue(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.description}))));promptsById=new Map;constructor(){this.prompts$.pipe(U(this.destroyRef)).subscribe({next:e=>{this.promptsById=new Map(e.map(t=>[t.id??"",t])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"]);}deletePrompt(e){this.promptState.delete(e.id??"").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolvePrompt(e){return this.promptsById.get(e)??null}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Fw({type:o,selectors:[["agentos-platform-prompts"]],decls:5,vars:7,consts:[["promptItemTpl",""],["title","Platform Prompts","emptyMessage","No platform prompts defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"prompt","platformMode"],[3,"deleteRequested","prompt","platformMode"]],template:function(t,r){if(t&1&&(ws(0,"ds-entity-list",1),dT(1,"async"),Rg("createRequested",function(){return r.openCreateForm()}),ws(2,"ds-icon-button",2),Rg("action",function(){return r.goBack()}),hl()(),Eg(3,V,1,1,"ng-template",null,0,mT)),t&2){let n=MC(4);bg("items",pT(1,4,r.promptItems$)??aT(6,F))("loading",r.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,I,Se,Ob],styles:[".platform-prompts__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-prompts__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"]})};export{q as PlatformPromptsComponent};
|