(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/progress-dialog"],{1178:(e,t,r)=>{"use strict";r.r(t);var s=r(152),n=r.n(s),a=r(154),o=r(153),l=r(260),i=r.n(l);const c="error",u="running";class p extends o.Component{renderErrors(e){return Array.isArray(e)&&0!==e.length?(0,o.createElement)(a.Alert,{intent:"danger"},(0,o.createElement)(a.Media,{image:(0,o.createElement)(a.Status,{intent:"danger"})},(0,o.createElement)("ul",{"data-type":"errors"},e.map((e=>(0,o.createElement)("li",{key:e},e)))))):null}renderStatusText({status:e,progress:t,progressStatus:r}){const s={done:"statusDone",[c]:"statusError",not_started:"statusNotStarted",canceled:"statusCanceled"};return e===u&&r?r:e===u&&-1!==t?(0,o.createElement)(a.Translate,{content:"percentCompleted",params:{percent:t}}):s[e]?(0,o.createElement)(a.Translate,{content:s[e]}):null}render(){const{title:e,steps:t,isOpen:r,errors:s,onComplete:l,onHide:i,...u}=this.props,p=0===Object.keys(t).filter((e=>t[e].status===c)).length;return(0,o.createElement)(a.ProgressDialog,n()({title:e,actions:i?(0,o.createElement)(a.Action,{onClick:i},(0,o.createElement)(a.Translate,{content:"minimize"})):null,cancelTitle:(0,o.createElement)(a.Translate,{content:"close","data-type":"close-button"}),isOpen:r,onFinish:l,onClose:i,"data-type":"progress-dialog"},u),Object.keys(t).map(((e,r)=>{const{title:n,icon:l,status:i,progressStatus:u,errors:d}=t[e],m=Number(t[e].progress);return(0,o.createElement)(a.ProgressStep,{key:e,title:n,icon:{src:l},status:i,statusText:this.renderStatusText({status:i,progress:m,progressStatus:u}),progress:m},this.renderErrors(Array.isArray(d)&&d.length?d:i===c||p&&Object.keys(t).length-1===r?s:[]))})))}}p.propTypes={title:i().node.isRequired,steps:i().object.isRequired,isOpen:i().bool.isRequired,errors:i().array.isRequired,onComplete:i().func.isRequired,onHide:i().func.isRequired},t.default=p},1177:(e,t,r)=>{"use strict";r.r(t);var s=r(154),n=r(153),a=r(1178);t.default=({locale:e,container:t,...r})=>{(0,n.render)((0,n.createElement)(s.LocaleProvider,{messages:e},(0,n.createElement)(a.default,r)),t)}}}]);
//# sourceMappingURL=progress-dialog.js.map?f45daa3592093cd948d8