import"./chunk-J7LKWQFV.js";import{I as P,J as O}from"./chunk-P25H6AGX.js";import{a as H}from"./chunk-VZISVRHZ.js";import{b as E,c as N}from"./chunk-AI2T33KF.js";import"./chunk-B47LJMRU.js";import{b as B}from"./chunk-233YH2CI.js";import"./chunk-TS5XAMXE.js";import"./chunk-EHV5JSNA.js";import"./chunk-5VEBEOBK.js";import"./chunk-S2V6IA2C.js";import"./chunk-QG2WC3H3.js";import"./chunk-6KEUYGBO.js";import"./chunk-ZBEJAM5I.js";import"./chunk-N2PQ6HLD.js";import"./chunk-RYOTKPRJ.js";import"./chunk-ORQ34GH7.js";import"./chunk-DZT3OJCU.js";import"./chunk-7SMWJ3GR.js";import"./chunk-P2NRYBYH.js";import"./chunk-M7AISLOK.js";import"./chunk-URVBFPQY.js";import"./chunk-OP2OM2NB.js";import"./chunk-YFKO2YMD.js";import"./chunk-KMX5PVQZ.js";import"./chunk-H7ZIYAN2.js";import{c as b}from"./chunk-D5M6Y5VI.js";import"./chunk-PFQHIQUX.js";import{a as M,i as k}from"./chunk-3CODJNWE.js";import"./chunk-HJB5ICMZ.js";import"./chunk-QU4JA34D.js";import"./chunk-TAYSHZWB.js";import"./chunk-GDIYNKGM.js";import"./chunk-L4FY67IO.js";import"./chunk-7WODUV7D.js";import{a as A}from"./chunk-ZZVJWSMI.js";import"./chunk-CX23ZL4L.js";import"./chunk-EP2DJHVF.js";import"./chunk-ZVZZ3QVR.js";import"./chunk-EQ67X7AF.js";import"./chunk-LMRN7T6T.js";import"./chunk-KHAMQZND.js";import"./chunk-KANMOB5U.js";import"./chunk-D3YCQTGW.js";import"./chunk-OBT56KUD.js";import{m as I}from"./chunk-NMCXU7N6.js";import{$b as S,Aa as v,Ba as h,Bc as m,Cc as T,Eb as _,Jc as C,Nb as p,Rb as f,Uc as w,Vc as F,Wa as D,Yb as c,_b as y,ac as x,bc as s,cc as r,dc as d,oc as g,sb as o,va as u}from"./chunk-IYD54RT7.js";import"./chunk-RVFOIZLJ.js";var L=(()=>{let e=class e{constructor(){this.timelineData=D.required(),this.labels=["Pass","Fail","Abort","Dispo'd"],this.data=[],this.title="",this.total=[],this.passing=[],this.lineChartData=_({labels:[],datasets:[]}),this.lineChartOptions=_({responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{beginAtZero:!0,stacked:!0,ticks:{precision:0}},x:{type:"time",adapters:{date:{locale:P}},time:{unit:"day"},ticks:{source:"auto"}}}})}ngOnInit(){let a=this.timelineData().ciStats;this.lineChartData().datasets=[],this.lineChartData().labels=[],this.title=this.timelineData().name,this.lineChartData().datasets.push({data:a.map(i=>i.scriptsPass+i.scriptsDispo),backgroundColor:"#33A346",borderColor:"#33A346",pointBackgroundColor:"#33A346",fill:"origin"}),this.lineChartData().datasets.push({data:a.map(i=>i.scriptsFail),backgroundColor:"#C34F37",borderColor:"#C34F37",pointBackgroundColor:"#C34F37",fill:"origin"}),this.lineChartData().labels=a.map(i=>O(new Date(i.scriptsExecutionDate),"yyyy-MM-dd'T'HH:mm:ss.SSSxxx"))}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=h({type:e,selectors:[["osee-timeline-chart"]],inputs:{timelineData:[v.SignalBased,"timelineData"]},standalone:!0,features:[C],decls:5,vars:4,consts:[[1,"tw-text-center"],[1,"tw-text-lg","tw-font-bold"],["baseChart","",3,"data","type","options"]],template:function(i,l){i&1&&(s(0,"div",0)(1,"mat-label",1),m(2),r()(),s(3,"div"),d(4,"canvas",2),r()),i&2&&(o(2),T(l.title),o(2),f("data",l.lineChartData())("type","line")("options",l.lineChartOptions()))},dependencies:[N,E,k,M],encapsulation:2,changeDetection:0});let t=e;return t})();function j(t,e){t&1&&m(0," No data available for the selected branch and CI Set ")}function q(t,e){if(t&1&&d(0,"osee-timeline-chart",3),t&2){let n=e.$implicit;f("timelineData",n)}}function R(t,e){if(t&1&&(s(0,"h2",1),m(1,"Test Scripts Pass/Fail"),r(),s(2,"div",2),S(3,q,1,1,"osee-timeline-chart",3,y),r()),t&2){let n=g();o(3),x(n)}}function Z(t,e){if(t&1&&p(0,j,1,0)(1,R,5,0),t&2){let n=e;c(0,n.length===0?0:-1),o(),c(1,n.length>0?1:-1)}}function $(t,e){t&1&&m(0," Loading... ")}function z(t,e){if(t&1&&(s(0,"div",0),p(1,Z,2,2),w(2,"async"),p(3,$,1,0),r()),t&2){let n,a=g();o(),c(1,(n=F(2,1,a.timelineStats))?1:3,n)}}var ft=(()=>{let e=class e{constructor(){this.uiService=u(A),this.dashboardService=u(H),this.timelineStats=this.dashboardService.timelineStats,this.branchId=b(this.uiService.branchId),this.branchType=b(this.uiService.branchType)}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=h({type:e,selectors:[["osee-timelines"]],standalone:!0,features:[C],decls:2,vars:1,consts:[[1,"tw-px-4","tw-pb-4"],[1,"tw-font-bold"],[1,"tw-flex","tw-flex-wrap","tw-gap-8"],[1,"tw-h-52","tw-w-full","tw-pb-12",3,"timelineData"]],template:function(i,l){i&1&&(d(0,"osee-ci-dashboard-controls"),p(1,z,4,3,"div",0)),i&2&&(o(),c(1,l.branchId()&&l.branchType()?1:-1))},dependencies:[I,B,L],encapsulation:2,changeDetection:0});let t=e;return t})();export{ft as default};
