|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[30342,52720,36707,71426],{27812:function(e,n,t){t.d(n,{Z:function(){return c}});var a=t(5016),r=t(59301),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"},s=t(7657),o=function(e,n){return r.createElement(s.Z,(0,a.Z)({},e,{ref:n,icon:i}))};var c=r.forwardRef(o)},26227:function(e,n,t){t.d(n,{Z:function(){return c}});var a=t(5016),r=t(59301),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},s=t(7657),o=function(e,n){return r.createElement(s.Z,(0,a.Z)({},e,{ref:n,icon:i}))};var c=r.forwardRef(o)},87169:function(e,n,t){t.d(n,{Z:function(){return c}});var a=t(5016),r=t(59301),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},s=t(7657),o=function(e,n){return r.createElement(s.Z,(0,a.Z)({},e,{ref:n,icon:i}))};var c=r.forwardRef(o)},95869:function(e,n,t){t.d(n,{Z:function(){return c}});var a=t(5016),r=t(59301),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 264c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48zm-8 136H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM480 544H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm-48 308H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm356.8-74.4c29-26.3 47.2-64.3 47.2-106.6 0-79.5-64.5-144-144-144s-144 64.5-144 144c0 42.3 18.2 80.3 47.2 106.6-57 32.5-96.2 92.7-99.2 162.1-.2 4.5 3.5 8.3 8 8.3h48.1c4.2 0 7.7-3.3 8-7.6C564 871.2 621.7 816 692 816s128 55.2 131.9 124.4c.2 4.2 3.7 7.6 8 7.6H880c4.6 0 8.2-3.8 8-8.3-2.9-69.5-42.2-129.6-99.2-162.1zM692 591c44.2 0 80 35.8 80 80s-35.8 80-80 80-80-35.8-80-80 35.8-80 80-80z"}}]},name:"solution",theme:"outlined"},s=t(7657),o=function(e,n){return r.createElement(s.Z,(0,a.Z)({},e,{ref:n,icon:i}))};var c=r.forwardRef(o)},13047:function(e,n,t){function a(e){var n=!0;if(e.length>0){for(var t=0;t<e.length;t++)if(0==e[t].compile_success||!e[t].compile_success){n=!1;break}}else n=!1;return n}function r(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=[],a=0;a<e.length;a++){var r=e[a],i=n?"".concat(n,"/").concat(r.name):"".concat(r.name);t.push({title:r.name,isLeaf:"tree"!==r.type,key:i})}return t}function i(e,n,t){for(var a=0;a<e.length;a++){var r=e[a];if(r.key===n){r.children=t;break}r.children&&i(r.children,n,t)}return e}function s(e,n,t){var a;return function(){var r=this,i=arguments,s=function(){a=null,t||e.apply(r,i)},o=t&&!a;clearTimeout(a),a=setTimeout(s,n),o&&e.apply(r,i)}}t.d(n,{Ax:function(){return i},Ds:function(){return s},KI:function(){return o},SI:function(){return r},f1:function(){return a}});var o=t(67390).Z.API_SERVER},12940:function(e,n,t){t.d(n,{Z:function(){return b}});var a=t(82242),r=t.n(a),i=t(7557),s=t.n(i),o=t(41498),c=t.n(o),l=t(79800),d=t.n(l),u=t(59301),p={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},m=t(3113),h=t(70557),f=t(10446),x=t(6848),v=t(1079),g=t(26613),j=t(46172),_=t(67390),y=t(37712),b=function(e){var n,t,a,i,o,l,b,w=e.editOffice,k=void 0===w?"view":w,S=e.data,N=(e.theme,e.type),C=e.filename,Z=e.monacoEditor,E=e.className,I=e.style,P=e.close,O=e.onClose,T=e.hasMask,R=e.disabledDownload,A=e.onImgDimensions,H=e.showNodata,L=(0,u.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),B=d()(L,2),F=(B[0],B[1],(0,u.useState)("")),z=d()(F,2),M=(z[0],z[1]),$=(0,u.useState)(),V=d()($,2),W=V[0],D=V[1],G="build"===window.ENV?"/react/build":"",q=location.host.startsWith("localhost")?_.Z.PROXY_SERVER:_.Z.API_SERVER,J=(0,u.useRef)();null!==(n=S)&&void 0!==n&&n.startsWith("/api")&&"txt"!==N&&(S=_.Z.API_SERVER+S),C&&(Z.filename=C),(0,u.useEffect)((function(){var e,n=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==n||n.map((function(e){var n=e.split("=");"_educoder_session"===n[0]&&M(n[1])}))}),[]),(0,u.useEffect)((function(){"office"===N&&Y()}),[N,S]);var Y=function(){var e=c()(s()().mark((function e(){var n,t,a;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=S,S.startsWith("http")||(n=location.origin+n),t=new URL(n).pathname.split("/").pop(),e.next=5,(0,g.gJ)({attachment_id:t});case 5:a=e.sent,D(a);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){U()},U=function(){(0,v.Nd)(C||"educoder",decodeURIComponent(S))};return(0,y.jsxs)("div",{style:r()({},I||{}),className:"".concat(T&&p.bgBlack," ").concat(N?p.wrp:"hide"),children:[P&&(0,y.jsxs)("div",{className:p.close,ref:J,children:[!!A&&(0,y.jsx)(x.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return J.current},children:(0,y.jsx)("span",{onClick:function(){O(),A()},children:(0,y.jsx)("i",{className:"icon-yulanpizhu"})})}),!R&&(0,y.jsx)(x.Z,{title:"点击下载此文件",getPopupContainer:function(){return J.current},children:(0,y.jsx)("span",{onClick:U,children:(0,y.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,y.jsx)(x.Z,{title:"关闭",getPopupContainer:function(){return J.current},children:(0,y.jsx)("span",{className:"",onClick:O,children:(0,y.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,y.jsx)("div",{className:"".concat(p[E]," ").concat(E," ").concat(p.monaco," ").concat("txt"===N?"show":"hide"),children:"txt"===N&&(0,y.jsx)(f.ZP,r()({},Z))}),"audio"===N&&(0,y.jsx)("audio",{src:(null===(t=S)||void 0===t?void 0:t.indexOf("http"))>-1||null!==(a=S)&&void 0!==a&&a.startsWith("/api")?S:"data:image/png;base64,".concat(S),autoPlay:!0}),"video"===N&&(0,y.jsx)(y.Fragment,{children:(null===(i=S)||void 0===i?void 0:i.indexOf("http"))>-1||null!==(o=S)&&void 0!==o&&o.startsWith("/api")?(0,y.jsx)("video",{controls:!0,src:"".concat(S),autoPlay:!0}):(0,y.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(S),autoPlay:!0})}),"office"===N&&W&&(0,y.jsx)("iframe",{src:"".concat(G,"/office.html?key=").concat(W.key,"&url=").concat(q+W.url,"&callbackUrl=").concat(q+W.callbackUrl,"&fileType=").concat(W.fileType,"&title=").concat(W.title,"&model=").concat(k,"&officeServer=").concat(_.Z.ONLYOFFICE,"&disabledDownload=").concat(!!R)}),"html"===N&&(0,y.jsx)("iframe",{src:S+"&disposition=inline"}),"pdf"===N&&(0,y.jsx)("iframe",{src:"".concat(G,"/js/pdfview/index.html?url=").concat(S,"&disabledDownload=").concat(!!R)}),"image"===N&&(0,y.jsx)("img",{src:(null===(l=S)||void 0===l?void 0:l.indexOf("http"))>-1||null!==(b=S)&&void 0!==b&&b.startsWith("/api")?S:"data:image/png;base64,".concat(S)}),("other"===N||"download"===N)&&(0,y.jsx)(y.Fragment,{children:H?(0,y.jsx)(j.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,y.jsx)(m.ZP,{icon:(0,y.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:X,children:"下载"})}):(0,y.jsxs)(m.ZP,{type:"primary",size:"middle",onClick:X,children:[(0,y.jsx)(h.Z,{}),"点击下载"]})})]})}},36707:function(e,n,t){t.d(n,{Z:function(){return V}});var a=t(82242),r=t.n(a),i=t(37205),s=t.n(i),o=t(91232),c=t.n(o),l=t(79800),d=t.n(l),u=t(59301),p=(t(8944),t(32834)),m=t.n(p),h=t(11690);var f=[],x=["<ul>"],v=new(m().Renderer),g=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function j(){f.length=0,x=["<ul>"]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function y(e,n,t,a){if(n>=e.length||e[n].level<=t)return n;var r=e[n];a.push("<li><a href='#"+r.anchor+"'>"+r.text+"</a>");var i=[];return n=y(e,++n,r.level,i),i.length>0&&(a.push("<ul>"),i.forEach((function(e){a.push(e)})),a.push("</ul>")),a.push("</li>"),n=y(e,n,t,a)}function b(){return y(f,0,0,x),x.push("</ul>"),x.join("")}var w={heading:function(e){var n=g.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[1].length,text:n[2]}},fences:function(e){var n=this.rules.block.fences.exec(e);if(n){var t=n[0],a=function(e,n){var t=e.match(/^(\s+)(?:```)/);if(null===t)return n;var a=t[1];return n.split("\n").map((function(e){var n=e.match(/^\s+/);return null===n?e:d()(n,1)[0].length>=a.length?e.slice(a.length):e})).join("\n")}(t,n[3]||""),r=n[2]?n[2].trim():n[2];if(["latex","katex","math"].indexOf(r)>=0){var i=N(),s=a;a=i,C[i]={type:"block",expression:s}}return{type:"code",raw:t,lang:r,text:a}}}},k=/(?:\${2})([^\n`]+?)(?:\${2})/gi,S=0,N=function(){return"__special_katext_id_".concat(S++,"__")},C={};function Z(){return C}function E(){S=0,C={}}function I(e){return e=e.replace(k,(function(e,n){var t=N();return C[t]={type:"inline",expression:n},t}))}var P=v.listitem;v.listitem=function(e){return P(I(e))};var O=v.paragraph;v.paragraph=function(e){return O(I(e))};var T=v.tablecell;v.tablecell=function(e,n){return T(I(e),n)},v.code=function(e,n,t){var a=(n||"").match(/\S*/)[0];return a?["latex","katex","math"].indexOf(a)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(n,'">').concat(t?e:(0,h.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(t?e:(0,h.escape)(e,!0))+"</code></pre>"},v.heading=function(e,n,t){var a=this.options.headerPrefix+t.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return f.push({anchor:a,level:n,text:e}),"<h"+n+' id="'+a+'">'+e+"</h"+n+">"},m().setOptions({silent:!0,gfm:!0,pedantic:!1}),m().use({tokenizer:w,renderer:v});var R=m(),A=(t(64018),t(79710)),H=t(67390),L=t(15342),B=t(1012),F=t(12940),z=t(37712),M="@▁@",$=/<pre[^>]*>/g;var V=function(e){var n=e.value,t=void 0===n?"":n,a=e.className,i=e.showTextOnly,o=e.showLines,l=e.style,p=void 0===l?{}:l,m=e.stylesPrev,h=void 0===m?{}:m,f=e.highlightKeywords,x=e.showProgramFill,v=(e.isProgramFill,e.disabledFill),g=void 0!==v&&v,y=e.programFillValue,w=e.onFillChange,k=void 0===w?function(e){}:w,S=e.onFillBlur,N=void 0===S?function(){}:S,C=String(t),I=(0,u.useState)(""),P=d()(I,2),O=P[0],T=P[1],V=(0,u.useState)("office"),W=d()(V,2),D=W[0],G=W[1],q=(0,u.useState)([]),J=d()(q,2),Y=J[0],X=J[1],U=(0,u.useRef)("a"+(0,B.Z)()),K={},Q=function(e){return e.replace(/<style.*?>([\s\S]+?)<\/style>/gim,(function(e,n){var t=n.replace(/(\n|\r)/g,"").split("}"),a=[];return t.map((function(e){""!=e&&a.push(".".concat(U.current," ").concat(e))})),"<style>".concat(a.join("}"),"</style>")}))},ee=(0,u.useMemo)((function(){try{C=C.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(x){var e=-1;return C=C.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,(function(n,t,a){return function(e,n){var t=document.createElement(e===M?"input":"textarea");t.style.width="100%",t.style.height=e===M?"40px":"151px",t.rows=5,t.spellcheck=!1,t.name="edu-program-fill",t.placeholder="请输入",t.dataset.id=n;var a=Object.keys(K).length;return K[a]=t,'<span class="edu-program-fill-wrap '.concat(e===M?"":"show",'" style="width:').concat(e===M?"200px":"100%",'"><span>').concat(t.outerHTML,'<span class="edu-program-fill-score"></span></span></span>')}(n,++e)})),'<pre style="background:#fff;padding:4px">'.concat(Q(C||""),"</pre>")}var n=R(C);n=Q(n);var t=Z();C.match(/\[TOC\]/)&&(n=n.replace("<p>[TOC]</p>",b()),j()),n=n.replace(/(__special_katext_id_\d+__)/g,(function(e,n){var a=t[n],r=a.type,i=a.expression;return(0,L.renderToString)(function(e){var n=document.createElement("div");return n.innerHTML=e,0===n.childNodes.length?"":n.childNodes[0].nodeValue}(i)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})})),n=n.replace(/▁/g,"▁▁▁"),E();var a=document.createElement("div");return a.innerHTML=n,f?(ae(a,f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),a.innerHTML):i?a.innerText:(setTimeout((function(){return se()}),500),a.innerHTML)}),[C,f]);(0,u.useEffect)((function(){re.current&&re.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=ne,e.onblur=te}))}),[Y]),(0,u.useEffect)((function(){if(null!=y&&y.length){var e,n=re.current.querySelectorAll(".edu-program-fill-score"),t=re.current.querySelectorAll('[name="edu-program-fill"]'),a=c()(t.entries());try{for(a.s();!(e=a.n()).done;){var r,i=d()(e.value,2),s=i[0],o=i[1];o.value=null===(r=y[s])||void 0===r?void 0:r.value,"warning"===y[s].type?o.className="program-fill-warning":"success"===y[s].type?o.className="program-fill-success":o.className=""}}catch(e){a.e(e)}finally{a.f()}var l,u=c()(n.entries());try{for(u.s();!(l=u.n()).done;){var p,m,h=d()(l.value,2),f=h[0];h[1].innerHTML=null!==(p=y[f])&&void 0!==p&&p.score?"".concat(null===(m=y[f])||void 0===m?void 0:m.score,"分"):""}}catch(e){u.e(e)}finally{u.f()}X(y)}}),[y]);var ne=function(e){Y[e.target.dataset.id]=Y[e.target.dataset.id]||{},Y[e.target.dataset.id].value=e.target.value,X(s()(Y)),k(Y,e.target.dataset.id)},te=function(e){Y[e.target.dataset.id]=Y[e.target.dataset.id]||{},Y[e.target.dataset.id].value=e.target.value,X(s()(Y)),N(Y,e.target.dataset.id)};function ae(e,n){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)ae(e,n);else if("IMG"!==e.nodeName)if(e.innerHTML){var t;e.innerHTML=null===(t=e.innerHTML)||void 0===t?void 0:t.replace(new RegExp(n,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>')}else{var a=document.createElement("span");a.innerHTML=e.textContent.replace(new RegExp(n,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),e.replaceWith(a)}}))}var re=(0,u.useRef)();function ie(e){var n=e.target;if("A"===n.tagName.toUpperCase()){var t=n.getAttribute("href");if(t.indexOf("office")>-1)e.preventDefault(),T(t),G("office");else if(t.indexOf("application/pdf")>-1)e.preventDefault(),T(t),G("pdf");else if(t.indexOf("text/html")>-1)e.preventDefault(),T(t),G("html");else if(t.startsWith("#")){e.preventDefault();var a=document.getElementById(t.replace("#",""));a&&a.scrollIntoView(!0)}}}_.WebkitLineClamp=o,o&&(p=r()(r()({},p),_));var se=function(){var e,n=null===(e=re.current)||void 0===e?void 0:e.querySelectorAll("video");null==n||n.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(A.ZP.isSupported()){var n=new A.ZP;n.loadSource(e.src),n.attachMedia(e)}}))};return(0,u.useEffect)((function(){if(re.current&&ee&&ee.match($)&&window.PR.prettyPrint(),re.current)return re.current.addEventListener("click",ie),function(){var e;null===(e=re.current)||void 0===e||e.removeEventListener("click",ie),E(),j()}}),[ee,re.current,ie]),(0,z.jsxs)(z.Fragment,{children:[i&&(0,z.jsx)("div",{ref:re,children:ee}),!i&&(0,z.jsx)("div",{ref:re,style:r()({},p),className:"".concat(a||""," ").concat(g?"disabled-fill":""," markdown-body ").concat(U.current),dangerouslySetInnerHTML:{__html:ee}}),(0,z.jsx)(F.Z,{close:!0,data:O,type:null!=O&&O.length?D:"",style:r()({},h),onClose:function(){return T("")}})]})}},30971:function(e,n,t){t.d(n,{h:function(){return v}});var a=t(82242),r=t.n(a),i=t(79800),s=t.n(i),o=t(59301),c=t(57809),l=t(78241),d=t(3113),u=t(89780),p=t.n(u),m=(t(8336),t(12469),t(37712)),h=c.default.Option,f={labelCol:{span:4},wrapperCol:{span:20}},x={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var n=e.value,t=e.onChange,a=e.mode,i=e.options,c=void 0===i?{}:i,l=(0,o.useRef)(),d=(0,o.useState)(),u=s()(d,2),h=u[0],f=u[1];return(0,o.useEffect)((function(){if(h){var e=function(e){var n=e.getValue();t&&t(n)};return h.on("change",e),function(){h.off("change",e)}}}),[h,t]),(0,o.useEffect)((function(){h&&h.setOption("mode",a)}),[h,a]),(0,o.useEffect)((function(){h&&(n===h.getValue()&&""!==n||setTimeout((function(){h.setValue(n||"")}),300))}),[h,n]),(0,o.useEffect)((function(){if(l.current&&!h){var e=p().fromTextArea(l.current,r()({mode:a,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},c));f(e)}}),[l.current,h]),(0,m.jsx)("div",{className:"my-codemirror-container",children:(0,m.jsx)("textarea",{ref:l})})}n.Z=function(e){var n=e.callback,t=e.onCancel,a=(0,o.useState)("python"),i=s()(a,2),u=i[0],p=i[1];return(0,m.jsxs)(l.Z,r()(r()({},f),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){n(e)},children:[(0,m.jsx)(l.Z.Item,{label:"代码语言",name:"language",children:(0,m.jsx)(c.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){p(x[e][1])},children:Object.keys(x).map((function(e){return(0,m.jsx)(h,{value:e,children:x[e][0]},e)}))})}),(0,m.jsx)(l.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,m.jsx)(v,{mode:u})}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(d.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(d.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))}},49731:function(e,n,t){t.d(n,{Z:function(){return ce}});var a=t(91232),r=t.n(a),i=t(7557),s=t.n(i),o=t(41498),c=t.n(o),l=t(79800),d=t.n(l),u=t(85573),p=t.n(u),m=t(59301),h=t(89780),f=t.n(h),x=t(76374),v=(t(8336),t(6313),t(25717),t(99498),t(25419),t(67549),t(36707)),g=t(37712),j=function(e){var n=e.value,t=void 0===n?"":n,a=(e.className,e.showTextOnly,e.showLines,e.style,(0,m.useMemo)((function(){return""}),[t]));return(0,g.jsx)(g.Fragment,{children:(0,g.jsx)("div",{dangerouslySetInnerHTML:{__html:a}})})},_=t(82242),y=t.n(_),b=[{title:"粗体",icon:"icon-bold",actionName:"bold"},{title:"斜体",icon:"icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"icon-file-code",actionName:"code-block"},{title:"链接",icon:"icon-link",actionName:"link"},"|",{title:"行内公式",icon:"icon-sum",actionName:"inline-latex"},{title:"多行公式",icon:"icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"icon-picture",actionName:"upload-image"},{title:"表格",icon:"icon-table",actionName:"add-table"},"|",{title:"换行",icon:"icon-minus",actionName:"line-break"},{title:"清空",icon:"icon-eraser",actionName:"eraser"}];function w(e){var n=e.onActionCallback,t=e.title,a=e.icon,r=e.actionName,i=e.className,s=void 0===i?"":i,o=e.children;return(0,g.jsxs)("a",{title:t,className:s,onClick:function(){n(r)},children:[(0,g.jsx)("i",{className:"md-iconfont ".concat(a)}),o]})}var k=function(e){var n=e.watch,t=e.showNullButton,a=e.showNullProgramButton,r=e.onActionCallback,i=e.fullScreen,s=e.insertTemp,o=e.hidetoolBar,c=[].concat(b,[{title:"".concat(n?"关闭实时预览":"开启实时预览"),icon:"".concat(n?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return(0,g.jsxs)("ul",{className:"markdown-toolbar-container",children:[!o&&c.map((function(e,n){return(0,g.jsx)("li",{children:e.actionName?(0,g.jsx)(w,y()(y()({},e),{},{onActionCallback:r})):(0,g.jsx)("span",{className:"v-line"})},n)})),t?(0,g.jsx)("li",{children:(0,g.jsx)(w,{icon:"icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:r,children:(0,g.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,a?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("li",{children:(0,g.jsx)(w,{icon:"icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:r,children:(0,g.jsx)("span",{className:"fill-tip",children:"添加单行填空项"})})}),(0,g.jsx)("li",{children:(0,g.jsx)(w,{icon:"icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:r,children:(0,g.jsx)("span",{className:"fill-tip",children:"添加多行填空项"})})})]}):null,s&&(0,g.jsx)("li",{children:(0,g.jsx)(w,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(s),onActionCallback:r,children:(0,g.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),(0,g.jsx)("li",{className:"btn-full-screen",children:(0,g.jsx)(w,{icon:"".concat(i?"icon-shrink":"icon-enlarge"),title:i?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})})]})},S=t(33471),N=t(78241),C=t(10249),Z=t(3113),E={labelCol:{span:4},wrapperCol:{span:20}},I=function(e){var n=e.callback,t=e.onCancel;return(0,g.jsxs)(N.Z,y()(y()({},E),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){n(e)},children:[(0,g.jsx)(N.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,g.jsx)(C.Z,{})}),(0,g.jsx)(N.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,g.jsx)(C.Z,{})}),(0,g.jsxs)("div",{className:"flex-container flex-end",children:[(0,g.jsx)(Z.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,g.jsx)(Z.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))},P=t(30971),O=t(8591),T=t(13047),R=N.Z.useForm,A={width:280,marginRight:10},H={labelCol:{span:5},wrapperCol:{span:19}},L=function(e){var n=e.callback,t=e.onCancel,a=R(),r=d()(a,1)[0],i=(0,m.useRef)();function s(e,n){-1!==e.status?r.setFieldsValue({src:"/api/attachments/".concat(e.id),type:n.type}):O.ZP.error(e.message)}return(0,g.jsxs)(N.Z,y()(y()({form:r},H),{},{className:"upload-image-panel",onFinish:function(e){n(y()(y()({},e),{},{name:i.current}))},style:{width:470,overflow:"hidden"},children:[(0,g.jsx)(N.Z.Item,{label:"图片地址",required:!0,children:(0,g.jsxs)("div",{className:"flex-container",children:[(0,g.jsx)(N.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入文件地址"}],children:(0,g.jsx)(C.Z,{style:A})}),(0,g.jsx)(B,{onFileChange:function(e){var n=e.target.files[0];i.current=n.name,F(n,s)}})]})}),(0,g.jsx)(N.Z.Item,{label:"图片描述",name:"alt",children:(0,g.jsx)(C.Z,{style:{width:264}})}),(0,g.jsxs)(N.Z.Item,{style:{textAlign:"right"},children:[(0,g.jsx)(Z.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,g.jsx)(Z.ZP,{type:"default",onClick:t,children:"取消"})]})]}))};function B(e){var n=e.onFileChange;return(0,g.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,g.jsx)("input",{type:"file",onChange:n})]})}function F(e,n){if(!e)throw new String("没有文件");var t=new FormData;t.append("editormd-image-file",e),t.append("file_param_name","editormd-image-file"),t.append("byxhr","true");var a=new window.XMLHttpRequest;a.withCredentials=!0,a.addEventListener("load",(function(t){n(JSON.parse(t.target.responseText),e)}),!1),a.addEventListener("error",(function(e){console.error(e)}),!1),a.open("POST","".concat(T.KI,"/api/attachments.json")),a.send(t)}var z=t(5112),M=t(5871),$=z.ZP.Group,V={margin:"0 8px"},W=function(e){var n=e.callback,t=e.onCancel;return(0,g.jsxs)(N.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){n(e)},children:[(0,g.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,g.jsx)("span",{style:V,children:"单元格数:"}),(0,g.jsx)("span",{style:V,children:"行数"}),(0,g.jsx)(N.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,g.jsx)(M.Z,{})}),(0,g.jsx)("span",{style:V,children:"列数"}),(0,g.jsx)(N.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,g.jsx)(M.Z,{})})]}),(0,g.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,g.jsx)("span",{style:V,children:"对齐方式:"}),(0,g.jsx)(N.Z.Item,{name:"align",children:(0,g.jsxs)($,{children:[(0,g.jsx)(z.ZP,{value:"default",children:(0,g.jsx)("i",{className:"fa fa-align-justify"})}),(0,g.jsx)(z.ZP,{value:"left",children:(0,g.jsx)("i",{className:"fa fa-align-left"})}),(0,g.jsx)(z.ZP,{value:"center",children:(0,g.jsx)("i",{className:"fa fa-align-center"})}),(0,g.jsx)(z.ZP,{value:"right",children:(0,g.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,g.jsxs)("div",{className:"flex-container flex-end",children:[(0,g.jsx)(Z.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,g.jsx)(Z.ZP,{type:"ghost",onClick:t,children:"取消"})]})]})},D=t(67390),G=t(35325),q=t(1012),J=t(43418),Y="link",X="upload-image",U="code-block",K="add-table",Q="------------",ee={default:Q,left:":".concat(Q),center:":".concat(Q,":"),right:"".concat(Q,":")},ne=t(93802);var te="@▁▁@";function ae(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var re=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",ie=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],se=p()(p()({},re+"-B","bold"),re+"-I","italic"),oe=p()(p()(p()(p()({},Y,"添加链接"),U,"添加代码块"),X,"添加文件"),K,"添加表格"),ce=function(e){var n=e.defaultValue,t=void 0===n?"":n,a=e.onChange,i=e.width,o=void 0===i?"100%":i,l=e.height,u=void 0===l?400:l,h=e.miniToolbar,_=void 0!==h&&h,y=e.isFocus,b=void 0!==y&&y,w=e.watch,N=e.insertTemp,C=e.mode,Z=void 0===C?"markdown":C,E=e.id,T=void 0===E?"markdown-editor-id":E,R=e.showResizeBar,A=void 0!==R&&R,H=e.noStorage,B=void 0!==H&&H,z=e.showNullButton,M=void 0!==z&&z,$=e.showNullProgramButton,V=void 0!==$&&$,Q=e.hidetoolBar,re=void 0!==Q&&Q,ce=e.fullScreen,le=void 0!==ce&&ce,de=e.onBlur,ue=e.onCMBeforeChange,pe=e.onFullScreen,me=e.className,he=void 0===me?"":me,fe=e.disablePaste,xe=void 0!==fe&&fe,ve=e.disabled,ge=void 0!==ve&&ve,je=e.disabledFill,_e=void 0!==je&&je,ye=e.placeholder,be=void 0===ye?"":ye,we=e.values,ke=void 0===we?"":we,Se=(0,m.useState)(null),Ne=d()(Se,2),Ce=Ne[0],Ze=Ne[1],Ee=(0,m.useState)(t),Ie=d()(Ee,2),Pe=Ie[0],Oe=Ie[1],Te=(0,m.useState)(w),Re=d()(Te,2),Ae=Re[0],He=Re[1],Le=(0,m.useState)(le),Be=d()(Le,2),Fe=Be[0],ze=Be[1],Me=(0,m.useState)(""),$e=d()(Me,2),Ve=$e[0],We=$e[1],De=(0,m.useState)(0),Ge=d()(De,2),qe=Ge[0],Je=Ge[1],Ye=(0,m.useState)(u),Xe=d()(Ye,2),Ue=Xe[0],Ke=Xe[1],Qe=(0,m.useState)(!1),en=d()(Qe,2),nn=(en[0],en[1]),tn=(0,m.useRef)((0,q.Z)()),an=(0,m.useRef)(!1),rn=(0,m.useRef)(),sn=(0,m.useRef)(),on=(0,m.useRef)(),cn=(0,m.useRef)(),ln=(0,m.useRef)(),dn=function(){var e=c()(s()().mark((function e(){var n,t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,G.ZP)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:tn.current}});case 2:null!=(t=e.sent)&&null!==(n=t.attachments)&&void 0!==n&&n.length&&(console.log("cm:",Ce,sn),t.attachments.map((function(e){e.content_type.indexOf("image")>-1?Ce.replaceSelection(".concat(e.content_type,")")):e.content_type.indexOf("video")>-1?Ce.replaceSelection('<video width="100%" controls src="'.concat(D.Z.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):e.content_type.indexOf("pdf")>-1?Ce.replaceSelection('<a href="'.concat(D.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,'&disposition=inline" target="_blank">').concat(e.name,"</a>")):Ce.replaceSelection("[".concat(e.name,"](").concat(D.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")"))})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,m.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Oe(ke),null==Ce||Ce.setValue(ke),window.scrollTo(0,e)}),[ke]),(0,m.useEffect)((function(){null==pe||pe(Fe)}),[Fe]),(0,m.useEffect)((function(){if(sn.current){var e=function(e,t){if(!xe){var a=t.clipboardData;if(a){var r=a.types.toString(),i=a.items;if("Files"===r||a.types.indexOf("Files")>-1){if(t.preventDefault(),"stex"==Z)return;try{var s,o=i[1];"file"===(null===(s=i[0])||void 0===s?void 0:s.kind)&&(o=i[0]);var c=o.getAsFile(),l=c.name.split(".").pop();F(c,(function(e){var t,a,r;e.id?(null==c||null===(t=c.type)||void 0===t?void 0:t.indexOf("image"))>-1?n.replaceSelection(".concat(e.content_type,")")):(null==c||null===(a=c.type)||void 0===a?void 0:a.indexOf("video"))>-1?n.replaceSelection('<video width="100%" controls src="'.concat(D.Z.API_SERVER,"/api/attachments/").concat(e.id,'"></video>')):(null==c||null===(r=c.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?n.replaceSelection('<a href="'.concat(D.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(c.type,'&disposition=inline" target="_blank">').concat(c.name,"</a>")):ie.includes(l)?n.replaceSelection('<a href="'.concat(D.Z.API_SERVER,"/api/attachments/").concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(c.name,"</a>")):n.replaceSelection("[".concat(c.name,"](").concat(D.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(t){O.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}t.preventDefault()},n=f().fromTextArea(sn.current,{mode:Z,lineNumbers:!_,lineWrapping:!0,value:t,autoCloseTags:!V,autoCloseBrackets:!0});return n.on("keyup",(function(e,t){8===t.keyCode&&(""==e.getValue()?n.setOption("placeholder",be):n.setOption("placeholder",null))})),n.on("keydown",(function(e,n){if(8===n.keyCode){var t=function(e,n){var t=e.getDoc(),a=t.getCursor(),r=t.getLine(a.line),i=r.charAt(a.ch-1),s=r.lastIndexOf("@▁@",a.ch),o=r.lastIndexOf("@▁▁@",a.ch),c=s>o?s:o,l=s>o?3:4;if(-1===te.indexOf(i))return null;if(console.log("change1:",n,e,r,a,c,s,o,i),c>=0&&a.ch-c<5){var d=c+l;return t.replaceRange("",{line:a.line,ch:c},{line:a.line,ch:d}),{line:a.line,ch:d}}return null}(e);t&&n.preventDefault()}})),b&&n.focus(),n.on("paste",e),n.on("dragleave",(function(e,n){on.current.classList.remove("mouse-hover-md")})),n.on("dragover",(function(e,n){on.current.classList.add("mouse-hover-md")})),n.on("drop",(function(e,t){var a;if(on.current.classList.add("mouse-hover-md"),(a=t.dataTransfer.files).length>0){t.preventDefault(),t.stopPropagation();for(var r=function(){var e=a[i],t=e.name.split(".").pop();F(e,(function(a){var r,i,s;a.id?(null==e||null===(r=e.type)||void 0===r?void 0:r.indexOf("image"))>-1?n.replaceSelection(".concat(a.content_type,")")):(null==e||null===(i=e.type)||void 0===i?void 0:i.indexOf("video"))>-1?n.replaceSelection('<video width="100%" controls src="'.concat(D.Z.API_SERVER,"/api/attachments/").concat(a.id,'"></video>')):(null==e||null===(s=e.type)||void 0===s?void 0:s.indexOf("pdf"))>-1?n.replaceSelection('<a href="'.concat(D.Z.API_SERVER,"/api/attachments/").concat(a.id,"?type=").concat(e.type,'&disposition=inline" target="_blank">').concat(e.name,"</a>")):ie.includes(t)?n.replaceSelection('<a href="'.concat(D.Z.API_SERVER,"/api/attachments/").concat(a.id,'?type=office&disposition=inline" target="_blank">').concat(e.name,"</a>")):n.replaceSelection("[".concat(e.name,"](").concat(D.Z.API_SERVER,"/api/attachments/").concat(a.id,"?type=").concat(a.content_type,")")):401===(null==a?void 0:a.status)&&(document.location.href="/user/login")}))},i=0;i<a.length;i++)r()}})),ge&&n.on("beforeChange",(function(e,n){"paste"!==n.origin&&"+input"!==n.origin||n.cancel()})),Ze(n),function(){n.off("paste",e)}}}),[]);var un=(0,m.useCallback)((function(){on.current}),[Ue,on,Fe]);(0,m.useEffect)((function(){if(Ce){var e=function(){var e=new x.Z((function(e){var n,t=r()(e);try{for(t.s();!(n=t.n()).done;){var a=n.value;(a.target.offsetHeight>0||a.target.offsetWidth>0)&&(un(),Ce.setSize("100%","100%"),Ce.refresh())}}catch(e){t.e(e)}finally{t.f()}}));return e.observe(sn.current.parentElement),e}();return function(){var n,t;null!==(n=sn.current)&&void 0!==n&&n.parentElement&&e.unobserve(null===(t=sn.current)||void 0===t?void 0:t.parentElement)}}}),[Ce,un]),(0,m.useEffect)((function(){if(Ce){for(var e=[],n=function(){var n=d()(a[t],2),r=n[0],i=n[1],s=p()({},r,(function(){pn(i)}));e.push(s),Ce.addKeyMap(s)},t=0,a=Object.entries(se);t<a.length;t++)n();return rn.current=setInterval((function(){an.current&&dn()}),4e3),function(){clearInterval(rn.current);for(var n=0,t=e;n<t.length;n++){var a=t[n];Ce.removeKeyMap(a)}}}}),[Ce]),(0,m.useEffect)((function(){le!==Fe&&ze(le)}),[le]),(0,ne.Z)((function(){if(!B&&qe>0){var e=(new Date).getTime(),n=window.sessionStorage.getItem(T);e>=qe+1e4&&(!n||n!==Pe)&&(window.sessionStorage.setItem(T,Pe),nn(!0))}}),1e4),(0,m.useEffect)((function(){He(w)}),[Ce,w]),(0,m.useEffect)((function(){Ce&&b&&Ce.focus()}),[Ce,b]),(0,m.useEffect)((function(){if(Ae&&Ce){var e=function(e){var n=e.target;if(ln.current){var t=n.scrollTop/n.scrollHeight;ln.current.scrollTop=ln.current.scrollHeight*t}},n=Ce.getScrollerElement();return n.addEventListener("scroll",e),function(){n.removeEventListener("scroll",e)}}}),[Ce,Ae]),(0,m.useEffect)((function(){if(Ce&&ue){var e=function(e,n){ue(e,n)};return Ce.on("beforeChange",e),function(){Ce.off("beforeChange",e)}}}),[Ce,ue]),(0,m.useEffect)((function(){if(Ce&&de){var e=function(){de(Ce.getValue())};return Ce.on("blur",e),function(){Ce.off("blur",e)}}}),[Ce,de]),(0,m.useEffect)((function(){if(Ce){var e=function(e,n){var t=e.getValue();Oe(t),Je((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),a&&(V?a(t,vn(t)):a(t))};return Ce.on("change",e),function(){Ce.off("change",e)}}}),[Ce,a]),(0,m.useEffect)((function(){if(Ce)if(null==t)Ce.setValue(""),Oe("");else{var e=window.scrollY||window.pageYOffset;t!==Ce.getValue()&&(Ce.setValue(t),Oe(t),Ce.setCursor(ge?1:Ce.lineCount(),0),window.scrollTo(0,e))}}),[Ce,t]);var pn=(0,m.useCallback)((function(e){var n=Ce.getCursor(),t=Ce.getSelection(),a=t.split("\n");switch(e){case"bold":return Ce.replaceSelection("**"+t+"**"),""===t&&Ce.setCursor(n.line,n.ch+2),Ce.focus();case"italic":return Ce.replaceSelection("*"+t+"*"),""===t&&Ce.setCursor(n.line,n.ch+1),Ce.focus();case"code":return Ce.replaceSelection("`"+t+"`"),""===t&&Ce.setCursor(n.line,n.ch+1),Ce.focus();case"inline-latex":return Ce.replaceSelection("`$$"+t+"$$`"),""===t&&Ce.setCursor(n.line,n.ch+3),Ce.focus();case"latex":return Ce.replaceSelection("```latex\n"+t+"\n```"),Ce.setCursor(n.line+1,t.length+1),Ce.focus();case"line-break":return Ce.replaceSelection("<br/>\n"),Ce.focus();case"list-ul":return""===t?Ce.replaceSelection("- "+t):Ce.replaceSelection(a.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ce.focus();case"list-ol":return""===t?Ce.replaceSelection("1. "+t):Ce.replaceSelection(a.map((function(e,n){return""===e?"":"".concat(n+1,". ").concat(e)})).join("\n")),Ce.focus();case"add-null-ch":return""===t&&Ce.setCursor(n.line,n.ch),Ce.replaceSelection("▁"),Ce.focus();case"add-signal":return""===t&&Ce.setCursor(n.line,n.ch),Ce.replaceSelection("@▁@"),Ce.focus();case"add-multiple":return""===t&&Ce.setCursor(n.line,n.ch),Ce.replaceSelection(te),Ce.focus();case"inster-template-1":return""===t&&Ce.setCursor(n.line,n.ch),Ce.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Ce.focus();case"eraser":return Ce.setValue(""),Ce.focus();case"trigger-watch":return He(!Ae),Ce.focus();case"trigger-full-screen":return ze(!Fe),Ce.focus();case Y:return void We(Y);case U:return void We(U);case X:return void We(X);case K:return void We(K);default:throw new Error}}),[Ce,Ae,Fe]),mn=(0,m.useCallback)((function(e){switch(We(""),Ve){case Y:var n=e.title,t=e.link;return Ce.replaceSelection("[".concat(n,"](").concat(t,")")),Ce.focus();case U:var a=e.language,r=e.content;return Ce.replaceSelection(["```"+a,r,"```"].join("\n")),Ce.focus();case X:var i=e.src,s=e.alt;return s?Ce.replaceSelection(".concat(i,' "').concat(s,'" )')):Ce.replaceSelection("")),Ce.focus();case K:for(var o=e.row,c=e.col,l=e.align,d="\n",u=0;u<o;u++){for(var p=[],m=[],h=0;h<c;h++)1===u&&m.push(ee[l]),p.push(" ");1===u&&(d+="| ".concat(m.join(" | ")," |\n")),d+="| ".concat(p.join(1===c?"":" | ")," |\n")}return Ce.replaceSelection(d+"\n"),Ce.focus();default:throw new Error}}),[Ce,Ve]),hn=(0,m.useMemo)((function(){switch(Ve){case Y:return(0,g.jsx)(I,{callback:mn,onCancel:fn});case U:return(0,g.jsx)(P.Z,{callback:mn,onCancel:fn});case X:return(0,g.jsx)(L,{callback:mn,onCancel:fn});case K:return(0,g.jsx)(W,{callback:mn,onCancel:fn});default:return null}}),[Ve]);function fn(){We("")}(0,m.useEffect)((function(){if(cn.current){var e=function(e){r=!0,i=e.pageY},n=function(){r=!1},t=function(e){if(r){var n=e.pageY-i;n<0&&(n=0),n>300&&(n=300),Ke(u+n+"px")}},a=cn.current,r=!1,i=0;return a.addEventListener("mousedown",e),document.addEventListener("mousemove",t),document.addEventListener("mouseup",n),function(){a.removeEventListener("mousedown",e),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",n)}}}),[Ce,cn]),(0,m.useEffect)((function(){Ke(u)}),[u]);var xn={width:ae(o),height:ae(Ue)},vn=((0,m.useMemo)((function(){if(qe){var e=new Date(qe),n=e.getHours(),t=e.getMinutes(),a=e.getSeconds();return t=t<10?"0"+t:t,a=a<10?"0"+a:a,"".concat(n=n<10?"0"+n:n,":").concat(t,":").concat(a)}return 0}),[qe]),function(e){var n=[];if(V){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,t,a){n.push({multiLine:!("@▁@"===e)})}))}return n});return(0,g.jsxs)(m.Fragment,{children:[(0,g.jsx)("div",{className:"markdown-editor-wrapper",ref:on,children:(0,g.jsxs)("div",{className:"markdown-editor-container ".concat(he," ").concat(Ae?"on-preview":""," ").concat(_?"mini":""," ").concat(Fe?"full-screen":""),style:xn,children:[(0,g.jsx)(k,{insertTemp:N,watch:Ae,fullScreen:Fe,showNullButton:M,showNullProgramButton:V,onActionCallback:pn,hidetoolBar:re,uuid:tn.current,setOpenPhones:function(){an.current=!0}}),(0,g.jsxs)("div",{className:"markdown-editor-body",children:[(0,g.jsx)("div",{className:"codemirror-container",children:(0,g.jsx)("textarea",{ref:sn,placeholder:be})}),Ae?(0,g.jsxs)("div",{ref:ln,className:"preview-container",children:["stex"===Z&&(0,g.jsx)(j,{value:Pe}),"stex"!==Z&&(0,g.jsx)(v.Z,{disabledFill:_e,showProgramFill:V,value:Pe})]}):null]})]})}),A?(0,g.jsx)("a",{ref:cn,className:"editor-resize"}):null,(0,g.jsx)(S.Z,{children:oe[Ve]?(0,g.jsx)(J.Z,{centered:!0,title:oe[Ve],open:!0,onCancel:fn,footer:null,className:"markdown-popup-form",children:hn}):null})]})}},33471:function(e,n,t){t.d(n,{Z:function(){return m}});var a=t(82100),r=t.n(a),i=t(29186),s=t.n(i),o=t(80619),c=t.n(o),l=t(47074),d=t.n(l),u=t(59301),p=t(4676),m=function(e){c()(t,e);var n=d()(t);function t(e){var a;r()(this,t),a=n.call(this,e);var i=window.document;return a.node=i.createElement("div"),i.body.appendChild(a.node),a}return s()(t,[{key:"render",value:function(){var e=this.props.children;return(0,p.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),t}(u.Component)},93802:function(e,n,t){t.d(n,{Z:function(){return r}});var a=t(59301);function r(e,n){var t=(0,a.useRef)();(0,a.useEffect)((function(){t.current=e})),(0,a.useEffect)((function(){if(null!==n){var e=setInterval((function(){t.current()}),n);return function(){return clearInterval(e)}}}),[n])}},23443:function(e,n,t){t.r(n),t.d(n,{default:function(){return ve}});var a=t(7557),r=t.n(a),i=t(41498),s=t.n(i),o=t(82242),c=t.n(o),l=t(79800),d=t.n(l),u=t(39647),p=t.n(u),m=t(59301),h=t(61186),f=t.n(h),x=t(86129),v=t.n(x),g=t(35325),j=t(80184),_=t(43418),y=t(8591),b=t(61621),w=t(66104),k=t(95237),S=t(43604),N=t(3113),C=t(28103),Z=t(10249),E=t(1710),I=t(27812),P=t(95869),O=t(87169),T=t(26227),R=t(67390),A=t(13277),H=t(1079),L=t(42441),B={flex_box_center:"flex_box_center___KJUhi",flex_space_between:"flex_space_between____N4uH",flex_box_vertical_center:"flex_box_vertical_center___yOdsz",flex_box_center_end:"flex_box_center_end___seJB9",flex_box_column:"flex_box_column___ihHC5",title:"title___JSmnB",export:"export___pgR1H",title1_right:"title1_right___MdWJo",userPic:"userPic___UeG3e",userInfo:"userInfo___TNu6l",listItem:"listItem___wdbM_",rightInfo:"rightInfo___Swqk5",shixunTitle:"shixunTitle___L2Tc4",shixunWrp:"shixunWrp___ZoaTc",footerBar:"footerBar___QW5rq",footerBarStatic:"footerBarStatic___CRq8b",exitComment:"exitComment___u4Rqt",nextComment:"nextComment___lvaID",modal:"modal___g3B3L"},F=t(37712),z={normal:{opacity:.8,shadowBlur:10,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0, 0, 0, 0)",color:"#2e65ad"}},M=(0,j.connect)((function(e){var n=e.shixunHomeworks,t=e.loading;return{shixunHomeworks:n,globalSetting:e.globalSetting,loading:t.effects}}))((function(e){var n,t,a,r,i,s,o,c,l,u,p,h,f=e.shixunHomeworks,x=(e.globalSetting,e.loading,e.dispatch,(0,j.useParams)(),(0,j.useSearchParams)()),v=d()(x,1)[0],g=((0,j.useLocation)(),(0,m.useState)([])),_=d()(g,2),y=(_[0],_[1],(0,m.useState)(v.get("tabs")||0)),b=d()(y,2),w=(b[0],b[1],f.shixunWorkReport),N=(null===(n=w.echart_data)||void 0===n?void 0:n.efficiency_list.length)-parseInt(null===(t=w.echart_data)||void 0===t?void 0:t.myself_eff[0]);return(0,F.jsxs)(m.Fragment,{children:[(0,F.jsx)("aside",{className:"ml60 pr30",children:(0,F.jsxs)(k.Z,{children:[(0,F.jsx)(S.Z,{flex:"800px",children:(0,F.jsx)(L.Z,{style:{width:750,height:580},option:{title:{text:"学习效率",subtext:"学习效率=log(实训总得分/实训总耗时)"},backgroundColor:"#fff",color:["#dd4444","#fec42c","#80F1BE"],grid:{left:"3%",right:"9%",bottom:"3%",containLabel:!0},tooltip:{showDelay:0,formatter:function(e){var n;return e.name===w.username?"姓名:"+w.username+"<br/>学号: "+w.user_id+"<br/>效率:"+(null===(n=w.echart_data)||void 0===n?void 0:n.myself_eff[1]):e.name+":"+e.value+" "},axisPointer:{show:!0,type:"cross",lineStyle:{type:"dashed",width:1}}},xAxis:[{type:"value",name:"学生位置",nameTextStyle:{color:"#000",fontSize:12},scale:!0,axisLabel:{formatter:""},axisTick:{show:!1},splitLine:{show:!1}}],yAxis:[{type:"value",name:" ",nameGap:20,nameTextStyle:{color:"#000",fontSize:12},scale:!0,axisLabel:{formatter:"{value}"},splitLine:{show:!1}}],series:[{name:"",type:"scatter",data:null===(u=w.echart_data)||void 0===u?void 0:u.efficiency_list,itemStyle:{normal:{color:"#2e65ad"}},markArea:{silent:!0,itemStyle:{normal:{color:"transparent",borderWidth:1,borderType:"dashed"}},data:[[{name:"学习效率分布区间",xAxis:"min",yAxis:"min"},{xAxis:"max",yAxis:"max"}]]},markPoint:{data:[{name:w.username,xAxis:N,yAxis:null===(p=w.echart_data)||void 0===p?void 0:p.myself_eff[1],value:null===(h=w.echart_data)||void 0===h?void 0:h.myself_eff[1]}],itemStyle:{normal:{color:"#c23531"}}},markLine:{lineStyle:{normal:{type:"solid",color:"#ff6800"}},data:[{type:"average",name:"中位值"}]}}]}})}),(0,F.jsx)(S.Z,{flex:"1",children:(0,F.jsxs)("aside",{className:B.rightInfo,children:[(0,F.jsxs)("ul",{children:[(0,F.jsxs)("li",{children:[(0,F.jsx)("span",{children:"姓名"})," ",(0,F.jsx)("span",{className:"ml30",children:w.username})]}),(0,F.jsxs)("li",{children:[(0,F.jsx)("span",{children:"学号"})," ",(0,F.jsx)("span",{className:"ml30",children:w.student_id||"--"})]}),(0,F.jsxs)("li",{children:[(0,F.jsx)("span",{children:"学习效率"})," ",(0,F.jsx)("span",{className:"ml30 c-orange",children:null===(a=w.echart_data)||void 0===a?void 0:a.myself_eff[1]})]}),(0,F.jsxs)("li",{children:[(0,F.jsx)("span",{children:"当前排名"})," ",(0,F.jsx)("span",{className:"ml30 c-orange",children:null===(r=w.echart_data)||void 0===r?void 0:r.myself_eff[0]})]})]}),(0,F.jsxs)("p",{children:["1个小圆点代表1个学生的学习效率",(0,F.jsx)("br",{}),"红色水滴表示当前学生的学习效率值",(0,F.jsx)("br",{}),"小圆点越高,学习效率越高",(0,F.jsx)("br",{}),"橙色横向箭头:中位值,表示整个课堂学生表现的平均值"]})]})})]})}),(0,F.jsx)("aside",{className:"ml60 pr30",children:(0,F.jsxs)(k.Z,{children:[(0,F.jsx)(S.Z,{flex:"800px",children:(0,F.jsx)(L.Z,{style:{width:750,height:580},option:{title:{text:"能力值",subtext:"能力值(实训获得经验值/实训评测次数)"},backgroundColor:"#fff",color:["#dd4444","#fec42c","#80F1BE"],grid:{x:"10%",x2:150,y:"18%",y2:"10%"},tooltip:{padding:10,backgroundColor:"#222",borderColor:"#777",borderWidth:1,formatter:function(e){var n;if(e.value,e.name===w.username)return"姓名:"+w.username+"<br/>学号: "+w.user_id+"<br/>得分:"+(null===(n=w.echart_data)||void 0===n?void 0:n.myself_object[1])}},xAxis:{type:"value",name:"log(实训的总时间)",nameGap:16,nameTextStyle:{color:"#000",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#000"}}},yAxis:{type:"value",name:" ",nameLocation:"end",nameGap:20,nameTextStyle:{color:"#000",fontSize:12},axisLine:{lineStyle:{color:"#000"}},splitLine:{show:!1}},series:[{name:"能力",type:"scatter",itemStyle:z,data:null===(s=w.echart_data)||void 0===s?void 0:s.consume_list,symbolSize:function(e){return Math.round(e[2])},markPoint:{data:[{name:w.username,xAxis:null===(o=w.echart_data)||void 0===o?void 0:o.myself_object[0],yAxis:null===(c=w.echart_data)||void 0===c?void 0:c.myself_object[1],value:null===(l=w.echart_data)||void 0===l?void 0:l.myself_object[1]}],itemStyle:{normal:{color:"#c23531"}}}}]}})}),(0,F.jsx)(S.Z,{flex:"1",children:(0,F.jsxs)("aside",{className:B.rightInfo,children:[(0,F.jsxs)("ul",{children:[(0,F.jsxs)("li",{children:[(0,F.jsx)("span",{children:"姓名"})," ",(0,F.jsx)("span",{className:"ml30",children:w.username})]}),(0,F.jsxs)("li",{children:[(0,F.jsx)("span",{children:"学号"})," ",(0,F.jsx)("span",{className:"ml30",children:w.student_id||"--"})]}),(0,F.jsxs)("li",{children:[(0,F.jsx)("span",{children:"能力"})," ",(0,F.jsx)("span",{className:"ml30 c-orange",children:null===(i=w.echart_data)||void 0===i?void 0:i.myself_object[1]})]})]}),(0,F.jsxs)("p",{children:["1个小圆点代表1个学生的能力值",(0,F.jsx)("br",{}),"红色水滴表示当前学生的能力值",(0,F.jsx)("br",{}),"小圆圈越大,评测次数越少",(0,F.jsx)("br",{})]})]})})]})})]})})),$=t(10446),V=t(5871),W=function(e){var n=e.defaultValue,t=e.onBlur,a=e.max,r=e.className,i=void 0===r?"game-score":r,s=(0,m.useState)(n),o=d()(s,2),c=o[0],l=o[1];return(0,m.useEffect)((function(){l(n)}),[n]),(0,F.jsx)(V.Z,{max:a,min:0,className:i,value:c,onChange:function(e){l(e)},onBlur:function(){c!==n&&t(c>a?a:c)}})},D=t(57809),G=t(49731),q="md___TEmcT",J=D.default.Option,Y={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},X=function(e){return e[e.SET_PATH=0]="SET_PATH",e[e.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT",e}(X||{});function U(e,n){switch(n.type){case X.SET_PATH:return c()(c()({},e),{},{selectedPath:n.payload});case X.GET_PASSED_CONTENT:return c()(c()({},e),{},{passedContent:n.payload});default:throw new Error}}var K=function(e){var n,t,a=e.path,r=(e.game_id,e.onPathChange,e.autoHeight),i=e.diff_code_count,s=e.data,o=e.game_codes_cn,c=a.split(";").filter((function(e){return!!e})),l=(0,m.useReducer)(U,{selectedPath:c[0],passedContent:{language:"python",content:""}}),u=d()(l,2),p=u[0],h=u[1],f=p.selectedPath,x=p.passedContent;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("h2",{children:[" ",(0,F.jsxs)("span",{children:[o,o&&(0,F.jsx)("span",{className:"ml5 font12 c-grey-999",children:{"最后通关代码":"通过了本题,在作业时间内最后一次提交的通关代码","最新代码":"未通过本题,展示最后提交评测的代码详情","截止后通关代码":"在作业时间结束后通关该题的代码详情"}[o]})]}),i&&(0,F.jsxs)("span",{style:{marginLeft:"50px"},children:["代码修改行数 ",i]}),(0,F.jsx)("span",{children:(0,F.jsxs)(D.default,{style:{width:200},value:f,onChange:function(e){h({type:X.SET_PATH,payload:e})},children:[" ",c.map((function(e){return(0,F.jsx)(J,{value:e,children:e},e)}))," "]})})," "]}),"md"===(null==f?void 0:f.split(".")[1])&&(0,F.jsx)(G.Z,{height:300,autoHeight:r,defaultValue:(null==s||null===(n=s.filter((function(e){return e.path===f})))||void 0===n||null===(n=n[0])||void 0===n?void 0:n.content)||"",className:q}),"md"!==(null==f?void 0:f.split(".")[1])&&(0,F.jsx)($.ZP,{height:300,language:x.language,value:(null==s||null===(t=s.filter((function(e){return e.path===f})))||void 0===t||null===(t=t[0])||void 0===t?void 0:t.content)||"",autoHeight:r,theme:"default",options:Y})]})},Q=t(18356),ee=(0,j.connect)((function(e){var n=e.shixunHomeworks,t=e.loading,a=e.globalSetting,r=e.classroomList;return{shixunHomeworks:n,globalSetting:a,loading:t.effects,classroomList:r}}))((function(e){var n=e.shixunHomeworks,t=e.autoHeight,a=e.classroomList,i=e.dispatch,o=n.shixunWorkReport,l=o.stage_list,d=o.work_id,u=(0,j.useParams)(),p=(0,A.GJ)(),h={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1},x=[{title:"评测次数",dataIndex:"position",width:"100px"},{title:"详细信息",dataIndex:"output_detail"},{title:"评测耗时(S)",dataIndex:"ts_time",width:"130px"},{title:"内存消耗(MB)",width:"150px",dataIndex:"ts_mem"},{title:"评测时间",width:"170px",dataIndex:"created_at",render:function(e){return f()(e).format("YYYY-MM-DD HH:mm")}},{title:"操作",width:"80px",dataIndex:"query_index",render:function(e,n){return(0,F.jsx)("span",{className:"c-blue current",onClick:s()(r()().mark((function e(){var a,i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Q.Lk)(n.game_identifier,{path:null===(a=n.path)||void 0===a||null===(a=a.replace(/\;/g,";"))||void 0===a?void 0:a.split(";")[0],query_index:n.query_index});case 2:0===(null==(i=e.sent)?void 0:i.status)&&_.Z.info({title:"代码内容",width:900,centered:!0,icon:null,okText:"关闭",className:"".concat(B.lookCode," custom-modal-divider"),content:(0,F.jsx)($.ZP,{height:500,autoHeight:t,language:"python",theme:"default",value:decodeURIComponent(escape(window.atob((null==i?void 0:i.content)||""))),options:h})});case 4:case"end":return e.stop()}}),e)}))),children:n.query_index?"查看代码":""})}}];function v(){return(v=s()(r()().mark((function e(n,t){var a,s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=l[n].challenge_id,e.next=3,i({type:"shixunHomeworks/changeScore",payload:{categoryId:u.homeworkId,type:"report",score:t,challenge_id:a}});case 3:return s=e.sent,e.next=6,i({type:"shixunHomeworks/getShixunWorkReport",payload:c()({},u)});case 6:0===s.status&&y.ZP.success("操作成功");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e,n){return(0,g.U2)("student_works/".concat(d,"/rep_passed_content.json"),{path:n,game_id:e})}var w=o.shixun_detail;return(0,F.jsx)(m.Fragment,{children:null==w?void 0:w.map((function(e,n){var r;return(0,F.jsx)("div",{children:(0,F.jsxs)("aside",{className:"pl30 pr30",children:[(0,F.jsxs)("div",{className:"".concat(B.shixunTitle," mt10"),children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{className:"fa fa-code "}),(0,F.jsxs)("strong",{className:"c-black",children:["第",n+1,"关 ",(0,F.jsx)(j.Link,{className:"c-black",target:"_blank",to:"/tasks/".concat(e.game_identifier),children:e.subject})]})]}),p?(0,F.jsxs)("span",{children:["调分:",(0,F.jsx)(W,{className:"game-score",max:l[n].game_score_full,defaultValue:l[n].game_score,onBlur:function(e){var t;!(0,A.Rm)()||null!==(t=a.AssistantObject.practice)&&void 0!==t&&t.can_appraise?function(e,n){v.apply(this,arguments)}(n,e):y.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]}):null]}),(0,F.jsxs)("div",{className:"font16 mt10",children:[0===e.st&&(e.path?"string"==typeof(null==e?void 0:e.game_codes_cn)?(0,F.jsx)("aside",{className:B.shixunWrp,children:(0,F.jsx)(K,{game_codes_cn:null==e?void 0:e.game_codes_cn,autoHeight:t,path:e.path,game_id:e.id,data:e.game_codes,diff_code_count:e.diff_code_count,onPathChange:b})}):(0,F.jsx)("div",{className:"font14",style:{border:"1px solid #d9d9d9",padding:"6px 10px"},children:" 提示:纯图形化、命令行的实训不展示通关代码,如需查看学生代码请前往作业列表导出实验文件。"}):"目前图形化、命令行、Vscode编辑器、选择题模式的实验,暂时无法使用此功能"),1===e.st&&(0===e.complete_status?"本关暂未通过,无通关代码":"目前图形化、命令行、Vscode编辑器、选择题模式的实验,暂时无法使用此功能")]}),(0,F.jsx)("aside",{className:"mt10 font16",children:null!==(r=e.outputs)&&void 0!==r&&r.length?(0,F.jsx)(E.Z,{columns:x,pagination:{hideOnSinglePage:!0},dataSource:e.outputs.map((function(n){return c()(c()({},e),n)}))}):"本关无评测记录"})]},n)},n)}))})})),ne=t(78241),te="greyText___nOpNq",ae="info___nBB3c",re="label___P6my8",ie="blackContent___O4HnS",se="orangeContent___JBF44",oe="inputLabel___B2GAs",ce="tableTitle___IqAxM",le="scoreTable___RJvpU",de=(0,j.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,classroomList:e.classroomList}}))((function(e){var n=e.shixunHomeworks,t=e.dispatch,a=e.classroomList,i=n.shixunWorkReport,o=(0,j.useParams)(),l=(0,m.useState)(!1),u=d()(l,2),p=u[0],h=u[1],f=ne.Z.useForm(),x=d()(f,1)[0];(0,m.useEffect)((function(){var e,t;"更改点评"===n.actionTabs.key&&x.setFieldsValue({comment:null===(e=n.actionTabs.selectArrs)||void 0===e||null===(e=e.data)||void 0===e?void 0:e.work_comment,hidden_comment:null===(t=n.actionTabs.selectArrs)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.work_comment_hidden})}),[n.actionTabs.key]);var v=function(){var e=s()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=x.getFieldsValue(),e.next=3,(0,g.ZP)("/api/student_works/".concat(o.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:n.hidden_comment,comment:n.comment}});case 3:0===e.sent.status&&(y.ZP.success("评阅成功"),x.resetFields(),t({type:"shixunHomeworks/setActionTabs",payload:{}}),t({type:"shixunHomeworks/getShixunWorkReport",payload:c()({},o)}));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),b=[{title:"关卡",dataIndex:"name",render:function(e,n,t){return t+1}},{title:"任务名称",dataIndex:"name",render:function(e,n,t){return(0,F.jsxs)("div",{children:[e,4===n.complete_status&&(0,F.jsx)(H.vA,{status:n.complete_status})]})}},{title:"开始时间",dataIndex:"open_time"},{title:"完成时间",dataIndex:"finished_time"},{title:"评测次数",dataIndex:"evaluate_count",align:"center"},{title:"实训耗时",dataIndex:"time_consuming"},{title:"是否查看答案",dataIndex:"view_answer",align:"center",render:function(e){return e?"是":"否"}},{title:"关卡得分",dataIndex:"game_score",align:"center",render:function(e,n){return(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{style:{color:parseFloat(n.game_score_full)!==parseFloat(e)?"#E30000":"#53C41B"},children:e}),"/",n.game_score_full]})}},{title:"调分",dataIndex:"game_score",align:"center",fixed:"right",render:function(e,n){return(0,A.GJ)()?(0,F.jsx)(W,{max:n.game_score_full,defaultValue:parseFloat(e),onBlur:function(){var e=s()(r()().mark((function e(i){var s,l;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,A.Rm)()||null!==(s=a.AssistantObject.practice)&&void 0!==s&&s.can_appraise){e.next=3;break}return y.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),e.abrupt("return");case 3:return e.next=5,t({type:"shixunHomeworks/changeScore",payload:{categoryId:o.homeworkId,type:"report",score:i,challenge_id:n.challenge_id}});case 5:return l=e.sent,e.next=8,t({type:"shixunHomeworks/getShixunWorkReport",payload:c()({},o)});case 8:0===l.status&&y.ZP.success("操作成功");case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()}):e}}];return(0,F.jsxs)(_.Z,{centered:!0,width:1080,title:"点评作业",open:"更改点评"===n.actionTabs.key,okText:"确定",cancelText:"取消",onOk:s()(r()().mark((function e(){var n,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,A.Rm)()||null!==(n=a.AssistantObject.practice)&&void 0!==n&&n.can_appraise){e.next=3;break}return y.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),e.abrupt("return");case 3:t=x.getFieldsValue(),"{}"===JSON.stringify(t)||""===t.hidden_comment&&""===t.comment?h(!0):v();case 5:case"end":return e.stop()}}),e)}))),onCancel:function(){t({type:"shixunHomeworks/setActionTabs",payload:{}})},children:[(0,F.jsxs)(k.Z,{justify:"space-between",className:ae,children:[(0,F.jsxs)(S.Z,{children:[(0,F.jsx)("span",{className:"".concat(re," ").concat(te),children:"姓名"}),(0,F.jsx)("span",{className:ie,children:null==i?void 0:i.username})]}),(0,F.jsxs)(S.Z,{children:[(0,F.jsx)("span",{className:"".concat(re," ").concat(te),children:"学号"}),(0,F.jsx)("span",{className:ie,children:(null==i?void 0:i.student_id)||"--"})]}),(0,F.jsxs)(S.Z,{children:[(0,F.jsx)("span",{className:"".concat(re," ").concat(te),children:"班级"}),(0,F.jsx)("span",{className:ie,children:(null==i?void 0:i.group_name)||"--"})]}),(0,F.jsxs)(S.Z,{children:[(0,F.jsx)("span",{className:"".concat(re," ").concat(te),children:"关卡得分"}),(0,F.jsx)("span",{className:se,children:(null==i?void 0:i.challenge_score)||"--"})]}),(0,F.jsxs)(S.Z,{children:[(0,F.jsx)("span",{className:"".concat(re," ").concat(te),children:"效率分"}),(0,F.jsx)("span",{className:se,children:(null==i?void 0:i.eff_score)||"--"})]}),(0,F.jsxs)(S.Z,{children:[(0,F.jsx)("span",{className:"".concat(re," ").concat(te),children:"迟交扣分"}),(0,F.jsx)("span",{className:se,children:(null==i?void 0:i.late_penalty)||"--"})]}),(0,F.jsxs)(S.Z,{children:[(0,F.jsx)("span",{className:"".concat(re," ").concat(te),children:"最终成绩"}),(0,F.jsx)("span",{className:se,children:(null==i?void 0:i.work_score)||"--"})]})]}),(0,F.jsxs)(ne.Z,{form:x,onChange:function(){p&&h(!1)},children:[(0,F.jsx)("div",{className:"".concat(oe," ").concat(te),children:"学生和课堂老师可见"}),(0,F.jsx)(ne.Z.Item,{name:"comment",children:(0,F.jsx)(Z.Z.TextArea,{placeholder:"请输入评阅内容",rows:3})}),(0,F.jsx)("div",{className:"".concat(oe," ").concat(te),children:"仅课堂老师可见"}),(0,F.jsx)(ne.Z.Item,{name:"hidden_comment",children:(0,F.jsx)(Z.Z.TextArea,{placeholder:"请输入评阅内容",rows:3})})]}),p&&(0,F.jsx)("p",{className:"c-red",children:"评阅内容至少有一个不为空"}),(0,F.jsx)("div",{className:ce,children:"关卡成绩"}),(0,F.jsx)(E.Z,{className:le,dataSource:i.stage_list,rowKey:"challenge_id",pagination:!1,columns:b,scroll:{x:"max-content"}})]})})),ue=t(77545),pe=t(36707),me=t(18036),he=t(44164),fe=t.n(he),xe=["shixunHomeworks","classroomList","globalSetting","loading","user","dispatch"],ve=(0,j.connect)((function(e){var n=e.shixunHomeworks,t=e.classroomList,a=e.loading,r=e.globalSetting,i=e.user;return{shixunHomeworks:n,classroomList:t,globalSetting:r,loading:a.effects,user:i}}))((function(e){var n,t,a=e.shixunHomeworks,i=e.classroomList,o=(e.globalSetting,e.loading,e.user),l=e.dispatch,u=(p()(e,xe),(0,m.useState)(c()({},(0,j.useParams)()))),h=d()(u,2),x=h[0],L=h[1],z=(0,j.useParams)(),$=(0,j.useLocation)(),V=(0,m.useState)([]),D=(d()(V,0),(0,m.useState)({last:!1})),G=d()(D,2),q=G[0],J=G[1],Y=(0,m.useState)({last:!1}),X=d()(Y,2),U=X[0],K=X[1],Q=(0,m.useRef)(),ne=(0,m.useRef)(),te=(0,m.useState)(!1),ae=d()(te,2),re=ae[0],ie=ae[1],se=(0,m.useState)(!1),oe=d()(se,2),ce=oe[0],le=oe[1],he=(0,m.useState)(!1),ve=d()(he,2),ge=ve[0],je=ve[1],_e=a.shixunWorkReport,ye=(0,m.useState)(),be=d()(ye,2),we=be[0],ke=be[1],Se=(0,A.GJ)(),Ne=(0,m.useState)(new(v())),Ce=d()(Ne,2),Ze=Ce[0],Ee=Ce[1],Ie=(0,m.useState)(0),Pe=d()(Ie,2),Oe=(Pe[0],Pe[1],(0,m.useState)([])),Te=d()(Oe,2),Re=Te[0],Ae=Te[1],He=(0,m.useState)(!1),Le=d()(He,2),Be=Le[0],Fe=Le[1],ze=(0,m.useState)(!1),Me=d()(ze,2),$e=Me[0],Ve=Me[1],We=(0,m.useState)(""),De=d()(We,2),Ge=De[0],qe=De[1],Je=(0,m.useState)(!1),Ye=d()(Je,2),Xe=Ye[0],Ue=Ye[1],Ke=(0,m.useState)(!0),Qe=d()(Ke,2),en=Qe[0],nn=Qe[1],tn=(0,m.useState)(0),an=d()(tn,2),rn=an[0],sn=an[1],on=function(){var e=s()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(o.userInfo.is_teacher||o.userInfo.admin)&&(Ue(!0),nn(!1));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,m.useEffect)((function(){on(),console.log("打印的------",_e),qe(_e.repeat_minus_score)}),[_e,o]),(0,m.useEffect)((function(){console.log("触发这",_e.work_score),sn(_e.work_score)}),[_e.work_score,Ge]),(0,m.useEffect)((function(){return l({type:"globalSetting/footerToggle",payload:!1}),function(){l({type:"globalSetting/footerToggle",payload:!0})}}),[]),(0,m.useEffect)((function(){if(_e){var e,n=[];null==_e||null===(e=_e.target_test_sets)||void 0===e||e.map((function(e,t){var a;null==e||null===(a=e.targets)||void 0===a||a.map((function(a,r){var i;a.name=null==e?void 0:e.name,a.total_target_score=null==e?void 0:e.total_target_score,a.actual_target_score=null==e?void 0:e.actual_target_score,a.rowSpan=0===r?null==e||null===(i=e.targets)||void 0===i?void 0:i.length:0,a.order=t+1,n.push(a)}))})),ke(n),l({type:"classroomList/getAssistantPermissions",payload:{course_id:x.coursesId}})}}),[_e]),(0,m.useEffect)((function(){"导出实训报告"===a.actionTabs.key&&Re.length>0&&pn("all")}),[Re]),(0,m.useEffect)((function(){L(c()({},z))}),[$.pathname]);var cn=function(){document.body.scrollIntoView()};function ln(){return dn.apply(this,arguments)}function dn(){return(dn=s()(r()().mark((function e(){var n,t,a,i,s,o,d;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=JSON.parse(sessionStorage.all_student_works_params||"{}"),e.next=3,l({type:"shixunHomeworks/getAllStudentWorks",payload:c()(c()({},x),a)});case 3:i=e.sent,Ae(i.all_student_works),(s=null===(n=i.all_student_works)||void 0===n?void 0:n.map((function(e){return String(e.student_work_id)})).indexOf(x.homeworkId))===(null===(t=i.all_student_works)||void 0===t?void 0:t.length)-1?J({last:!0}):J(null===(o=i.all_student_works)||void 0===o?void 0:o[s+1]),K(0===s?{last:!0}:null===(d=i.all_student_works)||void 0===d?void 0:d[s-1]);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var un=function(){document.querySelectorAll("canvas").forEach((function(e){(!e.clientWidth||!e.clientHeight)&&e.remove()}))},pn=function(){var e=s()(r()().mark((function e(n){var t,a,i,o,c,d,u,p,m,h,f,x;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=function(){return c=s()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l({type:"shixunHomeworks/getShixunWorkReport",payload:{homeworkId:Re[t].student_work_id}});case 2:n=e.sent,cn(),t++,setTimeout(s()(r()().mark((function e(){var c,l,d,u,p,m,h;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:un(),l=Ze.folder("".concat(null==n?void 0:n.username)),d=document.querySelector("#export-all").children,u=fe()(),p=r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.set(i).from(d[n]).toContainer().toCanvas().toPdf().get("pdf").then(function(){var e=s()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n<d.length-1)){e.next=3;break}return e.next=3,t.addPage();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e)})),m=0;case 6:if(!(m<d.length)){e.next=11;break}return e.delegateYield(p(m),"t0",8);case 8:m++,e.next=6;break;case 11:l.file("".concat(Re[t-1].student_work_user_name).concat(t,".pdf"),u.output("blob")),h=l.folder("代码文件"),null==n||null===(c=n.shixun_detail)||void 0===c||c.map((function(e,n){var t,a=h.folder("第".concat(n+1,"关-").concat(e.subject,"-").concat(e.id));null==e||null===(t=e.game_codes)||void 0===t||t.map((function(e){a.file("".concat(e.filename,".txt"),null==e?void 0:e.content)}))})),a.update({content:(0,F.jsxs)("div",{children:["当前进度: ",(0,F.jsx)("span",{className:"c-blue",children:t}),"/",null==Re?void 0:Re.length,(0,F.jsx)("br",{}),"请勿关闭浏览器窗口"]})}),t==(null==Re?void 0:Re.length)?(a.destroy(),mn()):o();case 16:case"end":return e.stop()}}),e)}))),2200);case 6:case"end":return e.stop()}}),e)}))),c.apply(this,arguments)},o=function(){return c.apply(this,arguments)},t=0,a=_.Z.info({width:460,title:(0,F.jsxs)("div",{children:["正在导出实训报告,",(0,F.jsx)("span",{className:"c-red",children:"请勿关闭或操作当前浏览器窗口"})]}),content:(0,F.jsxs)("div",{children:["当前进度: ",(0,F.jsx)("span",{className:"c-blue",children:t+1}),"/","all"!==n?1:null==Re?void 0:Re.length,(0,F.jsx)("br",{}),"请勿关闭浏览器窗口"]}),maskClosable:!1,className:B.modal,onOk:function(){}}),i={margin:[0,0],filename:"".concat(_e.username,".pdf"),html2canvas:{useCORS:!0,letterRendering:!0},jsPDF:{unit:"mm",format:"a4",orientation:"landscape"}},!("all"!==n||(null==Re?void 0:Re.length)<2)){e.next=27;break}un(),cn(),u=ne.current.children,p=fe()(),m=Ze.folder("".concat(null==_e?void 0:_e.username)),h=r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.set(i).from(u[n]).toContainer().toCanvas().toPdf().get("pdf").then(function(){var e=s()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n<u.length-1)){e.next=3;break}return e.next=3,t.addPage();case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e)})),f=0;case 13:if(!(f<u.length)){e.next=18;break}return e.delegateYield(h(f),"t0",15);case 15:f++,e.next=13;break;case 18:return ie(!1),m.file("".concat(_e.username,".pdf"),p.output("blob"),{base64:!1}),x=m.folder("代码文件"),null==_e||null===(d=_e.shixun_detail)||void 0===d||d.map((function(e,n){var t,a=x.folder("第".concat(n+1,"关-").concat(e.subject,"-").concat(e.id));null==e||null===(t=e.game_codes)||void 0===t||t.map((function(e){a.file("".concat(e.filename,".txt"),null==e?void 0:e.content)}))})),a.destroy(),mn(),e.abrupt("return");case 27:o();case 28:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),mn=function(){Ze.generateAsync({type:"blob"}).then((function(e){var n=document.createElement("a");n.href=window.URL.createObjectURL(e),n.download=_e.course_name+".zip",document.body.appendChild(n);var t=document.createEvent("MouseEvents");t.initEvent("click",!1,!1),n.dispatchEvent(t),document.body.removeChild(n),Ee(new(v()))})),je(!1)};(0,m.useEffect)((function(){hn()}),[x.homeworkId]);var hn=function(){var e=s()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(!0),e.next=3,l({type:"shixunHomeworks/getShixunWorkReport",payload:c()({},x)});case 3:le(!1),(0,A.GJ)()&&ln();case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),fn=[{title:"关卡",dataIndex:"name",render:function(e,n,t){return t+1}},{title:"任务名称",dataIndex:"name",render:function(e,n,t){return(0,F.jsxs)("div",{children:[e,4===n.complete_status&&(0,F.jsx)(H.vA,{status:n.complete_status})]})}},{title:"开启时间",dataIndex:"open_time"},{title:"代码修改行数",dataIndex:"diff_code_count",render:function(e,n,t){return e||"- -"}},{title:"评测次数",dataIndex:"evaluate_count"},{title:"完成时间",dataIndex:"finished_time"},{title:"实训耗时",dataIndex:"time_consuming"},{title:"是否查看答案",dataIndex:"view_answer",render:function(e){return e?"是":"否"}},{title:"经验值",dataIndex:"experience",render:function(e,n){return(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{style:{color:parseFloat(n.myself_experience)!==parseFloat(e)?"red":"green"},children:n.myself_experience}),"/",e]})}},{title:"关卡得分",dataIndex:"game_score",render:function(e,n){return(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{style:{color:parseFloat(n.game_score_full)!==parseFloat(e)?"red":"green"},children:e}),"/",n.game_score_full]})}},{title:"调分",dataIndex:"game_score",render:function(e,n){return Se?(0,F.jsx)(W,{max:n.game_score_full,defaultValue:parseFloat(e),onBlur:function(){var e=s()(r()().mark((function e(t){var a,s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,A.Rm)()||null!==(a=i.AssistantObject.practice)&&void 0!==a&&a.can_appraise){e.next=3;break}return y.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),e.abrupt("return");case 3:return e.next=5,l({type:"shixunHomeworks/changeScore",payload:{categoryId:x.homeworkId,type:"report",score:t,challenge_id:n.challenge_id}});case 5:return s=e.sent,e.next=8,l({type:"shixunHomeworks/getShixunWorkReport",payload:c()({},x)});case 8:0===s.status&&y.ZP.success("操作成功");case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()}):e}}],xn=[{title:"关卡",dataIndex:"order",key:"order",render:function(e,n,t){return{children:e,props:{rowSpan:n.rowSpan}}}},{title:"任务名称",dataIndex:"name",key:"name",render:function(e,n,t){return{children:e,props:{rowSpan:n.rowSpan}}}},{title:"指标名称",dataIndex:"target_name",key:"target_name"},{title:"指标预期结果",dataIndex:"output",key:"output"},{title:"指标实际结果",dataIndex:"actual_output",key:"actual_output"},{title:"指标得分",dataIndex:"test_score",key:"test_score",render:function(e,n,t){return(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{style:{color:parseFloat(n.actual_test_score)!==parseFloat(e)?"red":"green"},children:n.actual_test_score}),"/",e]})}},{title:"指标总分",render:function(e,n,t){return{children:(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{style:{color:parseFloat(n.actual_target_score)!==parseFloat(e)?"red":"green"},children:n.actual_target_score}),"/",e]}),props:{rowSpan:n.rowSpan}}},dataIndex:"total_target_score",key:"total_target_score"}],vn=function(e){l({type:"shixunHomeworks/setActionTabs",payload:{key:"",type:2}}),setTimeout((function(){"next"===e?j.history.push("/classrooms/".concat(x.coursesId,"/shixun_homework/").concat(x.categoryId,"/").concat(null==q?void 0:q.student_work_id,"/comment")):j.history.push("/classrooms/".concat(x.coursesId,"/shixun_homework/").concat(x.categoryId,"/").concat(null==U?void 0:U.student_work_id,"/comment"))}),200)},gn=function(){var e=s()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,g.ZP)("/api/student_works/".concat(null==_e?void 0:_e.work_id,"/update_repeat_score"),{method:"put",body:{score:Ge}});case 2:return n=e.sent,e.next=5,l({type:"shixunHomeworks/getShixunWorkReport",payload:c()({},x)});case 5:0===n.status&&y.ZP.info("操作成功");case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,F.jsxs)("section",{className:"bg-fafafa",style:{position:"sticky",top:0},children:[(0,F.jsx)("div",{className:"edu-container mt10",style:{paddingBottom:100},children:(0,F.jsxs)(b.Z,{loading:ce,active:!0,avatar:{size:40},paragraph:{rows:5},children:[(0,F.jsxs)("div",{className:"edu-container",children:[_e.course_id&&(0,F.jsxs)("section",{className:"animated fadeIn",children:[(0,F.jsx)("aside",{className:"",children:_e.category&&(0,F.jsxs)(w.Z,{separator:">",children:[(0,F.jsx)(w.Z.Item,{children:(0,F.jsx)(j.Link,{to:"/classrooms/".concat(_e.course_id,"/shixun_homework"),children:_e.course_name})}),(0,F.jsx)(w.Z.Item,{children:(0,F.jsx)(j.Link,{to:"/classrooms/".concat(_e.course_id,"/shixun_homework/").concat(_e.category.main?"":_e.category.category_id),children:_e.category.category_name})}),(0,F.jsx)(w.Z.Item,{children:(0,F.jsx)(j.Link,{to:"/classrooms/".concat(_e.course_id,"/shixun_homework/").concat(_e.homework_common_id,"/detail"),children:"作业详情"})}),(0,F.jsx)(w.Z.Item,{children:_e.username})]})}),(0,F.jsx)("aside",{className:[B.title1,"mt20"].join(" "),children:(0,F.jsxs)(k.Z,{align:"middle",children:[(0,F.jsxs)(S.Z,{flex:1,children:[(0,F.jsx)(j.Link,{to:"/classrooms/".concat(_e.course_id,"/shixun_homework/").concat(_e.homework_common_id,"/detail"),children:(0,F.jsx)(I.Z,{className:"font16 c-black"})}),(0,F.jsx)("strong",{className:"font20 ml5",children:_e.shixun_name}),(0,F.jsx)(H.VV,{temporary:!0,status:_e.homework_status})]}),(0,F.jsxs)(S.Z,{className:B.title1_right,children:[_e.view_tpi&&(0,F.jsxs)(N.ZP,{children:[(0,F.jsx)("span",{className:"iconfont icon-yijiandianping mr5"}),(0,F.jsx)(j.Link,{className:"c-black",target:"_blank",to:"/tasks/".concat(null==_e||null===(n=_e.shixun_detail)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.game_identifier),children:"查看学员实训"})]}),(0,A.GJ)()&&!1===_e.homework_end&&!!_e.myshixun_id&&(0,F.jsxs)(N.ZP,{className:"ml10",onClick:s()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l({type:"shixunHomeworks/setActionTabs",payload:{key:"打回重做",selectArrs:{myshixun_identifier:_e.myshixun_identifier},homework_common_id:z.categoryId}});case 2:case"end":return e.stop()}}),e)}))),children:[(0,F.jsx)("span",{className:"iconfont icon-dahuizhongzuo3x mr5"}),"打回重做"]}),(0,F.jsxs)(N.ZP,{className:"ml10",onClick:function(){return pn("")},loading:re,children:[(0,F.jsx)("span",{className:"iconfont icon-daochu mr5"}),"导出实训报告"]}),(0,A.GJ)()&&(null==Re?void 0:Re.length)>1&&(0,F.jsxs)(N.ZP,{className:"ml10",onClick:function(){return pn("all")},children:[(0,F.jsx)("span",{className:"iconfont icon-daochu mr5"}),"导出全部学生实训报告"]})]})]})})]}),(0,F.jsx)("aside",{className:"mt30 relative"})]}),(0,F.jsx)("aside",{className:"edu-container bg-white",ref:Q,children:(0,F.jsxs)("div",{id:"export-all",ref:ne,children:[(0,F.jsxs)("div",{id:"export-all-1",children:[(0,F.jsxs)("div",{className:B.title,children:[(0,F.jsx)("h1",{children:"总体评价"}),(0,F.jsx)("div",{children:(0,A.GJ)()&&(0,F.jsxs)(N.ZP,{className:"mr20",type:"primary",onClick:function(){l({type:"shixunHomeworks/setActionTabs",payload:{key:"更改点评",selectArrs:{myshixun_identifier:_e.user_id,data:c()({},_e)}}})},children:[(0,F.jsx)(P.Z,{}),_e.has_shixun_work_comment?"更改点评":"点评作业"]})})]}),(0,F.jsx)(C.Z,{style:{marginTop:0}}),(0,F.jsxs)(k.Z,{className:"pl30 pr30",children:[(0,F.jsx)(S.Z,{children:(0,F.jsx)("img",{className:B.userPic,src:"".concat(R.Z.IMG_SERVER,"/images/").concat(_e.image_url),alt:_e.username})}),(0,F.jsxs)(S.Z,{children:[(0,F.jsx)("span",{className:"font16 ml40",children:_e.username}),(0,F.jsx)(H.vA,{status:_e.compelete_status}),(0,F.jsxs)("ul",{className:B.userInfo,children:[(0,F.jsxs)("li",{children:["学号:",_e.student_id||"--"]}),(0,F.jsxs)("li",{children:["分班:",_e.group_name||"--"]}),(0,F.jsx)("br",{}),(0,F.jsxs)("li",{children:["截止前完成关卡:",(0,F.jsx)("span",{className:"c-red",children:_e.complete_count}),"/",(0,F.jsx)("span",{className:"c-red",children:_e.challenges_count})]}),(0,F.jsxs)("li",{children:["最新完成关卡:",(0,F.jsx)("span",{className:"c-red",children:_e.current_complete_count||"-"}),"/",(0,F.jsx)("span",{className:"c-red",children:_e.challenges_count})]}),(0,F.jsxs)("li",{children:["完成效率:",_e&&null===_e.efficiency?"--":_e&&_e.efficiency]}),(0,F.jsxs)("li",{children:["课堂最高完成效率:",_e&&null===_e.max_efficiency?"--":_e&&_e.max_efficiency]})]})]}),(0,F.jsxs)("ul",{className:[B.listItem,"mt10"].join(" "),children:[(0,F.jsxs)("li",{children:[(0,F.jsx)("strong",{children:"通关时间"}),(0,F.jsx)("div",{className:"c-light-black mt20",children:_e&&null===_e.passed_time||_e&&"--"===_e.passed_time?"--":f()(_e&&_e.passed_time).format("YYYY-MM-DD HH:mm")})]}),(0,F.jsxs)("li",{children:[(0,F.jsxs)("strong",{children:["计时规则",(0,F.jsx)("i",{onClick:function(e){e.stopPropagation(),e.preventDefault(),Fe(!0)},style:{marginLeft:4,color:"#145DFF",fontSize:16,cursor:"pointer"},className:"iconfont icon-tishixiaowenhao"})]}),(0,F.jsx)("div",{className:"c-light-black mt20",children:null==_e?void 0:_e.human_training_time_rules})]}),(0,F.jsxs)("li",{children:[(0,F.jsxs)("strong",{children:["实训总耗时",(0,F.jsx)("i",{onClick:function(e){e.stopPropagation(),e.preventDefault(),Ve(!0)},style:{marginLeft:4,color:"#145DFF",fontSize:16,cursor:"pointer"},className:"iconfont icon-tishixiaowenhao"})]}),(0,F.jsx)("div",{className:"c-light-black mt20",children:_e.time_consuming})]}),(0,F.jsxs)("li",{children:[(0,F.jsx)("strong",{children:"评测次数"}),(0,F.jsx)("div",{className:"mt20",children:_e.evaluate_count})]}),(null==_e?void 0:_e.eff_score_full)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("li",{children:[(0,F.jsx)("strong",{children:"关卡得分"}),(0,F.jsxs)("div",{className:"mt20",children:[(0,F.jsx)("span",{className:"c-orange",children:_e.challenge_score}),"/",(0,F.jsx)("span",{className:"c-light-black",children:_e.challenge_score_full})]})]}),(0,F.jsxs)("li",{children:[(0,F.jsx)("strong",{children:"效率分"}),(0,F.jsxs)("div",{className:"mt20",children:[(0,F.jsx)("span",{className:"c-orange",children:_e.eff_score}),"/",(0,F.jsx)("span",{className:"c-light-black",children:_e.eff_score_full})]})]})]}),(null==_e?void 0:_e.have_repeat)&&0!==(null==_e?void 0:_e.repeat_minus_score)&&(0,F.jsxs)("li",{style:{position:"relative"},children:[(0,F.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,F.jsx)("strong",{children:"查重扣分"}),(0,F.jsx)("div",{style:{position:"absolute",fontSize:"10px",color:"white",left:"57px",width:"46px",bottom:"72px"},children:null!=_e&&_e.review_rate?(0,F.jsxs)("span",{style:{background:"#0152d9",borderRadius:"6px 6px 6px 0",cursor:"pointer"},onClick:function(){null!=_e&&_e.review_id&&Xe&&(localStorage.setItem("studentDetial",window.location.pathname),j.history.push({pathname:"/classrooms/:coursesId/shixun_homework/".concat(x.categoryId,"/review_detail/").concat(null==_e?void 0:_e.review_id)}))},children:[_e.review_rate.toFixed(1),"%"]}):(0,F.jsx)("span",{style:{background:"#0152d9",borderRadius:"6px 6px 6px 0"},children:"- -"})})]}),Xe?(0,F.jsxs)("div",{className:"mt20",children:[(0,F.jsx)(Z.Z,{style:{width:"45px",height:"22px"},value:Ge,onChange:function(e){!function(e){qe(""),e.target.value&&(console.log("进来",_e),e.target.value=e.target.value>_e.repeat_setting_score?_e.repeat_setting_score:e.target.value,qe(e.target.value))}(e)},onBlur:gn,disabled:en})," / ",null==_e?void 0:_e.repeat_setting_score]}):(0,F.jsxs)("div",{className:"mt20",children:[null==_e?void 0:_e.repeat_minus_score," / ",null==_e?void 0:_e.repeat_setting_score]})]}),console.log("sssssssssssssssssssssss",null==_e?void 0:_e.have_repeat,null==_e?void 0:_e.repeat_minus_score),(null==_e?void 0:_e.have_repeat)&&0===(null==_e?void 0:_e.repeat_minus_score)&&(0,F.jsxs)("li",{children:[(0,F.jsx)("strong",{children:"查重扣分"}),(0,F.jsx)("div",{className:"mt20",children:" - -"})]}),!(null!=_e&&_e.have_repeat)&&(0,F.jsxs)("li",{children:[(0,F.jsx)("strong",{children:"查重扣分"}),(0,F.jsx)("div",{className:"mt20",children:" - -"})]}),(0,F.jsxs)("li",{children:[(0,F.jsx)("strong",{children:"迟交扣分"}),(0,F.jsx)("div",{className:"mt20",children:(0,F.jsx)("span",{children:_e.late_penalty||"- -"})})]}),(0,F.jsxs)("li",{children:[(0,F.jsx)("strong",{children:"最终成绩"}),(0,F.jsxs)("div",{className:"mt20",children:[(0,F.jsx)("span",{className:"c-orange",children:rn}),"/",(0,F.jsx)("span",{className:"c-light-black",children:_e.all_work_score})]})]}),(0,F.jsxs)("li",{children:[(0,F.jsx)("strong",{children:"总评"}),(0,F.jsx)("div",{className:"mt20",children:(0,F.jsx)("span",{className:"c-orange",children:_e.overall_appraisal})})]})]})]}),(0,F.jsx)(C.Z,{style:{margin:0}}),(_e.work_comment_hidden||_e.work_comment)&&(0,F.jsxs)("div",{children:[(0,F.jsxs)(k.Z,{align:"middle",children:[(0,F.jsx)(S.Z,{flex:1,children:(0,F.jsx)("h1",{className:B.title,children:"点评内容"})}),(0,F.jsx)(S.Z,{className:"pr30",children:(0,A.GJ)()&&(0,F.jsxs)(N.ZP,{onClick:s()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",icon:(0,F.jsx)(O.Z,{}),content:"是否确认删除?",onOk:function(){return s()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,me.gZ)({comment_id:_e.comment_id,homeworkId:x.homeworkId});case 2:0===e.sent.status&&(y.ZP.success("删除成功"),l({type:"shixunHomeworks/getShixunWorkReport",payload:c()({},x)}));case 4:case"end":return e.stop()}}),e)})))()}});case 1:case"end":return e.stop()}}),e)}))),children:[(0,F.jsx)(T.Z,{}),"删除"]})})]}),(0,F.jsx)(C.Z,{style:{margin:0}}),_e.work_comment&&(0,F.jsxs)("aside",{className:"pl30 pr30 mt20",children:[(0,F.jsx)("span",{className:"c-light-black font12",children:"# 学生和课堂老师可见"}),(0,F.jsx)("br",{}),(0,F.jsx)(pe.Z,{value:_e.work_comment})]}),_e.work_comment_hidden&&(0,F.jsxs)("aside",{className:"pl30 pr30 mt20",children:[(0,F.jsx)("span",{className:"c-light-black font12",children:"# 仅课堂老师可见"}),(0,F.jsx)("br",{}),(0,F.jsx)(pe.Z,{value:_e.work_comment_hidden})]})]}),(0,F.jsx)("h1",{className:B.title,children:"阶段成绩"}),(0,F.jsx)("aside",{className:"pl30 pr30",children:(0,F.jsx)(E.Z,{dataSource:_e.stage_list,rowKey:function(e){return null==e?void 0:e.challenge_id},pagination:!1,columns:fn})}),(null==_e||null===(t=_e.target_test_sets)||void 0===t?void 0:t.length)>0&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:B.title,children:"指标成绩"}),(0,F.jsx)("aside",{className:"pl30 pr30",children:(0,F.jsx)(E.Z,{dataSource:we,rowKey:function(e){return null==e?void 0:e.challenge_id},pagination:!1,bordered:!0,columns:xn})})]}),(null==_e?void 0:_e.work_description)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("h1",{className:B.title,children:"个人总结"}),(0,F.jsx)("aside",{className:"pl30 pr30",children:(0,F.jsx)(pe.Z,{value:null==_e?void 0:_e.work_description})})]}),(0,F.jsx)("h1",{className:B.title,children:"图形统计"}),(0,F.jsx)(M,{}),(0,F.jsx)("h1",{className:B.title,children:"实训详情"})]}),(0,F.jsx)(ee,{autoHeight:ge})]})}),(0,A.GJ)()&&(0,F.jsx)("aside",{className:"".concat(B.footerBar," ").concat(re?B.footerBarStatic:""),children:(0,F.jsx)("aside",{className:"edu-container",children:(0,F.jsxs)(k.Z,{align:"middle",children:[(0,F.jsx)(S.Z,{flex:"1",children:(0,F.jsx)(j.Link,{className:B.exitComment,to:"/classrooms/".concat(x.coursesId,"/shixun_homework/").concat(x.categoryId,"/detail"),children:"返回列表"})}),(0,F.jsxs)(S.Z,{flex:"1",className:"tr",children:[(0,F.jsx)(N.ZP,{type:"default",disabled:null==U?void 0:U.last,onClick:function(){return vn()},children:"上一个"}),(0,F.jsx)(N.ZP,{type:"default",style:{marginLeft:"20px",marginRight:"20px"},disabled:null==q?void 0:q.last,onClick:function(){return vn("next")},children:"下一个"}),(0,A.GJ)()&&(0,F.jsx)(N.ZP,{type:"primary",onClick:s()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l({type:"shixunHomeworks/setActionTabs",payload:{key:"更改点评",selectArrs:{myshixun_identifier:_e.user_id,data:c()({},_e)}}});case 1:case"end":return e.stop()}}),e)}))),children:"点评作业"})]})]})})})]})}),(0,F.jsx)(de,{}),(0,F.jsx)(ue.Z,{}),(0,F.jsxs)(_.Z,{open:Be,width:860,centered:!0,onCancel:function(){Fe(!1)},title:"计时规则说明",footer:null,children:[(0,F.jsxs)("div",{style:{color:"#333333",fontWeight:400},children:[(0,F.jsx)("span",{style:{fontWeight:500},children:"1、页面停留时长"}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{children:"学生进入关卡的答题页面开始计时,直至学生关卡评测通过,则计时结束;"}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{children:" 学生进入关卡的答题页面开始计时,若学生关闭/退出答题页面,则计时暂停,再次进入答题页面时开始累计计时直至评测通过,则计时结束;"}),(0,F.jsx)("span",{style:{color:"#FA6400",display:"flex",height:34,alignItems:"center"},children:" 可能会造成时长评估与实际做题能力不符的情况 "}),(0,F.jsx)("span",{children:"a、学生进入关卡看完题后,退出答题页面完成代码设计,再复制进平台答题页面进行评测,无法评估学生的学习和思考时间。"})]}),(0,F.jsxs)("div",{style:{color:"#333333",marginTop:20,fontWeight:400},children:[(0,F.jsx)("span",{style:{fontWeight:500},children:"2、关卡总耗时"}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{style:{},children:"学生第一次进入关卡答题页面开始计时,直至该关卡评测通过,则计时结束。 "}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{children:" 另,即使关卡闯关过程中,学生退出/关闭答题页面,也将持续计时,直至该关卡通过。"}),(0,F.jsx)("span",{style:{color:"#FA6400",display:"flex",height:44,paddingTop:10},children:" 可能会造成时长评估与实际做题能力不符的情况 "}),(0,F.jsx)("span",{children:"a、学生从其他同学处看到题目后,完成代码设计,再进入关卡答题页面,将已完成的代码复制至平台进行评测;"}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{children:"b、学生第一次打开关卡后,因为某种原因离开页面,时隔多日才再次进入平台闯关,就会导致学生关卡总耗时过长;"})]}),(0,F.jsxs)("div",{style:{color:"#333333",marginTop:20,fontWeight:400},children:[(0,F.jsx)("span",{style:{fontWeight:500},children:"3、作业通关时长"}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{style:{},children:"从老师发布的实训作业开始时间,开始计时,直至学生实训通关(包括迟交通关),结束计时。如果学生未通关,则该生的闯关耗时为老师设置的实训开始时间至实训截止时间,如果老师开启了补交,则该生的闯关耗时为实训开始时间至实训补交截止时间。"})]}),(0,F.jsxs)("div",{style:{color:"#333333",marginTop:20,fontWeight:400},children:[(0,F.jsx)("span",{style:{fontWeight:500},children:"规则目的"}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{style:{},children:"鼓励学生在实训作业发布的第一时间,立即登录平台完成实训作业的通关。"})]})]}),(0,F.jsx)(_.Z,{open:$e,title:"实训总耗时说明",centered:!0,footer:null,onCancel:function(){Ve(!1)},width:600,children:(0,F.jsxs)("div",{style:{fontWeight:400,color:"#333333"},children:[(0,F.jsxs)("div",{children:["1、当计时规则为“",(0,F.jsx)("span",{style:{color:"#145DFF"},children:"页面停留时长"}),"”时,实训总耗时为所有关卡耗时相加之和;"]}),(0,F.jsxs)("div",{style:{margin:"20px 0px"},children:["2、当计时规则为“",(0,F.jsx)("span",{style:{color:"#145DFF"},children:"关卡总耗时"}),"”时,实训总耗时为所有关卡耗时相加之和;"]}),(0,F.jsxs)("div",{children:["3、当计时规则为“",(0,F.jsx)("span",{style:{color:"#145DFF"},children:"作业通关时长"}),"”时,实训总耗时为实训发布时间至实训通关时间,当学生未通关时,实训总耗时为实训发布时间至实训截止时间。"]})]})})]})}))},77545:function(e,n,t){var a=t(7557),r=t.n(a),i=t(41498),s=t.n(i),o=(t(59301),t(43418)),c=t(8591),l=t(35325),d=t(80184),u=t(13277),p=t(37712);n.Z=(0,d.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,classroomList:e.classroomList}}))((function(e){var n=e.shixunHomeworks,t=e.classroomList,a=e.dispatch,i=(0,d.useParams)();return(0,p.jsxs)(o.Z,{centered:!0,title:"提示",open:"打回重做"===n.actionTabs.key,okText:"确定",cancelText:"取消",onOk:s()(r()().mark((function e(){var s,o,p,m,h;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,u.Rm)()||null!==(s=t.AssistantObject.practice)&&void 0!==s&&s.can_redo){e.next=3;break}return c.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),e.abrupt("return");case 3:return e.next=5,(0,l.ZP)("/api/myshixuns/".concat(n.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"GET",params:{course_id:i.coursesId,homework_common_id:n.actionTabs.homework_common_id}});case 5:if(!(o=e.sent).shixun_identifier){e.next=13;break}if(c.ZP.success("操作成功"),a({type:"shixunHomeworks/setActionTabs",payload:{}}),h=null==o||null===(p=o.new_works)||void 0===p||null===(p=p.find((function(e){return"".concat(e.homework_common_id)===i.categoryId})))||void 0===p?void 0:p.id,!(0,u.Rm)()||null!==(m=t.AssistantObject.practice)&&void 0!==m&&m.can_view){e.next=12;break}return e.abrupt("return");case 12:d.history.replace("/classrooms/".concat(i.coursesId,"/shixun_homework/").concat(i.categoryId,"/").concat(h,"/comment"));case 13:case"end":return e.stop()}}),e)}))),onCancel:function(){a({type:"shixunHomeworks/setActionTabs",payload:{}})},children:[(0,p.jsx)("p",{children:"该作业将被打回重做,学生实训记录将被清空!"}),(0,p.jsx)("p",{children:"确定打回?"})]})}))},66104:function(e,n,t){t.d(n,{Z:function(){return I}});var a=t(92310),r=t.n(a),i=t(11592),s=t(26112),o=t(59301),c=t(92343),l=t(36355),d=t(84105),u=t(91857);const p=e=>{let{children:n}=e;const{getPrefixCls:t}=o.useContext(l.E_),a=t("breadcrumb");return o.createElement("li",{className:`${a}-separator`,"aria-hidden":"true"},""===n?n:n||"/")};p.__ANT_BREADCRUMB_SEPARATOR=!0;var m=p,h=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)n.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(t[a[r]]=e[a[r]])}return t};function f(e,n,t,a){if(null==t)return null;const{className:i,onClick:c}=n,l=h(n,["className","onClick"]),d=Object.assign(Object.assign({},(0,s.Z)(l,{data:!0,aria:!0})),{onClick:c});return void 0!==a?o.createElement("a",Object.assign({},d,{className:r()(`${e}-link`,i),href:a}),t):o.createElement("span",Object.assign({},d,{className:r()(`${e}-link`,i)}),t)}function x(e,n){return(t,a,r,i,s)=>{if(n)return n(t,a,r,i);const o=function(e,n){if(void 0===e.title||null===e.title)return null;const t=Object.keys(n).join("|");return"object"==typeof e.title?e.title:String(e.title).replace(new RegExp(`:(${t})`,"g"),((e,t)=>n[t]||e))}(t,a);return f(e,t,o,s)}}var v=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)n.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(t[a[r]]=e[a[r]])}return t};const g=e=>{const{prefixCls:n,separator:t="/",children:a,menu:r,overlay:i,dropdownProps:s,href:c}=e;const l=(e=>{if(r||i){const t=Object.assign({},s);if(r){const e=r||{},{items:n}=e,a=v(e,["items"]);t.menu=Object.assign(Object.assign({},a),{items:null==n?void 0:n.map(((e,n)=>{var{key:t,title:a,label:r,path:i}=e,s=v(e,["key","title","label","path"]);let l=null!=r?r:a;return i&&(l=o.createElement("a",{href:`${c}${i}`},l)),Object.assign(Object.assign({},s),{key:null!=t?t:n,label:l})}))})}else i&&(t.overlay=i);return o.createElement(u.Z,Object.assign({placement:"bottom"},t),o.createElement("span",{className:`${n}-overlay-link`},e,o.createElement(d.Z,null)))}return e})(a);return null!=l?o.createElement(o.Fragment,null,o.createElement("li",null,l),t&&o.createElement(m,null,t)):null},j=e=>{const{prefixCls:n,children:t,href:a}=e,r=v(e,["prefixCls","children","href"]),{getPrefixCls:i}=o.useContext(l.E_),s=i("breadcrumb",n);return o.createElement(g,Object.assign({},r,{prefixCls:s}),f(s,r,t,a))};j.__ANT_BREADCRUMB_ITEM=!0;var _=j,y=t(17313),b=t(83116),w=t(37613);const k=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:Object.assign(Object.assign({},(0,y.Wf)(e)),{color:e.itemColor,fontSize:e.fontSize,[t]:{fontSize:e.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:e.linkColor,transition:`color ${e.motionDurationMid}`,padding:`0 ${e.paddingXXS}px`,borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",marginInline:-e.marginXXS,"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover}},(0,y.Qy)(e)),"li:last-child":{color:e.lastItemColor},[`${n}-separator`]:{marginInline:e.separatorMargin,color:e.separatorColor},[`${n}-link`]:{[`\n > ${t} + span,\n > ${t} + a\n `]:{marginInlineStart:e.marginXXS}},[`${n}-overlay-link`]:{borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",padding:`0 ${e.paddingXXS}px`,marginInline:-e.marginXXS,[`> ${t}`]:{marginInlineStart:e.marginXXS,fontSize:e.fontSizeIcon},"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover,a:{color:e.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${e.componentCls}-rtl`]:{direction:"rtl"}})}};var S=(0,b.Z)("Breadcrumb",(e=>{const n=(0,w.TS)(e,{});return[k(n)]}),(e=>({itemColor:e.colorTextDescription,lastItemColor:e.colorText,iconFontSize:e.fontSize,linkColor:e.colorTextDescription,linkHoverColor:e.colorText,separatorColor:e.colorTextDescription,separatorMargin:e.marginXS}))),N=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)n.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(t[a[r]]=e[a[r]])}return t};function C(e){const{breadcrumbName:n,children:t}=e,a=N(e,["breadcrumbName","children"]),r=Object.assign({title:n},a);return t&&(r.menu={items:t.map((e=>{var{breadcrumbName:n}=e,t=N(e,["breadcrumbName"]);return Object.assign(Object.assign({},t),{title:n})}))}),r}var Z=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)n.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(t[a[r]]=e[a[r]])}return t};const E=e=>{const{prefixCls:n,separator:t="/",style:a,className:d,rootClassName:u,routes:p,items:h,children:f,itemRender:v,params:j={}}=e,_=Z(e,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:y,direction:b,breadcrumb:w}=o.useContext(l.E_);let k;const N=y("breadcrumb",n),[E,I]=S(N),P=function(e,n){return(0,o.useMemo)((()=>e||(n?n.map(C):null)),[e,n])}(h,p);const O=x(N,v);if(P&&P.length>0){const e=[],n=h||p;k=P.map(((a,r)=>{const{path:i,key:c,type:l,menu:d,overlay:u,onClick:p,className:h,separator:f,dropdownProps:x}=a,v=((e,n)=>{if(void 0===n)return n;let t=(n||"").replace(/^\//,"");return Object.keys(e).forEach((n=>{t=t.replace(`:${n}`,e[n])})),t})(j,i);void 0!==v&&e.push(v);const _=null!=c?c:r;if("separator"===l)return o.createElement(m,{key:_},f);const y={},b=r===P.length-1;d?y.menu=d:u&&(y.overlay=u);let{href:w}=a;return e.length&&void 0!==v&&(w=`#/${e.join("/")}`),o.createElement(g,Object.assign({key:_},y,(0,s.Z)(a,{data:!0,aria:!0}),{className:h,dropdownProps:x,href:w,separator:b?"":t,onClick:p,prefixCls:N}),O(a,j,n,e,w))}))}else if(f){const e=(0,i.Z)(f).length;k=(0,i.Z)(f).map(((n,a)=>{if(!n)return n;const r=a===e-1;return(0,c.Tm)(n,{separator:r?"":t,key:a})}))}const T=r()(N,null==w?void 0:w.className,{[`${N}-rtl`]:"rtl"===b},d,u,I),R=Object.assign(Object.assign({},null==w?void 0:w.style),a);return E(o.createElement("nav",Object.assign({className:T,style:R},_),o.createElement("ol",null,k)))};E.Item=_,E.Separator=m;var I=E},28103:function(e,n,t){t.d(n,{Z:function(){return m}});var a=t(92310),r=t.n(a),i=t(59301),s=t(36355),o=t(17313),c=t(83116),l=t(37613);const d=e=>{const{componentCls:n,sizePaddingEdgeHorizontal:t,colorSplit:a,lineWidth:r,textPaddingInline:i,orientationMargin:s,verticalMarginInline:c}=e;return{[n]:Object.assign(Object.assign({},(0,o.Wf)(e)),{borderBlockStart:`${r}px solid ${a}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:c,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${r}px solid ${a}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${e.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${n}-with-text`]:{display:"flex",alignItems:"center",margin:`${e.dividerHorizontalWithTextGutterMargin}px 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${a}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${r}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${n}-with-text-left`]:{"&::before":{width:100*s+"%"},"&::after":{width:100-100*s+"%"}},[`&-horizontal${n}-with-text-right`]:{"&::before":{width:100-100*s+"%"},"&::after":{width:100*s+"%"}},[`${n}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:i},"&-dashed":{background:"none",borderColor:a,borderStyle:"dashed",borderWidth:`${r}px 0 0`},[`&-horizontal${n}-with-text${n}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${n}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${n}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${n}-with-text-left${n}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${n}-inner-text`]:{paddingInlineStart:t}},[`&-horizontal${n}-with-text-right${n}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${n}-inner-text`]:{paddingInlineEnd:t}}})}};var u=(0,c.Z)("Divider",(e=>{const n=(0,l.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0});return[d(n)]}),(e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}))),p=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)n.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(t[a[r]]=e[a[r]])}return t};var m=e=>{const{getPrefixCls:n,direction:t,divider:a}=i.useContext(s.E_),{prefixCls:o,type:c="horizontal",orientation:l="center",orientationMargin:d,className:m,rootClassName:h,children:f,dashed:x,plain:v,style:g}=e,j=p(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),_=n("divider",o),[y,b]=u(_),w=l.length>0?`-${l}`:l,k=!!f,S="left"===l&&null!=d,N="right"===l&&null!=d,C=r()(_,null==a?void 0:a.className,b,`${_}-${c}`,{[`${_}-with-text`]:k,[`${_}-with-text${w}`]:k,[`${_}-dashed`]:!!x,[`${_}-plain`]:!!v,[`${_}-rtl`]:"rtl"===t,[`${_}-no-default-orientation-margin-left`]:S,[`${_}-no-default-orientation-margin-right`]:N},m,h),Z=i.useMemo((()=>"number"==typeof d?d:/^\d+$/.test(d)?Number(d):d),[d]),E=Object.assign(Object.assign({},S&&{marginLeft:Z}),N&&{marginRight:Z});return y(i.createElement("div",Object.assign({className:C,style:Object.assign(Object.assign({},null==a?void 0:a.style),g)},j,{role:"separator"}),f&&"vertical"!==c&&i.createElement("span",{className:`${_}-inner-text`,style:E},f)))}}}]); |