"use strict";(self.webpackChunkseahub_frontend=self.webpackChunkseahub_frontend||[]).push([[1226],{86848:function(e,t,n){var r=n(23029),s=n(92901),a=n(39874),o=n(85501),i=n(9950),u=n(1352),c=n(97011),d=n(40326),f=n(88204),l=n(15167),h=n(9961),p=n(9223),v=(n(20479),n(44414)),g=window.shared.pageOptions,m=g.repoID,k=g.filePath,w=g.err,j=g.commitID,b=g.fileType,x=g.sharedToken,y=function(e){function t(){return(0,r.default)(this,t),(0,a.default)(this,t,arguments)}return(0,o.default)(t,e),(0,s.default)(t,[{key:"render",value:function(){return(0,v.jsx)(f.A,{content:(0,v.jsx)(S,{})})}}])}(i.Component),S=function(e){function t(e){var n;return(0,r.default)(this,t),(n=(0,a.default)(this,t,[e])).state={isLoading:!w,errorMsg:""},n}return(0,o.default)(t,e),(0,s.default)(t,[{key:"componentDidMount",value:function(){var e=this;if(!w){var t=function(){c.e.queryOfficeFileConvertStatus(m,j,k,b.toLowerCase(),x).then((function(n){switch(n.data.status){case"PROCESSING":e.setState({isLoading:!0}),setTimeout(t,2e3);break;case"ERROR":e.setState({isLoading:!1,errorMsg:(0,d.APU)("Document conversion failed.")});break;case"DONE":e.setState({isLoading:!1,errorMsg:""});var r=document.createElement("script");r.type="text/javascript",r.src="".concat(d.SGU,"js/pdf/web/viewer.js"),document.body.append(r)}})).catch((function(t){t.response?e.setState({isLoading:!1,errorMsg:(0,d.APU)("Document conversion failed.")}):e.setState({isLoading:!1,errorMsg:(0,d.APU)("Please check the network.")})}))};t()}}},{key:"render",value:function(){var e=this.state,t=e.isLoading,n=e.errorMsg;return w?(0,v.jsx)(l.A,{}):t?(0,v.jsx)(h.A,{}):n?(0,v.jsx)(l.A,{errorMsg:n}):(0,v.jsx)("div",{className:"shared-file-view-body pdf-file-view",children:(0,v.jsx)(p.A,{})})}}])}(i.Component);(0,u.createRoot)(document.getElementById("wrapper")).render((0,v.jsx)(y,{}))}},function(e){e.O(0,[4223],(function(){return t=86848,e(e.s=t);var t}));e.O()}]);