@whoz-oss/coday-client 0.0.0-workstream-forge.75 → 0.0.0-workstream-forge.76
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-MhUYxl3Z.js → chunk-1-KrEAQ8.js} +1 -1
- package/browser/{chunk-C0RjV9YR.js → chunk-1ZOpOUaW.js} +1 -1
- package/browser/chunk-23kAEj3q.js +2 -0
- package/browser/chunk-9HWe8Wzy.js +2 -0
- package/browser/chunk-B7rj3sQ7.js +1 -0
- package/browser/{chunk-CFuJNk7Q.js → chunk-BEDBkVgu.js} +1 -1
- package/browser/{chunk-DwLys37P.js → chunk-BIcQB7sK.js} +2 -2
- package/browser/{chunk-B1nDWA3v.js → chunk-BJPaMiDs.js} +1 -1
- package/browser/chunk-BV6wT0T7.js +5 -0
- package/browser/{chunk-BRFVbU6N.js → chunk-BY47yNsu.js} +1 -1
- package/browser/{chunk-BlYydhGT.js → chunk-B_Py0laY.js} +1 -1
- package/browser/chunk-BbByOPta.js +1 -0
- package/browser/{chunk-D9lhavsa.js → chunk-BbMI-wyK.js} +1 -1
- package/browser/chunk-Bfu0wybG.js +1 -0
- package/browser/{chunk-AJHLyP2Q.js → chunk-Bn4OSece.js} +1 -1
- package/browser/{chunk-tzI8SDtI.js → chunk-Bxgh-sAQ.js} +1 -1
- package/browser/chunk-C4p5x-Re.js +1 -0
- package/browser/chunk-C8fG3ERr.js +1 -0
- package/browser/chunk-CFcZA3SB.js +1 -0
- package/browser/{chunk-42jw_j0t.js → chunk-CHA2XJzk.js} +1 -1
- package/browser/chunk-CHNPg49w.js +1 -0
- package/browser/{chunk-DrGGZMUF.js → chunk-CKYIYMkc.js} +1 -1
- package/browser/chunk-CLfIuVc-.js +1 -0
- package/browser/chunk-CNACVa7Q.js +1 -0
- package/browser/{chunk-CoVye3Su.js → chunk-CNqpO_FY.js} +1 -1
- package/browser/{chunk-13WTmKep.js → chunk-CObrRIdZ.js} +1 -1
- package/browser/chunk-CPvGhzK5.js +1 -0
- package/browser/{chunk-6Be7kW0o.js → chunk-CS6qKxYt.js} +2 -2
- package/browser/chunk-CUSpXmFJ.js +10 -0
- package/browser/chunk-CVUqtHak.js +1 -0
- package/browser/{chunk-Dw-TsQE6.js → chunk-CW5ww82f.js} +1 -1
- package/browser/{chunk-Ccxus4_o.js → chunk-CZukyo2x.js} +1 -1
- package/browser/{chunk-BwapsUV-.js → chunk-CdDsCzf_.js} +1 -1
- package/browser/chunk-Cf0_2K6h.js +1 -0
- package/browser/{chunk-DYWO9D4-.js → chunk-Cf8N4Po0.js} +1 -1
- package/browser/{chunk-B0es9TQT.js → chunk-Ch_3uDw1.js} +6 -6
- package/browser/{chunk-CIMARU-Z.js → chunk-CnA_64qx.js} +2 -2
- package/browser/{chunk-D2VUzw11.js → chunk-Co7LObXe.js} +1 -1
- package/browser/chunk-CpwsvvJd.js +1 -0
- package/browser/chunk-Cq3Oy7Pe.js +1 -0
- package/browser/chunk-CsGeokjB.js +1 -0
- package/browser/chunk-CuVobvV0.js +1 -0
- package/browser/{chunk-Cr26pdWO.js → chunk-Cv0bIOvb.js} +2 -2
- package/browser/chunk-CvJVgZVG.js +1 -0
- package/browser/{chunk-C7774IZF.js → chunk-CwSW3sva.js} +1 -1
- package/browser/chunk-D0VzbRBB.js +1 -0
- package/browser/{chunk-CY9LGSZW.js → chunk-D6XCHufv.js} +2 -2
- package/browser/{chunk-DqyQME6K.js → chunk-DBtTWzKs.js} +1 -1
- package/browser/{chunk-DsE7jEkK.js → chunk-DFWsBx8I.js} +1 -1
- package/browser/chunk-DRsOVECa.js +1 -0
- package/browser/{chunk-C5CsTmNj.js → chunk-DW3Z2BQ_.js} +1 -1
- package/browser/{chunk-o7tHGyvk.js → chunk-DZYWKX3_.js} +1 -1
- package/browser/{chunk-6VeNGs2-.js → chunk-DcFDoEYa.js} +2 -2
- package/browser/{chunk-D6Uyjin9.js → chunk-Di5xhd_-.js} +1 -1
- package/browser/chunk-DiLxoH8g.js +1 -0
- package/browser/chunk-Dlyg1uqt.js +1 -0
- package/browser/{chunk-BCvr3olm.js → chunk-Dogf5SPS.js} +1 -1
- package/browser/{chunk-DOfFWQHE.js → chunk-DpSzd2vn.js} +1 -1
- package/browser/{chunk-B9cQUPc7.js → chunk-Dvp8jh28.js} +1 -1
- package/browser/chunk-DwMUe-rB.js +1 -0
- package/browser/chunk-DzdxxH9i.js +1 -0
- package/browser/chunk-M4BGcfDm.js +1 -0
- package/browser/chunk-REIy3uOh.js +1 -0
- package/browser/{chunk-80hCpwon.js → chunk-VWHbjPE5.js} +1 -1
- package/browser/chunk-_pblMwFh.js +1 -0
- package/browser/chunk-as8Lizgv.js +1 -0
- package/browser/{chunk-C-7EKaLv.js → chunk-cK5FIedv.js} +1 -1
- package/browser/chunk-dv1zrw3r.js +1 -0
- package/browser/chunk-ndZvKF70.js +1 -0
- package/browser/{chunk-buMTi15H.js → chunk-sYIU2Sow.js} +2 -2
- package/browser/chunk-x6K9cFDx.js +1 -0
- package/browser/index.html +1 -1
- package/browser/main-5MNGHNLY.js +1811 -0
- package/package.json +1 -1
- package/browser/chunk-2hH5YbLe.js +0 -2
- package/browser/chunk-5lNA_LR4.js +0 -1
- package/browser/chunk-93qYG1j4.js +0 -1
- package/browser/chunk-AblS4pXb.js +0 -1
- package/browser/chunk-B1R1JDKX.js +0 -1
- package/browser/chunk-BJ3cmxps.js +0 -10
- package/browser/chunk-BYvnZ4jZ.js +0 -1
- package/browser/chunk-BcDCPUzh.js +0 -1
- package/browser/chunk-BmMRXr--.js +0 -1
- package/browser/chunk-BnVoIxkm.js +0 -1
- package/browser/chunk-Bs4cz8et.js +0 -1
- package/browser/chunk-Buv4bUwG.js +0 -1
- package/browser/chunk-C2h53xO8.js +0 -1
- package/browser/chunk-C519Azc-.js +0 -1
- package/browser/chunk-C5jla22M.js +0 -1
- package/browser/chunk-C8Lny5xG.js +0 -2
- package/browser/chunk-CBAzExoV.js +0 -1
- package/browser/chunk-CErujabN.js +0 -1
- package/browser/chunk-CIPMuL5o.js +0 -1
- package/browser/chunk-CJy6YujN.js +0 -1
- package/browser/chunk-CLQWshBg.js +0 -1
- package/browser/chunk-CNbCiJwC.js +0 -1
- package/browser/chunk-CQzD4hlX.js +0 -1
- package/browser/chunk-CTep3Zcv.js +0 -1
- package/browser/chunk-CUD8zCnQ.js +0 -1
- package/browser/chunk-CX09OqPp.js +0 -1
- package/browser/chunk-CrIQg7gg.js +0 -5
- package/browser/chunk-CtRqtZpo.js +0 -1
- package/browser/chunk-Cw_eJAWw.js +0 -1
- package/browser/chunk-D0rG88ee.js +0 -1
- package/browser/chunk-D4rIP_px.js +0 -1
- package/browser/chunk-DSohMG90.js +0 -1
- package/browser/chunk-DVa9gI4Z.js +0 -1
- package/browser/chunk-DdV87KC5.js +0 -1
- package/browser/chunk-DgQbMek3.js +0 -1
- package/browser/chunk-EzRHT4mT.js +0 -1
- package/browser/chunk-Iomqh4vI.js +0 -1
- package/browser/chunk-SyIy1dgS.js +0 -1
- package/browser/chunk-cwPycVUY.js +0 -1
- package/browser/chunk-zsOy-bBo.js +0 -1
- package/browser/main-A4H3MFZY.js +0 -1811
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {A,b as bt,k as kt}from'./chunk-
|
|
1
|
+
import {A,b as bt,k as kt}from'./chunk-CNqpO_FY.js';import {z as z$1}from'./chunk-CHA2XJzk.js';import {_ as _i}from'./chunk-D6XCHufv.js';import {f as f$1}from'./chunk-DBtTWzKs.js';import {Y as Ye,E as Et$1,y as yt$1,Z as Ze}from'./chunk-sYIU2Sow.js';import'./chunk-Co7LObXe.js';import {g,C as Ce,R as Re,F,p as pe,L,P,U,O as Ot$1,a as F$1,r as re,m as mT,G as Gi,x,w,b as U$1,l as le,f,c as b,d as O,V,e as xw,h as hr,i as pr,j as Gn$1,$ as $t$1,k as ws,n as GC,o as pl,q as Rg,J as Jw,S as Sg,s as rC,t as CC,X as XE,u as bg,v as eC,y as oC,z as Ug,T as Tg,A as dE,B as Pg,E as EC,I as IC,D as py,N,H as c,K as bd,M as By,Q as br,W as x$1,Y as z$2,Z as Ue,_ as zt$2,a0 as jt,a1 as Vt$1,a2 as Nt$1,a3 as VI,a4 as nC,a5 as vl,a6 as UI,a7 as ya,a8 as Yg,a9 as lC,aa as If,ab as wf,ac as gC,ad as Hg}from'./main-5MNGHNLY.js';import'./chunk-VWHbjPE5.js';import {x as xe,k as kt$1,C as Ct,z as ze$1}from'./chunk-DcFDoEYa.js';import {P as Pt$1,L as Lt$1}from'./chunk-CS6qKxYt.js';import {v as ve,n as ne}from'./chunk-CwSW3sva.js';import'./chunk-CObrRIdZ.js';import {W,k as ke$1,s as se}from'./chunk-BIcQB7sK.js';import {c as ce,n as nt,O as Ot$2,z as zt$1,T as Tn$1,S as Sn$1,a as ae}from'./chunk-1ZOpOUaW.js';import {I as In$1,E as Ee,z as ze,D as Dn$1,F as Fn$1}from'./chunk-Ch_3uDw1.js';import {V as Ve,n as ne$1,H as He,N as Ne}from'./chunk-Di5xhd_-.js';import {y as yt,w as wt$1,t as ti,Y as Ye$1,f as fn$1,Z as Zn,$ as $t$2,c as cn$1}from'./chunk-BEDBkVgu.js';var Ot=(a,t)=>t.name;function Et(a,t){if(a&1&&(ws(0,"mat-option",11),GC(1),pl()),a&2){let e=t.$implicit;bg("value",e),XE(),Yg(e);}}function Nt(a,t){a&1&&Sg(0,"mat-spinner",13);}function It(a,t){if(a&1&&(ws(0,"span",20),GC(1),pl()),a&2){let e=gC().$implicit;XE(),Yg(e.description);}}function At(a,t){if(a&1&&(ws(0,"mat-option",11)(1,"span",19),GC(2),pl(),Jw(3,It,2,1,"span",20),pl()),a&2){let e=t.$implicit;bg("value",e.name),XE(2),Yg(e.name),XE(),eC(e.description?3:-1);}}function Vt(a,t){if(a&1&&(ws(0,"mat-option",11),GC(1),pl()),a&2){let e=t.$implicit;bg("value",e),XE(),Yg(e);}}function Ft(a,t){if(a&1){let e=lC();ws(0,"div",25)(1,"mat-form-field",8)(2,"mat-label"),GC(3,"Name"),pl(),ws(4,"input",26),Rg("input",function(i){If(e);let l=gC(2);return wf(l.issueNumber.set(i.target.value))}),pl()(),ws(5,"mat-form-field",27)(6,"mat-label"),GC(7,"Type"),pl(),ws(8,"mat-select",28),Rg("selectionChange",function(i){If(e);let l=gC(2);return wf(l.branchType.set(i.value))}),rC(9,Vt,2,2,"mat-option",11,nC),pl()()();}if(a&2){let e=gC(2);XE(4),bg("value",e.issueNumber()),XE(4),bg("value",e.branchType()),XE(),oC(e.branchTypes);}}function Gt(a,t){a&1&&Sg(0,"mat-spinner",13);}function Rt(a,t){if(a&1&&(ws(0,"mat-option",11),GC(1),pl()),a&2){let e=t.$implicit;bg("value",e),XE(),Yg(e);}}function qt(a,t){if(a&1){let e=lC();ws(0,"mat-form-field",8)(1,"mat-label"),GC(2,"Source branch"),pl(),ws(3,"input",29,4),Rg("input",function(i){If(e);let l=gC(2);return wf(l.onBranchSearchInput(i.target.value))})("focus",function(){If(e);let i=CC(4),l=gC(2);return wf(l.openPanel(i))}),pl(),Jw(5,Gt,1,0,"mat-spinner",13),ws(6,"mat-autocomplete",10,5),Rg("optionSelected",function(i){If(e);let l=gC(2);return wf(l.selectBranch(i.option.value))}),rC(8,Rt,2,2,"mat-option",11,nC),pl()();}if(a&2){let e=CC(7),n=gC(2);XE(3),bg("value",n.branchSearch())("matAutocomplete",e)("disabled",n.isLoadingBranches()),XE(2),eC(n.isLoadingBranches()?5:-1),XE(3),oC(n.filteredBranches());}}function $t(a,t){if(a&1){let e=lC();ws(0,"div",21)(1,"button",22),Rg("click",function(){If(e);let i=gC();return wf(i.onModeChange("local"))}),ws(2,"mat-icon"),GC(3,"folder_open"),pl(),ws(4,"span",23),GC(5,"Local"),pl(),ws(6,"span",24),GC(7,"Work directly on the current branch"),pl()(),ws(8,"button",22),Rg("click",function(){If(e);let i=gC();return wf(i.onModeChange("worktree"))}),ws(9,"mat-icon"),GC(10,"account_tree"),pl(),ws(11,"span",23),GC(12,"Worktree"),pl(),ws(13,"span",24),GC(14,"Create an isolated worktree from a branch"),pl()()(),Jw(15,Ft,11,2,"div",25),Jw(16,qt,10,4,"mat-form-field",8);}if(a&2){let e=gC();XE(),Ug("active",e.mode()==="local"),XE(7),Ug("active",e.mode()==="worktree"),XE(7),eC(e.isWorktree()?15:-1),XE(),eC(e.isWorktree()?16:-1);}}function Lt(a,t){a&1&&Sg(0,"mat-spinner",18);}function zt(a,t){a&1&&(ws(0,"mat-icon"),GC(1,"rocket_launch"),pl());}function Bt(a,t){a&1&&(ws(0,"mat-icon"),GC(1,"open_in_new"),pl());}var ke=class a{projectApi=g(c);agentApi=g(f$1);dialogRef=g(z$2);projectState=g(P);forcedProject=F$1(this.projectState.forcedProject$,{initialValue:null});selectedProject=Gi("");projectSearch=Gi("");selectedAgent=Gi("");agentSearch=Gi("");mode=Gi("local");selectedBranch=Gi("");branchSearch=Gi("");issueNumber=Gi("");branchType=Gi("feature");task=Gi("");hasGit=Gi(false);branchTypes=["feature","fix","refactor","chore","docs","build"];projects=Gi([]);agents=Gi([]);branches=Gi([]);filteredProjects=mT(()=>{let t=this.projectSearch().toLowerCase();return t?this.projects().filter(e=>e.toLowerCase().includes(t)):this.projects()});filteredAgents=mT(()=>{let t=this.agentSearch().toLowerCase();return t?this.agents().filter(e=>e.name.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t)):this.agents()});filteredBranches=mT(()=>{let t=this.branchSearch().toLowerCase();return t?this.branches().filter(e=>e.toLowerCase().includes(t)):this.branches()});isLoadingAgents=Gi(false);isLoadingBranches=Gi(false);isSubmitting=Gi(false);isWorktree=mT(()=>this.mode()==="worktree"&&this.hasGit());isValid=mT(()=>{let t=this.projects().includes(this.selectedProject()),e=this.agents().some(i=>i.name===this.selectedAgent()),n=t&&e&&!!this.task().trim();return this.isWorktree()?n&&!!this.selectedBranch()&&!!this.issueNumber().trim()&&!!this.branchType():n});canNavigate=mT(()=>this.projects().includes(this.selectedProject()));openPanel(t){t.openPanel();}onProjectSearchInput(t){this.projectSearch.set(t),this.selectedProject()&&t!==this.selectedProject()&&(this.selectedProject.set(""),this.selectedAgent.set(""),this.agentSearch.set(""),this.agents.set([]));}selectProject(t){this.selectedProject.set(t),this.projectSearch.set(t),this.selectedAgent.set(""),this.agentSearch.set(""),this.agents.set([]),this.branches.set([]),this.selectedBranch.set(""),this.branchSearch.set(""),this.hasGit.set(false),this.mode.set("local"),this.isLoadingAgents.set(true),this.agentApi.getAgents(t).subscribe({next:e=>{this.agents.set(e),this.isLoadingAgents.set(false);},error:()=>{this.isLoadingAgents.set(false);}}),this.projectApi.getGitBranches(t).subscribe({next:({branches:e})=>{this.hasGit.set(e.length>0);},error:()=>{this.hasGit.set(false);}});}onAgentSearchInput(t){this.agentSearch.set(t),this.selectedAgent()&&t!==this.selectedAgent()&&this.selectedAgent.set("");}selectAgent(t){this.selectedAgent.set(t),this.agentSearch.set(t);}onBranchSearchInput(t){this.branchSearch.set(t),this.selectedBranch()&&t!==this.selectedBranch()&&this.selectedBranch.set("");}selectBranch(t){this.selectedBranch.set(t),this.branchSearch.set(t);}ngOnInit(){this.projectApi.listProjects().subscribe({next:({projects:t})=>{let e=t.map(n=>n.name);this.projects.set(e),e.length===1&&e[0]&&this.selectProject(e[0]);}});}onProjectChange(t){this.selectProject(t);}onModeChange(t){this.mode.set(t),t==="worktree"&&this.selectedProject()&&this.branches().length===0&&this.loadBranches();}loadBranches(){this.isLoadingBranches.set(true),this.projectApi.getGitBranches(this.selectedProject()).subscribe({next:({branches:t})=>{this.branches.set(t),this.isLoadingBranches.set(false);},error:()=>{this.isLoadingBranches.set(false);}});}submit(){if(!this.isSubmitting()){if(this.isValid()){this.isSubmitting.set(true);let t=this.isWorktree()&&this.issueNumber().trim()?`${this.issueNumber().trim()} ${this.task().trim()}`:this.task().trim();this.projectApi.createTask(this.selectedProject(),this.selectedAgent(),t,this.isWorktree()?"worktree":"local",this.isWorktree()?this.selectedBranch():void 0,this.isWorktree()?this.issueNumber().trim():void 0,this.isWorktree()?this.branchType():void 0).subscribe({next:({threadId:e,projectId:n})=>{this.dialogRef.close({threadId:e,projectId:n});},error:()=>{this.isSubmitting.set(false);}});return}if(this.canNavigate()){this.dialogRef.close({projectId:this.selectedProject(),navigate:true});return}}}cancel(){this.dialogRef.close(null);}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=xw({type:a,selectors:[["app-new-task-dialog"]],decls:37,vars:12,consts:[["projectTrigger","matAutocompleteTrigger"],["projectAuto",""],["agentTrigger","matAutocompleteTrigger"],["agentAuto",""],["branchTrigger","matAutocompleteTrigger"],["branchAuto",""],["mat-dialog-title",""],[1,"ntd-content"],["appearance","outline",1,"ntd-field"],["matInput","","placeholder","Search project...",3,"input","focus","value","matAutocomplete"],[3,"optionSelected"],[3,"value"],["matInput","","placeholder","Search agent...",3,"input","focus","value","matAutocomplete","disabled"],["matSuffix","","diameter","16"],["matInput","","placeholder","Describe what the agent should accomplish...","rows","4",3,"input","value"],["align","end"],["mat-button","",3,"click","disabled"],["mat-flat-button","",1,"ntd-launch-btn",3,"click","disabled"],["diameter","16"],[1,"ntd-agent-name"],[1,"ntd-agent-desc"],[1,"ntd-radio-group"],["type","button",1,"ntd-mode-btn",3,"click"],[1,"ntd-radio-label"],[1,"ntd-radio-hint"],[1,"ntd-row"],["matInput","","type","text","placeholder","Name",3,"input","value"],["appearance","outline",1,"ntd-field","ntd-field--small"],[3,"selectionChange","value"],["matInput","","placeholder","Search branch...",3,"input","focus","value","matAutocomplete","disabled"]],template:function(e,n){if(e&1){let i=lC();ws(0,"h2",6)(1,"mat-icon"),GC(2,"rocket_launch"),pl(),GC(3,` New Task
|
|
2
2
|
`),pl(),ws(4,"mat-dialog-content",7)(5,"mat-form-field",8)(6,"mat-label"),GC(7,"Project"),pl(),ws(8,"input",9,0),Rg("input",function(p){return n.onProjectSearchInput(p.target.value)})("focus",function(){If(i);let p=CC(9);return wf(n.openPanel(p))}),pl(),ws(10,"mat-autocomplete",10,1),Rg("optionSelected",function(p){return n.selectProject(p.option.value)}),rC(12,Et,2,2,"mat-option",11,nC),pl()(),ws(14,"mat-form-field",8)(15,"mat-label"),GC(16,"Agent"),pl(),ws(17,"input",12,2),Rg("input",function(p){return n.onAgentSearchInput(p.target.value)})("focus",function(){If(i);let p=CC(18);return wf(n.openPanel(p))}),pl(),Jw(19,Nt,1,0,"mat-spinner",13),ws(20,"mat-autocomplete",10,3),Rg("optionSelected",function(p){return n.selectAgent(p.option.value)}),rC(22,At,4,3,"mat-option",11,Ot),pl()(),Jw(24,$t,17,6),ws(25,"mat-form-field",8)(26,"mat-label"),GC(27,"Task"),pl(),ws(28,"textarea",14),Rg("input",function(p){return n.task.set(p.target.value)}),pl()()(),ws(29,"mat-dialog-actions",15)(30,"button",16),Rg("click",function(){return n.cancel()}),GC(31,"Cancel"),pl(),ws(32,"button",17),Rg("click",function(){return n.submit()}),Jw(33,Lt,1,0,"mat-spinner",18)(34,zt,2,0,"mat-icon")(35,Bt,2,0,"mat-icon"),GC(36),pl()();}if(e&2){let i=CC(11),l=CC(21);XE(8),bg("value",n.projectSearch())("matAutocomplete",i),XE(4),oC(n.filteredProjects()),XE(5),bg("value",n.agentSearch())("matAutocomplete",l)("disabled",!n.selectedProject()||n.isLoadingAgents()),XE(2),eC(n.isLoadingAgents()?19:-1),XE(3),oC(n.filteredAgents()),XE(2),eC(n.hasGit()&&!n.forcedProject()?24:-1),XE(4),bg("value",n.task()),XE(2),bg("disabled",n.isSubmitting()),XE(2),bg("disabled",!n.canNavigate()||n.isSubmitting()),XE(),eC(n.isSubmitting()?33:n.isValid()?34:35),XE(3),vl(" ",n.isValid()?"Launch":"Open"," ");}},dependencies:[ti,zt$2,jt,Vt$1,Nt$1,hr,pr,ce,nt,ae,zt$1,Tn$1,Sn$1,kt$1,Ct,Fn$1,ze$1,Pt$1,Lt$1,Et$1,yt$1,yt,wt$1],styles:["h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:0}.ntd-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;padding-top:20px!important}.ntd-field[_ngcontent-%COMP%]{width:100%}.ntd-row[_ngcontent-%COMP%]{display:flex;gap:.75rem}.ntd-row[_ngcontent-%COMP%] .ntd-field--small[_ngcontent-%COMP%]{width:130px;flex-shrink:0}.ntd-radio-group[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding:.25rem 0 .75rem}.ntd-mode-btn[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.15rem;padding:.75rem;border:1px solid var(--color-border);border-radius:8px;background:transparent;color:var(--color-text);cursor:pointer;transition:border-color .15s,background .15s}.ntd-mode-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem;margin-bottom:.1rem}.ntd-mode-btn.active[_ngcontent-%COMP%]{border-color:var(--color-primary);background:color-mix(in srgb,var(--color-primary) 10%,transparent)}.ntd-mode-btn[_ngcontent-%COMP%]:hover:not(.active){border-color:var(--color-text-secondary)}.ntd-radio-label[_ngcontent-%COMP%]{font-weight:600;font-size:.9rem}.ntd-radio-hint[_ngcontent-%COMP%]{font-size:.72rem;color:var(--color-text-secondary);line-height:1.3;text-align:left}.ntd-agent-name[_ngcontent-%COMP%]{font-weight:500;display:block}.ntd-agent-desc[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:380px}.ntd-launch-btn[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse)}.ntd-launch-btn[_ngcontent-%COMP%]:disabled{background:var(--color-border);color:var(--color-text-secondary);opacity:.6;cursor:not-allowed}"],changeDetection:1})};var Qt=(a,t)=>t.name,Ut=(a,t)=>t.value;function Ht(a,t){if(a&1&&(ws(0,"mat-option",8),GC(1),pl()),a&2){let e=t.$implicit;bg("value",e),XE(),Yg(e);}}function Jt(a,t){a&1&&Sg(0,"mat-spinner",9);}function Xt(a,t){if(a&1&&(ws(0,"mat-option",8),GC(1),pl()),a&2){let e=t.$implicit;bg("value",e.name),XE(),Yg(e.name);}}function Kt(a,t){if(a&1){let e=lC();ws(0,"button",37),Rg("click",function(){let i=If(e).$implicit,l=gC();return wf(l.toggleDay(i.value))}),GC(1),pl();}if(a&2){let e=t.$implicit,n=gC();Ug("selected",n.isDaySelected(e.value)),XE(),vl(" ",e.label," ");}}function Yt(a,t){if(a&1){let e=lC();ws(0,"mat-form-field",4)(1,"mat-label"),GC(2,"Number of runs"),pl(),ws(3,"input",17),Rg("ngModelChange",function(i){If(e);let l=gC();return wf(l.endOccurrences.set(i))}),pl(),VI(),pl();}if(a&2){let e=gC();XE(3),bg("ngModel",e.endOccurrences()),UI();}}function Zt(a,t){if(a&1){let e=lC();ws(0,"mat-form-field",4)(1,"mat-label"),GC(2,"End date"),pl(),ws(3,"input",38),Rg("ngModelChange",function(i){If(e);let l=gC();return wf(l.endTimestamp.set(i))}),pl(),VI(),pl();}if(a&2){let e=gC();XE(3),bg("ngModel",e.endTimestamp())("min",e.startTimestamp()),UI();}}function en(a,t){if(a&1&&(ws(0,"div",32)(1,"mat-icon"),GC(2,"error"),pl(),ws(3,"span"),GC(4),pl()()),a&2){let e=gC();XE(4),Yg(e.errorMessage());}}function tn(a,t){a&1&&Sg(0,"mat-spinner",36);}function nn(a,t){a&1&&(ws(0,"mat-icon"),GC(1,"schedule"),pl());}var z=class a{projectApi=g(c);agentApi=g(f$1);schedulerApi=g(xe);dialogRef=g(z$2);dialogData=g(Ue,{optional:true});isEditMode=this.dialogData?.mode==="edit";projects=Gi([]);agents=Gi([]);name=Gi("");selectedProject=Gi("");selectedAgent=Gi("");instruction=Gi("");intervalValue=Gi(1);intervalUnit=Gi("d");startTimestamp=Gi("");daysOfWeek=Gi([]);endConditionType=Gi("none");endOccurrences=Gi(10);endTimestamp=Gi("");enabled=Gi(true);isLoadingAgents=Gi(false);isSaving=Gi(false);errorMessage=Gi("");daysOfWeekOptions=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}];filteredProjects=mT(()=>{let t=this.selectedProject().toLowerCase();return this.projects().filter(e=>e.toLowerCase().includes(t))});filteredAgents=mT(()=>{let t=this.selectedAgent().toLowerCase();return this.agents().filter(e=>e.name.toLowerCase().includes(t))});isValid=mT(()=>{let t=this.projects().includes(this.selectedProject()),e=this.agents().some(l=>l.name===this.selectedAgent()),n=this.instruction().trim().length>0,i=this.intervalValue()>=1;return t&&e&&n&&i});ngOnInit(){if(this.isEditMode&&this.dialogData?.scheduler){let t=this.dialogData.scheduler;this.name.set(t.name),this.selectedAgent.set(t.agentName??""),this.instruction.set(t.instruction??""),this.enabled.set(t.enabled);let e=t.schedule.interval.match(/^(\d+)(min|h|d|M)$/);e&&e[1]&&e[2]&&(this.intervalValue.set(parseInt(e[1],10)),this.intervalUnit.set(e[2])),t.schedule.startTimestamp&&this.startTimestamp.set(this.toDatetimeLocal(new Date(t.schedule.startTimestamp))),this.daysOfWeek.set(t.schedule.daysOfWeek??[]),t.schedule.endCondition&&(this.endConditionType.set(t.schedule.endCondition.type),t.schedule.endCondition.type==="occurrences"?this.endOccurrences.set(t.schedule.endCondition.value):t.schedule.endCondition.type==="endTimestamp"&&this.endTimestamp.set(this.toDatetimeLocal(new Date(t.schedule.endCondition.value))));}else this.startTimestamp.set(this.toDatetimeLocal(new Date));this.projectApi.listProjects().subscribe({next:({projects:t})=>{let e=t.map(i=>i.name).filter(i=>!i.includes("__"));this.projects.set(e);let n=this.dialogData?.projectName;this.isEditMode&&n?this.onProjectSelected(n):e.length===1&&e[0]&&this.onProjectSelected(e[0]);}});}onProjectSelected(t){this.selectedProject.set(t),this.isEditMode||(this.agents.set([]),this.selectedAgent.set("")),this.projects().includes(t)&&(this.isLoadingAgents.set(true),this.agentApi.getAgents(t).subscribe({next:e=>{this.agents.set(e),this.isLoadingAgents.set(false),!this.isEditMode&&e.length===1&&e[0]&&this.selectedAgent.set(e[0].name);},error:()=>this.isLoadingAgents.set(false)}));}toggleDay(t){let e=this.daysOfWeek();e.indexOf(t)>-1?this.daysOfWeek.set(e.filter(i=>i!==t)):this.daysOfWeek.set([...e,t].sort());}isDaySelected(t){return this.daysOfWeek().includes(t)}toDatetimeLocal(t){let e=n=>String(n).padStart(2,"0");return `${t.getFullYear()}-${e(t.getMonth()+1)}-${e(t.getDate())}T${e(t.getHours())}:${e(t.getMinutes())}`}submit(){if(!this.isValid()||this.isSaving())return;this.errorMessage.set(""),this.isSaving.set(true);let t=this.startTimestamp(),e={startTimestamp:t?new Date(t).toISOString():new Date().toISOString(),interval:`${this.intervalValue()}${this.intervalUnit()}`},n=this.daysOfWeek();n.length>0&&(e.daysOfWeek=n);let i=this.endConditionType();i==="occurrences"?e.endCondition={type:"occurrences",value:this.endOccurrences()}:i==="endTimestamp"&&this.endTimestamp()&&(e.endCondition={type:"endTimestamp",value:new Date(this.endTimestamp()).toISOString()});let l=this.instruction().trim(),p=l.length>40?l.slice(0,40)+"\u2026":l,L=this.name().trim()||`${this.selectedAgent()} \u2014 ${p}`;this.isEditMode&&this.dialogData?.scheduler&&this.dialogData.projectName?this.schedulerApi.updateSchedulerForProject(this.dialogData.projectName,this.dialogData.scheduler.id,{name:L,agentName:this.selectedAgent(),instruction:l,schedule:e,enabled:this.enabled()}).subscribe({next:()=>{this.isSaving.set(false),this.dialogRef.close(true);},error:oe=>{this.errorMessage.set(oe?.error?.error||"Failed to update scheduler"),this.isSaving.set(false);}}):this.schedulerApi.createSchedulerForProject(this.selectedProject(),{name:L,agentName:this.selectedAgent(),instruction:l,schedule:e,enabled:this.enabled()}).subscribe({next:()=>{this.isSaving.set(false),this.dialogRef.close(true);},error:oe=>{this.errorMessage.set(oe?.error?.error||"Failed to create scheduler"),this.isSaving.set(false);}});}cancel(){this.dialogRef.close(false);}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=xw({type:a,selectors:[["app-quick-scheduler-dialog"]],decls:84,vars:20,consts:[["projectAuto","matAutocomplete"],["agentAuto","matAutocomplete"],["mat-dialog-title",""],[1,"qsd-form"],["appearance","outline",1,"full-width"],["matInput","","placeholder","Optional \u2014 auto-generated if empty",3,"ngModelChange","ngModel"],["matInput","","placeholder","Select a project",3,"ngModelChange","focus","ngModel","matAutocomplete"],[3,"optionSelected"],[3,"value"],["matSuffix","","diameter","18"],["matInput","","placeholder","Select an agent",3,"ngModelChange","focus","ngModel","matAutocomplete","disabled"],["matInput","","placeholder","e.g. Review open PRs and summarize what needs attention","rows","3",3,"ngModelChange","ngModel"],[1,"qsd-divider"],["matInput","","type","datetime-local",3,"ngModelChange","ngModel"],[1,"qsd-interval"],[1,"qsd-label"],["appearance","outline",1,"interval-value"],["matInput","","type","number","min","1",3,"ngModelChange","ngModel"],["appearance","outline",1,"interval-unit"],[3,"ngModelChange","ngModel"],["value","min"],["value","h"],["value","d"],["value","M"],[1,"qsd-days"],[1,"qsd-day-chips"],["type","button",1,"day-chip",3,"selected"],[1,"qsd-hint"],[1,"qsd-end"],["value","none"],["value","occurrences"],["value","endTimestamp"],[1,"qsd-error"],["align","end"],["mat-button","",3,"click","disabled"],["mat-flat-button","",3,"click","disabled"],["diameter","18"],["type","button",1,"day-chip",3,"click"],["matInput","","type","datetime-local",3,"ngModelChange","ngModel","min"]],template:function(e,n){if(e&1&&(ws(0,"h2",2)(1,"mat-icon"),GC(2,"schedule"),pl(),GC(3),pl(),ws(4,"mat-dialog-content")(5,"div",3)(6,"mat-form-field",4)(7,"mat-label"),GC(8,"Name"),pl(),ws(9,"input",5),Rg("ngModelChange",function(l){return n.name.set(l)}),pl(),VI(),pl(),ws(10,"mat-form-field",4)(11,"mat-label"),GC(12,"Project"),pl(),ws(13,"input",6),Rg("ngModelChange",function(l){return n.onProjectSelected(l)})("focus",function(){return n.selectedProject.set(n.selectedProject())}),pl(),VI(),ws(14,"mat-autocomplete",7,0),Rg("optionSelected",function(l){return n.onProjectSelected(l.option.value)}),rC(16,Ht,2,2,"mat-option",8,nC),pl()(),ws(18,"mat-form-field",4)(19,"mat-label"),GC(20,"Agent"),pl(),Jw(21,Jt,1,0,"mat-spinner",9),ws(22,"input",10),Rg("ngModelChange",function(l){return n.selectedAgent.set(l)})("focus",function(){return n.selectedAgent.set(n.selectedAgent())}),pl(),VI(),ws(23,"mat-autocomplete",7,1),Rg("optionSelected",function(l){return n.selectedAgent.set(l.option.value)}),rC(25,Xt,2,2,"mat-option",8,Qt),pl()(),ws(27,"mat-form-field",4)(28,"mat-label"),GC(29,"What should the agent do?"),pl(),ws(30,"textarea",11),Rg("ngModelChange",function(l){return n.instruction.set(l)}),pl(),VI(),pl(),ws(31,"div",12)(32,"span"),GC(33,"Scheduling"),pl()(),ws(34,"mat-form-field",4)(35,"mat-label"),GC(36,"Starts on"),pl(),ws(37,"input",13),Rg("ngModelChange",function(l){return n.startTimestamp.set(l)}),pl(),VI(),pl(),ws(38,"div",14)(39,"span",15),GC(40,"Every"),pl(),ws(41,"mat-form-field",16)(42,"input",17),Rg("ngModelChange",function(l){return n.intervalValue.set(l)}),pl(),VI(),pl(),ws(43,"mat-form-field",18)(44,"mat-select",19),Rg("ngModelChange",function(l){return n.intervalUnit.set(l)}),ws(45,"mat-option",20),GC(46,"minutes"),pl(),ws(47,"mat-option",21),GC(48,"hours"),pl(),ws(49,"mat-option",22),GC(50,"days"),pl(),ws(51,"mat-option",23),GC(52,"months"),pl()(),VI(),pl()(),ws(53,"div",24)(54,"span",15),GC(55,"Days"),pl(),ws(56,"div",25),rC(57,Kt,2,3,"button",26,Ut),pl(),ws(59,"span",27),GC(60,"Leave empty for every day"),pl()(),ws(61,"div",28)(62,"mat-form-field",4)(63,"mat-label"),GC(64,"Ends on"),pl(),ws(65,"mat-select",19),Rg("ngModelChange",function(l){return n.endConditionType.set(l)}),ws(66,"mat-option",29),GC(67,"Never"),pl(),ws(68,"mat-option",30),GC(69,"After N runs"),pl(),ws(70,"mat-option",31),GC(71,"On a date"),pl()(),VI(),pl(),Jw(72,Yt,4,1,"mat-form-field",4),Jw(73,Zt,4,2,"mat-form-field",4),pl(),ws(74,"mat-checkbox",19),Rg("ngModelChange",function(l){return n.enabled.set(l)}),GC(75,"Enable immediately"),pl(),VI(),Jw(76,en,5,1,"div",32),pl()(),ws(77,"mat-dialog-actions",33)(78,"button",34),Rg("click",function(){return n.cancel()}),GC(79,"Cancel"),pl(),ws(80,"button",35),Rg("click",function(){return n.submit()}),Jw(81,tn,1,0,"mat-spinner",36)(82,nn,2,0,"mat-icon"),GC(83," Schedule "),pl()()),e&2){let i=CC(15),l=CC(24);XE(3),vl(" ",n.isEditMode?"Edit scheduled task":"New scheduled task",`
|
|
3
|
-
`),XE(6),bg("ngModel",n.name()),UI(),XE(4),bg("ngModel",n.selectedProject())("matAutocomplete",i),UI(),XE(3),oC(n.filteredProjects()),XE(5),eC(n.isLoadingAgents()?21:-1),XE(),bg("ngModel",n.selectedAgent())("matAutocomplete",l)("disabled",!n.projects().includes(n.selectedProject())),UI(),XE(3),oC(n.filteredAgents()),XE(5),bg("ngModel",n.instruction()),UI(),XE(7),bg("ngModel",n.startTimestamp()),UI(),XE(5),bg("ngModel",n.intervalValue()),UI(),XE(2),bg("ngModel",n.intervalUnit()),UI(),XE(13),oC(n.daysOfWeekOptions),XE(8),bg("ngModel",n.endConditionType()),UI(),XE(7),eC(n.endConditionType()==="occurrences"?72:-1),XE(),eC(n.endConditionType()==="endTimestamp"?73:-1),XE(),bg("ngModel",n.enabled()),UI(),XE(2),eC(n.errorMessage()?76:-1),XE(2),bg("disabled",n.isSaving()),XE(2),bg("disabled",!n.isValid()||n.isSaving()),XE(),eC(n.isSaving()?81:82);}},dependencies:[ti,Ye$1,fn$1,Zn,$t$1,cn$1,zt$2,jt,Vt$1,Nt$1,hr,pr,ce,nt,ae,zt$1,Tn$1,Sn$1,kt$1,Ct,Fn$1,ze$1,Pt$1,Lt$1,ve,ne,Et$1,yt$1,yt,wt$1],styles:['[_nghost-%COMP%]{display:block}h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.qsd-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;padding-top:4px}.full-width[_ngcontent-%COMP%]{width:100%}.qsd-interval[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.qsd-interval[_ngcontent-%COMP%] .qsd-label[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant);white-space:nowrap}.qsd-interval[_ngcontent-%COMP%] .interval-value[_ngcontent-%COMP%]{width:80px}.qsd-interval[_ngcontent-%COMP%] .interval-unit[_ngcontent-%COMP%]{flex:1}.qsd-days[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.qsd-days[_ngcontent-%COMP%] .qsd-label[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant);white-space:nowrap}.qsd-days[_ngcontent-%COMP%] .qsd-hint[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);opacity:.7;width:100%;margin-top:-4px;padding-left:36px}.qsd-day-chips[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.day-chip[_ngcontent-%COMP%]{padding:4px 10px;border-radius:16px;border:1px solid var(--mat-sys-outline);background:transparent;color:var(--mat-sys-on-surface);font-size:12px;cursor:pointer;transition:background .15s,color .15s}.day-chip.selected[_ngcontent-%COMP%]{background:var(--mat-sys-primary);color:var(--mat-sys-on-primary);border-color:var(--mat-sys-primary)}.day-chip[_ngcontent-%COMP%]:hover:not(.selected){background:var(--mat-sys-surface-variant)}.qsd-divider[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin:4px 0}.qsd-divider[_ngcontent-%COMP%]:before, .qsd-divider[_ngcontent-%COMP%]:after{content:"";flex:1;height:1px;background:var(--mat-sys-outline-variant)}.qsd-divider[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px}.qsd-end[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.qsd-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;color:var(--mat-sys-error);font-size:14px}.qsd-error[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}mat-dialog-actions[_ngcontent-%COMP%]{gap:8px}mat-dialog-actions[_ngcontent-%COMP%] button[mat-flat-button][_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}']})};var rn=(a,t)=>t.id;function an(a,t){if(a&1){let e=lC();ws(0,"button",9),Rg("click",function(){let i=If(e).$implicit,l=gC(2);return wf(l.setProject(i))}),GC(1),pl();}if(a&2){let e=t.$implicit,n=gC(2);Ug("active",n.activeProject()===e),XE(),vl(" ",e," ");}}function ln(a,t){if(a&1){let e=lC();ws(0,"nav",2)(1,"button",9),Rg("click",function(){If(e);let i=gC();return wf(i.setProject(null))}),GC(2," All projects "),pl(),rC(3,an,2,3,"button",10,nC),pl();}if(a&2){let e=gC();XE(),Ug("active",e.activeProject()===null),XE(2),oC(e.projects());}}function sn(a,t){a&1&&(ws(0,"div",3),Sg(1,"mat-spinner",11),pl());}function cn(a,t){if(a&1&&(ws(0,"div",4)(1,"mat-icon"),GC(2,"error"),pl(),GC(3),pl()),a&2){let e=gC();XE(3),vl(" ",e.errorMessage()," ");}}function dn(a,t){if(a&1){let e=lC();ws(0,"div",5)(1,"mat-icon"),GC(2,"schedule"),pl(),ws(3,"p"),GC(4,"No scheduled tasks yet."),pl(),ws(5,"button",12),Rg("click",function(){If(e);let i=gC();return wf(i.openCreate())}),ws(6,"mat-icon"),GC(7,"add"),pl(),GC(8," Create one "),pl()();}}function pn(a,t){if(a&1&&(ws(0,"span",17),GC(1),pl()),a&2){let e=gC().$implicit;XE(),Yg(e.projectName);}}function mn(a,t){if(a&1){let e=lC();ws(0,"li",14)(1,"div",15)(2,"span",16),GC(3),pl(),Jw(4,pn,2,1,"span",17),ws(5,"span",18),GC(6),pl()(),ws(7,"div",19)(8,"span",20),GC(9),pl(),ws(10,"span",21),GC(11),pl()(),ws(12,"div",22)(13,"mat-slide-toggle",23),Rg("change",function(){let i=If(e).$implicit,l=gC(2);return wf(l.toggleEnabled(i))}),pl(),ws(14,"button",24),Rg("click",function(){let i=If(e).$implicit,l=gC(2);return wf(l.runNow(i))}),ws(15,"mat-icon"),GC(16,"play_arrow"),pl()(),ws(17,"button",25),Rg("click",function(){let i=If(e).$implicit,l=gC(2);return wf(l.edit(i))}),ws(18,"mat-icon"),GC(19,"edit"),pl()(),ws(20,"button",26),Rg("click",function(){let i=If(e).$implicit,l=gC(2);return wf(l.delete(i))}),ws(21,"mat-icon"),GC(22,"delete"),pl()()()();}if(a&2){let e=t.$implicit,n=gC(2);Ug("disabled",!e.enabled),XE(3),Yg(e.name),XE(),eC(n.projects().length>1?4:-1),XE(2),Yg(n.getSource(e)),XE(3),Yg(n.formatInterval(e.schedule.interval)),XE(),Ug("due",!e.nextRun),XE(),Yg(n.formatNextRun(e.nextRun)),XE(2),bg("checked",e.enabled);}}function un(a,t){if(a&1&&(ws(0,"ul",6),rC(1,mn,23,10,"li",13,rn),pl()),a&2){let e=gC();XE(),oC(e.filteredSchedulers());}}var Me=class a{projectApi=g(c);schedulerApi=g(xe);dialog=g(Re);dialogRef=g(z$2);allSchedulers=Gi([]);isLoading=Gi(true);errorMessage=Gi("");activeProject=Gi(null);projects=Gi([]);filteredSchedulers=mT(()=>{let t=this.activeProject(),e=this.allSchedulers();return t?e.filter(n=>n.projectName===t):e});ngOnInit(){this.load();}load(){this.isLoading.set(true),this.errorMessage.set(""),this.projectApi.listProjects().subscribe({next:({projects:t})=>{let e=t.map(i=>i.name).filter(i=>!i.includes("__"));if(this.projects.set(e),e.length===0){this.isLoading.set(false);return}let n=e.map(i=>this.schedulerApi.listSchedulersForProject(i).pipe(ya(()=>br([]))));By(n).subscribe({next:i=>{let l=[];i.forEach((p,L)=>{p.forEach(oe=>l.push(x(w({},oe),{projectName:e[L]})));}),this.allSchedulers.set(l),this.isLoading.set(false);},error:()=>{this.errorMessage.set("Failed to load schedulers"),this.isLoading.set(false);}});},error:()=>{this.errorMessage.set("Failed to load projects"),this.isLoading.set(false);}});}setProject(t){this.activeProject.set(t);}formatInterval(t){let e=/^(\d+)(min|h|d|M)$/.exec(t);if(!e)return t;let[,n,i]=e;return `Every ${n}${{min:"min",h:"h",d:"d",M:"mo"}[i??""]??i}`}formatNextRun(t){if(!t)return "Expired";let e=new Date(t),n=new Date,i=e.getTime()-n.getTime();if(i<0)return "Due";let l=Math.floor(i/6e4);if(l<60)return `in ${l}m`;let p=Math.floor(l/60);return p<24?`in ${p}h`:`in ${Math.floor(p/24)}d`}getSource(t){if(t.agentName&&t.instruction){let e=t.instruction.length>35?t.instruction.slice(0,35)+"\u2026":t.instruction;return `${t.agentName}: ${e}`}return t.promptId??""}toggleEnabled(t){(t.enabled?this.schedulerApi.disableSchedulerForProject(t.projectName,t.id):this.schedulerApi.enableSchedulerForProject(t.projectName,t.id)).subscribe({next:()=>{this.allSchedulers.update(n=>n.map(i=>i.id===t.id?x(w({},i),{enabled:!i.enabled}):i));},error:()=>this.errorMessage.set("Failed to toggle scheduler")});}runNow(t){this.schedulerApi.runSchedulerNowForProject(t.projectName,t.id).subscribe({error:()=>this.errorMessage.set("Failed to run scheduler")});}edit(t){let e={mode:"edit",projectName:t.projectName,scheduler:{id:t.id,name:t.name,agentName:t.agentName,instruction:t.instruction,enabled:t.enabled,schedule:t.schedule}};this.dialog.open(z,{width:"480px",data:e}).afterClosed().subscribe(i=>{i&&this.load();});}delete(t){this.schedulerApi.deleteSchedulerForProject(t.projectName,t.id).subscribe({next:()=>{this.allSchedulers.update(e=>e.filter(n=>n.id!==t.id));},error:()=>this.errorMessage.set("Failed to delete scheduler")});}openCreate(){this.dialogRef.close(),this.dialog.open(z,{width:"480px"});}close(){this.dialogRef.close();}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=xw({type:a,selectors:[["app-global-schedulers-dialog"]],decls:19,vars:3,consts:[["mat-dialog-title",""],[1,"gsd-count"],[1,"gsd-project-filters"],[1,"gsd-loading"],[1,"gsd-error"],[1,"gsd-empty"],[1,"gsd-list"],["align","end"],["mat-button","",3,"click"],[1,"proj-chip",3,"click"],[1,"proj-chip",3,"active"],["diameter","32"],["mat-flat-button","",3,"click"],[1,"gsd-item",3,"disabled"],[1,"gsd-item"],[1,"gsd-item-main"],[1,"gsd-item-name"],[1,"gsd-item-project"],[1,"gsd-item-source"],[1,"gsd-item-meta"],[1,"gsd-interval"],[1,"gsd-next"],[1,"gsd-item-actions"],["matTooltip","Enable / Disable",3,"change","checked"],["mat-icon-button","","matTooltip","Run now",3,"click"],["mat-icon-button","","matTooltip","Edit",3,"click"],["mat-icon-button","","matTooltip","Delete",1,"delete-btn",3,"click"]],template:function(e,n){e&1&&(ws(0,"h2",0)(1,"mat-icon"),GC(2,"schedule"),pl(),GC(3," Scheduled tasks "),ws(4,"span",1),GC(5),pl()(),ws(6,"mat-dialog-content"),Jw(7,ln,5,2,"nav",2),Jw(8,sn,2,0,"div",3)(9,cn,4,1,"div",4)(10,dn,9,0,"div",5)(11,un,3,0,"ul",6),pl(),ws(12,"mat-dialog-actions",7)(13,"button",8),Rg("click",function(){return n.openCreate()}),ws(14,"mat-icon"),GC(15,"add"),pl(),GC(16," New scheduler "),pl(),ws(17,"button",8),Rg("click",function(){return n.close()}),GC(18,"Close"),pl()()),e&2&&(XE(5),Yg(n.filteredSchedulers().length),XE(2),eC(n.projects().length>1?7:-1),XE(),eC(n.isLoading()?8:n.errorMessage()?9:n.filteredSchedulers().length===0?10:11));},dependencies:[ti,zt$2,jt,Vt$1,Nt$1,hr,pr,Gn$1,yt,wt$1,Et$1,yt$1,Pt$1,Ve,ne$1,ke$1,se],styles:["[_nghost-%COMP%]{display:block}h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}h2[mat-dialog-title][_ngcontent-%COMP%] .gsd-count[_ngcontent-%COMP%]{font-size:13px;font-weight:400;color:var(--mat-sys-on-surface-variant);margin-left:2px}.gsd-project-filters[_ngcontent-%COMP%]{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}.proj-chip[_ngcontent-%COMP%]{padding:4px 12px;border-radius:16px;border:1px solid var(--mat-sys-outline);background:transparent;color:var(--mat-sys-on-surface);font-size:13px;cursor:pointer;transition:background .15s,color .15s}.proj-chip.active[_ngcontent-%COMP%]{background:var(--mat-sys-primary);color:var(--mat-sys-on-primary);border-color:var(--mat-sys-primary)}.proj-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--mat-sys-surface-variant)}.gsd-loading[_ngcontent-%COMP%], .gsd-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:32px 0;color:var(--mat-sys-on-surface-variant)}.gsd-loading[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .gsd-empty[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:40px;width:40px;height:40px;opacity:.4}.gsd-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;color:var(--mat-sys-error);padding:16px 0}.gsd-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.gsd-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:8px;background:var(--mat-sys-surface-container);transition:opacity .2s}.gsd-item.disabled[_ngcontent-%COMP%]{opacity:.5}.gsd-item-main[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.gsd-item-name[_ngcontent-%COMP%]{font-weight:500;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gsd-item-project[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-primary);font-weight:500}.gsd-item-source[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gsd-item-meta[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end;gap:2px;white-space:nowrap}.gsd-interval[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant)}.gsd-next[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-on-surface-variant)}.gsd-next.due[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.gsd-item-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.gsd-item-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]{color:var(--mat-sys-error);opacity:.7;transition:opacity .15s}.gsd-item-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]:hover{opacity:1}mat-dialog-actions[_ngcontent-%COMP%]{gap:8px}"]})};var Se=class a{http=g(py);threadApi=g(N);projectApi=g(c);isLoading=Gi(false);tasks=Gi([]);refresh(){this.isLoading.set(true),this.threadApi.listAllThreads().pipe(Td(15e3)).subscribe({next:t=>{let e=t.filter(n=>!n.parentThreadId).map(n=>({id:n.id,name:n.name,summary:n.summary,modifiedDate:n.modifiedDate,starring:n.starring??[],users:n.users??[],isActive:false,status:this.deriveStatus(n),projectId:n.projectId,worktreeProject:n.worktreeProject}));this.tasks.set(this.sorted(e)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false);}});}applyStatusEvent(t,e){let n=e==="invite"?"waiting-you":"in-progress";this.tasks.update(i=>this.sorted(i.map(l=>l.id===t?x(w({},l),{status:n}):l)));}closeTask(t,e){this.tasks.update(n=>n.filter(i=>i.id!==e)),this.http.delete(`/api/projects/${t}/missions/${e}`).subscribe({next:()=>this.refresh(),error:n=>{console.error("[GLOBAL-TC] Failed to close task:",n),this.refresh();}});}stopThread(t,e){this.http.post(`/api/projects/${t}/threads/${e}/stop`,{}).subscribe({error:n=>console.error("[GLOBAL-TC] Failed to stop thread:",n)});}deleteThread(t,e){this.tasks.update(n=>n.filter(i=>i.id!==e)),this.http.delete(`/api/projects/${t}/threads/${e}`).subscribe({next:()=>this.refresh(),error:n=>{console.error("[GLOBAL-TC] Failed to delete thread:",n),this.refresh();}});}toggleStar(t,e,n){let i=`/api/projects/${t}/threads/${e}/star`;(n?this.http.delete(i):this.http.post(i,{})).subscribe({next:()=>this.refresh(),error:p=>console.error("[GLOBAL-TC] Failed to toggle star:",p)});}markTaskDone(t,e){this.http.post(`/api/projects/${t}/threads/${e}/done`,{}).subscribe({next:()=>this.refresh(),error:n=>console.error("[GLOBAL-TC] Failed to mark task as done:",n)});}markTasksBatchDone(t){if(t.length===0)return;let e=new Map;for(let{id:l,projectId:p}of t){let L=e.get(p)??[];L.push(l),e.set(p,L);}let n=new Set(t.map(l=>l.id));this.tasks.update(l=>this.sorted(l.map(p=>n.has(p.id)?x(w({},p),{status:"done"}):p)));let i=[...e.entries()].map(([l,p])=>this.projectApi.markThreadsBatchDone(l,p));By(i.length>0?i:[br(null)]).subscribe({next:()=>this.refresh(),error:l=>{console.error("[GLOBAL-TC] Failed to batch-mark tasks as done:",l),this.refresh();}});}markTaskActive(t,e){this.http.delete(`/api/projects/${t}/threads/${e}/done`).subscribe({next:()=>this.refresh(),error:n=>console.error("[GLOBAL-TC] Failed to mark task as active:",n)});}deriveStatus(t){return t.closedByUser?"done":t.pendingInvite?"waiting-you":Date.now()-new Date(t.modifiedDate).getTime()<bt?"in-progress":"paused"}sorted(t){return [...t].sort((e,n)=>{let i=kt[e.status]-kt[n.status];return i!==0?i:e.modifiedDate>n.modifiedDate?-1:1})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x$1({token:a,factory:a.\u0275fac,providedIn:"root"})};var Te=class a{configApi=g(W);dialog=g(Re);openUserConfigEditor(){this.configApi.getUserConfig().subscribe({next:t=>{this.dialog.open(Ze,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(n=>{n&&this.configApi.updateUserConfig(n).subscribe({error:i=>console.error("[CONFIG-STATE] Error saving user config:",i)});});},error:t=>console.error("[CONFIG-STATE] Error loading user config:",t)});}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x$1({token:a,factory:a.\u0275fac,providedIn:"root"})};var gn=["layoutContainer"],hn=(a,t)=>t.key,_n=(a,t)=>t.name,fn=(a,t)=>t.status,Pt=(a,t)=>t.id;function bn(a,t){if(a&1){let e=lC();ws(0,"button",32),Rg("click",function(){If(e);let i=gC();return wf(i.clearSearch())}),ws(1,"mat-icon"),GC(2,"close"),pl()();}}function vn(a,t){if(a&1){let e=lC();ws(0,"button",33),Rg("click",function(){let i=If(e).$implicit,l=gC(2);return wf(l.setProject(i.name))}),GC(1),ws(2,"span",34),GC(3),pl()();}if(a&2){let e=t.$implicit,n=gC(2);Ug("active",n.activeProject()===e.name),XE(),vl(" ",e.name," "),XE(2),Yg(e.count);}}function Cn(a,t){if(a&1){let e=lC();ws(0,"nav",22)(1,"button",33),Rg("click",function(){If(e);let i=gC();return wf(i.setProject(null))}),GC(2," All projects "),ws(3,"span",34),GC(4),pl()(),rC(5,vn,4,4,"button",35,_n),pl();}if(a&2){let e=gC();XE(),Ug("active",e.activeProject()===null),XE(3),Yg(e.allTasks().length),XE(),oC(e.projectSummaries());}}function yn(a,t){if(a&1&&(ws(0,"span",37),GC(1),pl()),a&2){let e=gC().$implicit,n=gC();XE(),Yg(n.filterCounts()[e.key]);}}function xn(a,t){if(a&1){let e=lC();ws(0,"button",36),Rg("click",function(){let i=If(e).$implicit,l=gC();return wf(l.setFilter(i.key))}),ws(1,"mat-icon",26),GC(2),pl(),ws(3,"span"),GC(4),pl(),Jw(5,yn,2,1,"span",37),pl();}if(a&2){let e=t.$implicit,n=gC();Ug("active",n.activeFilter()===e.key),Tg("aria-selected",n.activeFilter()===e.key),XE(2),Yg(e.icon),XE(2),Yg(e.label),XE(),eC(n.filterCounts()[e.key]>0?5:-1);}}function kn(a,t){a&1&&(ws(0,"div",29),Sg(1,"mat-spinner",38),ws(2,"p"),GC(3,"Loading tasks from all projects\u2026"),pl()());}function Mn(a,t){a&1&&(ws(0,"div",30)(1,"mat-icon",39),GC(2,"hub"),pl(),ws(3,"p"),GC(4,"No tasks found."),pl()());}function Sn(a,t){if(a&1){let e=lC();ws(0,"button",51),Rg("click",function(){If(e);let i=gC(5);return wf(i.markSelectedPausedDone())}),ws(1,"mat-icon"),GC(2,"check_circle_outline"),pl(),GC(3),pl();}if(a&2){let e=gC(5);bg("matTooltip","Mark "+e.selectedPausedCount()+" task(s) as done"),XE(3),vl(" Mark done (",e.selectedPausedCount(),") ");}}function Tn(a,t){if(a&1){let e=lC();ws(0,"mat-checkbox",48),Rg("change",function(){If(e);let i=gC(4);return wf(i.toggleSelectAllPaused())}),pl(),Jw(1,Sn,4,2,"button",49),ws(2,"button",50),Rg("click",function(){If(e);let i=gC(4);return wf(i.toggleSelectMode())}),ws(3,"mat-icon"),GC(4,"close"),pl()();}if(a&2){let e=gC(4);bg("checked",e.allPausedSelected())("indeterminate",e.somePausedSelected()&&!e.allPausedSelected()),XE(),eC(e.selectedPausedCount()>0?1:-1);}}function wn(a,t){if(a&1){let e=lC();ws(0,"button",52),Rg("click",function(){If(e);let i=gC(4);return wf(i.toggleSelectMode())}),ws(1,"mat-icon"),GC(2,"checklist"),pl(),GC(3," Select "),pl();}}function Pn(a,t){if(a&1&&(ws(0,"div",41)(1,"h3",42)(2,"mat-icon",44),GC(3),pl(),GC(4),ws(5,"span",45),GC(6),pl()(),ws(7,"div",46),Jw(8,Tn,5,3)(9,wn,4,0,"button",47),pl()()),a&2){let e=gC().$implicit,n=gC(2);XE(3),Yg(e.icon),XE(),vl(" ",e.label," "),XE(2),Yg(e.tasks.length),XE(2),eC(n.isSelectMode()?8:9);}}function Dn(a,t){if(a&1&&(ws(0,"h3",42)(1,"mat-icon",44),GC(2),pl(),GC(3),ws(4,"span",45),GC(5),pl()()),a&2){let e=gC().$implicit;XE(2),Yg(e.icon),XE(),vl(" ",e.label," "),XE(2),Yg(e.tasks.length);}}function jn(a,t){if(a&1){let e=lC();ws(0,"app-task-card",53),Rg("stopRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onStopRequested(i,l.projectId))})("deleteRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onDeleteRequested(i,l.projectId))})("starToggled",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onStarToggled(i,l.projectId))})("closeTaskRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onCloseTaskRequested(i,l.projectId))})("markDoneRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onMarkDoneRequested(i,l.projectId))})("markActiveRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onMarkActiveRequested(i,l.projectId))})("previewRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onPreviewRequested(i,l.projectId,l.name))})("selectionChanged",function(i){If(e);let l=gC(3);return wf(l.onPausedSelectionChanged(i.id,i.selected))}),pl();}if(a&2){let e=t.$implicit,n=gC().$implicit,i=gC(2);Ug("is-previewed",i.previewThreadId()===e.id),bg("task",e)("projectNameOverride",e.projectId)("showProject",true)("previewMode",i.previewActive())("selectable",n.status==="paused"&&i.isSelectMode())("selected",i.selectedPausedIds().has(e.id));}}function On(a,t){if(a&1&&(ws(0,"section",40),Jw(1,Pn,10,4,"div",41)(2,Dn,6,3,"h3",42),ws(3,"div",31),rC(4,jn,1,8,"app-task-card",43,Pt),pl()()),a&2){let e=t.$implicit;XE(),eC(e.status==="paused"?1:2),XE(3),oC(e.tasks);}}function En(a,t){if(a&1&&rC(0,On,6,1,"section",40,fn),a&2){let e=gC();oC(e.taskGroups());}}function Nn(a,t){if(a&1){let e=lC();ws(0,"app-task-card",55),Rg("stopRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onStopRequested(i,l.projectId))})("deleteRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onDeleteRequested(i,l.projectId))})("starToggled",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onStarToggled(i,l.projectId))})("closeTaskRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onCloseTaskRequested(i,l.projectId))})("markDoneRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onMarkDoneRequested(i,l.projectId))})("markActiveRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onMarkActiveRequested(i,l.projectId))})("previewRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onPreviewRequested(i,l.projectId,l.name))}),pl();}if(a&2){let e=t.$implicit,n=gC(2);Ug("is-previewed",n.previewThreadId()===e.id),bg("task",e)("projectNameOverride",e.projectId)("showProject",true)("previewMode",n.previewActive());}}function In(a,t){if(a&1&&(ws(0,"div",31),rC(1,Nn,1,6,"app-task-card",54,Pt),pl()),a&2){let e=gC();XE(),oC(e.displayedTasks());}}function An(a,t){if(a&1){let e=lC();ws(0,"div",56),Rg("mousedown",function(i){If(e);let l=gC();return wf(l.onResizerMousedown(i))}),pl(),ws(1,"div",57)(2,"header",58)(3,"span",59),GC(4),pl(),ws(5,"div",60)(6,"button",61),Rg("click",function(){If(e);let i=gC();return wf(i.navigateToThread())}),ws(7,"mat-icon"),GC(8,"open_in_new"),pl()(),ws(9,"button",62),Rg("click",function(){If(e);let i=gC();return wf(i.closePreview())}),ws(10,"mat-icon"),GC(11,"close"),pl()()()(),ws(12,"div",63),Sg(13,"app-thread",64),pl()();}if(a&2){let e=gC();XE(),Hg("width",e.previewPanelWidthPercent(),"%"),XE(3),Yg(e.previewTaskName()||"Task"),XE(9),bg("projectName",e.previewProjectId())("threadId",e.previewThreadId());}}var Vn=20,Fn=70,Gn=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{status:"in-progress",label:"In progress",icon:"pending"},{status:"paused",label:"Paused",icon:"pause_circle"},{status:"error",label:"Error",icon:"error"},{status:"done",label:"Done",icon:"check_circle"}],Rn=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],wt=class a{globalTaskService=g(Se);destroyRef=g(Ce);dialog=g(Re);router=g(G);configState=g(Te);userService=g(pe);preferences=g(L);projectState=g(P);threadState=g(U);breakpointObserver=g(Ot$1);username=F(this.userService.username$,{initialValue:null});isDesktop=F(this.breakpointObserver.observe("(min-width: 1280px)").pipe(re(t=>t.matches)),{initialValue:false});previewEnabled=F(this.preferences.missionPreviewEnabled$,{initialValue:false});previewActive=mT(()=>this.previewEnabled()&&this.isDesktop());previewThreadId=Gi(null);previewProjectId=Gi(null);previewTaskName=Gi(null);previewPanelWidthPercent=Gi(this.preferences.getMissionPreviewPanelWidth());isDraggingResizer=false;dragStartX=0;dragStartWidth=0;containerWidth=0;layoutContainerRef;globalEventSource=null;filters=Rn;activeFilter=Gi("all");starredOnly=Gi(false);activeProject=Gi(null);searchQuery=Gi("");isLoading=this.globalTaskService.isLoading;allTasks=this.globalTaskService.tasks;isSelectMode=Gi(false);selectedPausedIds=Gi(new Set);pausedTasks=mT(()=>this.displayedTasks().filter(t=>t.status==="paused"));allPausedSelected=mT(()=>{let t=this.pausedTasks(),e=this.selectedPausedIds();return t.length>0&&t.every(n=>e.has(n.id))});somePausedSelected=mT(()=>{let t=this.selectedPausedIds();return this.pausedTasks().some(e=>t.has(e.id))});selectedPausedCount=mT(()=>{let t=this.selectedPausedIds();return this.pausedTasks().filter(e=>t.has(e.id)).length});projectSummaries=mT(()=>{let t=this.allTasks(),e=new Map;for(let n of t)e.set(n.projectId,(e.get(n.projectId)??0)+1);return [...e.entries()].map(([n,i])=>({name:n,count:i})).sort((n,i)=>n.name.localeCompare(i.name))});filteredTasks=mT(()=>{let t=this.allTasks(),e=this.activeProject();e&&(t=t.filter(l=>l.projectId===e));let n=this.username();this.starredOnly()&&n&&(t=t.filter(l=>l.starring.includes(n)));let i=this.activeFilter();return i!=="all"&&(t=t.filter(l=>l.status===i)),t});filterCounts=mT(()=>{let t=this.allTasks(),e=this.activeProject();e&&(t=t.filter(i=>i.projectId===e));let n=this.username();return this.starredOnly()&&n&&(t=t.filter(i=>i.starring.includes(n))),{all:t.length,"waiting-you":t.filter(i=>i.status==="waiting-you").length,"in-progress":t.filter(i=>i.status==="in-progress").length,done:t.filter(i=>i.status==="done").length,paused:t.filter(i=>i.status==="paused").length,error:t.filter(i=>i.status==="error").length}});displayedTasks=mT(()=>{let t=this.searchQuery().toLowerCase().trim(),e=this.sortedFilteredTasks();return t?e.filter(n=>(n.name||"").toLowerCase().includes(t)||(n.summary||"").toLowerCase().includes(t)):e});taskGroups=mT(()=>{let t=this.displayedTasks();return Gn.map(e=>x(w({},e),{tasks:t.filter(n=>n.status===e.status)})).filter(e=>e.tasks.length>0)});sortedFilteredTasks=mT(()=>{let t=this.filteredTasks(),e={"waiting-you":0,"in-progress":1,paused:2,error:3,done:4};return [...t].sort((n,i)=>(e[n.status]??99)-(e[i.status]??99))});constructor(){this.destroyRef.onDestroy(()=>this.disconnectGlobalSse());}ngOnInit(){this.globalTaskService.refresh(),this.connectGlobalSse(),this.userService.fetchCurrentUser().pipe(U$1(this.destroyRef)).subscribe({error:t=>console.warn("[GTC] Could not fetch user:",t)});}setFilter(t){this.activeFilter.set(t);}toggleStarredFilter(){this.starredOnly.update(t=>!t);}setProject(t){this.activeProject.set(t),this.activeFilter.set("all");}onSearchInput(t){this.searchQuery.set(t.target.value);}clearSearch(){this.searchQuery.set("");}refresh(){this.globalTaskService.refresh();}openPreferences(){this.dialog.open(Ye,{width:"400px"});}openTokenUsage(){this.router.navigate(["/token-usage"]);}openUserConfig(){this.configState.openUserConfigEditor();}openQuickSchedulerDialog(){this.dialog.open(z,{width:"480px",disableClose:false});}openGlobalSchedulersDialog(){this.dialog.open(Me,{width:"600px",maxHeight:"80vh"});}openNewTaskDialog(){this.dialog.open(ke,{width:"500px",disableClose:false}).afterClosed().subscribe(e=>{e&&(e.navigate?this.router.navigate(["project",e.projectId]):(setTimeout(()=>this.globalTaskService.refresh(),300),setTimeout(()=>this.globalTaskService.refresh(),1500)));});}onStopRequested(t,e){this.globalTaskService.stopThread(e,t);}onDeleteRequested(t,e){this.globalTaskService.deleteThread(e,t);}onStarToggled(t,e){let n=this.allTasks().find(p=>p.id===t);if(!n)return;let i=this.username(),l=!!i&&n.starring.includes(i);this.globalTaskService.toggleStar(e,t,l);}onCloseTaskRequested(t,e){let i=this.allTasks().find(p=>p.id===t)?.worktreeProject??e;this.dialog.open(z$1,{width:"420px",data:{title:"Close task",message:`This will stop the agent, delete the thread and remove the worktree project "${i}" from disk. This cannot be undone.`,confirmLabel:"Close task",cancelLabel:"Cancel"}}).afterClosed().subscribe(p=>{p&&this.globalTaskService.closeTask(e,t);});}onMarkDoneRequested(t,e){this.globalTaskService.markTaskDone(e,t);}onMarkActiveRequested(t,e){this.globalTaskService.markTaskActive(e,t);}toggleSelectMode(){let t=!this.isSelectMode();this.isSelectMode.set(t),t||this.selectedPausedIds.set(new Set);}onPausedSelectionChanged(t,e){this.selectedPausedIds.update(n=>{let i=new Set(n);return e?i.add(t):i.delete(t),i});}toggleSelectAllPaused(){let t=this.pausedTasks();this.allPausedSelected()?this.selectedPausedIds.set(new Set):this.selectedPausedIds.set(new Set(t.map(e=>e.id)));}markSelectedPausedDone(){let t=this.selectedPausedIds(),e=this.pausedTasks().filter(n=>t.has(n.id)).map(n=>({id:n.id,projectId:n.projectId}));e.length!==0&&(this.selectedPausedIds.set(new Set),this.isSelectMode.set(false),this.globalTaskService.markTasksBatchDone(e));}onPreviewRequested(t,e,n){this.previewThreadId()===t?(this.previewThreadId.set(null),this.previewProjectId.set(null),this.previewTaskName.set(null)):(this.projectState.selectProject(e),this.threadState.selectThread(t),this.previewProjectId.set(e),this.previewThreadId.set(t),this.previewTaskName.set(n));}closePreview(){this.previewThreadId.set(null),this.previewProjectId.set(null),this.previewTaskName.set(null);}navigateToThread(){let t=this.previewThreadId(),e=this.previewProjectId();!t||!e||this.router.navigate(["project",e,"thread",t]);}onResizerMousedown(t){t.preventDefault(),this.isDraggingResizer=true,this.dragStartX=t.clientX,this.dragStartWidth=this.previewPanelWidthPercent(),this.containerWidth=this.layoutContainerRef?.nativeElement.offsetWidth??window.innerWidth;}onDocumentMousemove(t){if(!this.isDraggingResizer)return;let n=(this.dragStartX-t.clientX)/this.containerWidth*100,i=Math.min(Fn,Math.max(Vn,this.dragStartWidth+n));this.previewPanelWidthPercent.set(i);}onDocumentMouseup(){this.isDraggingResizer&&(this.isDraggingResizer=false,this.preferences.setMissionPreviewPanelWidth(this.previewPanelWidthPercent()));}connectGlobalSse(t=5e3){this.disconnectGlobalSse();let e=new EventSource("/api/event-stream");this.globalEventSource=e,e.onmessage=n=>{try{let i=JSON.parse(n.data),l=le(i);if(!l)return;let p=l.threadId;if(!p)return;l instanceof f||l instanceof b?this.globalTaskService.applyStatusEvent(p,"invite"):l instanceof O?this.globalTaskService.applyStatusEvent(p,"thinking"):l instanceof V&&this.globalTaskService.refresh();}catch(i){}},e.onerror=()=>{e.readyState===EventSource.CLOSED&&(this.globalEventSource=null,setTimeout(()=>{this.globalEventSource||this.connectGlobalSse(Math.min(t*2,6e4));},t));};}disconnectGlobalSse(){this.globalEventSource&&(this.globalEventSource.close(),this.globalEventSource=null);}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=xw({type:a,selectors:[["app-global-task-control"]],viewQuery:function(e,n){if(e&1&&Pg(gn,5),e&2){let i;EC(i=IC())&&(n.layoutContainerRef=i.first);}},hostBindings:function(e,n){e&1&&Rg("mousemove",function(l){return n.onDocumentMousemove(l)},dE)("mouseup",function(){return n.onDocumentMouseup()},dE);},decls:85,vars:11,consts:[["layoutContainer",""],["schedulerMenu","matMenu"],["controlCenterMenu","matMenu"],[1,"gtc"],[1,"gtc-toolbar"],[1,"gtc-toolbar-left"],[1,"gtc-logo-icon"],[1,"gtc-title"],["appearance","fill","subscriptSizing","dynamic",1,"gtc-search"],["matPrefix",""],["matInput","","type","search","placeholder","Filter tasks\u2026","autocomplete","off",3,"input","keydown.escape","value"],["matSuffix","","mat-icon-button","","aria-label","Clear"],[1,"gtc-toolbar-actions"],["mat-icon-button","","matTooltip","Schedulers","aria-label","Schedulers",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-icon-button","","matTooltip","Control Center","aria-label","Control Center",3,"matMenuTriggerFor"],["mat-menu-item","","href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer"],["mat-icon-button","","matTooltip","Refresh all tasks","aria-label","Refresh tasks",3,"click","disabled"],["mat-stroked-button","","routerLink","/projects","aria-label","Manage projects","matTooltip","Manage projects"],[1,"btn-label"],["mat-flat-button","","aria-label","New task","matTooltip","New Task",1,"gtc-new-btn",3,"click"],[1,"gtc-filter-bar"],["aria-label","Filter by project",1,"gtc-project-filters"],["role","tablist","aria-label","Filter by status",1,"gtc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"gtc-body"],[1,"gtc-content"],[1,"gtc-loading"],[1,"gtc-empty"],[1,"gtc-grid"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],[1,"project-chip",3,"click"],[1,"chip-count"],[1,"project-chip",3,"active"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","36"],[1,"empty-icon"],[1,"gtc-group"],[1,"gtc-group-header"],[1,"gtc-group-title"],[3,"task","projectNameOverride","showProject","previewMode","selectable","selected","is-previewed"],[1,"group-icon"],[1,"group-count"],[1,"gtc-group-actions"],["mat-stroked-button","","matTooltip","Select multiple tasks to mark as done","aria-label","Enter selection mode",1,"select-mode-btn"],["aria-label","Select all paused tasks",1,"select-all-checkbox",3,"change","checked","indeterminate"],["mat-flat-button","",1,"batch-done-btn",3,"matTooltip"],["mat-icon-button","","matTooltip","Cancel selection","aria-label","Cancel selection",1,"select-mode-cancel-btn",3,"click"],["mat-flat-button","",1,"batch-done-btn",3,"click","matTooltip"],["mat-stroked-button","","matTooltip","Select multiple tasks to mark as done","aria-label","Enter selection mode",1,"select-mode-btn",3,"click"],[3,"stopRequested","deleteRequested","starToggled","closeTaskRequested","markDoneRequested","markActiveRequested","previewRequested","selectionChanged","task","projectNameOverride","showProject","previewMode","selectable","selected"],[3,"task","projectNameOverride","showProject","previewMode","is-previewed"],[3,"stopRequested","deleteRequested","starToggled","closeTaskRequested","markDoneRequested","markActiveRequested","previewRequested","task","projectNameOverride","showProject","previewMode"],["matTooltip","Drag to resize","aria-hidden","true",1,"gtc-resizer",3,"mousedown"],[1,"gtc-preview-pane"],[1,"gtc-preview-header"],[1,"gtc-preview-title"],[1,"gtc-preview-actions"],["matTooltip","Open full view","aria-label","Open thread in full view","type","button",1,"preview-action-btn",3,"click"],["matTooltip","Close panel","aria-label","Close preview panel","type","button",1,"preview-action-btn",3,"click"],[1,"gtc-preview-body","thread-preview-host"],[3,"projectName","threadId"]],template:function(e,n){if(e&1&&(ws(0,"div",3,0)(2,"header",4)(3,"div",5)(4,"mat-icon",6),GC(5,"hub"),pl(),ws(6,"h1",7),GC(7,"Global Task Control"),pl()(),ws(8,"mat-form-field",8)(9,"mat-icon",9),GC(10,"search"),pl(),ws(11,"input",10),Rg("input",function(l){return n.onSearchInput(l)})("keydown.escape",function(){return n.clearSearch()}),pl(),Jw(12,bn,3,0,"button",11),pl(),ws(13,"div",12)(14,"button",13)(15,"mat-icon"),GC(16,"schedule"),pl()(),ws(17,"mat-menu",null,1)(19,"button",14),Rg("click",function(){return n.openGlobalSchedulersDialog()}),ws(20,"mat-icon"),GC(21,"list"),pl(),ws(22,"span"),GC(23,"View schedulers"),pl()(),ws(24,"button",14),Rg("click",function(){return n.openQuickSchedulerDialog()}),ws(25,"mat-icon"),GC(26,"add"),pl(),ws(27,"span"),GC(28,"New scheduler"),pl()()(),ws(29,"button",15)(30,"mat-icon"),GC(31,"hub"),pl()(),ws(32,"mat-menu",null,2)(34,"button",14),Rg("click",function(){return n.openPreferences()}),ws(35,"mat-icon"),GC(36,"tune"),pl(),ws(37,"span"),GC(38,"Preferences"),pl()(),ws(39,"button",14),Rg("click",function(){return n.openTokenUsage()}),ws(40,"mat-icon"),GC(41,"data_usage"),pl(),ws(42,"span"),GC(43,"Token Usage"),pl()(),ws(44,"button",14),Rg("click",function(){return n.openUserConfig()}),ws(45,"mat-icon"),GC(46,"manage_accounts"),pl(),ws(47,"span"),GC(48,"User Configuration"),pl()(),Sg(49,"mat-divider"),ws(50,"a",16)(51,"mat-icon"),GC(52,"code"),pl(),ws(53,"span"),GC(54,"Contribute on GitHub"),pl()()(),ws(55,"button",17),Rg("click",function(){return n.refresh()}),ws(56,"mat-icon"),GC(57,"refresh"),pl()(),ws(58,"button",18)(59,"mat-icon"),GC(60,"settings"),pl(),ws(61,"span",19),GC(62,"Manage projects"),pl()(),ws(63,"button",20),Rg("click",function(){return n.openNewTaskDialog()}),ws(64,"mat-icon"),GC(65,"rocket_launch"),pl(),ws(66,"span",19),GC(67,"New Task"),pl()()()(),ws(68,"div",21),Jw(69,Cn,7,3,"nav",22),ws(70,"nav",23),rC(71,xn,6,6,"button",24,hn),ws(73,"button",25),Rg("click",function(){return n.toggleStarredFilter()}),ws(74,"mat-icon",26),GC(75,"star"),pl(),ws(76,"span"),GC(77,"Starred"),pl()()()(),ws(78,"div",27)(79,"main",28),Jw(80,kn,4,0,"div",29)(81,Mn,5,0,"div",30)(82,En,2,0)(83,In,3,0,"div",31),pl(),Jw(84,An,14,5),pl()()),e&2){let i=CC(18),l=CC(33);XE(11),bg("value",n.searchQuery()),XE(),eC(n.searchQuery()?12:-1),XE(2),bg("matMenuTriggerFor",i),XE(15),bg("matMenuTriggerFor",l),XE(26),bg("disabled",n.isLoading()),XE(14),eC(n.projectSummaries().length>1?69:-1),XE(2),oC(n.filters),XE(2),Ug("active",n.starredOnly()),Tg("aria-checked",n.starredOnly()),XE(7),eC(n.isLoading()?80:n.displayedTasks().length===0?81:n.activeFilter()==="all"&&!n.searchQuery()?82:83),XE(4),eC(n.previewActive()&&n.previewThreadId()&&n.previewProjectId()?84:-1);}},dependencies:[A,_i,ve,ne,yt,wt$1,hr,pr,Gn$1,Ve,ne$1,Et$1,yt$1,In$1,Ee,ze,Dn$1,He,Ne,ce,nt,Ot$2,zt$1,Tn$1,Sn$1,si],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}.gtc[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden}.gtc-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:0 .75rem;height:56px;flex-shrink:0;border-bottom:1px solid var(--color-border, rgba(0, 0, 0, .1));box-sizing:border-box}.gtc-toolbar-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.gtc-logo-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem;color:var(--color-primary)}.gtc-title[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600;color:var(--color-text);white-space:nowrap}.gtc-search[_ngcontent-%COMP%]{margin-left:auto;flex:0 1 240px;min-width:80px;--mat-form-field-container-height: 36px;--mat-form-field-container-vertical-padding: 6px;font-size:.875rem;--mdc-filled-text-field-container-color: transparent;--mdc-filled-text-field-hover-container-color: transparent;--mdc-filled-text-field-focus-container-color: transparent;--mdc-filled-text-field-active-indicator-color: transparent;--mdc-filled-text-field-hover-active-indicator-color: transparent;--mdc-filled-text-field-focus-active-indicator-color: transparent;--mdc-filled-text-field-active-indicator-height: 0}.gtc-toolbar-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.gtc-new-btn[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;height:36px;padding:0 1rem}.gtc-new-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}@media(max-width:600px){.gtc-toolbar[_ngcontent-%COMP%]{flex-wrap:wrap;height:auto;min-height:48px;padding:.5rem .75rem;gap:.375rem}.gtc-title[_ngcontent-%COMP%]{font-size:.875rem}.gtc-search[_ngcontent-%COMP%]{order:3;flex:1 1 100%;min-width:0;margin-left:0}.gtc-toolbar-actions[_ngcontent-%COMP%]{margin-left:auto}.btn-label[_ngcontent-%COMP%]{display:none}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]){--mdc-text-button-container-height: 36px;--mdc-filled-button-container-height: 36px;--mdc-outlined-button-container-height: 36px;min-width:36px;width:36px;height:36px;padding:0;border-radius:50%!important}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]) .mat-mdc-button-touch-target[_ngcontent-%COMP%]{width:36px;height:36px}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]) mat-icon[_ngcontent-%COMP%]{margin:0!important}}.gtc-filter-bar[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem;padding:.5rem .75rem;flex-shrink:0;border-bottom:1px solid var(--color-border, rgba(0, 0, 0, .08))}.gtc-project-filters[_ngcontent-%COMP%]{display:flex;gap:.375rem;flex-wrap:wrap}.project-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;padding:.2rem .65rem;border-radius:100px;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:transparent;border:1px solid var(--color-border);cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.project-chip[_ngcontent-%COMP%] .chip-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .3rem;font-size:.68rem;font-weight:700;min-width:16px;text-align:center;line-height:16px}.project-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.project-chip.active[_ngcontent-%COMP%] .chip-count[_ngcontent-%COMP%]{background:#ffffff40;color:var(--color-text-inverse)}.project-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.gtc-filters[_ngcontent-%COMP%]{display:flex;gap:.375rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.3rem .75rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff40;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.gtc-body[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1;overflow:hidden;min-height:0}.gtc-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:1rem 1rem 2rem;min-width:0}.gtc-resizer[_ngcontent-%COMP%]{width:6px;flex-shrink:0;cursor:col-resize;background:transparent;border-left:1px solid var(--color-border);border-right:1px solid var(--color-border);transition:background .15s ease}.gtc-resizer[_ngcontent-%COMP%]:hover, .gtc-resizer[_ngcontent-%COMP%]:active{background:var(--color-primary);opacity:.4}.gtc-preview-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;flex-shrink:0;min-width:280px;border-left:1px solid var(--color-border);background:var(--glass-bg)}.gtc-preview-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.625rem .75rem .625rem 1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.gtc-preview-title[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.gtc-preview-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.125rem;flex-shrink:0}.preview-action-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease}.preview-action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;line-height:18px;vertical-align:middle;color:var(--color-text-secondary)}.preview-action-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.preview-action-btn[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-text)}.gtc-preview-body[_ngcontent-%COMP%]{flex:1;overflow:hidden;display:flex;flex-direction:column;min-height:0}.gtc-preview-body[_ngcontent-%COMP%] app-thread[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;min-height:0} app-task-card.is-previewed .task-card{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary)}.gtc-group[_ngcontent-%COMP%]{margin-bottom:1.25rem}.gtc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.gtc-group-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem;gap:.75rem}.gtc-group-header[_ngcontent-%COMP%] .gtc-group-title[_ngcontent-%COMP%]{margin-bottom:0}.gtc-group-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.select-all-checkbox[_ngcontent-%COMP%]{--mdc-checkbox-state-layer-size: 32px}.select-mode-btn[_ngcontent-%COMP%]{height:26px;font-size:.72rem;font-weight:600;padding:0 .625rem;border-radius:8px;color:var(--color-text-secondary);border-color:var(--color-border);line-height:26px}.select-mode-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem;margin-right:.2rem}.select-mode-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);border-color:var(--color-text-secondary);background:var(--color-bg-hover)}.batch-done-btn[_ngcontent-%COMP%]{height:26px;font-size:.72rem;font-weight:600;padding:0 .625rem;border-radius:8px;background:var(--color-success, #34c759);color:#fff;line-height:26px}.batch-done-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem;margin-right:.2rem}.select-mode-cancel-btn[_ngcontent-%COMP%]{width:28px;height:28px;display:inline-flex!important;align-items:center!important;justify-content:center!important;color:var(--color-text-secondary)}.select-mode-cancel-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;line-height:1}.select-mode-cancel-btn[_ngcontent-%COMP%]:hover{color:var(--color-text)}.gtc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.gtc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:.95rem;width:.95rem;height:.95rem}.gtc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:16px;text-align:center;line-height:16px}.gtc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem}@media(max-width:600px){.gtc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.gtc-loading[_ngcontent-%COMP%], .gtc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;padding:3rem;color:var(--color-text-secondary);text-align:center}.gtc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .gtc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.9rem}.empty-icon[_ngcontent-%COMP%]{font-size:2.5rem;width:2.5rem;height:2.5rem;opacity:.3}"]})};
|
|
3
|
+
`),XE(6),bg("ngModel",n.name()),UI(),XE(4),bg("ngModel",n.selectedProject())("matAutocomplete",i),UI(),XE(3),oC(n.filteredProjects()),XE(5),eC(n.isLoadingAgents()?21:-1),XE(),bg("ngModel",n.selectedAgent())("matAutocomplete",l)("disabled",!n.projects().includes(n.selectedProject())),UI(),XE(3),oC(n.filteredAgents()),XE(5),bg("ngModel",n.instruction()),UI(),XE(7),bg("ngModel",n.startTimestamp()),UI(),XE(5),bg("ngModel",n.intervalValue()),UI(),XE(2),bg("ngModel",n.intervalUnit()),UI(),XE(13),oC(n.daysOfWeekOptions),XE(8),bg("ngModel",n.endConditionType()),UI(),XE(7),eC(n.endConditionType()==="occurrences"?72:-1),XE(),eC(n.endConditionType()==="endTimestamp"?73:-1),XE(),bg("ngModel",n.enabled()),UI(),XE(2),eC(n.errorMessage()?76:-1),XE(2),bg("disabled",n.isSaving()),XE(2),bg("disabled",!n.isValid()||n.isSaving()),XE(),eC(n.isSaving()?81:82);}},dependencies:[ti,Ye$1,fn$1,Zn,$t$2,cn$1,zt$2,jt,Vt$1,Nt$1,hr,pr,ce,nt,ae,zt$1,Tn$1,Sn$1,kt$1,Ct,Fn$1,ze$1,Pt$1,Lt$1,ve,ne,Et$1,yt$1,yt,wt$1],styles:['[_nghost-%COMP%]{display:block}h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.qsd-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;padding-top:4px}.full-width[_ngcontent-%COMP%]{width:100%}.qsd-interval[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.qsd-interval[_ngcontent-%COMP%] .qsd-label[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant);white-space:nowrap}.qsd-interval[_ngcontent-%COMP%] .interval-value[_ngcontent-%COMP%]{width:80px}.qsd-interval[_ngcontent-%COMP%] .interval-unit[_ngcontent-%COMP%]{flex:1}.qsd-days[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.qsd-days[_ngcontent-%COMP%] .qsd-label[_ngcontent-%COMP%]{font-size:14px;color:var(--mat-sys-on-surface-variant);white-space:nowrap}.qsd-days[_ngcontent-%COMP%] .qsd-hint[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);opacity:.7;width:100%;margin-top:-4px;padding-left:36px}.qsd-day-chips[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.day-chip[_ngcontent-%COMP%]{padding:4px 10px;border-radius:16px;border:1px solid var(--mat-sys-outline);background:transparent;color:var(--mat-sys-on-surface);font-size:12px;cursor:pointer;transition:background .15s,color .15s}.day-chip.selected[_ngcontent-%COMP%]{background:var(--mat-sys-primary);color:var(--mat-sys-on-primary);border-color:var(--mat-sys-primary)}.day-chip[_ngcontent-%COMP%]:hover:not(.selected){background:var(--mat-sys-surface-variant)}.qsd-divider[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin:4px 0}.qsd-divider[_ngcontent-%COMP%]:before, .qsd-divider[_ngcontent-%COMP%]:after{content:"";flex:1;height:1px;background:var(--mat-sys-outline-variant)}.qsd-divider[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);text-transform:uppercase;letter-spacing:.5px}.qsd-end[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.qsd-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;color:var(--mat-sys-error);font-size:14px}.qsd-error[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}mat-dialog-actions[_ngcontent-%COMP%]{gap:8px}mat-dialog-actions[_ngcontent-%COMP%] button[mat-flat-button][_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}']})};var rn=(a,t)=>t.id;function an(a,t){if(a&1){let e=lC();ws(0,"button",9),Rg("click",function(){let i=If(e).$implicit,l=gC(2);return wf(l.setProject(i))}),GC(1),pl();}if(a&2){let e=t.$implicit,n=gC(2);Ug("active",n.activeProject()===e),XE(),vl(" ",e," ");}}function ln(a,t){if(a&1){let e=lC();ws(0,"nav",2)(1,"button",9),Rg("click",function(){If(e);let i=gC();return wf(i.setProject(null))}),GC(2," All projects "),pl(),rC(3,an,2,3,"button",10,nC),pl();}if(a&2){let e=gC();XE(),Ug("active",e.activeProject()===null),XE(2),oC(e.projects());}}function sn(a,t){a&1&&(ws(0,"div",3),Sg(1,"mat-spinner",11),pl());}function cn(a,t){if(a&1&&(ws(0,"div",4)(1,"mat-icon"),GC(2,"error"),pl(),GC(3),pl()),a&2){let e=gC();XE(3),vl(" ",e.errorMessage()," ");}}function dn(a,t){if(a&1){let e=lC();ws(0,"div",5)(1,"mat-icon"),GC(2,"schedule"),pl(),ws(3,"p"),GC(4,"No scheduled tasks yet."),pl(),ws(5,"button",12),Rg("click",function(){If(e);let i=gC();return wf(i.openCreate())}),ws(6,"mat-icon"),GC(7,"add"),pl(),GC(8," Create one "),pl()();}}function pn(a,t){if(a&1&&(ws(0,"span",17),GC(1),pl()),a&2){let e=gC().$implicit;XE(),Yg(e.projectName);}}function mn(a,t){if(a&1){let e=lC();ws(0,"li",14)(1,"div",15)(2,"span",16),GC(3),pl(),Jw(4,pn,2,1,"span",17),ws(5,"span",18),GC(6),pl()(),ws(7,"div",19)(8,"span",20),GC(9),pl(),ws(10,"span",21),GC(11),pl()(),ws(12,"div",22)(13,"mat-slide-toggle",23),Rg("change",function(){let i=If(e).$implicit,l=gC(2);return wf(l.toggleEnabled(i))}),pl(),ws(14,"button",24),Rg("click",function(){let i=If(e).$implicit,l=gC(2);return wf(l.runNow(i))}),ws(15,"mat-icon"),GC(16,"play_arrow"),pl()(),ws(17,"button",25),Rg("click",function(){let i=If(e).$implicit,l=gC(2);return wf(l.edit(i))}),ws(18,"mat-icon"),GC(19,"edit"),pl()(),ws(20,"button",26),Rg("click",function(){let i=If(e).$implicit,l=gC(2);return wf(l.delete(i))}),ws(21,"mat-icon"),GC(22,"delete"),pl()()()();}if(a&2){let e=t.$implicit,n=gC(2);Ug("disabled",!e.enabled),XE(3),Yg(e.name),XE(),eC(n.projects().length>1?4:-1),XE(2),Yg(n.getSource(e)),XE(3),Yg(n.formatInterval(e.schedule.interval)),XE(),Ug("due",!e.nextRun),XE(),Yg(n.formatNextRun(e.nextRun)),XE(2),bg("checked",e.enabled);}}function un(a,t){if(a&1&&(ws(0,"ul",6),rC(1,mn,23,10,"li",13,rn),pl()),a&2){let e=gC();XE(),oC(e.filteredSchedulers());}}var Me=class a{projectApi=g(c);schedulerApi=g(xe);dialog=g(Re);dialogRef=g(z$2);allSchedulers=Gi([]);isLoading=Gi(true);errorMessage=Gi("");activeProject=Gi(null);projects=Gi([]);filteredSchedulers=mT(()=>{let t=this.activeProject(),e=this.allSchedulers();return t?e.filter(n=>n.projectName===t):e});ngOnInit(){this.load();}load(){this.isLoading.set(true),this.errorMessage.set(""),this.projectApi.listProjects().subscribe({next:({projects:t})=>{let e=t.map(i=>i.name).filter(i=>!i.includes("__"));if(this.projects.set(e),e.length===0){this.isLoading.set(false);return}let n=e.map(i=>this.schedulerApi.listSchedulersForProject(i).pipe(ya(()=>br([]))));By(n).subscribe({next:i=>{let l=[];i.forEach((p,L)=>{p.forEach(oe=>l.push(x(w({},oe),{projectName:e[L]})));}),this.allSchedulers.set(l),this.isLoading.set(false);},error:()=>{this.errorMessage.set("Failed to load schedulers"),this.isLoading.set(false);}});},error:()=>{this.errorMessage.set("Failed to load projects"),this.isLoading.set(false);}});}setProject(t){this.activeProject.set(t);}formatInterval(t){let e=/^(\d+)(min|h|d|M)$/.exec(t);if(!e)return t;let[,n,i]=e;return `Every ${n}${{min:"min",h:"h",d:"d",M:"mo"}[i??""]??i}`}formatNextRun(t){if(!t)return "Expired";let e=new Date(t),n=new Date,i=e.getTime()-n.getTime();if(i<0)return "Due";let l=Math.floor(i/6e4);if(l<60)return `in ${l}m`;let p=Math.floor(l/60);return p<24?`in ${p}h`:`in ${Math.floor(p/24)}d`}getSource(t){if(t.agentName&&t.instruction){let e=t.instruction.length>35?t.instruction.slice(0,35)+"\u2026":t.instruction;return `${t.agentName}: ${e}`}return t.promptId??""}toggleEnabled(t){(t.enabled?this.schedulerApi.disableSchedulerForProject(t.projectName,t.id):this.schedulerApi.enableSchedulerForProject(t.projectName,t.id)).subscribe({next:()=>{this.allSchedulers.update(n=>n.map(i=>i.id===t.id?x(w({},i),{enabled:!i.enabled}):i));},error:()=>this.errorMessage.set("Failed to toggle scheduler")});}runNow(t){this.schedulerApi.runSchedulerNowForProject(t.projectName,t.id).subscribe({error:()=>this.errorMessage.set("Failed to run scheduler")});}edit(t){let e={mode:"edit",projectName:t.projectName,scheduler:{id:t.id,name:t.name,agentName:t.agentName,instruction:t.instruction,enabled:t.enabled,schedule:t.schedule}};this.dialog.open(z,{width:"480px",data:e}).afterClosed().subscribe(i=>{i&&this.load();});}delete(t){this.schedulerApi.deleteSchedulerForProject(t.projectName,t.id).subscribe({next:()=>{this.allSchedulers.update(e=>e.filter(n=>n.id!==t.id));},error:()=>this.errorMessage.set("Failed to delete scheduler")});}openCreate(){this.dialogRef.close(),this.dialog.open(z,{width:"480px"});}close(){this.dialogRef.close();}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=xw({type:a,selectors:[["app-global-schedulers-dialog"]],decls:19,vars:3,consts:[["mat-dialog-title",""],[1,"gsd-count"],[1,"gsd-project-filters"],[1,"gsd-loading"],[1,"gsd-error"],[1,"gsd-empty"],[1,"gsd-list"],["align","end"],["mat-button","",3,"click"],[1,"proj-chip",3,"click"],[1,"proj-chip",3,"active"],["diameter","32"],["mat-flat-button","",3,"click"],[1,"gsd-item",3,"disabled"],[1,"gsd-item"],[1,"gsd-item-main"],[1,"gsd-item-name"],[1,"gsd-item-project"],[1,"gsd-item-source"],[1,"gsd-item-meta"],[1,"gsd-interval"],[1,"gsd-next"],[1,"gsd-item-actions"],["matTooltip","Enable / Disable",3,"change","checked"],["mat-icon-button","","matTooltip","Run now",3,"click"],["mat-icon-button","","matTooltip","Edit",3,"click"],["mat-icon-button","","matTooltip","Delete",1,"delete-btn",3,"click"]],template:function(e,n){e&1&&(ws(0,"h2",0)(1,"mat-icon"),GC(2,"schedule"),pl(),GC(3," Scheduled tasks "),ws(4,"span",1),GC(5),pl()(),ws(6,"mat-dialog-content"),Jw(7,ln,5,2,"nav",2),Jw(8,sn,2,0,"div",3)(9,cn,4,1,"div",4)(10,dn,9,0,"div",5)(11,un,3,0,"ul",6),pl(),ws(12,"mat-dialog-actions",7)(13,"button",8),Rg("click",function(){return n.openCreate()}),ws(14,"mat-icon"),GC(15,"add"),pl(),GC(16," New scheduler "),pl(),ws(17,"button",8),Rg("click",function(){return n.close()}),GC(18,"Close"),pl()()),e&2&&(XE(5),Yg(n.filteredSchedulers().length),XE(2),eC(n.projects().length>1?7:-1),XE(),eC(n.isLoading()?8:n.errorMessage()?9:n.filteredSchedulers().length===0?10:11));},dependencies:[ti,zt$2,jt,Vt$1,Nt$1,hr,pr,Gn$1,yt,wt$1,Et$1,yt$1,Pt$1,Ve,ne$1,ke$1,se],styles:["[_nghost-%COMP%]{display:block}h2[mat-dialog-title][_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}h2[mat-dialog-title][_ngcontent-%COMP%] .gsd-count[_ngcontent-%COMP%]{font-size:13px;font-weight:400;color:var(--mat-sys-on-surface-variant);margin-left:2px}.gsd-project-filters[_ngcontent-%COMP%]{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}.proj-chip[_ngcontent-%COMP%]{padding:4px 12px;border-radius:16px;border:1px solid var(--mat-sys-outline);background:transparent;color:var(--mat-sys-on-surface);font-size:13px;cursor:pointer;transition:background .15s,color .15s}.proj-chip.active[_ngcontent-%COMP%]{background:var(--mat-sys-primary);color:var(--mat-sys-on-primary);border-color:var(--mat-sys-primary)}.proj-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--mat-sys-surface-variant)}.gsd-loading[_ngcontent-%COMP%], .gsd-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:32px 0;color:var(--mat-sys-on-surface-variant)}.gsd-loading[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .gsd-empty[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:40px;width:40px;height:40px;opacity:.4}.gsd-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;color:var(--mat-sys-error);padding:16px 0}.gsd-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.gsd-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:8px;background:var(--mat-sys-surface-container);transition:opacity .2s}.gsd-item.disabled[_ngcontent-%COMP%]{opacity:.5}.gsd-item-main[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.gsd-item-name[_ngcontent-%COMP%]{font-weight:500;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gsd-item-project[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-primary);font-weight:500}.gsd-item-source[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gsd-item-meta[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end;gap:2px;white-space:nowrap}.gsd-interval[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant)}.gsd-next[_ngcontent-%COMP%]{font-size:11px;color:var(--mat-sys-on-surface-variant)}.gsd-next.due[_ngcontent-%COMP%]{color:var(--mat-sys-error)}.gsd-item-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.gsd-item-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]{color:var(--mat-sys-error);opacity:.7;transition:opacity .15s}.gsd-item-actions[_ngcontent-%COMP%] .delete-btn[_ngcontent-%COMP%]:hover{opacity:1}mat-dialog-actions[_ngcontent-%COMP%]{gap:8px}"]})};var Se=class a{http=g(py);threadApi=g(N);projectApi=g(c);isLoading=Gi(false);tasks=Gi([]);refresh(){this.isLoading.set(true),this.threadApi.listAllThreads().pipe(bd(15e3)).subscribe({next:t=>{let e=t.filter(n=>!n.parentThreadId).map(n=>({id:n.id,name:n.name,summary:n.summary,modifiedDate:n.modifiedDate,starring:n.starring??[],users:n.users??[],isActive:false,status:this.deriveStatus(n),projectId:n.projectId,worktreeProject:n.worktreeProject}));this.tasks.set(this.sorted(e)),this.isLoading.set(false);},error:()=>{this.isLoading.set(false);}});}applyStatusEvent(t,e){let n=e==="invite"?"waiting-you":"in-progress";this.tasks.update(i=>this.sorted(i.map(l=>l.id===t?x(w({},l),{status:n}):l)));}closeTask(t,e){this.tasks.update(n=>n.filter(i=>i.id!==e)),this.http.delete(`/api/projects/${t}/missions/${e}`).subscribe({next:()=>this.refresh(),error:n=>{console.error("[GLOBAL-TC] Failed to close task:",n),this.refresh();}});}stopThread(t,e){this.http.post(`/api/projects/${t}/threads/${e}/stop`,{}).subscribe({error:n=>console.error("[GLOBAL-TC] Failed to stop thread:",n)});}deleteThread(t,e){this.tasks.update(n=>n.filter(i=>i.id!==e)),this.http.delete(`/api/projects/${t}/threads/${e}`).subscribe({next:()=>this.refresh(),error:n=>{console.error("[GLOBAL-TC] Failed to delete thread:",n),this.refresh();}});}toggleStar(t,e,n){let i=`/api/projects/${t}/threads/${e}/star`;(n?this.http.delete(i):this.http.post(i,{})).subscribe({next:()=>this.refresh(),error:p=>console.error("[GLOBAL-TC] Failed to toggle star:",p)});}markTaskDone(t,e){this.http.post(`/api/projects/${t}/threads/${e}/done`,{}).subscribe({next:()=>this.refresh(),error:n=>console.error("[GLOBAL-TC] Failed to mark task as done:",n)});}markTasksBatchDone(t){if(t.length===0)return;let e=new Map;for(let{id:l,projectId:p}of t){let L=e.get(p)??[];L.push(l),e.set(p,L);}let n=new Set(t.map(l=>l.id));this.tasks.update(l=>this.sorted(l.map(p=>n.has(p.id)?x(w({},p),{status:"done"}):p)));let i=[...e.entries()].map(([l,p])=>this.projectApi.markThreadsBatchDone(l,p));By(i.length>0?i:[br(null)]).subscribe({next:()=>this.refresh(),error:l=>{console.error("[GLOBAL-TC] Failed to batch-mark tasks as done:",l),this.refresh();}});}markTaskActive(t,e){this.http.delete(`/api/projects/${t}/threads/${e}/done`).subscribe({next:()=>this.refresh(),error:n=>console.error("[GLOBAL-TC] Failed to mark task as active:",n)});}deriveStatus(t){return t.closedByUser?"done":t.pendingInvite?"waiting-you":Date.now()-new Date(t.modifiedDate).getTime()<bt?"in-progress":"paused"}sorted(t){return [...t].sort((e,n)=>{let i=kt[e.status]-kt[n.status];return i!==0?i:e.modifiedDate>n.modifiedDate?-1:1})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x$1({token:a,factory:a.\u0275fac,providedIn:"root"})};var Te=class a{configApi=g(W);dialog=g(Re);openUserConfigEditor(){this.configApi.getUserConfig().subscribe({next:t=>{this.dialog.open(Ze,{data:{configType:"user",initialContent:JSON.stringify(t,null,2)}}).afterClosed().subscribe(n=>{n&&this.configApi.updateUserConfig(n).subscribe({error:i=>console.error("[CONFIG-STATE] Error saving user config:",i)});});},error:t=>console.error("[CONFIG-STATE] Error loading user config:",t)});}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x$1({token:a,factory:a.\u0275fac,providedIn:"root"})};var gn=["layoutContainer"],hn=(a,t)=>t.key,_n=(a,t)=>t.name,fn=(a,t)=>t.status,Pt=(a,t)=>t.id;function bn(a,t){if(a&1){let e=lC();ws(0,"button",32),Rg("click",function(){If(e);let i=gC();return wf(i.clearSearch())}),ws(1,"mat-icon"),GC(2,"close"),pl()();}}function vn(a,t){if(a&1){let e=lC();ws(0,"button",33),Rg("click",function(){let i=If(e).$implicit,l=gC(2);return wf(l.setProject(i.name))}),GC(1),ws(2,"span",34),GC(3),pl()();}if(a&2){let e=t.$implicit,n=gC(2);Ug("active",n.activeProject()===e.name),XE(),vl(" ",e.name," "),XE(2),Yg(e.count);}}function Cn(a,t){if(a&1){let e=lC();ws(0,"nav",22)(1,"button",33),Rg("click",function(){If(e);let i=gC();return wf(i.setProject(null))}),GC(2," All projects "),ws(3,"span",34),GC(4),pl()(),rC(5,vn,4,4,"button",35,_n),pl();}if(a&2){let e=gC();XE(),Ug("active",e.activeProject()===null),XE(3),Yg(e.allTasks().length),XE(),oC(e.projectSummaries());}}function yn(a,t){if(a&1&&(ws(0,"span",37),GC(1),pl()),a&2){let e=gC().$implicit,n=gC();XE(),Yg(n.filterCounts()[e.key]);}}function xn(a,t){if(a&1){let e=lC();ws(0,"button",36),Rg("click",function(){let i=If(e).$implicit,l=gC();return wf(l.setFilter(i.key))}),ws(1,"mat-icon",26),GC(2),pl(),ws(3,"span"),GC(4),pl(),Jw(5,yn,2,1,"span",37),pl();}if(a&2){let e=t.$implicit,n=gC();Ug("active",n.activeFilter()===e.key),Tg("aria-selected",n.activeFilter()===e.key),XE(2),Yg(e.icon),XE(2),Yg(e.label),XE(),eC(n.filterCounts()[e.key]>0?5:-1);}}function kn(a,t){a&1&&(ws(0,"div",29),Sg(1,"mat-spinner",38),ws(2,"p"),GC(3,"Loading tasks from all projects\u2026"),pl()());}function Mn(a,t){a&1&&(ws(0,"div",30)(1,"mat-icon",39),GC(2,"hub"),pl(),ws(3,"p"),GC(4,"No tasks found."),pl()());}function Sn(a,t){if(a&1){let e=lC();ws(0,"button",51),Rg("click",function(){If(e);let i=gC(5);return wf(i.markSelectedPausedDone())}),ws(1,"mat-icon"),GC(2,"check_circle_outline"),pl(),GC(3),pl();}if(a&2){let e=gC(5);bg("matTooltip","Mark "+e.selectedPausedCount()+" task(s) as done"),XE(3),vl(" Mark done (",e.selectedPausedCount(),") ");}}function Tn(a,t){if(a&1){let e=lC();ws(0,"mat-checkbox",48),Rg("change",function(){If(e);let i=gC(4);return wf(i.toggleSelectAllPaused())}),pl(),Jw(1,Sn,4,2,"button",49),ws(2,"button",50),Rg("click",function(){If(e);let i=gC(4);return wf(i.toggleSelectMode())}),ws(3,"mat-icon"),GC(4,"close"),pl()();}if(a&2){let e=gC(4);bg("checked",e.allPausedSelected())("indeterminate",e.somePausedSelected()&&!e.allPausedSelected()),XE(),eC(e.selectedPausedCount()>0?1:-1);}}function wn(a,t){if(a&1){let e=lC();ws(0,"button",52),Rg("click",function(){If(e);let i=gC(4);return wf(i.toggleSelectMode())}),ws(1,"mat-icon"),GC(2,"checklist"),pl(),GC(3," Select "),pl();}}function Pn(a,t){if(a&1&&(ws(0,"div",41)(1,"h3",42)(2,"mat-icon",44),GC(3),pl(),GC(4),ws(5,"span",45),GC(6),pl()(),ws(7,"div",46),Jw(8,Tn,5,3)(9,wn,4,0,"button",47),pl()()),a&2){let e=gC().$implicit,n=gC(2);XE(3),Yg(e.icon),XE(),vl(" ",e.label," "),XE(2),Yg(e.tasks.length),XE(2),eC(n.isSelectMode()?8:9);}}function Dn(a,t){if(a&1&&(ws(0,"h3",42)(1,"mat-icon",44),GC(2),pl(),GC(3),ws(4,"span",45),GC(5),pl()()),a&2){let e=gC().$implicit;XE(2),Yg(e.icon),XE(),vl(" ",e.label," "),XE(2),Yg(e.tasks.length);}}function jn(a,t){if(a&1){let e=lC();ws(0,"app-task-card",53),Rg("stopRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onStopRequested(i,l.projectId))})("deleteRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onDeleteRequested(i,l.projectId))})("starToggled",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onStarToggled(i,l.projectId))})("closeTaskRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onCloseTaskRequested(i,l.projectId))})("markDoneRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onMarkDoneRequested(i,l.projectId))})("markActiveRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onMarkActiveRequested(i,l.projectId))})("previewRequested",function(i){let l=If(e).$implicit,p=gC(3);return wf(p.onPreviewRequested(i,l.projectId,l.name))})("selectionChanged",function(i){If(e);let l=gC(3);return wf(l.onPausedSelectionChanged(i.id,i.selected))}),pl();}if(a&2){let e=t.$implicit,n=gC().$implicit,i=gC(2);Ug("is-previewed",i.previewThreadId()===e.id),bg("task",e)("projectNameOverride",e.projectId)("showProject",true)("previewMode",i.previewActive())("selectable",n.status==="paused"&&i.isSelectMode())("selected",i.selectedPausedIds().has(e.id));}}function On(a,t){if(a&1&&(ws(0,"section",40),Jw(1,Pn,10,4,"div",41)(2,Dn,6,3,"h3",42),ws(3,"div",31),rC(4,jn,1,8,"app-task-card",43,Pt),pl()()),a&2){let e=t.$implicit;XE(),eC(e.status==="paused"?1:2),XE(3),oC(e.tasks);}}function En(a,t){if(a&1&&rC(0,On,6,1,"section",40,fn),a&2){let e=gC();oC(e.taskGroups());}}function Nn(a,t){if(a&1){let e=lC();ws(0,"app-task-card",55),Rg("stopRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onStopRequested(i,l.projectId))})("deleteRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onDeleteRequested(i,l.projectId))})("starToggled",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onStarToggled(i,l.projectId))})("closeTaskRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onCloseTaskRequested(i,l.projectId))})("markDoneRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onMarkDoneRequested(i,l.projectId))})("markActiveRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onMarkActiveRequested(i,l.projectId))})("previewRequested",function(i){let l=If(e).$implicit,p=gC(2);return wf(p.onPreviewRequested(i,l.projectId,l.name))}),pl();}if(a&2){let e=t.$implicit,n=gC(2);Ug("is-previewed",n.previewThreadId()===e.id),bg("task",e)("projectNameOverride",e.projectId)("showProject",true)("previewMode",n.previewActive());}}function In(a,t){if(a&1&&(ws(0,"div",31),rC(1,Nn,1,6,"app-task-card",54,Pt),pl()),a&2){let e=gC();XE(),oC(e.displayedTasks());}}function An(a,t){if(a&1){let e=lC();ws(0,"div",56),Rg("mousedown",function(i){If(e);let l=gC();return wf(l.onResizerMousedown(i))}),pl(),ws(1,"div",57)(2,"header",58)(3,"span",59),GC(4),pl(),ws(5,"div",60)(6,"button",61),Rg("click",function(){If(e);let i=gC();return wf(i.navigateToThread())}),ws(7,"mat-icon"),GC(8,"open_in_new"),pl()(),ws(9,"button",62),Rg("click",function(){If(e);let i=gC();return wf(i.closePreview())}),ws(10,"mat-icon"),GC(11,"close"),pl()()()(),ws(12,"div",63),Sg(13,"app-thread",64),pl()();}if(a&2){let e=gC();XE(),Hg("width",e.previewPanelWidthPercent(),"%"),XE(3),Yg(e.previewTaskName()||"Task"),XE(9),bg("projectName",e.previewProjectId())("threadId",e.previewThreadId());}}var Vn=20,Fn=70,Gn=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{status:"in-progress",label:"In progress",icon:"pending"},{status:"paused",label:"Paused",icon:"pause_circle"},{status:"error",label:"Error",icon:"error"},{status:"done",label:"Done",icon:"check_circle"}],Rn=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],wt=class a{globalTaskService=g(Se);destroyRef=g(Ce);dialog=g(Re);router=g(F);configState=g(Te);userService=g(pe);preferences=g(L);projectState=g(P);threadState=g(U);breakpointObserver=g(Ot$1);username=F$1(this.userService.username$,{initialValue:null});isDesktop=F$1(this.breakpointObserver.observe("(min-width: 1280px)").pipe(re(t=>t.matches)),{initialValue:false});previewEnabled=F$1(this.preferences.missionPreviewEnabled$,{initialValue:false});previewActive=mT(()=>this.previewEnabled()&&this.isDesktop());previewThreadId=Gi(null);previewProjectId=Gi(null);previewTaskName=Gi(null);previewPanelWidthPercent=Gi(this.preferences.getMissionPreviewPanelWidth());isDraggingResizer=false;dragStartX=0;dragStartWidth=0;containerWidth=0;layoutContainerRef;globalEventSource=null;filters=Rn;activeFilter=Gi("all");starredOnly=Gi(false);activeProject=Gi(null);searchQuery=Gi("");isLoading=this.globalTaskService.isLoading;allTasks=this.globalTaskService.tasks;isSelectMode=Gi(false);selectedPausedIds=Gi(new Set);pausedTasks=mT(()=>this.displayedTasks().filter(t=>t.status==="paused"));allPausedSelected=mT(()=>{let t=this.pausedTasks(),e=this.selectedPausedIds();return t.length>0&&t.every(n=>e.has(n.id))});somePausedSelected=mT(()=>{let t=this.selectedPausedIds();return this.pausedTasks().some(e=>t.has(e.id))});selectedPausedCount=mT(()=>{let t=this.selectedPausedIds();return this.pausedTasks().filter(e=>t.has(e.id)).length});projectSummaries=mT(()=>{let t=this.allTasks(),e=new Map;for(let n of t)e.set(n.projectId,(e.get(n.projectId)??0)+1);return [...e.entries()].map(([n,i])=>({name:n,count:i})).sort((n,i)=>n.name.localeCompare(i.name))});filteredTasks=mT(()=>{let t=this.allTasks(),e=this.activeProject();e&&(t=t.filter(l=>l.projectId===e));let n=this.username();this.starredOnly()&&n&&(t=t.filter(l=>l.starring.includes(n)));let i=this.activeFilter();return i!=="all"&&(t=t.filter(l=>l.status===i)),t});filterCounts=mT(()=>{let t=this.allTasks(),e=this.activeProject();e&&(t=t.filter(i=>i.projectId===e));let n=this.username();return this.starredOnly()&&n&&(t=t.filter(i=>i.starring.includes(n))),{all:t.length,"waiting-you":t.filter(i=>i.status==="waiting-you").length,"in-progress":t.filter(i=>i.status==="in-progress").length,done:t.filter(i=>i.status==="done").length,paused:t.filter(i=>i.status==="paused").length,error:t.filter(i=>i.status==="error").length}});displayedTasks=mT(()=>{let t=this.searchQuery().toLowerCase().trim(),e=this.sortedFilteredTasks();return t?e.filter(n=>(n.name||"").toLowerCase().includes(t)||(n.summary||"").toLowerCase().includes(t)):e});taskGroups=mT(()=>{let t=this.displayedTasks();return Gn.map(e=>x(w({},e),{tasks:t.filter(n=>n.status===e.status)})).filter(e=>e.tasks.length>0)});sortedFilteredTasks=mT(()=>{let t=this.filteredTasks(),e={"waiting-you":0,"in-progress":1,paused:2,error:3,done:4};return [...t].sort((n,i)=>(e[n.status]??99)-(e[i.status]??99))});constructor(){this.destroyRef.onDestroy(()=>this.disconnectGlobalSse());}ngOnInit(){this.globalTaskService.refresh(),this.connectGlobalSse(),this.userService.fetchCurrentUser().pipe(U$1(this.destroyRef)).subscribe({error:t=>console.warn("[GTC] Could not fetch user:",t)});}setFilter(t){this.activeFilter.set(t);}toggleStarredFilter(){this.starredOnly.update(t=>!t);}setProject(t){this.activeProject.set(t),this.activeFilter.set("all");}onSearchInput(t){this.searchQuery.set(t.target.value);}clearSearch(){this.searchQuery.set("");}refresh(){this.globalTaskService.refresh();}openPreferences(){this.dialog.open(Ye,{width:"400px"});}openTokenUsage(){this.router.navigate(["/token-usage"]);}openUserConfig(){this.configState.openUserConfigEditor();}openQuickSchedulerDialog(){this.dialog.open(z,{width:"480px",disableClose:false});}openGlobalSchedulersDialog(){this.dialog.open(Me,{width:"600px",maxHeight:"80vh"});}openNewTaskDialog(){this.dialog.open(ke,{width:"500px",disableClose:false}).afterClosed().subscribe(e=>{e&&(e.navigate?this.router.navigate(["project",e.projectId]):(setTimeout(()=>this.globalTaskService.refresh(),300),setTimeout(()=>this.globalTaskService.refresh(),1500)));});}onStopRequested(t,e){this.globalTaskService.stopThread(e,t);}onDeleteRequested(t,e){this.globalTaskService.deleteThread(e,t);}onStarToggled(t,e){let n=this.allTasks().find(p=>p.id===t);if(!n)return;let i=this.username(),l=!!i&&n.starring.includes(i);this.globalTaskService.toggleStar(e,t,l);}onCloseTaskRequested(t,e){let i=this.allTasks().find(p=>p.id===t)?.worktreeProject??e;this.dialog.open(z$1,{width:"420px",data:{title:"Close task",message:`This will stop the agent, delete the thread and remove the worktree project "${i}" from disk. This cannot be undone.`,confirmLabel:"Close task",cancelLabel:"Cancel"}}).afterClosed().subscribe(p=>{p&&this.globalTaskService.closeTask(e,t);});}onMarkDoneRequested(t,e){this.globalTaskService.markTaskDone(e,t);}onMarkActiveRequested(t,e){this.globalTaskService.markTaskActive(e,t);}toggleSelectMode(){let t=!this.isSelectMode();this.isSelectMode.set(t),t||this.selectedPausedIds.set(new Set);}onPausedSelectionChanged(t,e){this.selectedPausedIds.update(n=>{let i=new Set(n);return e?i.add(t):i.delete(t),i});}toggleSelectAllPaused(){let t=this.pausedTasks();this.allPausedSelected()?this.selectedPausedIds.set(new Set):this.selectedPausedIds.set(new Set(t.map(e=>e.id)));}markSelectedPausedDone(){let t=this.selectedPausedIds(),e=this.pausedTasks().filter(n=>t.has(n.id)).map(n=>({id:n.id,projectId:n.projectId}));e.length!==0&&(this.selectedPausedIds.set(new Set),this.isSelectMode.set(false),this.globalTaskService.markTasksBatchDone(e));}onPreviewRequested(t,e,n){this.previewThreadId()===t?(this.previewThreadId.set(null),this.previewProjectId.set(null),this.previewTaskName.set(null)):(this.projectState.selectProject(e),this.threadState.selectThread(t),this.previewProjectId.set(e),this.previewThreadId.set(t),this.previewTaskName.set(n));}closePreview(){this.previewThreadId.set(null),this.previewProjectId.set(null),this.previewTaskName.set(null);}navigateToThread(){let t=this.previewThreadId(),e=this.previewProjectId();!t||!e||this.router.navigate(["project",e,"thread",t]);}onResizerMousedown(t){t.preventDefault(),this.isDraggingResizer=true,this.dragStartX=t.clientX,this.dragStartWidth=this.previewPanelWidthPercent(),this.containerWidth=this.layoutContainerRef?.nativeElement.offsetWidth??window.innerWidth;}onDocumentMousemove(t){if(!this.isDraggingResizer)return;let n=(this.dragStartX-t.clientX)/this.containerWidth*100,i=Math.min(Fn,Math.max(Vn,this.dragStartWidth+n));this.previewPanelWidthPercent.set(i);}onDocumentMouseup(){this.isDraggingResizer&&(this.isDraggingResizer=false,this.preferences.setMissionPreviewPanelWidth(this.previewPanelWidthPercent()));}connectGlobalSse(t=5e3){this.disconnectGlobalSse();let e=new EventSource("/api/event-stream");this.globalEventSource=e,e.onmessage=n=>{try{let i=JSON.parse(n.data),l=le(i);if(!l)return;let p=l.threadId;if(!p)return;l instanceof f||l instanceof b?this.globalTaskService.applyStatusEvent(p,"invite"):l instanceof O?this.globalTaskService.applyStatusEvent(p,"thinking"):l instanceof V&&this.globalTaskService.refresh();}catch(i){}},e.onerror=()=>{e.readyState===EventSource.CLOSED&&(this.globalEventSource=null,setTimeout(()=>{this.globalEventSource||this.connectGlobalSse(Math.min(t*2,6e4));},t));};}disconnectGlobalSse(){this.globalEventSource&&(this.globalEventSource.close(),this.globalEventSource=null);}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=xw({type:a,selectors:[["app-global-task-control"]],viewQuery:function(e,n){if(e&1&&Pg(gn,5),e&2){let i;EC(i=IC())&&(n.layoutContainerRef=i.first);}},hostBindings:function(e,n){e&1&&Rg("mousemove",function(l){return n.onDocumentMousemove(l)},dE)("mouseup",function(){return n.onDocumentMouseup()},dE);},decls:85,vars:11,consts:[["layoutContainer",""],["schedulerMenu","matMenu"],["controlCenterMenu","matMenu"],[1,"gtc"],[1,"gtc-toolbar"],[1,"gtc-toolbar-left"],[1,"gtc-logo-icon"],[1,"gtc-title"],["appearance","fill","subscriptSizing","dynamic",1,"gtc-search"],["matPrefix",""],["matInput","","type","search","placeholder","Filter tasks\u2026","autocomplete","off",3,"input","keydown.escape","value"],["matSuffix","","mat-icon-button","","aria-label","Clear"],[1,"gtc-toolbar-actions"],["mat-icon-button","","matTooltip","Schedulers","aria-label","Schedulers",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-icon-button","","matTooltip","Control Center","aria-label","Control Center",3,"matMenuTriggerFor"],["mat-menu-item","","href","https://github.com/whoz-oss/coday","target","_blank","rel","noopener noreferrer"],["mat-icon-button","","matTooltip","Refresh all tasks","aria-label","Refresh tasks",3,"click","disabled"],["mat-stroked-button","","routerLink","/projects","aria-label","Manage projects","matTooltip","Manage projects"],[1,"btn-label"],["mat-flat-button","","aria-label","New task","matTooltip","New Task",1,"gtc-new-btn",3,"click"],[1,"gtc-filter-bar"],["aria-label","Filter by project",1,"gtc-project-filters"],["role","tablist","aria-label","Filter by status",1,"gtc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"gtc-body"],[1,"gtc-content"],[1,"gtc-loading"],[1,"gtc-empty"],[1,"gtc-grid"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],[1,"project-chip",3,"click"],[1,"chip-count"],[1,"project-chip",3,"active"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","36"],[1,"empty-icon"],[1,"gtc-group"],[1,"gtc-group-header"],[1,"gtc-group-title"],[3,"task","projectNameOverride","showProject","previewMode","selectable","selected","is-previewed"],[1,"group-icon"],[1,"group-count"],[1,"gtc-group-actions"],["mat-stroked-button","","matTooltip","Select multiple tasks to mark as done","aria-label","Enter selection mode",1,"select-mode-btn"],["aria-label","Select all paused tasks",1,"select-all-checkbox",3,"change","checked","indeterminate"],["mat-flat-button","",1,"batch-done-btn",3,"matTooltip"],["mat-icon-button","","matTooltip","Cancel selection","aria-label","Cancel selection",1,"select-mode-cancel-btn",3,"click"],["mat-flat-button","",1,"batch-done-btn",3,"click","matTooltip"],["mat-stroked-button","","matTooltip","Select multiple tasks to mark as done","aria-label","Enter selection mode",1,"select-mode-btn",3,"click"],[3,"stopRequested","deleteRequested","starToggled","closeTaskRequested","markDoneRequested","markActiveRequested","previewRequested","selectionChanged","task","projectNameOverride","showProject","previewMode","selectable","selected"],[3,"task","projectNameOverride","showProject","previewMode","is-previewed"],[3,"stopRequested","deleteRequested","starToggled","closeTaskRequested","markDoneRequested","markActiveRequested","previewRequested","task","projectNameOverride","showProject","previewMode"],["matTooltip","Drag to resize","aria-hidden","true",1,"gtc-resizer",3,"mousedown"],[1,"gtc-preview-pane"],[1,"gtc-preview-header"],[1,"gtc-preview-title"],[1,"gtc-preview-actions"],["matTooltip","Open full view","aria-label","Open thread in full view","type","button",1,"preview-action-btn",3,"click"],["matTooltip","Close panel","aria-label","Close preview panel","type","button",1,"preview-action-btn",3,"click"],[1,"gtc-preview-body","thread-preview-host"],[3,"projectName","threadId"]],template:function(e,n){if(e&1&&(ws(0,"div",3,0)(2,"header",4)(3,"div",5)(4,"mat-icon",6),GC(5,"hub"),pl(),ws(6,"h1",7),GC(7,"Global Task Control"),pl()(),ws(8,"mat-form-field",8)(9,"mat-icon",9),GC(10,"search"),pl(),ws(11,"input",10),Rg("input",function(l){return n.onSearchInput(l)})("keydown.escape",function(){return n.clearSearch()}),pl(),Jw(12,bn,3,0,"button",11),pl(),ws(13,"div",12)(14,"button",13)(15,"mat-icon"),GC(16,"schedule"),pl()(),ws(17,"mat-menu",null,1)(19,"button",14),Rg("click",function(){return n.openGlobalSchedulersDialog()}),ws(20,"mat-icon"),GC(21,"list"),pl(),ws(22,"span"),GC(23,"View schedulers"),pl()(),ws(24,"button",14),Rg("click",function(){return n.openQuickSchedulerDialog()}),ws(25,"mat-icon"),GC(26,"add"),pl(),ws(27,"span"),GC(28,"New scheduler"),pl()()(),ws(29,"button",15)(30,"mat-icon"),GC(31,"hub"),pl()(),ws(32,"mat-menu",null,2)(34,"button",14),Rg("click",function(){return n.openPreferences()}),ws(35,"mat-icon"),GC(36,"tune"),pl(),ws(37,"span"),GC(38,"Preferences"),pl()(),ws(39,"button",14),Rg("click",function(){return n.openTokenUsage()}),ws(40,"mat-icon"),GC(41,"data_usage"),pl(),ws(42,"span"),GC(43,"Token Usage"),pl()(),ws(44,"button",14),Rg("click",function(){return n.openUserConfig()}),ws(45,"mat-icon"),GC(46,"manage_accounts"),pl(),ws(47,"span"),GC(48,"User Configuration"),pl()(),Sg(49,"mat-divider"),ws(50,"a",16)(51,"mat-icon"),GC(52,"code"),pl(),ws(53,"span"),GC(54,"Contribute on GitHub"),pl()()(),ws(55,"button",17),Rg("click",function(){return n.refresh()}),ws(56,"mat-icon"),GC(57,"refresh"),pl()(),ws(58,"button",18)(59,"mat-icon"),GC(60,"settings"),pl(),ws(61,"span",19),GC(62,"Manage projects"),pl()(),ws(63,"button",20),Rg("click",function(){return n.openNewTaskDialog()}),ws(64,"mat-icon"),GC(65,"rocket_launch"),pl(),ws(66,"span",19),GC(67,"New Task"),pl()()()(),ws(68,"div",21),Jw(69,Cn,7,3,"nav",22),ws(70,"nav",23),rC(71,xn,6,6,"button",24,hn),ws(73,"button",25),Rg("click",function(){return n.toggleStarredFilter()}),ws(74,"mat-icon",26),GC(75,"star"),pl(),ws(76,"span"),GC(77,"Starred"),pl()()()(),ws(78,"div",27)(79,"main",28),Jw(80,kn,4,0,"div",29)(81,Mn,5,0,"div",30)(82,En,2,0)(83,In,3,0,"div",31),pl(),Jw(84,An,14,5),pl()()),e&2){let i=CC(18),l=CC(33);XE(11),bg("value",n.searchQuery()),XE(),eC(n.searchQuery()?12:-1),XE(2),bg("matMenuTriggerFor",i),XE(15),bg("matMenuTriggerFor",l),XE(26),bg("disabled",n.isLoading()),XE(14),eC(n.projectSummaries().length>1?69:-1),XE(2),oC(n.filters),XE(2),Ug("active",n.starredOnly()),Tg("aria-checked",n.starredOnly()),XE(7),eC(n.isLoading()?80:n.displayedTasks().length===0?81:n.activeFilter()==="all"&&!n.searchQuery()?82:83),XE(4),eC(n.previewActive()&&n.previewThreadId()&&n.previewProjectId()?84:-1);}},dependencies:[A,_i,ve,ne,yt,wt$1,hr,pr,Gn$1,Ve,ne$1,Et$1,yt$1,In$1,Ee,ze,Dn$1,He,Ne,ce,nt,Ot$2,zt$1,Tn$1,Sn$1,$t$1],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}.gtc[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden}.gtc-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:0 .75rem;height:56px;flex-shrink:0;border-bottom:1px solid var(--color-border, rgba(0, 0, 0, .1));box-sizing:border-box}.gtc-toolbar-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.gtc-logo-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem;color:var(--color-primary)}.gtc-title[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600;color:var(--color-text);white-space:nowrap}.gtc-search[_ngcontent-%COMP%]{margin-left:auto;flex:0 1 240px;min-width:80px;--mat-form-field-container-height: 36px;--mat-form-field-container-vertical-padding: 6px;font-size:.875rem;--mdc-filled-text-field-container-color: transparent;--mdc-filled-text-field-hover-container-color: transparent;--mdc-filled-text-field-focus-container-color: transparent;--mdc-filled-text-field-active-indicator-color: transparent;--mdc-filled-text-field-hover-active-indicator-color: transparent;--mdc-filled-text-field-focus-active-indicator-color: transparent;--mdc-filled-text-field-active-indicator-height: 0}.gtc-toolbar-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.gtc-new-btn[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;height:36px;padding:0 1rem}.gtc-new-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}@media(max-width:600px){.gtc-toolbar[_ngcontent-%COMP%]{flex-wrap:wrap;height:auto;min-height:48px;padding:.5rem .75rem;gap:.375rem}.gtc-title[_ngcontent-%COMP%]{font-size:.875rem}.gtc-search[_ngcontent-%COMP%]{order:3;flex:1 1 100%;min-width:0;margin-left:0}.gtc-toolbar-actions[_ngcontent-%COMP%]{margin-left:auto}.btn-label[_ngcontent-%COMP%]{display:none}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]){--mdc-text-button-container-height: 36px;--mdc-filled-button-container-height: 36px;--mdc-outlined-button-container-height: 36px;min-width:36px;width:36px;height:36px;padding:0;border-radius:50%!important}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]) .mat-mdc-button-touch-target[_ngcontent-%COMP%]{width:36px;height:36px}.gtc-toolbar-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(mat-icon-button):not([mat-icon-button]) mat-icon[_ngcontent-%COMP%]{margin:0!important}}.gtc-filter-bar[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem;padding:.5rem .75rem;flex-shrink:0;border-bottom:1px solid var(--color-border, rgba(0, 0, 0, .08))}.gtc-project-filters[_ngcontent-%COMP%]{display:flex;gap:.375rem;flex-wrap:wrap}.project-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;padding:.2rem .65rem;border-radius:100px;font-size:.75rem;font-weight:500;color:var(--color-text-secondary);background:transparent;border:1px solid var(--color-border);cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.project-chip[_ngcontent-%COMP%] .chip-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .3rem;font-size:.68rem;font-weight:700;min-width:16px;text-align:center;line-height:16px}.project-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.project-chip.active[_ngcontent-%COMP%] .chip-count[_ngcontent-%COMP%]{background:#ffffff40;color:var(--color-text-inverse)}.project-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.gtc-filters[_ngcontent-%COMP%]{display:flex;gap:.375rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.3rem .75rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff40;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.gtc-body[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1;overflow:hidden;min-height:0}.gtc-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:1rem 1rem 2rem;min-width:0}.gtc-resizer[_ngcontent-%COMP%]{width:6px;flex-shrink:0;cursor:col-resize;background:transparent;border-left:1px solid var(--color-border);border-right:1px solid var(--color-border);transition:background .15s ease}.gtc-resizer[_ngcontent-%COMP%]:hover, .gtc-resizer[_ngcontent-%COMP%]:active{background:var(--color-primary);opacity:.4}.gtc-preview-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;flex-shrink:0;min-width:280px;border-left:1px solid var(--color-border);background:var(--glass-bg)}.gtc-preview-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.625rem .75rem .625rem 1rem;border-bottom:1px solid var(--color-border);flex-shrink:0}.gtc-preview-title[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.gtc-preview-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.125rem;flex-shrink:0}.preview-action-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease}.preview-action-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;line-height:18px;vertical-align:middle;color:var(--color-text-secondary)}.preview-action-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.preview-action-btn[_ngcontent-%COMP%]:hover mat-icon[_ngcontent-%COMP%]{color:var(--color-text)}.gtc-preview-body[_ngcontent-%COMP%]{flex:1;overflow:hidden;display:flex;flex-direction:column;min-height:0}.gtc-preview-body[_ngcontent-%COMP%] app-thread[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;min-height:0} app-task-card.is-previewed .task-card{border-color:var(--color-primary);box-shadow:0 0 0 2px var(--color-primary)}.gtc-group[_ngcontent-%COMP%]{margin-bottom:1.25rem}.gtc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.gtc-group-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem;gap:.75rem}.gtc-group-header[_ngcontent-%COMP%] .gtc-group-title[_ngcontent-%COMP%]{margin-bottom:0}.gtc-group-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.select-all-checkbox[_ngcontent-%COMP%]{--mdc-checkbox-state-layer-size: 32px}.select-mode-btn[_ngcontent-%COMP%]{height:26px;font-size:.72rem;font-weight:600;padding:0 .625rem;border-radius:8px;color:var(--color-text-secondary);border-color:var(--color-border);line-height:26px}.select-mode-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem;margin-right:.2rem}.select-mode-btn[_ngcontent-%COMP%]:hover{color:var(--color-text);border-color:var(--color-text-secondary);background:var(--color-bg-hover)}.batch-done-btn[_ngcontent-%COMP%]{height:26px;font-size:.72rem;font-weight:600;padding:0 .625rem;border-radius:8px;background:var(--color-success, #34c759);color:#fff;line-height:26px}.batch-done-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem;margin-right:.2rem}.select-mode-cancel-btn[_ngcontent-%COMP%]{width:28px;height:28px;display:inline-flex!important;align-items:center!important;justify-content:center!important;color:var(--color-text-secondary)}.select-mode-cancel-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem;line-height:1}.select-mode-cancel-btn[_ngcontent-%COMP%]:hover{color:var(--color-text)}.gtc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.gtc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:.95rem;width:.95rem;height:.95rem}.gtc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:16px;text-align:center;line-height:16px}.gtc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem}@media(max-width:600px){.gtc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.gtc-loading[_ngcontent-%COMP%], .gtc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;padding:3rem;color:var(--color-text-secondary);text-align:center}.gtc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .gtc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.9rem}.empty-icon[_ngcontent-%COMP%]{font-size:2.5rem;width:2.5rem;height:2.5rem;opacity:.3}"]})};
|
|
4
4
|
export{wt as GlobalTaskControlComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {w,av as B$1,x as x$1}from'./main-
|
|
1
|
+
import {w,av as B$1,x as x$1}from'./main-5MNGHNLY.js';function ct(){return {async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}var re=ct();function rn(n){re=n;}var xe={exec:()=>null};function k(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:(t,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace(D.caret,"$1"),r=r.replace(t,l),s},getRegex:()=>new RegExp(r,e)};return s}var D={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},Hn=/^(?:[ \t]*(?:\n|$))+/,Gn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Wn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Te=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,pt=/(?:[*+-]|\d{1,9}[.)])/,sn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ln=k(sn).replace(/bull/g,pt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Zn=k(sn).replace(/bull/g,pt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ut=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Yn=/^[^\n]+/,ht=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,jn=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ht).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xn=k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,pt).getRegex(),Fe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ft=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Qn=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ft).replace("tag",Fe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),an=k(ut).replace("hr",Te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Fe).getRegex(),Vn=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",an).getRegex(),gt={blockquote:Vn,code:Gn,def:jn,fences:Wn,heading:qn,hr:Te,html:Qn,lheading:ln,list:Xn,newline:Hn,paragraph:an,table:xe,text:Yn},Vt=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Fe).getRegex(),Kn=x$1(w({},gt),{lheading:Zn,table:Vt,paragraph:k(ut).replace("hr",Te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Vt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Fe).getRegex()}),Jn=x$1(w({},gt),{html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ft).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:xe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(ut).replace("hr",Te).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",ln).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),er=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,on=/^( {2,}|\\)\n(?!\s*$)/,nr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Be=/[\p{P}\p{S}]/u,dt=/[\s\p{P}\p{S}]/u,cn=/[^\s\p{P}\p{S}]/u,rr=k(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,dt).getRegex(),pn=/(?!~)[\p{P}\p{S}]/u,sr=/(?!~)[\s\p{P}\p{S}]/u,ir=/(?:[^\s\p{P}\p{S}]|~)/u,lr=/\[(?:[^\[\]`]|`[^`]*?`)*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,un=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ar=k(un,"u").replace(/punct/g,Be).getRegex(),or=k(un,"u").replace(/punct/g,pn).getRegex(),hn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",cr=k(hn,"gu").replace(/notPunctSpace/g,cn).replace(/punctSpace/g,dt).replace(/punct/g,Be).getRegex(),pr=k(hn,"gu").replace(/notPunctSpace/g,ir).replace(/punctSpace/g,sr).replace(/punct/g,pn).getRegex(),ur=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cn).replace(/punctSpace/g,dt).replace(/punct/g,Be).getRegex(),hr=k(/\\(punct)/,"gu").replace(/punct/g,Be).getRegex(),fr=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),gr=k(ft).replace("(?:-->|$)","-->").getRegex(),dr=k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",gr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ze=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,mr=k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ze).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fn=k(/^!?\[(label)\]\[(ref)\]/).replace("label",ze).replace("ref",ht).getRegex(),gn=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",ht).getRegex(),kr=k("reflink|nolink(?!\\()","g").replace("reflink",fn).replace("nolink",gn).getRegex(),Kt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,mt={_backpedal:xe,anyPunctuation:hr,autolink:fr,blockSkip:lr,br:on,code:tr,del:xe,emStrongLDelim:ar,emStrongRDelimAst:cr,emStrongRDelimUnd:ur,escape:er,link:mr,nolink:gn,punctuation:rr,reflink:fn,reflinkSearch:kr,tag:dr,text:nr,url:xe},br=x$1(w({},mt),{link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",ze).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ze).getRegex()}),lt=x$1(w({},mt),{emStrongRDelimAst:pr,emStrongLDelim:or,url:k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Kt).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Kt).getRegex()}),xr=x$1(w({},lt),{br:k(on).replace("{2,}","*").getRegex(),text:k(lt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),ve={normal:gt,gfm:Kn,pedantic:Jn},me={normal:mt,gfm:lt,breaks:xr,pedantic:br},Tr={"&":"&","<":"<",">":">",'"':""","'":"'"},Jt=n=>Tr[n];function q(n,e){if(e){if(D.escapeTest.test(n))return n.replace(D.escapeReplace,Jt)}else if(D.escapeTestNoEncode.test(n))return n.replace(D.escapeReplaceNoEncode,Jt);return n}function en(n){try{n=encodeURI(n).replace(D.percentDecode,"%");}catch(e){return null}return n}function tn(n,e){let r=n.replace(D.findPipe,(a,l,o)=>{let p=false,u=l;for(;--u>=0&&o[u]==="\\";)p=!p;return p?"|":" |"}),s=r.split(D.splitPipe),t=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;t<s.length;t++)s[t]=s[t].trim().replace(D.slashPipe,"|");return s}function ke(n,e,r){let s=n.length;if(s===0)return "";let t=0;for(;t<s;){let a=n.charAt(s-t-1);if(a===e&&true)t++;else break}return n.slice(0,s-t)}function wr(n,e){if(n.indexOf(e[1])===-1)return -1;let r=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])r++;else if(n[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}function nn(n,e,r,s,t){let a=e.href,l=e.title||null,o=n[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=true;let p={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:l,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=false,p}function Ar(n,e,r){let s=n.match(r.other.indentCodeCompensation);if(s===null)return e;let t=s[1];return e.split(`
|
|
3
3
|
`).map(a=>{let l=a.match(r.other.beginningSpace);if(l===null)return a;let[o]=l;return o.length>=t.length?a.slice(t.length):a}).join(`
|
|
4
4
|
`)}var $e=class{options;rules;lexer;constructor(n){this.options=n||re;}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return {type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return {type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ke(r,`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-DZYWKX3_.js';import {v}from'./chunk-BY47yNsu.js';import {g,ao as W,F as F$1,C as Ce,G as Gi,b as U$1,r as re,bS as Ea,Q as br,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,s as rC,ac as gC,y as oC,a9 as lC,a8 as Yg,u as bg,aa as If,ab as wf}from'./main-5MNGHNLY.js';import'./chunk-CUSpXmFJ.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-Ch_3uDw1.js';import'./chunk-Di5xhd_-.js';import'./chunk-BEDBkVgu.js';import'./chunk-DRsOVECa.js';import'./chunk-Co7LObXe.js';var $=(i,e)=>e.key;function q(i,e){i&1&&(ws(0,"p",2),GC(1,"Loading AI providers\u2026"),pl());}function z(i,e){i&1&&(ws(0,"p",3),GC(1,"No AI providers available."),pl());}function j(i,e){i&1&&(ws(0,"ds-tag",11),GC(1,"Read-only"),pl());}function G(i,e){if(i&1){let t=lC();ws(0,"button",13),Rg("click",function(){If(t);let c=gC().$implicit,l=gC(2);return wf(l.edit(c))}),GC(1,"Edit"),pl(),ws(2,"button",15),Rg("click",function(){If(t);let c=gC().$implicit,l=gC(2);return wf(l.delete(c))}),GC(3,"Delete"),pl();}}function H(i,e){i&1&&(ws(0,"button",14),GC(1,"Inherited"),pl());}function U(i,e){if(i&1){let t=lC();ws(0,"tr")(1,"td",7),GC(2),pl(),ws(3,"td",8),GC(4),pl(),ws(5,"td")(6,"div",9)(7,"ds-tag",10),GC(8),pl(),Jw(9,j,2,0,"ds-tag",11),pl()(),ws(10,"td",12)(11,"button",13),Rg("click",function(){let c=If(t).$implicit,l=gC(2);return wf(l.duplicate(c))}),GC(12,"Duplicate"),pl(),Jw(13,G,4,0)(14,H,2,0,"button",14),pl()();}if(i&2){let t=e.$implicit;XE(2),Yg(t.config.name),XE(2),Yg(t.config.apiType),XE(3),bg("variant",t.scopeLabel==="Platform"?"neutral":t.scopeLabel==="Personal"?"outline":"accent"),XE(),Yg(t.scopeLabel),XE(),eC(t.canMutate?-1:9),XE(4),eC(t.canMutate?13:14);}}function B(i,e){if(i&1&&(ws(0,"div",4)(1,"table",5)(2,"thead")(3,"tr")(4,"th"),GC(5,"Name"),pl(),ws(6,"th"),GC(7,"API type"),pl(),ws(8,"th"),GC(9,"Scope"),pl(),ws(10,"th")(11,"span",6),GC(12,"Actions"),pl()()()(),ws(13,"tbody"),rC(14,U,15,6,"tr",null,$),pl()()()),i&2){let t=gC();XE(14),oC(t.rows());}}var F=class i{route=g(W);router=g(F$1);destroyRef=g(Ce);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Gi(false);isLoading=Gi(true);rows=Gi([]);ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(re(e=>e.get("namespaceId")??""),Ea(e=>e?this.namespaceRole.isAdminOfNamespace$(e):br(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.rows.set(this.toRows(e)),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:n(this.isAdmin())}});}edit(e){!e.canMutate||!e.config.id||this.router.navigate(["/agentos",this.namespaceId,"ai-providers",e.config.id,"edit"],{queryParams:{scope:e.scope}});}delete(e){!e.canMutate||!e.config.id||!confirm(`Delete AI provider \u201C${e.config.name}\u201D?`)||this.state.delete(e.config.id,e.scope).pipe(U$1(this.destroyRef)).subscribe();}duplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toRows(e){return [...this.mapScope(e.platform,"platform","Platform",false),...this.mapScope(e.namespace,"namespace","Namespace",this.isAdmin()),...this.mapScope(e.userOnNs,"userOnNs","Personal",true),...this.mapScope(e.userGlobal,"userGlobal","Personal",true)]}mapScope(e,t,s,c){return e.map((l,V)=>({key:`${t}:${l.id??V}`,config:l,scope:t,scopeLabel:s,canMutate:c}))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-ai-providers-all-scopes"]],decls:6,vars:1,consts:[["title","AI providers","description","AI providers available in this namespace, including inherited platform and personal entries."],["type","button",1,"ai-providers__new",3,"click"],["role","status",1,"ai-providers__status"],[1,"ai-providers__status"],[1,"ai-providers__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"ai-providers__name"],[1,"ai-providers__type"],[1,"ai-providers__tags"],[3,"variant"],["variant","outline"],[1,"ai-providers__actions"],["type","button",3,"click"],["type","button","disabled",""],["type","button",1,"ai-providers__delete",3,"click"]],template:function(t,s){t&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return s.openCreateForm()}),GC(2," New AI provider "),pl()(),Jw(3,q,2,0,"p",2)(4,z,2,0,"p",3)(5,B,16,0,"div",4)),t&2&&(XE(3),eC(s.isLoading()?3:s.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn],styles:[".ai-providers__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.ai-providers__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.ai-providers__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.ai-providers__name[_ngcontent-%COMP%]{font-weight:500}.ai-providers__type[_ngcontent-%COMP%]{color:var(--color-text-secondary)}.ai-providers__tags[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.ai-providers__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.ai-providers__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.ai-providers__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.ai-providers__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.ai-providers__actions[_ngcontent-%COMP%] .ai-providers__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{F as AiProvidersAllScopesComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c}from'./chunk-CW5ww82f.js';import {g,ao as W$1,F,C as Ce,G as Gi,M as By,a7 as ya,Q as br,b as U$1,x,w,dc as Re,de as Ve,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,s as rC,ac as gC,y as oC,a8 as Yg,u as bg,a9 as lC,aa as If,ab as wf}from'./main-5MNGHNLY.js';import {d as Kn,J as Jn,Y as Yn}from'./chunk-Ch_3uDw1.js';import'./chunk-Di5xhd_-.js';import'./chunk-BEDBkVgu.js';var z=(n,t)=>t.key;function A(n,t){n&1&&(ws(0,"p",2),GC(1,"Loading scheduled prompts\u2026"),pl());}function j(n,t){n&1&&(ws(0,"p",3),GC(1,"No scheduled prompts available."),pl());}function K(n,t){if(n&1&&(ws(0,"span",8),GC(1),pl()),n&2){let e=gC().$implicit;XE(),Yg(e.prompt.description);}}function W(n,t){n&1&&(ws(0,"ds-tag",11),GC(1,"Read-only"),pl());}function q(n,t){if(n&1){let e=lC();ws(0,"button",14),Rg("click",function(){If(e);let d=gC().$implicit,l=gC(2);return wf(l.toggle(d))}),GC(1),pl(),ws(2,"button",14),Rg("click",function(){If(e);let d=gC().$implicit,l=gC(2);return wf(l.edit(d))}),GC(3,"Edit"),pl(),ws(4,"button",15),Rg("click",function(){If(e);let d=gC().$implicit,l=gC(2);return wf(l.delete(d))}),GC(5,"Delete"),pl();}if(n&2){let e=gC().$implicit;XE(),Yg(e.prompt.enabled?"Disable":"Enable");}}function B(n,t){n&1&&(ws(0,"button",13),GC(1,"Inherited"),pl());}function H(n,t){if(n&1&&(ws(0,"tr")(1,"td")(2,"span",7),GC(3),pl(),Jw(4,K,2,1,"span",8),pl(),ws(5,"td"),GC(6),pl(),ws(7,"td")(8,"ds-tag",9),GC(9),pl()(),ws(10,"td")(11,"div",10)(12,"ds-tag",9),GC(13),pl(),Jw(14,W,2,0,"ds-tag",11),pl()(),ws(15,"td",12),Jw(16,q,6,1)(17,B,2,0,"button",13),pl()()),n&2){let e=t.$implicit,r=gC(2);XE(3),Yg(e.prompt.name),XE(),eC(e.prompt.description?4:-1),XE(2),Yg(r.scheduleLabel(e.prompt)),XE(2),bg("variant",e.prompt.enabled?"accent":"outline"),XE(),Yg(e.prompt.enabled?"Enabled":"Disabled"),XE(3),bg("variant",e.scope==="platform"?"neutral":"accent"),XE(),Yg(e.scope==="platform"?"Platform":"Namespace"),XE(),eC(e.scope==="platform"?14:-1),XE(2),eC(e.scope==="namespace"?16:17);}}function J(n,t){if(n&1&&(ws(0,"div",4)(1,"table",5)(2,"thead")(3,"tr")(4,"th"),GC(5,"Name"),pl(),ws(6,"th"),GC(7,"Schedule"),pl(),ws(8,"th"),GC(9,"Status"),pl(),ws(10,"th"),GC(11,"Scope"),pl(),ws(12,"th")(13,"span",6),GC(14,"Actions"),pl()()()(),ws(15,"tbody"),rC(16,H,18,9,"tr",null,z),pl()()()),n&2){let e=gC();XE(16),oC(e.rows());}}var U=class n{route=g(W$1);router=g(F);destroyRef=g(Ce);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=Gi([]);isLoading=Gi(true);constructor(){By({platform:this.state.listPlatform().pipe(ya(()=>br([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U$1(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((r,d)=>({key:`platform:${r.id??d}`,prompt:r,scope:"platform"})),...e.map((r,d)=>({key:`namespace:${r.id??d}`,prompt:r,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U$1(this.destroyRef)).subscribe(r=>this.rows.update(d=>d.map(l=>l.key===t.key?x(w({},l),{prompt:r}):l)));}delete(t){t.scope==="platform"||!t.prompt.id||!confirm(`Delete scheduled prompt \u201C${t.prompt.name}\u201D?`)||this.state.delete(t.prompt.id).pipe(U$1(this.destroyRef)).subscribe(()=>this.rows.update(e=>e.filter(r=>r.key!==t.key)));}scheduleLabel(t){let e=t.recurrence,r=e.unit===Re.WEEK?"week":"month",d=e.unit===Re.WEEK&&e.days?.length?` (${e.days.map(l=>Ve[l]??l).join(", ")})`:"";return `Every ${r}${d} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:6,vars:1,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["type","button",1,"scheduled-prompts__new",3,"click"],["role","status",1,"scheduled-prompts__status"],[1,"scheduled-prompts__status"],[1,"scheduled-prompts__table-wrap"],["dsTable",""],[1,"sr-only"],[1,"scheduled-prompts__name"],[1,"scheduled-prompts__description"],[3,"variant"],[1,"scheduled-prompts__tags"],["variant","outline"],[1,"scheduled-prompts__actions"],["type","button","disabled",""],["type","button",3,"click"],["type","button",1,"scheduled-prompts__delete",3,"click"]],template:function(e,r){e&1&&(ws(0,"ds-section-header",0)(1,"button",1),Rg("click",function(){return r.openCreateForm()}),GC(2," New scheduled prompt "),pl()(),Jw(3,A,2,0,"p",2)(4,j,2,0,"p",3)(5,J,18,0,"div",4)),e&2&&(XE(3),eC(r.isLoading()?3:r.rows().length===0?4:5));},dependencies:[Kn,Jn,Yn],styles:[".scheduled-prompts__new[_ngcontent-%COMP%]{padding:7px 12px;border:1px solid var(--color-accent);border-radius:0;background:var(--color-accent);color:var(--color-bg);cursor:pointer;font-family:var(--font-heading);font-size:14px;font-weight:600}.scheduled-prompts__status[_ngcontent-%COMP%]{margin:20px 8px;color:var(--color-text-secondary)}.scheduled-prompts__table-wrap[_ngcontent-%COMP%]{overflow-x:auto}table.ds-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:14px}table.ds-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid var(--color-divider);color:var(--color-neutral-600);font-size:11px;letter-spacing:.08em;text-align:left;text-transform:uppercase}table.ds-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px;border-bottom:1px solid color-mix(in srgb,var(--color-text) 8%,transparent)}table.ds-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.scheduled-prompts__name[_ngcontent-%COMP%]{display:block;font-weight:500}.scheduled-prompts__description[_ngcontent-%COMP%]{display:block;color:var(--color-text-secondary);font-size:12px}.scheduled-prompts__tags[_ngcontent-%COMP%]{display:flex;gap:4px;flex-wrap:wrap}.scheduled-prompts__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:4px;white-space:nowrap}.scheduled-prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:4px 7px;border:1px solid transparent;background:transparent;color:var(--color-accent);cursor:pointer;font:inherit}.scheduled-prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-100)}.scheduled-prompts__actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--color-neutral-600);cursor:default}.scheduled-prompts__actions[_ngcontent-%COMP%] .scheduled-prompts__delete[_ngcontent-%COMP%]{color:var(--color-error)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}"]})};export{U as ScheduledPromptListComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {d}from'./chunk-CUSpXmFJ.js';import {g,ao as W$1,F,C as Ce,da as $$1,G as Gi,m as mT,b as U$1,e as xw,$ as $t,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,u as bg,v as eC,ac as gC,a8 as Yg,z as Ug,a5 as vl,a9 as lC,T as Tg,s as rC,y as oC,S as Sg,bf as aT,bg as uT,aa as If,ab as wf,bj as aE}from'./main-5MNGHNLY.js';import'./chunk-Co7LObXe.js';import'./chunk-Ch_3uDw1.js';import'./chunk-Di5xhd_-.js';import'./chunk-BEDBkVgu.js';var $=(n,o)=>o.id,B=(n,o)=>o.name;function j(n,o){n&1&&(ws(0,"p",6),GC(1,"Loading\u2026"),pl());}function H(n,o){n&1&&(ws(0,"p",7),GC(1,"Failed to load agent definition."),pl());}function J(n,o){if(n&1&&(ws(0,"dt",12),GC(1,"User context"),pl(),ws(2,"dd",14),GC(3),pl()),n&2){let e=gC();XE(3),Yg(e.userId);}}function U(n,o){if(n&1&&(ws(0,"pre",22),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.systemPrompt);}}function G(n,o){if(n&1){let e=lC();ws(0,"section",9)(1,"button",20),Rg("click",function(){If(e);let p=gC(2);return wf(p.toggleSystemPrompt())}),ws(2,"h2",10),GC(3,"System Prompt"),pl(),ws(4,"span",21),GC(5," \u25BC "),pl()(),Jw(6,U,2,1,"pre",22),pl();}if(n&2){let e=gC(2);XE(),Tg("aria-expanded",!e.systemPromptCollapsed()),XE(3),Ug("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),XE(2),eC(e.systemPromptCollapsed()?-1:6);}}function K(n,o){if(n&1&&(ws(0,"pre",22),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.instructions);}}function q(n,o){if(n&1){let e=lC();ws(0,"section",9)(1,"button",20),Rg("click",function(){If(e);let p=gC(2);return wf(p.toggleInstructions())}),ws(2,"h2",10),GC(3,"Instructions"),pl(),ws(4,"span",21),GC(5," \u25BC "),pl()(),Jw(6,K,2,1,"pre",22),pl();}if(n&2){let e=gC(2);XE(),Tg("aria-expanded",!e.instructionsCollapsed()),XE(3),Ug("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),XE(2),eC(e.instructionsCollapsed()?-1:6);}}function Q(n,o){n&1&&(ws(0,"p",17),GC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),pl());}function W(n,o){n&1&&(ws(0,"span",25),GC(1,"platform"),pl());}function X(n,o){n&1&&(ws(0,"span",25),GC(1,"SKILL.md"),pl());}function Y(n,o){if(n&1&&(ws(0,"li",23)(1,"span",24),GC(2),pl(),Jw(3,W,2,0,"span",25),Jw(4,X,2,0,"span",25),ws(5,"p",26),GC(6),pl()()),n&2){let e=o.$implicit;XE(2),Yg(e.name),XE(),eC(e.namespaceId?-1:3),XE(),eC(e.readOnly?4:-1),XE(2),Yg(e.description);}}function Z(n,o){if(n&1&&(ws(0,"ul",18),rC(1,Y,7,4,"li",23,$),pl()),n&2){let e=gC(2);XE(),oC(e.resolvedSkills());}}function ee(n,o){n&1&&(ws(0,"p",17),GC(1,"No tools available for this agent."),pl());}function ne(n,o){if(n&1&&(Sg(0,"div",31),aT(1,"agentosMarkdown")),n&2){let e=gC(2).$implicit;bg("innerHTML",uT(1,1,e.description),aE);}}function te(n,o){if(n&1&&(ws(0,"div",30),Jw(1,ne,2,3,"div",31),ws(2,"pre",32),GC(3),pl()()),n&2){let e=gC().$implicit,c=gC(3);XE(),eC(e.description?1:-1),XE(2),Yg(c.formatSchema(e.inputSchema));}}function ie(n,o){if(n&1){let e=lC();ws(0,"li",27)(1,"button",28),Rg("click",function(){let p=If(e).$implicit,V=gC(3);return wf(V.toggleTool(p))}),ws(2,"span",29),GC(3),pl(),ws(4,"span",21),GC(5," \u25BC "),pl()(),Jw(6,te,4,2,"div",30),pl();}if(n&2){let e=o.$implicit,c=gC(3);XE(),Tg("aria-expanded",c.isToolExpanded(e)),XE(2),Yg(e.name),XE(),Ug("agent-config-inspect__chevron--open",c.isToolExpanded(e)),XE(2),eC(c.isToolExpanded(e)?6:-1);}}function oe(n,o){if(n&1&&(ws(0,"ul",19),rC(1,ie,7,5,"li",27,B),pl()),n&2){let e=gC();XE(),oC(e.tools);}}function ae(n,o){if(n&1&&(ws(0,"div",8)(1,"section",9)(2,"h2",10),GC(3,"General"),pl(),ws(4,"dl",11)(5,"dt",12),GC(6,"Name"),pl(),ws(7,"dd",13),GC(8),pl(),ws(9,"dt",12),GC(10,"Resolved model"),pl(),ws(11,"dd",14),GC(12),pl(),ws(13,"dt",12),GC(14,"Provider"),pl(),ws(15,"dd",13),GC(16),pl(),ws(17,"dt",12),GC(18,"Advanced execution"),pl(),ws(19,"dd",13)(20,"span",15),GC(21),pl()(),Jw(22,J,4,1),pl()(),Jw(23,G,7,4,"section",9),Jw(24,q,7,4,"section",9),ws(25,"section",9)(26,"h2",10),GC(27," Skills "),ws(28,"span",16),GC(29),pl()(),Jw(30,Q,2,0,"p",17)(31,Z,3,0,"ul",18),pl(),ws(32,"section",9)(33,"h2",10),GC(34," Tools "),ws(35,"span",16),GC(36),pl()(),Jw(37,ee,2,0,"p",17)(38,oe,3,0,"ul",19),pl()()),n&2){let e=o,c=gC();XE(8),Yg(e.name),XE(4),Yg(e.resolvedModelApiName),XE(4),Yg(e.resolvedProviderName),XE(4),Ug("agent-config-inspect__badge--active",e.advancedExecution),XE(),vl(" ",e.advancedExecution?"Enabled":"Disabled"," "),XE(),eC(e.userId?22:-1),XE(),eC(e.systemPrompt?23:-1),XE(),eC(e.instructions?24:-1),XE(5),vl("(",c.resolvedSkills().length,")"),XE(),eC(c.resolvedSkills().length===0?30:31),XE(6),vl("(",e.tools.length,")"),XE(),eC(e.tools.length===0?37:38);}}var R=class n{route=g(W$1);router=g(F);destroyRef=g(Ce);agentConfigController=g($$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Gi(true);hasError=Gi(false);definition=Gi(null);expandedTools=Gi(new Set);resolvedSkills=mT(()=>this.definition()?.skills??[]);systemPromptCollapsed=Gi(true);instructionsCollapsed=Gi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c});}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o);}toggleInstructions(){this.instructionsCollapsed.update(o=>!o);}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__skills"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__skill"],[1,"agent-config-inspect__skill-name"],[1,"agent-config-inspect__skill-badge"],[1,"agent-config-inspect__skill-desc"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return c.back()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Agent Configs "),pl(),ws(6,"h1",4),GC(7,"Agent definition"),pl(),ws(8,"a",5),GC(9,"Edit config \u2192"),pl()(),Jw(10,j,2,0,"p",6)(11,H,2,0,"p",7)(12,ae,39,13,"div",8),pl()),e&2){let p;XE(8),bg("routerLink",c.editRoute()),XE(2),eC(c.isLoading()?10:c.hasError()?11:(p=c.definition())?12:-1,p);}},dependencies:[$t,d],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%], .agent-config-inspect__skills[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__skill[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5rem}.agent-config-inspect__skill-name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500}.agent-config-inspect__skill-badge[_ngcontent-%COMP%]{font-size:.75rem;font-family:monospace;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__skill-desc[_ngcontent-%COMP%]{flex:1 1 100%;margin:0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"]})};export{R as AgentConfigInspectComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {A,k as kt,b as bt}from'./chunk-CNqpO_FY.js';import {S as St}from'./chunk-BV6wT0T7.js';import {E as Et,y as yt$1,G as Ge}from'./chunk-sYIU2Sow.js';import {g,F as F$1,P,U,N,p as pe$1,H as c,C as Ce$1,G as Gi,a as F$2,m as mT,b as U$1,e as xw,h as hr,i as pr,k as ws,n as GC,o as pl,q as Rg,J as Jw,s as rC,X as XE,u as bg,v as eC,y as oC,z as Ug,T as Tg,r as re,ca as _e$1,W as x,an as ue$1,ap as Cd,l as le$1,V,S as Sg,a9 as lC,aa as If,ac as gC,ab as wf,a8 as Yg,a5 as vl}from'./main-5MNGHNLY.js';import'./chunk-CwSW3sva.js';import'./chunk-BIcQB7sK.js';import'./chunk-1ZOpOUaW.js';import'./chunk-Di5xhd_-.js';import {y as yt,w as wt}from'./chunk-BEDBkVgu.js';var R=class n{threadState=g(U);codayService=g(Ge);threadList=F$2(this.threadState.threadList$,{initialValue:[]});selectedThread=F$2(this.threadState.selectedThread$,{initialValue:null});isThinking=F$2(this.codayService.isThinking$,{initialValue:false});inviteEvent=F$2(this.codayService.currentInviteEvent$.pipe(re(t=>t?.invite===_e$1?null:t)),{initialValue:null});tasks=mT(()=>{let t=this.threadList(),e=this.selectedThread(),r=this.isThinking(),o=this.inviteEvent();return t.filter(i=>!i.parentThreadId).map(i=>{let m=!!e&&i.id===e.id;return {id:i.id,name:i.name,summary:i.summary,modifiedDate:i.modifiedDate,starring:i.starring??[],users:i.users??[],status:this.deriveStatus(i,m,r,!!o),isActive:m,worktreeProject:i.worktreeProject}}).sort((i,m)=>{let q=kt[i.status]-kt[m.status];return q!==0?q:i.modifiedDate>m.modifiedDate?-1:1})});deriveStatus(t,e,r,o){let i=Date.now()-new Date(t.modifiedDate).getTime();return t.closedByUser?"done":t.pendingInvite?"waiting-you":e?r?"in-progress":"paused":i<bt?"in-progress":"paused"}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var F=class n{projectState=g(P);threadState=g(U);destroy$=new ue$1;eventSource=null;currentProject=null;constructor(){this.projectState.selectedProject$.pipe(Cd(this.destroy$)).subscribe(t=>{let e=t?.name??null;e!==this.currentProject&&(this.disconnect(),e&&this.connect(e));});}connect(t,e=5e3){this.currentProject=t;let r=`/api/projects/${encodeURIComponent(t)}/event-stream`;console.log(`[PROJECT_SSE] Connecting to ${r}`),this.eventSource=new EventSource(r),this.eventSource.onmessage=o=>{try{let i=JSON.parse(o.data),m=le$1(i);if(!m)return;m instanceof V&&(console.log("[PROJECT_SSE] ThreadUpdateEvent \u2014 refreshing thread list"),this.threadState.refreshThreadList());}catch(i){console.warn("[PROJECT_SSE] Failed to parse event:",i);}},this.eventSource.onerror=()=>{this.eventSource?.readyState===EventSource.CLOSED&&(console.warn(`[PROJECT_SSE] Connection closed for ${t}, reconnecting in ${e}ms`),this.eventSource=null,setTimeout(()=>{this.currentProject===t&&this.connect(t,Math.min(e*2,6e4));},e));};}disconnect(){this.eventSource&&(this.eventSource.close(),this.eventSource=null,console.log(`[PROJECT_SSE] Disconnected from project ${this.currentProject}`)),this.currentProject=null;}ngOnDestroy(){this.disconnect(),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var ce=(n,t)=>t.key,de=(n,t)=>t.status,le=(n,t)=>t.id;function pe(n,t){n&1&&Sg(0,"mat-spinner",6);}function me(n,t){n&1&&(ws(0,"mat-icon"),GC(1,"add"),pl());}function ue(n,t){if(n&1&&(ws(0,"span",16),GC(1),pl()),n&2){let e=gC().$implicit,r=gC();XE(),Yg(r.filterCounts()[e.key]);}}function ge(n,t){if(n&1){let e=lC();ws(0,"button",15),Rg("click",function(){let o=If(e).$implicit,i=gC();return wf(i.setFilter(o.key))}),ws(1,"mat-icon",10),GC(2),pl(),ws(3,"span"),GC(4),pl(),Jw(5,ue,2,1,"span",16),pl();}if(n&2){let e=t.$implicit,r=gC();Ug("active",r.activeFilter()===e.key),Tg("aria-selected",r.activeFilter()===e.key),XE(2),Yg(e.icon),XE(2),Yg(e.label),XE(),eC(r.filterCounts()[e.key]>0?5:-1);}}function _e(n,t){n&1&&(ws(0,"div",12),Sg(1,"mat-spinner",17),ws(2,"p"),GC(3,"Loading tasks\u2026"),pl()());}function fe(n,t){if(n&1){let e=lC();ws(0,"p"),GC(1,"No tasks yet. Start your first one!"),pl(),ws(2,"button",19),Rg("click",function(){If(e);let o=gC(2);return wf(o.createTask())}),ws(3,"mat-icon"),GC(4,"add"),pl(),GC(5," New Task "),pl();}}function he(n,t){n&1&&(ws(0,"p"),GC(1,"No tasks in this category."),pl());}function ke(n,t){if(n&1&&(ws(0,"div",13)(1,"mat-icon",18),GC(2,"rocket_launch"),pl(),Jw(3,fe,6,0)(4,he,2,0,"p"),pl()),n&2){let e=gC();XE(3),eC(e.activeFilter()==="all"?3:4);}}function ve(n,t){if(n&1){let e=lC();ws(0,"app-task-card",25),Rg("stopRequested",function(o){If(e);let i=gC(3);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=gC(3);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=gC(3);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=gC(3);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=gC(3);return wf(i.onMarkActiveRequested(o))}),pl();}if(n&2){let e=t.$implicit;bg("task",e);}}function Ce(n,t){if(n&1&&(ws(0,"section",20)(1,"h2",21)(2,"mat-icon",22),GC(3),pl(),GC(4),ws(5,"span",23),GC(6),pl()(),ws(7,"div",14),rC(8,ve,1,1,"app-task-card",24,le),pl()()),n&2){let e=t.$implicit;XE(3),Yg(e.icon),XE(),vl(" ",e.label," "),XE(2),Yg(e.tasks.length),XE(2),oC(e.tasks);}}function be(n,t){if(n&1&&rC(0,Ce,10,3,"section",20,de),n&2){let e=gC();oC(e.taskGroups());}}function ye(n,t){if(n&1){let e=lC();ws(0,"app-task-card",25),Rg("stopRequested",function(o){If(e);let i=gC(2);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=gC(2);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=gC(2);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=gC(2);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=gC(2);return wf(i.onMarkActiveRequested(o))}),pl();}if(n&2){let e=t.$implicit;bg("task",e);}}function xe(n,t){if(n&1&&(ws(0,"div",14),rC(1,ye,1,1,"app-task-card",24,le),pl()),n&2){let e=gC();XE(),oC(e.filteredTasks());}}var Te=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],se=class n{router=g(F$1);projectState=g(P);threadState=g(U);threadApi=g(N);taskStatus=g(R);userService=g(pe$1);projectApi=g(c);destroyRef=g(Ce$1);_projectEventStream=g(F);filters=Te;activeFilter=Gi("all");starredOnly=Gi(false);isCreating=Gi(false);isLoadingList=F$2(this.threadState.isLoadingThreadList$,{initialValue:false});username=F$2(this.userService.username$,{initialValue:null});allTasks=this.taskStatus.tasks;filteredTasks=mT(()=>{let t=this.activeFilter(),e=this.username(),r=this.allTasks();return this.starredOnly()&&e&&(r=r.filter(o=>o.starring.includes(e))),t==="all"?r:r.filter(o=>o.status===t)});filterCounts=mT(()=>{let t=this.username(),e=this.allTasks();return this.starredOnly()&&t&&(e=e.filter(r=>r.starring.includes(t))),{all:e.length,"waiting-you":e.filter(r=>r.status==="waiting-you").length,"in-progress":e.filter(r=>r.status==="in-progress").length,paused:e.filter(r=>r.status==="paused").length,done:e.filter(r=>r.status==="done").length}});taskGroups=mT(()=>{let t=this.username(),e=this.allTasks();this.starredOnly()&&t&&(e=e.filter(o=>o.starring.includes(t)));let r=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt",tasks:[]},{status:"in-progress",label:"In progress",icon:"pending",tasks:[]},{status:"done",label:"Done",icon:"check_circle",tasks:[]},{status:"paused",label:"Paused",icon:"pause_circle",tasks:[]},{status:"error",label:"Error",icon:"error",tasks:[]}];for(let o of e){let i=r.find(m=>m.status===o.status);i&&i.tasks.push(o);}return r.filter(o=>o.tasks.length>0)});ngOnInit(){this.userService.fetchCurrentUser().pipe(U$1(this.destroyRef)).subscribe({error:t=>console.warn("[TASK-CONTROL] Could not fetch user:",t)});}setFilter(t){this.activeFilter.set(t);}toggleStarredFilter(){this.starredOnly.update(t=>!t);}createTask(){let t=this.projectState.getSelectedProjectId();!t||this.isCreating()||(this.isCreating.set(true),this.threadApi.createThread().pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.isCreating.set(false),this.router.navigate(["project",t,"thread",e.thread.id]);},error:e=>{console.error("[TASK-CONTROL] Failed to create thread:",e),this.isCreating.set(false);}}));}onStopRequested(t){this.threadApi.stopThread(t).pipe(U$1(this.destroyRef)).subscribe({error:e=>console.error("[TASK-CONTROL] Failed to stop thread:",e)});}onDeleteRequested(t){this.threadApi.deleteThread(t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:e=>console.error("[TASK-CONTROL] Failed to delete thread:",e)});}onStarToggled(t){let e=this.username();if(!e)return;let r=this.allTasks().find(m=>m.id===t);if(!r)return;let o=r.starring.includes(e),i=o?this.threadApi.unstarThread(t):this.threadApi.starThread(t);this.threadState.updateStarLocal(t,!o,e),i.pipe(U$1(this.destroyRef)).subscribe({error:m=>{console.error("[TASK-CONTROL] Failed to toggle star:",m),this.threadState.refreshThreadList();}});}onMarkDoneRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadDone(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as done:",r)});}onMarkActiveRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadActive(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as active:",r)});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["app-task-control"]],decls:25,vars:6,consts:[[1,"task-control"],[1,"tc-header"],[1,"tc-title-row"],[1,"tc-title"],[1,"title-icon"],["mat-flat-button","","aria-label","Start a new task",1,"new-task-btn",3,"click","disabled"],["diameter","16"],["role","tablist","aria-label","Filter tasks",1,"tc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"tc-grid-wrapper"],[1,"tc-loading"],[1,"tc-empty"],[1,"tc-grid"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","40"],[1,"empty-icon"],["mat-flat-button","",1,"new-task-btn",3,"click"],[1,"tc-group"],[1,"tc-group-title"],[1,"group-icon"],[1,"group-count"],[3,"task"],[3,"stopRequested","deleteRequested","starToggled","markDoneRequested","markActiveRequested","task"]],template:function(e,r){e&1&&(ws(0,"app-sidenav")(1,"div",0)(2,"header",1)(3,"div",2)(4,"h1",3)(5,"mat-icon",4),GC(6,"rocket_launch"),pl(),GC(7," Task Control "),pl(),ws(8,"button",5),Rg("click",function(){return r.createTask()}),Jw(9,pe,1,0,"mat-spinner",6)(10,me,2,0,"mat-icon"),GC(11," New Task "),pl()(),ws(12,"nav",7),rC(13,ge,6,6,"button",8,ce),ws(15,"button",9),Rg("click",function(){return r.toggleStarredFilter()}),ws(16,"mat-icon",10),GC(17,"star"),pl(),ws(18,"span"),GC(19,"Starred"),pl()()()(),ws(20,"main",11),Jw(21,_e,4,0,"div",12)(22,ke,5,1,"div",13)(23,be,2,0)(24,xe,3,0,"div",14),pl()()()),e&2&&(XE(8),bg("disabled",r.isCreating()),XE(),eC(r.isCreating()?9:10),XE(4),oC(r.filters),XE(2),Ug("active",r.starredOnly()),Tg("aria-checked",r.starredOnly()),XE(6),eC(r.isLoadingList()?21:r.filteredTasks().length===0?22:r.activeFilter()==="all"?23:24));},dependencies:[A,St,yt,wt,hr,pr,Et,yt$1],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden}.task-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;padding:1.5rem;gap:1.25rem;box-sizing:border-box}.tc-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;flex-shrink:0}.tc-title-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem}.tc-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text)}.tc-title[_ngcontent-%COMP%] .title-icon[_ngcontent-%COMP%]{font-size:1.5rem;width:1.5rem;height:1.5rem;color:var(--color-primary)}.new-task-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;padding:0 1rem;height:36px;flex-shrink:0}.new-task-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}.new-task-btn[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{display:inline-block}.tc-filters[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.375rem .875rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff4d;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.tc-group[_ngcontent-%COMP%]{margin-bottom:1.5rem}.tc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.tc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.85rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.tc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem}.tc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.75rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.tc-grid-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--color-border) transparent}.tc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem;padding-bottom:1rem}@media(max-width:600px){.tc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.tc-loading[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;height:100%;min-height:240px;color:var(--color-text-secondary);text-align:center}.tc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.95rem}.empty-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;opacity:.3}"]})};export{se as TaskControlComponent};
|