@whoz-oss/coday-client 3.33.1 → 3.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/browser/{chunk-DmspnNZU.js → chunk-1pMMl5aQ.js} +1 -1
  2. package/browser/{chunk-CCjiYUwJ.js → chunk-24Rqvp-B.js} +1 -1
  3. package/browser/{chunk-DoBiZHJP.js → chunk-3SjkoJQ2.js} +1 -1
  4. package/browser/{chunk-Xqo-i29q.js → chunk-6yN7LoqT.js} +1 -1
  5. package/browser/{chunk-Dq_iutg_.js → chunk-8bJEDZYk.js} +1 -1
  6. package/browser/{chunk-DRINXf1H.js → chunk-9B6pDYGf.js} +1 -1
  7. package/browser/{chunk-DKZE1MMp.js → chunk-9Y4DMIzP.js} +1 -1
  8. package/browser/{chunk-BfgOvSfj.js → chunk-B0wi4IQ8.js} +1 -1
  9. package/browser/{chunk-ZI_RF6mJ.js → chunk-B1h8Rr_L.js} +1 -1
  10. package/browser/{chunk-CgZso3Sn.js → chunk-B400uKLU.js} +1 -1
  11. package/browser/{chunk-BVHP3O1y.js → chunk-B4GIoG1U.js} +1 -1
  12. package/browser/{chunk-DTO-7qsb.js → chunk-BAHGxBjI.js} +1 -1
  13. package/browser/{chunk-Dg2L56ka.js → chunk-BByguAe9.js} +1 -1
  14. package/browser/{chunk-CrDpiJQ_.js → chunk-BECO5DZL.js} +1 -1
  15. package/browser/{chunk-CfLw6giw.js → chunk-BEoycX98.js} +1 -1
  16. package/browser/{chunk-vuYNru7F.js → chunk-BHtGbjK6.js} +1 -1
  17. package/browser/{chunk-WJVIVGQ_.js → chunk-BK-SvUGW.js} +1 -1
  18. package/browser/chunk-BLltB5Fl.js +1 -0
  19. package/browser/{chunk-s2nIreh9.js → chunk-BOwbpQDE.js} +1 -1
  20. package/browser/{chunk-97Ur9CVM.js → chunk-B_wrSH-e.js} +1 -1
  21. package/browser/{chunk-DSWc3xOX.js → chunk-Begup16p.js} +1 -1
  22. package/browser/{chunk-BwA9KDbo.js → chunk-BqbE20yc.js} +1 -1
  23. package/browser/{chunk-DrktTXS1.js → chunk-BscGFXSw.js} +1 -1
  24. package/browser/{chunk-Fswp1zS2.js → chunk-Bt_Yi0KO.js} +1 -1
  25. package/browser/{chunk-6LX0m2KK.js → chunk-BvggdF8d.js} +1 -1
  26. package/browser/{chunk-7OibMkdV.js → chunk-C5xuZf5R.js} +1 -1
  27. package/browser/{chunk-BA-NscEe.js → chunk-C7OQXeW9.js} +1 -1
  28. package/browser/{chunk--u1fh-bE.js → chunk-C8eqogQ9.js} +1 -1
  29. package/browser/{chunk-CWhMBwZt.js → chunk-CDyIhHOt.js} +1 -1
  30. package/browser/{chunk-D1wn67qT.js → chunk-CGjjc55P.js} +6 -6
  31. package/browser/{chunk-ByHd8LOC.js → chunk-CJCjJyKP.js} +1 -1
  32. package/browser/{chunk-nyQxv1ai.js → chunk-CLaD3yHE.js} +1 -1
  33. package/browser/{chunk-CrtwjGyv.js → chunk-CMjxkuFH.js} +2 -2
  34. package/browser/{chunk-Bdo-PzpO.js → chunk-CS3cO2Tx.js} +1 -1
  35. package/browser/{chunk-BgHBODRL.js → chunk-CT8vu_Pw.js} +1 -1
  36. package/browser/{chunk-I798FyiF.js → chunk-CThe5GoQ.js} +1 -1
  37. package/browser/{chunk-CY4cIdrD.js → chunk-CX3BRjB5.js} +1 -1
  38. package/browser/{chunk-KJgXoqSt.js → chunk-CXqNbVXr.js} +1 -1
  39. package/browser/{chunk-CaZu6-ik.js → chunk-CZe6uHRZ.js} +1 -1
  40. package/browser/{chunk-tpkg6uRN.js → chunk-Ceb8iCgi.js} +1 -1
  41. package/browser/{chunk-DFN1Pyx5.js → chunk-Ci0veFyD.js} +1 -1
  42. package/browser/{chunk-BYRF4k2F.js → chunk-CqTTbhQw.js} +1 -1
  43. package/browser/{chunk-XRvc0QGl.js → chunk-D-bfzu2J.js} +1 -1
  44. package/browser/{chunk-BMMVal6G.js → chunk-DE0C-yKk.js} +1 -1
  45. package/browser/{chunk-CvSL9m7J.js → chunk-DFjEHH4o.js} +1 -1
  46. package/browser/{chunk-DzIeB2JV.js → chunk-DGUwcds6.js} +1 -1
  47. package/browser/{chunk-CDVp9M5o.js → chunk-DH80wnhH.js} +1 -1
  48. package/browser/{chunk-BAW4T6Di.js → chunk-DLpC4uuD.js} +1 -1
  49. package/browser/chunk-DOeIIw1a.js +1 -0
  50. package/browser/{chunk-Bb0cfZpR.js → chunk-DS1gnXQd.js} +1 -1
  51. package/browser/{chunk-BR2UGTBA.js → chunk-DUTqrLQ0.js} +2 -2
  52. package/browser/{chunk-amKg4vsy.js → chunk-DVK2B443.js} +1 -1
  53. package/browser/chunk-DY8YywkA.js +1 -0
  54. package/browser/{chunk-BvidtKG2.js → chunk-DdPOtjZp.js} +5 -5
  55. package/browser/{chunk-qnkDdlfN.js → chunk-DfHrtnxD.js} +1 -1
  56. package/browser/{chunk-DRl5lKc8.js → chunk-DmpFu0Pv.js} +1 -1
  57. package/browser/{chunk-Bp6uMEC4.js → chunk-Dn1IeSER.js} +1 -1
  58. package/browser/{chunk-BuwCQJib.js → chunk-DpjNfc-X.js} +1 -1
  59. package/browser/{chunk-BrwKLScI.js → chunk-DvkkGOWr.js} +1 -1
  60. package/browser/{chunk-D0hAJFb0.js → chunk-Dy3jpvsK.js} +1 -1
  61. package/browser/chunk-DzRcZL5W.js +4 -0
  62. package/browser/{chunk-DngrH8va.js → chunk-O_d524Nl.js} +1 -1
  63. package/browser/chunk-U55ggdv9.js +1 -0
  64. package/browser/{chunk-DMb_O3oJ.js → chunk-ZnMmRxVz.js} +1 -1
  65. package/browser/{chunk-D2JaJwBk.js → chunk-_pYIE7Vn.js} +1 -1
  66. package/browser/{chunk-DYl74_xV.js → chunk-b-dxVOcr.js} +1 -1
  67. package/browser/{chunk-BJy7Ev8t.js → chunk-e71Ldo0f.js} +1 -1
  68. package/browser/{chunk-gfpawxnm.js → chunk-heXluV0a.js} +1 -1
  69. package/browser/{chunk-zoDBYyjf.js → chunk-iFWDza_l.js} +1 -1
  70. package/browser/{chunk-Dl_uhmYA.js → chunk-qlZmtZOW.js} +1 -1
  71. package/browser/{chunk-Cjnbx8x8.js → chunk-x_UzK7O8.js} +1 -1
  72. package/browser/index.html +1 -1
  73. package/browser/{main-COD2LZKB.js → main-GYSPY3UE.js} +1 -1
  74. package/package.json +1 -1
  75. package/browser/chunk-2e1XJLC3.js +0 -1
  76. package/browser/chunk-DHVomWlH.js +0 -1
  77. package/browser/chunk-DQhceK5b.js +0 -4
  78. package/browser/chunk-DkYkMN4g.js +0 -1
  79. package/browser/chunk-JXiqGD2F.js +0 -1
@@ -1 +1 @@
1
- import {g,G,P,e as xw,h as hr,i as pr,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as bg,y as eC,a5 as vl,al as vt,am as qm,a9 as lC,ai as tm,aa as If,aj as KC,ab as wf,a3 as VI,ak as em,a6 as UI,D as Pg,E as EC,I as IC,ac as gC,a8 as Yg}from'./main-COD2LZKB.js';import {y as yt,w as wt,t as ti,Y as Ye,Z as Zn,c as cn}from'./chunk-Bb0cfZpR.js';var J=["inputElement"];function K(o,r){if(o&1&&(ws(0,"span",3),GC(1),pl()),o&2){let t=gC();XE(),Yg(t.label);}}function U(o,r){if(o&1&&(ws(0,"small",5),GC(1),pl()),o&2){let t=gC();XE(),Yg(t.hint);}}var h=class o{label="";placeholder="";hint="";isDisabled=false;value="";autoFocus=true;valueChange=new vt;enterPressed=new vt;inputElement;inputValue="";ngAfterViewInit(){this.inputValue=this.value,this.autoFocus&&setTimeout(()=>this.inputElement?.nativeElement.focus(),100);}onValueChange(r){this.valueChange.emit(r);}onEnter(){this.inputValue.trim()&&this.enterPressed.emit(this.inputValue.trim());}focus(){this.inputElement?.nativeElement.focus();}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["app-text-input"]],viewQuery:function(t,e){if(t&1&&Pg(J,5),t&2){let p;EC(p=IC())&&(e.inputElement=p.first);}},inputs:{label:"label",placeholder:"placeholder",hint:"hint",isDisabled:"isDisabled",value:"value",autoFocus:"autoFocus"},outputs:{valueChange:"valueChange",enterPressed:"enterPressed"},decls:6,vars:5,consts:[["inputElement",""],[1,"text-input-container"],[1,"text-input-wrapper"],[1,"text-input-label"],["type","text",1,"text-input-field",3,"ngModelChange","keydown.enter","ngModel","placeholder","disabled"],[1,"text-input-hint"]],template:function(t,e){if(t&1){let p=lC();ws(0,"div",1)(1,"label",2),Jw(2,K,2,1,"span",3),ws(3,"input",4,0),tm("ngModelChange",function(m){return If(p),KC(e.inputValue,m)||(e.inputValue=m),wf(m)}),Rg("ngModelChange",function(m){return e.onValueChange(m)})("keydown.enter",function(){return e.onEnter()}),pl(),VI(),pl(),Jw(5,U,2,1,"small",5),pl();}t&2&&(XE(2),eC(e.label?2:-1),XE(),em("ngModel",e.inputValue),bg("placeholder",e.placeholder)("disabled",e.isDisabled),UI(),XE(2),eC(e.hint?5:-1));},dependencies:[ti,Ye,Zn,cn,qm],styles:[".text-input-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%}.text-input-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;cursor:text}.text-input-label[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);margin:0}.text-input-field[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:1rem;color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-border);border-radius:8px;outline:none;transition:all .2s ease}.text-input-field[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.text-input-field[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(var(--color-primary-rgb),.1)}.text-input-field[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed;background:var(--color-surface)}.text-input-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);margin:0;font-style:italic}@media(max-width:768px){.text-input-field[_ngcontent-%COMP%]{padding:.65rem .85rem;font-size:.95rem}.text-input-label[_ngcontent-%COMP%]{font-size:.9rem}.text-input-hint[_ngcontent-%COMP%]{font-size:.8rem}}"],changeDetection:1})};function X(o,r){if(o&1&&(ws(0,"div",8),GC(1),pl()),o&2){let t=gC();XE(),Yg(t.errorMessage);}}var L=class o{router=g(G);projectStateService=g(P);projectName="";projectPath="";isCreating=false;errorMessage=null;isValid(){return this.projectName.trim()!==""&&this.projectPath.trim()!==""}onCreate(){if(!this.isValid()){this.errorMessage="Both name and path are required";return}this.isCreating=true,this.errorMessage=null,this.projectStateService.createProject(this.projectName.trim(),this.projectPath.trim()).subscribe({next:()=>{let r=this.projectName.trim();this.isCreating=false,this.projectStateService.selectProject(r),this.router.navigate(["project",r]);},error:r=>{this.errorMessage=r.error?.error??"Failed to create project",this.isCreating=false;}});}onCancel(){this.router.navigate(["/"]);}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["app-project-new"]],decls:19,vars:9,consts:[[1,"project-new-page"],[1,"project-new-card"],["mat-button","",1,"project-new__back",3,"click"],[1,"project-new__title"],[1,"project-new__subtitle"],[1,"project-new__form"],["label","Project name","placeholder","my-project",3,"valueChange","value","isDisabled","autoFocus"],["label","Project path","placeholder","/path/to/project","hint","Absolute path to the project directory",3,"valueChange","enterPressed","value","isDisabled"],[1,"project-new__error"],[1,"project-new__actions"],["mat-button","",3,"click","disabled"],["mat-flat-button","","color","primary",3,"click","disabled"]],template:function(t,e){t&1&&(ws(0,"div",0)(1,"div",1)(2,"button",2),Rg("click",function(){return e.onCancel()}),ws(3,"mat-icon"),GC(4,"arrow_back"),pl(),GC(5," Back to projects "),pl(),ws(6,"h1",3),GC(7,"New project"),pl(),ws(8,"p",4),GC(9,"Point Coday to an existing directory on your machine."),pl(),ws(10,"div",5)(11,"app-text-input",6),Rg("valueChange",function(d){return e.projectName=d}),pl(),ws(12,"app-text-input",7),Rg("valueChange",function(d){return e.projectPath=d})("enterPressed",function(){return e.onCreate()}),pl(),Jw(13,X,2,1,"div",8),pl(),ws(14,"div",9)(15,"button",10),Rg("click",function(){return e.onCancel()}),GC(16,"Cancel"),pl(),ws(17,"button",11),Rg("click",function(){return e.onCreate()}),GC(18),pl()()()()),t&2&&(XE(11),bg("value",e.projectName)("isDisabled",e.isCreating)("autoFocus",true),XE(),bg("value",e.projectPath)("isDisabled",e.isCreating),XE(),eC(e.errorMessage?13:-1),XE(2),bg("disabled",e.isCreating),XE(2),bg("disabled",!e.isValid()||e.isCreating),XE(),vl(" ",e.isCreating?"Creating\u2026":"Create project"," "));},dependencies:[hr,pr,yt,wt,h],styles:[".project-new-page[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:center;min-height:100vh;width:100%;background:var(--color-bg);padding:2rem 1.5rem;box-sizing:border-box}.project-new-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;width:100%;max-width:560px;padding:2rem;background:var(--color-bg-secondary, rgba(255, 255, 255, .7));border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:16px;box-shadow:var(--glass-shadow, 0 8px 32px rgba(31, 38, 135, .15));margin-top:2rem}.project-new__back[_ngcontent-%COMP%]{align-self:flex-start;margin-left:-.5rem;color:var(--color-text-secondary, #6e6e73)}.project-new__title[_ngcontent-%COMP%]{margin:0;font-size:1.625rem;font-weight:700;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.project-new__subtitle[_ngcontent-%COMP%]{margin:-.75rem 0 0;font-size:.9375rem;color:var(--color-text-secondary, #6e6e73)}.project-new__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.project-new__error[_ngcontent-%COMP%]{padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}.project-new__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;justify-content:flex-end;padding-top:.25rem}"],changeDetection:1})};export{L as ProjectNewComponent};
1
+ import {g,G,P,e as xw,h as hr,i as pr,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as bg,y as eC,a5 as vl,al as vt,am as qm,a9 as lC,ai as tm,aa as If,aj as KC,ab as wf,a3 as VI,ak as em,a6 as UI,D as Pg,E as EC,I as IC,ac as gC,a8 as Yg}from'./main-GYSPY3UE.js';import {y as yt,w as wt,t as ti,Y as Ye,Z as Zn,c as cn}from'./chunk-DS1gnXQd.js';var J=["inputElement"];function K(o,r){if(o&1&&(ws(0,"span",3),GC(1),pl()),o&2){let t=gC();XE(),Yg(t.label);}}function U(o,r){if(o&1&&(ws(0,"small",5),GC(1),pl()),o&2){let t=gC();XE(),Yg(t.hint);}}var h=class o{label="";placeholder="";hint="";isDisabled=false;value="";autoFocus=true;valueChange=new vt;enterPressed=new vt;inputElement;inputValue="";ngAfterViewInit(){this.inputValue=this.value,this.autoFocus&&setTimeout(()=>this.inputElement?.nativeElement.focus(),100);}onValueChange(r){this.valueChange.emit(r);}onEnter(){this.inputValue.trim()&&this.enterPressed.emit(this.inputValue.trim());}focus(){this.inputElement?.nativeElement.focus();}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["app-text-input"]],viewQuery:function(t,e){if(t&1&&Pg(J,5),t&2){let p;EC(p=IC())&&(e.inputElement=p.first);}},inputs:{label:"label",placeholder:"placeholder",hint:"hint",isDisabled:"isDisabled",value:"value",autoFocus:"autoFocus"},outputs:{valueChange:"valueChange",enterPressed:"enterPressed"},decls:6,vars:5,consts:[["inputElement",""],[1,"text-input-container"],[1,"text-input-wrapper"],[1,"text-input-label"],["type","text",1,"text-input-field",3,"ngModelChange","keydown.enter","ngModel","placeholder","disabled"],[1,"text-input-hint"]],template:function(t,e){if(t&1){let p=lC();ws(0,"div",1)(1,"label",2),Jw(2,K,2,1,"span",3),ws(3,"input",4,0),tm("ngModelChange",function(m){return If(p),KC(e.inputValue,m)||(e.inputValue=m),wf(m)}),Rg("ngModelChange",function(m){return e.onValueChange(m)})("keydown.enter",function(){return e.onEnter()}),pl(),VI(),pl(),Jw(5,U,2,1,"small",5),pl();}t&2&&(XE(2),eC(e.label?2:-1),XE(),em("ngModel",e.inputValue),bg("placeholder",e.placeholder)("disabled",e.isDisabled),UI(),XE(2),eC(e.hint?5:-1));},dependencies:[ti,Ye,Zn,cn,qm],styles:[".text-input-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%}.text-input-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;cursor:text}.text-input-label[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);margin:0}.text-input-field[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:1rem;color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-border);border-radius:8px;outline:none;transition:all .2s ease}.text-input-field[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.text-input-field[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(var(--color-primary-rgb),.1)}.text-input-field[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed;background:var(--color-surface)}.text-input-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);margin:0;font-style:italic}@media(max-width:768px){.text-input-field[_ngcontent-%COMP%]{padding:.65rem .85rem;font-size:.95rem}.text-input-label[_ngcontent-%COMP%]{font-size:.9rem}.text-input-hint[_ngcontent-%COMP%]{font-size:.8rem}}"],changeDetection:1})};function X(o,r){if(o&1&&(ws(0,"div",8),GC(1),pl()),o&2){let t=gC();XE(),Yg(t.errorMessage);}}var L=class o{router=g(G);projectStateService=g(P);projectName="";projectPath="";isCreating=false;errorMessage=null;isValid(){return this.projectName.trim()!==""&&this.projectPath.trim()!==""}onCreate(){if(!this.isValid()){this.errorMessage="Both name and path are required";return}this.isCreating=true,this.errorMessage=null,this.projectStateService.createProject(this.projectName.trim(),this.projectPath.trim()).subscribe({next:()=>{let r=this.projectName.trim();this.isCreating=false,this.projectStateService.selectProject(r),this.router.navigate(["project",r]);},error:r=>{this.errorMessage=r.error?.error??"Failed to create project",this.isCreating=false;}});}onCancel(){this.router.navigate(["/"]);}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=xw({type:o,selectors:[["app-project-new"]],decls:19,vars:9,consts:[[1,"project-new-page"],[1,"project-new-card"],["mat-button","",1,"project-new__back",3,"click"],[1,"project-new__title"],[1,"project-new__subtitle"],[1,"project-new__form"],["label","Project name","placeholder","my-project",3,"valueChange","value","isDisabled","autoFocus"],["label","Project path","placeholder","/path/to/project","hint","Absolute path to the project directory",3,"valueChange","enterPressed","value","isDisabled"],[1,"project-new__error"],[1,"project-new__actions"],["mat-button","",3,"click","disabled"],["mat-flat-button","","color","primary",3,"click","disabled"]],template:function(t,e){t&1&&(ws(0,"div",0)(1,"div",1)(2,"button",2),Rg("click",function(){return e.onCancel()}),ws(3,"mat-icon"),GC(4,"arrow_back"),pl(),GC(5," Back to projects "),pl(),ws(6,"h1",3),GC(7,"New project"),pl(),ws(8,"p",4),GC(9,"Point Coday to an existing directory on your machine."),pl(),ws(10,"div",5)(11,"app-text-input",6),Rg("valueChange",function(d){return e.projectName=d}),pl(),ws(12,"app-text-input",7),Rg("valueChange",function(d){return e.projectPath=d})("enterPressed",function(){return e.onCreate()}),pl(),Jw(13,X,2,1,"div",8),pl(),ws(14,"div",9)(15,"button",10),Rg("click",function(){return e.onCancel()}),GC(16,"Cancel"),pl(),ws(17,"button",11),Rg("click",function(){return e.onCreate()}),GC(18),pl()()()()),t&2&&(XE(11),bg("value",e.projectName)("isDisabled",e.isCreating)("autoFocus",true),XE(),bg("value",e.projectPath)("isDisabled",e.isCreating),XE(),eC(e.errorMessage?13:-1),XE(2),bg("disabled",e.isCreating),XE(2),bg("disabled",!e.isValid()||e.isCreating),XE(),vl(" ",e.isCreating?"Creating\u2026":"Create project"," "));},dependencies:[hr,pr,yt,wt,h],styles:[".project-new-page[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:center;min-height:100vh;width:100%;background:var(--color-bg);padding:2rem 1.5rem;box-sizing:border-box}.project-new-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;width:100%;max-width:560px;padding:2rem;background:var(--color-bg-secondary, rgba(255, 255, 255, .7));border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:16px;box-shadow:var(--glass-shadow, 0 8px 32px rgba(31, 38, 135, .15));margin-top:2rem}.project-new__back[_ngcontent-%COMP%]{align-self:flex-start;margin-left:-.5rem;color:var(--color-text-secondary, #6e6e73)}.project-new__title[_ngcontent-%COMP%]{margin:0;font-size:1.625rem;font-weight:700;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.project-new__subtitle[_ngcontent-%COMP%]{margin:-.75rem 0 0;font-size:.9375rem;color:var(--color-text-secondary, #6e6e73)}.project-new__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.project-new__error[_ngcontent-%COMP%]{padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}.project-new__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;justify-content:flex-end;padding-top:.25rem}"],changeDetection:1})};export{L as ProjectNewComponent};
@@ -1,4 +1,4 @@
1
- import {s as se}from'./chunk-Dg2L56ka.js';import {a as Dr,z as zi,F as Fn,H as Hi,h as ht,b as gr,_ as _r}from'./chunk-D1wn67qT.js';import {g,H as py,P,Y as x,aL as wo,aM as Zn,bD as ge,bE as vt,aO as wt,bs as Tl,az as Xt,aW as C,aS as K,bF as J,al as vt$1,aT as Ut,bG as p,bH as Pt,e as xw,a_ as QT,bA as yC,bI as Ig,b5 as nT,D as Pg,bJ as dr,E as EC,I as IC,bv as Fg,bK as fe,bL as pe,bM as mr,aP as G,bt as Qn,bN as F,aR as Fs,an as ue,O as Ot,bO as mt,bP as Wy,ae as kt$1,W as br,r as re,bQ as Gy,bR as Id,bS as va,aF as R$1,bu as Ve$1,bT as pn,bU as Od,bV as Zy,aA as an,bW as Y,bX as Pt$1,bY as po,bZ as X,b_ as xt,aZ as js,aC as Tu,q as Rg,T as Tg,aw as hl,bB as vC,ax as gl,ac as gC,b$ as kC,A as Ug,c0 as xg,c1 as E,c2 as ME,c3 as kt$2,bC as Si}from'./main-COD2LZKB.js';import {D}from'./chunk-Bb0cfZpR.js';var xe=class a{http=g(py);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(hl(0,"div",1,0),vC(2),gl()),a&2){let e=o.id,t=gC();kC(t._classList),Ug("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),xg("id",t.id),Tg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new C("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(Tl);_elementRef=g(Xt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=J.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new vt$1;opened=new vt$1;closed=new vt$1;optionActivated=new vt$1;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,Fn,5)(n,Hi,5),t&2){let s;EC(s=IC())&&(i.options=s),EC(s=IC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Pg(dr,7)(Ke,5),t&2){let n;EC(n=IC())&&(i.template=n.first),EC(n=IC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",QT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",QT],requireSelection:[2,"requireSelection","requireSelection",QT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",QT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:zi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(yC(),Ig(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
1
+ import {s as se}from'./chunk-BByguAe9.js';import {a as Dr,q as qi,F as Fn,b as $i,h as ht,c as br$1,y as yr}from'./chunk-CGjjc55P.js';import {g,H as py,P,Y as x,aL as wo,aM as Zn,bD as ge,bE as vt,aO as wt,bs as Tl,az as Xt,aW as C,aS as K,bF as J,al as vt$1,aT as Ut,bG as p,bH as Pt,e as xw,a_ as QT,bA as yC,bI as Ig,b5 as nT,D as Pg,bJ as dr,E as EC,I as IC,bv as Fg,bK as fe,bL as pe,bM as mr,aP as G,bt as Qn,bN as F,aR as Fs,an as ue,O as Ot,bO as mt,bP as Wy,ae as kt$1,W as br,r as re,bQ as Gy,bR as Id,bS as va,aF as R$1,bu as Ve$1,bT as pn,bU as Od,bV as Zy,aA as an,bW as Y,bX as Pt$1,bY as po,bZ as X,b_ as xt,aZ as js,aC as Tu,q as Rg,T as Tg,aw as hl,bB as vC,ax as gl,ac as gC,b$ as kC,A as Ug,c0 as xg,c1 as E,c2 as ME,c3 as kt$2,bC as Si}from'./main-GYSPY3UE.js';import {D}from'./chunk-DS1gnXQd.js';var xe=class a{http=g(py);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(hl(0,"div",1,0),vC(2),gl()),a&2){let e=o.id,t=gC();kC(t._classList),Ug("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),xg("id",t.id),Tg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new C("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(Tl);_elementRef=g(Xt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=J.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new vt$1;opened=new vt$1;closed=new vt$1;optionActivated=new vt$1;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=xw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&Fg(n,Fn,5)(n,$i,5),t&2){let s;EC(s=IC())&&(i.options=s),EC(s=IC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Pg(dr,7)(Ke,5),t&2){let n;EC(n=IC())&&(i.template=n.first),EC(n=IC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",QT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",QT],requireSelection:[2,"requireSelection","requireSelection",QT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",QT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",QT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:qi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(yC(),Ig(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
2
2
  width: 100%;
3
3
  max-height: 256px;
4
4
  visibility: hidden;
@@ -52,4 +52,4 @@ div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden,
52
52
  mat-autocomplete {
53
53
  display: none;
54
54
  }
55
- `],encapsulation:2})}return a})();var Ye={provide:D,useExisting:Si(()=>ze),multi:true};var Ge=new C("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let a=g(pe);return ()=>kt$2(a)}}),ze=(()=>{class a{_environmentInjector=g(fe);_element=g(Xt);_injector=g(pe);_viewContainerRef=g(mr);_zone=g(G);_changeDetectorRef=g(Tl);_dir=g(Qn,{optional:true});_formField=g(se,{optional:true,host:true});_viewportRuler=g(F);_scrollStrategy=g(Ge);_renderer=g(Fs);_animationsDisabled=K();_defaults=g(Ve,{optional:true});_overlayRef=null;_portal;_componentDestroyed=false;_initialized=new ue;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue=null;_valueOnAttach=null;_valueOnLastKeydown=null;_positionStrategy;_manuallyFloatingLabel=false;_closingActionsSubscription;_viewportSubscription=J.EMPTY;_breakpointObserver=g(Ot);_handsetLandscapeSubscription=J.EMPTY;_canOpenOnNextFocus=true;_valueBeforeAutoSelection;_pendingAutoselectedOption=null;_closeKeyEventStream=new ue;_overlayPanelClass=mt(this._defaults?.overlayPanelClass||[]);_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus();};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled=false;_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler);}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition());}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=true,this._destroyPanel(),this._closeKeyEventStream.complete();}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=false;openPanel(){this._openPanelInternal();}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit();}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=false,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=false,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges());}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition();}get panelClosingActions(){return Wy(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(kt$1(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(kt$1(()=>this._overlayAttached)):br()).pipe(re(e=>e instanceof ht?e:null))}optionSelections=Gy(()=>{let e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(Id(e),va(()=>Wy(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(va(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new R$1(e=>{let t=n=>{let s=E(n),l=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,E$1=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&s!==this._element.nativeElement&&!this._hasFocus()&&(!l||!l.contains(s))&&(!E$1||!E$1.contains(s))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(s)&&e.next(n);},i=[this._renderer.listen("document","click",t),this._renderer.listen("document","auxclick",t),this._renderer.listen("document","touchend",t)];return ()=>{i.forEach(n=>n());}})}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e));}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this._element.nativeElement.disabled=e;}_handleKeydown(e){let t=e,i=t.keyCode,n=Ve$1(t);if(i===27&&!n&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&i===13&&this.panelOpen&&!n)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let s=this.autocomplete._keyManager.activeItem,l=i===38||i===40;i===9||l&&!n&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):l&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(l||this.autocomplete._keyManager.activeItem!==s)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)));}}_handleInput(e){let t=e.target,i=t.value;if(t.type==="number"&&(i=i==""?null:parseFloat(i)),this._previousValue!==i){if(this._previousValue=i,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(i),!i)this._clearPreviousSelectedOption(null,false);else if(this.panelOpen&&!this.autocomplete.requireSelection){let n=this.autocomplete.options?.find(s=>s.selected);if(n){let s=this._getDisplayValue(n.value);i!==s&&n.deselect(false);}}if(this._canOpen()&&this._hasFocus()){let n=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(n);}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(true)):this._canOpenOnNextFocus=true;}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal();}_hasFocus(){return pn()===this._element.nativeElement}_floatLabel(e=false){this._formField&&this._formField.floatLabel==="auto"&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=true);}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=false);}_subscribeToClosingActions(){let e=new R$1(i=>{ME(()=>{i.next();},{injector:this._environmentInjector});}),t=this.autocomplete.options?.changes.pipe(Od(()=>this._positionStrategy.reapplyLastPosition()),Zy(0))??br();return Wy(e,t).pipe(va(()=>this._zone.run(()=>{let i=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),i!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),an(1)).subscribe(i=>this._setValueAndClose(i))}_emitOpened(){this.autocomplete.opened.emit();}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null);}_getDisplayValue(e){let t=this.autocomplete;return t&&t.displayWith?t.displayWith(e):e}_assignOptionValue(e){let t=this._getDisplayValue(e);e==null&&this._clearPreviousSelectedOption(null,false),this._updateNativeInputValue(t??"");}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e;}_setValueAndClose(e){let t=this.autocomplete,i=e?e.source:this._pendingAutoselectedOption;i?(this._clearPreviousSelectedOption(i),this._assignOptionValue(i.value),this._onChange(i.value),t._emitSelectEvent(i),this._element.nativeElement.focus()):t.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),this._onChange(null)),this.closePanel();}_clearPreviousSelectedOption(e,t){this.autocomplete?.options?.forEach(i=>{i!==e&&i.selected&&i.deselect(t);});}_openPanelInternal(e=this._element.nativeElement.value){this._attachOverlay(e),this._floatLabel();}_attachOverlay(e){if(!this.autocomplete)return;let t=this._overlayRef;t?(this._positionStrategy.setOrigin(this._getConnectedElement()),t.updateSize({width:this._getPanelWidth()})):(this._portal=new Y(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),t=Pt$1(this._injector,this._getOverlayConfig()),this._overlayRef=t,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&t&&t.updateSize({width:this._getPanelWidth()});}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(po.HandsetLandscape).subscribe(n=>{n.matches?this._positionStrategy.withFlexibleDimensions(true).withGrowAfterOpen(true).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(false).withGrowAfterOpen(false).withViewportMargin(0);})),t&&!t.hasAttached()&&(t.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let i=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=true,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this.panelOpen&&i!==this.panelOpen&&this._emitOpened();}_handlePanelKeydown=e=>{(e.keyCode===27&&!Ve$1(e)||e.keyCode===38&&Ve$1(e,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),e.stopPropagation(),e.preventDefault());};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe());}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=void 0;}_getOverlayConfig(){return new X({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,hasBackdrop:this._defaults?.hasBackdrop,backdropClass:this._defaults?.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:this._overlayPanelClass,disableAnimations:this._animationsDisabled})}_getOverlayPosition(){let e=xt(this._injector,this._getConnectedElement()).withFlexibleDimensions(false).withPush(false).withPopoverLocation("inline");return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){let t=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],i=this._aboveClass,n=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:i},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:i}],s;this.position==="above"?s=n:this.position==="below"?s=t:s=[...t,...n],e.withPositions(s);}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let e=this.autocomplete;if(e.autoActiveFirstOption){let t=-1;for(let i=0;i<e.options.length;i++)if(!e.options.get(i).disabled){t=i;break}e._keyManager.setActiveItem(t);}else e._keyManager.setActiveItem(-1);}_canOpen(){let e=this._element.nativeElement;return !e.readOnly&&!e.disabled&&!this.autocompleteDisabled}_scrollToOption(e){let t=this.autocomplete,i=gr(e,t.options,t.optionGroups);if(e===0&&i===1)t._setScrollTop(0);else if(t.panel){let n=t.options.toArray()[e];if(n){let s=n._getHostElement(),l=_r(s.offsetTop,s.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(l);}}}static \u0275fac=function(t){return new(t||a)};static \u0275dir=js({type:a,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(t,i){t&1&&Rg("focusin",function(){return i._handleFocus()})("blur",function(){return i._onTouched()})("input",function(s){return i._handleInput(s)})("keydown",function(s){return i._handleKeydown(s)})("click",function(){return i._handleClick()}),t&2&&Tg("autocomplete",i.autocompleteAttribute)("role",i.autocompleteDisabled?null:"combobox")("aria-autocomplete",i.autocompleteDisabled?null:"list")("aria-activedescendant",i.panelOpen&&i.activeOption?i.activeOption.id:null)("aria-expanded",i.autocompleteDisabled?null:i.panelOpen.toString())("aria-controls",i.autocompleteDisabled||!i.panelOpen?null:i.autocomplete?.id)("aria-haspopup",i.autocompleteDisabled?null:"listbox");},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",QT]},exportAs:["matAutocompleteTrigger"],features:[nT([Ye]),Tu]})}return a})(),kt=(()=>{class a{static \u0275fac=function(t){return new(t||a)};static \u0275mod=wo({type:a});static \u0275inj=Zn({imports:[ge,Dr,vt,Dr,wt]})}return a})();export{Ct as C,kt as k,xe as x,ze as z};
55
+ `],encapsulation:2})}return a})();var Ye={provide:D,useExisting:Si(()=>ze),multi:true};var Ge=new C("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let a=g(pe);return ()=>kt$2(a)}}),ze=(()=>{class a{_environmentInjector=g(fe);_element=g(Xt);_injector=g(pe);_viewContainerRef=g(mr);_zone=g(G);_changeDetectorRef=g(Tl);_dir=g(Qn,{optional:true});_formField=g(se,{optional:true,host:true});_viewportRuler=g(F);_scrollStrategy=g(Ge);_renderer=g(Fs);_animationsDisabled=K();_defaults=g(Ve,{optional:true});_overlayRef=null;_portal;_componentDestroyed=false;_initialized=new ue;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue=null;_valueOnAttach=null;_valueOnLastKeydown=null;_positionStrategy;_manuallyFloatingLabel=false;_closingActionsSubscription;_viewportSubscription=J.EMPTY;_breakpointObserver=g(Ot);_handsetLandscapeSubscription=J.EMPTY;_canOpenOnNextFocus=true;_valueBeforeAutoSelection;_pendingAutoselectedOption=null;_closeKeyEventStream=new ue;_overlayPanelClass=mt(this._defaults?.overlayPanelClass||[]);_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus();};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled=false;_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler);}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition());}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=true,this._destroyPanel(),this._closeKeyEventStream.complete();}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=false;openPanel(){this._openPanelInternal();}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit();}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=false,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=false,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges());}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition();}get panelClosingActions(){return Wy(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(kt$1(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(kt$1(()=>this._overlayAttached)):br()).pipe(re(e=>e instanceof ht?e:null))}optionSelections=Gy(()=>{let e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(Id(e),va(()=>Wy(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(va(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new R$1(e=>{let t=n=>{let s=E(n),l=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,E$1=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&s!==this._element.nativeElement&&!this._hasFocus()&&(!l||!l.contains(s))&&(!E$1||!E$1.contains(s))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(s)&&e.next(n);},i=[this._renderer.listen("document","click",t),this._renderer.listen("document","auxclick",t),this._renderer.listen("document","touchend",t)];return ()=>{i.forEach(n=>n());}})}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e));}registerOnChange(e){this._onChange=e;}registerOnTouched(e){this._onTouched=e;}setDisabledState(e){this._element.nativeElement.disabled=e;}_handleKeydown(e){let t=e,i=t.keyCode,n=Ve$1(t);if(i===27&&!n&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&i===13&&this.panelOpen&&!n)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let s=this.autocomplete._keyManager.activeItem,l=i===38||i===40;i===9||l&&!n&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):l&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(l||this.autocomplete._keyManager.activeItem!==s)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)));}}_handleInput(e){let t=e.target,i=t.value;if(t.type==="number"&&(i=i==""?null:parseFloat(i)),this._previousValue!==i){if(this._previousValue=i,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(i),!i)this._clearPreviousSelectedOption(null,false);else if(this.panelOpen&&!this.autocomplete.requireSelection){let n=this.autocomplete.options?.find(s=>s.selected);if(n){let s=this._getDisplayValue(n.value);i!==s&&n.deselect(false);}}if(this._canOpen()&&this._hasFocus()){let n=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(n);}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(true)):this._canOpenOnNextFocus=true;}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal();}_hasFocus(){return pn()===this._element.nativeElement}_floatLabel(e=false){this._formField&&this._formField.floatLabel==="auto"&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=true);}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=false);}_subscribeToClosingActions(){let e=new R$1(i=>{ME(()=>{i.next();},{injector:this._environmentInjector});}),t=this.autocomplete.options?.changes.pipe(Od(()=>this._positionStrategy.reapplyLastPosition()),Zy(0))??br();return Wy(e,t).pipe(va(()=>this._zone.run(()=>{let i=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),i!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),an(1)).subscribe(i=>this._setValueAndClose(i))}_emitOpened(){this.autocomplete.opened.emit();}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null);}_getDisplayValue(e){let t=this.autocomplete;return t&&t.displayWith?t.displayWith(e):e}_assignOptionValue(e){let t=this._getDisplayValue(e);e==null&&this._clearPreviousSelectedOption(null,false),this._updateNativeInputValue(t??"");}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e;}_setValueAndClose(e){let t=this.autocomplete,i=e?e.source:this._pendingAutoselectedOption;i?(this._clearPreviousSelectedOption(i),this._assignOptionValue(i.value),this._onChange(i.value),t._emitSelectEvent(i),this._element.nativeElement.focus()):t.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),this._onChange(null)),this.closePanel();}_clearPreviousSelectedOption(e,t){this.autocomplete?.options?.forEach(i=>{i!==e&&i.selected&&i.deselect(t);});}_openPanelInternal(e=this._element.nativeElement.value){this._attachOverlay(e),this._floatLabel();}_attachOverlay(e){if(!this.autocomplete)return;let t=this._overlayRef;t?(this._positionStrategy.setOrigin(this._getConnectedElement()),t.updateSize({width:this._getPanelWidth()})):(this._portal=new Y(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),t=Pt$1(this._injector,this._getOverlayConfig()),this._overlayRef=t,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&t&&t.updateSize({width:this._getPanelWidth()});}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(po.HandsetLandscape).subscribe(n=>{n.matches?this._positionStrategy.withFlexibleDimensions(true).withGrowAfterOpen(true).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(false).withGrowAfterOpen(false).withViewportMargin(0);})),t&&!t.hasAttached()&&(t.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let i=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=true,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this.panelOpen&&i!==this.panelOpen&&this._emitOpened();}_handlePanelKeydown=e=>{(e.keyCode===27&&!Ve$1(e)||e.keyCode===38&&Ve$1(e,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),e.stopPropagation(),e.preventDefault());};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe());}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=void 0;}_getOverlayConfig(){return new X({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,hasBackdrop:this._defaults?.hasBackdrop,backdropClass:this._defaults?.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:this._overlayPanelClass,disableAnimations:this._animationsDisabled})}_getOverlayPosition(){let e=xt(this._injector,this._getConnectedElement()).withFlexibleDimensions(false).withPush(false).withPopoverLocation("inline");return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){let t=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],i=this._aboveClass,n=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:i},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:i}],s;this.position==="above"?s=n:this.position==="below"?s=t:s=[...t,...n],e.withPositions(s);}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let e=this.autocomplete;if(e.autoActiveFirstOption){let t=-1;for(let i=0;i<e.options.length;i++)if(!e.options.get(i).disabled){t=i;break}e._keyManager.setActiveItem(t);}else e._keyManager.setActiveItem(-1);}_canOpen(){let e=this._element.nativeElement;return !e.readOnly&&!e.disabled&&!this.autocompleteDisabled}_scrollToOption(e){let t=this.autocomplete,i=br$1(e,t.options,t.optionGroups);if(e===0&&i===1)t._setScrollTop(0);else if(t.panel){let n=t.options.toArray()[e];if(n){let s=n._getHostElement(),l=yr(s.offsetTop,s.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(l);}}}static \u0275fac=function(t){return new(t||a)};static \u0275dir=js({type:a,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(t,i){t&1&&Rg("focusin",function(){return i._handleFocus()})("blur",function(){return i._onTouched()})("input",function(s){return i._handleInput(s)})("keydown",function(s){return i._handleKeydown(s)})("click",function(){return i._handleClick()}),t&2&&Tg("autocomplete",i.autocompleteAttribute)("role",i.autocompleteDisabled?null:"combobox")("aria-autocomplete",i.autocompleteDisabled?null:"list")("aria-activedescendant",i.panelOpen&&i.activeOption?i.activeOption.id:null)("aria-expanded",i.autocompleteDisabled?null:i.panelOpen.toString())("aria-controls",i.autocompleteDisabled||!i.panelOpen?null:i.autocomplete?.id)("aria-haspopup",i.autocompleteDisabled?null:"listbox");},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",QT]},exportAs:["matAutocompleteTrigger"],features:[nT([Ye]),Tu]})}return a})(),kt=(()=>{class a{static \u0275fac=function(t){return new(t||a)};static \u0275mod=wo({type:a});static \u0275inj=Zn({imports:[ge,Dr,vt,Dr,wt]})}return a})();export{Ct as C,kt as k,xe as x,ze as z};
@@ -1,2 +1,2 @@
1
- import {R}from'./chunk-qnkDdlfN.js';import {g,ao as V,G,du as W,C as Ce,a as Gi,m as mT,dv as je,Q as By,b as U,a7 as ya,W as br,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,y as eC,a9 as lC,a3 as VI,t as rC,ac as gC,v as bg,a6 as UI,z as oC,a5 as vl,a8 as Yg,A as Ug,b0 as Qg,aa as If,ab as wf}from'./main-COD2LZKB.js';import'./chunk-BvidtKG2.js';import {t as ti,Q as Qn,e as ei,Y as Ye,a as wt,A as At,Z as Zn,c as cn}from'./chunk-Bb0cfZpR.js';import'./chunk-JXiqGD2F.js';import'./chunk-KJgXoqSt.js';import'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';var $=(o,t)=>t.id;function J(o,t){o&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function Q(o,t){if(o&1&&(ws(0,"p",8),GC(1),pl()),o&2){let e=gC(2);XE(),Yg(e.errorMessage());}}function X(o,t){if(o&1){let e=lC();ws(0,"button",29),Rg("click",function(){If(e);let s=gC(2);return wf(s.retryLoad())}),GC(1,"Retry loading"),pl();}}function Z(o,t){if(o&1&&(ws(0,"span",31),GC(1),pl()),o&2){let e=gC(3);XE(),Yg(e.association()?.checkoutFailureReason);}}function ee(o,t){if(o&1&&(ws(0,"p",30),GC(1),Jw(2,Z,2,1,"span",31),pl()),o&2){let e=gC(2);Ug("namespace-git__status--failed",e.checkoutStatus()===e.CheckoutStatus.FAILED)("namespace-git__status--ready",e.checkoutStatus()===e.CheckoutStatus.READY),XE(),vl(" Repository: ",e.checkoutStatus()," "),XE(),eC(e.association()?.checkoutFailureReason?2:-1);}}function te(o,t){if(o&1&&(ws(0,"option",20),GC(1),pl()),o&2){let e=t.$implicit,l=gC(2);bg("value",e.id),XE(),Qg("",e.name," (",l.authTypeLabel(e.authType),")");}}function ne(o,t){o&1&&(ws(0,"span",21),GC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),pl());}function ie(o,t){if(o&1){let e=lC();ws(0,"button",32),Rg("click",function(){If(e);let s=gC(2);return wf(s.remove())}),GC(1," Remove association "),pl();}if(o&2){let e=gC(2);bg("disabled",!e.associationLoaded()||e.isSaving());}}function ae(o,t){if(o&1){let e=lC();ws(0,"div",6)(1,"p",7),GC(2," Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, every new top-level case gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows. "),pl(),Jw(3,Q,2,1,"p",8),Jw(4,X,2,0,"button",9),Jw(5,ee,3,6,"p",10),ws(6,"fieldset",11)(7,"legend",12),GC(8,"Repository"),pl(),ws(9,"label",13)(10,"span",14),GC(11,"Repository URL"),pl(),ws(12,"input",15),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.repositoryUrl.set(s))}),pl(),VI(),ws(13,"span",16),GC(14,"HTTPS only, without credentials in the URL."),pl()(),ws(15,"label",13)(16,"span",14),GC(17,"Main branch"),pl(),ws(18,"input",17),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.mainBranch.set(s))}),pl(),VI(),ws(19,"span",16),GC(20,"New worktrees start at this branch\u2019s commit, without creating a branch."),pl()(),ws(21,"label",13)(22,"span",14),GC(23,"Service account"),pl(),ws(24,"select",18),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.serviceAuthSettingId.set(s))}),ws(25,"option",19),GC(26,"Select an auth setting\u2026"),pl(),rC(27,te,2,3,"option",20,$),pl(),VI(),ws(29,"span",16),GC(30," Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case. "),pl(),Jw(31,ne,2,0,"span",21),pl()(),ws(32,"fieldset",11)(33,"legend",12),GC(34,"Automation"),pl(),ws(35,"label",22)(36,"input",23),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.autoWorktree.set(s))}),pl(),VI(),ws(37,"span"),GC(38,"Create a worktree for every new top-level case"),pl()(),ws(39,"span",16),GC(40," Applies to cases created from now on. Turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),pl(),ws(41,"label",13)(42,"span",14),GC(43,"Setup command (optional)"),pl(),ws(44,"input",24),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.setupCommand.set(s))}),pl(),VI(),ws(45,"span",21),GC(46," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),pl()()(),ws(47,"div",25)(48,"button",26),Rg("click",function(){If(e);let s=gC();return wf(s.save())}),GC(49),pl(),Jw(50,ie,2,1,"button",27),ws(51,"button",28),Rg("click",function(){If(e);let s=gC();return wf(s.cancel())}),GC(52,"Cancel"),pl()()();}if(o&2){let e=gC();XE(3),eC(e.errorMessage()?3:-1),XE(),eC(e.associationLoaded()?-1:4),XE(),eC(e.isAssociated()&&e.checkoutStatus()?5:-1),XE(),bg("disabled",!e.associationLoaded()||e.isSaving()),XE(6),bg("ngModel",e.repositoryUrl()),UI(),XE(6),bg("ngModel",e.mainBranch()),UI(),XE(6),bg("ngModel",e.serviceAuthSettingId()),UI(),XE(3),oC(e.eligibleAuthSettings()),XE(4),eC(e.eligibleAuthSettings().length===0?31:-1),XE(),bg("disabled",!e.associationLoaded()||e.isSaving()),XE(4),bg("ngModel",e.autoWorktree()),UI(),XE(8),bg("ngModel",e.setupCommand()),UI(),XE(4),bg("disabled",!e.canSave()),XE(),vl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),XE(),eC(e.isAssociated()?50:-1);}}var oe=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],re={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},q=class o{route=g(V);router=g(G);gitApi=g(W);authSettingState=g(R);destroyRef=g(Ce);isLoading=Gi(true);isSaving=Gi(false);associationLoaded=Gi(false);errorMessage=Gi(null);association=Gi(null);authSettings=Gi([]);repositoryUrl=Gi("");mainBranch=Gi("main");serviceAuthSettingId=Gi("");autoWorktree=Gi(false);setupCommand=Gi("");namespaceId="";isAssociated=mT(()=>this.association()?.associated===true);eligibleAuthSettings=mT(()=>this.authSettings().filter(t=>oe.includes(t.authType)));authTypeLabel(t){return re[t??""]??t??"unknown"}canSave=mT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=mT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=je;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),By({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),ya(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||confirm("Remove the repository association? Existing workspaces keep their worktree.")&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ya(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}cancel(){this.router.navigate(["/agentos/namespaces"]);}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-namespace-git"]],decls:10,vars:1,consts:[[1,"namespace-git"],[1,"namespace-git__header"],["type","button","title","Back to namespaces",1,"namespace-git__back",3,"click"],[1,"namespace-git__back-icon"],[1,"namespace-git__title"],[1,"namespace-git__loading"],[1,"namespace-git__body"],[1,"namespace-git__hint"],["role","alert",1,"namespace-git__error"],["type","button",1,"namespace-git__retry"],[1,"namespace-git__status",3,"namespace-git__status--failed","namespace-git__status--ready"],[1,"namespace-git__section",3,"disabled"],[1,"namespace-git__label"],[1,"namespace-git__field"],[1,"namespace-git__field-label"],["type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__field-hint"],["type","text","placeholder","main","name","mainBranch",1,"namespace-git__input",3,"ngModelChange","ngModel"],["name","serviceAuthSettingId",1,"namespace-git__input",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"namespace-git__field-hint","namespace-git__field-hint--warn"],[1,"namespace-git__checkbox"],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],["type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__actions"],["type","button",1,"namespace-git__save",3,"click","disabled"],["type","button",1,"namespace-git__remove",3,"disabled"],["type","button",1,"namespace-git__cancel",3,"click"],["type","button",1,"namespace-git__retry",3,"click"],[1,"namespace-git__status"],[1,"namespace-git__status-reason"],["type","button",1,"namespace-git__remove",3,"click","disabled"]],template:function(e,l){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return l.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Namespaces "),pl(),ws(6,"h1",4),GC(7,"Git repository"),pl()(),Jw(8,J,2,0,"p",5)(9,ae,53,14,"div",6),pl()),e&2&&(XE(8),eC(l.isLoading()?8:9));},dependencies:[ti,Qn,ei,Ye,wt,At,Zn,cn],styles:[".namespace-git[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.namespace-git__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-git__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-git__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-git__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem}.namespace-git__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.namespace-git__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__error[_ngcontent-%COMP%]{margin:0;padding:.75rem;border-radius:.375rem;background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c);font-size:.875rem}.namespace-git__status[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:.375rem;background:var(--color-surface-secondary, #f3f4f6);font-size:.875rem;display:flex;flex-direction:column;gap:.25rem}.namespace-git__status--ready[_ngcontent-%COMP%]{background:var(--color-success-bg, #ecfdf5);color:var(--color-success, #047857)}.namespace-git__status--failed[_ngcontent-%COMP%]{background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c)}.namespace-git__status-reason[_ngcontent-%COMP%]{font-size:.8125rem;opacity:.9}.namespace-git__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.5rem;padding:1rem;margin:0}.namespace-git__label[_ngcontent-%COMP%]{font-weight:600;font-size:.9375rem;padding:0 .25rem}.namespace-git__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-git__field-label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500}.namespace-git__field-hint[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__field-hint--warn[_ngcontent-%COMP%]{color:var(--color-warning, #b45309)}.namespace-git__input[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem .625rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.375rem;background:var(--color-surface, #fff);color:inherit}.namespace-git__checkbox[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;cursor:pointer}.namespace-git__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.namespace-git__save[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%], .namespace-git__remove[_ngcontent-%COMP%], .namespace-git__cancel[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem 1rem;border-radius:.375rem;cursor:pointer;border:1px solid transparent}.namespace-git__save[_ngcontent-%COMP%]:disabled, .namespace-git__retry[_ngcontent-%COMP%]:disabled, .namespace-git__remove[_ngcontent-%COMP%]:disabled, .namespace-git__cancel[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.namespace-git__save[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.namespace-git__remove[_ngcontent-%COMP%]{background:none;border-color:var(--color-error, #b91c1c);color:var(--color-error, #b91c1c)}.namespace-git__cancel[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%]{background:none;border-color:var(--color-border, #e5e7eb);color:inherit}"]})};
1
+ import {R}from'./chunk-DfHrtnxD.js';import {g,ao as V,G,du as W,C as Ce,a as Gi,m as mT,dv as je,Q as By,b as U,a7 as ya,W as br,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,y as eC,a9 as lC,a3 as VI,t as rC,ac as gC,v as bg,a6 as UI,z as oC,a5 as vl,a8 as Yg,A as Ug,b0 as Qg,aa as If,ab as wf}from'./main-GYSPY3UE.js';import'./chunk-DdPOtjZp.js';import {t as ti,Q as Qn,e as ei,Y as Ye,a as wt,A as At,Z as Zn,c as cn}from'./chunk-DS1gnXQd.js';import'./chunk-DOeIIw1a.js';import'./chunk-CXqNbVXr.js';import'./chunk-CGjjc55P.js';import'./chunk-CZe6uHRZ.js';var $=(o,t)=>t.id;function J(o,t){o&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function Q(o,t){if(o&1&&(ws(0,"p",8),GC(1),pl()),o&2){let e=gC(2);XE(),Yg(e.errorMessage());}}function X(o,t){if(o&1){let e=lC();ws(0,"button",29),Rg("click",function(){If(e);let s=gC(2);return wf(s.retryLoad())}),GC(1,"Retry loading"),pl();}}function Z(o,t){if(o&1&&(ws(0,"span",31),GC(1),pl()),o&2){let e=gC(3);XE(),Yg(e.association()?.checkoutFailureReason);}}function ee(o,t){if(o&1&&(ws(0,"p",30),GC(1),Jw(2,Z,2,1,"span",31),pl()),o&2){let e=gC(2);Ug("namespace-git__status--failed",e.checkoutStatus()===e.CheckoutStatus.FAILED)("namespace-git__status--ready",e.checkoutStatus()===e.CheckoutStatus.READY),XE(),vl(" Repository: ",e.checkoutStatus()," "),XE(),eC(e.association()?.checkoutFailureReason?2:-1);}}function te(o,t){if(o&1&&(ws(0,"option",20),GC(1),pl()),o&2){let e=t.$implicit,l=gC(2);bg("value",e.id),XE(),Qg("",e.name," (",l.authTypeLabel(e.authType),")");}}function ne(o,t){o&1&&(ws(0,"span",21),GC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),pl());}function ie(o,t){if(o&1){let e=lC();ws(0,"button",32),Rg("click",function(){If(e);let s=gC(2);return wf(s.remove())}),GC(1," Remove association "),pl();}if(o&2){let e=gC(2);bg("disabled",!e.associationLoaded()||e.isSaving());}}function ae(o,t){if(o&1){let e=lC();ws(0,"div",6)(1,"p",7),GC(2," Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, every new top-level case gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows. "),pl(),Jw(3,Q,2,1,"p",8),Jw(4,X,2,0,"button",9),Jw(5,ee,3,6,"p",10),ws(6,"fieldset",11)(7,"legend",12),GC(8,"Repository"),pl(),ws(9,"label",13)(10,"span",14),GC(11,"Repository URL"),pl(),ws(12,"input",15),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.repositoryUrl.set(s))}),pl(),VI(),ws(13,"span",16),GC(14,"HTTPS only, without credentials in the URL."),pl()(),ws(15,"label",13)(16,"span",14),GC(17,"Main branch"),pl(),ws(18,"input",17),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.mainBranch.set(s))}),pl(),VI(),ws(19,"span",16),GC(20,"New worktrees start at this branch\u2019s commit, without creating a branch."),pl()(),ws(21,"label",13)(22,"span",14),GC(23,"Service account"),pl(),ws(24,"select",18),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.serviceAuthSettingId.set(s))}),ws(25,"option",19),GC(26,"Select an auth setting\u2026"),pl(),rC(27,te,2,3,"option",20,$),pl(),VI(),ws(29,"span",16),GC(30," Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case. "),pl(),Jw(31,ne,2,0,"span",21),pl()(),ws(32,"fieldset",11)(33,"legend",12),GC(34,"Automation"),pl(),ws(35,"label",22)(36,"input",23),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.autoWorktree.set(s))}),pl(),VI(),ws(37,"span"),GC(38,"Create a worktree for every new top-level case"),pl()(),ws(39,"span",16),GC(40," Applies to cases created from now on. Turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),pl(),ws(41,"label",13)(42,"span",14),GC(43,"Setup command (optional)"),pl(),ws(44,"input",24),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.setupCommand.set(s))}),pl(),VI(),ws(45,"span",21),GC(46," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),pl()()(),ws(47,"div",25)(48,"button",26),Rg("click",function(){If(e);let s=gC();return wf(s.save())}),GC(49),pl(),Jw(50,ie,2,1,"button",27),ws(51,"button",28),Rg("click",function(){If(e);let s=gC();return wf(s.cancel())}),GC(52,"Cancel"),pl()()();}if(o&2){let e=gC();XE(3),eC(e.errorMessage()?3:-1),XE(),eC(e.associationLoaded()?-1:4),XE(),eC(e.isAssociated()&&e.checkoutStatus()?5:-1),XE(),bg("disabled",!e.associationLoaded()||e.isSaving()),XE(6),bg("ngModel",e.repositoryUrl()),UI(),XE(6),bg("ngModel",e.mainBranch()),UI(),XE(6),bg("ngModel",e.serviceAuthSettingId()),UI(),XE(3),oC(e.eligibleAuthSettings()),XE(4),eC(e.eligibleAuthSettings().length===0?31:-1),XE(),bg("disabled",!e.associationLoaded()||e.isSaving()),XE(4),bg("ngModel",e.autoWorktree()),UI(),XE(8),bg("ngModel",e.setupCommand()),UI(),XE(4),bg("disabled",!e.canSave()),XE(),vl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),XE(),eC(e.isAssociated()?50:-1);}}var oe=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],re={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},q=class o{route=g(V);router=g(G);gitApi=g(W);authSettingState=g(R);destroyRef=g(Ce);isLoading=Gi(true);isSaving=Gi(false);associationLoaded=Gi(false);errorMessage=Gi(null);association=Gi(null);authSettings=Gi([]);repositoryUrl=Gi("");mainBranch=Gi("main");serviceAuthSettingId=Gi("");autoWorktree=Gi(false);setupCommand=Gi("");namespaceId="";isAssociated=mT(()=>this.association()?.associated===true);eligibleAuthSettings=mT(()=>this.authSettings().filter(t=>oe.includes(t.authType)));authTypeLabel(t){return re[t??""]??t??"unknown"}canSave=mT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=mT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=je;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),By({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),ya(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||confirm("Remove the repository association? Existing workspaces keep their worktree.")&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ya(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}cancel(){this.router.navigate(["/agentos/namespaces"]);}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-namespace-git"]],decls:10,vars:1,consts:[[1,"namespace-git"],[1,"namespace-git__header"],["type","button","title","Back to namespaces",1,"namespace-git__back",3,"click"],[1,"namespace-git__back-icon"],[1,"namespace-git__title"],[1,"namespace-git__loading"],[1,"namespace-git__body"],[1,"namespace-git__hint"],["role","alert",1,"namespace-git__error"],["type","button",1,"namespace-git__retry"],[1,"namespace-git__status",3,"namespace-git__status--failed","namespace-git__status--ready"],[1,"namespace-git__section",3,"disabled"],[1,"namespace-git__label"],[1,"namespace-git__field"],[1,"namespace-git__field-label"],["type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__field-hint"],["type","text","placeholder","main","name","mainBranch",1,"namespace-git__input",3,"ngModelChange","ngModel"],["name","serviceAuthSettingId",1,"namespace-git__input",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"namespace-git__field-hint","namespace-git__field-hint--warn"],[1,"namespace-git__checkbox"],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],["type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__actions"],["type","button",1,"namespace-git__save",3,"click","disabled"],["type","button",1,"namespace-git__remove",3,"disabled"],["type","button",1,"namespace-git__cancel",3,"click"],["type","button",1,"namespace-git__retry",3,"click"],[1,"namespace-git__status"],[1,"namespace-git__status-reason"],["type","button",1,"namespace-git__remove",3,"click","disabled"]],template:function(e,l){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return l.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Namespaces "),pl(),ws(6,"h1",4),GC(7,"Git repository"),pl()(),Jw(8,J,2,0,"p",5)(9,ae,53,14,"div",6),pl()),e&2&&(XE(8),eC(l.isLoading()?8:9));},dependencies:[ti,Qn,ei,Ye,wt,At,Zn,cn],styles:[".namespace-git[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.namespace-git__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-git__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-git__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-git__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem}.namespace-git__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.namespace-git__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__error[_ngcontent-%COMP%]{margin:0;padding:.75rem;border-radius:.375rem;background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c);font-size:.875rem}.namespace-git__status[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:.375rem;background:var(--color-surface-secondary, #f3f4f6);font-size:.875rem;display:flex;flex-direction:column;gap:.25rem}.namespace-git__status--ready[_ngcontent-%COMP%]{background:var(--color-success-bg, #ecfdf5);color:var(--color-success, #047857)}.namespace-git__status--failed[_ngcontent-%COMP%]{background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c)}.namespace-git__status-reason[_ngcontent-%COMP%]{font-size:.8125rem;opacity:.9}.namespace-git__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.5rem;padding:1rem;margin:0}.namespace-git__label[_ngcontent-%COMP%]{font-weight:600;font-size:.9375rem;padding:0 .25rem}.namespace-git__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-git__field-label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500}.namespace-git__field-hint[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__field-hint--warn[_ngcontent-%COMP%]{color:var(--color-warning, #b45309)}.namespace-git__input[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem .625rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.375rem;background:var(--color-surface, #fff);color:inherit}.namespace-git__checkbox[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;cursor:pointer}.namespace-git__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.namespace-git__save[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%], .namespace-git__remove[_ngcontent-%COMP%], .namespace-git__cancel[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem 1rem;border-radius:.375rem;cursor:pointer;border:1px solid transparent}.namespace-git__save[_ngcontent-%COMP%]:disabled, .namespace-git__retry[_ngcontent-%COMP%]:disabled, .namespace-git__remove[_ngcontent-%COMP%]:disabled, .namespace-git__cancel[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.namespace-git__save[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.namespace-git__remove[_ngcontent-%COMP%]{background:none;border-color:var(--color-error, #b91c1c);color:var(--color-error, #b91c1c)}.namespace-git__cancel[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%]{background:none;border-color:var(--color-border, #e5e7eb);color:inherit}"]})};
2
2
  export{q as NamespaceGitComponent};
@@ -1 +1 @@
1
- import {d}from'./chunk-BvidtKG2.js';import {g,ao as V,G as G$1,C as Ce,da as M,a as Gi,b as U$1,e as xw,s as si,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as bg,y as eC,a8 as Yg,A as Ug,a5 as vl,a9 as lC,ac as gC,T as Tg,t as rC,z as oC,S as Sg,bf as aT,bg as uT,aa as If,ab as wf,bj as aE}from'./main-COD2LZKB.js';import'./chunk-KJgXoqSt.js';import'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';var F=(n,o)=>o.name;function B(n,o){n&1&&(ws(0,"p",6),GC(1,"Loading\u2026"),pl());}function $(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 H(n,o){if(n&1&&(ws(0,"pre",21),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.systemPrompt);}}function J(n,o){if(n&1){let e=lC();ws(0,"section",9)(1,"button",19),Rg("click",function(){If(e);let g=gC(2);return wf(g.toggleSystemPrompt())}),ws(2,"h2",10),GC(3,"System Prompt"),pl(),ws(4,"span",20),GC(5," \u25BC "),pl()(),Jw(6,H,2,1,"pre",21),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 U(n,o){if(n&1&&(ws(0,"pre",21),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.instructions);}}function G(n,o){if(n&1){let e=lC();ws(0,"section",9)(1,"button",19),Rg("click",function(){If(e);let g=gC(2);return wf(g.toggleInstructions())}),ws(2,"h2",10),GC(3,"Instructions"),pl(),ws(4,"span",20),GC(5," \u25BC "),pl()(),Jw(6,U,2,1,"pre",21),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,"No tools available for this agent."),pl());}function K(n,o){if(n&1&&(Sg(0,"div",26),aT(1,"agentosMarkdown")),n&2){let e=gC(2).$implicit;bg("innerHTML",uT(1,1,e.description),aE);}}function Q(n,o){if(n&1&&(ws(0,"div",25),Jw(1,K,2,3,"div",26),ws(2,"pre",27),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 W(n,o){if(n&1){let e=lC();ws(0,"li",22)(1,"button",23),Rg("click",function(){let g=If(e).$implicit,V=gC(3);return wf(V.toggleTool(g))}),ws(2,"span",24),GC(3),pl(),ws(4,"span",20),GC(5," \u25BC "),pl()(),Jw(6,Q,4,2,"div",25),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 X(n,o){if(n&1&&(ws(0,"ul",18),rC(1,W,7,5,"li",22,F),pl()),n&2){let e=gC();XE(),oC(e.tools);}}function Y(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,J,7,4,"section",9),Jw(24,G,7,4,"section",9),ws(25,"section",9)(26,"h2",10),GC(27," Tools "),ws(28,"span",16),GC(29),pl()(),Jw(30,q,2,0,"p",17)(31,X,3,0,"ul",18),pl()()),n&2){let e=o;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("(",e.tools.length,")"),XE(),eC(e.tools.length===0?30:31);}}var R=class n{route=g(V);router=g(G$1);destroyRef=g(Ce);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Gi(true);hasError=Gi(false);definition=Gi(null);expandedTools=Gi(new Set);systemPromptCollapsed=Gi(true);instructionsCollapsed=Gi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c});}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o);}toggleInstructions(){this.instructionsCollapsed.update(o=>!o);}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=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__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return c.back()}),ws(3,"span",3),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,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),pl()),e&2){let g;XE(8),bg("routerLink",c.editRoute()),XE(2),eC(c.isLoading()?10:c.hasError()?11:(g=c.definition())?12:-1,g);}},dependencies:[si,d],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"]})};export{R as AgentConfigInspectComponent};
1
+ import {d}from'./chunk-DdPOtjZp.js';import {g,ao as V,G as G$1,C as Ce,da as M,a as Gi,b as U$1,e as xw,s as si,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as bg,y as eC,a8 as Yg,A as Ug,a5 as vl,a9 as lC,ac as gC,T as Tg,t as rC,z as oC,S as Sg,bf as aT,bg as uT,aa as If,ab as wf,bj as aE}from'./main-GYSPY3UE.js';import'./chunk-CXqNbVXr.js';import'./chunk-CGjjc55P.js';import'./chunk-CZe6uHRZ.js';import'./chunk-DS1gnXQd.js';var F=(n,o)=>o.name;function B(n,o){n&1&&(ws(0,"p",6),GC(1,"Loading\u2026"),pl());}function $(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 H(n,o){if(n&1&&(ws(0,"pre",21),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.systemPrompt);}}function J(n,o){if(n&1){let e=lC();ws(0,"section",9)(1,"button",19),Rg("click",function(){If(e);let g=gC(2);return wf(g.toggleSystemPrompt())}),ws(2,"h2",10),GC(3,"System Prompt"),pl(),ws(4,"span",20),GC(5," \u25BC "),pl()(),Jw(6,H,2,1,"pre",21),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 U(n,o){if(n&1&&(ws(0,"pre",21),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.instructions);}}function G(n,o){if(n&1){let e=lC();ws(0,"section",9)(1,"button",19),Rg("click",function(){If(e);let g=gC(2);return wf(g.toggleInstructions())}),ws(2,"h2",10),GC(3,"Instructions"),pl(),ws(4,"span",20),GC(5," \u25BC "),pl()(),Jw(6,U,2,1,"pre",21),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,"No tools available for this agent."),pl());}function K(n,o){if(n&1&&(Sg(0,"div",26),aT(1,"agentosMarkdown")),n&2){let e=gC(2).$implicit;bg("innerHTML",uT(1,1,e.description),aE);}}function Q(n,o){if(n&1&&(ws(0,"div",25),Jw(1,K,2,3,"div",26),ws(2,"pre",27),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 W(n,o){if(n&1){let e=lC();ws(0,"li",22)(1,"button",23),Rg("click",function(){let g=If(e).$implicit,V=gC(3);return wf(V.toggleTool(g))}),ws(2,"span",24),GC(3),pl(),ws(4,"span",20),GC(5," \u25BC "),pl()(),Jw(6,Q,4,2,"div",25),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 X(n,o){if(n&1&&(ws(0,"ul",18),rC(1,W,7,5,"li",22,F),pl()),n&2){let e=gC();XE(),oC(e.tools);}}function Y(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,J,7,4,"section",9),Jw(24,G,7,4,"section",9),ws(25,"section",9)(26,"h2",10),GC(27," Tools "),ws(28,"span",16),GC(29),pl()(),Jw(30,q,2,0,"p",17)(31,X,3,0,"ul",18),pl()()),n&2){let e=o;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("(",e.tools.length,")"),XE(),eC(e.tools.length===0?30:31);}}var R=class n{route=g(V);router=g(G$1);destroyRef=g(Ce);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Gi(true);hasError=Gi(false);definition=Gi(null);expandedTools=Gi(new Set);systemPromptCollapsed=Gi(true);instructionsCollapsed=Gi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c});}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o);}toggleInstructions(){this.instructionsCollapsed.update(o=>!o);}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=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__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return c.back()}),ws(3,"span",3),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,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),pl()),e&2){let g;XE(8),bg("routerLink",c.editRoute()),XE(2),eC(c.isLoading()?10:c.hasError()?11:(g=c.definition())?12:-1,g);}},dependencies:[si,d],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"]})};export{R as AgentConfigInspectComponent};
@@ -1 +1 @@
1
- import {c}from'./chunk-ZI_RF6mJ.js';import {g,ao as V,G,C as Ce$1,da as M,db as Te$1,dc as we$1,a as Gi,dd as Re$1,F,bR as Id,m as mT,Q as By,b as U,a7 as ya,W as br,x,w,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a5 as vl,y as eC,a9 as lC,S as Sg,a3 as VI,t as rC,ac as gC,v as bg,A as Ug,a6 as UI,z as oC,a8 as Yg,aa as If,ab as wf,bk as yh}from'./main-COD2LZKB.js';import {o as z,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,C as Cn,E as En}from'./chunk-Bb0cfZpR.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function ue(n,t){n&1&&(ws(0,"span",12),GC(1," Name is required. "),pl());}function fe(n,t){if(n&1&&(ws(0,"p",42),GC(1),pl(),ws(2,"span",13),GC(3,"Agent Config cannot be changed after creation."),pl()),n&2){let e=gC(2);XE(),Yg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(ws(0,"a",43),GC(1,"Add an agent config"),pl(),GC(2," first. ")),n&2){let e=gC(3);bg("href","/agentos/"+e.namespaceId+"/agent-configs/new",yh);}}function he(n,t){if(n&1&&(ws(0,"p",13),GC(1," No agent configs available in this scope yet. "),Jw(2,_e,3,1),pl()),n&2){let e=gC(2);XE(2),eC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.id),XE(),Yg(e.name);}}function Ce(n,t){n&1&&(ws(0,"span",12),GC(1,"Agent Config is required."),pl());}function ve(n,t){if(n&1&&(ws(0,"select",44)(1,"option",45),GC(2,"Select an agent config\u2026"),pl(),rC(3,ge,2,2,"option",23,me),pl(),VI(),Jw(5,Ce,2,0,"span",12),ws(6,"span",13),GC(7,"Immutable after creation."),pl()),n&2){let e=gC(2);bg("formControl",e.agentConfigIdControl),UI(),XE(3),oC(e.availableAgentConfigs()),XE(2),eC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&(ws(0,"span",12),GC(1,"Opening message is required."),pl());}function ye(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.value),XE(),Yg(e.label);}}function be(n,t){if(n&1){let e=lC();ws(0,"label",48)(1,"input",49),Rg("change",function(){let g=If(e).$implicit,v=gC(3);return wf(v.toggleDay(g.value))}),pl(),ws(2,"span",50),GC(3),pl()();}if(n&2){let e=t.$implicit,d=gC(3);XE(),bg("checked",d.isDaySelected(e.value)),XE(2),Yg(e.label);}}function Se(n,t){if(n&1&&(ws(0,"div",8)(1,"span",46),GC(2,"Days of week"),pl(),ws(3,"div",47),rC(4,be,4,2,"label",48,A),pl(),ws(6,"span",13),GC(7,"Leave empty to run every day of the week."),pl()()),n&2){let e=gC(2);XE(4),oC(e.dayOptions);}}function Ee(n,t){n&1&&(ws(0,"span",12),GC(1,"Valid time is required (HH:mm)."),pl());}function Pe(n,t){n&1&&(ws(0,"span",12),GC(1,"Start date is required."),pl());}function Me(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.value),XE(),Yg(e.label);}}function Oe(n,t){n&1&&(ws(0,"span",12),GC(1,"End date is required."),pl());}function De(n,t){if(n&1&&(ws(0,"div",8)(1,"label",51),GC(2," End date "),ws(3,"span",10),GC(4,"*"),pl()(),Sg(5,"input",52),VI(),Jw(6,Oe,2,0,"span",12),pl()),n&2){let e=gC(2);XE(5),Ug("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),bg("formControl",e.endDateControl),UI(),XE(),eC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(ws(0,"span",12),GC(1,"Must be at least 1."),pl());}function we(n,t){if(n&1&&(ws(0,"div",8)(1,"label",53),GC(2," Number of occurrences "),ws(3,"span",10),GC(4,"*"),pl()(),Sg(5,"input",54),VI(),Jw(6,Te,2,0,"span",12),pl()),n&2){let e=gC(2);XE(5),Ug("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),bg("formControl",e.occurrenceCountControl),UI(),XE(),eC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&(ws(0,"span",12),GC(1,"Invalid JSON."),pl());}function Ne(n,t){if(n&1&&(ws(0,"p",38),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let g=gC();return wf(g.submit())}),ws(1,"div",8)(2,"label",9),GC(3," Name "),ws(4,"span",10),GC(5,"*"),pl()(),Sg(6,"input",11),VI(),Jw(7,ue,2,0,"span",12),ws(8,"span",13),GC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),pl()(),ws(10,"div",8)(11,"label",14),GC(12,"Description"),pl(),Sg(13,"input",15),VI(),pl(),ws(14,"div",8)(15,"label",16),GC(16," Agent Config "),ws(17,"span",10),GC(18,"*"),pl()(),Jw(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),pl(),ws(22,"div",8)(23,"label",17),GC(24," Opening message "),ws(25,"span",10),GC(26,"*"),pl()(),Sg(27,"textarea",18),VI(),Jw(28,xe,2,0,"span",12),ws(29,"span",13),GC(30," The message sent to the agent when the scheduled prompt fires. "),pl()(),ws(31,"fieldset",19)(32,"legend",20),GC(33,"Recurrence"),pl(),ws(34,"div",8)(35,"label",21),GC(36," Unit "),ws(37,"span",10),GC(38,"*"),pl()(),ws(39,"select",22),rC(40,ye,2,2,"option",23,A),pl(),VI(),pl(),Jw(42,Se,8,0,"div",8),ws(43,"div",8)(44,"label",24),GC(45," Time (UTC) "),ws(46,"span",10),GC(47,"*"),pl()(),ws(48,"div",25),Sg(49,"input",26),VI(),ws(50,"span",27),GC(51,"UTC"),pl()(),Jw(52,Ee,2,0,"span",12),pl()(),ws(53,"fieldset",19)(54,"legend",20),GC(55,"Planning"),pl(),ws(56,"div",8)(57,"label",28),GC(58," Start date "),ws(59,"span",10),GC(60,"*"),pl()(),Sg(61,"input",29),VI(),Jw(62,Pe,2,0,"span",12),pl(),ws(63,"div",8)(64,"label",30),GC(65," Ends "),ws(66,"span",10),GC(67,"*"),pl()(),ws(68,"select",31),rC(69,Me,2,2,"option",23,A),pl(),VI(),pl(),Jw(71,De,7,4,"div",8),Jw(72,we,7,4,"div",8),pl(),ws(73,"div",8)(74,"label",32),Sg(75,"input",33),VI(),ws(76,"span",34),GC(77,"Enabled"),pl()(),ws(78,"p",35),GC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),pl()(),ws(80,"div",8)(81,"label",36),GC(82,"External Metadata"),pl(),Sg(83,"textarea",37),VI(),Jw(84,ke,2,0,"span",12),ws(85,"span",13),GC(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),pl()(),Jw(87,Ne,2,1,"p",38),ws(88,"div",39)(89,"button",40),GC(90),pl(),ws(91,"button",41),Rg("click",function(){If(e);let g=gC();return wf(g.cancel())}),GC(92,"Cancel"),pl()()();}if(n&2){let e=gC();bg("formGroup",e.form),XE(6),Ug("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),bg("formControl",e.nameControl),UI(),XE(),eC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(6),bg("formControl",e.descriptionControl),UI(),XE(6),eC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),XE(8),Ug("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),bg("formControl",e.promptContentControl),UI(),XE(),eC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),XE(11),bg("formControl",e.unitControl),UI(),XE(),oC(e.schedulerUnits),XE(2),eC(e.showDayFilter()?42:-1),XE(7),bg("formControl",e.timeUtcControl),UI(),XE(3),eC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),XE(9),Ug("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),bg("formControl",e.startDateControl),UI(),XE(),eC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),XE(6),bg("formControl",e.endTypeControl),UI(),XE(),oC(e.endTypes),XE(2),eC(e.showEndDate()?71:-1),XE(),eC(e.showOccurrenceCount()?72:-1),XE(3),bg("formControl",e.enabledControl),UI(),XE(8),bg("formControl",e.externalMetadataJsonControl),UI(),XE(),eC(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),XE(3),eC(e.errorMessage()?87:-1),XE(2),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=g(V);router=g(G);destroyRef=g(Ce$1);state=g(c);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required]}),description:new _t(null),agentConfigId:new _t("",{nonNullable:true,validators:[_e$1.required]}),promptContent:new _t("",{nonNullable:true,validators:[_e$1.required]}),unit:new _t(we$1.WEEK,{nonNullable:true,validators:[_e$1.required]}),days:new _t([],{nonNullable:true}),timeUtc:new _t("09:00",{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new _t("",{nonNullable:true,validators:[_e$1.required]}),endType:new _t(Te$1.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true}),externalMetadataJson:new _t("",{nonNullable:true,validators:[Ae]})},{validators:[Ie,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);errorMessage=Gi(null);SchedulerUnit=we$1;SchedulerEndType=Te$1;schedulerUnits=[{value:we$1.WEEK,label:"Week(s)"},{value:we$1.MONTH,label:"Month(s)"}];endTypes=[{value:Te$1.NEVER,label:"Never"},{value:Te$1.ON_DATE,label:"On date"},{value:Te$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Re$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(Id(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Id(this.endTypeControl.value)));showDayFilter=mT(()=>this.unitSignal()===we$1.WEEK);showEndDate=mT(()=>this.endTypeSignal()===Te$1.ON_DATE);showOccurrenceCount=mT(()=>this.endTypeSignal()===Te$1.OCCURRENCES);agentConfigs=Gi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),By({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:d})=>{this.existingPrompt=e,this.agentConfigs.set(d),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ya(()=>br([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,d=e.includes(t)?e.filter(g=>g!==t):[...e,t];this.daysControl.setValue(d);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,d=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===Te$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Te$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let v=this.externalMetadataJsonControl.value.trim();return v?JSON.parse(v):null})()});(t?this.state.update(this.existingPrompt.id,d):this.state.create(d)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:v=>{this.isSubmitting.set(false),v.status===409?this.errorMessage.set(`A scheduled prompt named "${d.name}" already exists in this scope.`):v.status===400?this.errorMessage.set(v.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],["for","sp-external-metadata",1,"scheduled-prompt-form__label"],["id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"scheduled-prompt-form__textarea","scheduled-prompt-form__textarea--code",3,"formControl"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,d){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return d.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),pl()),e&2&&(XE(5),vl(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),XE(2),vl(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),XE(),eC(d.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Cn,En],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ie(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Te$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Te$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ae(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),d=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${d}`}export{se as ScheduledPromptFormComponent};
1
+ import {c}from'./chunk-B1h8Rr_L.js';import {g,ao as V,G,C as Ce$1,da as M,db as Te$1,dc as we$1,a as Gi,dd as Re$1,F,bR as Id,m as mT,Q as By,b as U,a7 as ya,W as br,x,w,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,a5 as vl,y as eC,a9 as lC,S as Sg,a3 as VI,t as rC,ac as gC,v as bg,A as Ug,a6 as UI,z as oC,a8 as Yg,aa as If,ab as wf,bk as yh}from'./main-GYSPY3UE.js';import {o as z,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,C as Cn,E as En}from'./chunk-DS1gnXQd.js';var A=(n,t)=>t.value,me=(n,t)=>t.id;function pe(n,t){n&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function ue(n,t){n&1&&(ws(0,"span",12),GC(1," Name is required. "),pl());}function fe(n,t){if(n&1&&(ws(0,"p",42),GC(1),pl(),ws(2,"span",13),GC(3,"Agent Config cannot be changed after creation."),pl()),n&2){let e=gC(2);XE(),Yg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(ws(0,"a",43),GC(1,"Add an agent config"),pl(),GC(2," first. ")),n&2){let e=gC(3);bg("href","/agentos/"+e.namespaceId+"/agent-configs/new",yh);}}function he(n,t){if(n&1&&(ws(0,"p",13),GC(1," No agent configs available in this scope yet. "),Jw(2,_e,3,1),pl()),n&2){let e=gC(2);XE(2),eC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.id),XE(),Yg(e.name);}}function Ce(n,t){n&1&&(ws(0,"span",12),GC(1,"Agent Config is required."),pl());}function ve(n,t){if(n&1&&(ws(0,"select",44)(1,"option",45),GC(2,"Select an agent config\u2026"),pl(),rC(3,ge,2,2,"option",23,me),pl(),VI(),Jw(5,Ce,2,0,"span",12),ws(6,"span",13),GC(7,"Immutable after creation."),pl()),n&2){let e=gC(2);bg("formControl",e.agentConfigIdControl),UI(),XE(3),oC(e.availableAgentConfigs()),XE(2),eC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function xe(n,t){n&1&&(ws(0,"span",12),GC(1,"Opening message is required."),pl());}function ye(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.value),XE(),Yg(e.label);}}function be(n,t){if(n&1){let e=lC();ws(0,"label",48)(1,"input",49),Rg("change",function(){let g=If(e).$implicit,v=gC(3);return wf(v.toggleDay(g.value))}),pl(),ws(2,"span",50),GC(3),pl()();}if(n&2){let e=t.$implicit,d=gC(3);XE(),bg("checked",d.isDaySelected(e.value)),XE(2),Yg(e.label);}}function Se(n,t){if(n&1&&(ws(0,"div",8)(1,"span",46),GC(2,"Days of week"),pl(),ws(3,"div",47),rC(4,be,4,2,"label",48,A),pl(),ws(6,"span",13),GC(7,"Leave empty to run every day of the week."),pl()()),n&2){let e=gC(2);XE(4),oC(e.dayOptions);}}function Ee(n,t){n&1&&(ws(0,"span",12),GC(1,"Valid time is required (HH:mm)."),pl());}function Pe(n,t){n&1&&(ws(0,"span",12),GC(1,"Start date is required."),pl());}function Me(n,t){if(n&1&&(ws(0,"option",23),GC(1),pl()),n&2){let e=t.$implicit;bg("value",e.value),XE(),Yg(e.label);}}function Oe(n,t){n&1&&(ws(0,"span",12),GC(1,"End date is required."),pl());}function De(n,t){if(n&1&&(ws(0,"div",8)(1,"label",51),GC(2," End date "),ws(3,"span",10),GC(4,"*"),pl()(),Sg(5,"input",52),VI(),Jw(6,Oe,2,0,"span",12),pl()),n&2){let e=gC(2);XE(5),Ug("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),bg("formControl",e.endDateControl),UI(),XE(),eC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(ws(0,"span",12),GC(1,"Must be at least 1."),pl());}function we(n,t){if(n&1&&(ws(0,"div",8)(1,"label",53),GC(2," Number of occurrences "),ws(3,"span",10),GC(4,"*"),pl()(),Sg(5,"input",54),VI(),Jw(6,Te,2,0,"span",12),pl()),n&2){let e=gC(2);XE(5),Ug("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),bg("formControl",e.occurrenceCountControl),UI(),XE(),eC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){n&1&&(ws(0,"span",12),GC(1,"Invalid JSON."),pl());}function Ne(n,t){if(n&1&&(ws(0,"p",38),GC(1),pl()),n&2){let e=gC(2);XE(),Yg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=lC();ws(0,"form",7),Rg("ngSubmit",function(){If(e);let g=gC();return wf(g.submit())}),ws(1,"div",8)(2,"label",9),GC(3," Name "),ws(4,"span",10),GC(5,"*"),pl()(),Sg(6,"input",11),VI(),Jw(7,ue,2,0,"span",12),ws(8,"span",13),GC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),pl()(),ws(10,"div",8)(11,"label",14),GC(12,"Description"),pl(),Sg(13,"input",15),VI(),pl(),ws(14,"div",8)(15,"label",16),GC(16," Agent Config "),ws(17,"span",10),GC(18,"*"),pl()(),Jw(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),pl(),ws(22,"div",8)(23,"label",17),GC(24," Opening message "),ws(25,"span",10),GC(26,"*"),pl()(),Sg(27,"textarea",18),VI(),Jw(28,xe,2,0,"span",12),ws(29,"span",13),GC(30," The message sent to the agent when the scheduled prompt fires. "),pl()(),ws(31,"fieldset",19)(32,"legend",20),GC(33,"Recurrence"),pl(),ws(34,"div",8)(35,"label",21),GC(36," Unit "),ws(37,"span",10),GC(38,"*"),pl()(),ws(39,"select",22),rC(40,ye,2,2,"option",23,A),pl(),VI(),pl(),Jw(42,Se,8,0,"div",8),ws(43,"div",8)(44,"label",24),GC(45," Time (UTC) "),ws(46,"span",10),GC(47,"*"),pl()(),ws(48,"div",25),Sg(49,"input",26),VI(),ws(50,"span",27),GC(51,"UTC"),pl()(),Jw(52,Ee,2,0,"span",12),pl()(),ws(53,"fieldset",19)(54,"legend",20),GC(55,"Planning"),pl(),ws(56,"div",8)(57,"label",28),GC(58," Start date "),ws(59,"span",10),GC(60,"*"),pl()(),Sg(61,"input",29),VI(),Jw(62,Pe,2,0,"span",12),pl(),ws(63,"div",8)(64,"label",30),GC(65," Ends "),ws(66,"span",10),GC(67,"*"),pl()(),ws(68,"select",31),rC(69,Me,2,2,"option",23,A),pl(),VI(),pl(),Jw(71,De,7,4,"div",8),Jw(72,we,7,4,"div",8),pl(),ws(73,"div",8)(74,"label",32),Sg(75,"input",33),VI(),ws(76,"span",34),GC(77,"Enabled"),pl()(),ws(78,"p",35),GC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),pl()(),ws(80,"div",8)(81,"label",36),GC(82,"External Metadata"),pl(),Sg(83,"textarea",37),VI(),Jw(84,ke,2,0,"span",12),ws(85,"span",13),GC(86,"Optional. Opaque JSON object stored as-is. Leave empty to clear."),pl()(),Jw(87,Ne,2,1,"p",38),ws(88,"div",39)(89,"button",40),GC(90),pl(),ws(91,"button",41),Rg("click",function(){If(e);let g=gC();return wf(g.cancel())}),GC(92,"Cancel"),pl()()();}if(n&2){let e=gC();bg("formGroup",e.form),XE(6),Ug("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),bg("formControl",e.nameControl),UI(),XE(),eC(e.nameControl.invalid&&e.nameControl.touched?7:-1),XE(6),bg("formControl",e.descriptionControl),UI(),XE(6),eC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),XE(8),Ug("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),bg("formControl",e.promptContentControl),UI(),XE(),eC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),XE(11),bg("formControl",e.unitControl),UI(),XE(),oC(e.schedulerUnits),XE(2),eC(e.showDayFilter()?42:-1),XE(7),bg("formControl",e.timeUtcControl),UI(),XE(3),eC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),XE(9),Ug("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),bg("formControl",e.startDateControl),UI(),XE(),eC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),XE(6),bg("formControl",e.endTypeControl),UI(),XE(),oC(e.endTypes),XE(2),eC(e.showEndDate()?71:-1),XE(),eC(e.showOccurrenceCount()?72:-1),XE(3),bg("formControl",e.enabledControl),UI(),XE(8),bg("formControl",e.externalMetadataJsonControl),UI(),XE(),eC(e.externalMetadataJsonControl.invalid&&e.externalMetadataJsonControl.touched?84:-1),XE(3),eC(e.errorMessage()?87:-1),XE(2),bg("disabled",e.form.invalid||e.isSubmitting()),XE(),vl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var se=class n{route=g(V);router=g(G);destroyRef=g(Ce$1);state=g(c);agentConfigController=g(M);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required]}),description:new _t(null),agentConfigId:new _t("",{nonNullable:true,validators:[_e$1.required]}),promptContent:new _t("",{nonNullable:true,validators:[_e$1.required]}),unit:new _t(we$1.WEEK,{nonNullable:true,validators:[_e$1.required]}),days:new _t([],{nonNullable:true}),timeUtc:new _t("09:00",{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new _t("",{nonNullable:true,validators:[_e$1.required]}),endType:new _t(Te$1.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true}),externalMetadataJson:new _t("",{nonNullable:true,validators:[Ae]})},{validators:[Ie,Ve]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}get externalMetadataJsonControl(){return this.form.controls.externalMetadataJson}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);errorMessage=Gi(null);SchedulerUnit=we$1;SchedulerEndType=Te$1;schedulerUnits=[{value:we$1.WEEK,label:"Week(s)"},{value:we$1.MONTH,label:"Month(s)"}];endTypes=[{value:Te$1.NEVER,label:"Never"},{value:Te$1.ON_DATE,label:"On date"},{value:Te$1.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(Re$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(Id(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Id(this.endTypeControl.value)));showDayFilter=mT(()=>this.unitSignal()===we$1.WEEK);showEndDate=mT(()=>this.endTypeSignal()===Te$1.ON_DATE);showOccurrenceCount=mT(()=>this.endTypeSignal()===Te$1.OCCURRENCES);agentConfigs=Gi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Re());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),By({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:d})=>{this.existingPrompt=e,this.agentConfigs.set(d),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(ya(()=>br([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled),this.externalMetadataJsonControl.setValue(t.externalMetadata?JSON.stringify(t.externalMetadata,null,2):"");}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,d=e.includes(t)?e.filter(g=>g!==t):[...e,t];this.daysControl.setValue(d);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,d=x(w({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===Te$1.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===Te$1.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value,removed:this.existingPrompt?.removed??false,externalMetadata:(()=>{let v=this.externalMetadataJsonControl.value.trim();return v?JSON.parse(v):null})()});(t?this.state.update(this.existingPrompt.id,d):this.state.create(d)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:v=>{this.isSubmitting.set(false),v.status===409?this.errorMessage.set(`A scheduled prompt named "${d.name}" already exists in this scope.`):v.status===400?this.errorMessage.set(v.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=xw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],["for","sp-external-metadata",1,"scheduled-prompt-form__label"],["id","sp-external-metadata","rows","6","placeholder",'{ "key": "value" }',"spellcheck","false","autocomplete","off",1,"scheduled-prompt-form__textarea","scheduled-prompt-form__textarea--code",3,"formControl"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,d){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return d.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5),pl(),ws(6,"h1",4),GC(7),pl()(),Jw(8,pe,2,0,"p",5)(9,Fe,93,28,"form",6),pl()),e&2&&(XE(5),vl(" ",d.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),XE(2),vl(" ",d.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),XE(),eC(d.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Cn,En],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ie(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===Te$1.ON_DATE&&!e?{endDateRequired:true}:null}function Ve(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===Te$1.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ae(n){let t=n.value?.trim();if(!t)return null;try{return JSON.parse(t),null}catch(e){return {invalidJson:true}}}function Re(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),d=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${d}`}export{se as ScheduledPromptFormComponent};
@@ -1 +1 @@
1
- import {O}from'./chunk-BVHP3O1y.js';import {R}from'./chunk-qnkDdlfN.js';import {g,G,C as Ce,aJ as Tr,a as Gi,bS as va,r as re,b as U,e as xw,aK as xb,k as ws,bf as aT,q as Rg,n as GC,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-COD2LZKB.js';import'./chunk-BvidtKG2.js';import {W as Wn}from'./chunk-D1wn67qT.js';import'./chunk-CaZu6-ik.js';import'./chunk-Bb0cfZpR.js';import'./chunk-JXiqGD2F.js';import'./chunk-KJgXoqSt.js';var k=()=>[];function V(i,t){if(i&1){let e=lC();ws(0,"agentos-auth-setting-item",4),Rg("editRequested",function(n){If(e);let p=gC(2);return wf(p.onEdit(n))})("deleteRequested",function(n){If(e);let p=gC(2);return wf(p.onDelete(n))}),pl();}i&2&&bg("config",t)("showBadge",false);}function F(i,t){if(i&1&&Jw(0,V,1,2,"agentos-auth-setting-item",3),i&2){let e,o=t.$implicit,n=gC();eC((e=n.resolveSetting(o.id))?0:-1,e);}}var M=class i{router=g(G);destroyRef=g(Ce);state=g(R);refresh$=new Tr(void 0);isLoading=Gi(true);settings$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())));settingItems$=this.settings$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.authType}))));settingsById=new Map;constructor(){this.settings$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.settingsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.state.delete(t.id,"platform").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveSetting(t){return this.settingsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-auth-settings"]],decls:6,vars:7,consts:[["authSettingItemTpl",""],["title","Platform Auth Settings","emptyMessage","No platform auth settings defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"platform-auth-settings__back",3,"click"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(e,o){if(e&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return o.openCreateForm()}),ws(2,"button",2),Rg("click",function(){return o.goBack()}),GC(3,"\u2190 Admin"),pl()(),Eg(4,F,1,1,"ng-template",null,0,fT)),e&2){let n=CC(5);bg("items",uT(1,4,o.settingItems$)??rT(6,k))("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,O,xb],encapsulation:2})};export{M as PlatformAuthSettingsComponent};
1
+ import {O}from'./chunk-B4GIoG1U.js';import {R}from'./chunk-DfHrtnxD.js';import {g,G,C as Ce,aJ as Tr,a as Gi,bS as va,r as re,b as U,e as xw,aK as xb,k as ws,bf as aT,q as Rg,n as GC,o as pl,af as Eg,u as CC,v as bg,bg as uT,ah as rT,J as Jw,ac as gC,y as eC,a9 as lC,aa as If,ab as wf,ag as fT}from'./main-GYSPY3UE.js';import'./chunk-DdPOtjZp.js';import {$ as $n}from'./chunk-CGjjc55P.js';import'./chunk-CZe6uHRZ.js';import'./chunk-DS1gnXQd.js';import'./chunk-DOeIIw1a.js';import'./chunk-CXqNbVXr.js';var k=()=>[];function V(i,t){if(i&1){let e=lC();ws(0,"agentos-auth-setting-item",4),Rg("editRequested",function(n){If(e);let p=gC(2);return wf(p.onEdit(n))})("deleteRequested",function(n){If(e);let p=gC(2);return wf(p.onDelete(n))}),pl();}i&2&&bg("config",t)("showBadge",false);}function F(i,t){if(i&1&&Jw(0,V,1,2,"agentos-auth-setting-item",3),i&2){let e,o=t.$implicit,n=gC();eC((e=n.resolveSetting(o.id))?0:-1,e);}}var M=class i{router=g(G);destroyRef=g(Ce);state=g(R);refresh$=new Tr(void 0);isLoading=Gi(true);settings$=this.refresh$.pipe(va(()=>(this.isLoading.set(true),this.state.loadPlatformSettings())));settingItems$=this.settings$.pipe(re(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.authType}))));settingsById=new Map;constructor(){this.settings$.pipe(U(this.destroyRef)).subscribe({next:t=>{this.settingsById=new Map(t.map(e=>[e.id??"",e])),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}goBack(){this.router.navigate(["/agentos","admin"]);}openCreateForm(){this.router.navigate(["/agentos","admin","auth-settings","new"]);}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","auth-settings",t.id,"edit"]);}onDelete(t){t.id&&this.state.delete(t.id,"platform").pipe(U(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveSetting(t){return this.settingsById.get(t)??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=xw({type:i,selectors:[["agentos-platform-auth-settings"]],decls:6,vars:7,consts:[["authSettingItemTpl",""],["title","Platform Auth Settings","emptyMessage","No platform auth settings defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"platform-auth-settings__back",3,"click"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(e,o){if(e&1&&(ws(0,"ds-entity-list",1),aT(1,"async"),Rg("createRequested",function(){return o.openCreateForm()}),ws(2,"button",2),Rg("click",function(){return o.goBack()}),GC(3,"\u2190 Admin"),pl()(),Eg(4,F,1,1,"ng-template",null,0,fT)),e&2){let n=CC(5);bg("items",uT(1,4,o.settingItems$)??rT(6,k))("loading",o.isLoading())("showCreate",true)("itemTemplate",n);}},dependencies:[$n,O,xb],encapsulation:2})};export{M as PlatformAuthSettingsComponent};
@@ -1,4 +1,4 @@
1
- import {w,av as B$1,x as x$1}from'./main-COD2LZKB.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} *[^
1
+ import {w,av as B$1,x as x$1}from'./main-GYSPY3UE.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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},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,`