"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[98876,71212,50194,97120],{32831:function(e,t,n){n.d(t,{Z:function(){return h}});var r=n(82242),A=n.n(r),o=n(7557),a=n.n(o),s=n(41498),c=n.n(s),u=n(79800),i=n.n(u),g=n(59301),l={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},f=n(3113),C=n(70557),E=n(63631),p=n(6848),I=n(83287),d=n(94280),B=n(13767),Q=n(91689),v=n(37712),h=function(e){var t,n,r,o,s,u,h,m=e.editOffice,x=void 0===m?"view":m,y=e.data,k=(e.theme,e.type),w=e.filename,R=e.monacoEditor,b=e.className,N=e.style,D=e.close,L=e.onClose,P=e.hasMask,H=e.disabledDownload,j=e.onImgDimensions,K=e.showNodata,S=(0,g.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),T=i()(S,2),M=(T[0],T[1],(0,g.useState)("")),Z=i()(M,2),F=(Z[0],Z[1]),Y=(0,g.useState)(),U=i()(Y,2),X=U[0],V=U[1],O="build"===window.ENV?"/react/build":"",G=location.host.startsWith("localhost")?Q.Z.PROXY_SERVER:Q.Z.API_SERVER,q=(0,g.useRef)();null!==(t=y)&&void 0!==t&&t.startsWith("/api")&&"txt"!==k&&(y=Q.Z.API_SERVER+y),w&&(R.filename=w),(0,g.useEffect)((function(){var e,t=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==t||t.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&F(t[1])}))}),[]),(0,g.useEffect)((function(){"office"===k&&W()}),[k,y]);var W=function(){var e=c()(a()().mark((function e(){var t,n,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=y,y.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=5,(0,d.gJ)({attachment_id:n});case 5:r=e.sent,V(r);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),z=function(){J()},J=function(){(0,I.Nd)(w||"educoder",decodeURIComponent(y))};return(0,v.jsxs)("div",{style:A()({},N||{}),className:"".concat(P&&l.bgBlack," ").concat(k?l.wrp:"hide"),children:[D&&(0,v.jsxs)("div",{className:l.close,ref:q,children:[!!j&&(0,v.jsx)(p.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return q.current},children:(0,v.jsx)("span",{onClick:function(){L(),j()},children:(0,v.jsx)("i",{className:"icon-yulanpizhu"})})}),!H&&(0,v.jsx)(p.Z,{title:"点击下载此文件",getPopupContainer:function(){return q.current},children:(0,v.jsx)("span",{onClick:J,children:(0,v.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,v.jsx)(p.Z,{title:"关闭",getPopupContainer:function(){return q.current},children:(0,v.jsx)("span",{className:"",onClick:L,children:(0,v.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,v.jsx)("div",{className:"".concat(l[b]," ").concat(b," ").concat(l.monaco," ").concat("txt"===k?"show":"hide"),children:"txt"===k&&(0,v.jsx)(E.ZP,A()({},R))}),"audio"===k&&(0,v.jsx)("audio",{src:(null===(n=y)||void 0===n?void 0:n.indexOf("http"))>-1||null!==(r=y)&&void 0!==r&&r.startsWith("/api")?y:"data:image/png;base64,".concat(y),autoPlay:!0}),"video"===k&&(0,v.jsx)(v.Fragment,{children:(null===(o=y)||void 0===o?void 0:o.indexOf("http"))>-1||null!==(s=y)&&void 0!==s&&s.startsWith("/api")?(0,v.jsx)("video",{controls:!0,src:"".concat(y),autoPlay:!0}):(0,v.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(y),autoPlay:!0})}),"office"===k&&X&&(0,v.jsx)("iframe",{src:"".concat(O,"/office.html?key=").concat(X.key,"&url=").concat(G+X.url,"&callbackUrl=").concat(G+X.callbackUrl,"&fileType=").concat(X.fileType,"&title=").concat(X.title,"&model=").concat(x,"&officeServer=").concat(Q.Z.ONLYOFFICE,"&disabledDownload=").concat(!!H)}),"html"===k&&(0,v.jsx)("iframe",{src:y+"&disposition=inline"}),"pdf"===k&&(0,v.jsx)("iframe",{src:"".concat(O,"/js/pdfview/index.html?url=").concat(y,"&disabledDownload=").concat(!!H)}),"image"===k&&(0,v.jsx)("img",{src:(null===(u=y)||void 0===u?void 0:u.indexOf("http"))>-1||null!==(h=y)&&void 0!==h&&h.startsWith("/api")?y:"data:image/png;base64,".concat(y)}),("other"===k||"download"===k)&&(0,v.jsx)(v.Fragment,{children:K?(0,v.jsx)(B.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,v.jsx)(f.ZP,{icon:(0,v.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:z,children:"下载"})}):(0,v.jsxs)(f.ZP,{type:"primary",size:"middle",onClick:z,children:[(0,v.jsx)(C.Z,{}),"点击下载"]})})]})}},71212:function(e,t,n){n.d(t,{Z:function(){return U}});var r=n(82242),A=n.n(r),o=n(37205),a=n.n(o),s=n(91232),c=n.n(s),u=n(79800),i=n.n(u),g=n(59301),l=(n(88831),n(32834)),f=n.n(l),C=n(11690);var E=[],p=["