"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/task-progress-bar"],{1384:(e,s,r)=>{r.r(s),r.d(s,{TaskProgressBarItemContent:()=>u});var t=r(703),n=r.n(t),o=r(209),i=r(210),a=r.n(i),l=r(88),p=r(208);const u=({title:e,progress:s,output:r,errors:t,refresh:n})=>{const i=[];return e&&(e=(0,p.jsx)("span",{dangerouslySetInnerHTML:{__html:e}},"title")),s?i.push((0,p.jsx)(o.Progress,{children:(0,p.jsx)(o.ProgressStep,{title:e,status:"running",progress:s.value,statusText:void 0!==s.value?`${s.value}%`:void 0,children:s.onClick&&(0,p.jsx)(o.Link,{onClick:s.onClick,children:(0,p.jsx)(o.Translate,{content:"progressDialogLink"})})})},"progress")):(i.push(e),r&&i.push((0,p.jsx)(o.Text,{component:"ul",intent:"muted",fontSize:"sm",className:"task-progress-bar-item__output",children:r.map(((e,s)=>(0,p.jsx)("li",{children:e},s.toString())))},"output")),t&&i.push((0,p.jsx)(o.Text,{component:"ul",intent:"muted",fontSize:"sm",className:"task-progress-bar-item__output",children:t.map(((e,s)=>(0,p.jsx)("li",{children:e},s.toString())))},"errors")),n&&i.push((0,p.jsx)(o.Link,{onClick:n.onClick,component:o.Text,fontSize:"sm",children:n.title||(0,p.jsx)(o.Translate,{content:"refresh"})},"refresh"))),(0,p.jsx)("div",{className:"task-progress-bar-item__content",children:i})};u.propTypes={title:a().string,progress:a().shape({value:a().number,onClick:a().func}),output:a().arrayOf(a().string),errors:a().arrayOf(a().string),refresh:a().shape({title:a().string,onClick:a().func.isRequired})},u.defaultProps={title:void 0,progress:void 0,output:void 0,errors:void 0,refresh:void 0};const c=({items:e,isOpen:s})=>{const r=[];return e.forEach((e=>{e instanceof l.Task.ProgressBar.Item&&r.push((e=>{const{key:s,intent:r,onClose:t,...o}=e.toToast();return{key:s,intent:r,onClose:t,message:(0,p.jsx)(u,{...o}),closable:!o.progress,className:n()("task-progress-bar-item",{[`task-progress-bar-item--${r}`]:r})}})(e))})),s?(0,p.jsx)(o.Toaster,{id:"asyncProgressBar",position:"bottom-end",toasts:r}):null};c.propTypes={items:a().array.isRequired,isOpen:a().bool.isRequired},s.default=c},1383:(e,s,r)=>{r.r(s);var t=r(208),n=r(209),o=r(1384);s.default=({locale:e,container:s,...r})=>{(0,t.render)((0,t.jsx)(n.LocaleProvider,{messages:e,children:(0,t.jsx)(o.default,{...r})}),s)}}}]);
//# sourceMappingURL=task-progress-bar.js.map?6b78865cccd5f357bfbc