import{a as f}from"./chunk-CZA53JXZ.js";import{a as u}from"./chunk-EDFYBFRY.js";import{b as d}from"./chunk-R5GBW5HQ.js";import{B as c,S as i,ba as m,md as p,p as r,pd as h,va as l,ya as a}from"./chunk-3NIPUOIR.js";var g=class extends u{constructor(){super(...arguments),this.workflowName="",this.documentName="",this.status="",this.documentId=""}};var w=class{get count(){return this._count}constructor(n){this.workflowLogService=n,this.workflowLogSubject=new r([]),this.responseHeaderSubject=new r(null),this.loadingSubject=new r(!1),this.loading$=this.loadingSubject.asObservable(),this._count=0,this.responseHeaderSubject$=this.responseHeaderSubject.asObservable()}connect(){return this.workflowLogSubject.asObservable()}disconnect(){this.workflowLogSubject.complete(),this.loadingSubject.complete()}loadWorkflowLogs(n){this.loadingSubject.next(!0),this.workflowLogService.getWorkflowLogs(n).pipe(i(()=>c([])),m(()=>this.loadingSubject.next(!1))).subscribe(t=>{let e=new f;e.pageSize=parseInt(t.headers.get("pageSize")),e.totalCount=parseInt(t.headers.get("totalCount")),e.skip=parseInt(t.headers.get("skip")),this.responseHeaderSubject.next(e);let s=t.body?[...t.body]:[];this._count=s.length,this.workflowLogSubject.next(s)})}};var E=(()=>{class o{constructor(t,e){this.httpClient=t,this.commonHttpErrorService=e}getWorkflowLogs(t){let e="workflow-logs",s=new p().set("fields",t.fields).set("orderBy",t.orderBy).set("pageSize",t.pageSize.toString()).set("skip",t.skip.toString()).set("searchQuery",t.searchQuery).set("documentName",t.documentName).set("workflowName",t.workflowName).set("status",t.status).set("documentId",t.documentId?t.documentId:"");return this.httpClient.get(e,{params:s,observe:"response"}).pipe(i(this.commonHttpErrorService.handleError))}static{this.\u0275fac=function(e){return new(e||o)(a(h),a(d))}}static{this.\u0275prov=l({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{g as a,w as b,E as c};
