(self.webpackChunk=self.webpackChunk||[]).push([[49716],{43501:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1565),i=n(59301),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},a=n(68475),o=function(e,t){return i.createElement(a.Z,(0,r.Z)({},e,{ref:t,icon:c}))};var s=i.forwardRef(o)},89136:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1565),i=n(59301),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},a=n(68475),o=function(e,t){return i.createElement(a.Z,(0,r.Z)({},e,{ref:t,icon:c}))};var s=i.forwardRef(o)},53547:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1565),i=n(59301),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},a=n(68475),o=function(e,t){return i.createElement(a.Z,(0,r.Z)({},e,{ref:t,icon:c}))};var s=i.forwardRef(o)},7406:function(e,t,n){"use strict";var r=n(82242),i=n.n(r),c=(n(59301),n(93314)),a=n(3113),o=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,r=void 0===n?{}:n,s=e.styles,l=void 0===s?{}:s,u=e.customText,d=e.ButtonText,f=e.ButtonClick,p=e.Buttonclass,h=e.ButtonTwo,v=e.imgStyles,m=e.loading,x=void 0!==m&&m;return(0,o.jsxs)("section",{className:"tc animated fadeIn",style:i()(i()({},{color:"#999",margin:"100px auto",visibility:x?"hidden":"visible"}),l),children:[(0,o.jsx)("img",{src:t||c,style:i()(i()({},v),{},{pointerEvents:"none",userSelect:"none"})}),(0,o.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,o.jsx)(a.ZP,i()(i()({className:p,onClick:f},r),{},{children:d})),h&&h]})}},84143:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(82242),i=n.n(r),c=n(7557),a=n.n(c),o=n(41498),s=n.n(o),l=n(79800),u=n.n(l),d=n(59301),f={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},p=n(3113),h=n(74516),v=n(94049),m=n(6848),x=n(6457),g=n(83),_=n(7406),y=n(27065),j=n(6288),b=n(37712),E=function(e){var t,n,r,c,o,l,E=e.editOffice,C=void 0===E?"view":E,w=e.data,A=(e.theme,e.type),N=e.filename,O=e.monacoEditor,I=e.className,S=e.style,T=e.close,k=e.onClose,Z=e.hasMask,B=e.disabledDownload,L=e.onImgDimensions,P=e.showNodata,R=e.recordInfo,F=(0,d.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),M=u()(F,2),U=(M[0],M[1],(0,d.useState)("")),z=u()(U,2),D=(z[0],z[1]),H=(0,d.useState)(),V=u()(H,2),q=V[0],X=V[1],$="build"===window.ENV?"/react/build":"",W=location.host.startsWith("localhost")?y.Z.PROXY_SERVER:y.Z.API_SERVER,Y=(0,d.useRef)();null!==(t=w)&&void 0!==t&&t.startsWith("/api")&&"txt"!==A&&(w=y.Z.API_SERVER+w);N&&(O.filename=N),(0,d.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]&&D(t[1])}))}),[]),(0,d.useEffect)((function(){var e;"office"===A&&(w.indexOf("bigfilescdn.")>-1||w.indexOf("bigfiles1")>-1?X({url:w,fileType:(e=w,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:w.indexOf("model=edit")?"edit":"view"}):J())}),[A,w]);var J=function(){var e=s()(a()().mark((function e(){var t,n,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",w),t=w,w.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,g.gJ)({attachment_id:n});case 6:(r=e.sent).url=W+r.url,X(r);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){w.startsWith("http")||w.startsWith("blob:")?Q():(0,x.Sv)(N||"educoder",w,N)},Q=function(){R&&(0,j.fc)({id:null==R?void 0:R.id,watch_type:1,course_id:null==R?void 0:R.course_id}),(0,x.Nd)(N||"educoder",decodeURIComponent(w))};return(0,b.jsxs)("div",{style:i()({},S||{}),className:"".concat(Z&&f.bgBlack," ").concat(A?f.wrp:"hide"),children:[T&&(0,b.jsxs)("div",{className:f.close,ref:Y,children:[!!L&&(0,b.jsx)(m.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return Y.current},children:(0,b.jsx)("span",{onClick:function(){k(),L()},children:(0,b.jsx)("i",{className:"icon-yulanpizhu"})})}),!B&&(0,b.jsx)(m.Z,{title:"点击下载此文件",getPopupContainer:function(){return Y.current},children:(0,b.jsx)("span",{onClick:Q,children:(0,b.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,b.jsx)(m.Z,{title:"关闭",getPopupContainer:function(){return Y.current},children:(0,b.jsx)("span",{className:"",onClick:k,children:(0,b.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,b.jsx)("div",{className:"".concat(f[I]," ").concat(I," ").concat(f.monaco," ").concat("txt"===A?"show":"hide"),children:"txt"===A&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(v.ZP,i()({},O))})}),"audio"===A&&(0,b.jsx)("audio",{src:"".concat((null===(n=w)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(r=w)||void 0===r?void 0:r.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(w),autoPlay:!0}),"video"===A&&(0,b.jsx)(b.Fragment,{children:(null===(c=w)||void 0===c?void 0:c.indexOf("http"))>-1?(0,b.jsx)("video",{controls:!0,src:"".concat(w),autoPlay:!0}):(0,b.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(w),autoPlay:!0})}),"office"===A&&q&&(0,b.jsx)("iframe",{src:"".concat($,"/office.html?key=").concat(q.key,"&url=").concat(btoa(q.url),"&callbackUrl=").concat(W+q.callbackUrl,"&fileType=").concat(q.fileType,"&title=").concat(q.title,"&model=").concat(C,"&officeServer=").concat(y.Z.ONLYOFFICE,"&disabledDownload=").concat(!!B)}),"html"===A&&(0,b.jsx)("iframe",{src:w+"&disposition=inline"}),"pdf"===A&&(0,b.jsx)("iframe",{src:"".concat($,"/js/pdfview/index.html?url=").concat(w,"&disabledDownload=").concat(!!B)}),"image"===A&&(0,b.jsx)("img",{src:"".concat((null===(o=w)||void 0===o?void 0:o.indexOf("http://"))>-1||(null===(l=w)||void 0===l?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(w)}),("other"===A||"download"===A)&&(0,b.jsx)(b.Fragment,{children:P?(0,b.jsx)(_.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,b.jsx)(p.ZP,{icon:(0,b.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:K,children:"下载"})}):(0,b.jsxs)(p.ZP,{type:"primary",size:"middle",onClick:K,children:[(0,b.jsx)(h.Z,{}),"点击下载"]})})]})}},42783:function(e,t,n){"use strict";var r=n(82242),i=n.n(r),c=n(37205),a=n.n(c),o=n(91232),s=n.n(o),l=n(79800),u=n.n(l),d=n(59301),f=(n(98253),n(55369)),p=(n(64018),n(63824)),h=n(27065),v=n(15342),m=n(1012),x=n(84143),g=n(37712),_="@▁@",y=/]*>/g;t.Z=function(e){var t=e.value,n=void 0===t?"":t,r=e.className,c=e.showTextOnly,o=e.showLines,l=e.style,j=void 0===l?{}:l,b=e.stylesPrev,E=void 0===b?{}:b,C=e.highlightKeywords,w=e.showProgramFill,A=(e.isProgramFill,e.disabledFill),N=void 0!==A&&A,O=e.programFillValue,I=e.onFillChange,S=void 0===I?function(e){}:I,T=e.onFillBlur,k=void 0===T?function(){}:T,Z=String(n),B=(0,d.useState)(""),L=u()(B,2),P=L[0],R=L[1],F=(0,d.useState)("office"),M=u()(F,2),U=M[0],z=M[1],D=(0,d.useState)([]),H=u()(D,2),V=H[0],q=H[1],X=(0,d.useRef)("a"+(0,m.Z)()),$={},W=function(e){return e.replace(/([\s\S]+?)<\/style>/gim,(function(e,t){var n=t.replace(/(\n|\r)/g,"").split("}"),r=[];return n.map((function(e){""!=e&&r.push(".".concat(X.current," ").concat(e))})),"")}))},Y=(0,d.useMemo)((function(){try{Z=Z.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+h.Z.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+h.Z.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+h.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n")}catch(e){}if(w){var e=-1;return Z=Z.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,(function(t,n,r){var i;return function(e,t,n){var r=document.createElement(e===_?"input":"textarea");r.style.width="100%",r.style.height=e===_?"40px":"151px",r.rows=5,r.spellcheck=!1,r.name="edu-program-fill",r.placeholder="请输入",r.dataset.id=t;var i=Object.keys($).length;return $[i]=r,'')}(t,++e,null==O||null===(i=O[e])||void 0===i?void 0:i.value)})),'
'.concat(W(Z||""),"
")}var t=W(Z);t=(0,f.ZP)(t);var n=(0,f.ez)();Z.match(/\[TOC\]/)&&(t=t.replace("

[TOC]

",(0,f.Qv)()),(0,f.Iy)()),t=t.replace(/(__special_katext_id_\d+__)/g,(function(e,t){var r=n[t],i=r.type,c=r.expression;return(0,v.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(c)||"",{displayMode:"block"===i,throwOnError:!1,output:"html"})})),t=t.replace(/▁/g,"▁▁▁▁▁"),(0,f.AL)();var r=document.createElement("div");return r.innerHTML=t,C?(Q(r,C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r.innerHTML):c?r.innerText:(setTimeout((function(){return te()}),500),r.innerHTML)}),[Z,C]);(0,d.useEffect)((function(){G.current&&G.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=J,e.onblur=K}))}),[V]),(0,d.useEffect)((function(){if(null!=O&&O.length)try{var e,t=G.current.querySelectorAll(".edu-program-fill-score"),n=G.current.querySelectorAll('[name="edu-program-fill"]'),r=s()(n.entries());try{for(r.s();!(e=r.n()).done;){var i,c,a,o=u()(e.value,2),l=o[0],d=o[1];d.value=(null==O||null===(i=O[l])||void 0===i?void 0:i.value)||"","warning"===(null==O||null===(c=O[l])||void 0===c?void 0:c.type)?d.className="program-fill-warning":"success"===(null==O||null===(a=O[l])||void 0===a?void 0:a.type)?d.className="program-fill-success":d.className=""}}catch(e){r.e(e)}finally{r.f()}var f,p=s()(t.entries());try{for(p.s();!(f=p.n()).done;){var h,v,m=u()(f.value,2),x=m[0];m[1].innerHTML=null!=O&&null!==(h=O[x])&&void 0!==h&&h.score?"".concat(null==O||null===(v=O[x])||void 0===v?void 0:v.score,"分"):""}}catch(e){p.e(e)}finally{p.f()}q(O)}catch(e){console.log(e,"error")}}),[O]);var J=function(e){V[e.target.dataset.id]=V[e.target.dataset.id]||{},V[e.target.dataset.id].value=e.target.value,q(a()(V)),S(V,e.target.dataset.id)},K=function(e){V[e.target.dataset.id]=V[e.target.dataset.id]||{},V[e.target.dataset.id].value=e.target.value,q(a()(V)),k(V,e.target.dataset.id)};function Q(e,t){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)Q(e,t);else if("IMG"!==e.nodeName)if(e.innerHTML){var n;e.innerHTML=null===(n=e.innerHTML)||void 0===n?void 0:n.replace(new RegExp(t,"gi"),'$&')}else{var r=document.createElement("span");r.innerHTML=e.textContent.replace(new RegExp(t,"gi"),'$&'),e.replaceWith(r)}}))}var G=(0,d.useRef)();function ee(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var n=t.getAttribute("href");if(n.indexOf("office")>-1)e.preventDefault(),R(n),z("office");else if(n.indexOf("application/pdf")>-1)e.preventDefault(),R(n),z("pdf");else if(n.indexOf("text/html")>-1)e.preventDefault(),R(n),z("html");else if(n.startsWith("#")){e.preventDefault();var r=document.getElementById(n.replace("#",""));r&&r.scrollIntoView(!0)}}}f.jb.WebkitLineClamp=o,o&&(j=i()(i()({},j),f.jb));var te=function(){var e,t=null===(e=G.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(p.ZP.isSupported()){var t=new p.ZP;t.loadSource(e.src),t.attachMedia(e)}}))};return(0,d.useEffect)((function(){if(G.current&&Y&&Y.match(y)&&window.PR.prettyPrint(),G.current)return G.current.addEventListener("click",ee),function(){var e;null===(e=G.current)||void 0===e||e.removeEventListener("click",ee),(0,f.AL)(),(0,f.Iy)()}}),[Y,G.current,ee]),(0,g.jsxs)(g.Fragment,{children:[c&&(0,g.jsx)("div",{ref:G,children:Y}),!c&&(0,g.jsx)("div",{ref:G,style:i()({},j),className:"".concat(r||""," ").concat(N?"disabled-fill":""," markdown-body ").concat(X.current),dangerouslySetInnerHTML:{__html:Y}}),(0,g.jsx)(x.Z,{close:!0,data:P,type:null!=P&&P.length?U:"",style:i()({},E),onClose:function(){return R("")}})]})}},96962:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(7880),i="ldsRing___mpBZC",c="idsRingWrapper___Of9_n",a=n(37712),o=function(e){var t=e.message,n=e.className,o=e.children,s=e.style,l=void 0===s?{}:s;return(0,a.jsxs)("div",{className:"custom-spinner ".concat(c," ").concat(n),children:[(0,a.jsxs)("div",{className:i,children:[(0,a.jsx)("div",{}),(0,a.jsx)("div",{}),(0,a.jsx)("div",{}),(0,a.jsx)("div",{})]}),t?(0,a.jsx)("p",{style:l,children:t}):null,o,(0,a.jsx)(r.Outlet,{})]})}},88549:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});n(59301);var r="result___gu5zt",i="title___xrnx2",c="left___IAxp9",a="leftNode___HL8fG",o="right___ZXYmw",s="rightNode___jYL5_",l=n(92310),u=n.n(l),d=n(37712),f=function(e){var t=e.className,n=e.style,l=void 0===n?{}:n,f=e.leftNode,p=e.leftTitle,h=void 0===p?"自测输入":p,v=e.rightNode,m=e.rightTitle,x=void 0===m?"运行结果":m;return(0,d.jsxs)("div",{className:u()(r,t),style:l,children:[(0,d.jsxs)("div",{className:c,children:[(0,d.jsxs)("div",{className:i,children:[(0,d.jsx)("i",{style:{color:"#08CF76"},className:"iconfont iconfont icon-zidingyiceshiyongli font14 mr5"}),(0,d.jsx)("span",{children:h})]}),(0,d.jsx)("div",{className:a,children:f})]}),(0,d.jsxs)("div",{className:o,children:[(0,d.jsxs)("div",{className:i,children:[(0,d.jsx)("i",{style:{color:"#00DFFF"},className:"iconfont iconfont icon-daimazhihangjieguo font14 mr5"}),(0,d.jsx)("span",{children:x})]}),(0,d.jsx)("div",{className:s,children:v})]})]})}},10226:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return j}});var r=n(7557),i=n.n(r),c=n(41498),a=n.n(c),o=n(79800),s=n.n(o),l=n(59301),u=n(96845),d=n(27065),f=n(7880),p=n(71418),h=n(86314),v=n(26407),m=n(94049),x=n(24334),g=n(99232),_=n.n(g),y=n(37712),j=function(){var e=(0,f.useParams)(),t=e.submitId,n=e.id,r=(0,l.useState)(void 0),c=s()(r,2),o=c[0],g=c[1];console.log((0,f.useLocation)(),33);var j=(0,f.useLocation)();(0,l.useEffect)((function(){return(0,f.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),(0,f.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){(0,f.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),(0,f.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}}),[]),(0,l.useEffect)((function(){document.title="在线刷题"})),(0,l.useEffect)((function(){if(t){var e=function(){var e=a()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,h.X6)(t);case 2:n=e.sent,g(n.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[t]);var b=o||{},E=b.status,C=b.created_at,w=b.code,A=b.name,N=b.language,O=b.pass_sets_count,I=b.set_count,S=b.error_msg,T=b.output,k=b.input,Z=b.expected_output,B=(b.execute_memory,b.user),L=b.execute_time,P=b.input_file_url,R=b.output_file_url,F=b.is_file,M=b.expected_output_file_url;return(0,y.jsx)(p.Z,{spinning:!o,delay:500,children:(0,y.jsx)("div",{className:"record-detail-info",children:o?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("header",{className:u.Z.header,children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("img",{src:"".concat(d.Z.IMG_SERVER,"/images/").concat(B.image_url),alt:"user",width:30}),(0,y.jsx)("span",{children:B.name})]}),(0,y.jsxs)("h2",{children:[" ",A," "]}),(0,y.jsx)("button",{className:"ant-btn",onClick:function(){var e;f.history.push("/problems/".concat(n,"/oj/").concat(null==j||null===(e=j.query)||void 0===e?void 0:e.backId,"?tab=1"))},style:{border:"1px solid #bacffe",color:"#3061d0"},children:"返回该题"})]}),(0,y.jsxs)("div",{className:"record-detail-body",children:[(0,y.jsx)("h2",{children:" 提交记录 "}),(0,y.jsxs)("ul",{className:"record-info",children:[(0,y.jsxs)("li",{children:[" 状态:",(0,y.jsx)("span",{className:0===E?"c-green":"c-red",children:v.Im[E]})," "]}),(0,y.jsxs)("li",{children:[" 提交时间:",(0,y.jsx)("span",{children:_()(C).format("YYYY-MM-DD HH:mm:ss")})," "]}),(0,y.jsxs)("li",{children:[" 语言:",(0,y.jsx)("span",{children:N})," "]}),(0,y.jsxs)("li",{children:[" 执行用时:",(0,y.jsxs)("span",{children:[1e3*L,"ms"]})," "]}),(0,y.jsxs)("li",{children:[" ","".concat(O," / ").concat(I," 个通过的测试用例")," "]})]}),(0,v.gZ)({status:E,error_msg:S,execute_time:L,output:T,input:k,expected_output:Z,input_file_url:P,output_file_url:R,is_file:F,expected_output_file_url:M}),(0,y.jsx)("h2",{children:" 提交的内容 "}),(0,y.jsx)(m.ZP,{height:"200px",width:"100%",language:null==N?void 0:N.toLocaleLowerCase(),value:x.Base64.decode(w),options:{readOnly:!0}})]})]}):null})})}},26407:function(e,t,n){"use strict";n.d(t,{Im:function(){return C},ZP:function(){return I},gZ:function(){return N}});var r=n(79800),i=n.n(r),c=n(82242),a=n.n(c),o=n(85573),s=n.n(o),l=n(59301),u=n(98135),d=n(8591),f=n(3113),p=n(43501),h=n(53547),v=n(99898),m=n(24334),x=n(96962),g=n(42783),_=n(6457),y=n(88549),j=n(37712),b=u.Z.TextArea,E={visible:!1,tabIndex:"0"},C=s()(s()(s()(s()(s()(s()({},v.h.NOMATCH,"测试用例结果不匹配"),v.h.OK,"调试通过"),2,"调试超时"),3,"调试pod失败"),4,"编译失败"),5,"执行失败"),w=function(e){return e[e.SET_VISIBLE=0]="SET_VISIBLE",e[e.SET_TABINDEX=1]="SET_TABINDEX",e}(w||{});function A(e,t){switch(t.type){case w.SET_VISIBLE:return a()(a()({},e),{},{visible:t.payload});case w.SET_TABINDEX:return a()(a()({},e),{},{tabIndex:t.payload});default:throw new Error}}function N(e){var t=e.status,n=e.error_msg,r=e.output,i=e.input,c=e.expected_output,a=e.is_file,o=e.input_file_url,s=e.output_file_url,l=e.expected_output_file_url,u=null,d={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(t){case v.h.NOMATCH:u=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("p",{className:"c-red",children:"实际输入:"}),!a&&(0,j.jsx)(g.Z,{value:i,style:d}),a&&(0,j.jsx)("div",{style:d,children:(0,j.jsx)("a",{onClick:function(){return(0,_.LR)(o,i)},children:i})}),(0,j.jsx)("p",{className:"c-red",children:"实际输出:"}),!a&&(0,j.jsx)(g.Z,{value:r&&m.Base64.decode(r)||"",style:d}),a&&(0,j.jsx)("div",{style:d,children:(0,j.jsx)("a",{onClick:function(){return(0,_.LR)(s,r)},children:r})}),(0,j.jsx)("p",{className:"c-red",children:"预期输出:"}),!a&&(0,j.jsx)(g.Z,{value:c&&m.Base64.decode(c)||"",style:d}),a&&(0,j.jsx)("div",{style:d,children:(0,j.jsx)("a",{onClick:function(){return(0,_.LR)(l,c)},children:c})})]});break;case v.h.EXECUTEFAILURE:case v.h.COMPILEFAILURE:u=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("p",{children:"最后执行的输入:"}),!a&&(0,j.jsx)(g.Z,{value:i,style:d}),a&&(0,j.jsx)("div",{style:d,children:(0,j.jsx)("a",{onClick:function(){return(0,_.LR)(o,i)},children:i})}),(0,j.jsx)("p",{children:"执行出错信息:"}),(0,j.jsx)("pre",{className:"error",children:m.Base64.decode(n)})]});break;case v.h.PODFAILURE:u=(0,j.jsx)("p",{children:"创建pod失败,请稍后重试"});break;case v.h.TIMEOUT:u=(0,j.jsx)("p",{children:"评测超时,请稍后重试"})}return(0,j.jsxs)(j.Fragment,{children:[" ",u," "]})}function O(e){var t=e.status,n=e.error_msg,r=e.execute_time,i=e.output,c=e.input,a=e.expected_output,o=(e.is_file,e.input_file_url,e.output_file_url,e.expected_output_file_url,null);switch(t){case v.h.OK:o=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("p",{children:["执行用时:",r,"秒"]}),(0,j.jsx)("p",{children:"执行结果:"}),(0,j.jsx)("pre",{children:m.Base64.decode(i)})]});break;case v.h.NOMATCH:o=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("p",{children:["输入:",(0,j.jsx)("pre",{children:c})]}),(0,j.jsxs)("p",{children:["输出:",i&&m.Base64.decode(i)]}),(0,j.jsxs)("p",{children:["预期输出:",a&&m.Base64.decode(a)]})]});break;case v.h.EXECUTEFAILURE:case v.h.COMPILEFAILURE:o=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("p",{children:["最后执行的输入:",(0,j.jsx)("pre",{children:c})]}),(0,j.jsx)("p",{children:"执行出错信息:"}),(0,j.jsx)("pre",{className:"error",children:m.Base64.decode(n)})]});break;case v.h.PODFAILURE:o=(0,j.jsx)("p",{children:"创建pod失败,请稍后重试"});break;case v.h.TIMEOUT:o=(0,j.jsx)("p",{children:"评测超时,请稍后重试"})}return(0,j.jsxs)(j.Fragment,{children:[" ",o," "]})}var I=function(e){var t=e.id,n=e.is_file,r=e.input,c=e.debuging,a=e.submitting,o=(e.executingMessage,e.debugResult),s=e.onChangeInput,u=e.onDebugCode,v=e.onSubmitCode,m=(0,l.useReducer)(A,E),g=i()(m,2),_=g[0],C=g[1],N=_.visible;_.tabIndex;(0,l.useEffect)((function(){C({type:w.SET_VISIBLE,payload:!1})}),[t]);var I=(0,l.useMemo)((function(){if(o){o.status;return(0,j.jsx)(j.Fragment,{children:O(o)})}return null}),[o]);return(0,j.jsxs)("div",{className:"test-case-panel",children:[(0,j.jsxs)("div",{className:"test-case-panel-body ".concat(N?"active":""),children:[(0,j.jsx)("ul",{className:"s-navs",children:(0,j.jsx)("li",{children:(0,j.jsx)("a",{className:"active",children:"调试代码结果"})})}),(0,j.jsx)(y.Z,{leftTitle:"自定义测试用例",rightTitle:"代码执行结果",style:{height:240},leftNode:(0,j.jsx)(b,{placeholder:"请输入自测用例(如果未填写,自测运行时,系统会自动填充第一个非隐藏的文本类型的测试用例)",value:n?"":r,onChange:s}),rightNode:c?(0,j.jsx)(x.Z,{message:"代码执行中..."}):o?I:(0,j.jsx)("p",{style:{color:"#536879"},children:"请填写测试用例的输入值,点击“调试代码”"})})]}),(0,j.jsx)("a",{className:"btn-collapse ".concat(N?"up":""),onClick:function(){C({type:w.SET_VISIBLE,payload:!N})},children:N?(0,j.jsx)(p.Z,{}):(0,j.jsx)(h.Z,{})}),(0,j.jsxs)("footer",{className:"footer",children:[(0,j.jsx)("span",{style:{visibility:"hidden"},children:"控制台"}),(0,j.jsxs)("div",{className:"flex-container",children:[(0,j.jsx)(f.ZP,{id:"oj-prev",className:"btn-blue",type:"ghost",children:"上一题"}),(0,j.jsx)(f.ZP,{id:"oj-next",className:"btn-blue",type:"ghost",children:"下一题"}),(0,j.jsx)(f.ZP,{className:"btn-green",type:"ghost",loading:c,onClick:function(){if(!r||n)return d.ZP.error("请输入自测用例"),C({type:w.SET_VISIBLE,payload:!0}),void C({type:w.SET_TABINDEX,payload:"0"});C({type:w.SET_VISIBLE,payload:!0}),C({type:w.SET_TABINDEX,payload:"1"}),u()},children:"调试代码"}),(0,j.jsx)(f.ZP,{type:"primary",className:"custom-ant-disabled",loading:a,disabled:a,onClick:function(){C({type:w.SET_VISIBLE,payload:!1}),v()},children:"评测并提交"})]})]})]})}},99898:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var r=function(e){return e[e.NOMATCH=-1]="NOMATCH",e[e.OK=0]="OK",e[e.TIMEOUT=2]="TIMEOUT",e[e.PODFAILURE=3]="PODFAILURE",e[e.COMPILEFAILURE=4]="COMPILEFAILURE",e[e.EXECUTEFAILURE=5]="EXECUTEFAILURE",e}({})},86314:function(e,t,n){"use strict";n.d(t,{H7:function(){return d},KC:function(){return m},M3:function(){return y},MK:function(){return u},MU:function(){return a},Rg:function(){return E},WH:function(){return x},X6:function(){return s},bM:function(){return c},bx:function(){return g},dd:function(){return h},de:function(){return w},fi:function(){return f},fu:function(){return i},gu:function(){return _},n4:function(){return p},qe:function(){return b},rL:function(){return C},rX:function(){return l},uc:function(){return A},vl:function(){return v},wO:function(){return j},zO:function(){return o}});var r=n(51136);function i(e){return(0,r.U2)("mypractices/".concat(e,".json"),{hidePopLogin:!0})}function c(e,t){return(0,r.v_)("mypractices/".concat(e,"/code_submit.json"),t)}function a(e,t){return(0,r.v_)("mypractices/".concat(e,"/code_debug.json"),t)}function o(e,t){return t.language&&(t.language=encodeURIComponent(t.language)),(0,r.U2)("mypractices/".concat(e,"/submit_records.json"),t)}function s(e){return(0,r.U2)("mypractices/record_detail.json",{id:e})}function l(e,t){return(0,r.U2)("mypractices/".concat(e,"/result.json"),{mode:t})}function u(e,t){return(0,r.v_)("mypractices/".concat(e,"/add_notes.json"),t)}function d(e,t){return(0,r.v_)("mypractices/".concat(e,"/restore_initial_code.json"),t)}function f(e,t){return(0,r.v_)("mypractices/".concat(e,"/sync_code.json"),t)}function p(e,t){return(0,r.v_)("mypractices/".concat(e,"/update_code.json"),t)}function h(e){return(0,r.v_)("mypractices/".concat(e,"/initial_codes.json"))}function v(e,t){return(0,r.v_)("discusses/".concat(e,"/plus.json"),t)}function m(e){return(0,r.U2)("practices/practices_list.json",e)}function x(e,t){return(0,r.U2)("practices/".concat(e,"/question_solution_articles"),t)}function g(e,t){return(0,r.v_)("practices/".concat(e,"/question_solution_articles"),t)}function _(e,t){return(0,r.gz)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active),t)}function y(e,t){return(0,r.U2)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/edit"),t)}function j(e,t){return(0,r.U2)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active),t)}function b(e,t){return(0,r.v_)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/set_authority_or_excellent"),t)}function E(e,t){return(0,r.v_)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/praise_or_treads"),t)}function C(e,t){return(0,r.v_)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/hide"))}function w(e,t){return(0,r.IV)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active),t)}function A(e,t){return(0,r.v_)("mypractices/".concat(e,"/update_practice_time_sum"),t)}},55369:function(e,t,n){"use strict";n.d(t,{AL:function(){return b},Iy:function(){return f},Qv:function(){return v},ez:function(){return j},jb:function(){return p}});var r=n(79800),i=n.n(r),c=n(32834),a=n.n(c),o=n(11690);var s=[],l=["