Your IP : 3.144.104.136
import{b as U,c as A}from"./chunk-KOPGM7TY.js";import{$a as F,Bb as x,Cb as E,M as D,Sa as w,_a as P,ba as $,c as k,cc as N,d as y,f as j,k as M,l as T,oa as I,qc as O,y as C}from"./chunk-SXUPRFOU.js";import{A as l,G as h,O as d,S as g,ba as S,ia as b,ma as v,q as u,s as p,t as f,ta as o,xa as c}from"./chunk-ERDNNTNA.js";var L=1e3,W=1500,n=(()=>{let t=class t{constructor(i){this.api5Service=i,this.repeat$=new p,this.finish$=new p}observeTaskProgress(i){let e=0;return d(W).pipe(v(()=>this.repeat$.pipe(S(L))),o(()=>this.api5Service.progress(i)),c(()=>e++),c(r=>{if(!(!r||r.ok?.$reason==="noprogress"||r.ok&&e>1)){this.repeat$.next();return}this.finish$.next(r)}))}};t.\u0275fac=function(e){return new(e||t)(j(N))},t.\u0275prov=k({token:t,factory:t.\u0275fac});let s=t;return s})();var st=(()=>{let t=class t{set tab(i){this.tabSubject.next(i)}get tab(){return this.tabSubject.value}constructor(i){this.progressTaskService=i,this.tabSubject=new f(null),this.finish=new C,this.modalState$=this.tabSubject.pipe(g(e=>!!e),o(e=>e.state.progressIdSubject.pipe(o(r=>r?this.progressTaskService.observeTaskProgress(r):l(null)),h(r=>r?this.getModalStateFromProgressResponse(r):null),b(e.state.progressModalStateSubject),u()))),this.progressTaskService.finish$.pipe(O()).subscribe(e=>{this.finish.emit(e)})}getModalStateFromProgressResponse(i){let e=i.comment?.$;if(!e)return null;let r=i.steps?.$,m=i.done?.$,R=parseInt(r),a=parseInt(m)/R*100;return isNaN(a)||a>100?{comment:e,percent:100,percentDisplay:!0}:{comment:e,percent:Math.round(a),percentDisplay:!0}}};t.\u0275fac=function(e){return new(e||t)(D(n))},t.\u0275cmp=M({type:t,selectors:[["isp-progress-task-modal"]],inputs:{tab:"tab"},outputs:{finish:"finish"},features:[w([n])],decls:2,vars:3,consts:[[3,"state"]],template:function(e,r){e&1&&(I(0,"isp-progress-modal",0),P(1,"async")),e&2&&$("state",F(1,1,r.modalState$))},dependencies:[U,x],encapsulation:2,changeDetection:0});let s=t;return s})();var mt=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=T({type:t}),t.\u0275inj=y({imports:[E,A]});let s=t;return s})();export{st as a,mt as b};