You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
5 lines
16 KiB
5 lines
16 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[191],{"7/Mi":function(ge,oe,l){ge.exports={flex_box_center:"flex_box_center___31oEc",flex_space_between:"flex_space_between___3wnNm",flex_box_vertical_center:"flex_box_vertical_center___2L2Ae",flex_box_center_end:"flex_box_center_end___363cr",flex_box_column:"flex_box_column___2iHEb",list:"list___3lthG",on:"on___2apyH"}},"9Bee":function(ge,oe,l){"use strict";var ue=l("k1fw"),ee=l("q1tI"),ce=l.n(ee),ye=l("vg9a"),Te=l("tJVT"),de=l("DlQD"),te=l.n(de),Oe=l("rUJ1");function be(r,o){var u=r.match(/^(\s+)(?:```)/);if(u===null)return o;var c=u[1];return o.split(`
|
|
`).map(function(m){var y=m.match(/^\s+/);if(y===null)return m;var R=Object(Te.a)(y,1),D=R[0];return D.length>=c.length?m.slice(c.length):m}).join(`
|
|
`)}var Q=[],V=["<ul>"],v=new te.a.Renderer,Pe=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function L(){Q.length=0,V=["<ul>"]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function ie(r,o,u,c){if(o>=r.length||r[o].level<=u)return o;var m=r[o];c.push("<li><a href='#"+m.anchor+"'>"+m.text+"</a>"),o++;var y=[];return o=ie(r,o,m.level,y),y.length>0&&(c.push("<ul>"),y.forEach(function(R){c.push(R)}),c.push("</ul>")),c.push("</li>"),o=ie(r,o,u,c),o}function Le(){return ie(Q,0,0,V),V.push("</ul>"),V.join("")}var Re={heading:function(o){var u=Pe.exec(o);if(u)return{type:"heading",raw:u[0],depth:u[1].length,text:u[2]}},fences:function(o){var u=this.rules.block.fences.exec(o);if(u){var c=u[0],m=be(c,u[3]||""),y=u[2]?u[2].trim():u[2];if(["latex","katex","math"].indexOf(y)>=0){var R=me(),D=m;m=R,ne[R]={type:"block",expression:D}}return{type:"code",raw:c,lang:y,text:m}}}},De=/(?:\${2})([^\n`]+?)(?:\${2})/gi,_e=0,me=function(){return"__special_katext_id_".concat(_e++,"__")},ne={};function Me(){return ne}function se(){_e=0,ne={}}function B(r){return r=r.replace(De,function(o,u){var c=me();return ne[c]={type:"inline",expression:u},c}),r}var we=v.listitem;v.listitem=function(r){return we(B(r))};var g=v.paragraph;v.paragraph=function(r){return g(B(r))};var S=v.tablecell;v.tablecell=function(r,o){return S(B(r),o)},v.code=function(r,o,u){var c=(o||"").match(/\S*/)[0];return c?["latex","katex","math"].indexOf(c)>=0?"<p class='editormd-tex'>".concat(r,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(u?r:Object(Oe.escape)(r,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(u?r:Object(Oe.escape)(r,!0))+"</code></pre>"},v.heading=function(r,o,u){var c=this.options.headerPrefix+u.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return Q.push({anchor:c,level:o,text:r}),"<h"+o+' id="'+c+'">'+r+"</h"+o+">"},te.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),te.a.use({tokenizer:Re,renderer:v});var A=te.a,Z=l("SJMd"),G=l("m3rI"),he=l("Oy/b"),F=/<pre[^>]*>/g;function P(r){var o=document.createElement("div");return o.innerHTML=r,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var re=oe.a=function(r){var o=r.value,u=o===void 0?"":o,c=r.className,m=r.showTextOnly,y=r.showLines,R=r.style,D=R===void 0?{}:R,h=String(u),N=Object(ee.useMemo)(function(){try{var x=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,$=/\"\/api\/attachments\/|\"\/attachments\/download\//g,K=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;h=h.replace(x,"("+G.a.API_SERVER+"/api/attachments/").replace($,'"'+G.a.API_SERVER+"/api/attachments/").replace(K,'"'+G.a.API_SERVER+"/files/uploads/")}catch(n){}var p=A(h);setTimeout(function(){return W()},300);var t=Me();if(h.match(/\[TOC\]/)&&(p=p.replace("<p>[TOC]</p>",Le()),L()),p=p.replace(/(__special_katext_id_\d+__)/g,function(n,a){var i=t[a],s=i.type,_=i.expression;return Object(he.renderToString)(P(_)||"",{displayMode:s==="block",throwOnError:!1,output:"html"})}),p=p.replace(/▁/g,"\u2581\u2581\u2581"),se(),m){var e=document.createElement("div");return e.innerHTML=p,e.innerText}return p},[h]),T=Object(ee.useRef)();E.WebkitLineClamp=y,y&&(D=Object(ue.a)(Object(ue.a)({},D),E));function X(x){var $=x.target;if($.tagName.toUpperCase()==="A"){var K=$.getAttribute("href");if(K.startsWith("#")){x.preventDefault();var p=document.getElementById(K.replace("#",""));p&&p.scrollIntoView(!0)}}}var W=function(){};return Object(ee.useEffect)(function(){if(T.current&&N&&(N.match(F)&&window.PR.prettyPrint()),T.current)return T.current.addEventListener("click",X),function(){T.current.removeEventListener("click",X),se(),L()}},[N,T.current,X]),ce.a.createElement(ce.a.Fragment,null,ce.a.createElement("div",{ref:T,style:Object(ue.a)({},D),className:"".concat(c||""," markdown-body "),dangerouslySetInnerHTML:{__html:N}}))}},kzkF:function(ge,oe,l){"use strict";l.r(oe);var ue=l("14J3"),ee=l("BMrR"),ce=l("jCWc"),ye=l("kPKH"),Te=l("+L6B"),de=l("2/Rp"),te=l("k1fw"),Oe=l("miYZ"),be=l("tsqr"),Q=l("9og8"),V=l("oBTY"),v=l("tJVT"),Pe=l("PpiC"),L=l("q1tI"),E=l.n(L),ie=l("9kvl"),Le=l("1n7x"),Re=l.n(Le),De=l("wd/R"),_e=l.n(De),me=l("HBuW"),ne=l("9Bee"),Me=l("7/Mi"),se=l.n(Me);function B(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */B=function(){return g};var g={},S=Object.prototype,A=S.hasOwnProperty,Z=typeof Symbol=="function"?Symbol:{},G=Z.iterator||"@@iterator",he=Z.asyncIterator||"@@asyncIterator",F=Z.toStringTag||"@@toStringTag";function P(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{P({},"")}catch(t){P=function(n,a,i){return n[a]=i}}function re(t,e,n,a){var i=e&&e.prototype instanceof u?e:u,s=Object.create(i.prototype),_=new $(a||[]);return s._invoke=function(w,C,d){var O="suspendedStart";return function(U,fe){if(O==="executing")throw new Error("Generator is already running");if(O==="completed"){if(U==="throw")throw fe;return p()}for(d.method=U,d.arg=fe;;){var ae=d.delegate;if(ae){var le=X(ae,d);if(le){if(le===o)continue;return le}}if(d.method==="next")d.sent=d._sent=d.arg;else if(d.method==="throw"){if(O==="suspendedStart")throw O="completed",d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);O="executing";var b=r(w,C,d);if(b.type==="normal"){if(O=d.done?"completed":"suspendedYield",b.arg===o)continue;return{value:b.arg,done:d.done}}b.type==="throw"&&(O="completed",d.method="throw",d.arg=b.arg)}}}(t,n,_),s}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(a){return{type:"throw",arg:a}}}g.wrap=re;var o={};function u(){}function c(){}function m(){}var y={};P(y,G,function(){return this});var R=Object.getPrototypeOf,D=R&&R(R(K([])));D&&D!==S&&A.call(D,G)&&(y=D);var h=m.prototype=u.prototype=Object.create(y);function N(t){["next","throw","return"].forEach(function(e){P(t,e,function(n){return this._invoke(e,n)})})}function T(t,e){function n(i,s,_,w){var C=r(t[i],t,s);if(C.type!=="throw"){var d=C.arg,O=d.value;return O&&typeof O=="object"&&A.call(O,"__await")?e.resolve(O.__await).then(function(U){n("next",U,_,w)},function(U){n("throw",U,_,w)}):e.resolve(O).then(function(U){d.value=U,_(d)},function(U){return n("throw",U,_,w)})}w(C.arg)}var a;this._invoke=function(i,s){function _(){return new e(function(w,C){n(i,s,w,C)})}return a=a?a.then(_,_):_()}}function X(t,e){var n=t.iterator[e.method];if(n===void 0){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=void 0,X(t,e),e.method==="throw"))return o;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return o}var a=r(n,t.iterator,e.arg);if(a.type==="throw")return e.method="throw",e.arg=a.arg,e.delegate=null,o;var i=a.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,o):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,o)}function W(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function $(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(W,this),this.reset(!0)}function K(t){if(t){var e=t[G];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var n=-1,a=function i(){for(;++n<t.length;)if(A.call(t,n))return i.value=t[n],i.done=!1,i;return i.value=void 0,i.done=!0,i};return a.next=a}}return{next:p}}function p(){return{value:void 0,done:!0}}return c.prototype=m,P(h,"constructor",m),P(m,"constructor",c),c.displayName=P(m,F,"GeneratorFunction"),g.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===c||(e.displayName||e.name)==="GeneratorFunction")},g.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,P(t,F,"GeneratorFunction")),t.prototype=Object.create(h),t},g.awrap=function(t){return{__await:t}},N(T.prototype),P(T.prototype,he,function(){return this}),g.AsyncIterator=T,g.async=function(t,e,n,a,i){i===void 0&&(i=Promise);var s=new T(re(t,e,n,a),i);return g.isGeneratorFunction(e)?s:s.next().then(function(_){return _.done?_.value:s.next()})},N(h),P(h,F,"Generator"),P(h,G,function(){return this}),P(h,"toString",function(){return"[object Generator]"}),g.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function a(){for(;e.length;){var i=e.pop();if(i in t)return a.value=i,a.done=!1,a}return a.done=!0,a}},g.values=K,$.prototype={constructor:$,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var n in this)n.charAt(0)==="t"&&A.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(d,O){return _.type="throw",_.arg=e,n.next=d,O&&(n.method="next",n.arg=void 0),!!O}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],_=s.completion;if(s.tryLoc==="root")return a("end");if(s.tryLoc<=this.prev){var w=A.call(s,"catchLoc"),C=A.call(s,"finallyLoc");if(w&&C){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(w){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!C)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(e,n){for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a];if(i.tryLoc<=this.prev&&A.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&(e==="break"||e==="continue")&&s.tryLoc<=n&&n<=s.finallyLoc&&(s=null);var _=s?s.completion:{};return _.type=e,_.arg=n,s?(this.method="next",this.next=s.finallyLoc,o):this.complete(_)},complete:function(e,n){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&n&&(this.next=n),o},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),x(a),o}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc===e){var i=a.completion;if(i.type==="throw"){var s=i.arg;x(a)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,a){return this.delegate={iterator:K(e),resultName:n,nextLoc:a},this.method==="next"&&(this.arg=void 0),o}},g}var we=function(S){var A=S.shixunsList,Z=S.globalSetting,G=S.loading,he=S.dispatch,F=Object(Pe.a)(S,["shixunsList","globalSetting","loading","dispatch"]),P=Object(L.useState)([]),re=Object(v.a)(P,2),r=re[0],o=re[1],u=Object(L.useState)(!1),c=Object(v.a)(u,2),m=c[0],y=c[1],R=Object(L.useState)(0),D=Object(v.a)(R,2),h=D[0],N=D[1],T=Object(L.useState)(0),X=Object(v.a)(T,2),W=X[0],x=X[1],$=Object(L.useState)(!1),K=Object(v.a)($,2),p=K[0],t=K[1],e=Object(L.useState)(0),n=Object(v.a)(e,2),a=n[0],i=n[1],s=Object(L.useState)([]),_=Object(v.a)(s,1),w=_[0],C=Object(L.useState)(""),d=Object(v.a)(C,2),O=d[0],U=d[1];Object(L.useEffect)(function(){var b,M,j,f;if(r==null||((b=r[W])===null||b===void 0||((M=b.challenge_info)===null||M===void 0||((j=M[h])===null||j===void 0||((f=j.task_pass)===null||f===void 0))))?void 0:f.length){var H,Y,k;U(r==null||((H=r[W])===null||H===void 0||((Y=H.challenge_info)===null||Y===void 0||((k=Y[h])===null||k===void 0)))?void 0:k.task_pass),setTimeout(function(){var q=1,pe=1500,I=0;Object(V.a)(document.getElementsByClassName("html2pdf__page-break")).forEach(function(J){(!J.width||!J.height)&&J.remove()});var z=Array.from(document.getElementById("export-all").querySelector(".markdown-body").children);z.map(function(J,ve){if(I+=J.scrollHeight,pe<=I){I=J.scrollHeight,++q;var Ee=document.createElement("li");Ee.className="html2pdf__page-break",Ee.innerHTML=" ",document.getElementById("export-all").querySelector(".markdown-body").insertBefore(Ee,J)}}),p&&ae()},1500)}},[h,W]),Object(L.useEffect)(function(){p&&(h==0&&W==0?ae():(N(0),x(0)))},[p]);var fe=function(){var b=Object(Q.a)(B().mark(function M(){return B().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:t(!0),i(0);case 2:case"end":return f.stop()}},M)}));return function(){return b.apply(this,arguments)}}(),ae=function(){var b=Object(Q.a)(B().mark(function M(){return B().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return y(!0),f.abrupt("return",new Promise(function(H,Y){Object(V.a)(document.getElementsByTagName("canvas")).forEach(function(z){(!z.width||!z.height)&&z.remove()});try{var k,q="".concat(r==null||((k=r[W])===null||k===void 0)?void 0:k.shixun_name,"-\u7B2C").concat(h+1,"\u5173-").concat(_e()().format("YYYY-MM-DD")),pe={margin:10,filename:q,image:{type:"jpeg",quality:.98},pagebreak:{mode:["avoid-all","css","legacy"]},html2canvas:{letterRendering:!0,useCORS:!0,allowTaint:!1,scale:1}};if(Re()().set(pe).from(document.getElementById("export-all")).toContainer().toCanvas().toImg().toPdf().save(),H(),p){++a;var I=w[a].split("-");i(a),setTimeout(function(){N(Number(I[1])),x(Number(I[0]))},5e3)}}catch(z){be.b.warn("\u65E0\u4E0B\u8F7D\u5185\u5BB9"),Y()}}));case 3:case"end":return f.stop()}},M)}));return function(){return b.apply(this,arguments)}}();Object(L.useEffect)(function(){document.title="\u5B9E\u8DF5\u9879\u76EE\u5BFC\u51FA",le()},[F.location]);var le=function(){var b=Object(Q.a)(B().mark(function M(){var j,f,H,Y,k,q;return B().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return console.log("props:",F),I.next=3,Object(me.kb)(Object(te.a)({},F.location.query));case 3:j=I.sent,j.status===0&&(j.data.shixuns.map(function(z,J){var ve;(ve=z.challenge_info)===null||ve===void 0||ve.map(function(Ee,xe){w.push("".concat(J,"-").concat(xe))})}),o(Object(V.a)(j.data.shixuns)),U((f=j.data)===null||f===void 0||((H=f.shixuns)===null||H===void 0||((Y=H[W])===null||Y===void 0||((k=Y.challenge_info)===null||k===void 0||((q=k[h])===null||q===void 0))))?void 0:q.task_pass));case 5:case"end":return I.stop()}},M)}));return function(){return b.apply(this,arguments)}}();return E.a.createElement("section",{className:"edu-container mt20"},E.a.createElement("div",{className:"tr"},E.a.createElement(de.a,{style:{marginRight:15},type:"primary",onClick:fe}," \u6279\u91CF\u5BFC\u51FA\u5F53\u524D\u5B9E\u8BAD "),E.a.createElement(de.a,{type:"primary",onClick:ae}," \u5BFC\u51FA\u5F53\u524D\u5B9E\u8BAD ")),E.a.createElement("br",null),E.a.createElement(ee.a,{gutter:[20,20]},E.a.createElement(ye.a,{span:6},E.a.createElement("ul",{className:se.a.list},r.map(function(b,M){return E.a.createElement(E.a.Fragment,null,E.a.createElement("h1",null,b.shixun_name),b.challenge_info.map(function(j,f){return E.a.createElement("li",{onClick:function(){x(M),N(f)},className:M===W&&f===h&&se.a.on,key:f}," ",j.challenge_name)}))}))),E.a.createElement(ye.a,{span:18},E.a.createElement("aside",{id:"export-all"},!!r.length&&E.a.createElement(ne.a,{value:O})))))};oe.default=Object(ie.a)(function(g){var S=g.shixunsList,A=g.loading,Z=g.globalSetting;return{shixunsList:S,globalSetting:Z,loading:A.models.shixunsList}})(we)}}]);
|