(self.webpackChunk_mlflow_mlflow=self.webpackChunk_mlflow_mlflow||[]).push([[9531],{46858:function(t,e,a){"use strict";a.r(e),a.d(e,{default:function(){return p}});var r=a(31014),s=a(83314),n=a(82589),o=a(68254),i=a(77484),d=a(76010),c=a(52350),h=a(8220),u=a(57596),l=a(50111);s.Uy.GlobalWorkerOptions.workerSrc="./static-files/pdf.worker.js";class f extends r.Component{constructor(){super(...arguments),this.state={loading:!0,error:void 0,pdfData:void 0,currentPage:1,numPages:1},this.onDocumentLoadSuccess=t=>{let{numPages:e}=t;this.setState({numPages:e})},this.onDocumentLoadError=t=>{d.A.logErrorAndNotifyUser(new c.s(t))},this.onPageChange=(t,e)=>{this.setState({currentPage:t})},this.renderPdf=()=>(0,l.Y)(r.Fragment,{children:(0,l.FD)("div",{className:"pdf-viewer",children:[(0,l.Y)("div",{className:"paginator",children:(0,l.Y)(n.dKS,{simple:!0,currentPageIndex:this.state.currentPage,numTotal:this.state.numPages,pageSize:1,onChange:this.onPageChange,dangerouslySetAntdProps:{simple:!0}})}),(0,l.Y)("div",{className:"document",children:(0,l.Y)(s.yo,{file:this.state.pdfData,onLoadSuccess:this.onDocumentLoadSuccess,onLoadError:this.onDocumentLoadError,loading:(0,l.Y)(o.S,{}),children:(0,l.Y)(s.YW,{pageNumber:this.state.currentPage,loading:(0,l.Y)(o.S,{})})})})]})})}fetchPdf(){const t=(0,i.To)(this.props.path,this.props.runUuid);this.props.getArtifact(t).then((t=>{this.setState({pdfData:{data:t},loading:!1})})).catch((t=>{this.setState({error:t,loading:!1})}))}componentDidMount(){this.fetchPdf()}componentDidUpdate(t){this.props.path===t.path&&this.props.runUuid===t.runUuid||this.fetchPdf()}render(){return this.state.loading?(0,l.Y)(h.$,{className:"artifact-pdf-view-loading"}):this.state.error?(0,l.Y)(u.F,{className:"artifact-pdf-view-error"}):(0,l.Y)("div",{className:"pdf-outer-container",children:this.renderPdf()})}}f.defaultProps={getArtifact:i.xC};var p=f},23237:function(){},97492:function(){},31815:function(){},82787:function(){}}]);