@whoz-oss/coday-client 0.211.1 → 0.213.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-CX7XKBK2.js → chunk-24GQIJ2V.js} +1 -1
- package/browser/chunk-2BN4B3OL.js +1 -0
- package/browser/{chunk-2DY4SDDH.js → chunk-2HEJ7K6I.js} +1 -1
- package/browser/{chunk-BFHBI6M4.js → chunk-2PNAJMT3.js} +1 -1
- package/browser/{chunk-S7353OXG.js → chunk-34BTCCLM.js} +1 -1
- package/browser/{chunk-PG25CCE5.js → chunk-3F2YMBKP.js} +1 -1
- package/browser/{chunk-LRFTCV6X.js → chunk-3FFHE56W.js} +1 -1
- package/browser/{chunk-2D4GFLRK.js → chunk-4CDCFIEK.js} +1 -1
- package/browser/{chunk-SQCTA46L.js → chunk-4OCEBSTP.js} +1 -1
- package/browser/{chunk-SDPYXC6U.js → chunk-4TH4ERQY.js} +1 -1
- package/browser/{chunk-UMIKI5LE.js → chunk-5GF6TTRK.js} +1 -1
- package/browser/chunk-5NLXR4MK.js +5 -0
- package/browser/{chunk-TD5QFOMN.js → chunk-66JGZWOM.js} +1 -1
- package/browser/{chunk-SJFPTVIP.js → chunk-6MPSH5Y7.js} +1 -1
- package/browser/{chunk-Q4QETBSU.js → chunk-7EHCV7WH.js} +1 -1
- package/browser/{chunk-MR7WYSXF.js → chunk-7FKWFZ3A.js} +1 -1
- package/browser/chunk-7FTSWXXP.js +1 -0
- package/browser/{chunk-U4IRQFQX.js → chunk-7RVP2EHC.js} +1 -1
- package/browser/{chunk-3KLIHIYI.js → chunk-A34IERCN.js} +1 -1
- package/browser/{chunk-76J57JUY.js → chunk-BJM7MKOH.js} +1 -1
- package/browser/{chunk-QN7OUZIZ.js → chunk-BZ7URUNM.js} +1 -1
- package/browser/{chunk-EIJAV76W.js → chunk-BZS55WHS.js} +1 -1
- package/browser/{chunk-TGWQ4PGG.js → chunk-C2XSJPYF.js} +1 -1
- package/browser/{chunk-UDIJZYRI.js → chunk-C3TALDAV.js} +1 -1
- package/browser/{chunk-4MF2HW3L.js → chunk-C47ZCNLR.js} +1 -1
- package/browser/{chunk-46WOQYAR.js → chunk-CA4E6QDU.js} +1 -1
- package/browser/{chunk-4SGDH2OK.js → chunk-CRJUN7EB.js} +1 -1
- package/browser/{chunk-B4FX32QR.js → chunk-DB2U5ZVV.js} +1 -1
- package/browser/{chunk-QNFNT462.js → chunk-DEXRATBM.js} +1 -1
- package/browser/{chunk-NXKPUZGQ.js → chunk-EBAEYY2S.js} +1 -1
- package/browser/{chunk-M7CBEYMD.js → chunk-EFCBXNFU.js} +1 -1
- package/browser/{chunk-2S57CBYZ.js → chunk-EFCODPLG.js} +1 -1
- package/browser/chunk-F4BSKSY7.js +1 -0
- package/browser/{chunk-VSCZ2PDC.js → chunk-GCJZKHAW.js} +1 -1
- package/browser/chunk-GDWZ2TMN.js +1 -0
- package/browser/{chunk-HTKDXFLE.js → chunk-GF3EMWCA.js} +1 -1
- package/browser/{chunk-MAHIDPCP.js → chunk-GPZP3WYQ.js} +1 -1
- package/browser/{chunk-Y32N3VH4.js → chunk-GVYMNRD4.js} +1 -1
- package/browser/{chunk-QX3PREUS.js → chunk-HMFEXHRI.js} +1 -1
- package/browser/{chunk-5V6YWKKW.js → chunk-IDD4RLL7.js} +1 -1
- package/browser/{chunk-F5MVOI67.js → chunk-IRW4FVEN.js} +1 -1
- package/browser/{chunk-63CH53ZX.js → chunk-J5W3AZMJ.js} +1 -1
- package/browser/{chunk-MXVXTRUI.js → chunk-J7IFGV56.js} +1 -1
- package/browser/{chunk-6PK5FNSW.js → chunk-JCMCMBHO.js} +1 -1
- package/browser/{chunk-CGTCICKZ.js → chunk-JIPJ76UT.js} +1 -1
- package/browser/chunk-K7JRH3HO.js +6 -0
- package/browser/{chunk-SECZWZIB.js → chunk-KD3BJ52V.js} +1 -1
- package/browser/{chunk-X5QAL64P.js → chunk-KP4KMDLX.js} +1 -1
- package/browser/{chunk-MLKV56MK.js → chunk-KQVQSY4A.js} +1 -1
- package/browser/{chunk-RYCGZWL2.js → chunk-KWBMAZB4.js} +1 -1
- package/browser/{chunk-SOHEYVJF.js → chunk-LCLP27IJ.js} +1 -1
- package/browser/{chunk-FM5EGDVD.js → chunk-LN55MSDV.js} +1 -1
- package/browser/chunk-MSMRBM6R.js +1 -0
- package/browser/{chunk-5WOINLAX.js → chunk-MVRV42NP.js} +1 -1
- package/browser/{chunk-2RE6V43M.js → chunk-N5FLB2OL.js} +1 -1
- package/browser/{chunk-WE6G6IT3.js → chunk-NAHXPRXR.js} +1 -1
- package/browser/{chunk-IAIUV3RV.js → chunk-NCFBQG5D.js} +1 -1
- package/browser/chunk-NHXL5GKK.js +1 -0
- package/browser/chunk-O37JOBGG.js +1 -0
- package/browser/chunk-ONZHMPPP.js +1 -0
- package/browser/{chunk-NNVKL253.js → chunk-OPSHMM4H.js} +1 -1
- package/browser/{chunk-FNFYAJMS.js → chunk-OVCLHAFH.js} +1 -1
- package/browser/{chunk-KCCB2UUO.js → chunk-OWSH6KVW.js} +1 -1
- package/browser/{chunk-32554AB2.js → chunk-P4GNUQZT.js} +1 -1
- package/browser/{chunk-KQBJFLLL.js → chunk-P6FB27NC.js} +1 -1
- package/browser/{chunk-AR4TQRY3.js → chunk-QCDV42EK.js} +1 -1
- package/browser/{chunk-HCFETNQ6.js → chunk-QCUONBHJ.js} +1 -1
- package/browser/chunk-RTAXT4D4.js +1 -0
- package/browser/{chunk-JZJSONXG.js → chunk-RXRBDGVY.js} +1 -1
- package/browser/chunk-SDINNYUR.js +1 -0
- package/browser/{chunk-BVQ4XPRS.js → chunk-SKBT6DBT.js} +1 -1
- package/browser/{chunk-RAN3AUJQ.js → chunk-SO6H32XQ.js} +1 -1
- package/browser/{chunk-CFLI2OWG.js → chunk-TASI5WPN.js} +1 -1
- package/browser/{chunk-JBAFVFZR.js → chunk-TEJQAOQQ.js} +1 -1
- package/browser/{chunk-RULUSI5M.js → chunk-TUARXNRR.js} +1 -1
- package/browser/{chunk-CK52GCRW.js → chunk-U5L2OULZ.js} +1 -1
- package/browser/{chunk-WBQOEBH7.js → chunk-UDEMKCGK.js} +1 -1
- package/browser/chunk-UFZICL7S.js +1 -0
- package/browser/{chunk-JLMNYKPP.js → chunk-V3HCXJKS.js} +1 -1
- package/browser/{chunk-E5MHC5FO.js → chunk-V7NUXN3R.js} +1 -1
- package/browser/chunk-VPYY4J2W.js +1 -0
- package/browser/{chunk-Y2UH6C4J.js → chunk-W7YYBRGC.js} +1 -1
- package/browser/{chunk-5TU5JR3W.js → chunk-W7ZS65Y4.js} +1 -1
- package/browser/{chunk-CHH2YNB6.js → chunk-WIYSZEOD.js} +1 -1
- package/browser/{chunk-WFACDK2M.js → chunk-XC3I4AWV.js} +1 -1
- package/browser/{chunk-AUQEDCYM.js → chunk-XEZKOM4R.js} +1 -1
- package/browser/{chunk-7VQ75OC6.js → chunk-Z6RFJ6L3.js} +1 -1
- package/browser/{chunk-S7FMQPO3.js → chunk-ZE2KJJWW.js} +1 -1
- package/browser/{chunk-TT7A5DFQ.js → chunk-ZPHUI4F6.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-FRF4H6OA.js → main-JYYTUNUG.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-26Y7QHUX.js +0 -6
- package/browser/chunk-2AZPKCT2.js +0 -1
- package/browser/chunk-7BVQ2WHQ.js +0 -1
- package/browser/chunk-BFRQNDIH.js +0 -1
- package/browser/chunk-GFBKFSKL.js +0 -1
- package/browser/chunk-JVDPRI2N.js +0 -1
- package/browser/chunk-M3ZPITZW.js +0 -1
- package/browser/chunk-OGRY5XOW.js +0 -1
- package/browser/chunk-QDO3O2UB.js +0 -5
- package/browser/chunk-QP5FMZO7.js +0 -1
- package/browser/chunk-RMX22TIL.js +0 -1
- package/browser/chunk-SQWYD6HJ.js +0 -1
- package/browser/chunk-XKH66LUP.js +0 -1
- package/browser/chunk-ZX7BSCA5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./chunk-76J57JUY.js";import{c as S,d as _,f as u,g as C}from"./chunk-QVW2GZXC.js";import{a as q,b as U,c as Y,d as Q}from"./chunk-SQCTA46L.js";import"./chunk-KCCB2UUO.js";import{e as I}from"./chunk-S7353OXG.js";import"./chunk-CHH2YNB6.js";import"./chunk-SDPYXC6U.js";import{a as L,d as b}from"./chunk-WE6G6IT3.js";import"./chunk-46WOQYAR.js";import"./chunk-AR4TQRY3.js";import{a as $,c as H}from"./chunk-32554AB2.js";import"./chunk-EIJAV76W.js";import"./chunk-E5MHC5FO.js";import"./chunk-SECZWZIB.js";import"./chunk-WBQOEBH7.js";import"./chunk-26Y7QHUX.js";import"./chunk-NXKPUZGQ.js";import"./chunk-TGWQ4PGG.js";import"./chunk-QN7OUZIZ.js";import"./chunk-BVQ4XPRS.js";import"./chunk-HTKDXFLE.js";import"./chunk-7VQ75OC6.js";import"./chunk-FM5EGDVD.js";import"./chunk-NNVKL253.js";import{B as x,Bb as M,Db as y,Fb as s,Jb as W,Ka as m,Kb as O,Lb as P,N as A,T as p,Tb as G,Ub as z,Wa as v,Z as F,ca as a,d as k,ga as c,h as f,ha as d,lb as V,mb as j,rb as w,sb as h,tb as g,ub as R,vb as D,wb as B}from"./chunk-QDO3O2UB.js";var T=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation()}ngOnDestroy(){this.stopWelcomeRotation()}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex]},3e3)}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0)}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(t,i){t&1&&(D(0,"h1",0),G(1),B()),t&2&&(m(),z(i.currentWelcomeMessage))},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:block;min-height:1.2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"]})};var N=class o{destroy$=new f;isSetup=!1;codayService=a(I);preferencesService=a(b);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(p(this.destroy$),A(),x(([e,t])=>e===!0&&t===!1)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled()}),this.preferencesService.browserNotificationEnabled$.pipe(p(this.destroy$),A(),x(([e,t])=>e===!1&&t===!0)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled()}),this.isSetup=!0}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification())}playCompletionSound(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),i=e.createGain();t.connect(i),i.connect(e.destination),t.frequency.setValueAtTime(700,e.currentTime),i.gain.setValueAtTime(.1,e.currentTime),i.gain.exponentialRampToValueAtTime(.01,e.currentTime+.08),t.start(e.currentTime),t.stop(e.currentTime+.08);let n=e.createOscillator(),r=e.createGain();n.connect(r),r.connect(e.destination);let l=e.currentTime+.11;n.frequency.setValueAtTime(950,l),r.gain.setValueAtTime(.1,l),r.gain.exponentialRampToValueAtTime(.01,l+.09),n.start(l),n.stop(l+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(e){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",e)}}handleBrowserNotificationEnabled(){return k(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1))}catch(e){console.error("[AGENT-NOTIFICATION] Error requesting permission:",e),this.preferencesService.setBrowserNotificationEnabled(!1)}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification")}createConfirmationNotification(){let e=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:!1});setTimeout(()=>e.close(),4e3),e.onclick=()=>{window.focus(),e.close()},console.log("[AGENT-NOTIFICATION] Confirmation notification sent")}createTaskCompleteNotification(){let e=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:!1});setTimeout(()=>e.close(),5e3),e.onclick=()=>{window.focus(),e.close()},console.log("[AGENT-NOTIFICATION] Task complete notification sent")}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||o)};static \u0275prov=F({token:o,factory:o.\u0275fac,providedIn:"root"})};var Z=["inputSection"];function ee(o,e){if(o&1){let t=M();h(0,"app-thread",4),y("chatFocused",function(){c(t);let n=s();return d(n.onChatFocusedOnMobile())})("drawerStateChange",function(n){c(t);let r=s();return d(r.onDrawerStateChange(n))}),g()}if(o&2){let t=s();w("projectName",t.projectName)("threadId",t.threadId)}}function te(o,e){if(o&1){let t=M();h(0,"div",5),R(1,"app-welcome-message"),g(),h(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),y("messageSubmitted",function(n){c(t);let r=s();return d(r.onMessageSubmitted(n))})("voiceMessageReady",function(n){c(t);let r=s();return d(r.onVoiceMessageReady(n))})("voiceRecordingToggled",function(n){c(t);let r=s();return d(r.onVoiceToggled(n))})("heightChanged",function(n){c(t);let r=s();return d(r.onInputHeightChanged(n))})("textareaFocused",function(){c(t);let n=s();return d(n.onChatFocusedOnMobile())}),g()()()()}if(o&2){let t=s();m(6),w("isDisabled",t.isSessionInitializing)("isSessionInitializing",t.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",t.isStartingFirstMessage)}}var K=class o{destroy$=new f;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=a(I);titleService=a(U);preferencesService=a(b);route=a($);router=a(H);threadApiService=a(L);agentNotificationService=a(N);firstMessageState=a(Y);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)")}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(p(this.destroy$)).subscribe(e=>{let t=e.projectName,i=e.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:t,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=t,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView())})}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService)}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(e){console.log("[MAIN-APP] First message submitted from welcome view:",e),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created:",t.thread.id),this.firstMessageState.setPendingFirstMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id])},error:t=>{console.error("[MAIN-APP] Failed to create thread:",t),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(t.message||"Unknown error"))}})}onVoiceToggled(e){console.log("[VOICE] Recording in welcome view:",e)}onVoiceMessageReady(e){console.log("[MAIN-APP] Voice message ready from welcome view"),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created for voice message:",t.thread.id),this.firstMessageState.setPendingVoiceMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id])},error:t=>{console.error("[MAIN-APP] Failed to create thread for voice message:",t),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(t.message||"Unknown error"))}})}isDrawerOpen=!1;onDrawerStateChange(e){this.isDrawerOpen=e}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close()}onInputHeightChanged(e){console.log("[MAIN-APP] Input height changed:",e),this.inputSectionHeight=e}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let e=this.inputSection.nativeElement.offsetHeight;e!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",e),this.inputSectionHeight=e)}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let e=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",e),e?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["app-main"]],viewQuery:function(t,i){if(t&1&&W(Z,5)(E,5),t&2){let n;O(n=P())&&(i.inputSection=n.first),O(n=P())&&(i.sidenav=n.first)}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app",3,"mousedown","touchstart"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceMessageReady","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(t,i){t&1&&(h(0,"app-sidenav",1)(1,"div",2),y("mousedown",function(){return i.onChatFocusedOnMobile()})("touchstart",function(){return i.onChatFocusedOnMobile()}),V(2,ee,1,2,"app-thread",3)(3,te,7,5),g()()),t&2&&(w("drawerOpen",i.isDrawerOpen),m(2),j(i.threadId?2:3))},dependencies:[q,Q,T,E],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media(max-width:768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media(max-width:768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media(max-width:768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[S("slideIn",[C(":enter",[u({transform:"translateY(100%)",opacity:0}),_("300ms ease-out",u({transform:"translateY(0)",opacity:1}))]),C(":leave",[_("200ms ease-in",u({transform:"translateY(100%)",opacity:0}))])])]}})};export{K as MainAppComponent};
|
|
1
|
+
import{a as E}from"./chunk-BJM7MKOH.js";import{c as S,d as _,f as u,g as C}from"./chunk-QVW2GZXC.js";import{a as q,b as U,c as Y,d as Q}from"./chunk-4OCEBSTP.js";import"./chunk-OWSH6KVW.js";import{e as I}from"./chunk-34BTCCLM.js";import"./chunk-WIYSZEOD.js";import"./chunk-4TH4ERQY.js";import{a as L,d as b}from"./chunk-NAHXPRXR.js";import"./chunk-CA4E6QDU.js";import"./chunk-QCDV42EK.js";import{a as $,c as H}from"./chunk-P4GNUQZT.js";import"./chunk-BZS55WHS.js";import"./chunk-V7NUXN3R.js";import"./chunk-KD3BJ52V.js";import"./chunk-UDEMKCGK.js";import"./chunk-K7JRH3HO.js";import"./chunk-EBAEYY2S.js";import"./chunk-C2XSJPYF.js";import"./chunk-BZ7URUNM.js";import"./chunk-SKBT6DBT.js";import"./chunk-GF3EMWCA.js";import"./chunk-Z6RFJ6L3.js";import"./chunk-LN55MSDV.js";import"./chunk-OPSHMM4H.js";import{B as x,Bb as M,Db as y,Fb as s,Jb as W,Ka as m,Kb as O,Lb as P,N as A,T as p,Tb as G,Ub as z,Wa as v,Z as F,ca as a,d as k,ga as c,h as f,ha as d,lb as V,mb as j,rb as w,sb as h,tb as g,ub as R,vb as D,wb as B}from"./chunk-5NLXR4MK.js";var T=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation()}ngOnDestroy(){this.stopWelcomeRotation()}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex]},3e3)}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0)}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(t,i){t&1&&(D(0,"h1",0),G(1),B()),t&2&&(m(),z(i.currentWelcomeMessage))},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:block;min-height:1.2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"]})};var N=class o{destroy$=new f;isSetup=!1;codayService=a(I);preferencesService=a(b);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(p(this.destroy$),A(),x(([e,t])=>e===!0&&t===!1)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled()}),this.preferencesService.browserNotificationEnabled$.pipe(p(this.destroy$),A(),x(([e,t])=>e===!1&&t===!0)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled()}),this.isSetup=!0}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification())}playCompletionSound(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),i=e.createGain();t.connect(i),i.connect(e.destination),t.frequency.setValueAtTime(700,e.currentTime),i.gain.setValueAtTime(.1,e.currentTime),i.gain.exponentialRampToValueAtTime(.01,e.currentTime+.08),t.start(e.currentTime),t.stop(e.currentTime+.08);let n=e.createOscillator(),r=e.createGain();n.connect(r),r.connect(e.destination);let l=e.currentTime+.11;n.frequency.setValueAtTime(950,l),r.gain.setValueAtTime(.1,l),r.gain.exponentialRampToValueAtTime(.01,l+.09),n.start(l),n.stop(l+.09),console.log("[AGENT-NOTIFICATION] Completion sound played")}catch(e){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",e)}}handleBrowserNotificationEnabled(){return k(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(!1);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1))}catch(e){console.error("[AGENT-NOTIFICATION] Error requesting permission:",e),this.preferencesService.setBrowserNotificationEnabled(!1)}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification")}createConfirmationNotification(){let e=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:!1});setTimeout(()=>e.close(),4e3),e.onclick=()=>{window.focus(),e.close()},console.log("[AGENT-NOTIFICATION] Confirmation notification sent")}createTaskCompleteNotification(){let e=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:!1});setTimeout(()=>e.close(),5e3),e.onclick=()=>{window.focus(),e.close()},console.log("[AGENT-NOTIFICATION] Task complete notification sent")}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||o)};static \u0275prov=F({token:o,factory:o.\u0275fac,providedIn:"root"})};var Z=["inputSection"];function ee(o,e){if(o&1){let t=M();h(0,"app-thread",4),y("chatFocused",function(){c(t);let n=s();return d(n.onChatFocusedOnMobile())})("drawerStateChange",function(n){c(t);let r=s();return d(r.onDrawerStateChange(n))}),g()}if(o&2){let t=s();w("projectName",t.projectName)("threadId",t.threadId)}}function te(o,e){if(o&1){let t=M();h(0,"div",5),R(1,"app-welcome-message"),g(),h(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),y("messageSubmitted",function(n){c(t);let r=s();return d(r.onMessageSubmitted(n))})("voiceMessageReady",function(n){c(t);let r=s();return d(r.onVoiceMessageReady(n))})("voiceRecordingToggled",function(n){c(t);let r=s();return d(r.onVoiceToggled(n))})("heightChanged",function(n){c(t);let r=s();return d(r.onInputHeightChanged(n))})("textareaFocused",function(){c(t);let n=s();return d(n.onChatFocusedOnMobile())}),g()()()()}if(o&2){let t=s();m(6),w("isDisabled",t.isSessionInitializing)("isSessionInitializing",t.isSessionInitializing)("showWelcome",!0)("isThinking",!1)("isStarting",t.isStartingFirstMessage)}}var K=class o{destroy$=new f;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=!1;isStartingFirstMessage=!1;inputSectionHeight=80;codayService=a(I);titleService=a(U);preferencesService=a(b);route=a($);router=a(H);threadApiService=a(L);agentNotificationService=a(N);firstMessageState=a(Y);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)")}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(p(this.destroy$)).subscribe(e=>{let t=e.projectName,i=e.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:t,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=t,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView())})}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService)}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}onMessageSubmitted(e){console.log("[MAIN-APP] First message submitted from welcome view:",e),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created:",t.thread.id),this.firstMessageState.setPendingFirstMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id])},error:t=>{console.error("[MAIN-APP] Failed to create thread:",t),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(t.message||"Unknown error"))}})}onVoiceToggled(e){console.log("[VOICE] Recording in welcome view:",e)}onVoiceMessageReady(e){console.log("[MAIN-APP] Voice message ready from welcome view"),this.isSessionInitializing=!0,this.isStartingFirstMessage=!0,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created for voice message:",t.thread.id),this.firstMessageState.setPendingVoiceMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id])},error:t=>{console.error("[MAIN-APP] Failed to create thread for voice message:",t),this.isSessionInitializing=!1,this.isStartingFirstMessage=!1,alert("Failed to create conversation: "+(t.message||"Unknown error"))}})}isDrawerOpen=!1;onDrawerStateChange(e){this.isDrawerOpen=e}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close()}onInputHeightChanged(e){console.log("[MAIN-APP] Input height changed:",e),this.inputSectionHeight=e}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let e=this.inputSection.nativeElement.offsetHeight;e!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",e),this.inputSectionHeight=e)}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint)}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let e=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",e),e?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical")};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical")};static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["app-main"]],viewQuery:function(t,i){if(t&1&&W(Z,5)(E,5),t&2){let n;O(n=P())&&(i.inputSection=n.first),O(n=P())&&(i.sidenav=n.first)}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app",3,"mousedown","touchstart"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceMessageReady","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(t,i){t&1&&(h(0,"app-sidenav",1)(1,"div",2),y("mousedown",function(){return i.onChatFocusedOnMobile()})("touchstart",function(){return i.onChatFocusedOnMobile()}),V(2,ee,1,2,"app-thread",3)(3,te,7,5),g()()),t&2&&(w("drawerOpen",i.isDrawerOpen),m(2),j(i.threadId?2:3))},dependencies:[q,Q,T,E],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media(max-width:768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media(max-width:768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media(max-width:768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[S("slideIn",[C(":enter",[u({transform:"translateY(100%)",opacity:0}),_("300ms ease-out",u({transform:"translateY(0)",opacity:1}))]),C(":leave",[_("200ms ease-in",u({transform:"translateY(100%)",opacity:0}))])])]}})};export{K as MainAppComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as l}from"./chunk-W7ZS65Y4.js";import{V as o,Z as s,a as n,ca as a,ta as i}from"./chunk-5NLXR4MK.js";var u=class t{userController=a(l);currentUser=i(null);loadMe(){return this.userController.getMeUser().pipe(o(r=>this.currentUser.set(r)))}updateMe(r){let e=this.currentUser();if(!e)throw new Error("Cannot update: current user not loaded");if(!e.id)throw new Error("Cannot update: current user has no id");let c=n(n({},e),r);return this.userController.updateUser(e.id,c).pipe(o(d=>this.currentUser.set(d)))}static \u0275fac=function(e){return new(e||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})};export{u as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Y}from"./chunk-X5QAL64P.js";import{a as Z}from"./chunk-MAHIDPCP.js";import"./chunk-CK52GCRW.js";import"./chunk-ZX7BSCA5.js";import{g as B}from"./chunk-5TU5JR3W.js";import{a as R,c as L}from"./chunk-32554AB2.js";import{p as X}from"./chunk-26Y7QHUX.js";import"./chunk-NXKPUZGQ.js";import"./chunk-QN7OUZIZ.js";import{a as v,c as y}from"./chunk-BVQ4XPRS.js";import"./chunk-HTKDXFLE.js";import{F as W,c as z,e as x,g as A,h as G,i as q,l as u,n as j,p as $,s as J,w as U,x as H,y as K,z as Q}from"./chunk-7VQ75OC6.js";import"./chunk-NNVKL253.js";import{Bb as T,Db as g,Fb as p,Ka as a,Tb as l,Ub as b,Vb as N,Wa as w,ca as m,ga as _,ha as h,kb as I,lb as M,lc as D,m as E,ma as F,mb as P,pb as O,qb as k,rb as s,sb as i,ta as d,tb as o,ua as V,ub as C}from"./chunk-QDO3O2UB.js";function te(r,e){r&1&&(i(0,"p",5),l(1,"Loading\u2026"),o())}function ne(r,e){if(r&1&&(i(0,"label",10),C(1,"input",25),i(2,"span"),l(3),o()()),r&2){let t=e.$implicit,n=p(2);a(),s("value",t.value)("formControl",n.scopeControl)("disabled",t.value==="namespace"&&!n.isAdmin()),a(2),b(t.label)}}function oe(r,e){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let t=e.$implicit;s("value",t.type),a(),b(t.displayName)}}function ie(r,e){if(r&1){let t=T();i(0,"div",21)(1,"ds-json-schema-form",26),g("valueChange",function(c){_(t);let f=p(2);return h(f.onParamsChange(c))}),o()()}if(r&2){let t=p(2);a(),s("schema",e)("value",t.initialParams())}}function re(r,e){if(r&1){let t=T();i(0,"form",7),g("ngSubmit",function(){_(t);let c=p();return h(c.submit())}),i(1,"fieldset",8)(2,"legend",9),l(3,"Scope"),o(),O(4,ne,4,4,"label",10,I().trackByScope,!0),o(),i(6,"div",11)(7,"label",12),l(8,"Type "),i(9,"span",13),l(10,"*"),o()(),i(11,"select",14)(12,"option",15),l(13,"Select type"),o(),O(14,oe,2,2,"option",16,I().trackByType,!0),o()(),i(16,"div",11)(17,"label",17),l(18,"Name "),i(19,"span",13),l(20,"*"),o()(),C(21,"input",18),o(),i(22,"div",11)(23,"label",19),l(24,"Description"),o(),C(25,"textarea",20),o(),M(26,ie,2,2,"div",21),i(27,"div",22)(28,"button",23),l(29),o(),i(30,"button",24),g("click",function(){_(t);let c=p();return h(c.cancel())}),l(31,"Cancel"),o()()()}if(r&2){let t,n=p();s("formGroup",n.form),a(),s("disabled",n.isEditMode()),a(3),k(n.scopeOptions),a(7),s("formControl",n.typeControl),a(3),k(n.integrationTypes()),a(7),s("formControl",n.nameControl),a(4),s("formControl",n.descriptionControl),a(),P((t=n.schema())?26:-1,t),a(2),s("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),a(),N(" ",n.isEditMode()?"Save changes":"Create"," ")}}var ae=new Set(["platform","namespace","userOnNs","userGlobal"]),S=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ee=class r{route=m(R);router=m(L);destroyRef=m(F);state=m(Y);integrationTypeController=m(B);namespaceRole=m(Z);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=y(this.isPlatformMode?E(!0):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new q({name:new u("",{nonNullable:!0,validators:[x.required,x.minLength(1)]}),description:new u(null),type:new u("",{nonNullable:!0,validators:[x.required]}),scope:new u("namespace",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=d(!1);isSubmitting=d(!1);isLoading=d(!1);scopeOptions=[{value:"platform",label:S.platform},{value:"namespace",label:S.namespace},{value:"userOnNs",label:S.userOnNs},{value:"userGlobal",label:S.userGlobal}];paramsValue=d(null);initialParams=d(null);integrationTypes=y(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=y(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=D(()=>{let e=this.selectedType();return e?this.integrationTypes().find(n=>n.type===e)?.configSchema??null:null});existingConfig=null;constructor(){V(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let e=this.route.snapshot.paramMap,t=this.route.snapshot.queryParamMap,n=e.get("integrationId");if(n){this.isEditMode.set(!0),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let c=this.parseScope(t.get("scope"));this.scopeControl.setValue(c);let f=t.get("template");f&&this.hydrateFromTemplate(f)}parseScope(e){return e&&ae.has(e)?e:"namespace"}deriveScopeFromConfig(e){return!e.userId&&!e.namespaceId?"platform":e.userId?e.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.existingConfig=t,this.scopeControl.setValue(this.deriveScopeFromConfig(t)),this.applyConfigToForm(t),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[IntegrationForm] Could not load config '${e}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.applyConfigToForm(t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:t=>{console.warn(`[IntegrationForm] Could not hydrate from template ${e}:`,t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(e){this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.typeControl.setValue(e.integrationType),this.initialParams.set(e.parameters),this.paramsValue.set(e.parameters)}onParamsChange(e){this.paramsValue.set(e)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let e=this.descriptionControl.value?.trim(),t={name:this.nameControl.value.trim(),description:e||null,integrationType:this.typeControl.value,parameters:this.paramsValue()},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,t,n,this.existingConfig):this.state.create(t,n,this.namespaceId??null)).pipe(v(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(e,t){return t.type}trackByScope(e,t){return t.value}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=w({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"]],template:function(t,n){t&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),g("click",function(){return n.cancel()}),i(3,"span",3),l(4,"\u2190"),o(),l(5," Integrations "),o(),i(6,"h1",4),l(7),o()(),M(8,te,2,0,"p",5)(9,re,32,8,"form",6),o()),t&2&&(a(7),b(n.isEditMode()?"Edit integration":"New integration"),a(),P(n.isLoading()?8:9))},dependencies:[W,j,K,Q,z,H,$,A,G,J,U,X],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));border-radius:10px;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text, #1d1d1f);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:10px;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));background:var(--glass-bg, rgba(255, 255, 255, .5));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{ee as IntegrationFormComponent};
|
|
1
|
+
import{a as Y}from"./chunk-KP4KMDLX.js";import{a as Z}from"./chunk-GPZP3WYQ.js";import"./chunk-U5L2OULZ.js";import"./chunk-2BN4B3OL.js";import{h as B}from"./chunk-W7ZS65Y4.js";import{a as R,c as L}from"./chunk-P4GNUQZT.js";import{t as X}from"./chunk-K7JRH3HO.js";import"./chunk-EBAEYY2S.js";import"./chunk-BZ7URUNM.js";import{a as v,c as y}from"./chunk-SKBT6DBT.js";import"./chunk-GF3EMWCA.js";import{F as W,c as z,e as x,g as A,h as G,i as q,l as u,n as j,p as $,s as J,w as U,x as H,y as K,z as Q}from"./chunk-Z6RFJ6L3.js";import"./chunk-OPSHMM4H.js";import{Bb as T,Db as g,Fb as p,Ka as a,Tb as l,Ub as b,Vb as N,Wa as w,ca as m,ga as _,ha as h,kb as I,lb as M,lc as D,m as E,ma as F,mb as P,pb as O,qb as k,rb as s,sb as i,ta as d,tb as o,ua as V,ub as C}from"./chunk-5NLXR4MK.js";function te(r,e){r&1&&(i(0,"p",5),l(1,"Loading\u2026"),o())}function ne(r,e){if(r&1&&(i(0,"label",10),C(1,"input",25),i(2,"span"),l(3),o()()),r&2){let t=e.$implicit,n=p(2);a(),s("value",t.value)("formControl",n.scopeControl)("disabled",t.value==="namespace"&&!n.isAdmin()),a(2),b(t.label)}}function oe(r,e){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let t=e.$implicit;s("value",t.type),a(),b(t.displayName)}}function ie(r,e){if(r&1){let t=T();i(0,"div",21)(1,"ds-json-schema-form",26),g("valueChange",function(c){_(t);let f=p(2);return h(f.onParamsChange(c))}),o()()}if(r&2){let t=p(2);a(),s("schema",e)("value",t.initialParams())}}function re(r,e){if(r&1){let t=T();i(0,"form",7),g("ngSubmit",function(){_(t);let c=p();return h(c.submit())}),i(1,"fieldset",8)(2,"legend",9),l(3,"Scope"),o(),O(4,ne,4,4,"label",10,I().trackByScope,!0),o(),i(6,"div",11)(7,"label",12),l(8,"Type "),i(9,"span",13),l(10,"*"),o()(),i(11,"select",14)(12,"option",15),l(13,"Select type"),o(),O(14,oe,2,2,"option",16,I().trackByType,!0),o()(),i(16,"div",11)(17,"label",17),l(18,"Name "),i(19,"span",13),l(20,"*"),o()(),C(21,"input",18),o(),i(22,"div",11)(23,"label",19),l(24,"Description"),o(),C(25,"textarea",20),o(),M(26,ie,2,2,"div",21),i(27,"div",22)(28,"button",23),l(29),o(),i(30,"button",24),g("click",function(){_(t);let c=p();return h(c.cancel())}),l(31,"Cancel"),o()()()}if(r&2){let t,n=p();s("formGroup",n.form),a(),s("disabled",n.isEditMode()),a(3),k(n.scopeOptions),a(7),s("formControl",n.typeControl),a(3),k(n.integrationTypes()),a(7),s("formControl",n.nameControl),a(4),s("formControl",n.descriptionControl),a(),P((t=n.schema())?26:-1,t),a(2),s("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),a(),N(" ",n.isEditMode()?"Save changes":"Create"," ")}}var ae=new Set(["platform","namespace","userOnNs","userGlobal"]),S=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ee=class r{route=m(R);router=m(L);destroyRef=m(F);state=m(Y);integrationTypeController=m(B);namespaceRole=m(Z);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=y(this.isPlatformMode?E(!0):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new q({name:new u("",{nonNullable:!0,validators:[x.required,x.minLength(1)]}),description:new u(null),type:new u("",{nonNullable:!0,validators:[x.required]}),scope:new u("namespace",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=d(!1);isSubmitting=d(!1);isLoading=d(!1);scopeOptions=[{value:"platform",label:S.platform},{value:"namespace",label:S.namespace},{value:"userOnNs",label:S.userOnNs},{value:"userGlobal",label:S.userGlobal}];paramsValue=d(null);initialParams=d(null);integrationTypes=y(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=y(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=D(()=>{let e=this.selectedType();return e?this.integrationTypes().find(n=>n.type===e)?.configSchema??null:null});existingConfig=null;constructor(){V(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let e=this.route.snapshot.paramMap,t=this.route.snapshot.queryParamMap,n=e.get("integrationId");if(n){this.isEditMode.set(!0),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let c=this.parseScope(t.get("scope"));this.scopeControl.setValue(c);let f=t.get("template");f&&this.hydrateFromTemplate(f)}parseScope(e){return e&&ae.has(e)?e:"namespace"}deriveScopeFromConfig(e){return!e.userId&&!e.namespaceId?"platform":e.userId?e.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.existingConfig=t,this.scopeControl.setValue(this.deriveScopeFromConfig(t)),this.applyConfigToForm(t),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[IntegrationForm] Could not load config '${e}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.applyConfigToForm(t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:t=>{console.warn(`[IntegrationForm] Could not hydrate from template ${e}:`,t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(e){this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.typeControl.setValue(e.integrationType),this.initialParams.set(e.parameters),this.paramsValue.set(e.parameters)}onParamsChange(e){this.paramsValue.set(e)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let e=this.descriptionControl.value?.trim(),t={name:this.nameControl.value.trim(),description:e||null,integrationType:this.typeControl.value,parameters:this.paramsValue()},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,t,n,this.existingConfig):this.state.create(t,n,this.namespaceId??null)).pipe(v(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(e,t){return t.type}trackByScope(e,t){return t.value}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=w({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"]],template:function(t,n){t&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),g("click",function(){return n.cancel()}),i(3,"span",3),l(4,"\u2190"),o(),l(5," Integrations "),o(),i(6,"h1",4),l(7),o()(),M(8,te,2,0,"p",5)(9,re,32,8,"form",6),o()),t&2&&(a(7),b(n.isEditMode()?"Edit integration":"New integration"),a(),P(n.isLoading()?8:9))},dependencies:[W,j,K,Q,z,H,$,A,G,J,U,X],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));border-radius:10px;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text, #1d1d1f);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:10px;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));background:var(--glass-bg, rgba(255, 255, 255, .5));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{ee as IntegrationFormComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as W}from"./chunk-
|
|
1
|
+
import{a as W}from"./chunk-SO6H32XQ.js";import{a as P,b as w,e as I,f as L,g as O,h as S}from"./chunk-C2XSJPYF.js";import{a as R,b as A}from"./chunk-GF3EMWCA.js";import{E as V,g as N,m as B}from"./chunk-Z6RFJ6L3.js";import{Q as T,S as E}from"./chunk-OPSHMM4H.js";import{Bb as M,Db as d,Fb as s,Ka as o,Rb as k,Tb as i,Ub as r,Vb as g,Wa as b,Yb as D,Zb as y,_b as v,ca as m,ga as C,ha as u,lb as h,mb as _,rb as x,sb as a,tb as n}from"./chunk-5NLXR4MK.js";function j(c,p){if(c&1){let t=M();a(0,"mat-checkbox",5),v("ngModelChange",function(l){C(t);let f=s();return y(f.checkboxChecked,l)||(f.checkboxChecked=l),u(l)}),i(1),n()}if(c&2){let t=s();D("ngModel",t.checkboxChecked),o(),r(t.data.checkboxLabel)}}var F=class c{dialogRef=m(P);data=m(w);checkboxChecked=!1;confirm(){this.dialogRef.close({confirmed:!0,checkboxChecked:this.checkboxChecked})}cancel(){this.dialogRef.close({confirmed:!1})}static \u0275fac=function(t){return new(t||c)};static \u0275cmp=b({type:c,selectors:[["app-confirm-dialog"]],decls:13,vars:8,consts:[["mat-dialog-title",""],[3,"ngModel"],["align","end"],["mat-button","",3,"click"],["mat-flat-button","",3,"click","color"],[3,"ngModelChange","ngModel"]],template:function(t,e){t&1&&(a(0,"h2",0)(1,"mat-icon"),i(2,"warning"),n(),i(3),n(),a(4,"mat-dialog-content")(5,"p"),i(6),n(),h(7,j,2,2,"mat-checkbox",1),n(),a(8,"mat-dialog-actions",2)(9,"button",3),d("click",function(){return e.cancel()}),i(10),n(),a(11,"button",4),d("click",function(){return e.confirm()}),i(12),n()()),t&2&&(o(),k("destructive",!!e.data.isDestructive),o(2),g(" ",e.data.title,`
|
|
2
2
|
`),o(3),r(e.data.message),o(),_(e.data.checkboxLabel?7:-1),o(3),r(e.data.cancelLabel??"Cancel"),o(),x("color",e.data.isDestructive?"warn":"primary"),o(),g(" ",e.data.confirmLabel??"Confirm"," "))},dependencies:[S,I,O,L,E,T,A,R,W,V,N,B],styles:["h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}h2[mat-dialog-title][_ngcontent-%COMP%] mat-icon.destructive[_ngcontent-%COMP%]{color:var(--color-error, #f44336)}mat-dialog-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary);line-height:1.5}mat-dialog-content[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block;margin-top:8px;font-size:.875rem}"],changeDetection:0})};export{F as a};
|
|
@@ -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 De,v as Fe,w as Le,x as Be,y as ze,z as Ue}from"./chunk-
|
|
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 De,v as Fe,w as Le,x as Be,y as ze,z as Ue}from"./chunk-NAHXPRXR.js";import{a as $e}from"./chunk-KD3BJ52V.js";import{a as pe,b as ge,e as me,f as he,g as ue}from"./chunk-C2XSJPYF.js";import{a as j}from"./chunk-GF3EMWCA.js";import{E as D,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-Z6RFJ6L3.js";import{E as le,J as de,O as ve,Q as fe}from"./chunk-OPSHMM4H.js";import{Ab as x,Db as d,Fb as k,Ic as se,Jb as X,Ka as c,Kb as ee,Lb as te,Nc as ce,Pb as ne,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,Yb as g,Z as P,Zb as m,_ as Y,_b as h,aa as K,ab as Z,ca as v,d as S,h as C,i as b,ia as B,ic as ae,ja as q,jb as M,lb as T,mb as w,pb as $,qb as z,rb as u,sb as a,tb as r,ub as f,xc as I,ya as G}from"./chunk-5NLXR4MK.js";var qe=["determinateSpinner"];function Ge(l,e){if(l&1&&(B(),a(0,"svg",11),f(1,"circle",12),r()),l&2){let n=k();M("viewBox",n._viewBox()),c(),V("stroke-dasharray",n._strokeCircumference(),"px")("stroke-dashoffset",n._strokeCircumference()/2,"px")("stroke-width",n._circleStrokeWidth(),"%"),M("r",n._circleRadius())}}var Qe=new K("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:He})}),He=100,Ze=10,St=(()=>{class l{_elementRef=v(G);_noopAnimations;get color(){return this._color||this._defaultColor}set color(n){this._color=n}_color;_defaultColor="primary";_determinateCircle;constructor(){let n=v(Qe),t=de(),i=this._elementRef.nativeElement;this._noopAnimations=t==="di-disabled"&&!!n&&!n._forceAnimations,this.mode=i.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&t==="reduced-motion"&&i.classList.add("mat-progress-spinner-reduced-motion"),n&&(n.color&&(this.color=this._defaultColor=n.color),n.diameter&&(this.diameter=n.diameter),n.strokeWidth&&(this.strokeWidth=n.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(n){this._value=Math.max(0,Math.min(100,n||0))}_value=0;get diameter(){return this._diameter}set diameter(n){this._diameter=n||0}_diameter=He;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(n){this._strokeWidth=n||0}_strokeWidth;_circleRadius(){return(this.diameter-Ze)/2}_viewBox(){let n=this._circleRadius()*2+this.strokeWidth;return`0 0 ${n} ${n}`}_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(t){return new(t||l)};static \u0275cmp=E({type:l,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(t,i){if(t&1&&X(qe,5),t&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(t,i){t&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(t,i){if(t&1&&(Z(0,Ge,2,8,"ng-template",null,0,ae),a(2,"div",2,1),B(),a(4,"svg",3),f(5,"circle",4),r()(),q(),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()()()),t&2){let o=ne(1);c(4),M("viewBox",i._viewBox()),c(),V("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),M("r",i._circleRadius()),c(4),u("ngTemplateOutlet",o),c(2),u("ngTemplateOutlet",o),c(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 l})();var Ct=(()=>{class l{static \u0275fac=function(t){return new(t||l)};static \u0275mod=Q({type:l});static \u0275inj=Y({imports:[le]})}return l})();var L=class l{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,n)=>{let t=speechSynthesis.getVoices();if(t.length)e(t);else{let i=setTimeout(()=>{n("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,n){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 t=this.extractPlainText(e);if(!t.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;this.stopSpeech();try{let i=new SpeechSynthesisUtterance(t);i.voice=this.selectedVoice,i.lang=this.selectedVoice.lang,i.volume=this.volume,i.rate=this.rate,this.currentOnEndCallback=n||null,n&&(i.onend=()=>{this.currentOnEndCallback===n&&(this.currentOnEndCallback=null,n())},i.onerror=()=>{this.currentOnEndCallback===n&&(this.currentOnEndCallback=null,n())}),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),n=e.createOscillator(),t=e.createGain();n.connect(t),t.connect(e.destination),n.frequency.setValueAtTime(800,e.currentTime),t.gain.setValueAtTime(.1,e.currentTime),t.gain.exponentialRampToValueAtTime(.01,e.currentTime+.1),n.start(e.currentTime),n.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),n=yield this.voices;if(!n||n.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let t=n.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:",t.length,"for language:",e),t.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 n=e.localService?"\u{1F3E0}":"\u2601\uFE0F",t=e.default?" \u2B50":"";return`${n} ${e.name} (${e.lang})${t}`}setSelectedVoice(e){return S(this,null,function*(){if(!e){this.selectedVoice=void 0;return}let[n,t]=e.split("|");if(!n||!t){this.selectedVoice=void 0;return}let i=(yield this.voices)?.find(o=>o.name===n&&o.lang===t);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:",n,t))})}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 n=this.preferencesService.getSelectedVoice();if(n){let[i,o]=n.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:",n);return}}let t=e[0];if(t){let i=`${t.name}|${t.lang}`;this.preferencesService.setSelectedVoice(i),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",t.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),n={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 n[e]||n.en||"Hello, this is a test."}extractPlainText(e){let n=e.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/ /g," ").replace(/&/g,"and").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"');return n=this.addNaturalPunctuation(n),n.replace(/\s+/g," ").trim()}addNaturalPunctuation(e){return e.replace(/\n+/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`).map(n=>this.addPeriodIfNeeded(n.trim())).filter(n=>n.length>0).join(" ")}addPeriodIfNeeded(e){return e?/[.!?;:]$/.test(e)?e:e+".":""}static \u0275fac=function(n){return new(n||l)};static \u0275prov=P({token:l,factory:l.\u0275fac,providedIn:"root"})};var tt=(l,e)=>e.code,nt=(l,e)=>e.name+e.lang;function it(l,e){l&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 ot(l,e){if(l&1&&(a(0,"option",25),s(1),r()),l&2){let n=e.$implicit;u("value",n.code),c(),re("",n.flag," ",n.label)}}function rt(l,e){l&1&&(a(0,"option",32),s(1,"Loading voices..."),r())}function at(l,e){l&1&&(a(0,"option",32),s(1,"No voice available"),r())}function st(l,e){if(l&1&&(a(0,"option",25),s(1),r()),l&2){let n=e.$implicit;u("value",n.name+"|"+n.lang),c(),y(" ",n.displayName," ")}}var Je=class l{destroy$=new C;selectedTheme="light";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(){this.selectedTheme=this.themeService.getCurrentTheme(),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(e=>{this.selectedTheme=e}),this.preferencesService.voiceLanguage$.pipe(p(this.destroy$)).subscribe(e=>{this.selectedVoiceLanguage=e}),this.preferencesService.enterToSend$.pipe(p(this.destroy$)).subscribe(e=>{this.useEnterToSend=e}),this.preferencesService.printTechnicalMessages$.pipe(p(this.destroy$)).subscribe(e=>{this.printTechnicalMessages=e}),this.preferencesService.hideTechnicalMessages$.pipe(p(this.destroy$)).subscribe(e=>{this.showTechnicalMessages=!e}),this.preferencesService.hideWarningMessages$.pipe(p(this.destroy$)).subscribe(e=>{this.showWarningMessages=!e}),this.preferencesService.voiceInputMode$.pipe(p(this.destroy$)).subscribe(e=>{this.voiceInputMode=e}),this.preferencesService.voiceAnnounceEnabled$.pipe(p(this.destroy$)).subscribe(e=>{this.voiceAnnounceEnabled=e}),this.preferencesService.voiceMode$.pipe(p(this.destroy$)).subscribe(e=>{this.voiceMode=e}),this.preferencesService.voiceReadFullText$.pipe(p(this.destroy$)).subscribe(e=>{this.voiceReadFullText=e}),this.preferencesService.voiceVolume$.pipe(p(this.destroy$)).subscribe(e=>{this.voiceVolume=Math.round(e*100)}),this.preferencesService.voiceRate$.pipe(p(this.destroy$)).subscribe(e=>{this.voiceRate=Math.round(e*100)}),this.preferencesService.selectedVoice$.pipe(p(this.destroy$)).subscribe(e=>{this.selectedVoiceId=e}),this.preferencesService.voiceLanguage$.pipe(p(this.destroy$)).subscribe(()=>{this.loadAvailableVoices()}),this.preferencesService.agentNotificationEnabled$.pipe(p(this.destroy$)).subscribe(e=>{this.agentNotificationEnabled=e}),this.preferencesService.notificationSoundEnabled$.pipe(p(this.destroy$)).subscribe(e=>{this.notificationSoundEnabled=e}),this.preferencesService.browserNotificationEnabled$.pipe(p(this.destroy$)).subscribe(e=>{this.browserNotificationEnabled=e,this.checkNotificationPermission()}),this.preferencesService.missionPreviewEnabled$.pipe(p(this.destroy$)).subscribe(e=>{this.missionPreviewEnabled=e})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme(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 n=e.target.value;console.log("[OPTIONS] Voice input mode changed to:",n),this.preferencesService.setVoiceInputMode(n)}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(n){return new(n||l)};static \u0275cmp=E({type:l,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(n,t){n&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(t.selectedTheme,o)||(t.selectedTheme=o),o}),d("change",function(){return t.onThemeChange()}),r(),f(11,"span",7),s(12," Light "),r(),a(13,"label",5)(14,"input",8),h("ngModelChange",function(o){return m(t.selectedTheme,o)||(t.selectedTheme=o),o}),d("change",function(){return t.onThemeChange()}),r(),f(15,"span",7),s(16," Dark "),r(),a(17,"label",5)(18,"input",9),h("ngModelChange",function(o){return m(t.selectedTheme,o)||(t.selectedTheme=o),o}),d("change",function(){return t.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(t.useEnterToSend,o)||(t.useEnterToSend=o),o}),d("change",function(){return t.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(t.useEnterToSend,o)||(t.useEnterToSend=o),o}),d("change",function(){return t.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(t.showTechnicalMessages,o)||(t.showTechnicalMessages=o),o}),d("change",function(){return t.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(t.showWarningMessages,o)||(t.showWarningMessages=o),o}),d("change",function(){return t.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(t.printTechnicalMessages,o)||(t.printTechnicalMessages=o),o}),d("change",function(){return t.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(t.missionPreviewEnabled,o)||(t.missionPreviewEnabled=o),o}),d("change",function(){return t.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(t.agentNotificationEnabled,o)||(t.agentNotificationEnabled=o),o}),d("change",function(){return t.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(t.notificationSoundEnabled,o)||(t.notificationSoundEnabled=o),o}),d("change",function(){return t.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(t.browserNotificationEnabled,o)||(t.browserNotificationEnabled=o),o}),d("change",function(){return t.onBrowserNotificationEnabledChange()}),r()(),T(89,it,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 t.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(t.selectedVoiceLanguage,o)||(t.selectedVoiceLanguage=o),o}),d("change",function(){return t.onVoiceLanguageChange()}),$(110,ot,2,3,"option",25,tt),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(t.voiceAnnounceEnabled,o)||(t.voiceAnnounceEnabled=o),o}),d("change",function(){return t.onVoiceAnnounceEnabledChange()}),r(),f(118,"span",7),s(119," Enabled "),r(),a(120,"label",5)(121,"input",26),h("ngModelChange",function(o){return m(t.voiceAnnounceEnabled,o)||(t.voiceAnnounceEnabled=o),o}),d("change",function(){return t.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(t.voiceMode,o)||(t.voiceMode=o),o}),d("change",function(){return t.onVoiceModeChange()}),r(),f(130,"span",7),s(131," Voice synthesis "),r(),a(132,"label",5)(133,"input",28),h("ngModelChange",function(o){return m(t.voiceMode,o)||(t.voiceMode=o),o}),d("change",function(){return t.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(t.voiceReadFullText,o)||(t.voiceReadFullText=o),o}),d("change",function(){return t.onVoiceReadFullTextChange()}),r(),f(142,"span",7),s(143," Full message "),r(),a(144,"label",5)(145,"input",29),h("ngModelChange",function(o){return m(t.voiceReadFullText,o)||(t.voiceReadFullText=o),o}),d("change",function(){return t.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(t.selectedVoiceId,o)||(t.selectedVoiceId=o),o}),d("change",function(){return t.onSelectedVoiceChange()}),T(152,rt,2,0,"option",32),T(153,at,2,0,"option",32),$(154,st,2,2,"option",25,nt),r(),f(156,"div",10),a(157,"a",33),d("click",function(){return t.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(t.voiceVolume,o)||(t.voiceVolume=o),o}),d("input",function(){return t.onVoiceVolumeChange()}),r()(),a(164,"div",3)(165,"label",37),s(166),r(),a(167,"input",38),h("ngModelChange",function(o){return m(t.voiceRate,o)||(t.voiceRate=o),o}),d("input",function(){return t.onVoiceRateChange()}),r()()()()),n&2&&(c(10),g("ngModel",t.selectedTheme),c(4),g("ngModel",t.selectedTheme),c(4),g("ngModel",t.selectedTheme),c(14),u("value",!0),g("ngModel",t.useEnterToSend),c(4),u("value",!1),g("ngModel",t.useEnterToSend),c(7),g("ngModel",t.showTechnicalMessages),c(5),g("ngModel",t.showWarningMessages),c(5),g("ngModel",t.printTechnicalMessages),c(14),g("ngModel",t.missionPreviewEnabled),c(11),g("ngModel",t.agentNotificationEnabled),c(5),g("ngModel",t.notificationSoundEnabled),u("disabled",!t.agentNotificationEnabled),c(5),g("ngModel",t.browserNotificationEnabled),u("disabled",!t.agentNotificationEnabled||t.browserNotificationDenied),c(),w(t.browserNotificationDenied?89:-1),c(10),u("value",t.voiceInputMode),c(10),g("ngModel",t.selectedVoiceLanguage),c(),z(t.voiceLanguageOptions),c(7),u("value",!0),g("ngModel",t.voiceAnnounceEnabled),c(4),u("value",!1),g("ngModel",t.voiceAnnounceEnabled),c(8),g("ngModel",t.voiceMode),c(4),g("ngModel",t.voiceMode),c(8),u("value",!0),g("ngModel",t.voiceReadFullText),c(4),u("value",!1),g("ngModel",t.voiceReadFullText),c(6),g("ngModel",t.selectedVoiceId),u("disabled",t.loadingVoices||t.availableVoices.length===0),c(),w(t.loadingVoices?152:-1),c(),w(!t.loadingVoices&&t.availableVoices.length===0?153:-1),c(),z(t.availableVoices),c(8),y("Volume: ",t.voiceVolume,"%"),c(),g("ngModel",t.voiceVolume),c(3),y("Speed: ",t.voiceRate,"%"),c(),g("ngModel",t.voiceRate))},dependencies:[D,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}']})};var Ye=class l{destroy$=new C;currentProject=null;currentThread=null;messagesSubject=new b([]);isThinkingSubject=new b(!1);currentChoiceSubject=new b(null);projectTitleSubject=new b("Coday");currentInviteEventSubject=new b(null);messageToRestoreSubject=new b("");threadUpdateEventSubject=new b(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new b("");subThreadEventsSubject=new C;subThreadEvents$=this.subThreadEventsSubject.asObservable();subThreadEventBuffers=new Map;getBufferedSubThreadEvents(e){return this.subThreadEventBuffers.get(e)??[]}messages$=this.messagesSubject.asObservable();streamingText$=this.streamingTextSubject.asObservable();isThinking$=this.isThinkingSubject.asObservable();currentChoice$=this.currentChoiceSubject.asObservable();currentInviteEvent$=this.currentInviteEventSubject.asObservable();messageToRestore$=this.messageToRestoreSubject.asObservable();threadUpdateEvent$=this.threadUpdateEventSubject.asObservable();connectionStatus$;tabTitleService=null;eventStream=v(ze);messageApi=v(Ue);userService=v(be);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling()}setTabTitleService(e){this.tabTitleService=e}connectToThread(e,n){this.currentProject=e,this.currentThread=n,this.eventStream.connectToThread(e,n)}loadHistoryFromRest(e){for(let n of e){let t=Be(n);t&&this.handleEvent(t)}}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.subThreadEventBuffers.clear(),this.stopThinking()}sendMessage(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}let n=this.currentInviteEventSubject.value;if(n){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let t=n.buildAnswer(e);this.messageApi.sendMessage(t).subscribe({error:i=>{console.error("[CODAY] Send invite answer error:",i),this.currentInviteEventSubject.next(n),this.stopThinking()}})}else this.messageApi.sendFreeMessage(e).subscribe({error:t=>{console.error("[CODAY] Send error:",t)}})}sendChoice(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let n=this.currentChoiceEvent.buildAnswer(e);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(n).subscribe({next:()=>{},error:t=>{console.error("[CODAY-CHOICE] Choice error:",t),this.stopThinking()}})}else console.error("[CODAY-CHOICE] No choice event available for choice:",e)}deleteMessage(e){let n=this.messagesSubject.value.find(i=>i.id===e),t=this.extractTextContentFromMessage(n);return this.messageApi.deleteMessage(e).pipe(J(i=>{i.success&&(this.removeMessagesFromIndex(e),t.trim()&&this.messageToRestoreSubject.next(t))}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive()}initializeEventHandling(){this.eventStream.events$.pipe(p(this.destroy$)).subscribe({next:e=>this.handleEvent(e),error:e=>console.error("[CODAY] Event stream error:",e),complete:()=>console.log("[CODAY] Event stream completed")})}handleEvent(e){if(e.threadId&&e.threadId!==this.currentThread){let n=this.subThreadEventBuffers.get(e.threadId);n?n.push(e):this.subThreadEventBuffers.set(e.threadId,[e]),this.subThreadEventsSubject.next(e);return}e instanceof Re?this.handleMessageEvent(e):e instanceof ke?this.handleTextChunkEvent(e):e instanceof xe?this.handleTextEvent(e):e instanceof Pe?this.handleAnswerEvent(e):e instanceof Ie?this.handleErrorEvent(e):e instanceof Ve?this.handleWarnEvent(e):e instanceof U?this.handleThinkingEvent(e):e instanceof je?this.handleToolRequestEvent(e):e instanceof We?this.handleToolResponseEvent(e):e instanceof Ne?this.handleChoiceEvent(e):e instanceof Te?this.handleHeartBeatEvent(e):e instanceof we?this.handleInviteEvent(e):e instanceof Ae?this.handleThreadUpdateEvent(e):e instanceof Fe?this.handleDelegationEvent(e):e instanceof De||e instanceof Le||console.warn("[CODAY] Unhandled event type:",e.type)}handleDelegationEvent(e){if(console.log("[CODAY] DelegationEvent received:",e.subThreadId,e.agentName),this.messagesSubject.value.findIndex(i=>i.subThreadId===e.subThreadId)===-1){let i={id:e.timestamp,role:"system",speaker:e.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:e.subThreadId,delegationAgentName:e.agentName};this.addMessage(i)}}handleThreadUpdateEvent(e){this.threadUpdateEventSubject.next(e)}handleMessageEvent(e){e.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let n={id:e.timestamp,role:e.role,speaker:e.name,content:e.content,timestamp:e.date,type:"text"};this.addMessage(n)}handleTextChunkEvent(e){this.accumulatedChunks+=e.chunk,this.streamingTextSubject.next(this.accumulatedChunks)}handleTextEvent(e){let n={id:e.timestamp,role:e.speaker?"assistant":"system",speaker:e.speaker??"System",content:[{type:"text",content:e.text}],timestamp:e.date,type:e.speaker?"text":"technical"};this.addMessage(n)}handleAnswerEvent(e){let n=this.currentInviteEventSubject.value;if(n){let i=!!e.parentKey&&e.parentKey===n.timestamp,o=!e.parentKey&&e.date>=n.date;(i||o)&&this.currentInviteEventSubject.next(null)}if(e.silent)return;let t={id:e.timestamp,role:"user",speaker:e.name??this.userService.getUsername()??"User",content:[{type:"text",content:e.answer}],timestamp:e.date,type:"text",parentKey:e.parentKey,invite:e.invite};this.addMessage(t)}handleErrorEvent(e){let n={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(e.error)}`}],timestamp:e.date,type:"error"};this.addMessage(n)}handleWarnEvent(e){let n={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(e.warning)}`}],timestamp:e.date,type:"warning"};this.addMessage(n)}handleThinkingEvent(e){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(!1),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive()},U.debounce+1e3))}handleToolRequestEvent(e){let n={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp};this.addMessage(n)}handleToolResponseEvent(e){let n={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp};this.addMessage(n)}handleChoiceEvent(e){this.stopThinking(),this.currentChoiceEvent=e,this.tabTitleService?.setSystemInactive();let n=e.options.map(i=>({value:i,label:i})),t=e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite;this.currentChoiceSubject.next({options:n,label:t,allowFreeText:e.allowFreeText})}handleHeartBeatEvent(e){}handleInviteEvent(e){if(this.stopThinking(),e.invite===Oe)this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive();else{let t={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.invite}],timestamp:e.date,type:"text"};this.addMessage(t),this.messagesSubject.value.some(_=>_.parentKey===e.timestamp||_.role==="user"&&_.timestamp>e.date||_.role==="assistant"&&_.timestamp>e.date)||(this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive())}}addMessage(e){let n=this.messagesSubject.value;n.some(t=>t.id===e.id)||this.messagesSubject.next([...n,e])}removeMessagesFromIndex(e){let n=this.messagesSubject.value,t=n.findIndex(o=>o.id===e);if(t===-1||t===0)return;let i=n.slice(0,t);this.messagesSubject.next(i),this.stopThinking()}extractTextContentFromMessage(e){return e?e.content.filter(n=>n.type==="text").map(n=>n.content).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i as I}from"./chunk-W7ZS65Y4.js";import{a as k,c as w}from"./chunk-P4GNUQZT.js";import{a as h}from"./chunk-SKBT6DBT.js";import{F as B,c as D,e as C,g as F,h as V,i as A,l as s,n as z,s as L,w as R}from"./chunk-Z6RFJ6L3.js";import{Bb as O,Db as u,Fb as g,Ka as r,Tb as o,Ub as S,Vb as E,Wa as N,a as x,b as v,ca as p,ga as _,ha as b,lb as M,ma as y,mb as P,rb as i,sb as n,ta as f,tb as t,ub as l}from"./chunk-5NLXR4MK.js";function T(m,a){m&1&&(n(0,"p",5),o(1,"Loading\u2026"),t())}function $(m,a){if(m&1){let e=O();n(0,"form",7),u("ngSubmit",function(){_(e);let d=g();return b(d.submit())}),n(1,"div",8)(2,"label",9),o(3,"Name "),n(4,"span",10),o(5,"*"),t()(),l(6,"input",11),t(),n(7,"div",8)(8,"label",12),o(9,"Description"),t(),l(10,"textarea",13),t(),n(11,"div",8)(12,"label",14),o(13,"External ID"),t(),l(14,"input",15),t(),n(15,"div",8)(16,"label",16),o(17,"Default agent"),t(),l(18,"input",17),t(),n(19,"div",8)(20,"label",18),o(21,"Config path"),t(),l(22,"input",19),t(),n(23,"div",20)(24,"button",21),o(25),t(),n(26,"button",22),u("click",function(){_(e);let d=g();return b(d.cancel())}),o(27,"Cancel"),t()()()}if(m&2){let e=g();i("formGroup",e.form),r(6),i("formControl",e.nameControl),r(4),i("formControl",e.descriptionControl),r(4),i("formControl",e.externalIdControl),r(4),i("formControl",e.defaultAgentNameControl),r(4),i("formControl",e.configPathControl),r(2),i("disabled",e.nameControl.invalid||e.isSubmitting()),r(),E(" ",e.isEditMode()?"Save changes":"Create"," ")}}var G=class m{route=p(k);router=p(w);namespaceController=p(I);destroyRef=p(y);form=new A({name:new s("",{nonNullable:!0,validators:[C.required,C.minLength(1)]}),description:new s("",{nonNullable:!0}),configPath:new s("",{nonNullable:!0}),externalId:new s("",{nonNullable:!0}),defaultAgentName:new s("",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}isEditMode=f(!1);isSubmitting=f(!1);isLoading=f(!1);existingNamespace=null;ngOnInit(){let a=this.route.snapshot.paramMap.get("namespaceId");a&&(this.isEditMode.set(!0),this.loadNamespace(a))}loadNamespace(a){this.isLoading.set(!0),this.namespaceController.getByIdNamespace(a).pipe(h(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}submit(){if(this.nameControl.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let a=v(x({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",a):this.namespaceController.createNamespace(a)).pipe(h(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos/namespaces"])}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=N({type:m,selectors:[["agentos-namespace-form"]],decls:10,vars:2,consts:[[1,"namespace-form"],[1,"namespace-form__header"],["type","button","title","Back to namespaces",1,"namespace-form__back",3,"click"],[1,"namespace-form__back-icon"],[1,"namespace-form__title"],[1,"namespace-form__loading"],[1,"namespace-form__form",3,"formGroup"],[1,"namespace-form__form",3,"ngSubmit","formGroup"],[1,"namespace-form__field"],["for","ns-name",1,"namespace-form__label"],["aria-hidden","true"],["id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-description",1,"namespace-form__label"],["id","ns-description","rows","4","placeholder","Optional description",1,"namespace-form__textarea",3,"formControl"],["for","ns-external-id",1,"namespace-form__label"],["id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-default-agent",1,"namespace-form__label"],["id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-config-path",1,"namespace-form__label"],["id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",1,"namespace-form__input",3,"formControl"],[1,"namespace-form__actions"],["type","submit",1,"namespace-form__btn","namespace-form__btn--primary",3,"disabled"],["type","button",1,"namespace-form__btn",3,"click"]],template:function(e,c){e&1&&(n(0,"div",0)(1,"header",1)(2,"button",2),u("click",function(){return c.cancel()}),n(3,"span",3),o(4,"\u2190"),t(),o(5," Namespaces "),t(),n(6,"h1",4),o(7),t()(),M(8,T,2,0,"p",5)(9,$,28,8,"form",6),t()),e&2&&(r(7),S(c.isEditMode()?"Edit namespace":"New namespace"),r(),P(c.isLoading()?8:9))},dependencies:[B,z,D,F,V,L,R],styles:[".namespace-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.namespace-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.namespace-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.namespace-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.namespace-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.namespace-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.namespace-form__input[_ngcontent-%COMP%], .namespace-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.namespace-form__input[_ngcontent-%COMP%]:focus, .namespace-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.namespace-form__input[_ngcontent-%COMP%]::placeholder, .namespace-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.namespace-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:96px;line-height:1.5}.namespace-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.namespace-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.namespace-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.namespace-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.namespace-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.namespace-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{G as NamespaceFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as G}from"./chunk-
|
|
1
|
+
import{a as G}from"./chunk-A34IERCN.js";import{a as T}from"./chunk-2BN4B3OL.js";import{a as I,c as w}from"./chunk-P4GNUQZT.js";import{a as _}from"./chunk-SKBT6DBT.js";import{F as R,b as A,c as N,e as C,g as F,h as U,i as z,l as d,n as D,v as V,w as L}from"./chunk-Z6RFJ6L3.js";import{Bb as P,Db as f,Fb as c,Ka as l,Tb as n,Ub as y,Vb as k,Wa as O,ca as u,ga as p,ha as g,lb as x,ma as E,mb as v,rb as h,sb as r,ta as b,tb as e,ub as m}from"./chunk-5NLXR4MK.js";function q(a,i){a&1&&(r(0,"p",5),n(1,"Loading\u2026"),e())}function $(a,i){if(a&1&&(r(0,"span",13),n(1),e()),a&2){let t=c(2);l(),y(t.form.controls.email.value)}}function j(a,i){a&1&&m(0,"input",14)}function H(a,i){if(a&1){let t=P();r(0,"form",7),f("ngSubmit",function(){p(t);let s=c();return g(s.save())}),r(1,"div",8)(2,"h2",9),n(3,"Identity"),e(),r(4,"div",10)(5,"label",11),n(6,"Email "),r(7,"span",12),n(8,"*"),e()(),x(9,$,2,1,"span",13)(10,j,1,0,"input",14),e(),r(11,"div",10)(12,"label",15),n(13,"External ID"),e(),m(14,"input",16),e()(),r(15,"div",8)(16,"h2",9),n(17,"Profile"),e(),r(18,"div",10)(19,"label",17),n(20,"First name"),e(),m(21,"input",18),e(),r(22,"div",10)(23,"label",19),n(24,"Last name"),e(),m(25,"input",20),e(),r(26,"div",21)(27,"label",22),n(28,"Bio"),e(),m(29,"textarea",23),e()(),r(30,"div",8)(31,"h2",9),n(32,"Permissions"),e(),r(33,"div",24),m(34,"input",25),r(35,"label",26),n(36," Super admin (full access to AgentOS) "),e()()(),r(37,"div",27)(38,"button",28),n(39),e(),r(40,"button",29),f("click",function(){p(t);let s=c();return g(s.cancel())}),n(41,"Cancel"),e()()()}if(a&2){let t=c();h("formGroup",t.form),l(9),v(t.isEditMode?9:10),l(29),h("disabled",t.form.invalid||t.isSaving()),l(),k(" ",t.isSaving()?"Saving\u2026":t.isEditMode?"Save changes":"Create user"," ")}}var B=class a{route=u(I);router=u(w);destroyRef=u(E);userAdminState=u(G);userState=u(T);userId=this.route.snapshot.params.userId;isEditMode=!!this.userId;isSaving=b(!1);isLoading=b(!1);form=new z({email:new d("",{nonNullable:!0,validators:[C.required,C.email]}),externalId:new d("",{nonNullable:!0}),firstname:new d("",{nonNullable:!0}),lastname:new d("",{nonNullable:!0}),bio:new d("",{nonNullable:!0}),isAdmin:new d(!1,{nonNullable:!0})});ngOnInit(){if(!this.isEditMode)return;let i=()=>{this.userState.currentUser()?.id===this.userId&&this.form.controls.isAdmin.disable()};this.userState.currentUser()?i():this.userState.loadMe().pipe(_(this.destroyRef)).subscribe({next:()=>i(),error:()=>this.form.controls.isAdmin.disable()});let t=this.userAdminState.users().find(o=>o.id===this.userId);if(t){this.syncForm(t),this.form.controls.email.disable();return}this.isLoading.set(!0),this.userAdminState.loadAll().pipe(_(this.destroyRef)).subscribe({next:()=>{let o=this.userAdminState.users().find(s=>s.id===this.userId);o&&(this.syncForm(o),this.form.controls.email.disable()),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)})}get title(){return this.isEditMode?"Edit user":"New user"}save(){if(this.form.invalid||this.isSaving())return;this.isSaving.set(!0);let{email:i,externalId:t,firstname:o,lastname:s,bio:S,isAdmin:M}=this.form.getRawValue();(this.isEditMode?this.userAdminState.updateUser(this.userId,{externalId:t||void 0,firstname:o||void 0,lastname:s||void 0,bio:S||void 0,isAdmin:M}):this.userAdminState.createUser({email:i||void 0,externalId:t||void 0,firstname:o||void 0,lastname:s||void 0,bio:S||void 0,isAdmin:M})).pipe(_(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSaving.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos/admin/users"])}syncForm(i){this.form.setValue({email:i.email??"",externalId:i.externalId??"",firstname:i.firstname??"",lastname:i.lastname??"",bio:i.bio??"",isAdmin:i.isAdmin??!1})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=O({type:a,selectors:[["agentos-user-form"]],decls:10,vars:2,consts:[[1,"user-form"],[1,"user-form__header"],["type","button","title","Back to users",1,"user-form__back",3,"click"],[1,"user-form__back-icon"],[1,"user-form__title"],[1,"user-form__loading"],[1,"user-form__body",3,"formGroup"],[1,"user-form__body",3,"ngSubmit","formGroup"],[1,"user-form__section"],[1,"user-form__section-title"],[1,"user-form__field"],["for","uf-email",1,"user-form__label"],[1,"user-form__required"],[1,"user-form__value","user-form__value--readonly"],["id","uf-email","type","email","placeholder","user@example.com","formControlName","email","autocomplete","email",1,"user-form__input"],["for","uf-externalId",1,"user-form__label"],["id","uf-externalId","type","text","placeholder","External identifier","formControlName","externalId",1,"user-form__input"],["for","uf-firstname",1,"user-form__label"],["id","uf-firstname","type","text","placeholder","First name","formControlName","firstname","autocomplete","given-name",1,"user-form__input"],["for","uf-lastname",1,"user-form__label"],["id","uf-lastname","type","text","placeholder","Last name","formControlName","lastname","autocomplete","family-name",1,"user-form__input"],[1,"user-form__field","user-form__field--bio"],["for","uf-bio",1,"user-form__label"],["id","uf-bio","placeholder","A short description","formControlName","bio","rows","4",1,"user-form__input","user-form__input--textarea"],[1,"user-form__field","user-form__field--checkbox"],["id","uf-isAdmin","type","checkbox","formControlName","isAdmin",1,"user-form__checkbox"],["for","uf-isAdmin",1,"user-form__label","user-form__label--checkbox"],[1,"user-form__actions"],["type","submit",1,"user-form__btn","user-form__btn--primary",3,"disabled"],["type","button",1,"user-form__btn",3,"click"]],template:function(t,o){t&1&&(r(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return o.cancel()}),r(3,"span",3),n(4,"\u2190"),e(),n(5," Users "),e(),r(6,"h1",4),n(7),e()(),x(8,q,2,0,"p",5)(9,H,42,4,"form",6),e()),t&2&&(l(7),y(o.title),l(),v(o.isLoading()?8:9))},dependencies:[R,D,N,A,F,U,L,V],styles:[".user-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.user-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.user-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.user-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.user-form__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-form__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-form__section-title[_ngcontent-%COMP%]{margin:0;font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--color-text-secondary, #6e6e73);border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .06));padding-bottom:.5rem}.user-form__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-form__field--bio[_ngcontent-%COMP%]{align-items:start}.user-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);white-space:nowrap}.user-form__required[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.user-form__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text, #1d1d1f)}.user-form__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.875rem}.user-form__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease;resize:none}.user-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.user-form__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.user-form__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.user-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.user-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.user-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{B as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as we}from"./chunk-WFACDK2M.js";import{a as Se}from"./chunk-LRFTCV6X.js";import{a as ke,b as Ee}from"./chunk-U4IRQFQX.js";import{a as Ie}from"./chunk-3KLIHIYI.js";import{a as fe}from"./chunk-63CH53ZX.js";import{a as _e,b as be,c as ve,d as xe}from"./chunk-SQWYD6HJ.js";import{a as Ce,b as he,c as q}from"./chunk-IAIUV3RV.js";import"./chunk-7BVQ2WHQ.js";import{a as ye}from"./chunk-TT7A5DFQ.js";import"./chunk-5V6YWKKW.js";import{a as J}from"./chunk-ZX7BSCA5.js";import{a as le,b as ge,c as ue}from"./chunk-Q4QETBSU.js";import{a as Me,b as Oe}from"./chunk-JBAFVFZR.js";import{a as Ae,b as Pe}from"./chunk-BFRQNDIH.js";import{a as $,e as G,j as K}from"./chunk-5TU5JR3W.js";import"./chunk-CHH2YNB6.js";import{a as V,c as P}from"./chunk-32554AB2.js";import{o as Y}from"./chunk-26Y7QHUX.js";import"./chunk-NXKPUZGQ.js";import"./chunk-QN7OUZIZ.js";import{a as W}from"./chunk-BVQ4XPRS.js";import"./chunk-HTKDXFLE.js";import"./chunk-7VQ75OC6.js";import"./chunk-NNVKL253.js";import{Bb as D,Cb as H,Db as C,Eb as N,Fb as _,Ic as B,Ka as m,Rb as z,Tb as i,Ub as h,Uc as j,Wa as p,ca as d,ec as L,fc as U,ga as S,ha as k,kb as w,lb as l,lc as R,ma as E,mb as g,pb as F,qb as T,rb as y,sb as a,ta as b,tb as s,ub as x,vb as u,wb as f,xb as A}from"./chunk-QDO3O2UB.js";var t=()=>!0;var De=[{path:"",loadComponent:()=>import("./chunk-OGRY5XOW.js").then(e=>e.AgentosShellComponent),children:[{path:"home",canActivate:[t],loadComponent:()=>import("./chunk-JVDPRI2N.js").then(e=>e.CaseShellComponent)},{path:"",loadComponent:()=>import("./chunk-2AZPKCT2.js").then(e=>e.LayoutComponent),children:[{path:"namespaces/new",canActivate:[t],loadComponent:()=>import("./chunk-PG25CCE5.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces/:namespaceId/edit",canActivate:[t],loadComponent:()=>import("./chunk-PG25CCE5.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces",canActivate:[t],loadComponent:()=>import("./chunk-M3ZPITZW.js").then(e=>e.NamespaceListComponent)},{path:"admin",canActivate:[t],loadComponent:()=>import("./chunk-6PK5FNSW.js").then(e=>e.AdminHomeComponent)},{path:"admin/users/new",canActivate:[t],loadComponent:()=>import("./chunk-QP5FMZO7.js").then(e=>e.UserFormComponent)},{path:"admin/users/:userId/edit",canActivate:[t],loadComponent:()=>import("./chunk-QP5FMZO7.js").then(e=>e.UserFormComponent)},{path:"admin/users",canActivate:[t],loadComponent:()=>import("./chunk-XKH66LUP.js").then(e=>e.UserListComponent)},{path:"admin/integration-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-2DY4SDDH.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-2DY4SDDH.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs",canActivate:[t],loadComponent:()=>import("./chunk-AUQEDCYM.js").then(e=>e.PlatformIntegrationConfigsComponent)},{path:"admin/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-RULUSI5M.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-RULUSI5M.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts",canActivate:[t],loadComponent:()=>import("./chunk-Y2UH6C4J.js").then(e=>e.PlatformPromptsComponent)},{path:"admin/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-VSCZ2PDC.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-VSCZ2PDC.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-Y32N3VH4.js").then(e=>e.PlatformAiProvidersComponent)},{path:"admin/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-JLMNYKPP.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-JLMNYKPP.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-4MF2HW3L.js").then(e=>e.PlatformAiModelsComponent)},{path:"admin/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-RMX22TIL.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-RMX22TIL.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-2S57CBYZ.js").then(e=>e.AgentConfigInspectComponent)},{path:"admin/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-QNFNT462.js").then(e=>e.PlatformAgentConfigsComponent)},{path:"me",canActivate:[t],loadComponent:()=>import("./chunk-HCFETNQ6.js").then(e=>e.UserProfileComponent)},{path:"user",canActivate:[t],loadComponent:()=>import("./chunk-HCFETNQ6.js").then(e=>e.UserProfileComponent)},{path:":namespaceId/integrations/new",canActivate:[t],loadComponent:()=>import("./chunk-2DY4SDDH.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-2DY4SDDH.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations",canActivate:[t],loadComponent:()=>import("./chunk-UMIKI5LE.js").then(e=>e.IntegrationsAllScopesComponent)},{path:":namespaceId/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-VSCZ2PDC.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-VSCZ2PDC.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-MXVXTRUI.js").then(e=>e.AiProvidersAllScopesComponent)},{path:":namespaceId/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-JLMNYKPP.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-JLMNYKPP.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-CGTCICKZ.js").then(e=>e.NamespaceAiModelsComponent)},{path:":namespaceId/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-RULUSI5M.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-RULUSI5M.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts",canActivate:[t],loadComponent:()=>import("./chunk-SJFPTVIP.js").then(e=>e.NamespacePromptsComponent)},{path:":namespaceId/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-RMX22TIL.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-RMX22TIL.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-2S57CBYZ.js").then(e=>e.AgentConfigInspectComponent)},{path:":namespaceId/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-5WOINLAX.js").then(e=>e.NamespaceAgentConfigsComponent)},{path:"",redirectTo:"namespaces",pathMatch:"full"}]}]}];function te(e,o){e&1&&A(0,"span",1)}function ne(e,o){e&1&&A(0,"span",2)}function oe(e,o){e&1&&A(0,"span",3)}var v=class e{pluginService=d(K);online=b(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=p({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(n,r){if(n&1&&(u(0,"div",0),l(1,te,1,0,"span",1)(2,ne,1,0,"span",2)(3,oe,1,0,"span",3),f()),n&2){let c;m(),g((c=r.online())===!0?1:c===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};function ae(e,o){if(e&1){let n=D();a(0,"button",9),C("click",function(){S(n);let c=_();return k(c.navigateToAdmin())}),a(1,"span",10),i(2,"\u2699\uFE0F"),s()()}}function ie(e,o){if(e&1&&(a(0,"span",7),i(1),s()),e&2){let n=_();m(),h(n.userInitials)}}function re(e,o){e&1&&(a(0,"span",8),i(1,"\u25EF"),s())}var Q=class e{router=d(P);userState=d(J);destroyRef=d(E);currentUser=this.userState.currentUser;navigateHome(){this.router.navigate(["/agentos/home"])}isAdmin=R(()=>this.userState.currentUser()?.isAdmin===!0);navigateToAdmin(){this.router.navigate(["/agentos/admin"])}ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(W(this.destroyRef)).subscribe()}get userInitials(){let o=this.currentUser();if(!o)return"";let n=o.firstname?.[0]??"",r=o.lastname?.[0]??"";return(n+r).toUpperCase()||o.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=p({type:e,selectors:[["agentos-header"]],decls:11,vars:5,consts:[[1,"header"],["type","button","title","Home",1,"header__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button","title","Admin",1,"header__admin-btn"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"],["type","button","title","Admin",1,"header__admin-btn",3,"click"],[1,"header__admin-icon"]],template:function(n,r){n&1&&(a(0,"header",0)(1,"button",1),C("click",function(){return r.navigateHome()}),x(2,"img",2),a(3,"span",3),i(4,"Coday"),s()(),a(5,"nav",4),x(6,"agentos-backend-status"),l(7,ae,3,0,"button",5),a(8,"button",6),C("click",function(){return r.toggleProfile()}),l(9,ie,2,1,"span",7)(10,re,2,0,"span",8),s()()()),n&2&&(m(7),g(r.isAdmin()?7:-1),m(),z("header__user-btn--active",r.isOnProfilePage),y("title",r.isOnProfilePage?"Back":"My profile"),m(),g(r.userInitials?9:10))},dependencies:[v],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;background:none;border:none;padding:0;cursor:pointer;border-radius:6px;transition:opacity .15s ease}.header__brand[_ngcontent-%COMP%]:hover{opacity:.7}.header__logo-img[_ngcontent-%COMP%]{width:32px;height:32px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;letter-spacing:-.01em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__admin-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit;font-size:1rem;line-height:1}.header__admin-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__admin-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};function se(e,o){e&1&&(u(0,"p",6),i(1,"No cases yet. Start one below."),f())}function me(e,o){if(e&1&&(u(0,"div",7)(1,"span",8),i(2),f(),u(3,"span",9),i(4),f()()),e&2){let n=o.$implicit;m(2),h(n.id),m(2),h(n.status)}}function ce(e,o){if(e&1&&F(0,me,5,2,"div",7,w().trackById,!0),e&2){let n=_();T(n)}}function de(e,o){e&1&&l(0,se,2,0,"p",6)(1,ce,2,0),e&2&&g(o.length===0?0:1)}var X=class e{http=d(j);router=d(P);route=d(V);config=d($);caseController=d(G);preferences=d(q);namespaceId=this.route.snapshot.params.namespaceId;cases$=this.caseController.listByParentCase(this.namespaceId);inputValue=b("");onInput(o){this.inputValue.set(o.target.value)}onKeydown(o){this.preferences.shouldSend(o)&&(o.preventDefault(),this.submit())}submit(){this.inputValue().trim()&&this.http.post(`${this.config.basePath}/api/cases`,{namespaceId:this.namespaceId,metadata:{}}).subscribe(n=>{this.inputValue.set(""),this.router.navigate(["/agentos",this.namespaceId,"cases",n.id??""])})}trackById(o,n){return n.id??""}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=p({type:e,selectors:[["agentos-case-list"]],decls:11,vars:5,consts:[[1,"case-list"],[1,"case-list__header"],[1,"case-list__items"],[1,"case-list__composer"],["placeholder","Start a new case\u2026","rows","3",1,"case-list__input",3,"input","keydown","value"],[1,"case-list__hint"],[1,"case-list__empty"],[1,"case-list__item"],[1,"case-list__item-id"],[1,"case-list__item-status"]],template:function(n,r){if(n&1&&(u(0,"div",0)(1,"header",1)(2,"h2"),i(3,"Cases"),f()(),u(4,"div",2),l(5,de,2,1),L(6,"async"),f(),u(7,"div",3)(8,"textarea",4),N("input",function(I){return r.onInput(I)})("keydown",function(I){return r.onKeydown(I)}),f(),u(9,"p",5),i(10),f()()()),n&2){let c;m(5),g((c=U(6,3,r.cases$))?5:-1,c),m(3),H("value",r.inputValue()),m(2),h(r.preferences.composerHint())}},dependencies:[B],styles:[".case-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-width:720px;margin:0 auto;padding:2rem;gap:1.5rem}.case-list__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.case-list__items[_ngcontent-%COMP%]{flex:1;overflow-y:auto}.case-list__empty[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.case-list__composer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.case-list__input[_ngcontent-%COMP%]{width:100%;resize:none;padding:.75rem 1rem;border-radius:12px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));color:var(--color-text, #1d1d1f);font-size:.95rem;font-family:inherit;line-height:1.5;outline:none;box-sizing:border-box;transition:border-color .15s ease}.case-list__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.case-list__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.case-list__hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73);opacity:.7}"]})};var Z=class e{case;static toListItem(o){return{id:o.id??"",name:o.title??o.id??"\u2014",description:void 0}}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=p({type:e,selectors:[["agentos-case-item"]],inputs:{case:"case"},decls:0,vars:0,template:function(n,r){},encapsulation:2,changeDetection:0})};function pe(e,o){if(e&1&&(a(0,"p",11),i(1," Last action: "),a(2,"strong"),i(3),s()()),e&2){let n=_();m(3),h(n.lastAction())}}var ee=class e{lastAction=b(null);onSend(){this.lastAction.set("send")}onStop(){this.lastAction.set("stop")}onAttach(){this.lastAction.set("attach")}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=p({type:e,selectors:[["agentos-hello"]],decls:35,vars:2,consts:[[1,"hello-agentos"],[1,"card"],[1,"badge"],[1,"principles"],[1,"demo"],[1,"demo-label"],[1,"demo-buttons"],["icon","send","variant","primary","title","Send",3,"action"],["icon","stop","variant","danger","title","Stop",3,"action"],["icon","attach_file","variant","default","title","Attach",3,"action"],["icon","mic","variant","default","title","Record",3,"action","disabled"],[1,"demo-feedback"]],template:function(n,r){n&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),i(3,"AgentOS UI"),s(),a(4,"h1"),i(5,"Hello AgentOS"),s(),a(6,"p"),i(7," This component lives in "),a(8,"code"),i(9,"libs/agentos-ui"),s(),i(10," \u2014 isolated from Coday internals, ready to be published as "),a(11,"code"),i(12,"@whoz-oss/agentos-ui"),s(),i(13,". "),s(),x(14,"agentos-backend-status"),a(15,"ul",3)(16,"li"),i(17,"\u2726 No imports from Coday app"),s(),a(18,"li"),i(19,"\u2726 CSS custom properties as host contract"),s(),a(20,"li"),i(21,"\u2726 Standalone Angular components"),s(),a(22,"li"),i(23,"\u2726 Signals-first reactive state"),s()(),a(24,"div",4)(25,"p",5),i(26,"ds-icon-button from "),a(27,"code"),i(28,"@whoz-oss/design-system"),s()(),a(29,"div",6)(30,"ds-icon-button",7),C("action",function(){return r.onSend()}),s(),a(31,"ds-icon-button",8),C("action",function(){return r.onStop()}),s(),a(32,"ds-icon-button",9),C("action",function(){return r.onAttach()}),s(),a(33,"ds-icon-button",10),C("action",function(){return r.onAttach()}),s()(),l(34,pe,4,1,"p",11),s()()()),n&2&&(m(33),y("disabled",!0),m(),g(r.lastAction()?34:-1))},dependencies:[Y,v],styles:['@charset "UTF-8";.hello-agentos[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:2rem}.card[_ngcontent-%COMP%]{background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .15));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:20px;padding:3rem;max-width:480px;width:100%;text-align:center}.badge[_ngcontent-%COMP%]{display:inline-block;background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.25rem .75rem;border-radius:100px;margin-bottom:1.5rem}h1[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f);font-size:2rem;font-weight:700;margin:0 0 1rem;letter-spacing:-.02em}p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);line-height:1.6;margin:0 0 1.5rem}p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.principles[_ngcontent-%COMP%]{list-style:none;margin:0 0 1.5rem;padding:0;text-align:left;display:flex;flex-direction:column;gap:.5rem}.principles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;padding:.5rem .75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:8px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%]{border-top:1px solid var(--color-border-light, rgba(40, 40, 40, .08));padding-top:1.25rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.8rem;margin:0 0 .75rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.demo[_ngcontent-%COMP%] .demo-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:12px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73)}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}']})};export{De as AGENTOS_ROUTES,Ae as ActionCardChipsDirective,Pe as ActionCardComponent,fe as AgentosShellComponent,ge as AgentosThemeService,he as AgentosUserPreferencesService,v as BackendStatusComponent,_e as CaseChatComponent,ve as CaseDrawerComponent,be as CaseHomeComponent,Z as CaseItemComponent,X as CaseListComponent,xe as CaseShellComponent,Ce as ENTER_KEY_BEHAVIORS,Q as HeaderComponent,ee as HelloAgentosComponent,ye as LayoutComponent,we as MarkdownPipe,Me as NamespaceItemComponent,Oe as NamespaceListComponent,le as THEME_MODES,ue as THEME_PORT,q as USER_PREFERENCES_PORT,Ie as UserAdminStateService,Se as UserFormComponent,ke as UserItemComponent,Ee as UserListComponent,J as UserStateService,t as agentosReadyGuard};
|
|
1
|
+
import{a as Ge}from"./chunk-3FFHE56W.js";import{a as Ke,b as We}from"./chunk-7RVP2EHC.js";import{a as $e}from"./chunk-A34IERCN.js";import{a as fe}from"./chunk-J5W3AZMJ.js";import{a as _e,b as be,c as ve,d as xe,e as ye,f as Ae,g as Pe,h as Me,i as Oe,j as Ie,k as Se,l as Ee,m as we,n as Fe,o as Te,p as De,q as He,r as Ne,s as ze,t as Le}from"./chunk-7FTSWXXP.js";import{a as ke}from"./chunk-XC3I4AWV.js";import{a as Ce,b as he,c as q}from"./chunk-NCFBQG5D.js";import"./chunk-O37JOBGG.js";import{a as Ue}from"./chunk-ZPHUI4F6.js";import"./chunk-IDD4RLL7.js";import{a as J}from"./chunk-2BN4B3OL.js";import{a as le,b as ge,c as ue}from"./chunk-7EHCV7WH.js";import{a as je,b as Ve}from"./chunk-TEJQAOQQ.js";import{a as Re,b as Be}from"./chunk-UFZICL7S.js";import{a as $,e as G,k as K}from"./chunk-W7ZS65Y4.js";import"./chunk-WIYSZEOD.js";import{a as V,c as P}from"./chunk-P4GNUQZT.js";import{r as Y}from"./chunk-K7JRH3HO.js";import"./chunk-EBAEYY2S.js";import"./chunk-BZ7URUNM.js";import{a as W}from"./chunk-SKBT6DBT.js";import"./chunk-GF3EMWCA.js";import"./chunk-Z6RFJ6L3.js";import"./chunk-OPSHMM4H.js";import{Bb as D,Cb as H,Db as C,Eb as N,Fb as _,Jc as B,Ka as m,Rb as z,Tb as i,Ub as h,Vc as j,Wa as p,ca as d,ec as L,fc as U,ga as S,ha as k,kb as w,lb as l,lc as R,ma as E,mb as g,pb as F,qb as T,rb as y,sb as a,ta as b,tb as s,ub as x,vb as u,wb as f,xb as A}from"./chunk-5NLXR4MK.js";var t=()=>!0;var Je=[{path:"",loadComponent:()=>import("./chunk-GDWZ2TMN.js").then(e=>e.AgentosShellComponent),children:[{path:"home",canActivate:[t],loadComponent:()=>import("./chunk-VPYY4J2W.js").then(e=>e.CaseShellComponent)},{path:"",loadComponent:()=>import("./chunk-RTAXT4D4.js").then(e=>e.LayoutComponent),children:[{path:"namespaces/new",canActivate:[t],loadComponent:()=>import("./chunk-3F2YMBKP.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces/:namespaceId/edit",canActivate:[t],loadComponent:()=>import("./chunk-3F2YMBKP.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces",canActivate:[t],loadComponent:()=>import("./chunk-ONZHMPPP.js").then(e=>e.NamespaceListComponent)},{path:"admin",canActivate:[t],loadComponent:()=>import("./chunk-JCMCMBHO.js").then(e=>e.AdminHomeComponent)},{path:"admin/users/new",canActivate:[t],loadComponent:()=>import("./chunk-SDINNYUR.js").then(e=>e.UserFormComponent)},{path:"admin/users/:userId/edit",canActivate:[t],loadComponent:()=>import("./chunk-SDINNYUR.js").then(e=>e.UserFormComponent)},{path:"admin/users",canActivate:[t],loadComponent:()=>import("./chunk-MSMRBM6R.js").then(e=>e.UserListComponent)},{path:"admin/integration-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-2HEJ7K6I.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-2HEJ7K6I.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs",canActivate:[t],loadComponent:()=>import("./chunk-XEZKOM4R.js").then(e=>e.PlatformIntegrationConfigsComponent)},{path:"admin/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-TUARXNRR.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-TUARXNRR.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts",canActivate:[t],loadComponent:()=>import("./chunk-W7YYBRGC.js").then(e=>e.PlatformPromptsComponent)},{path:"admin/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-GCJZKHAW.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-GCJZKHAW.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-GVYMNRD4.js").then(e=>e.PlatformAiProvidersComponent)},{path:"admin/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-V3HCXJKS.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-V3HCXJKS.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-C47ZCNLR.js").then(e=>e.PlatformAiModelsComponent)},{path:"admin/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-F4BSKSY7.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-F4BSKSY7.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-EFCODPLG.js").then(e=>e.AgentConfigInspectComponent)},{path:"admin/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-DEXRATBM.js").then(e=>e.PlatformAgentConfigsComponent)},{path:"me",canActivate:[t],loadComponent:()=>import("./chunk-QCUONBHJ.js").then(e=>e.UserProfileComponent)},{path:"user",canActivate:[t],loadComponent:()=>import("./chunk-QCUONBHJ.js").then(e=>e.UserProfileComponent)},{path:":namespaceId/integrations/new",canActivate:[t],loadComponent:()=>import("./chunk-2HEJ7K6I.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-2HEJ7K6I.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations",canActivate:[t],loadComponent:()=>import("./chunk-5GF6TTRK.js").then(e=>e.IntegrationsAllScopesComponent)},{path:":namespaceId/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-GCJZKHAW.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-GCJZKHAW.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-J7IFGV56.js").then(e=>e.AiProvidersAllScopesComponent)},{path:":namespaceId/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-V3HCXJKS.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-V3HCXJKS.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-JIPJ76UT.js").then(e=>e.NamespaceAiModelsComponent)},{path:":namespaceId/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-TUARXNRR.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-TUARXNRR.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts",canActivate:[t],loadComponent:()=>import("./chunk-6MPSH5Y7.js").then(e=>e.NamespacePromptsComponent)},{path:":namespaceId/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-F4BSKSY7.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-F4BSKSY7.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-EFCODPLG.js").then(e=>e.AgentConfigInspectComponent)},{path:":namespaceId/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-MVRV42NP.js").then(e=>e.NamespaceAgentConfigsComponent)},{path:"",redirectTo:"namespaces",pathMatch:"full"}]}]}];function te(e,o){e&1&&A(0,"span",1)}function ne(e,o){e&1&&A(0,"span",2)}function oe(e,o){e&1&&A(0,"span",3)}var v=class e{pluginService=d(K);online=b(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=p({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(n,r){if(n&1&&(u(0,"div",0),l(1,te,1,0,"span",1)(2,ne,1,0,"span",2)(3,oe,1,0,"span",3),f()),n&2){let c;m(),g((c=r.online())===!0?1:c===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};function ae(e,o){if(e&1){let n=D();a(0,"button",9),C("click",function(){S(n);let c=_();return k(c.navigateToAdmin())}),a(1,"span",10),i(2,"\u2699\uFE0F"),s()()}}function ie(e,o){if(e&1&&(a(0,"span",7),i(1),s()),e&2){let n=_();m(),h(n.userInitials)}}function re(e,o){e&1&&(a(0,"span",8),i(1,"\u25EF"),s())}var Q=class e{router=d(P);userState=d(J);destroyRef=d(E);currentUser=this.userState.currentUser;navigateHome(){this.router.navigate(["/agentos/home"])}isAdmin=R(()=>this.userState.currentUser()?.isAdmin===!0);navigateToAdmin(){this.router.navigate(["/agentos/admin"])}ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(W(this.destroyRef)).subscribe()}get userInitials(){let o=this.currentUser();if(!o)return"";let n=o.firstname?.[0]??"",r=o.lastname?.[0]??"";return(n+r).toUpperCase()||o.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=p({type:e,selectors:[["agentos-header"]],decls:11,vars:5,consts:[[1,"header"],["type","button","title","Home",1,"header__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button","title","Admin",1,"header__admin-btn"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"],["type","button","title","Admin",1,"header__admin-btn",3,"click"],[1,"header__admin-icon"]],template:function(n,r){n&1&&(a(0,"header",0)(1,"button",1),C("click",function(){return r.navigateHome()}),x(2,"img",2),a(3,"span",3),i(4,"Coday"),s()(),a(5,"nav",4),x(6,"agentos-backend-status"),l(7,ae,3,0,"button",5),a(8,"button",6),C("click",function(){return r.toggleProfile()}),l(9,ie,2,1,"span",7)(10,re,2,0,"span",8),s()()()),n&2&&(m(7),g(r.isAdmin()?7:-1),m(),z("header__user-btn--active",r.isOnProfilePage),y("title",r.isOnProfilePage?"Back":"My profile"),m(),g(r.userInitials?9:10))},dependencies:[v],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;background:none;border:none;padding:0;cursor:pointer;border-radius:6px;transition:opacity .15s ease}.header__brand[_ngcontent-%COMP%]:hover{opacity:.7}.header__logo-img[_ngcontent-%COMP%]{width:32px;height:32px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;letter-spacing:-.01em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__admin-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit;font-size:1rem;line-height:1}.header__admin-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__admin-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};function se(e,o){e&1&&(u(0,"p",6),i(1,"No cases yet. Start one below."),f())}function me(e,o){if(e&1&&(u(0,"div",7)(1,"span",8),i(2),f(),u(3,"span",9),i(4),f()()),e&2){let n=o.$implicit;m(2),h(n.id),m(2),h(n.status)}}function ce(e,o){if(e&1&&F(0,me,5,2,"div",7,w().trackById,!0),e&2){let n=_();T(n)}}function de(e,o){e&1&&l(0,se,2,0,"p",6)(1,ce,2,0),e&2&&g(o.length===0?0:1)}var X=class e{http=d(j);router=d(P);route=d(V);config=d($);caseController=d(G);preferences=d(q);namespaceId=this.route.snapshot.params.namespaceId;cases$=this.caseController.listByParentCase(this.namespaceId);inputValue=b("");onInput(o){this.inputValue.set(o.target.value)}onKeydown(o){this.preferences.shouldSend(o)&&(o.preventDefault(),this.submit())}submit(){this.inputValue().trim()&&this.http.post(`${this.config.basePath}/api/cases`,{namespaceId:this.namespaceId,metadata:{}}).subscribe(n=>{this.inputValue.set(""),this.router.navigate(["/agentos",this.namespaceId,"cases",n.id??""])})}trackById(o,n){return n.id??""}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=p({type:e,selectors:[["agentos-case-list"]],decls:11,vars:5,consts:[[1,"case-list"],[1,"case-list__header"],[1,"case-list__items"],[1,"case-list__composer"],["placeholder","Start a new case\u2026","rows","3",1,"case-list__input",3,"input","keydown","value"],[1,"case-list__hint"],[1,"case-list__empty"],[1,"case-list__item"],[1,"case-list__item-id"],[1,"case-list__item-status"]],template:function(n,r){if(n&1&&(u(0,"div",0)(1,"header",1)(2,"h2"),i(3,"Cases"),f()(),u(4,"div",2),l(5,de,2,1),L(6,"async"),f(),u(7,"div",3)(8,"textarea",4),N("input",function(I){return r.onInput(I)})("keydown",function(I){return r.onKeydown(I)}),f(),u(9,"p",5),i(10),f()()()),n&2){let c;m(5),g((c=U(6,3,r.cases$))?5:-1,c),m(3),H("value",r.inputValue()),m(2),h(r.preferences.composerHint())}},dependencies:[B],styles:[".case-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-width:720px;margin:0 auto;padding:2rem;gap:1.5rem}.case-list__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.case-list__items[_ngcontent-%COMP%]{flex:1;overflow-y:auto}.case-list__empty[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.case-list__composer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.case-list__input[_ngcontent-%COMP%]{width:100%;resize:none;padding:.75rem 1rem;border-radius:12px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));color:var(--color-text, #1d1d1f);font-size:.95rem;font-family:inherit;line-height:1.5;outline:none;box-sizing:border-box;transition:border-color .15s ease}.case-list__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.case-list__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.case-list__hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73);opacity:.7}"]})};var Z=class e{case;static toListItem(o){return{id:o.id??"",name:o.title??o.id??"\u2014",description:void 0}}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=p({type:e,selectors:[["agentos-case-item"]],inputs:{case:"case"},decls:0,vars:0,template:function(n,r){},encapsulation:2,changeDetection:0})};function pe(e,o){if(e&1&&(a(0,"p",11),i(1," Last action: "),a(2,"strong"),i(3),s()()),e&2){let n=_();m(3),h(n.lastAction())}}var ee=class e{lastAction=b(null);onSend(){this.lastAction.set("send")}onStop(){this.lastAction.set("stop")}onAttach(){this.lastAction.set("attach")}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=p({type:e,selectors:[["agentos-hello"]],decls:35,vars:2,consts:[[1,"hello-agentos"],[1,"card"],[1,"badge"],[1,"principles"],[1,"demo"],[1,"demo-label"],[1,"demo-buttons"],["icon","send","variant","primary","title","Send",3,"action"],["icon","stop","variant","danger","title","Stop",3,"action"],["icon","attach_file","variant","default","title","Attach",3,"action"],["icon","mic","variant","default","title","Record",3,"action","disabled"],[1,"demo-feedback"]],template:function(n,r){n&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),i(3,"AgentOS UI"),s(),a(4,"h1"),i(5,"Hello AgentOS"),s(),a(6,"p"),i(7," This component lives in "),a(8,"code"),i(9,"libs/agentos-ui"),s(),i(10," \u2014 isolated from Coday internals, ready to be published as "),a(11,"code"),i(12,"@whoz-oss/agentos-ui"),s(),i(13,". "),s(),x(14,"agentos-backend-status"),a(15,"ul",3)(16,"li"),i(17,"\u2726 No imports from Coday app"),s(),a(18,"li"),i(19,"\u2726 CSS custom properties as host contract"),s(),a(20,"li"),i(21,"\u2726 Standalone Angular components"),s(),a(22,"li"),i(23,"\u2726 Signals-first reactive state"),s()(),a(24,"div",4)(25,"p",5),i(26,"ds-icon-button from "),a(27,"code"),i(28,"@whoz-oss/design-system"),s()(),a(29,"div",6)(30,"ds-icon-button",7),C("action",function(){return r.onSend()}),s(),a(31,"ds-icon-button",8),C("action",function(){return r.onStop()}),s(),a(32,"ds-icon-button",9),C("action",function(){return r.onAttach()}),s(),a(33,"ds-icon-button",10),C("action",function(){return r.onAttach()}),s()(),l(34,pe,4,1,"p",11),s()()()),n&2&&(m(33),y("disabled",!0),m(),g(r.lastAction()?34:-1))},dependencies:[Y,v],styles:['@charset "UTF-8";.hello-agentos[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:2rem}.card[_ngcontent-%COMP%]{background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .15));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:20px;padding:3rem;max-width:480px;width:100%;text-align:center}.badge[_ngcontent-%COMP%]{display:inline-block;background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.25rem .75rem;border-radius:100px;margin-bottom:1.5rem}h1[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f);font-size:2rem;font-weight:700;margin:0 0 1rem;letter-spacing:-.02em}p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);line-height:1.6;margin:0 0 1.5rem}p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.principles[_ngcontent-%COMP%]{list-style:none;margin:0 0 1.5rem;padding:0;text-align:left;display:flex;flex-direction:column;gap:.5rem}.principles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;padding:.5rem .75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:8px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%]{border-top:1px solid var(--color-border-light, rgba(40, 40, 40, .08));padding-top:1.25rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.8rem;margin:0 0 .75rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.demo[_ngcontent-%COMP%] .demo-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:12px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73)}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}']})};export{Je as AGENTOS_ROUTES,Re as ActionCardChipsDirective,Be as ActionCardComponent,fe as AgentosShellComponent,ge as AgentosThemeService,he as AgentosUserPreferencesService,v as BackendStatusComponent,He as CaseChatComponent,ze as CaseDrawerComponent,Ne as CaseHomeComponent,Z as CaseItemComponent,X as CaseListComponent,Le as CaseShellComponent,Ce as ENTER_KEY_BEHAVIORS,Ee as ExchangeContentViewerComponent,Te as ExchangeDrawerComponent,Fe as ExchangeFileListComponent,we as ExchangeItemComponent,De as ExchangeShellComponent,_e as ExchangeStateService,Q as HeaderComponent,ee as HelloAgentosComponent,Ue as LayoutComponent,be as MAX_VIEWABLE_SIZE,ke as MarkdownPipe,je as NamespaceItemComponent,Ve as NamespaceListComponent,le as THEME_MODES,ue as THEME_PORT,q as USER_PREFERENCES_PORT,$e as UserAdminStateService,Ge as UserFormComponent,Ke as UserItemComponent,We as UserListComponent,J as UserStateService,t as agentosReadyGuard,Oe as canViewFile,Ae as detectFormat,Se as exchangeMutationScope,ye as formatDate,xe as formatSize,ve as getFileIcon,Pe as isFormatViewable,Me as isViewable,Ie as reindentJson};
|