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