"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/progress-dialog"],{1316:(e,s,t)=>{t.r(s);var r=t(209),n=t(208),o=t(210),a=t.n(o),i=t(88);const l="error",c="running";class u extends n.Component{renderErrors(e,s){if(!Array.isArray(s)||0===s.length)return null;const t=e===l?"danger":"warning";return(0,n.jsx)(r.Alert,{intent:t,children:(0,n.jsx)(r.Media,{image:(0,n.jsx)(r.Status,{intent:t}),children:(0,n.jsx)("ul",{"data-type":"errors",children:s.map((e=>(0,n.jsx)("li",{children:e},e)))})})})}renderStatusText({status:e,progress:s,progressStatus:t}){const o={done:"statusDone",[l]:"statusError",not_started:"statusNotStarted",canceled:"statusCanceled"};return e===c&&t?t:e===c&&-1!==s?(0,n.jsx)(r.Translate,{content:"percentCompleted",params:{percent:s}}):o[e]?(0,n.jsx)(r.Translate,{content:o[e]}):null}render(){const{title:e,steps:s,isOpen:t,errors:o,onComplete:a,onHide:c,...u}=this.props,d=0===Object.keys(s).filter((e=>s[e].status===l)).length;return(0,n.jsx)(r.ProgressDialog,{title:(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:e}}),actions:c?(0,n.jsx)(r.Button,{"aria-label":i.Locale.getSection("components.tasks.common").lmsg("minimize"),ghost:!0,size:"lg",icon:"minimize",onClick:c}):null,cancelTitle:(0,n.jsx)(r.Translate,{content:"close","data-type":"close-button"}),isOpen:t,onFinish:a,onClose:c,"data-type":"progress-dialog",...u,children:Object.keys(s).map(((e,t)=>{const{title:a,icon:i,status:c,progressStatus:u,errors:p}=s[e],g=Number(s[e].progress);return(0,n.jsx)(r.ProgressStep,{title:a,icon:{src:i},status:c,statusText:this.renderStatusText({status:c,progress:g,progressStatus:u}),progress:g,children:this.renderErrors(c,Array.isArray(p)&&p.length?p:c===l||d&&Object.keys(s).length-1===t?o:[])},e)}))})}}u.propTypes={title:a().node.isRequired,steps:a().object.isRequired,isOpen:a().bool.isRequired,errors:a().array.isRequired,onComplete:a().func.isRequired,onHide:a().func.isRequired},s.default=u},1315:(e,s,t)=>{t.r(s);var r=t(209),n=t(208),o=t(1316);s.default=({locale:e,container:s,...t})=>{(0,n.render)((0,n.jsx)(r.LocaleProvider,{messages:e,children:(0,n.jsx)(o.default,{...t})}),s)}}}]);
//# sourceMappingURL=progress-dialog.js.map?6df66b8f473732c0e544