@whoz-oss/coday-client 0.241.1 → 0.243.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.
@@ -1,4 +1,4 @@
1
- import{a as _n}from"./chunk-EAVXJ7QN.js";import{a as Ue,b as Be,c as xn,e as Mn,f as ce}from"./chunk-AFRMVXZZ.js";import{a as wn,b as Tn,c as Sn}from"./chunk-TSYL5EEO.js";import{a as Ke}from"./chunk-N6D7DELC.js";import{a as je,b as K,c as ln,d as se,i as mn,j as pn,k as gn,m as un,o as hn,p as fn,r as bn,t as Qe,v as Cn,x as vn,y as Xe}from"./chunk-ZCELWKMZ.js";import{a as yn}from"./chunk-GIIRKWUO.js";import{c as Kt}from"./chunk-6XX7GME4.js";import{a as An}from"./chunk-SKBEA6VH.js";import{s as In,w as Dn}from"./chunk-VNO76B3S.js";import{b as dn,h as En,i as On,j as Pn,n as kn}from"./chunk-E6T6QLQT.js";import{a as cn,c as $e}from"./chunk-VMYKE4ZC.js";import{a as R,b as z}from"./chunk-AS2L77JV.js";import{E as Ge,c as We,g as qe,m as Ye}from"./chunk-7OGOI6WM.js";import{b as X}from"./chunk-TASSC2XX.js";import{E as rn,K as an,O as re,Q as sn,R as Ne,S as ae,i as Jt,j as Zt,p as en,s as tn,t as nn,z as on}from"./chunk-G5RWG2GK.js";import{$b as He,B as q,Bb as _,D as De,Db as h,Fb as l,G as Rt,Ga as H,Ha as yt,Ja as zt,Jb as ue,Jc as ze,Ka as c,Kb as Z,Lb as ee,Lc as Xt,Mc as Mt,Pa as Nt,Pc as j,Rb as N,T as F,Tb as p,Ub as w,Vb as he,Wa as S,Wb as Ae,Xa as $t,Xc as G,Ya as jt,Z as k,Za as Ut,Zb as Fe,_ as Ht,_b as Re,_c as Q,a as de,ac as Wt,b as Pe,bc as qt,ca as m,cc as Yt,d as O,dc as Gt,fc as Ee,g as ke,ga as f,gc as Qt,h as B,ha as b,hc as St,i as Ie,jb as oe,la as Vt,lb as g,m as xt,mb as u,mc as Ve,n as At,oa as M,pa as Lt,pb as V,qb as L,rb as C,sb as a,t as ie,ta as W,tb as s,u as Ft,ub as x,va as Y,vb as wt,wb as Tt,xb as Bt,ya as ge,yc as Le}from"./chunk-CHEXA6RY.js";var Je=class i{sanitizer=m(Q);transform(e,t){if(!t||!e)return e;let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`(${n})`,"gi"),r=e.replace(o,"<strong>$1</strong>");return this.sanitizer.bypassSecurityTrustHtml(r)}static \u0275fac=function(t){return new(t||i)};static \u0275pipe=Ut({name:"highlight",type:i,pure:!0})};var fe=class i{http=m(G);projectState=m(X);threadState=m(K);transcribeAudio(e,t,n){let o=this.projectState.getSelectedProjectIdOrThrow();return this.http.post(`/api/projects/${o}/transcribe`,de({audio:e,mimeType:t},n?{language:n}:{}))}sendVoiceMessage(e,t,n){let o=this.projectState.getSelectedProjectIdOrThrow(),r=this.threadState.getSelectedThreadIdOrThrow();return this.http.post(`/api/projects/${o}/threads/${r}/voice-message`,de({audio:e,mimeType:t},n?{language:n}:{}))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var bi=["messageInput"],Ci=["fileInput"],vi=(i,e)=>e.name;function _i(i,e){i&1&&(a(0,"div",3),x(1,"span",8),p(2," Recording... Click mic to stop "),s())}function xi(i,e){i&1&&(a(0,"div",3),x(1,"span",9),p(2," Transcribing... "),s())}function yi(i,e){if(i&1&&(a(0,"span",14),p(1),s()),i&2){let t=l().$implicit,n=l(2);c(),w(" "+(n.getParameterFormat(t)||""))}}function wi(i,e){if(i&1){let t=_();a(0,"div",11),h("click",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("keydown.enter",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("keydown.space",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("mouseenter",function(){let o=f(t).$index,r=l(2);return b(r.selectedAutocompleteIndex=o)}),a(1,"div",12),x(2,"span",13),Ee(3,"highlight"),g(4,yi,2,1,"span",14),s(),x(5,"div",15),Ee(6,"highlight"),s()}if(i&2){let t=e.$implicit,n=e.$index,o=l(2);N("selected",n===o.selectedAutocompleteIndex),oe("aria-selected",n===o.selectedAutocompleteIndex),c(2),C("innerHTML",St(3,6,o.autocompleteTrigger+t.name,o.getAutocompleteQuery()),H),c(2),u(o.hasParameterFormat(t)?4:-1),c(),C("innerHTML",St(6,9,t.description,o.getAutocompleteQuery()),H)}}function Ti(i,e){if(i&1&&(a(0,"div",4),V(1,wi,7,12,"div",10,vi),s()),i&2){let t=l();c(),L(t.autocompleteItems)}}function Si(i,e){if(i&1){let t=_();a(0,"ds-icon-button",18),h("action",function(){f(t);let o=l(2);return b(o.onStopClick())}),s()}}function Mi(i,e){if(i&1){let t=_();a(0,"ds-icon-button",19),h("action",function(){f(t);let o=l(2);return b(o.sendMessage())}),s()}if(i&2){let t=l(2);N("hidden",t.isDisabled||!t.message.trim())("active",!!t.message.trim()&&!t.isDisabled),C("title",t.getSendButtonTooltip())("disabled",t.isDisabled||!t.message.trim())}}function Ei(i,e){if(i&1){let t=_();a(0,"ds-icon-button",21),h("action",function(){f(t);let o=l(3);return b(o.triggerFileUpload())}),s(),a(1,"input",22,1),h("change",function(o){f(t);let r=l(3);return b(r.onFileInputChange(o))}),s()}if(i&2){let t=l(3);C("disabled",t.isDisabled)}}function Oi(i,e){if(i&1){let t=_();g(0,Ei,3,1),a(1,"ds-icon-button",20),h("action",function(){f(t);let o=l(2);return b(o.toggleRecording())}),s()}if(i&2){let t=l(2);u(!t.showWelcome&&!(t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing))?0:-1),c(),N("hidden",t.message.trim()&&!t.isRecording&&!t.isTranscribing),C("variant",t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing)?"danger":"default")("disabled",t.isVoiceMessageMode&&t.isTranscribing)("title",t.isRecording?"Click to stop recording":t.isTranscribing?"Uploading...":"Click to start recording")}}function Pi(i,e){if(i&1&&(a(0,"div",7),g(1,Si,1,0,"ds-icon-button",16),g(2,Mi,1,6,"ds-icon-button",17),g(3,Oi,2,6),s()),i&2){let t=l();c(),u(t.isThinking?1:-1),c(),u((!t.isThinking||t.message.trim())&&!(t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing))?2:-1),c(),u(t.isThinking?-1:3)}}var Ze=class i{isDisabled=!1;showWelcome=!1;isThinking=!1;isStarting=!1;isSessionInitializing=!1;isStopping=!1;filesPasted=new M;messageSubmitted=new M;voiceMessageReady=new M;voiceRecordingToggled=new M;heightChanged=new M;stopRequested=new M;textareaFocused=new M;messageInput;fileInput;message="";isRecording=!1;isTranscribing=!1;isFocused=!1;recognition=null;mediaRecorder=null;audioChunks=[];voiceInputMode="browser";get isVoiceMessageMode(){return this.voiceInputMode==="voice-message"}sessionHadTranscript=!1;pendingLineBreaksTimeout=null;lastProcessedResultIndex=0;useEnterToSend=!1;currentInvite="";subscriptions=[];thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;autocompleteVisible=!1;autocompleteTrigger=null;autocompleteItems=[];selectedAutocompleteIndex=0;preferencesService=m(se);codayService=m(ce);agentApiService=m(_n);promptApiService=m(An);projectStateService=m(X);audioApiService=m(fe);threadStateService=m(K);ngOnInit(){this.initializeVoiceInput(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.subscriptions.push(this.preferencesService.voiceLanguage$.subscribe(()=>this.updateRecognitionLanguage())),this.subscriptions.push(this.preferencesService.voiceInputMode$.subscribe(e=>{this.voiceInputMode=e})),this.subscriptions.push(this.preferencesService.enterToSend$.subscribe(e=>{this.useEnterToSend=e})),this.subscribeToInviteEvents(),this.subscribeToMessageRestore()}ngAfterViewInit(){this.adjustTextareaHeight(),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),200)})}ngOnChanges(e){e.isThinking&&(e.isThinking.currentValue?this.startThinkingAnimation():(this.stopThinkingAnimation(),this.isStopping=!1,e.isThinking.previousValue&&(console.log("[CHAT-TEXTAREA] Thinking ended, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})))),e.isSessionInitializing&&!e.isSessionInitializing.currentValue&&e.isSessionInitializing.previousValue&&(console.log("[CHAT-TEXTAREA] Session initialization completed, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})),e.isStarting&&!e.isStarting.currentValue&&e.isStarting.previousValue&&this.isThinking&&(this.thinkingPhraseIndex===0?(console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index 0 - restarting animation"),this.stopThinkingAnimation(),this.startThinkingAnimation()):console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index",this.thinkingPhraseIndex,"- continuing without restart"))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions=[],this.clearPendingLineBreaks(),this.stopThinkingAnimation()}onKeyDown(e){if(this.autocompleteVisible)switch(e.key){case"ArrowDown":e.preventDefault(),this.selectedAutocompleteIndex=Math.min(this.selectedAutocompleteIndex+1,this.autocompleteItems.length-1),this.scrollSelectedItemIntoView();return;case"ArrowUp":e.preventDefault(),this.selectedAutocompleteIndex=Math.max(this.selectedAutocompleteIndex-1,0),this.scrollSelectedItemIntoView();return;case"Tab":case"Enter":if(!this.message.includes(" ")){e.preventDefault(),this.selectAutocompleteItem();return}break;case"Escape":e.preventDefault(),this.hideAutocomplete();return}e.key==="Enter"&&(this.useEnterToSend?!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(e.preventDefault(),this.sendMessage(!0)):(navigator.platform.toLowerCase().includes("mac")?e.metaKey:e.ctrlKey)&&!e.shiftKey&&(e.preventDefault(),this.sendMessage(!0)))}onInput(){this.adjustTextareaHeight(),this.checkForAutocomplete()}onPaste(e){let t=e.clipboardData?.items;if(!t)return;let n=Array.from(t).filter(r=>r.kind==="file");if(!n.length)return;e.preventDefault();let o=n.reduce((r,d)=>{let v=d.getAsFile();return v?[...r,v]:r},[]);o.length&&this.filesPasted.emit(o)}triggerFileUpload(){console.log("[CHAT-TEXTAREA] Triggering file upload"),this.fileInput?.nativeElement?.click()}onFileInputChange(e){let t=e.target,n=t.files;if(!n||n.length===0){console.log("[CHAT-TEXTAREA] No files selected");return}console.log("[CHAT-TEXTAREA] Files selected:",n.length);let o=Array.from(n);this.filesPasted.emit(o),t.value=""}onDocumentClick(e){if(!this.autocompleteVisible)return;let t=e.target,n=document.querySelector(".autocomplete-popup"),o=this.messageInput?.nativeElement;n&&!n.contains(t)&&o&&!o.contains(t)&&this.hideAutocomplete()}sendMessage(e=!1){let t=this.message.trim();!this.isDisabled&&(e||t)&&(this.isRecording&&this.recognition&&(this.clearPendingLineBreaks(),this.recognition.stop()),this.messageSubmitted.emit(t),this.message="",setTimeout(()=>this.adjustTextareaHeight(),0))}onStopClick(){this.isStopping=!0,this.stopRequested.emit()}toggleRecording(){this.isRecording?this.voiceInputMode==="whisper"||this.voiceInputMode==="voice-message"?this.stopWhisperRecording():this.stopRecording():this.voiceInputMode==="whisper"||this.voiceInputMode==="voice-message"?this.startWhisperRecording():this.startRecording()}startWhisperRecording(){return O(this,null,function*(){if(!this.isRecording)try{let e=yield navigator.mediaDevices.getUserMedia({audio:!0});this.audioChunks=[],this.mediaRecorder=new MediaRecorder(e),this.mediaRecorder.ondataavailable=t=>{t.data.size>0&&this.audioChunks.push(t.data)},this.mediaRecorder.onstop=()=>{e.getTracks().forEach(t=>t.stop()),this.processWhisperAudio()},this.mediaRecorder.onerror=t=>{console.error("[WHISPER] MediaRecorder error:",t),e.getTracks().forEach(n=>n.stop()),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)},this.mediaRecorder.start(),this.isRecording=!0,this.voiceRecordingToggled.emit(!0),console.log("[WHISPER] Started recording")}catch(e){console.error("[WHISPER] Failed to start recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)}})}stopWhisperRecording(){if(!(!this.mediaRecorder||!this.isRecording))try{this.mediaRecorder.stop(),this.isRecording=!1,this.voiceRecordingToggled.emit(!1),console.log("[WHISPER] Stopped recording")}catch(e){console.error("[WHISPER] Failed to stop recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)}}processWhisperAudio(){if(this.audioChunks.length===0)return;let e=new Blob(this.audioChunks,{type:this.mediaRecorder?.mimeType||"audio/webm"}),t=e.type.split(";")[0]||"audio/webm";this.audioChunks=[],this.isTranscribing=!0;let n=new FileReader;n.onloadend=()=>{let o=n.result.split(",")[1];if(!o){console.error("[WHISPER] Failed to read audio as base64"),this.isTranscribing=!1;return}let d=this.preferencesService.getVoiceLanguage().split("-")[0];if(this.voiceInputMode==="voice-message"){if(!this.threadStateService.getSelectedThreadId()){console.log("[WHISPER] No thread selected \u2014 emitting voiceMessageReady for thread creation"),this.isTranscribing=!1,this.voiceMessageReady.emit({base64:o,mimeType:t,language:d});return}this.audioApiService.sendVoiceMessage(o,t,d).subscribe({next:v=>{this.isTranscribing=!1,console.log("[WHISPER] Voice message sent, transcription:",v.transcription?.substring(0,50))},error:v=>{console.error("[WHISPER] Voice message error:",v),this.isTranscribing=!1,this.fallbackToTranscription(o,t,d)}})}else this.audioApiService.transcribeAudio(o,t,d).subscribe({next:v=>{this.isTranscribing=!1,v.text&&this.appendToTextarea(v.text+" ")},error:v=>{console.error("[WHISPER] Transcription error:",v),this.isTranscribing=!1}})},n.readAsDataURL(e)}fallbackToTranscription(e,t,n){this.audioApiService.transcribeAudio(e,t,n).subscribe({next:o=>{this.isTranscribing=!1,o.text&&this.appendToTextarea(o.text+" ")},error:o=>{console.error("[WHISPER] Fallback transcription also failed:",o),this.isTranscribing=!1}})}initializeVoiceInput(){let e=window.SpeechRecognition??window.webkitSpeechRecognition;if(console.log("[SPEECH] speechRecognition",e),!e){console.warn("[SPEECH] Speech Recognition API not available");return}this.recognition=new e,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.maxAlternatives=1,this.recognition.lang=this.getSelectedLanguage();try{"grammars"in this.recognition&&(this.recognition.serviceURI=void 0)}catch(t){console.log("[SPEECH] Advanced speech recognition parameters not supported")}this.recognition.onresult=t=>{let n="",o=Math.max(t.resultIndex,this.lastProcessedResultIndex);for(let r=o;r<t.results.length;r++)t.results[r].isFinal&&(n+=t.results[r][0].transcript,this.lastProcessedResultIndex=r+1);if(n){let r=this.improveTranscriptPunctuation(n.trim());this.sessionHadTranscript=!0,console.log("[SPEECH] onresult ending, appending to textarea",this.isRecording),this.appendToTextarea(r)}},this.recognition.onend=()=>{console.log("[SPEECH] Recognition ended. Was recording:",this.isRecording),this.isRecording=!1,this.lastProcessedResultIndex=0,this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onerror=t=>{console.error("[SPEECH] Speech recognition error:",t.error),console.log("[SPEECH] Error details:",{error:t.error,message:t.message,timeStamp:t.timeStamp}),this.isRecording=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onstart=()=>{console.log("[SPEECH] Recognition started successfully")},this.recognition.onspeechstart=()=>{console.log("[SPEECH] Speech detected")},this.recognition.onspeechend=()=>{console.log("[SPEECH] Speech ended")}}startRecording(){return O(this,null,function*(){if(!(!this.recognition||this.isRecording))try{this.isRecording=!0,this.sessionHadTranscript=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording),this.recognition.start(),console.log("[SPEECH] Started recording")}catch(e){console.error("[SPEECH] Failed to start recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(this.isRecording)}})}stopRecording(){if(!this.recognition||!this.isRecording){console.log("[SPEECH] stopRecording not recording");return}try{console.log("[SPEECH] stopRecording recognition stop"),this.recognition.stop(),this.schedulePendingLineBreaks()}catch(e){console.error("[SPEECH] Failed to stop recording:",e)}}getSelectedLanguage(){return this.preferencesService.getVoiceLanguage()}updateRecognitionLanguage(){if(this.recognition){let e=this.getSelectedLanguage();this.recognition.lang=e,console.log("[SPEECH] Language changed to:",e)}}improveTranscriptPunctuation(e){let t=e;return/[.!?]$/.test(t.trim())||(t=t.trim()+"."),t=t.charAt(0).toUpperCase()+t.slice(1),t=t.replace(/\s+/g," "),t=t+" ",t}appendToTextarea(e){let t=this.message;if(this.message=t?`${t}${e}`:e,this.messageInput?.nativeElement){this.messageInput.nativeElement.focus();let n=this.message.length;this.messageInput.nativeElement.setSelectionRange(n,n)}setTimeout(()=>this.adjustTextareaHeight(),0)}schedulePendingLineBreaks(){this.clearPendingLineBreaks(),this.pendingLineBreaksTimeout=window.setTimeout(()=>{this.sessionHadTranscript&&(console.log("[SPEECH] Adding line breaks after transcript session"),this.appendToTextarea(`
1
+ import{a as _n}from"./chunk-EAVXJ7QN.js";import{a as Ue,b as Be,c as xn,e as Mn,f as ce}from"./chunk-UEGZX4MW.js";import{a as wn,b as Tn,c as Sn}from"./chunk-TSYL5EEO.js";import{a as Ke}from"./chunk-DZ2M3NQD.js";import{a as je,b as K,c as ln,d as se,i as mn,j as pn,k as gn,m as un,o as hn,p as fn,r as bn,t as Qe,v as Cn,y as vn,z as Xe}from"./chunk-CRXIMHRG.js";import{a as yn}from"./chunk-GIIRKWUO.js";import{c as Kt}from"./chunk-6XX7GME4.js";import{a as An}from"./chunk-SKBEA6VH.js";import{s as In,w as Dn}from"./chunk-VNO76B3S.js";import{b as dn,h as En,i as On,j as Pn,n as kn}from"./chunk-E6T6QLQT.js";import{a as cn,c as $e}from"./chunk-VMYKE4ZC.js";import{a as R,b as z}from"./chunk-AS2L77JV.js";import{E as Ge,c as We,g as qe,m as Ye}from"./chunk-7OGOI6WM.js";import{b as X}from"./chunk-TASSC2XX.js";import{E as rn,K as an,O as re,Q as sn,R as Ne,S as ae,i as Jt,j as Zt,p as en,s as tn,t as nn,z as on}from"./chunk-G5RWG2GK.js";import{$b as He,B as q,Bb as _,D as De,Db as h,Fb as l,G as Rt,Ga as H,Ha as yt,Ja as zt,Jb as ue,Jc as ze,Ka as c,Kb as Z,Lb as ee,Lc as Xt,Mc as Mt,Pa as Nt,Pc as j,Rb as N,T as F,Tb as p,Ub as w,Vb as he,Wa as S,Wb as Ae,Xa as $t,Xc as G,Ya as jt,Z as k,Za as Ut,Zb as Fe,_ as Ht,_b as Re,_c as Q,a as de,ac as Wt,b as Pe,bc as qt,ca as m,cc as Yt,d as O,dc as Gt,fc as Ee,g as ke,ga as f,gc as Qt,h as B,ha as b,hc as St,i as Ie,jb as oe,la as Vt,lb as g,m as xt,mb as u,mc as Ve,n as At,oa as M,pa as Lt,pb as V,qb as L,rb as C,sb as a,t as ie,ta as W,tb as s,u as Ft,ub as x,va as Y,vb as wt,wb as Tt,xb as Bt,ya as ge,yc as Le}from"./chunk-CHEXA6RY.js";var Je=class i{sanitizer=m(Q);transform(e,t){if(!t||!e)return e;let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`(${n})`,"gi"),r=e.replace(o,"<strong>$1</strong>");return this.sanitizer.bypassSecurityTrustHtml(r)}static \u0275fac=function(t){return new(t||i)};static \u0275pipe=Ut({name:"highlight",type:i,pure:!0})};var fe=class i{http=m(G);projectState=m(X);threadState=m(K);transcribeAudio(e,t,n){let o=this.projectState.getSelectedProjectIdOrThrow();return this.http.post(`/api/projects/${o}/transcribe`,de({audio:e,mimeType:t},n?{language:n}:{}))}sendVoiceMessage(e,t,n){let o=this.projectState.getSelectedProjectIdOrThrow(),r=this.threadState.getSelectedThreadIdOrThrow();return this.http.post(`/api/projects/${o}/threads/${r}/voice-message`,de({audio:e,mimeType:t},n?{language:n}:{}))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var bi=["messageInput"],Ci=["fileInput"],vi=(i,e)=>e.name;function _i(i,e){i&1&&(a(0,"div",3),x(1,"span",8),p(2," Recording... Click mic to stop "),s())}function xi(i,e){i&1&&(a(0,"div",3),x(1,"span",9),p(2," Transcribing... "),s())}function yi(i,e){if(i&1&&(a(0,"span",14),p(1),s()),i&2){let t=l().$implicit,n=l(2);c(),w(" "+(n.getParameterFormat(t)||""))}}function wi(i,e){if(i&1){let t=_();a(0,"div",11),h("click",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("keydown.enter",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("keydown.space",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("mouseenter",function(){let o=f(t).$index,r=l(2);return b(r.selectedAutocompleteIndex=o)}),a(1,"div",12),x(2,"span",13),Ee(3,"highlight"),g(4,yi,2,1,"span",14),s(),x(5,"div",15),Ee(6,"highlight"),s()}if(i&2){let t=e.$implicit,n=e.$index,o=l(2);N("selected",n===o.selectedAutocompleteIndex),oe("aria-selected",n===o.selectedAutocompleteIndex),c(2),C("innerHTML",St(3,6,o.autocompleteTrigger+t.name,o.getAutocompleteQuery()),H),c(2),u(o.hasParameterFormat(t)?4:-1),c(),C("innerHTML",St(6,9,t.description,o.getAutocompleteQuery()),H)}}function Ti(i,e){if(i&1&&(a(0,"div",4),V(1,wi,7,12,"div",10,vi),s()),i&2){let t=l();c(),L(t.autocompleteItems)}}function Si(i,e){if(i&1){let t=_();a(0,"ds-icon-button",18),h("action",function(){f(t);let o=l(2);return b(o.onStopClick())}),s()}}function Mi(i,e){if(i&1){let t=_();a(0,"ds-icon-button",19),h("action",function(){f(t);let o=l(2);return b(o.sendMessage())}),s()}if(i&2){let t=l(2);N("hidden",t.isDisabled||!t.message.trim())("active",!!t.message.trim()&&!t.isDisabled),C("title",t.getSendButtonTooltip())("disabled",t.isDisabled||!t.message.trim())}}function Ei(i,e){if(i&1){let t=_();a(0,"ds-icon-button",21),h("action",function(){f(t);let o=l(3);return b(o.triggerFileUpload())}),s(),a(1,"input",22,1),h("change",function(o){f(t);let r=l(3);return b(r.onFileInputChange(o))}),s()}if(i&2){let t=l(3);C("disabled",t.isDisabled)}}function Oi(i,e){if(i&1){let t=_();g(0,Ei,3,1),a(1,"ds-icon-button",20),h("action",function(){f(t);let o=l(2);return b(o.toggleRecording())}),s()}if(i&2){let t=l(2);u(!t.showWelcome&&!(t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing))?0:-1),c(),N("hidden",t.message.trim()&&!t.isRecording&&!t.isTranscribing),C("variant",t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing)?"danger":"default")("disabled",t.isVoiceMessageMode&&t.isTranscribing)("title",t.isRecording?"Click to stop recording":t.isTranscribing?"Uploading...":"Click to start recording")}}function Pi(i,e){if(i&1&&(a(0,"div",7),g(1,Si,1,0,"ds-icon-button",16),g(2,Mi,1,6,"ds-icon-button",17),g(3,Oi,2,6),s()),i&2){let t=l();c(),u(t.isThinking?1:-1),c(),u((!t.isThinking||t.message.trim())&&!(t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing))?2:-1),c(),u(t.isThinking?-1:3)}}var Ze=class i{isDisabled=!1;showWelcome=!1;isThinking=!1;isStarting=!1;isSessionInitializing=!1;isStopping=!1;filesPasted=new M;messageSubmitted=new M;voiceMessageReady=new M;voiceRecordingToggled=new M;heightChanged=new M;stopRequested=new M;textareaFocused=new M;messageInput;fileInput;message="";isRecording=!1;isTranscribing=!1;isFocused=!1;recognition=null;mediaRecorder=null;audioChunks=[];voiceInputMode="browser";get isVoiceMessageMode(){return this.voiceInputMode==="voice-message"}sessionHadTranscript=!1;pendingLineBreaksTimeout=null;lastProcessedResultIndex=0;useEnterToSend=!1;currentInvite="";subscriptions=[];thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;autocompleteVisible=!1;autocompleteTrigger=null;autocompleteItems=[];selectedAutocompleteIndex=0;preferencesService=m(se);codayService=m(ce);agentApiService=m(_n);promptApiService=m(An);projectStateService=m(X);audioApiService=m(fe);threadStateService=m(K);ngOnInit(){this.initializeVoiceInput(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.subscriptions.push(this.preferencesService.voiceLanguage$.subscribe(()=>this.updateRecognitionLanguage())),this.subscriptions.push(this.preferencesService.voiceInputMode$.subscribe(e=>{this.voiceInputMode=e})),this.subscriptions.push(this.preferencesService.enterToSend$.subscribe(e=>{this.useEnterToSend=e})),this.subscribeToInviteEvents(),this.subscribeToMessageRestore()}ngAfterViewInit(){this.adjustTextareaHeight(),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),200)})}ngOnChanges(e){e.isThinking&&(e.isThinking.currentValue?this.startThinkingAnimation():(this.stopThinkingAnimation(),this.isStopping=!1,e.isThinking.previousValue&&(console.log("[CHAT-TEXTAREA] Thinking ended, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})))),e.isSessionInitializing&&!e.isSessionInitializing.currentValue&&e.isSessionInitializing.previousValue&&(console.log("[CHAT-TEXTAREA] Session initialization completed, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})),e.isStarting&&!e.isStarting.currentValue&&e.isStarting.previousValue&&this.isThinking&&(this.thinkingPhraseIndex===0?(console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index 0 - restarting animation"),this.stopThinkingAnimation(),this.startThinkingAnimation()):console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index",this.thinkingPhraseIndex,"- continuing without restart"))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions=[],this.clearPendingLineBreaks(),this.stopThinkingAnimation()}onKeyDown(e){if(this.autocompleteVisible)switch(e.key){case"ArrowDown":e.preventDefault(),this.selectedAutocompleteIndex=Math.min(this.selectedAutocompleteIndex+1,this.autocompleteItems.length-1),this.scrollSelectedItemIntoView();return;case"ArrowUp":e.preventDefault(),this.selectedAutocompleteIndex=Math.max(this.selectedAutocompleteIndex-1,0),this.scrollSelectedItemIntoView();return;case"Tab":case"Enter":if(!this.message.includes(" ")){e.preventDefault(),this.selectAutocompleteItem();return}break;case"Escape":e.preventDefault(),this.hideAutocomplete();return}e.key==="Enter"&&(this.useEnterToSend?!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(e.preventDefault(),this.sendMessage(!0)):(navigator.platform.toLowerCase().includes("mac")?e.metaKey:e.ctrlKey)&&!e.shiftKey&&(e.preventDefault(),this.sendMessage(!0)))}onInput(){this.adjustTextareaHeight(),this.checkForAutocomplete()}onPaste(e){let t=e.clipboardData?.items;if(!t)return;let n=Array.from(t).filter(r=>r.kind==="file");if(!n.length)return;e.preventDefault();let o=n.reduce((r,d)=>{let v=d.getAsFile();return v?[...r,v]:r},[]);o.length&&this.filesPasted.emit(o)}triggerFileUpload(){console.log("[CHAT-TEXTAREA] Triggering file upload"),this.fileInput?.nativeElement?.click()}onFileInputChange(e){let t=e.target,n=t.files;if(!n||n.length===0){console.log("[CHAT-TEXTAREA] No files selected");return}console.log("[CHAT-TEXTAREA] Files selected:",n.length);let o=Array.from(n);this.filesPasted.emit(o),t.value=""}onDocumentClick(e){if(!this.autocompleteVisible)return;let t=e.target,n=document.querySelector(".autocomplete-popup"),o=this.messageInput?.nativeElement;n&&!n.contains(t)&&o&&!o.contains(t)&&this.hideAutocomplete()}sendMessage(e=!1){let t=this.message.trim();!this.isDisabled&&(e||t)&&(this.isRecording&&this.recognition&&(this.clearPendingLineBreaks(),this.recognition.stop()),this.messageSubmitted.emit(t),this.message="",setTimeout(()=>this.adjustTextareaHeight(),0))}onStopClick(){this.isStopping=!0,this.stopRequested.emit()}toggleRecording(){this.isRecording?this.voiceInputMode==="whisper"||this.voiceInputMode==="voice-message"?this.stopWhisperRecording():this.stopRecording():this.voiceInputMode==="whisper"||this.voiceInputMode==="voice-message"?this.startWhisperRecording():this.startRecording()}startWhisperRecording(){return O(this,null,function*(){if(!this.isRecording)try{let e=yield navigator.mediaDevices.getUserMedia({audio:!0});this.audioChunks=[],this.mediaRecorder=new MediaRecorder(e),this.mediaRecorder.ondataavailable=t=>{t.data.size>0&&this.audioChunks.push(t.data)},this.mediaRecorder.onstop=()=>{e.getTracks().forEach(t=>t.stop()),this.processWhisperAudio()},this.mediaRecorder.onerror=t=>{console.error("[WHISPER] MediaRecorder error:",t),e.getTracks().forEach(n=>n.stop()),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)},this.mediaRecorder.start(),this.isRecording=!0,this.voiceRecordingToggled.emit(!0),console.log("[WHISPER] Started recording")}catch(e){console.error("[WHISPER] Failed to start recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)}})}stopWhisperRecording(){if(!(!this.mediaRecorder||!this.isRecording))try{this.mediaRecorder.stop(),this.isRecording=!1,this.voiceRecordingToggled.emit(!1),console.log("[WHISPER] Stopped recording")}catch(e){console.error("[WHISPER] Failed to stop recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)}}processWhisperAudio(){if(this.audioChunks.length===0)return;let e=new Blob(this.audioChunks,{type:this.mediaRecorder?.mimeType||"audio/webm"}),t=e.type.split(";")[0]||"audio/webm";this.audioChunks=[],this.isTranscribing=!0;let n=new FileReader;n.onloadend=()=>{let o=n.result.split(",")[1];if(!o){console.error("[WHISPER] Failed to read audio as base64"),this.isTranscribing=!1;return}let d=this.preferencesService.getVoiceLanguage().split("-")[0];if(this.voiceInputMode==="voice-message"){if(!this.threadStateService.getSelectedThreadId()){console.log("[WHISPER] No thread selected \u2014 emitting voiceMessageReady for thread creation"),this.isTranscribing=!1,this.voiceMessageReady.emit({base64:o,mimeType:t,language:d});return}this.audioApiService.sendVoiceMessage(o,t,d).subscribe({next:v=>{this.isTranscribing=!1,console.log("[WHISPER] Voice message sent, transcription:",v.transcription?.substring(0,50))},error:v=>{console.error("[WHISPER] Voice message error:",v),this.isTranscribing=!1,this.fallbackToTranscription(o,t,d)}})}else this.audioApiService.transcribeAudio(o,t,d).subscribe({next:v=>{this.isTranscribing=!1,v.text&&this.appendToTextarea(v.text+" ")},error:v=>{console.error("[WHISPER] Transcription error:",v),this.isTranscribing=!1}})},n.readAsDataURL(e)}fallbackToTranscription(e,t,n){this.audioApiService.transcribeAudio(e,t,n).subscribe({next:o=>{this.isTranscribing=!1,o.text&&this.appendToTextarea(o.text+" ")},error:o=>{console.error("[WHISPER] Fallback transcription also failed:",o),this.isTranscribing=!1}})}initializeVoiceInput(){let e=window.SpeechRecognition??window.webkitSpeechRecognition;if(console.log("[SPEECH] speechRecognition",e),!e){console.warn("[SPEECH] Speech Recognition API not available");return}this.recognition=new e,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.maxAlternatives=1,this.recognition.lang=this.getSelectedLanguage();try{"grammars"in this.recognition&&(this.recognition.serviceURI=void 0)}catch(t){console.log("[SPEECH] Advanced speech recognition parameters not supported")}this.recognition.onresult=t=>{let n="",o=Math.max(t.resultIndex,this.lastProcessedResultIndex);for(let r=o;r<t.results.length;r++)t.results[r].isFinal&&(n+=t.results[r][0].transcript,this.lastProcessedResultIndex=r+1);if(n){let r=this.improveTranscriptPunctuation(n.trim());this.sessionHadTranscript=!0,console.log("[SPEECH] onresult ending, appending to textarea",this.isRecording),this.appendToTextarea(r)}},this.recognition.onend=()=>{console.log("[SPEECH] Recognition ended. Was recording:",this.isRecording),this.isRecording=!1,this.lastProcessedResultIndex=0,this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onerror=t=>{console.error("[SPEECH] Speech recognition error:",t.error),console.log("[SPEECH] Error details:",{error:t.error,message:t.message,timeStamp:t.timeStamp}),this.isRecording=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onstart=()=>{console.log("[SPEECH] Recognition started successfully")},this.recognition.onspeechstart=()=>{console.log("[SPEECH] Speech detected")},this.recognition.onspeechend=()=>{console.log("[SPEECH] Speech ended")}}startRecording(){return O(this,null,function*(){if(!(!this.recognition||this.isRecording))try{this.isRecording=!0,this.sessionHadTranscript=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording),this.recognition.start(),console.log("[SPEECH] Started recording")}catch(e){console.error("[SPEECH] Failed to start recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(this.isRecording)}})}stopRecording(){if(!this.recognition||!this.isRecording){console.log("[SPEECH] stopRecording not recording");return}try{console.log("[SPEECH] stopRecording recognition stop"),this.recognition.stop(),this.schedulePendingLineBreaks()}catch(e){console.error("[SPEECH] Failed to stop recording:",e)}}getSelectedLanguage(){return this.preferencesService.getVoiceLanguage()}updateRecognitionLanguage(){if(this.recognition){let e=this.getSelectedLanguage();this.recognition.lang=e,console.log("[SPEECH] Language changed to:",e)}}improveTranscriptPunctuation(e){let t=e;return/[.!?]$/.test(t.trim())||(t=t.trim()+"."),t=t.charAt(0).toUpperCase()+t.slice(1),t=t.replace(/\s+/g," "),t=t+" ",t}appendToTextarea(e){let t=this.message;if(this.message=t?`${t}${e}`:e,this.messageInput?.nativeElement){this.messageInput.nativeElement.focus();let n=this.message.length;this.messageInput.nativeElement.setSelectionRange(n,n)}setTimeout(()=>this.adjustTextareaHeight(),0)}schedulePendingLineBreaks(){this.clearPendingLineBreaks(),this.pendingLineBreaksTimeout=window.setTimeout(()=>{this.sessionHadTranscript&&(console.log("[SPEECH] Adding line breaks after transcript session"),this.appendToTextarea(`
2
2
 
3
3
  `),this.sessionHadTranscript=!1),this.pendingLineBreaksTimeout=null},500)}clearPendingLineBreaks(){this.pendingLineBreaksTimeout&&(clearTimeout(this.pendingLineBreaksTimeout),this.pendingLineBreaksTimeout=null)}adjustTextareaHeight(){let e=this.messageInput?.nativeElement;if(!e)return;let t=e.parentElement?.offsetHeight??e.offsetHeight+32;this.heightChanged.emit(t)}getSendButtonShortcut(){return this.useEnterToSend?"Enter":navigator.platform.toLowerCase().includes("mac")?"\u2318+Enter":"Ctrl+Enter"}getSendButtonTooltip(){return this.useEnterToSend?"Send message (Enter) - Shift+Enter for new line":`Send message (${navigator.platform.toLowerCase().includes("mac")?"Cmd+Enter":"Ctrl+Enter"}) - Enter for new line`}getPlaceholder(){return this.isSessionInitializing?"Initializing session...":this.isThinking?this.isStopping?"Stopping...":this.isStarting?"Processing request...":this.currentThinkingPhrase:this.isVoiceMessageMode&&this.isTranscribing?"Uploading...":this.isVoiceMessageMode&&this.isRecording?"Listening...":this.showWelcome?"How can I help you today?":"Type '@' for agents, '/' for commands, or just your message..."}startThinkingAnimation(){this.thinkingPhraseIndex=0,this.currentThinkingPhrase=this.thinkingPhrases[0]??"Thinking...",this.thinkingInterval=window.setInterval(()=>{this.thinkingPhraseIndex<this.thinkingPhrases.length-1&&(this.thinkingPhraseIndex++,this.currentThinkingPhrase=this.thinkingPhrases[this.thinkingPhraseIndex]??"Thinking...")},2e3)}stopThinkingAnimation(){this.thinkingInterval&&(clearInterval(this.thinkingInterval),this.thinkingInterval=null),this.thinkingPhraseIndex=0,this.currentThinkingPhrase="Thinking..."}subscribeToInviteEvents(){this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(e=>{e?this.handleInviteEvent(e.invite,e.defaultValue):this.currentInvite=""}))}handleInviteEvent(e,t){this.currentInvite=e,t&&(this.message=t,setTimeout(()=>this.adjustTextareaHeight(),0)),setTimeout(()=>{this.messageInput?.nativeElement&&this.messageInput.nativeElement.focus()},50)}subscribeToMessageRestore(){this.subscriptions.push(this.codayService.messageToRestore$.subscribe(e=>{e.trim()&&(console.log("[CHAT-TEXTAREA] Restoring message content:",e.substring(0,50)+"..."),this.restoreMessageContent(e))}))}restoreMessageContent(e){this.message=e,this.messageInput?.nativeElement&&(this.messageInput.nativeElement.focus(),setTimeout(()=>{let t=this.messageInput.nativeElement,n=this.message.length;t.setSelectionRange(n,n)},0)),setTimeout(()=>this.adjustTextareaHeight(),10)}focusTextarea(){let e=this.messageInput?.nativeElement;console.log("[CHAT-TEXTAREA] focusTextarea called",{hasElement:!!e,isDisabled:this.isDisabled,isThinking:this.isThinking,elementDisabled:e?.disabled,isSessionInitializing:this.isSessionInitializing}),e&&!e.disabled?(e.focus(),console.log("[CHAT-TEXTAREA] Textarea focused successfully")):console.log("[CHAT-TEXTAREA] Focus blocked - element disabled or not available")}checkForAutocomplete(){let e=this.message;if(e.startsWith("@")){let t=e.substring(1);if(t.includes(" ")){this.hideAutocomplete();return}this.showAgentAutocomplete(t);return}if(e.startsWith("/")){let t=e.substring(1);if(t.includes(" ")){this.hideAutocomplete();return}this.showPromptAutocomplete(t);return}this.hideAutocomplete()}showAgentAutocomplete(e){this.autocompleteTrigger="@";try{let t=this.projectStateService.getSelectedProjectIdOrThrow();this.agentApiService.getAgentsAutocomplete(t,e).subscribe({next:n=>{this.autocompleteItems=n,this.autocompleteVisible=n.length>0,this.selectedAutocompleteIndex=0},error:n=>{console.error("[AUTOCOMPLETE] Error loading agents:",n),this.hideAutocomplete()}})}catch(t){console.warn("[AUTOCOMPLETE] No project selected, cannot load agents"),this.hideAutocomplete()}}showPromptAutocomplete(e){this.autocompleteTrigger="/";try{let t=this.projectStateService.getSelectedProjectIdOrThrow();this.promptApiService.getPromptsAutocomplete(t,e).subscribe({next:n=>{this.autocompleteItems=n,this.autocompleteVisible=n.length>0,this.selectedAutocompleteIndex=0},error:n=>{console.error("[AUTOCOMPLETE] Error loading prompts:",n),this.hideAutocomplete()}})}catch(t){console.warn("[AUTOCOMPLETE] No project selected, cannot load prompts"),this.hideAutocomplete()}}hideAutocomplete(){this.autocompleteVisible=!1,this.autocompleteItems=[],this.selectedAutocompleteIndex=0}selectAutocompleteItem(){let e=this.autocompleteItems[this.selectedAutocompleteIndex];if(!e)return;let t=null;if(this.autocompleteTrigger==="/"){let n=e,o=n.parameterFormat;if(console.log(n),o===void 0)this.message=`/${e.name}`;else if(o==="")this.message=`/${e.name} `;else{this.message=`/${e.name} ${o}`;let r=this.message.indexOf('=""');r!==-1&&(t=r+2)}}else this.message=`@${e.name} `;this.hideAutocomplete(),setTimeout(()=>{if(this.messageInput?.nativeElement)if(this.messageInput.nativeElement.focus(),t!==null)this.messageInput.nativeElement.setSelectionRange(t,t);else{let n=this.message.length;this.messageInput.nativeElement.setSelectionRange(n,n)}},0)}selectAutocompleteItemByClick(e){this.selectedAutocompleteIndex=e,this.selectAutocompleteItem()}getAutocompleteQuery(){return this.message.substring(1).split(" ")[0]??""}getParameterFormat(e){return e.parameterFormat}hasParameterFormat(e){return this.autocompleteTrigger==="/"&&e.parameterFormat!==void 0}scrollSelectedItemIntoView(){setTimeout(()=>{let e=document.querySelector(".autocomplete-popup");if(!e)return;let t=e.querySelector(".autocomplete-item.selected");t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},0)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=S({type:i,selectors:[["app-chat-textarea"]],viewQuery:function(t,n){if(t&1&&ue(bi,7)(Ci,5),t&2){let o;Z(o=ee())&&(n.messageInput=o.first),Z(o=ee())&&(n.fileInput=o.first)}},hostBindings:function(t,n){t&1&&h("paste",function(r){return n.onPaste(r)})("click",function(r){return n.onDocumentClick(r)},zt)},inputs:{isDisabled:"isDisabled",showWelcome:"showWelcome",isThinking:"isThinking",isStarting:"isStarting",isSessionInitializing:"isSessionInitializing"},outputs:{filesPasted:"filesPasted",messageSubmitted:"messageSubmitted",voiceMessageReady:"voiceMessageReady",voiceRecordingToggled:"voiceRecordingToggled",heightChanged:"heightChanged",stopRequested:"stopRequested",textareaFocused:"textareaFocused"},features:[Y],decls:8,vars:15,consts:[["messageInput",""],["fileInput",""],[1,"chat-input-container"],[1,"recording-indicator"],[1,"autocomplete-popup"],[1,"input-row","grouped-input"],[1,"message-input",3,"ngModelChange","keydown","input","focus","blur","ngModel","placeholder","disabled"],[1,"actions"],[1,"recording-dot"],[1,"transcribing-dot"],["role","option","tabindex","0",1,"autocomplete-item",3,"selected"],["role","option","tabindex","0",1,"autocomplete-item",3,"click","keydown.enter","keydown.space","mouseenter"],[1,"item-name"],[3,"innerHTML"],[1,"parameter-format"],[1,"item-description",3,"innerHTML"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn"],["icon","send","variant","primary",1,"send-btn",3,"title","disabled","hidden","active"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn",3,"action"],["icon","send","variant","primary",1,"send-btn",3,"action","title","disabled"],["icon","mic",1,"voice-btn",3,"action","variant","disabled","title"],["icon","attach_file","variant","default","title","Upload files (images or documents)",1,"upload-btn",3,"action","disabled"],["type","file","multiple","","accept","image/*,application/pdf,.pdf,.doc,.docx,.txt,.md,.json,.yaml,.yml,.csv,.xml,.html",2,"display","none",3,"change"]],template:function(t,n){if(t&1){let o=_();a(0,"div",2),g(1,_i,3,0,"div",3),g(2,xi,3,0,"div",3),g(3,Ti,3,0,"div",4),a(4,"div",5)(5,"textarea",6,0),He("ngModelChange",function(d){return f(o),Re(n.message,d)||(n.message=d),b(d)}),h("keydown",function(d){return n.onKeyDown(d)})("input",function(){return n.onInput()})("focus",function(){return f(o),n.isFocused=!0,b(n.textareaFocused.emit())})("blur",function(){return n.isFocused=!1}),s(),g(7,Pi,4,3,"div",7),s()()}t&2&&(c(),u(!n.isVoiceMessageMode&&n.isRecording?1:-1),c(),u(!n.isVoiceMessageMode&&n.isTranscribing?2:-1),c(),u(n.autocompleteVisible?3:-1),c(),N("focused",n.isFocused)("welcome-mode",n.showWelcome)("is-thinking",n.isThinking)("is-listening",n.isVoiceMessageMode&&(n.isRecording||n.isTranscribing)),c(),Fe("ngModel",n.message),C("placeholder",n.getPlaceholder())("disabled",n.isDisabled||n.isVoiceMessageMode&&(n.isRecording||n.isTranscribing)),c(2),u(n.isSessionInitializing?-1:7))},dependencies:[Ge,We,qe,Ye,In,Je],styles:['@keyframes _ngcontent-%COMP%_gradientBorderShift{0%{background-position:0 0}50%{background-position:100% 0}to{background-position:0 0}}.chat-input-container[_ngcontent-%COMP%]{flex-shrink:0;width:100%;position:relative}.thinking-progress[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;height:3px;z-index:1}.thinking-progress[_ngcontent-%COMP%] .mdc-linear-progress__bar-inner{border-top-width:3px}.input-row.grouped-input[_ngcontent-%COMP%]{display:flex;align-items:stretch;background:var(--glass-bg);border-radius:16px;padding:0 .15rem 0 1.25rem;position:relative;transition:border-color .2s,box-shadow .2s,background .3s}.input-row[_ngcontent-%COMP%]{position:relative;background:var(--glass-bg, #1e1e1e)!important;background-clip:padding-box}.input-row[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:-2px;border-radius:inherit;background-size:200% 100%;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;padding:1px;pointer-events:none;z-index:-1;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-listening[_ngcontent-%COMP%]:before{inset:0;-webkit-mask:none;mask:none;padding:0;opacity:.15;z-index:0;background:linear-gradient(90deg,var(--color-error, #ef4444) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-error, #ef4444) 100%);background-size:200% 100%;animation:_ngcontent-%COMP%_gradientBorderShift 2s ease-in-out infinite}.input-row.is-listening[_ngcontent-%COMP%] .message-input[_ngcontent-%COMP%], .input-row.is-listening[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{position:relative;z-index:1}.input-row.is-thinking[_ngcontent-%COMP%]:before{inset:0;-webkit-mask:none;mask:none;padding:0;opacity:.15;z-index:0;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% 100%;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%] .message-input[_ngcontent-%COMP%], .input-row.is-thinking[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{position:relative;z-index:1}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking):before{background:var(--color-primary);animation:none}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking){box-shadow:0 0 0 4px #007aff1a}.message-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent!important;box-shadow:none;font-size:1rem;padding:1rem 0;color:var(--color-text);resize:none;field-sizing:content;min-height:36px;max-height:70vh;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;line-height:1.5}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.message-input[_ngcontent-%COMP%]:focus{outline:none;border:none;box-shadow:none}.message-input[_ngcontent-%COMP%]:disabled{background-color:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;opacity:.6}.message-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);transition:opacity .3s ease-in-out}.message-input[_ngcontent-%COMP%]:disabled::placeholder{animation:_ngcontent-%COMP%_thinkingPulsate 2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_thinkingPulsate{0%,to{opacity:.6}50%{opacity:1}}.voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%]{margin:0}.actions[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap;justify-content:center}.send-btn[_ngcontent-%COMP%]{transition:opacity .4s,margin-left .4s}.send-btn.active[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:1}.send-btn[_ngcontent-%COMP%]:not(.active) button[_ngcontent-%COMP%]{opacity:0;margin-left:calc(-.5rem - 36px)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){color:#fff;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-primary, #3b82f6) 20%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 80%,var(--color-primary, #3b82f6) 100%);background-size:300% auto;animation:sendButtonGradientShift 6s ease-in-out infinite;box-shadow:0 4px 14px #007aff30;transform:scale(1.2)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active:not(:disabled){transform:scale(1.3);box-shadow:0 4px 24px #007aff30}.recording-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-top:.2rem;margin-bottom:.2rem;color:var(--color-error, #ff5555);font-size:.9rem;position:absolute;top:-1.5rem}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:1}50%{opacity:.5}}.autocomplete-popup[_ngcontent-%COMP%]{position:absolute;bottom:100%;left:0;right:0;margin-bottom:.5rem;background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-backdrop-blur);backdrop-filter:var(--glass-backdrop-blur);border-radius:12px;box-shadow:0 8px 32px #00000026;border:1px solid var(--color-border);max-height:400px;max-width:500px;overflow-y:auto;z-index:100}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]{padding:.75rem 1rem;cursor:pointer;transition:background .2s;border-left:3px solid transparent}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]:hover, .autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{background:var(--color-bg-hover)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{border-left-color:var(--color-primary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{font-weight:600;color:var(--color-text);margin-bottom:.25rem;font-family:SF Mono,Monaco,Menlo,Cascadia Code,Consolas,monospace;font-size:.95rem}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1));padding:0 2px;border-radius:2px}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] .parameter-format[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-weight:400;opacity:.7}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);line-height:1.3}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1))}@media print{.thinking-progress[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%], .recording-indicator[_ngcontent-%COMP%], .autocomplete-popup[_ngcontent-%COMP%]{display:none!important}}']})};var be=class i{unreadCountSubject=new Ie(0);unreadCount$=this.unreadCountSubject.asObservable();constructor(){console.log("[UNREAD] Service initialized")}addUnread(){let t=this.unreadCountSubject.value+1;this.unreadCountSubject.next(t),console.log("[UNREAD] Added unread message, total:",t)}markAllAsRead(){this.unreadCountSubject.value>0&&(this.unreadCountSubject.next(0),console.log("[UNREAD] Marked all messages as read"))}getCurrentCount(){return this.unreadCountSubject.value}reset(){this.unreadCountSubject.next(0),console.log("[UNREAD] Counter reset")}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var et=class i{ATTENTION_EMOJI="\u{1F534}";isSystemActive=!1;systemActiveTimer=null;SYSTEM_ACTIVE_TIMEOUT=4e3;unreadService=m(be);project=m(X);constructor(){this.initializeTitleUpdates()}initializeTitleUpdates(){Ft([this.project.selectedProject$,this.unreadService.unreadCount$]).subscribe(([e,t])=>{this.updateTitle(e?.name??"...",t)})}updateTitle(e,t){let n;this.isSystemActive?n=`\u23F3${t>0?` (${t}) `:" "}${e}`:t>0?n=`${this.ATTENTION_EMOJI} (${t}) ${e}`:n=e,document.title=n,console.log("[TAB-TITLE] Updated to:",n)}setSystemActive(){console.log("[TAB-TITLE] System active - showing hourglass"),this.isSystemActive=!0,this.systemActiveTimer&&clearTimeout(this.systemActiveTimer),this.systemActiveTimer=setTimeout(()=>{console.log("[TAB-TITLE] System active timeout - hiding hourglass"),this.isSystemActive=!1,this.forceUpdateTitle()},this.SYSTEM_ACTIVE_TIMEOUT),this.forceUpdateTitle()}setSystemInactive(){console.log("[TAB-TITLE] System inactive - hiding hourglass"),this.isSystemActive=!1,this.systemActiveTimer&&(clearTimeout(this.systemActiveTimer),this.systemActiveTimer=null),this.forceUpdateTitle()}forceUpdateTitle(){let e=this.project.getSelectedProjectId()??"...",t=this.unreadService.getCurrentCount();this.updateTitle(e,t)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var tt=class i{pendingFirstMessage=null;pendingVoiceMessage=null;setPendingFirstMessage(e){console.log("[FIRST-MESSAGE-STATE] Storing pending first message:",e.substring(0,50)+"..."),this.pendingFirstMessage=e}consumePendingFirstMessage(){let e=this.pendingFirstMessage;return e?(console.log("[FIRST-MESSAGE-STATE] Consuming pending first message:",e.substring(0,50)+"..."),this.pendingFirstMessage=null):console.log("[FIRST-MESSAGE-STATE] No pending first message to consume"),e}setPendingVoiceMessage(e){console.log("[FIRST-MESSAGE-STATE] Storing pending voice message"),this.pendingVoiceMessage=e}consumePendingVoiceMessage(){let e=this.pendingVoiceMessage;return e&&(console.log("[FIRST-MESSAGE-STATE] Consuming pending voice message"),this.pendingVoiceMessage=null),e}hasPendingFirstMessage(){return this.pendingFirstMessage!==null||this.pendingVoiceMessage!==null}clear(){this.pendingFirstMessage&&(console.log("[FIRST-MESSAGE-STATE] Clearing pending first message"),this.pendingFirstMessage=null),this.pendingVoiceMessage=null}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var ki=(i,e)=>e.label;function Ii(i,e){if(i&1){let t=_();a(0,"button",2),h("click",function(o){let r=f(t).$implicit,d=l();return b(d.executeAction(r,o))}),a(1,"mat-icon"),p(2),s()()}if(i&2){let t=e.$implicit;oe("title",t.tooltip||t.label),c(),oe("aria-label",t.label),c(),w(t.icon)}}var nt=class i{actions=[];executeAction(e,t){t.stopPropagation(),e.action()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=S({type:i,selectors:[["app-message-context-menu"]],inputs:{actions:"actions"},decls:3,vars:0,consts:[[1,"context-menu-wrapper"],["mat-icon-button",""],["mat-icon-button","",3,"click"]],template:function(t,n){t&1&&(a(0,"div",0),V(1,Ii,3,3,"button",1,ki),s()),t&2&&(c(),L(n.actions))},dependencies:[j,re,R],styles:[".context-menu-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}.context-menu-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{transform:scale(.75)}"]})};var J=class i{renderer;constructor(){this.renderer=new wn,this.configureRenderer()}configureRenderer(){let e=this.renderer.link.bind(this.renderer);this.renderer.link=t=>{let n=this.isExternalLink(t.href),o=e(t);if(n){o=o.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ');let r=t.title?`${t.text} - ${t.title} (opens in new tab)`:`${t.text} (opens in new tab)`;o=o.replace("<a ",`<a aria-label="${this.escapeHtml(r)}" `),o=o.replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')}return o}}isExternalLink(e){if(!e||e.startsWith("/")||e.startsWith("#")||e.startsWith("?"))return!1;if(e.startsWith("//"))return!0;try{return new URL(e,window.location.href).hostname!==window.location.hostname}catch(t){return!1}}escapeHtml(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return e.replace(/[&<>"']/g,n=>t[n]||n)}parse(e){return O(this,null,function*(){let t=yield Tn.parse(e,{renderer:this.renderer,breaks:!0,gfm:!0});return Sn.sanitize(t,{ADD_TAGS:["span"],ADD_ATTR:["aria-hidden","aria-label","target","rel"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i})})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var Di=i=>({"user-message-wrapper":i});function Ai(i,e){if(i&1&&(a(0,"div",4)(1,"div",8),p(2),s()()),i&2){let t=l(2);c(2),he(" ",t.message.speaker," ")}}function Fi(i,e){if(i&1&&(a(0,"time",6),p(1),s()),i&2){let t=l(2);c(),w(t.formattedTimestamp)}}function Ri(i,e){if(i&1&&(a(0,"div",7),x(1,"app-message-context-menu",9),s()),i&2){let t=l(2);c(),C("actions",t.actions)}}function Hi(i,e){if(i&1&&(g(0,Ai,3,1,"div",4),x(1,"div",5),g(2,Fi,2,1,"time",6),g(3,Ri,2,1,"div",7)),i&2){let t=l();u(t.shouldShowSpeaker?0:-1),c(),C("innerHTML",t.renderedContent,H),c(),u(t.formattedTimestamp?2:-1),c(),u(t.isLongMessage&&t.shouldShowActions&&t.message.role==="assistant"?3:-1)}}function Vi(i,e){if(i&1&&x(0,"span",12),i&2){let t=l(3);C("innerHTML",t.renderedContent,H)}}function Li(i,e){if(i&1&&(a(0,"span",13),p(1),s()),i&2){let t=l(3);c(),w(t.collapsedErrorText)}}function zi(i,e){i&1&&p(0," Show less \u25B2 ")}function Ni(i,e){i&1&&p(0," Show more \u25BC ")}function $i(i,e){if(i&1){let t=_();a(0,"div",10),g(1,Vi,1,1,"span",12)(2,Li,2,1,"span",13),a(3,"button",14),h("click",function(){f(t);let o=l(2);return b(o.toggleErrorExpanded())}),g(4,zi,1,0)(5,Ni,1,0),s()()}if(i&2){let t=l(2);c(),u(t.isErrorExpanded()?1:2),c(3),u(t.isErrorExpanded()?4:5)}}function ji(i,e){i&1&&p(0," \u25B2 ")}function Ui(i,e){i&1&&p(0," \u25BC ")}function Bi(i,e){if(i&1&&(a(0,"a",17),p(1,"view"),s()),i&2){let t=l(3);C("href",t.eventLink,yt)}}function Wi(i,e){if(i&1&&(a(0,"pre",18),p(1),s()),i&2){let t=l(3);c(),w(t.message.fullContent)}}function qi(i,e){if(i&1){let t=_();a(0,"div",15),x(1,"span",12),a(2,"button",16),h("click",function(){f(t);let o=l(2);return b(o.toggleTechnicalExpanded())}),g(3,ji,1,0)(4,Ui,1,0),s(),g(5,Bi,2,1,"a",17),s(),g(6,Wi,2,1,"pre",18)}if(i&2){let t=l(2);c(),C("innerHTML",t.renderedContent,H),c(2),u(t.isTechnicalExpanded()?3:4),c(2),u(t.eventLink?5:-1),c(),u(t.isTechnicalExpanded()?6:-1)}}function Yi(i,e){if(i&1&&(a(0,"a",17),p(1,"view"),s()),i&2){let t=l(3);C("href",t.eventLink,yt)}}function Gi(i,e){if(i&1&&(a(0,"div",11),x(1,"span",12),g(2,Yi,2,1,"a",17),s()),i&2){let t=l(2);c(),C("innerHTML",t.renderedContent,H),c(),u(t.eventLink?2:-1)}}function Qi(i,e){if(i&1&&g(0,$i,6,2,"div",10)(1,qi,7,4)(2,Gi,3,2,"div",11),i&2){let t=l();u(t.message.type==="error"&&t.isLongError?0:t.message.type==="technical"&&t.message.fullContent?1:2)}}function Xi(i,e){if(i&1&&(a(0,"div",2),x(1,"app-message-context-menu",9),s()),i&2){let t=l();c(),C("actions",t.actions)}}function Ki(i,e){if(i&1&&(a(0,"div",3),x(1,"app-message-context-menu",9),s()),i&2){let t=l();c(),C("actions",t.actions)}}var Ce=class i{destroy$=new B;message;canDelete=!0;isOtherUser=!1;containingThreadId;copyRequested=new M;deleteRequested=new M;renderedContent="";shouldHideTechnical=!1;shouldHideWarning=!1;isErrorExpanded=W(!1);static ERROR_COLLAPSE_LINE_THRESHOLD=5;isTechnicalExpanded=W(!1);sanitizer=m(Q);notificationService=m(yn);preferencesService=m(se);projectState=m(X);threadState=m(K);markdownService=m(J);get messageClasses(){return{[this.message.role]:!0,[this.message.type]:!0,"hidden-technical":this.shouldHideTechnical&&this.message.type==="technical","hidden-warning":this.shouldHideWarning&&this.message.type==="warning","other-user":this.isOtherUser}}ngOnInit(){return O(this,null,function*(){yield this.renderMarkdown(),this.preferencesService.hideTechnicalMessages$.pipe(F(this.destroy$)).subscribe(e=>{this.shouldHideTechnical=e}),this.preferencesService.hideWarningMessages$.pipe(F(this.destroy$)).subscribe(e=>{this.shouldHideWarning=e}),this.shouldHideTechnical=this.preferencesService.getHideTechnicalMessages(),this.shouldHideWarning=this.preferencesService.getHideWarningMessages()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get shouldShowSpeaker(){return this.message.role==="user"?this.isOtherUser||this.message.speaker.startsWith("@"):this.message.role==="assistant"}get shouldShowActions(){return this.message.role==="user"||this.message.role==="assistant"}get isSimplified(){return this.message.role!=="user"&&this.message.role!=="assistant"}datePipe=m(Mt);get formattedTimestamp(){if(this.message.role!=="user"||!this.message.timestamp)return null;let e=new Date().toDateString()===this.message.timestamp.toDateString();return this.datePipe.transform(this.message.timestamp,e?"HH:mm":"dd/MM HH:mm")}get isLongError(){return this.message.type!=="error"?!1:this.extractTextContent().split(/\n|\\n/).length>i.ERROR_COLLAPSE_LINE_THRESHOLD}get collapsedErrorText(){return this.extractTextContent().split(/\n|\\n/).slice(0,i.ERROR_COLLAPSE_LINE_THRESHOLD).join(`
4
4
  `)+"\u2026"}toggleErrorExpanded(){this.isErrorExpanded.update(e=>!e)}toggleTechnicalExpanded(){this.isTechnicalExpanded.update(e=>!e)}get isLongMessage(){let e=this.extractTextContent();return e.length>1e3||e.split(`
@@ -1,4 +1,4 @@
1
- import{c as be,d as N,e as _e,f as Te,g as we,h as Oe,i as Pe,j as xe,k as ke,l as Ve,m as Ie,n as Ne,o as je,p as We,q as U,r as Re,s as Ae,u as Fe,v as De,w as Le,x as Be,y as ze,z as Ue}from"./chunk-ZCELWKMZ.js";import{a as $e}from"./chunk-J4UAEXFM.js";import{a as pe,b as ge,e as me,f as he,g as ue}from"./chunk-BTOJ27OO.js";import{a as j}from"./chunk-AS2L77JV.js";import{E as F,c as W,g as R,m as A,p as Se,q as Ce,x as ye,y as Ee,z as Me}from"./chunk-7OGOI6WM.js";import{E as le,J as de,O as ve,Q as fe}from"./chunk-G5RWG2GK.js";import{$b as h,Ab as x,Db as d,Fb as k,Jb as X,Ka as l,Kb as ee,Kc as se,Lb as te,Pb as ne,Pc as ce,Qb as V,Rb as ie,Sb as oe,T as p,Tb as s,V as J,Vb as y,Wa as E,Wb as re,Xa as Q,Z as P,Zb as g,_ as q,_b as m,aa as Y,ab as Z,ca as v,d as S,h as C,i as b,ia as B,ja as K,jb as M,jc as ae,lb as T,mb as w,pb as $,qb as z,rb as u,sb as a,tb as r,ub as f,ya as G,zc as I}from"./chunk-CHEXA6RY.js";var Ge=["determinateSpinner"];function Qe(c,e){if(c&1&&(B(),a(0,"svg",11),f(1,"circle",12),r()),c&2){let t=k();M("viewBox",t._viewBox()),l(),V("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),M("r",t._circleRadius())}}var Ze=new Y("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:He})}),He=100,Xe=10,Ct=(()=>{class c{_elementRef=v(G);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=v(Ze),n=de(),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=He;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0}_strokeWidth;_circleRadius(){return(this.diameter-Xe)/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=E({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&X(Ge,5),n&2){let o;ee(o=te())&&(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&&(M("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),oe("mat-"+i.color),V("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),ie("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",I],diameter:[2,"diameter","diameter",I],strokeWidth:[2,"strokeWidth","strokeWidth",I]},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&&(Z(0,Qe,2,8,"ng-template",null,0,ae),a(2,"div",2,1),B(),a(4,"svg",3),f(5,"circle",4),r()(),K(),a(6,"div",5)(7,"div",6)(8,"div",7),x(9,8),r(),a(10,"div",9),x(11,8),r(),a(12,"div",10),x(13,8),r()()()),n&2){let o=ne(1);l(4),M("viewBox",i._viewBox()),l(),V("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),M("r",i._circleRadius()),l(4),u("ngTemplateOutlet",o),l(2),u("ngTemplateOutlet",o),l(2),u("ngTemplateOutlet",o)}},dependencies:[se],styles:[`.mat-mdc-progress-spinner{--mat-progress-spinner-animation-multiplier: 1;display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mat-progress-spinner-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mat-progress-spinner-reduced-motion{--mat-progress-spinner-animation-multiplier: 1.25}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate calc(1568.2352941176ms*var(--mat-progress-spinner-animation-multiplier)) linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate calc(5332ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}
1
+ import{A as Ue,c as be,d as N,e as _e,f as Te,g as we,h as Oe,i as Pe,j as xe,k as ke,l as Ve,m as Ie,n as Ne,o as je,p as We,q as U,r as Re,s as Ae,u as Fe,v as De,x as Le,y as Be,z as ze}from"./chunk-CRXIMHRG.js";import{a as $e}from"./chunk-J4UAEXFM.js";import{a as pe,b as ge,e as me,f as he,g as ue}from"./chunk-BTOJ27OO.js";import{a as j}from"./chunk-AS2L77JV.js";import{E as F,c as W,g as R,m as A,p as Se,q as Ce,x as ye,y as Ee,z as Me}from"./chunk-7OGOI6WM.js";import{E as le,J as de,O as ve,Q as fe}from"./chunk-G5RWG2GK.js";import{$b as h,Ab as x,Db as d,Fb as k,Jb as X,Ka as l,Kb as ee,Kc as se,Lb as te,Pb as ne,Pc as ce,Qb as V,Rb as ie,Sb as oe,T as p,Tb as s,V as J,Vb as y,Wa as E,Wb as re,Xa as Q,Z as P,Zb as g,_ as q,_b as m,aa as Y,ab as Z,ca as v,d as S,h as C,i as b,ia as B,ja as K,jb as M,jc as ae,lb as T,mb as w,pb as $,qb as z,rb as u,sb as a,tb as r,ub as f,ya as G,zc as I}from"./chunk-CHEXA6RY.js";var Ge=["determinateSpinner"];function Qe(c,e){if(c&1&&(B(),a(0,"svg",11),f(1,"circle",12),r()),c&2){let t=k();M("viewBox",t._viewBox()),l(),V("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),M("r",t._circleRadius())}}var Ze=new Y("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:He})}),He=100,Xe=10,Ct=(()=>{class c{_elementRef=v(G);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=v(Ze),n=de(),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=He;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0}_strokeWidth;_circleRadius(){return(this.diameter-Xe)/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=E({type:c,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&X(Ge,5),n&2){let o;ee(o=te())&&(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&&(M("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),oe("mat-"+i.color),V("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),ie("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",I],diameter:[2,"diameter","diameter",I],strokeWidth:[2,"strokeWidth","strokeWidth",I]},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&&(Z(0,Qe,2,8,"ng-template",null,0,ae),a(2,"div",2,1),B(),a(4,"svg",3),f(5,"circle",4),r()(),K(),a(6,"div",5)(7,"div",6)(8,"div",7),x(9,8),r(),a(10,"div",9),x(11,8),r(),a(12,"div",10),x(13,8),r()()()),n&2){let o=ne(1);l(4),M("viewBox",i._viewBox()),l(),V("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),M("r",i._circleRadius()),l(4),u("ngTemplateOutlet",o),l(2),u("ngTemplateOutlet",o),l(2),u("ngTemplateOutlet",o)}},dependencies:[se],styles:[`.mat-mdc-progress-spinner{--mat-progress-spinner-animation-multiplier: 1;display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mat-progress-spinner-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mat-progress-spinner-reduced-motion{--mat-progress-spinner-animation-multiplier: 1.25}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate calc(1568.2352941176ms*var(--mat-progress-spinner-animation-multiplier)) linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate calc(5332ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}
2
2
  `],encapsulation:2,changeDetection:0})}return c})();var yt=(()=>{class c{static \u0275fac=function(n){return new(n||c)};static \u0275mod=Q({type:c});static \u0275inj=q({imports:[le]})}return c})();var L=class c{destroy$=new C;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new b(!1);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=v(N);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(p(this.destroy$)).subscribe(e=>{this.volume=e,console.log("[VOICE-SERVICE] Volume updated to:",e)}),this.preferencesService.voiceRate$.pipe(p(this.destroy$)).subscribe(e=>{this.rate=e,console.log("[VOICE-SERVICE] Rate updated to:",e)}),this.preferencesService.voiceLanguage$.pipe(p(this.destroy$)).subscribe(e=>{this.language=e,console.log("[VOICE-SERVICE] Language updated to:",e),this.updateSelectedVoiceForLanguage()}),this.preferencesService.selectedVoice$.pipe(p(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 S(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),!1;if(!e.trim())return console.warn("[VOICE-SERVICE] No text to speak"),!1;let n=this.extractPlainText(e);if(!n.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;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,_=i.onerror;return i.onend=O=>{this.speakingSubject.next(!1),o&&o.call(i,O)},i.onerror=O=>{this.speakingSubject.next(!1),_&&_.call(i,O)},speechSynthesis.speak(i),console.log("[VOICE-SERVICE] Started speaking:",e.substring(0,50)+"..."),!0}catch(i){return console.error("[VOICE-SERVICE] Error speaking:",i),!1}})}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(!1),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 S(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 S(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 S(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("|"),_=o?.slice(0,2),O=this.language.slice(0,2);if(_===O&&e.some(H=>H.name===i&&H.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||"Hello, this is a test."}extractPlainText(e){let t=e.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/&nbsp;/g," ").replace(/&amp;/g,"and").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');return t=this.addNaturalPunctuation(t),t.replace(/\s+/g," ").trim()}addNaturalPunctuation(e){return e.replace(/\n+/g,`
3
3
  `).split(`
4
4
  `).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=P({token:c,factory:c.\u0275fac,providedIn:"root"})};var nt=(c,e)=>e.code,it=(c,e)=>e.name+e.lang;function ot(c,e){c&1&&(a(0,"div",17)(1,"mat-icon",39),s(2,"warning"),r(),a(3,"span",40),s(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),r()())}function rt(c,e){if(c&1&&(a(0,"option",25),s(1),r()),c&2){let t=e.$implicit;u("value",t.code),l(),re("",t.flag," ",t.label)}}function at(c,e){c&1&&(a(0,"option",32),s(1,"Loading voices..."),r())}function st(c,e){c&1&&(a(0,"option",32),s(1,"No voice available"),r())}function ct(c,e){if(c&1&&(a(0,"option",25),s(1),r()),c&2){let t=e.$implicit;u("value",t.name+"|"+t.lang),l(),y(" ",t.displayName," ")}}var Je=class c{destroy$=new C;selectedTheme="light";selectedThemeVariant="industry";selectedVoiceLanguage="en-US";useEnterToSend=!1;printTechnicalMessages=!1;showTechnicalMessages=!0;showWarningMessages=!0;voiceInputMode="browser";voiceAnnounceEnabled=!1;voiceMode="speech";voiceReadFullText=!1;voiceVolume=80;voiceRate=120;agentNotificationEnabled=!1;notificationSoundEnabled=!0;browserNotificationEnabled=!1;browserNotificationDenied=!1;missionPreviewEnabled=!1;availableVoices=[];selectedVoiceId=null;loadingVoices=!1;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=v(N);voiceSynthesisService=v(L);themeService=v(_e);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(p(this.destroy$)).subscribe(t=>{this.selectedTheme=t.mode,this.selectedThemeVariant=t.variant}),this.preferencesService.voiceLanguage$.pipe(p(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t}),this.preferencesService.enterToSend$.pipe(p(this.destroy$)).subscribe(t=>{this.useEnterToSend=t}),this.preferencesService.printTechnicalMessages$.pipe(p(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t}),this.preferencesService.hideTechnicalMessages$.pipe(p(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t}),this.preferencesService.hideWarningMessages$.pipe(p(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t}),this.preferencesService.voiceInputMode$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceInputMode=t}),this.preferencesService.voiceAnnounceEnabled$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t}),this.preferencesService.voiceMode$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceMode=t}),this.preferencesService.voiceReadFullText$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t}),this.preferencesService.voiceVolume$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100)}),this.preferencesService.voiceRate$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100)}),this.preferencesService.selectedVoice$.pipe(p(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t}),this.preferencesService.voiceLanguage$.pipe(p(this.destroy$)).subscribe(()=>{this.loadAvailableVoices()}),this.preferencesService.agentNotificationEnabled$.pipe(p(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t}),this.preferencesService.notificationSoundEnabled$.pipe(p(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t}),this.preferencesService.browserNotificationEnabled$.pipe(p(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission()}),this.preferencesService.missionPreviewEnabled$.pipe(p(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 S(this,null,function*(){this.loadingVoices=!0;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=!1}})}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=E({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&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),s(4,"palette"),r(),a(5,"span"),s(6,"Appearance"),r()(),a(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),h("ngModelChange",function(o){return m(n.selectedTheme,o)||(n.selectedTheme=o),o}),d("change",function(){return n.onThemeChange()}),r(),f(11,"span",7),s(12," Light "),r(),a(13,"label",5)(14,"input",8),h("ngModelChange",function(o){return m(n.selectedTheme,o)||(n.selectedTheme=o),o}),d("change",function(){return n.onThemeChange()}),r(),f(15,"span",7),s(16," Dark "),r(),a(17,"label",5)(18,"input",9),h("ngModelChange",function(o){return m(n.selectedTheme,o)||(n.selectedTheme=o),o}),d("change",function(){return n.onThemeChange()}),r(),f(19,"span",7),s(20," System "),r()()()(),a(21,"div",1)(22,"div",2)(23,"mat-icon"),s(24,"chat_bubble_outline"),r(),a(25,"span"),s(26,"Messaging"),r()(),a(27,"div",3)(28,"span",10),s(29,"Send message behavior:"),r(),a(30,"div",4)(31,"label",5)(32,"input",11),h("ngModelChange",function(o){return m(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),d("change",function(){return n.onEnterToSendChange()}),r(),f(33,"span",7),s(34," Enter to send "),r(),a(35,"label",5)(36,"input",11),h("ngModelChange",function(o){return m(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),d("change",function(){return n.onEnterToSendChange()}),r(),f(37,"span",7),s(38," Enter for new line "),r()()(),a(39,"div",3)(40,"div",12)(41,"span",10),s(42,"Show technical messages"),r(),a(43,"mat-slide-toggle",13),h("ngModelChange",function(o){return m(n.showTechnicalMessages,o)||(n.showTechnicalMessages=o),o}),d("change",function(){return n.onShowTechnicalMessagesChange()}),r()()(),a(44,"div",3)(45,"div",12)(46,"span",10),s(47,"Show warning messages"),r(),a(48,"mat-slide-toggle",13),h("ngModelChange",function(o){return m(n.showWarningMessages,o)||(n.showWarningMessages=o),o}),d("change",function(){return n.onShowWarningMessagesChange()}),r()()(),a(49,"div",3)(50,"div",12)(51,"span",10),s(52,"Include technical messages in print"),r(),a(53,"mat-slide-toggle",13),h("ngModelChange",function(o){return m(n.printTechnicalMessages,o)||(n.printTechnicalMessages=o),o}),d("change",function(){return n.onPrintTechnicalMessagesChange()}),r()()()(),a(54,"div",1)(55,"div",2)(56,"mat-icon"),s(57,"rocket_launch"),r(),a(58,"span"),s(59,"Mission Control"),r()(),a(60,"div",3)(61,"div",12)(62,"div",14)(63,"span",10),s(64,"Side-by-side thread preview"),r(),a(65,"span",15),s(66,"Click a mission card to open a preview panel. Recommended for large screens."),r()(),a(67,"mat-slide-toggle",13),h("ngModelChange",function(o){return m(n.missionPreviewEnabled,o)||(n.missionPreviewEnabled=o),o}),d("change",function(){return n.onMissionPreviewEnabledChange()}),r()()()(),a(68,"div",1)(69,"div",2)(70,"mat-icon"),s(71,"notifications"),r(),a(72,"span"),s(73,"Notifications"),r()(),a(74,"div",3)(75,"div",12)(76,"span",10),s(77,"Notify when the agent answers or requests input"),r(),a(78,"mat-slide-toggle",13),h("ngModelChange",function(o){return m(n.agentNotificationEnabled,o)||(n.agentNotificationEnabled=o),o}),d("change",function(){return n.onAgentNotificationEnabledChange()}),r()()(),a(79,"div",3)(80,"div",12)(81,"span",10),s(82,"Notification sound"),r(),a(83,"mat-slide-toggle",16),h("ngModelChange",function(o){return m(n.notificationSoundEnabled,o)||(n.notificationSoundEnabled=o),o}),d("change",function(){return n.onNotificationSoundEnabledChange()}),r()()(),a(84,"div",3)(85,"div",12)(86,"span",10),s(87,"Browser notification"),r(),a(88,"mat-slide-toggle",16),h("ngModelChange",function(o){return m(n.browserNotificationEnabled,o)||(n.browserNotificationEnabled=o),o}),d("change",function(){return n.onBrowserNotificationEnabledChange()}),r()(),T(89,ot,5,0,"div",17),r()(),a(90,"div",1)(91,"div",2)(92,"mat-icon"),s(93,"record_voice_over"),r(),a(94,"span"),s(95,"Voice & Speech"),r()(),a(96,"div",3)(97,"label",18),s(98,"Voice input method:"),r(),a(99,"select",19),d("change",function(o){return n.onVoiceInputModeChange(o)}),a(100,"option",20),s(101,"Browser (real-time)"),r(),a(102,"option",21),s(103,"Whisper (higher accuracy)"),r(),a(104,"option",22),s(105,"Voice message (send audio)"),r()()(),a(106,"div",3)(107,"label",23),s(108,"Voice recognition language:"),r(),a(109,"select",24),h("ngModelChange",function(o){return m(n.selectedVoiceLanguage,o)||(n.selectedVoiceLanguage=o),o}),d("change",function(){return n.onVoiceLanguageChange()}),$(110,rt,2,3,"option",25,nt),r()(),a(112,"div",3)(113,"span",10),s(114,"Automatic announcement:"),r(),a(115,"div",4)(116,"label",5)(117,"input",26),h("ngModelChange",function(o){return m(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),d("change",function(){return n.onVoiceAnnounceEnabledChange()}),r(),f(118,"span",7),s(119," Enabled "),r(),a(120,"label",5)(121,"input",26),h("ngModelChange",function(o){return m(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),d("change",function(){return n.onVoiceAnnounceEnabledChange()}),r(),f(122,"span",7),s(123," Disabled "),r()()(),a(124,"div",3)(125,"span",10),s(126,"Voice mode:"),r(),a(127,"div",4)(128,"label",5)(129,"input",27),h("ngModelChange",function(o){return m(n.voiceMode,o)||(n.voiceMode=o),o}),d("change",function(){return n.onVoiceModeChange()}),r(),f(130,"span",7),s(131," Voice synthesis "),r(),a(132,"label",5)(133,"input",28),h("ngModelChange",function(o){return m(n.voiceMode,o)||(n.voiceMode=o),o}),d("change",function(){return n.onVoiceModeChange()}),r(),f(134,"span",7),s(135," Sound notification "),r()()(),a(136,"div",3)(137,"span",10),s(138,"Message reading:"),r(),a(139,"div",4)(140,"label",5)(141,"input",29),h("ngModelChange",function(o){return m(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),d("change",function(){return n.onVoiceReadFullTextChange()}),r(),f(142,"span",7),s(143," Full message "),r(),a(144,"label",5)(145,"input",29),h("ngModelChange",function(o){return m(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),d("change",function(){return n.onVoiceReadFullTextChange()}),r(),f(146,"span",7),s(147," First paragraphs only "),r()()(),a(148,"div",3)(149,"label",30),s(150,"Selected voice:"),r(),a(151,"select",31),h("ngModelChange",function(o){return m(n.selectedVoiceId,o)||(n.selectedVoiceId=o),o}),d("change",function(){return n.onSelectedVoiceChange()}),T(152,at,2,0,"option",32),T(153,st,2,0,"option",32),$(154,ct,2,2,"option",25,it),r(),f(156,"div",10),a(157,"a",33),d("click",function(){return n.testVoice()}),a(158,"span",34),s(159,"Test voice"),r()()(),a(160,"div",3)(161,"label",35),s(162),r(),a(163,"input",36),h("ngModelChange",function(o){return m(n.voiceVolume,o)||(n.voiceVolume=o),o}),d("input",function(){return n.onVoiceVolumeChange()}),r()(),a(164,"div",3)(165,"label",37),s(166),r(),a(167,"input",38),h("ngModelChange",function(o){return m(n.voiceRate,o)||(n.voiceRate=o),o}),d("input",function(){return n.onVoiceRateChange()}),r()()()()),t&2&&(l(10),g("ngModel",n.selectedTheme),l(4),g("ngModel",n.selectedTheme),l(4),g("ngModel",n.selectedTheme),l(14),u("value",!0),g("ngModel",n.useEnterToSend),l(4),u("value",!1),g("ngModel",n.useEnterToSend),l(7),g("ngModel",n.showTechnicalMessages),l(5),g("ngModel",n.showWarningMessages),l(5),g("ngModel",n.printTechnicalMessages),l(14),g("ngModel",n.missionPreviewEnabled),l(11),g("ngModel",n.agentNotificationEnabled),l(5),g("ngModel",n.notificationSoundEnabled),u("disabled",!n.agentNotificationEnabled),l(5),g("ngModel",n.browserNotificationEnabled),u("disabled",!n.agentNotificationEnabled||n.browserNotificationDenied),l(),w(n.browserNotificationDenied?89:-1),l(10),u("value",n.voiceInputMode),l(10),g("ngModel",n.selectedVoiceLanguage),l(),z(n.voiceLanguageOptions),l(7),u("value",!0),g("ngModel",n.voiceAnnounceEnabled),l(4),u("value",!1),g("ngModel",n.voiceAnnounceEnabled),l(8),g("ngModel",n.voiceMode),l(4),g("ngModel",n.voiceMode),l(8),u("value",!0),g("ngModel",n.voiceReadFullText),l(4),u("value",!1),g("ngModel",n.voiceReadFullText),l(6),g("ngModel",n.selectedVoiceId),u("disabled",n.loadingVoices||n.availableVoices.length===0),l(),w(n.loadingVoices?152:-1),l(),w(!n.loadingVoices&&n.availableVoices.length===0?153:-1),l(),z(n.availableVoices),l(8),y("Volume: ",n.voiceVolume,"%"),l(),g("ngModel",n.voiceVolume),l(3),y("Speed: ",n.voiceRate,"%"),l(),g("ngModel",n.voiceRate))},dependencies:[F,Ee,Me,W,Ce,ye,Se,R,A,j,$e],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}']})};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}
@@ -1,3 +1,3 @@
1
- import{a as pt,b as vt,c as ye}from"./chunk-I2ONTIJI.js";import{a as _t}from"./chunk-NMKUE2VW.js";import{d as bt}from"./chunk-OCX3RQ65.js";import{a as he}from"./chunk-EAVXJ7QN.js";import{a as I,b as V,d as ft,g as xt}from"./chunk-AFRMVXZZ.js";import"./chunk-TSYL5EEO.js";import"./chunk-N6D7DELC.js";import{a as ze,b as We,c as Qe,d as Ue,g as at,n as lt,q as st,s as ct,x as dt}from"./chunk-ZCELWKMZ.js";import"./chunk-YJOXSEUO.js";import"./chunk-GIIRKWUO.js";import{c as Re,d as $e}from"./chunk-6XX7GME4.js";import"./chunk-2PWIGCN2.js";import{a as pe,b as me,c as ue,d as _e}from"./chunk-B4UTEYRE.js";import{a as ge,b as ee}from"./chunk-EZSEUOCV.js";import{a as mt,b as ut}from"./chunk-DFU2RM36.js";import"./chunk-SKBEA6VH.js";import{a as gt,b as ht,c as Ct}from"./chunk-J4UAEXFM.js";import{a as ce,c as et,d as H,g as X,h as J,i as Y,j as Z}from"./chunk-GTCP3EYX.js";import{a as He,c as Xe,d as Je,e as Ke,j as de}from"./chunk-VNO76B3S.js";import{a as le,b as se,c as Ye,d as Ze}from"./chunk-E6T6QLQT.js";import{a as $,b as qe,d as L,e as q,f as B,g as z,h as W}from"./chunk-BTOJ27OO.js";import"./chunk-SPV5SLNS.js";import{a as Be,c as Q}from"./chunk-VMYKE4ZC.js";import{a as N,b as A}from"./chunk-AS2L77JV.js";import{B as rt,E as K,c as tt,g as nt,m as it,o as ot}from"./chunk-7OGOI6WM.js";import{a as U,b as ae}from"./chunk-TASSC2XX.js";import{O as re,Q as O,S as E,n as Le}from"./chunk-G5RWG2GK.js";import{Bb as x,D as Ee,Db as m,Fb as d,Ja as xe,Jb as Ae,Ka as c,Kb as Ie,Lb as Ve,Pb as w,Qb as Fe,Rb as S,Tb as s,Ub as b,Vb as P,Wa as D,Xc as Ge,Z as oe,a as F,b as G,ca as f,ga as g,ha as h,jb as ke,lb as v,m as Pe,ma as Ne,mb as C,mc as k,ob as j,pb as y,qb as M,rb as _,s as De,sb as o,t as je,ta as u,tb as r,ub as T,z as Oe}from"./chunk-CHEXA6RY.js";var Dt=(a,t)=>t.name;function jt(a,t){if(a&1&&(o(0,"mat-option",11),s(1),r()),a&2){let e=t.$implicit;_("value",e),c(),b(e)}}function Ot(a,t){a&1&&T(0,"mat-spinner",13)}function Et(a,t){if(a&1&&(o(0,"span",20),s(1),r()),a&2){let e=d().$implicit;c(),b(e.description)}}function Nt(a,t){if(a&1&&(o(0,"mat-option",11)(1,"span",19),s(2),r(),v(3,Et,2,1,"span",20),r()),a&2){let e=t.$implicit;_("value",e.name),c(2),b(e.name),c(),C(e.description?3:-1)}}function At(a,t){if(a&1&&(o(0,"mat-option",11),s(1),r()),a&2){let e=t.$implicit;_("value",e),c(),b(e)}}function It(a,t){if(a&1){let e=x();o(0,"div",25)(1,"mat-form-field",8)(2,"mat-label"),s(3,"Name"),r(),o(4,"input",26),m("input",function(i){g(e);let l=d(2);return h(l.issueNumber.set(i.target.value))}),r()(),o(5,"mat-form-field",27)(6,"mat-label"),s(7,"Type"),r(),o(8,"mat-select",28),m("selectionChange",function(i){g(e);let l=d(2);return h(l.branchType.set(i.value))}),y(9,At,2,2,"mat-option",11,j),r()()()}if(a&2){let e=d(2);c(4),_("value",e.issueNumber()),c(4),_("value",e.branchType()),c(),M(e.branchTypes)}}function Vt(a,t){a&1&&T(0,"mat-spinner",13)}function Ft(a,t){if(a&1&&(o(0,"mat-option",11),s(1),r()),a&2){let e=t.$implicit;_("value",e),c(),b(e)}}function Gt(a,t){if(a&1){let e=x();o(0,"mat-form-field",8)(1,"mat-label"),s(2,"Source branch"),r(),o(3,"input",29,4),m("input",function(i){g(e);let l=d(2);return h(l.onBranchSearchInput(i.target.value))})("focus",function(){g(e);let i=w(4),l=d(2);return h(l.openPanel(i))}),r(),v(5,Vt,1,0,"mat-spinner",13),o(6,"mat-autocomplete",10,5),m("optionSelected",function(i){g(e);let l=d(2);return h(l.selectBranch(i.option.value))}),y(8,Ft,2,2,"mat-option",11,j),r()()}if(a&2){let e=w(7),n=d(2);c(3),_("value",n.branchSearch())("matAutocomplete",e)("disabled",n.isLoadingBranches()),c(2),C(n.isLoadingBranches()?5:-1),c(3),M(n.filteredBranches())}}function Rt(a,t){if(a&1){let e=x();o(0,"div",21)(1,"button",22),m("click",function(){g(e);let i=d();return h(i.onModeChange("local"))}),o(2,"mat-icon"),s(3,"folder_open"),r(),o(4,"span",23),s(5,"Local"),r(),o(6,"span",24),s(7,"Work directly on the current branch"),r()(),o(8,"button",22),m("click",function(){g(e);let i=d();return h(i.onModeChange("worktree"))}),o(9,"mat-icon"),s(10,"account_tree"),r(),o(11,"span",23),s(12,"Worktree"),r(),o(13,"span",24),s(14,"Create an isolated worktree from a branch"),r()()(),v(15,It,11,2,"div",25),v(16,Gt,10,4,"mat-form-field",8)}if(a&2){let e=d();c(),S("active",e.mode()==="local"),c(7),S("active",e.mode()==="worktree"),c(7),C(e.isWorktree()?15:-1),c(),C(e.isWorktree()?16:-1)}}function $t(a,t){a&1&&T(0,"mat-spinner",18)}function Lt(a,t){a&1&&(o(0,"mat-icon"),s(1,"rocket_launch"),r())}function qt(a,t){a&1&&(o(0,"mat-icon"),s(1,"open_in_new"),r())}var fe=class a{projectApi=f(U);agentApi=f(he);dialogRef=f($);projectState=f(ae);forcedProject=Q(this.projectState.forcedProject$,{initialValue:null});selectedProject=u("");projectSearch=u("");selectedAgent=u("");agentSearch=u("");mode=u("local");selectedBranch=u("");branchSearch=u("");issueNumber=u("");branchType=u("feature");task=u("");hasGit=u(!1);branchTypes=["feature","fix","refactor","chore","docs","build"];projects=u([]);agents=u([]);branches=u([]);filteredProjects=k(()=>{let t=this.projectSearch().toLowerCase();return t?this.projects().filter(e=>e.toLowerCase().includes(t)):this.projects()});filteredAgents=k(()=>{let t=this.agentSearch().toLowerCase();return t?this.agents().filter(e=>e.name.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t)):this.agents()});filteredBranches=k(()=>{let t=this.branchSearch().toLowerCase();return t?this.branches().filter(e=>e.toLowerCase().includes(t)):this.branches()});isLoadingAgents=u(!1);isLoadingBranches=u(!1);isSubmitting=u(!1);isWorktree=k(()=>this.mode()==="worktree"&&this.hasGit());isValid=k(()=>{let t=this.projects().includes(this.selectedProject()),e=this.agents().some(i=>i.name===this.selectedAgent()),n=t&&e&&!!this.task().trim();return this.isWorktree()?n&&!!this.selectedBranch()&&!!this.issueNumber().trim()&&!!this.branchType():n});canNavigate=k(()=>this.projects().includes(this.selectedProject()));openPanel(t){t.openPanel()}onProjectSearchInput(t){this.projectSearch.set(t),this.selectedProject()&&t!==this.selectedProject()&&(this.selectedProject.set(""),this.selectedAgent.set(""),this.agentSearch.set(""),this.agents.set([]))}selectProject(t){this.selectedProject.set(t),this.projectSearch.set(t),this.selectedAgent.set(""),this.agentSearch.set(""),this.agents.set([]),this.branches.set([]),this.selectedBranch.set(""),this.branchSearch.set(""),this.hasGit.set(!1),this.mode.set("local"),this.isLoadingAgents.set(!0),this.agentApi.getAgents(t).subscribe({next:e=>{this.agents.set(e),this.isLoadingAgents.set(!1)},error:()=>{this.isLoadingAgents.set(!1)}}),this.projectApi.getGitBranches(t).subscribe({next:({branches:e})=>{this.hasGit.set(e.length>0)},error:()=>{this.hasGit.set(!1)}})}onAgentSearchInput(t){this.agentSearch.set(t),this.selectedAgent()&&t!==this.selectedAgent()&&this.selectedAgent.set("")}selectAgent(t){this.selectedAgent.set(t),this.agentSearch.set(t)}onBranchSearchInput(t){this.branchSearch.set(t),this.selectedBranch()&&t!==this.selectedBranch()&&this.selectedBranch.set("")}selectBranch(t){this.selectedBranch.set(t),this.branchSearch.set(t)}ngOnInit(){this.projectApi.listProjects().subscribe({next:({projects:t})=>{let e=t.map(n=>n.name);this.projects.set(e),e.length===1&&e[0]&&this.selectProject(e[0])}})}onProjectChange(t){this.selectProject(t)}onModeChange(t){this.mode.set(t),t==="worktree"&&this.selectedProject()&&this.branches().length===0&&this.loadBranches()}loadBranches(){this.isLoadingBranches.set(!0),this.projectApi.getGitBranches(this.selectedProject()).subscribe({next:({branches:t})=>{this.branches.set(t),this.isLoadingBranches.set(!1)},error:()=>{this.isLoadingBranches.set(!1)}})}submit(){if(!this.isSubmitting()){if(this.isValid()){this.isSubmitting.set(!0);let t=this.isWorktree()&&this.issueNumber().trim()?`${this.issueNumber().trim()} ${this.task().trim()}`:this.task().trim();this.projectApi.createTask(this.selectedProject(),this.selectedAgent(),t,this.isWorktree()?"worktree":"local",this.isWorktree()?this.selectedBranch():void 0,this.isWorktree()?this.issueNumber().trim():void 0,this.isWorktree()?this.branchType():void 0).subscribe({next:({threadId:e,projectId:n})=>{this.dialogRef.close({threadId:e,projectId:n})},error:()=>{this.isSubmitting.set(!1)}});return}if(this.canNavigate()){this.dialogRef.close({projectId:this.selectedProject(),navigate:!0});return}}}cancel(){this.dialogRef.close(null)}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=D({type:a,selectors:[["app-new-task-dialog"]],decls:37,vars:12,consts:[["projectTrigger","matAutocompleteTrigger"],["projectAuto",""],["agentTrigger","matAutocompleteTrigger"],["agentAuto",""],["branchTrigger","matAutocompleteTrigger"],["branchAuto",""],["mat-dialog-title",""],[1,"ntd-content"],["appearance","outline",1,"ntd-field"],["matInput","","placeholder","Search project...",3,"input","focus","value","matAutocomplete"],[3,"optionSelected"],[3,"value"],["matInput","","placeholder","Search agent...",3,"input","focus","value","matAutocomplete","disabled"],["matSuffix","","diameter","16"],["matInput","","placeholder","Describe what the agent should accomplish...","rows","4",3,"input","value"],["align","end"],["mat-button","",3,"click","disabled"],["mat-flat-button","",1,"ntd-launch-btn",3,"click","disabled"],["diameter","16"],[1,"ntd-agent-name"],[1,"ntd-agent-desc"],[1,"ntd-radio-group"],["type","button",1,"ntd-mode-btn",3,"click"],[1,"ntd-radio-label"],[1,"ntd-radio-hint"],[1,"ntd-row"],["matInput","","type","text","placeholder","Name",3,"input","value"],["appearance","outline",1,"ntd-field","ntd-field--small"],[3,"selectionChange","value"],["matInput","","placeholder","Search branch...",3,"input","focus","value","matAutocomplete","disabled"]],template:function(e,n){if(e&1){let i=x();o(0,"h2",6)(1,"mat-icon"),s(2,"rocket_launch"),r(),s(3,` New Task
1
+ import{a as pt,b as vt,c as ye}from"./chunk-I2ONTIJI.js";import{a as _t}from"./chunk-NMKUE2VW.js";import{d as bt}from"./chunk-R2NWLPS6.js";import{a as he}from"./chunk-EAVXJ7QN.js";import{a as I,b as V,d as ft,g as xt}from"./chunk-UEGZX4MW.js";import"./chunk-TSYL5EEO.js";import"./chunk-DZ2M3NQD.js";import{a as ze,b as We,c as Qe,d as Ue,g as at,n as lt,q as st,s as ct,y as dt}from"./chunk-CRXIMHRG.js";import"./chunk-YJOXSEUO.js";import"./chunk-GIIRKWUO.js";import{c as Re,d as $e}from"./chunk-6XX7GME4.js";import"./chunk-2PWIGCN2.js";import{a as pe,b as me,c as ue,d as _e}from"./chunk-B4UTEYRE.js";import{a as ge,b as ee}from"./chunk-EZSEUOCV.js";import{a as mt,b as ut}from"./chunk-DFU2RM36.js";import"./chunk-SKBEA6VH.js";import{a as gt,b as ht,c as Ct}from"./chunk-J4UAEXFM.js";import{a as ce,c as et,d as H,g as X,h as J,i as Y,j as Z}from"./chunk-GTCP3EYX.js";import{a as He,c as Xe,d as Je,e as Ke,j as de}from"./chunk-VNO76B3S.js";import{a as le,b as se,c as Ye,d as Ze}from"./chunk-E6T6QLQT.js";import{a as $,b as qe,d as L,e as q,f as B,g as z,h as W}from"./chunk-BTOJ27OO.js";import"./chunk-SPV5SLNS.js";import{a as Be,c as Q}from"./chunk-VMYKE4ZC.js";import{a as N,b as A}from"./chunk-AS2L77JV.js";import{B as rt,E as K,c as tt,g as nt,m as it,o as ot}from"./chunk-7OGOI6WM.js";import{a as U,b as ae}from"./chunk-TASSC2XX.js";import{O as re,Q as O,S as E,n as Le}from"./chunk-G5RWG2GK.js";import{Bb as x,D as Ee,Db as m,Fb as d,Ja as xe,Jb as Ae,Ka as c,Kb as Ie,Lb as Ve,Pb as w,Qb as Fe,Rb as S,Tb as s,Ub as b,Vb as P,Wa as D,Xc as Ge,Z as oe,a as F,b as G,ca as f,ga as g,ha as h,jb as ke,lb as v,m as Pe,ma as Ne,mb as C,mc as k,ob as j,pb as y,qb as M,rb as _,s as De,sb as o,t as je,ta as u,tb as r,ub as T,z as Oe}from"./chunk-CHEXA6RY.js";var Dt=(a,t)=>t.name;function jt(a,t){if(a&1&&(o(0,"mat-option",11),s(1),r()),a&2){let e=t.$implicit;_("value",e),c(),b(e)}}function Ot(a,t){a&1&&T(0,"mat-spinner",13)}function Et(a,t){if(a&1&&(o(0,"span",20),s(1),r()),a&2){let e=d().$implicit;c(),b(e.description)}}function Nt(a,t){if(a&1&&(o(0,"mat-option",11)(1,"span",19),s(2),r(),v(3,Et,2,1,"span",20),r()),a&2){let e=t.$implicit;_("value",e.name),c(2),b(e.name),c(),C(e.description?3:-1)}}function At(a,t){if(a&1&&(o(0,"mat-option",11),s(1),r()),a&2){let e=t.$implicit;_("value",e),c(),b(e)}}function It(a,t){if(a&1){let e=x();o(0,"div",25)(1,"mat-form-field",8)(2,"mat-label"),s(3,"Name"),r(),o(4,"input",26),m("input",function(i){g(e);let l=d(2);return h(l.issueNumber.set(i.target.value))}),r()(),o(5,"mat-form-field",27)(6,"mat-label"),s(7,"Type"),r(),o(8,"mat-select",28),m("selectionChange",function(i){g(e);let l=d(2);return h(l.branchType.set(i.value))}),y(9,At,2,2,"mat-option",11,j),r()()()}if(a&2){let e=d(2);c(4),_("value",e.issueNumber()),c(4),_("value",e.branchType()),c(),M(e.branchTypes)}}function Vt(a,t){a&1&&T(0,"mat-spinner",13)}function Ft(a,t){if(a&1&&(o(0,"mat-option",11),s(1),r()),a&2){let e=t.$implicit;_("value",e),c(),b(e)}}function Gt(a,t){if(a&1){let e=x();o(0,"mat-form-field",8)(1,"mat-label"),s(2,"Source branch"),r(),o(3,"input",29,4),m("input",function(i){g(e);let l=d(2);return h(l.onBranchSearchInput(i.target.value))})("focus",function(){g(e);let i=w(4),l=d(2);return h(l.openPanel(i))}),r(),v(5,Vt,1,0,"mat-spinner",13),o(6,"mat-autocomplete",10,5),m("optionSelected",function(i){g(e);let l=d(2);return h(l.selectBranch(i.option.value))}),y(8,Ft,2,2,"mat-option",11,j),r()()}if(a&2){let e=w(7),n=d(2);c(3),_("value",n.branchSearch())("matAutocomplete",e)("disabled",n.isLoadingBranches()),c(2),C(n.isLoadingBranches()?5:-1),c(3),M(n.filteredBranches())}}function Rt(a,t){if(a&1){let e=x();o(0,"div",21)(1,"button",22),m("click",function(){g(e);let i=d();return h(i.onModeChange("local"))}),o(2,"mat-icon"),s(3,"folder_open"),r(),o(4,"span",23),s(5,"Local"),r(),o(6,"span",24),s(7,"Work directly on the current branch"),r()(),o(8,"button",22),m("click",function(){g(e);let i=d();return h(i.onModeChange("worktree"))}),o(9,"mat-icon"),s(10,"account_tree"),r(),o(11,"span",23),s(12,"Worktree"),r(),o(13,"span",24),s(14,"Create an isolated worktree from a branch"),r()()(),v(15,It,11,2,"div",25),v(16,Gt,10,4,"mat-form-field",8)}if(a&2){let e=d();c(),S("active",e.mode()==="local"),c(7),S("active",e.mode()==="worktree"),c(7),C(e.isWorktree()?15:-1),c(),C(e.isWorktree()?16:-1)}}function $t(a,t){a&1&&T(0,"mat-spinner",18)}function Lt(a,t){a&1&&(o(0,"mat-icon"),s(1,"rocket_launch"),r())}function qt(a,t){a&1&&(o(0,"mat-icon"),s(1,"open_in_new"),r())}var fe=class a{projectApi=f(U);agentApi=f(he);dialogRef=f($);projectState=f(ae);forcedProject=Q(this.projectState.forcedProject$,{initialValue:null});selectedProject=u("");projectSearch=u("");selectedAgent=u("");agentSearch=u("");mode=u("local");selectedBranch=u("");branchSearch=u("");issueNumber=u("");branchType=u("feature");task=u("");hasGit=u(!1);branchTypes=["feature","fix","refactor","chore","docs","build"];projects=u([]);agents=u([]);branches=u([]);filteredProjects=k(()=>{let t=this.projectSearch().toLowerCase();return t?this.projects().filter(e=>e.toLowerCase().includes(t)):this.projects()});filteredAgents=k(()=>{let t=this.agentSearch().toLowerCase();return t?this.agents().filter(e=>e.name.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t)):this.agents()});filteredBranches=k(()=>{let t=this.branchSearch().toLowerCase();return t?this.branches().filter(e=>e.toLowerCase().includes(t)):this.branches()});isLoadingAgents=u(!1);isLoadingBranches=u(!1);isSubmitting=u(!1);isWorktree=k(()=>this.mode()==="worktree"&&this.hasGit());isValid=k(()=>{let t=this.projects().includes(this.selectedProject()),e=this.agents().some(i=>i.name===this.selectedAgent()),n=t&&e&&!!this.task().trim();return this.isWorktree()?n&&!!this.selectedBranch()&&!!this.issueNumber().trim()&&!!this.branchType():n});canNavigate=k(()=>this.projects().includes(this.selectedProject()));openPanel(t){t.openPanel()}onProjectSearchInput(t){this.projectSearch.set(t),this.selectedProject()&&t!==this.selectedProject()&&(this.selectedProject.set(""),this.selectedAgent.set(""),this.agentSearch.set(""),this.agents.set([]))}selectProject(t){this.selectedProject.set(t),this.projectSearch.set(t),this.selectedAgent.set(""),this.agentSearch.set(""),this.agents.set([]),this.branches.set([]),this.selectedBranch.set(""),this.branchSearch.set(""),this.hasGit.set(!1),this.mode.set("local"),this.isLoadingAgents.set(!0),this.agentApi.getAgents(t).subscribe({next:e=>{this.agents.set(e),this.isLoadingAgents.set(!1)},error:()=>{this.isLoadingAgents.set(!1)}}),this.projectApi.getGitBranches(t).subscribe({next:({branches:e})=>{this.hasGit.set(e.length>0)},error:()=>{this.hasGit.set(!1)}})}onAgentSearchInput(t){this.agentSearch.set(t),this.selectedAgent()&&t!==this.selectedAgent()&&this.selectedAgent.set("")}selectAgent(t){this.selectedAgent.set(t),this.agentSearch.set(t)}onBranchSearchInput(t){this.branchSearch.set(t),this.selectedBranch()&&t!==this.selectedBranch()&&this.selectedBranch.set("")}selectBranch(t){this.selectedBranch.set(t),this.branchSearch.set(t)}ngOnInit(){this.projectApi.listProjects().subscribe({next:({projects:t})=>{let e=t.map(n=>n.name);this.projects.set(e),e.length===1&&e[0]&&this.selectProject(e[0])}})}onProjectChange(t){this.selectProject(t)}onModeChange(t){this.mode.set(t),t==="worktree"&&this.selectedProject()&&this.branches().length===0&&this.loadBranches()}loadBranches(){this.isLoadingBranches.set(!0),this.projectApi.getGitBranches(this.selectedProject()).subscribe({next:({branches:t})=>{this.branches.set(t),this.isLoadingBranches.set(!1)},error:()=>{this.isLoadingBranches.set(!1)}})}submit(){if(!this.isSubmitting()){if(this.isValid()){this.isSubmitting.set(!0);let t=this.isWorktree()&&this.issueNumber().trim()?`${this.issueNumber().trim()} ${this.task().trim()}`:this.task().trim();this.projectApi.createTask(this.selectedProject(),this.selectedAgent(),t,this.isWorktree()?"worktree":"local",this.isWorktree()?this.selectedBranch():void 0,this.isWorktree()?this.issueNumber().trim():void 0,this.isWorktree()?this.branchType():void 0).subscribe({next:({threadId:e,projectId:n})=>{this.dialogRef.close({threadId:e,projectId:n})},error:()=>{this.isSubmitting.set(!1)}});return}if(this.canNavigate()){this.dialogRef.close({projectId:this.selectedProject(),navigate:!0});return}}}cancel(){this.dialogRef.close(null)}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=D({type:a,selectors:[["app-new-task-dialog"]],decls:37,vars:12,consts:[["projectTrigger","matAutocompleteTrigger"],["projectAuto",""],["agentTrigger","matAutocompleteTrigger"],["agentAuto",""],["branchTrigger","matAutocompleteTrigger"],["branchAuto",""],["mat-dialog-title",""],[1,"ntd-content"],["appearance","outline",1,"ntd-field"],["matInput","","placeholder","Search project...",3,"input","focus","value","matAutocomplete"],[3,"optionSelected"],[3,"value"],["matInput","","placeholder","Search agent...",3,"input","focus","value","matAutocomplete","disabled"],["matSuffix","","diameter","16"],["matInput","","placeholder","Describe what the agent should accomplish...","rows","4",3,"input","value"],["align","end"],["mat-button","",3,"click","disabled"],["mat-flat-button","",1,"ntd-launch-btn",3,"click","disabled"],["diameter","16"],[1,"ntd-agent-name"],[1,"ntd-agent-desc"],[1,"ntd-radio-group"],["type","button",1,"ntd-mode-btn",3,"click"],[1,"ntd-radio-label"],[1,"ntd-radio-hint"],[1,"ntd-row"],["matInput","","type","text","placeholder","Name",3,"input","value"],["appearance","outline",1,"ntd-field","ntd-field--small"],[3,"selectionChange","value"],["matInput","","placeholder","Search branch...",3,"input","focus","value","matAutocomplete","disabled"]],template:function(e,n){if(e&1){let i=x();o(0,"h2",6)(1,"mat-icon"),s(2,"rocket_launch"),r(),s(3,` New Task
2
2
  `),r(),o(4,"mat-dialog-content",7)(5,"mat-form-field",8)(6,"mat-label"),s(7,"Project"),r(),o(8,"input",9,0),m("input",function(p){return n.onProjectSearchInput(p.target.value)})("focus",function(){g(i);let p=w(9);return h(n.openPanel(p))}),r(),o(10,"mat-autocomplete",10,1),m("optionSelected",function(p){return n.selectProject(p.option.value)}),y(12,jt,2,2,"mat-option",11,j),r()(),o(14,"mat-form-field",8)(15,"mat-label"),s(16,"Agent"),r(),o(17,"input",12,2),m("input",function(p){return n.onAgentSearchInput(p.target.value)})("focus",function(){g(i);let p=w(18);return h(n.openPanel(p))}),r(),v(19,Ot,1,0,"mat-spinner",13),o(20,"mat-autocomplete",10,3),m("optionSelected",function(p){return n.selectAgent(p.option.value)}),y(22,Nt,4,3,"mat-option",11,Dt),r()(),v(24,Rt,17,6),o(25,"mat-form-field",8)(26,"mat-label"),s(27,"Task"),r(),o(28,"textarea",14),m("input",function(p){return n.task.set(p.target.value)}),r()()(),o(29,"mat-dialog-actions",15)(30,"button",16),m("click",function(){return n.cancel()}),s(31,"Cancel"),r(),o(32,"button",17),m("click",function(){return n.submit()}),v(33,$t,1,0,"mat-spinner",18)(34,Lt,2,0,"mat-icon")(35,qt,2,0,"mat-icon"),s(36),r()()}if(e&2){let i=w(11),l=w(21);c(8),_("value",n.projectSearch())("matAutocomplete",i),c(4),M(n.filteredProjects()),c(5),_("value",n.agentSearch())("matAutocomplete",l)("disabled",!n.selectedProject()||n.isLoadingAgents()),c(2),C(n.isLoadingAgents()?19:-1),c(3),M(n.filteredAgents()),c(2),C(n.hasGit()&&!n.forcedProject()?24:-1),c(4),_("value",n.task()),c(2),_("disabled",n.isSubmitting()),c(2),_("disabled",!n.canNavigate()||n.isSubmitting()),c(),C(n.isSubmitting()?33:n.isValid()?34:35),c(3),P(" ",n.isValid()?"Launch":"Open"," ")}},dependencies:[K,W,q,z,B,E,O,J,X,ce,H,Z,Y,ue,pe,de,me,ee,ge,V,I,A,N],styles:["h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:0}.ntd-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;padding-top:20px!important}.ntd-field[_ngcontent-%COMP%]{width:100%}.ntd-row[_ngcontent-%COMP%]{display:flex;gap:.75rem}.ntd-row[_ngcontent-%COMP%] .ntd-field--small[_ngcontent-%COMP%]{width:130px;flex-shrink:0}.ntd-radio-group[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding:.25rem 0 .75rem}.ntd-mode-btn[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.15rem;padding:.75rem;border:1px solid var(--color-border);border-radius:8px;background:transparent;color:var(--color-text);cursor:pointer;transition:border-color .15s,background .15s}.ntd-mode-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem;margin-bottom:.1rem}.ntd-mode-btn.active[_ngcontent-%COMP%]{border-color:var(--color-primary);background:color-mix(in srgb,var(--color-primary) 10%,transparent)}.ntd-mode-btn[_ngcontent-%COMP%]:hover:not(.active){border-color:var(--color-text-secondary)}.ntd-radio-label[_ngcontent-%COMP%]{font-weight:600;font-size:.9rem}.ntd-radio-hint[_ngcontent-%COMP%]{font-size:.72rem;color:var(--color-text-secondary);line-height:1.3;text-align:left}.ntd-agent-name[_ngcontent-%COMP%]{font-weight:500;display:block}.ntd-agent-desc[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:380px}.ntd-launch-btn[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse)}.ntd-launch-btn[_ngcontent-%COMP%]:disabled{background:var(--color-border);color:var(--color-text-secondary);opacity:.6;cursor:not-allowed}"]})};var Bt=(a,t)=>t.name,zt=(a,t)=>t.value;function Wt(a,t){if(a&1&&(o(0,"mat-option",8),s(1),r()),a&2){let e=t.$implicit;_("value",e),c(),b(e)}}function Qt(a,t){a&1&&T(0,"mat-spinner",9)}function Ut(a,t){if(a&1&&(o(0,"mat-option",8),s(1),r()),a&2){let e=t.$implicit;_("value",e.name),c(),b(e.name)}}function Ht(a,t){if(a&1){let e=x();o(0,"button",37),m("click",function(){let i=g(e).$implicit,l=d();return h(l.toggleDay(i.value))}),s(1),r()}if(a&2){let e=t.$implicit,n=d();S("selected",n.isDaySelected(e.value)),c(),P(" ",e.label," ")}}function Xt(a,t){if(a&1){let e=x();o(0,"mat-form-field",4)(1,"mat-label"),s(2,"Number of runs"),r(),o(3,"input",17),m("ngModelChange",function(i){g(e);let l=d();return h(l.endOccurrences.set(i))}),r()()}if(a&2){let e=d();c(3),_("ngModel",e.endOccurrences())}}function Jt(a,t){if(a&1){let e=x();o(0,"mat-form-field",4)(1,"mat-label"),s(2,"End date"),r(),o(3,"input",38),m("ngModelChange",function(i){g(e);let l=d();return h(l.endTimestamp.set(i))}),r()()}if(a&2){let e=d();c(3),_("ngModel",e.endTimestamp())("min",e.startTimestamp())}}function Kt(a,t){if(a&1&&(o(0,"div",32)(1,"mat-icon"),s(2,"error"),r(),o(3,"span"),s(4),r()()),a&2){let e=d();c(4),b(e.errorMessage())}}function Yt(a,t){a&1&&T(0,"mat-spinner",36)}function Zt(a,t){a&1&&(o(0,"mat-icon"),s(1,"schedule"),r())}var R=class a{projectApi=f(U);agentApi=f(he);schedulerApi=f(_e);dialogRef=f($);dialogData=f(qe,{optional:!0});isEditMode=this.dialogData?.mode==="edit";projects=u([]);agents=u([]);name=u("");selectedProject=u("");selectedAgent=u("");instruction=u("");intervalValue=u(1);intervalUnit=u("d");startTimestamp=u("");daysOfWeek=u([]);endConditionType=u("none");endOccurrences=u(10);endTimestamp=u("");enabled=u(!0);isLoadingAgents=u(!1);isSaving=u(!1);errorMessage=u("");daysOfWeekOptions=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}];filteredProjects=k(()=>{let t=this.selectedProject().toLowerCase();return this.projects().filter(e=>e.toLowerCase().includes(t))});filteredAgents=k(()=>{let t=this.selectedAgent().toLowerCase();return this.agents().filter(e=>e.name.toLowerCase().includes(t))});isValid=k(()=>{let t=this.projects().includes(this.selectedProject()),e=this.agents().some(l=>l.name===this.selectedAgent()),n=this.instruction().trim().length>0,i=this.intervalValue()>=1;return t&&e&&n&&i});ngOnInit(){if(this.isEditMode&&this.dialogData?.scheduler){let t=this.dialogData.scheduler;this.name.set(t.name),this.selectedAgent.set(t.agentName??""),this.instruction.set(t.instruction??""),this.enabled.set(t.enabled);let e=t.schedule.interval.match(/^(\d+)(min|h|d|M)$/);e&&e[1]&&e[2]&&(this.intervalValue.set(parseInt(e[1],10)),this.intervalUnit.set(e[2])),t.schedule.startTimestamp&&this.startTimestamp.set(this.toDatetimeLocal(new Date(t.schedule.startTimestamp))),this.daysOfWeek.set(t.schedule.daysOfWeek??[]),t.schedule.endCondition&&(this.endConditionType.set(t.schedule.endCondition.type),t.schedule.endCondition.type==="occurrences"?this.endOccurrences.set(t.schedule.endCondition.value):t.schedule.endCondition.type==="endTimestamp"&&this.endTimestamp.set(this.toDatetimeLocal(new Date(t.schedule.endCondition.value))))}else this.startTimestamp.set(this.toDatetimeLocal(new Date));this.projectApi.listProjects().subscribe({next:({projects:t})=>{let e=t.map(i=>i.name).filter(i=>!i.includes("__"));this.projects.set(e);let n=this.dialogData?.projectName;this.isEditMode&&n?this.onProjectSelected(n):e.length===1&&e[0]&&this.onProjectSelected(e[0])}})}onProjectSelected(t){this.selectedProject.set(t),this.isEditMode||(this.agents.set([]),this.selectedAgent.set("")),this.projects().includes(t)&&(this.isLoadingAgents.set(!0),this.agentApi.getAgents(t).subscribe({next:e=>{this.agents.set(e),this.isLoadingAgents.set(!1),!this.isEditMode&&e.length===1&&e[0]&&this.selectedAgent.set(e[0].name)},error:()=>this.isLoadingAgents.set(!1)}))}toggleDay(t){let e=this.daysOfWeek();e.indexOf(t)>-1?this.daysOfWeek.set(e.filter(i=>i!==t)):this.daysOfWeek.set([...e,t].sort())}isDaySelected(t){return this.daysOfWeek().includes(t)}toDatetimeLocal(t){let e=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${e(t.getMonth()+1)}-${e(t.getDate())}T${e(t.getHours())}:${e(t.getMinutes())}`}submit(){if(!this.isValid()||this.isSaving())return;this.errorMessage.set(""),this.isSaving.set(!0);let t=this.startTimestamp(),e={startTimestamp:t?new Date(t).toISOString():new Date().toISOString(),interval:`${this.intervalValue()}${this.intervalUnit()}`},n=this.daysOfWeek();n.length>0&&(e.daysOfWeek=n);let i=this.endConditionType();i==="occurrences"?e.endCondition={type:"occurrences",value:this.endOccurrences()}:i==="endTimestamp"&&this.endTimestamp()&&(e.endCondition={type:"endTimestamp",value:new Date(this.endTimestamp()).toISOString()});let l=this.instruction().trim(),p=l.length>40?l.slice(0,40)+"\u2026":l,ie=this.name().trim()||`${this.selectedAgent()} \u2014 ${p}`;this.isEditMode&&this.dialogData?.scheduler&&this.dialogData.projectName?this.schedulerApi.updateSchedulerForProject(this.dialogData.projectName,this.dialogData.scheduler.id,{name:ie,agentName:this.selectedAgent(),instruction:l,schedule:e,enabled:this.enabled()}).subscribe({next:()=>{this.isSaving.set(!1),this.dialogRef.close(!0)},error:te=>{this.errorMessage.set(te?.error?.error||"Failed to update scheduler"),this.isSaving.set(!1)}}):this.schedulerApi.createSchedulerForProject(this.selectedProject(),{name:ie,agentName:this.selectedAgent(),instruction:l,schedule:e,enabled:this.enabled()}).subscribe({next:()=>{this.isSaving.set(!1),this.dialogRef.close(!0)},error:te=>{this.errorMessage.set(te?.error?.error||"Failed to create scheduler"),this.isSaving.set(!1)}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=D({type:a,selectors:[["app-quick-scheduler-dialog"]],decls:84,vars:20,consts:[["projectAuto","matAutocomplete"],["agentAuto","matAutocomplete"],["mat-dialog-title",""],[1,"qsd-form"],["appearance","outline",1,"full-width"],["matInput","","placeholder","Optional \u2014 auto-generated if empty",3,"ngModelChange","ngModel"],["matInput","","placeholder","Select a project",3,"ngModelChange","focus","ngModel","matAutocomplete"],[3,"optionSelected"],[3,"value"],["matSuffix","","diameter","18"],["matInput","","placeholder","Select an agent",3,"ngModelChange","focus","ngModel","matAutocomplete","disabled"],["matInput","","placeholder","e.g. Review open PRs and summarize what needs attention","rows","3",3,"ngModelChange","ngModel"],[1,"qsd-divider"],["matInput","","type","datetime-local",3,"ngModelChange","ngModel"],[1,"qsd-interval"],[1,"qsd-label"],["appearance","outline",1,"interval-value"],["matInput","","type","number","min","1",3,"ngModelChange","ngModel"],["appearance","outline",1,"interval-unit"],[3,"ngModelChange","ngModel"],["value","min"],["value","h"],["value","d"],["value","M"],[1,"qsd-days"],[1,"qsd-day-chips"],["type","button",1,"day-chip",3,"selected"],[1,"qsd-hint"],[1,"qsd-end"],["value","none"],["value","occurrences"],["value","endTimestamp"],[1,"qsd-error"],["align","end"],["mat-button","",3,"click","disabled"],["mat-flat-button","",3,"click","disabled"],["diameter","18"],["type","button",1,"day-chip",3,"click"],["matInput","","type","datetime-local",3,"ngModelChange","ngModel","min"]],template:function(e,n){if(e&1&&(o(0,"h2",2)(1,"mat-icon"),s(2,"schedule"),r(),s(3),r(),o(4,"mat-dialog-content")(5,"div",3)(6,"mat-form-field",4)(7,"mat-label"),s(8,"Name"),r(),o(9,"input",5),m("ngModelChange",function(l){return n.name.set(l)}),r()(),o(10,"mat-form-field",4)(11,"mat-label"),s(12,"Project"),r(),o(13,"input",6),m("ngModelChange",function(l){return n.onProjectSelected(l)})("focus",function(){return n.selectedProject.set(n.selectedProject())}),r(),o(14,"mat-autocomplete",7,0),m("optionSelected",function(l){return n.onProjectSelected(l.option.value)}),y(16,Wt,2,2,"mat-option",8,j),r()(),o(18,"mat-form-field",4)(19,"mat-label"),s(20,"Agent"),r(),v(21,Qt,1,0,"mat-spinner",9),o(22,"input",10),m("ngModelChange",function(l){return n.selectedAgent.set(l)})("focus",function(){return n.selectedAgent.set(n.selectedAgent())}),r(),o(23,"mat-autocomplete",7,1),m("optionSelected",function(l){return n.selectedAgent.set(l.option.value)}),y(25,Ut,2,2,"mat-option",8,Bt),r()(),o(27,"mat-form-field",4)(28,"mat-label"),s(29,"What should the agent do?"),r(),o(30,"textarea",11),m("ngModelChange",function(l){return n.instruction.set(l)}),r()(),o(31,"div",12)(32,"span"),s(33,"Scheduling"),r()(),o(34,"mat-form-field",4)(35,"mat-label"),s(36,"Starts on"),r(),o(37,"input",13),m("ngModelChange",function(l){return n.startTimestamp.set(l)}),r()(),o(38,"div",14)(39,"span",15),s(40,"Every"),r(),o(41,"mat-form-field",16)(42,"input",17),m("ngModelChange",function(l){return n.intervalValue.set(l)}),r()(),o(43,"mat-form-field",18)(44,"mat-select",19),m("ngModelChange",function(l){return n.intervalUnit.set(l)}),o(45,"mat-option",20),s(46,"minutes"),r(),o(47,"mat-option",21),s(48,"hours"),r(),o(49,"mat-option",22),s(50,"days"),r(),o(51,"mat-option",23),s(52,"months"),r()()()(),o(53,"div",24)(54,"span",15),s(55,"Days"),r(),o(56,"div",25),y(57,Ht,2,3,"button",26,zt),r(),o(59,"span",27),s(60,"Leave empty for every day"),r()(),o(61,"div",28)(62,"mat-form-field",4)(63,"mat-label"),s(64,"Ends on"),r(),o(65,"mat-select",19),m("ngModelChange",function(l){return n.endConditionType.set(l)}),o(66,"mat-option",29),s(67,"Never"),r(),o(68,"mat-option",30),s(69,"After N runs"),r(),o(70,"mat-option",31),s(71,"On a date"),r()()(),v(72,Xt,4,1,"mat-form-field",4),v(73,Jt,4,2,"mat-form-field",4),r(),o(74,"mat-checkbox",19),m("ngModelChange",function(l){return n.enabled.set(l)}),s(75,"Enable immediately"),r(),v(76,Kt,5,1,"div",32),r()(),o(77,"mat-dialog-actions",33)(78,"button",34),m("click",function(){return n.cancel()}),s(79,"Cancel"),r(),o(80,"button",35),m("click",function(){return n.submit()}),v(81,Yt,1,0,"mat-spinner",36)(82,Zt,2,0,"mat-icon"),s(83," Schedule "),r()()),e&2){let i=w(15),l=w(24);c(3),P(" ",n.isEditMode?"Edit scheduled task":"New scheduled task",`
3
3
  `),c(6),_("ngModel",n.name()),c(4),_("ngModel",n.selectedProject())("matAutocomplete",i),c(3),M(n.filteredProjects()),c(5),C(n.isLoadingAgents()?21:-1),c(),_("ngModel",n.selectedAgent())("matAutocomplete",l)("disabled",!n.projects().includes(n.selectedProject())),c(3),M(n.filteredAgents()),c(5),_("ngModel",n.instruction()),c(7),_("ngModel",n.startTimestamp()),c(5),_("ngModel",n.intervalValue()),c(2),_("ngModel",n.intervalUnit()),c(13),M(n.daysOfWeekOptions),c(8),_("ngModel",n.endConditionType()),c(7),C(n.endConditionType()==="occurrences"?72:-1),c(),C(n.endConditionType()==="endTimestamp"?73:-1),c(),_("ngModel",n.enabled()),c(2),C(n.errorMessage()?76:-1),c(2),_("disabled",n.isSaving()),c(2),_("disabled",!n.isValid()||n.isSaving()),c(),C(n.isSaving()?81:82)}},dependencies:[K,tt,ot,nt,rt,it,W,q,z,B,E,O,J,X,ce,H,Z,Y,ue,pe,de,me,ee,ge,ut,mt,V,I,A,N],styles:['[_nghost-%COMP%]{display:block}h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.qsd-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;padding-top:4px}.full-width[_ngcontent-%COMP%]{width:100%}.qsd-interval[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.qsd-interval[_ngcontent-%COMP%] .qsd-label[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant);white-space:nowrap}.qsd-interval[_ngcontent-%COMP%] .interval-value[_ngcontent-%COMP%]{width:80px}.qsd-interval[_ngcontent-%COMP%] .interval-unit[_ngcontent-%COMP%]{flex:1}.qsd-days[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.qsd-days[_ngcontent-%COMP%] .qsd-label[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant);white-space:nowrap}.qsd-days[_ngcontent-%COMP%] .qsd-hint[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);opacity:.7;width:100%;margin-top:-4px;padding-left:36px}.qsd-day-chips[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.day-chip[_ngcontent-%COMP%]{padding:4px 10px;border-radius:16px;border:1px solid var(--mat-sys-outline);background:transparent;color:var(--mat-sys-on-surface);font-size:12px;cursor:pointer;transition:background .15s,color .15s}.day-chip.selected[_ngcontent-%COMP%]{background:var(--mat-sys-primary);color:var(--mat-sys-on-primary);border-color:var(--mat-sys-primary)}.day-chip[_ngcontent-%COMP%]:hover:not(.selected){background:var(--mat-sys-surface-variant)}.qsd-divider[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin:4px 0}.qsd-divider[_ngcontent-%COMP%]:before, .qsd-divider[_ngcontent-%COMP%]:after{content:"";flex:1;height:1px;background:var(--mat-sys-outline-variant)}.qsd-divider[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px}.qsd-end[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.qsd-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;color:var(--mat-sys-error);font-size:14px}.qsd-error[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}mat-dialog-actions[_ngcontent-%COMP%]{gap:8px}mat-dialog-actions[_ngcontent-%COMP%] button[mat-flat-button][_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}'],changeDetection:0})};var tn=(a,t)=>t.id;function nn(a,t){if(a&1){let e=x();o(0,"button",9),m("click",function(){let i=g(e).$implicit,l=d(2);return h(l.setProject(i))}),s(1),r()}if(a&2){let e=t.$implicit,n=d(2);S("active",n.activeProject()===e),c(),P(" ",e," ")}}function on(a,t){if(a&1){let e=x();o(0,"nav",2)(1,"button",9),m("click",function(){g(e);let i=d();return h(i.setProject(null))}),s(2," All projects "),r(),y(3,nn,2,3,"button",10,j),r()}if(a&2){let e=d();c(),S("active",e.activeProject()===null),c(2),M(e.projects())}}function rn(a,t){a&1&&(o(0,"div",3),T(1,"mat-spinner",11),r())}function an(a,t){if(a&1&&(o(0,"div",4)(1,"mat-icon"),s(2,"error"),r(),s(3),r()),a&2){let e=d();c(3),P(" ",e.errorMessage()," ")}}function ln(a,t){if(a&1){let e=x();o(0,"div",5)(1,"mat-icon"),s(2,"schedule"),r(),o(3,"p"),s(4,"No scheduled tasks yet."),r(),o(5,"button",12),m("click",function(){g(e);let i=d();return h(i.openCreate())}),o(6,"mat-icon"),s(7,"add"),r(),s(8," Create one "),r()()}}function sn(a,t){if(a&1&&(o(0,"span",17),s(1),r()),a&2){let e=d().$implicit;c(),b(e.projectName)}}function cn(a,t){if(a&1){let e=x();o(0,"li",14)(1,"div",15)(2,"span",16),s(3),r(),v(4,sn,2,1,"span",17),o(5,"span",18),s(6),r()(),o(7,"div",19)(8,"span",20),s(9),r(),o(10,"span",21),s(11),r()(),o(12,"div",22)(13,"mat-slide-toggle",23),m("change",function(){let i=g(e).$implicit,l=d(2);return h(l.toggleEnabled(i))}),r(),o(14,"button",24),m("click",function(){let i=g(e).$implicit,l=d(2);return h(l.runNow(i))}),o(15,"mat-icon"),s(16,"play_arrow"),r()(),o(17,"button",25),m("click",function(){let i=g(e).$implicit,l=d(2);return h(l.edit(i))}),o(18,"mat-icon"),s(19,"edit"),r()(),o(20,"button",26),m("click",function(){let i=g(e).$implicit,l=d(2);return h(l.delete(i))}),o(21,"mat-icon"),s(22,"delete"),r()()()()}if(a&2){let e=t.$implicit,n=d(2);S("disabled",!e.enabled),c(3),b(e.name),c(),C(n.projects().length>1?4:-1),c(2),b(n.getSource(e)),c(3),b(n.formatInterval(e.schedule.interval)),c(),S("due",!e.nextRun),c(),b(n.formatNextRun(e.nextRun)),c(2),_("checked",e.enabled)}}function dn(a,t){if(a&1&&(o(0,"ul",6),y(1,cn,23,10,"li",13,tn),r()),a&2){let e=d();c(),M(e.filteredSchedulers())}}var be=class a{projectApi=f(U);schedulerApi=f(_e);dialog=f(L);dialogRef=f($);allSchedulers=u([]);isLoading=u(!0);errorMessage=u("");activeProject=u(null);projects=u([]);filteredSchedulers=k(()=>{let t=this.activeProject(),e=this.allSchedulers();return t?e.filter(n=>n.projectName===t):e});ngOnInit(){this.load()}load(){this.isLoading.set(!0),this.errorMessage.set(""),this.projectApi.listProjects().subscribe({next:({projects:t})=>{let e=t.map(i=>i.name).filter(i=>!i.includes("__"));if(this.projects.set(e),e.length===0){this.isLoading.set(!1);return}let n=e.map(i=>this.schedulerApi.listSchedulersForProject(i).pipe(Ee(()=>Pe([]))));Oe(n).subscribe({next:i=>{let l=[];i.forEach((p,ie)=>{p.forEach(te=>l.push(G(F({},te),{projectName:e[ie]})))}),this.allSchedulers.set(l),this.isLoading.set(!1)},error:()=>{this.errorMessage.set("Failed to load schedulers"),this.isLoading.set(!1)}})},error:()=>{this.errorMessage.set("Failed to load projects"),this.isLoading.set(!1)}})}setProject(t){this.activeProject.set(t)}formatInterval(t){let e=/^(\d+)(min|h|d|M)$/.exec(t);if(!e)return t;let[,n,i]=e;return`Every ${n}${{min:"min",h:"h",d:"d",M:"mo"}[i??""]??i}`}formatNextRun(t){if(!t)return"Expired";let e=new Date(t),n=new Date,i=e.getTime()-n.getTime();if(i<0)return"Due";let l=Math.floor(i/6e4);if(l<60)return`in ${l}m`;let p=Math.floor(l/60);return p<24?`in ${p}h`:`in ${Math.floor(p/24)}d`}getSource(t){if(t.agentName&&t.instruction){let e=t.instruction.length>35?t.instruction.slice(0,35)+"\u2026":t.instruction;return`${t.agentName}: ${e}`}return t.promptId??""}toggleEnabled(t){(t.enabled?this.schedulerApi.disableSchedulerForProject(t.projectName,t.id):this.schedulerApi.enableSchedulerForProject(t.projectName,t.id)).subscribe({next:()=>{this.allSchedulers.update(n=>n.map(i=>i.id===t.id?G(F({},i),{enabled:!i.enabled}):i))},error:()=>this.errorMessage.set("Failed to toggle scheduler")})}runNow(t){this.schedulerApi.runSchedulerNowForProject(t.projectName,t.id).subscribe({error:()=>this.errorMessage.set("Failed to run scheduler")})}edit(t){let e={mode:"edit",projectName:t.projectName,scheduler:{id:t.id,name:t.name,agentName:t.agentName,instruction:t.instruction,enabled:t.enabled,schedule:t.schedule}};this.dialog.open(R,{width:"480px",data:e}).afterClosed().subscribe(i=>{i&&this.load()})}delete(t){this.schedulerApi.deleteSchedulerForProject(t.projectName,t.id).subscribe({next:()=>{this.allSchedulers.update(e=>e.filter(n=>n.id!==t.id))},error:()=>this.errorMessage.set("Failed to delete scheduler")})}openCreate(){this.dialogRef.close(),this.dialog.open(R,{width:"480px"})}close(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=D({type:a,selectors:[["app-global-schedulers-dialog"]],decls:19,vars:3,consts:[["mat-dialog-title",""],[1,"gsd-count"],[1,"gsd-project-filters"],[1,"gsd-loading"],[1,"gsd-error"],[1,"gsd-empty"],[1,"gsd-list"],["align","end"],["mat-button","",3,"click"],[1,"proj-chip",3,"click"],[1,"proj-chip",3,"active"],["diameter","32"],["mat-flat-button","",3,"click"],[1,"gsd-item",3,"disabled"],[1,"gsd-item"],[1,"gsd-item-main"],[1,"gsd-item-name"],[1,"gsd-item-project"],[1,"gsd-item-source"],[1,"gsd-item-meta"],[1,"gsd-interval"],[1,"gsd-next"],[1,"gsd-item-actions"],["matTooltip","Enable / Disable",3,"change","checked"],["mat-icon-button","","matTooltip","Run now",3,"click"],["mat-icon-button","","matTooltip","Edit",3,"click"],["mat-icon-button","","matTooltip","Delete",1,"delete-btn",3,"click"]],template:function(e,n){e&1&&(o(0,"h2",0)(1,"mat-icon"),s(2,"schedule"),r(),s(3," Scheduled tasks "),o(4,"span",1),s(5),r()(),o(6,"mat-dialog-content"),v(7,on,5,2,"nav",2),v(8,rn,2,0,"div",3)(9,an,4,1,"div",4)(10,ln,9,0,"div",5)(11,dn,3,0,"ul",6),r(),o(12,"mat-dialog-actions",7)(13,"button",8),m("click",function(){return n.openCreate()}),o(14,"mat-icon"),s(15,"add"),r(),s(16," New scheduler "),r(),o(17,"button",8),m("click",function(){return n.close()}),s(18,"Close"),r()()),e&2&&(c(5),b(n.filteredSchedulers().length),c(2),C(n.projects().length>1?7:-1),c(),C(n.isLoading()?8:n.errorMessage()?9:n.filteredSchedulers().length===0?10:11))},dependencies:[K,W,q,z,B,E,O,re,A,N,V,I,ee,se,le,ht,gt],styles:["[_nghost-%COMP%]{display:block}h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}h2[mat-dialog-title][_ngcontent-%COMP%] .gsd-count[_ngcontent-%COMP%]{font-size:13px;font-weight:400;color:var(--mat-sys-on-surface-variant);margin-left:2px}.gsd-project-filters[_ngcontent-%COMP%]{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}.proj-chip[_ngcontent-%COMP%]{padding:4px 12px;border-radius:16px;border:1px solid var(--mat-sys-outline);background:transparent;color:var(--mat-sys-on-surface);font-size:13px;cursor:pointer;transition:background .15s,color .15s}.proj-chip.active[_ngcontent-%COMP%]{background:var(--mat-sys-primary);color:var(--mat-sys-on-primary);border-color:var(--mat-sys-primary)}.proj-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--mat-sys-surface-variant)}.gsd-loading[_ngcontent-%COMP%], .gsd-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:32px 0;color:var(--mat-sys-on-surface-variant)}.gsd-loading[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .gsd-empty[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:40px;width:40px;height:40px;opacity:.4}.gsd-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;color:var(--mat-sys-error);padding:16px 0}.gsd-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.gsd-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:8px;background:var(--mat-sys-surface-container);transition:opacity .2s}.gsd-item.disabled[_ngcontent-%COMP%]{opacity:.5}.gsd-item-main[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.gsd-item-name[_ngcontent-%COMP%]{font-weight:500;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gsd-item-project[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-primary);font-weight:500}.gsd-item-source[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gsd-item-meta[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end;gap:2px;white-space:nowrap}.gsd-interval[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant)}.gsd-next[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-on-surface-variant)}.gsd-next.due[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.gsd-item-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.gsd-item-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]{color:var(--mat-sys-error);opacity:.7;transition:opacity .15s}.gsd-item-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]:hover{opacity:1}mat-dialog-actions[_ngcontent-%COMP%]{gap:8px}"],changeDetection:0})};var ve=class a{http=f(Ge);threadApi=f(ze);isLoading=u(!1);tasks=u([]);refresh(){this.isLoading.set(!0),this.threadApi.listAllThreads().pipe(De(15e3)).subscribe({next:t=>{let e=t.filter(n=>!n.parentThreadId).map(n=>({id:n.id,name:n.name,summary:n.summary,modifiedDate:n.modifiedDate,starring:n.starring??[],users:n.users??[],isActive:!1,status:this.deriveStatus(n),projectId:n.projectId,worktreeProject:n.worktreeProject}));this.tasks.set(this.sorted(e)),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1)}})}applyStatusEvent(t,e){let n=e==="invite"?"waiting-you":"in-progress";this.tasks.update(i=>this.sorted(i.map(l=>l.id===t?G(F({},l),{status:n}):l)))}closeTask(t,e){this.tasks.update(n=>n.filter(i=>i.id!==e)),this.http.delete(`/api/projects/${t}/missions/${e}`).subscribe({next:()=>this.refresh(),error:n=>{console.error("[GLOBAL-TC] Failed to close task:",n),this.refresh()}})}stopThread(t,e){this.http.post(`/api/projects/${t}/threads/${e}/stop`,{}).subscribe({error:n=>console.error("[GLOBAL-TC] Failed to stop thread:",n)})}deleteThread(t,e){this.tasks.update(n=>n.filter(i=>i.id!==e)),this.http.delete(`/api/projects/${t}/threads/${e}`).subscribe({next:()=>this.refresh(),error:n=>{console.error("[GLOBAL-TC] Failed to delete thread:",n),this.refresh()}})}toggleStar(t,e,n){let i=`/api/projects/${t}/threads/${e}/star`;(n?this.http.delete(i):this.http.post(i,{})).subscribe({next:()=>this.refresh(),error:p=>console.error("[GLOBAL-TC] Failed to toggle star:",p)})}markTaskDone(t,e){this.http.post(`/api/projects/${t}/threads/${e}/done`,{}).subscribe({next:()=>this.refresh(),error:n=>console.error("[GLOBAL-TC] Failed to mark task as done:",n)})}markTaskActive(t,e){this.http.delete(`/api/projects/${t}/threads/${e}/done`).subscribe({next:()=>this.refresh(),error:n=>console.error("[GLOBAL-TC] Failed to mark task as active:",n)})}deriveStatus(t){return t.closedByUser?"done":t.pendingInvite?"waiting-you":Date.now()-new Date(t.modifiedDate).getTime()<vt?"in-progress":"paused"}sorted(t){return[...t].sort((e,n)=>{let i=ye[e.status]-ye[n.status];return i!==0?i:e.modifiedDate>n.modifiedDate?-1:1})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=oe({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ce=class a{configApi=f(Ct);dialog=f(L);openUserConfigEditor(){this.configApi.getUserConfig().subscribe({next:t=>{this.dialog.open(xt,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(n=>{n&&this.configApi.updateUserConfig(n).subscribe({error:i=>console.error("[CONFIG-STATE] Error saving user config:",i)})})},error:t=>console.error("[CONFIG-STATE] Error loading user config:",t)})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=oe({token:a,factory:a.\u0275fac,providedIn:"root"})};var pn=["layoutContainer"],mn=(a,t)=>t.key,un=(a,t)=>t.name,gn=(a,t)=>t.status,Tt=(a,t)=>t.id;function hn(a,t){if(a&1){let e=x();o(0,"button",32),m("click",function(){g(e);let i=d();return h(i.clearSearch())}),o(1,"mat-icon"),s(2,"close"),r()()}}function _n(a,t){if(a&1){let e=x();o(0,"button",33),m("click",function(){let i=g(e).$implicit,l=d(2);return h(l.setProject(i.name))}),s(1),o(2,"span",34),s(3),r()()}if(a&2){let e=t.$implicit,n=d(2);S("active",n.activeProject()===e.name),c(),P(" ",e.name," "),c(2),b(e.count)}}function fn(a,t){if(a&1){let e=x();o(0,"nav",22)(1,"button",33),m("click",function(){g(e);let i=d();return h(i.setProject(null))}),s(2," All projects "),o(3,"span",34),s(4),r()(),y(5,_n,4,4,"button",35,un),r()}if(a&2){let e=d();c(),S("active",e.activeProject()===null),c(3),b(e.allTasks().length),c(),M(e.projectSummaries())}}function bn(a,t){if(a&1&&(o(0,"span",37),s(1),r()),a&2){let e=d().$implicit,n=d();c(),b(n.filterCounts()[e.key])}}function vn(a,t){if(a&1){let e=x();o(0,"button",36),m("click",function(){let i=g(e).$implicit,l=d();return h(l.setFilter(i.key))}),o(1,"mat-icon",26),s(2),r(),o(3,"span"),s(4),r(),v(5,bn,2,1,"span",37),r()}if(a&2){let e=t.$implicit,n=d();S("active",n.activeFilter()===e.key),ke("aria-selected",n.activeFilter()===e.key),c(2),b(e.icon),c(2),b(e.label),c(),C(n.filterCounts()[e.key]>0?5:-1)}}function Cn(a,t){a&1&&(o(0,"div",29),T(1,"mat-spinner",38),o(2,"p"),s(3,"Loading tasks from all projects\u2026"),r()())}function xn(a,t){a&1&&(o(0,"div",30)(1,"mat-icon",39),s(2,"hub"),r(),o(3,"p"),s(4,"No tasks found."),r()())}function kn(a,t){if(a&1){let e=x();o(0,"app-task-card",45),m("stopRequested",function(i){let l=g(e).$implicit,p=d(3);return h(p.onStopRequested(i,l.projectId))})("deleteRequested",function(i){let l=g(e).$implicit,p=d(3);return h(p.onDeleteRequested(i,l.projectId))})("starToggled",function(i){let l=g(e).$implicit,p=d(3);return h(p.onStarToggled(i,l.projectId))})("closeTaskRequested",function(i){let l=g(e).$implicit,p=d(3);return h(p.onCloseTaskRequested(i,l.projectId))})("markDoneRequested",function(i){let l=g(e).$implicit,p=d(3);return h(p.onMarkDoneRequested(i,l.projectId))})("markActiveRequested",function(i){let l=g(e).$implicit,p=d(3);return h(p.onMarkActiveRequested(i,l.projectId))})("previewRequested",function(i){let l=g(e).$implicit,p=d(3);return h(p.onPreviewRequested(i,l.projectId,l.name))}),r()}if(a&2){let e=t.$implicit,n=d(3);S("is-previewed",n.previewThreadId()===e.id),_("task",e)("projectNameOverride",e.projectId)("showProject",!0)("previewMode",n.previewActive())}}function yn(a,t){if(a&1&&(o(0,"section",40)(1,"h3",41)(2,"mat-icon",42),s(3),r(),s(4),o(5,"span",43),s(6),r()(),o(7,"div",31),y(8,kn,1,6,"app-task-card",44,Tt),r()()),a&2){let e=t.$implicit;c(3),b(e.icon),c(),P(" ",e.label," "),c(2),b(e.tasks.length),c(2),M(e.tasks)}}function Mn(a,t){if(a&1&&y(0,yn,10,3,"section",40,gn),a&2){let e=d();M(e.taskGroups())}}function Sn(a,t){if(a&1){let e=x();o(0,"app-task-card",45),m("stopRequested",function(i){let l=g(e).$implicit,p=d(2);return h(p.onStopRequested(i,l.projectId))})("deleteRequested",function(i){let l=g(e).$implicit,p=d(2);return h(p.onDeleteRequested(i,l.projectId))})("starToggled",function(i){let l=g(e).$implicit,p=d(2);return h(p.onStarToggled(i,l.projectId))})("closeTaskRequested",function(i){let l=g(e).$implicit,p=d(2);return h(p.onCloseTaskRequested(i,l.projectId))})("markDoneRequested",function(i){let l=g(e).$implicit,p=d(2);return h(p.onMarkDoneRequested(i,l.projectId))})("markActiveRequested",function(i){let l=g(e).$implicit,p=d(2);return h(p.onMarkActiveRequested(i,l.projectId))})("previewRequested",function(i){let l=g(e).$implicit,p=d(2);return h(p.onPreviewRequested(i,l.projectId,l.name))}),r()}if(a&2){let e=t.$implicit,n=d(2);S("is-previewed",n.previewThreadId()===e.id),_("task",e)("projectNameOverride",e.projectId)("showProject",!0)("previewMode",n.previewActive())}}function Tn(a,t){if(a&1&&(o(0,"div",31),y(1,Sn,1,6,"app-task-card",44,Tt),r()),a&2){let e=d();c(),M(e.displayedTasks())}}function wn(a,t){if(a&1){let e=x();o(0,"div",46),m("mousedown",function(i){g(e);let l=d();return h(l.onResizerMousedown(i))}),r(),o(1,"div",47)(2,"header",48)(3,"span",49),s(4),r(),o(5,"div",50)(6,"button",51),m("click",function(){g(e);let i=d();return h(i.navigateToThread())}),o(7,"mat-icon"),s(8,"open_in_new"),r()(),o(9,"button",52),m("click",function(){g(e);let i=d();return h(i.closePreview())}),o(10,"mat-icon"),s(11,"close"),r()()()(),o(12,"div",53),T(13,"app-thread",54),r()()}if(a&2){let e=d();c(),Fe("width",e.previewPanelWidthPercent(),"%"),c(3),b(e.previewTaskName()||"Task"),c(9),_("projectName",e.previewProjectId())("threadId",e.previewThreadId())}}var Pn=20,Dn=70,jn=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{status:"in-progress",label:"In progress",icon:"pending"},{status:"paused",label:"Paused",icon:"pause_circle"},{status:"error",label:"Error",icon:"error"},{status:"done",label:"Done",icon:"check_circle"}],On=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],St=class a{globalTaskService=f(ve);destroyRef=f(Ne);dialog=f(L);router=f(Re);configState=f(Ce);userService=f(Qe);preferences=f(Ue);projectState=f(ae);threadState=f(We);breakpointObserver=f(Le);username=Q(this.userService.username$,{initialValue:null});isDesktop=Q(this.breakpointObserver.observe("(min-width: 1280px)").pipe(je(t=>t.matches)),{initialValue:!1});previewEnabled=Q(this.preferences.missionPreviewEnabled$,{initialValue:!1});previewActive=k(()=>this.previewEnabled()&&this.isDesktop());previewThreadId=u(null);previewProjectId=u(null);previewTaskName=u(null);previewPanelWidthPercent=u(this.preferences.getMissionPreviewPanelWidth());isDraggingResizer=!1;dragStartX=0;dragStartWidth=0;containerWidth=0;layoutContainerRef;globalEventSource=null;filters=On;activeFilter=u("all");starredOnly=u(!1);activeProject=u(null);searchQuery=u("");isLoading=this.globalTaskService.isLoading;allTasks=this.globalTaskService.tasks;projectSummaries=k(()=>{let t=this.allTasks(),e=new Map;for(let n of t)e.set(n.projectId,(e.get(n.projectId)??0)+1);return[...e.entries()].map(([n,i])=>({name:n,count:i})).sort((n,i)=>n.name.localeCompare(i.name))});filteredTasks=k(()=>{let t=this.allTasks(),e=this.activeProject();e&&(t=t.filter(l=>l.projectId===e));let n=this.username();this.starredOnly()&&n&&(t=t.filter(l=>l.starring.includes(n)));let i=this.activeFilter();return i!=="all"&&(t=t.filter(l=>l.status===i)),t});filterCounts=k(()=>{let t=this.allTasks(),e=this.activeProject();e&&(t=t.filter(i=>i.projectId===e));let n=this.username();return this.starredOnly()&&n&&(t=t.filter(i=>i.starring.includes(n))),{all:t.length,"waiting-you":t.filter(i=>i.status==="waiting-you").length,"in-progress":t.filter(i=>i.status==="in-progress").length,done:t.filter(i=>i.status==="done").length,paused:t.filter(i=>i.status==="paused").length,error:t.filter(i=>i.status==="error").length}});displayedTasks=k(()=>{let t=this.searchQuery().toLowerCase().trim(),e=this.sortedFilteredTasks();return t?e.filter(n=>(n.name||"").toLowerCase().includes(t)||(n.summary||"").toLowerCase().includes(t)):e});taskGroups=k(()=>{let t=this.displayedTasks();return jn.map(e=>G(F({},e),{tasks:t.filter(n=>n.status===e.status)})).filter(e=>e.tasks.length>0)});sortedFilteredTasks=k(()=>{let t=this.filteredTasks(),e={"waiting-you":0,"in-progress":1,paused:2,error:3,done:4};return[...t].sort((n,i)=>(e[n.status]??99)-(e[i.status]??99))});constructor(){this.destroyRef.onDestroy(()=>this.disconnectGlobalSse())}ngOnInit(){this.globalTaskService.refresh(),this.connectGlobalSse(),this.userService.fetchCurrentUser().pipe(Be(this.destroyRef)).subscribe({error:t=>console.warn("[GTC] Could not fetch user:",t)})}setFilter(t){this.activeFilter.set(t)}toggleStarredFilter(){this.starredOnly.update(t=>!t)}setProject(t){this.activeProject.set(t),this.activeFilter.set("all")}onSearchInput(t){this.searchQuery.set(t.target.value)}clearSearch(){this.searchQuery.set("")}refresh(){this.globalTaskService.refresh()}openPreferences(){this.dialog.open(ft,{width:"400px"})}openTokenUsage(){this.router.navigate(["/token-usage"])}openUserConfig(){this.configState.openUserConfigEditor()}openQuickSchedulerDialog(){this.dialog.open(R,{width:"480px",disableClose:!1})}openGlobalSchedulersDialog(){this.dialog.open(be,{width:"600px",maxHeight:"80vh"})}openNewTaskDialog(){this.dialog.open(fe,{width:"500px",disableClose:!1}).afterClosed().subscribe(e=>{e&&(e.navigate?this.router.navigate(["project",e.projectId]):(setTimeout(()=>this.globalTaskService.refresh(),300),setTimeout(()=>this.globalTaskService.refresh(),1500)))})}onStopRequested(t,e){this.globalTaskService.stopThread(e,t)}onDeleteRequested(t,e){this.globalTaskService.deleteThread(e,t)}onStarToggled(t,e){let n=this.allTasks().find(p=>p.id===t);if(!n)return;let i=this.username(),l=!!i&&n.starring.includes(i);this.globalTaskService.toggleStar(e,t,l)}onCloseTaskRequested(t,e){let i=this.allTasks().find(p=>p.id===t)?.worktreeProject??e;this.dialog.open(_t,{width:"420px",data:{title:"Close task",message:`This will stop the agent, delete the thread and remove the worktree project "${i}" from disk. This cannot be undone.`,confirmLabel:"Close task",cancelLabel:"Cancel"}}).afterClosed().subscribe(p=>{p&&this.globalTaskService.closeTask(e,t)})}onMarkDoneRequested(t,e){this.globalTaskService.markTaskDone(e,t)}onMarkActiveRequested(t,e){this.globalTaskService.markTaskActive(e,t)}onPreviewRequested(t,e,n){this.previewThreadId()===t?(this.previewThreadId.set(null),this.previewProjectId.set(null),this.previewTaskName.set(null)):(this.projectState.selectProject(e),this.threadState.selectThread(t),this.previewProjectId.set(e),this.previewThreadId.set(t),this.previewTaskName.set(n))}closePreview(){this.previewThreadId.set(null),this.previewProjectId.set(null),this.previewTaskName.set(null)}navigateToThread(){let t=this.previewThreadId(),e=this.previewProjectId();!t||!e||this.router.navigate(["project",e,"thread",t])}onResizerMousedown(t){t.preventDefault(),this.isDraggingResizer=!0,this.dragStartX=t.clientX,this.dragStartWidth=this.previewPanelWidthPercent(),this.containerWidth=this.layoutContainerRef?.nativeElement.offsetWidth??window.innerWidth}onDocumentMousemove(t){if(!this.isDraggingResizer)return;let n=(this.dragStartX-t.clientX)/this.containerWidth*100,i=Math.min(Dn,Math.max(Pn,this.dragStartWidth+n));this.previewPanelWidthPercent.set(i)}onDocumentMouseup(){this.isDraggingResizer&&(this.isDraggingResizer=!1,this.preferences.setMissionPreviewPanelWidth(this.previewPanelWidthPercent()))}connectGlobalSse(t=5e3){this.disconnectGlobalSse();let e=new EventSource("/api/event-stream");this.globalEventSource=e,e.onmessage=n=>{try{let i=JSON.parse(n.data),l=dt(i);if(!l)return;let p=l.threadId;if(!p)return;l instanceof at||l instanceof lt?this.globalTaskService.applyStatusEvent(p,"invite"):l instanceof st?this.globalTaskService.applyStatusEvent(p,"thinking"):l instanceof ct&&this.globalTaskService.refresh()}catch(i){}},e.onerror=()=>{e.readyState===EventSource.CLOSED&&(this.globalEventSource=null,setTimeout(()=>{this.globalEventSource||this.connectGlobalSse(Math.min(t*2,6e4))},t))}}disconnectGlobalSse(){this.globalEventSource&&(this.globalEventSource.close(),this.globalEventSource=null)}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=D({type:a,selectors:[["app-global-task-control"]],viewQuery:function(e,n){if(e&1&&Ae(pn,5),e&2){let i;Ie(i=Ve())&&(n.layoutContainerRef=i.first)}},hostBindings:function(e,n){e&1&&m("mousemove",function(l){return n.onDocumentMousemove(l)},xe)("mouseup",function(){return n.onDocumentMouseup()},xe)},decls:85,vars:11,consts:[["layoutContainer",""],["schedulerMenu","matMenu"],["controlCenterMenu","matMenu"],[1,"gtc"],[1,"gtc-toolbar"],[1,"gtc-toolbar-left"],[1,"gtc-logo-icon"],[1,"gtc-title"],["appearance","fill","subscriptSizing","dynamic",1,"gtc-search"],["matPrefix",""],["matInput","","type","search","placeholder","Filter tasks\u2026","autocomplete","off",3,"input","keydown.escape","value"],["matSuffix","","mat-icon-button","","aria-label","Clear"],[1,"gtc-toolbar-actions"],["mat-icon-button","","matTooltip","Schedulers","aria-label","Schedulers",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-icon-button","","matTooltip","Control Center","aria-label","Control Center",3,"matMenuTriggerFor"],["mat-menu-item","","href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer"],["mat-icon-button","","matTooltip","Refresh all tasks","aria-label","Refresh tasks",3,"click","disabled"],["mat-stroked-button","","routerLink","/projects","aria-label","Manage projects","matTooltip","Manage projects"],[1,"btn-label"],["mat-flat-button","","aria-label","New task","matTooltip","New Task",1,"gtc-new-btn",3,"click"],[1,"gtc-filter-bar"],["aria-label","Filter by project",1,"gtc-project-filters"],["role","tablist","aria-label","Filter by status",1,"gtc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"gtc-body"],[1,"gtc-content"],[1,"gtc-loading"],[1,"gtc-empty"],[1,"gtc-grid"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],[1,"project-chip",3,"click"],[1,"chip-count"],[1,"project-chip",3,"active"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","36"],[1,"empty-icon"],[1,"gtc-group"],[1,"gtc-group-title"],[1,"group-icon"],[1,"group-count"],[3,"task","projectNameOverride","showProject","previewMode","is-previewed"],[3,"stopRequested","deleteRequested","starToggled","closeTaskRequested","markDoneRequested","markActiveRequested","previewRequested","task","projectNameOverride","showProject","previewMode"],["matTooltip","Drag to resize","aria-hidden","true",1,"gtc-resizer",3,"mousedown"],[1,"gtc-preview-pane"],[1,"gtc-preview-header"],[1,"gtc-preview-title"],[1,"gtc-preview-actions"],["matTooltip","Open full view","aria-label","Open thread in full view","type","button",1,"preview-action-btn",3,"click"],["matTooltip","Close panel","aria-label","Close preview panel","type","button",1,"preview-action-btn",3,"click"],[1,"gtc-preview-body","thread-preview-host"],[3,"projectName","threadId"]],template:function(e,n){if(e&1&&(o(0,"div",3,0)(2,"header",4)(3,"div",5)(4,"mat-icon",6),s(5,"hub"),r(),o(6,"h1",7),s(7,"Global Task Control"),r()(),o(8,"mat-form-field",8)(9,"mat-icon",9),s(10,"search"),r(),o(11,"input",10),m("input",function(l){return n.onSearchInput(l)})("keydown.escape",function(){return n.clearSearch()}),r(),v(12,hn,3,0,"button",11),r(),o(13,"div",12)(14,"button",13)(15,"mat-icon"),s(16,"schedule"),r()(),o(17,"mat-menu",null,1)(19,"button",14),m("click",function(){return n.openGlobalSchedulersDialog()}),o(20,"mat-icon"),s(21,"list"),r(),o(22,"span"),s(23,"View schedulers"),r()(),o(24,"button",14),m("click",function(){return n.openQuickSchedulerDialog()}),o(25,"mat-icon"),s(26,"add"),r(),o(27,"span"),s(28,"New scheduler"),r()()(),o(29,"button",15)(30,"mat-icon"),s(31,"hub"),r()(),o(32,"mat-menu",null,2)(34,"button",14),m("click",function(){return n.openPreferences()}),o(35,"mat-icon"),s(36,"tune"),r(),o(37,"span"),s(38,"Preferences"),r()(),o(39,"button",14),m("click",function(){return n.openTokenUsage()}),o(40,"mat-icon"),s(41,"data_usage"),r(),o(42,"span"),s(43,"Token Usage"),r()(),o(44,"button",14),m("click",function(){return n.openUserConfig()}),o(45,"mat-icon"),s(46,"manage_accounts"),r(),o(47,"span"),s(48,"User Configuration"),r()(),T(49,"mat-divider"),o(50,"a",16)(51,"mat-icon"),s(52,"code"),r(),o(53,"span"),s(54,"Contribute on GitHub"),r()()(),o(55,"button",17),m("click",function(){return n.refresh()}),o(56,"mat-icon"),s(57,"refresh"),r()(),o(58,"button",18)(59,"mat-icon"),s(60,"settings"),r(),o(61,"span",19),s(62,"Manage projects"),r()(),o(63,"button",20),m("click",function(){return n.openNewTaskDialog()}),o(64,"mat-icon"),s(65,"rocket_launch"),r(),o(66,"span",19),s(67,"New Task"),r()()()(),o(68,"div",21),v(69,fn,7,3,"nav",22),o(70,"nav",23),y(71,vn,6,6,"button",24,mn),o(73,"button",25),m("click",function(){return n.toggleStarredFilter()}),o(74,"mat-icon",26),s(75,"star"),r(),o(76,"span"),s(77,"Starred"),r()()()(),o(78,"div",27)(79,"main",28),v(80,Cn,4,0,"div",29)(81,xn,5,0,"div",30)(82,Mn,2,0)(83,Tn,3,0,"div",31),r(),v(84,wn,14,5),r()()),e&2){let i=w(18),l=w(33);c(11),_("value",n.searchQuery()),c(),C(n.searchQuery()?12:-1),c(2),_("matMenuTriggerFor",i),c(15),_("matMenuTriggerFor",l),c(26),_("disabled",n.isLoading()),c(14),C(n.projectSummaries().length>1?69:-1),c(2),M(n.filters),c(2),S("active",n.starredOnly()),ke("aria-checked",n.starredOnly()),c(7),C(n.isLoading()?80:n.displayedTasks().length===0?81:n.activeFilter()==="all"&&!n.searchQuery()?82:83),c(4),C(n.previewActive()&&n.previewThreadId()&&n.previewProjectId()?84:-1)}},dependencies:[pt,bt,A,N,E,O,re,se,le,V,I,Ke,Xe,He,Je,Ze,Ye,J,X,et,H,Z,Y,$e],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}.gtc[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden}.gtc-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:0 .75rem;height:56px;flex-shrink:0;border-bottom:1px solid var(--color-border, rgba(0, 0, 0, .1));box-sizing:border-box}.gtc-toolbar-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.gtc-logo-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem;color:var(--color-primary)}.gtc-title[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600;color:var(--color-text);white-space:nowrap}.gtc-search[_ngcontent-%COMP%]{margin-left:auto;flex:0 1 240px;min-width:80px;--mat-form-field-container-height: 36px;--mat-form-field-container-vertical-padding: 6px;font-size:.875rem;--mdc-filled-text-field-container-color: transparent;--mdc-filled-text-field-hover-container-color: transparent;--mdc-filled-text-field-focus-container-color: transparent;--mdc-filled-text-field-active-indicator-color: transparent;--mdc-filled-text-field-hover-active-indicator-color: transparent;--mdc-filled-text-field-focus-active-indicator-color: transparent;--mdc-filled-text-field-active-indicator-height: 0}.gtc-toolbar-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.gtc-new-btn[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;height:36px;padding:0 1rem}.gtc-new-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}@media(max-width:600px){.gtc-toolbar[_ngcontent-%COMP%]{flex-wrap:wrap;height:auto;min-height:48px;padding:.5rem .75rem;gap:.375rem}.gtc-title[_ngcontent-%COMP%]{font-size:.875rem}.gtc-search[_ngcontent-%COMP%]{order:3;flex:1 1 100%;min-width:0;margin-left:0}.gtc-toolbar-actions[_ngcontent-%COMP%]{margin-left:auto}.btn-label[_ngcontent-%COMP%]{display:none}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]){--mdc-text-button-container-height: 36px;--mdc-filled-button-container-height: 36px;--mdc-outlined-button-container-height: 36px;min-width:36px;width:36px;height:36px;padding:0;border-radius:50%!important}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]) .mat-mdc-button-touch-target[_ngcontent-%COMP%]{width:36px;height:36px}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]) mat-icon[_ngcontent-%COMP%]{margin:0!important}}.gtc-filter-bar[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem;padding:.5rem .75rem;flex-shrink:0;border-bottom:1px solid var(--color-border, rgba(0, 0, 0, .08))}.gtc-project-filters[_ngcontent-%COMP%]{display:flex;gap:.375rem;flex-wrap:wrap}.project-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;padding:.2rem .65rem;border-radius:100px;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:transparent;border:1px solid var(--color-border);cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.project-chip[_ngcontent-%COMP%] .chip-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .3rem;font-size:.68rem;font-weight:700;min-width:16px;text-align:center;line-height:16px}.project-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.project-chip.active[_ngcontent-%COMP%] .chip-count[_ngcontent-%COMP%]{background:#ffffff40;color:var(--color-text-inverse)}.project-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.gtc-filters[_ngcontent-%COMP%]{display:flex;gap:.375rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.3rem .75rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff40;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.gtc-body[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1;overflow:hidden;min-height:0}.gtc-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:1rem 1rem 2rem;min-width:0}.gtc-resizer[_ngcontent-%COMP%]{width:6px;flex-shrink:0;cursor:col-resize;background:transparent;border-left:1px solid var(--color-border);border-right:1px solid var(--color-border);transition:background .15s ease}.gtc-resizer[_ngcontent-%COMP%]:hover, .gtc-resizer[_ngcontent-%COMP%]:active{background:var(--color-primary);opacity:.4}.gtc-preview-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;flex-shrink:0;min-width:280px;border-left:1px solid var(--color-border);background:var(--glass-bg)}.gtc-preview-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.625rem .75rem .625rem 1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.gtc-preview-title[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.gtc-preview-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.125rem;flex-shrink:0}.preview-action-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease}.preview-action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;line-height:18px;vertical-align:middle;color:var(--color-text-secondary)}.preview-action-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.preview-action-btn[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-text)}.gtc-preview-body[_ngcontent-%COMP%]{flex:1;overflow:hidden;display:flex;flex-direction:column;min-height:0}.gtc-preview-body[_ngcontent-%COMP%] app-thread[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;min-height:0} app-task-card.is-previewed .task-card{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary)}.gtc-group[_ngcontent-%COMP%]{margin-bottom:1.25rem}.gtc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.gtc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.gtc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:.95rem;width:.95rem;height:.95rem}.gtc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:16px;text-align:center;line-height:16px}.gtc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem}@media(max-width:600px){.gtc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.gtc-loading[_ngcontent-%COMP%], .gtc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;padding:3rem;color:var(--color-text-secondary);text-align:center}.gtc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .gtc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.9rem}.empty-icon[_ngcontent-%COMP%]{font-size:2.5rem;width:2.5rem;height:2.5rem;opacity:.3}"],changeDetection:0})};export{St as GlobalTaskControlComponent};
@@ -31,5 +31,5 @@
31
31
  <style>:root{--color-bg:#f5f6f8;--color-bg-solid:#f5f6f8;--color-bg-secondary:rgba(255, 255, 255, .7);--color-bg-secondary-rgb:255 255 255;--color-text:#1d1d1f;--color-text-secondary:#6e6e73;--color-text-inverse:#ffffff;--color-text-tertiary:#a1a1a6;--color-primary:#007aff;--color-primary-hover:#0051d5;--color-accent:#8b5cf6;--color-link:#007aff;--color-border:rgba(0, 0, 0, .1);--color-border-light:rgba(40, 40, 40, .08);--color-input-bg:rgba(255, 255, 255, .8);--color-bg-hover:rgba(0, 0, 0, .04);--color-success:#34c759;--color-success-bg:#e3f5e1;--color-error:#ff3b30;--color-warning:#ff9500;--color-info:#5ac8fa;--color-message-user:rgba(0, 122, 255, .1);--color-message-ai:rgba(255, 255, 255, .8);--color-code-bg:rgba(142, 142, 147, .12);--color-code-text:#ff375f;--glass-bg:rgba(255, 255, 255, .72);--glass-border:rgba(255, 255, 255, .18);--glass-shadow:0 8px 32px 0 rgba(31, 38, 135, .15);--glass-backdrop-blur:blur(20px);--color-modal-bg:#ffffff;--color-surface:#ffffff;--color-modal-border:rgba(0, 0, 0, .12);--color-modal-shadow:0 8px 40px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .1);--color-shadow:rgba(0, 0, 0, .08);--color-overlay:rgba(0, 0, 0, .4);--color-surface-hover:var(--color-bg-hover);--color-surface-secondary:rgba(0, 0, 0, .03);--color-surface-muted:rgba(0, 0, 0, .05);--color-divider:rgba(0, 0, 0, .1)}@media print{html,body,app-root{height:auto!important;max-height:none!important;min-height:auto!important;overflow:visible!important;position:static!important}body{background:#fff!important;color:#000!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif!important;font-size:11pt;line-height:1.6;padding:1rem!important}*{animation:none!important;transition:none!important;box-shadow:none!important;text-shadow:none!important}}*{box-sizing:border-box}html{color-scheme:light}html{--mat-sys-background:light-dark(#faf9fd, #121316);--mat-sys-error:light-dark(#ba1a1a, #ffb4ab);--mat-sys-error-container:light-dark(#ffdad6, #93000a);--mat-sys-inverse-on-surface:light-dark(#f2f0f4, #2f3033);--mat-sys-inverse-primary:light-dark(#abc7ff, #005cbb);--mat-sys-inverse-surface:light-dark(#2f3033, #e3e2e6);--mat-sys-on-background:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-error:light-dark(#ffffff, #690005);--mat-sys-on-error-container:light-dark(#93000a, #ffdad6);--mat-sys-on-primary:light-dark(#ffffff, #002f65);--mat-sys-on-primary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-primary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-primary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-on-secondary:light-dark(#ffffff, #283041);--mat-sys-on-secondary-container:light-dark(#3e4759, #dae2f9);--mat-sys-on-secondary-fixed:light-dark(#131c2b, #131c2b);--mat-sys-on-secondary-fixed-variant:light-dark(#3e4759, #3e4759);--mat-sys-on-surface:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-surface-variant:light-dark(#44474e, #e0e2ec);--mat-sys-on-tertiary:light-dark(#ffffff, #002f65);--mat-sys-on-tertiary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-tertiary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-tertiary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-outline:light-dark(#74777f, #8e9099);--mat-sys-outline-variant:light-dark(#c4c6d0, #44474e);--mat-sys-primary:light-dark(#005cbb, #abc7ff);--mat-sys-primary-container:light-dark(#d7e3ff, #00458f);--mat-sys-primary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-primary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-scrim:light-dark(#000000, #000000);--mat-sys-secondary:light-dark(#565e71, #bec6dc);--mat-sys-secondary-container:light-dark(#dae2f9, #3e4759);--mat-sys-secondary-fixed:light-dark(#dae2f9, #dae2f9);--mat-sys-secondary-fixed-dim:light-dark(#bec6dc, #bec6dc);--mat-sys-shadow:light-dark(#000000, #000000);--mat-sys-surface:light-dark(#faf9fd, #121316);--mat-sys-surface-bright:light-dark(#faf9fd, #38393c);--mat-sys-surface-container:light-dark(#efedf0, #1f2022);--mat-sys-surface-container-high:light-dark(#e9e7eb, #292a2c);--mat-sys-surface-container-highest:light-dark(#e3e2e6, #343537);--mat-sys-surface-container-low:light-dark(#f4f3f6, #1a1b1f);--mat-sys-surface-container-lowest:light-dark(#ffffff, #0d0e11);--mat-sys-surface-dim:light-dark(#dbd9dd, #121316);--mat-sys-surface-tint:light-dark(#005cbb, #abc7ff);--mat-sys-surface-variant:light-dark(#e0e2ec, #44474e);--mat-sys-tertiary:light-dark(#005cbb, #abc7ff);--mat-sys-tertiary-container:light-dark(#d7e3ff, #00458f);--mat-sys-tertiary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-tertiary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-neutral-variant20:#2d3038;--mat-sys-neutral10:#1a1b1f;--mat-sys-level0:0px 0px 0px 0px rgba(0, 0, 0, .2), 0px 0px 0px 0px rgba(0, 0, 0, .14), 0px 0px 0px 0px rgba(0, 0, 0, .12);--mat-sys-level1:0px 2px 1px -1px rgba(0, 0, 0, .2), 0px 1px 1px 0px rgba(0, 0, 0, .14), 0px 1px 3px 0px rgba(0, 0, 0, .12);--mat-sys-level2:0px 3px 3px -2px rgba(0, 0, 0, .2), 0px 3px 4px 0px rgba(0, 0, 0, .14), 0px 1px 8px 0px rgba(0, 0, 0, .12);--mat-sys-level3:0px 3px 5px -1px rgba(0, 0, 0, .2), 0px 6px 10px 0px rgba(0, 0, 0, .14), 0px 1px 18px 0px rgba(0, 0, 0, .12);--mat-sys-level4:0px 5px 5px -3px rgba(0, 0, 0, .2), 0px 8px 10px 1px rgba(0, 0, 0, .14), 0px 3px 14px 2px rgba(0, 0, 0, .12);--mat-sys-level5:0px 7px 8px -4px rgba(0, 0, 0, .2), 0px 12px 17px 2px rgba(0, 0, 0, .14), 0px 5px 22px 4px rgba(0, 0, 0, .12);--mat-sys-body-large:400 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-line-height:1.5rem;--mat-sys-body-large-size:1rem;--mat-sys-body-large-tracking:.031rem;--mat-sys-body-large-weight:400;--mat-sys-body-medium:400 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-line-height:1.25rem;--mat-sys-body-medium-size:.875rem;--mat-sys-body-medium-tracking:.016rem;--mat-sys-body-medium-weight:400;--mat-sys-body-small:400 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-line-height:1rem;--mat-sys-body-small-size:.75rem;--mat-sys-body-small-tracking:.025rem;--mat-sys-body-small-weight:400;--mat-sys-display-large:400 3.562rem / 4rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-line-height:4rem;--mat-sys-display-large-size:3.562rem;--mat-sys-display-large-tracking:-.016rem;--mat-sys-display-large-weight:400;--mat-sys-display-medium:400 2.812rem / 3.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-line-height:3.25rem;--mat-sys-display-medium-size:2.812rem;--mat-sys-display-medium-tracking:0;--mat-sys-display-medium-weight:400;--mat-sys-display-small:400 2.25rem / 2.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-line-height:2.75rem;--mat-sys-display-small-size:2.25rem;--mat-sys-display-small-tracking:0;--mat-sys-display-small-weight:400;--mat-sys-headline-large:400 2rem / 2.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-line-height:2.5rem;--mat-sys-headline-large-size:2rem;--mat-sys-headline-large-tracking:0;--mat-sys-headline-large-weight:400;--mat-sys-headline-medium:400 1.75rem / 2.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-line-height:2.25rem;--mat-sys-headline-medium-size:1.75rem;--mat-sys-headline-medium-tracking:0;--mat-sys-headline-medium-weight:400;--mat-sys-headline-small:400 1.5rem / 2rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-line-height:2rem;--mat-sys-headline-small-size:1.5rem;--mat-sys-headline-small-tracking:0;--mat-sys-headline-small-weight:400;--mat-sys-label-large:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-line-height:1.25rem;--mat-sys-label-large-size:.875rem;--mat-sys-label-large-tracking:.006rem;--mat-sys-label-large-weight:500;--mat-sys-label-large-weight-prominent:700;--mat-sys-label-medium:500 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-line-height:1rem;--mat-sys-label-medium-size:.75rem;--mat-sys-label-medium-tracking:.031rem;--mat-sys-label-medium-weight:500;--mat-sys-label-medium-weight-prominent:700;--mat-sys-label-small:500 .688rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-line-height:1rem;--mat-sys-label-small-size:.688rem;--mat-sys-label-small-tracking:.031rem;--mat-sys-label-small-weight:500;--mat-sys-title-large:400 1.375rem / 1.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-line-height:1.75rem;--mat-sys-title-large-size:1.375rem;--mat-sys-title-large-tracking:0;--mat-sys-title-large-weight:400;--mat-sys-title-medium:500 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-line-height:1.5rem;--mat-sys-title-medium-size:1rem;--mat-sys-title-medium-tracking:.009rem;--mat-sys-title-medium-weight:500;--mat-sys-title-small:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-line-height:1.25rem;--mat-sys-title-small-size:.875rem;--mat-sys-title-small-tracking:.006rem;--mat-sys-title-small-weight:500;--mat-sys-corner-extra-large:28px;--mat-sys-corner-extra-large-top:28px 28px 0 0;--mat-sys-corner-extra-small:4px;--mat-sys-corner-extra-small-top:4px 4px 0 0;--mat-sys-corner-full:9999px;--mat-sys-corner-large:16px;--mat-sys-corner-large-end:0 16px 16px 0;--mat-sys-corner-large-start:16px 0 0 16px;--mat-sys-corner-large-top:16px 16px 0 0;--mat-sys-corner-medium:12px;--mat-sys-corner-none:0;--mat-sys-corner-small:8px;--mat-sys-dragged-state-layer-opacity:.16;--mat-sys-focus-state-layer-opacity:.12;--mat-sys-hover-state-layer-opacity:.08;--mat-sys-pressed-state-layer-opacity:.12;--mat-snack-bar-container-shape:transparent;--mat-snack-bar-container-color:transparent;--mat-snack-bar-supporting-text-color:var(--color-text)}html,body{margin:0;padding:0;width:100%;height:100%}body{background:var(--color-bg);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,Segoe UI,Helvetica Neue,Arial,sans-serif;transition:background .3s ease,color .3s ease;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;padding:0!important}</style><link rel="stylesheet" href="styles-HDA2O7OH.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-HDA2O7OH.css"></noscript></head>
32
32
  <body>
33
33
  <app-root></app-root>
34
- <link rel="modulepreload" href="chunk-BLRBIAYK.js"><link rel="modulepreload" href="chunk-QVW2GZXC.js"><link rel="modulepreload" href="chunk-N6D7DELC.js"><link rel="modulepreload" href="chunk-ZCELWKMZ.js"><link rel="modulepreload" href="chunk-YJOXSEUO.js"><link rel="modulepreload" href="chunk-6XX7GME4.js"><link rel="modulepreload" href="chunk-2PWIGCN2.js"><link rel="modulepreload" href="chunk-BTOJ27OO.js"><link rel="modulepreload" href="chunk-SPV5SLNS.js"><link rel="modulepreload" href="chunk-VMYKE4ZC.js"><script src="polyfills-2FSRUXKO.js" type="module"></script><script src="main-44QZIU3R.js" type="module"></script></body>
34
+ <link rel="modulepreload" href="chunk-BLRBIAYK.js"><link rel="modulepreload" href="chunk-QVW2GZXC.js"><link rel="modulepreload" href="chunk-DZ2M3NQD.js"><link rel="modulepreload" href="chunk-CRXIMHRG.js"><link rel="modulepreload" href="chunk-YJOXSEUO.js"><link rel="modulepreload" href="chunk-6XX7GME4.js"><link rel="modulepreload" href="chunk-2PWIGCN2.js"><link rel="modulepreload" href="chunk-BTOJ27OO.js"><link rel="modulepreload" href="chunk-SPV5SLNS.js"><link rel="modulepreload" href="chunk-VMYKE4ZC.js"><script src="polyfills-2FSRUXKO.js" type="module"></script><script src="main-YKFAFCDV.js" type="module"></script></body>
35
35
  </html>