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
14 KiB
5 lines
14 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[128],{"5oB3":function(ce,Q,s){ce.exports={flex_box_center:"flex_box_center___2WENa",flex_space_between:"flex_space_between___32o_C",flex_box_vertical_center:"flex_box_vertical_center___VReNJ",flex_box_center_end:"flex_box_center_end___VidHP",flex_box_column:"flex_box_column___7bh0_",guidance:"guidance___1zlCK",title:"title___TLK56",u:"u___1YcNG",active:"active___2cPfY",content:"content___3PW9_",btn:"btn___26Rnl"}},"9Bee":function(ce,Q,s){"use strict";var oe=s("k1fw"),$=s("q1tI"),ie=s.n($),fe=s("vg9a"),se=s("tJVT"),B=s("DlQD"),V=s.n(B),T=s("rUJ1");function x(i,l){var c=i.match(/^(\s+)(?:```)/);if(c===null)return l;var u=c[1];return l.split(`
|
|
`).map(function(f){var v=f.match(/^\s+/);if(v===null)return f;var y=Object(se.a)(v,1),O=y[0];return O.length>=u.length?f.slice(u.length):f}).join(`
|
|
`)}var Z=[],z=["<ul>"],R=new V.a.Renderer,de=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function j(){Z.length=0,z=["<ul>"]}var le={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function q(i,l,c,u){if(l>=i.length||i[l].level<=c)return l;var f=i[l];u.push("<li><a href='#"+f.anchor+"'>"+f.text+"</a>"),l++;var v=[];return l=q(i,l,f.level,v),v.length>0&&(u.push("<ul>"),v.forEach(function(y){u.push(y)}),u.push("</ul>")),u.push("</li>"),l=q(i,l,c,u),l}function ue(){return q(Z,0,0,z),z.push("</ul>"),z.join("")}var ee={heading:function(l){var c=de.exec(l);if(c)return{type:"heading",raw:c[0],depth:c[1].length,text:c[2]}},fences:function(l){var c=this.rules.block.fences.exec(l);if(c){var u=c[0],f=x(u,c[3]||""),v=c[2]?c[2].trim():c[2];if(["latex","katex","math"].indexOf(v)>=0){var y=m(),O=f;f=y,D[y]={type:"block",expression:O}}return{type:"code",raw:u,lang:v,text:f}}}},_e=/(?:\${2})([^\n`]+?)(?:\${2})/gi,g=0,m=function(){return"__special_katext_id_".concat(g++,"__")},D={};function P(){return D}function w(){g=0,D={}}function E(i){return i=i.replace(_e,function(l,c){var u=m();return D[u]={type:"inline",expression:c},u}),i}var G=R.listitem;R.listitem=function(i){return G(E(i))};var te=R.paragraph;R.paragraph=function(i){return te(E(i))};var k=R.tablecell;R.tablecell=function(i,l){return k(E(i),l)},R.code=function(i,l,c){var u=(l||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(i,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(l,'">').concat(c?i:Object(T.escape)(i,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(c?i:Object(T.escape)(i,!0))+"</code></pre>"},R.heading=function(i,l,c){var u=this.options.headerPrefix+c.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return Z.push({anchor:u,level:l,text:i}),"<h"+l+' id="'+u+'">'+i+"</h"+l+">"},V.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),V.a.use({tokenizer:ee,renderer:R});var p=V.a,F=s("SJMd"),S=s("m3rI"),H=s("Oy/b"),ne=/<pre[^>]*>/g;function J(i){var l=document.createElement("div");return l.innerHTML=i,l.childNodes.length===0?"":l.childNodes[0].nodeValue}var X=Q.a=function(i){var l=i.value,c=l===void 0?"":l,u=i.className,f=i.showTextOnly,v=i.showLines,y=i.style,O=y===void 0?{}:y,M=String(c),U=Object($.useMemo)(function(){try{var L=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,N=/\"\/api\/attachments\/|\"\/attachments\/download\//g,I=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;M=M.replace(L,"("+S.a.API_SERVER+"/api/attachments/").replace(N,'"'+S.a.API_SERVER+"/api/attachments/").replace(I,'"'+S.a.API_SERVER+"/files/uploads/")}catch(o){}var t=p(M);setTimeout(function(){return Y()},300);var e=P();if(M.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",ue()),j()),t=t.replace(/(__special_katext_id_\d+__)/g,function(o,a){var r=e[a],d=r.type,_=r.expression;return Object(H.renderToString)(J(_)||"",{displayMode:d==="block",throwOnError:!1,output:"html"})}),t=t.replace(/▁/g,"\u2581\u2581\u2581"),w(),f){var n=document.createElement("div");return n.innerHTML=t,n.innerText}return t},[M]),C=Object($.useRef)();le.WebkitLineClamp=v,v&&(O=Object(oe.a)(Object(oe.a)({},O),le));function W(L){var N=L.target;if(N.tagName.toUpperCase()==="A"){var I=N.getAttribute("href");if(I.startsWith("#")){L.preventDefault();var t=document.getElementById(I.replace("#",""));t&&t.scrollIntoView(!0)}}}var Y=function(){};return Object($.useEffect)(function(){if(C.current&&U&&(U.match(ne)&&window.PR.prettyPrint()),C.current)return C.current.addEventListener("click",W),function(){C.current.removeEventListener("click",W),w(),j()}},[U,C.current,W]),ie.a.createElement(ie.a.Fragment,null,ie.a.createElement("div",{ref:C,style:Object(oe.a)({},O),className:"".concat(u||""," markdown-body "),dangerouslySetInnerHTML:{__html:U}}))}},ObO0:function(ce,Q,s){"use strict";s.r(Q);var oe=s("cWXX"),$=s("/ezw"),ie=s("+L6B"),fe=s("2/Rp"),se=s("9og8"),B=s("tJVT"),V=s("PpiC"),T=s("q1tI"),x=s.n(T),Z=s("Ty5D"),z=s("9kvl"),R=s("1vsH"),de=s("5oB3"),j=s.n(de),le=s("ErOA"),q=s("m3rI"),ue=s("9Bee");function ee(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ee=function(){return m};var g,m={},D=Object.prototype,P=D.hasOwnProperty,w=Object.defineProperty||function(t,e,n){t[e]=n.value},E=typeof Symbol=="function"?Symbol:{},G=E.iterator||"@@iterator",te=E.asyncIterator||"@@asyncIterator",k=E.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,o,a){return n[o]=a}}function F(t,e,n,o){var a=e&&e.prototype instanceof l?e:l,r=Object.create(a.prototype),d=new N(o||[]);return w(r,"_invoke",{value:C(t,n,d)}),r}function S(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(o){return{type:"throw",arg:o}}}m.wrap=F;var H="suspendedStart",ne="suspendedYield",J="executing",X="completed",i={};function l(){}function c(){}function u(){}var f={};p(f,G,function(){return this});var v=Object.getPrototypeOf,y=v&&v(v(I([])));y&&y!==D&&P.call(y,G)&&(f=y);var O=u.prototype=l.prototype=Object.create(f);function M(t){["next","throw","return"].forEach(function(e){p(t,e,function(n){return this._invoke(e,n)})})}function U(t,e){function n(a,r,d,_){var h=S(t[a],t,r);if(h.type!=="throw"){var b=h.arg,A=b.value;return A&&typeof A=="object"&&P.call(A,"__await")?e.resolve(A.__await).then(function(K){n("next",K,d,_)},function(K){n("throw",K,d,_)}):e.resolve(A).then(function(K){b.value=K,d(b)},function(K){return n("throw",K,d,_)})}_(h.arg)}var o;w(this,"_invoke",{value:function(r,d){function _(){return new e(function(h,b){n(r,d,h,b)})}return o=o?o.then(_,_):_()}})}function C(t,e,n){var o=H;return function(a,r){if(o===J)throw new Error("Generator is already running");if(o===X){if(a==="throw")throw r;return{value:g,done:!0}}for(n.method=a,n.arg=r;;){var d=n.delegate;if(d){var _=W(d,n);if(_){if(_===i)continue;return _}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(o===H)throw o=X,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);o=J;var h=S(t,e,n);if(h.type==="normal"){if(o=n.done?X:ne,h.arg===i)continue;return{value:h.arg,done:n.done}}h.type==="throw"&&(o=X,n.method="throw",n.arg=h.arg)}}}function W(t,e){var n=e.method,o=t.iterator[n];if(o===g)return e.delegate=null,n==="throw"&&t.iterator.return&&(e.method="return",e.arg=g,W(t,e),e.method==="throw")||n!=="return"&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),i;var a=S(o,t.iterator,e.arg);if(a.type==="throw")return e.method="throw",e.arg=a.arg,e.delegate=null,i;var r=a.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=g),e.delegate=null,i):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,i)}function Y(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(Y,this),this.reset(!0)}function I(t){if(t||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,o=function a(){for(;++n<t.length;)if(P.call(t,n))return a.value=t[n],a.done=!1,a;return a.value=g,a.done=!0,a};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return c.prototype=u,w(O,"constructor",{value:u,configurable:!0}),w(u,"constructor",{value:c,configurable:!0}),c.displayName=p(u,k,"GeneratorFunction"),m.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===c||(e.displayName||e.name)==="GeneratorFunction")},m.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,p(t,k,"GeneratorFunction")),t.prototype=Object.create(O),t},m.awrap=function(t){return{__await:t}},M(U.prototype),p(U.prototype,te,function(){return this}),m.AsyncIterator=U,m.async=function(t,e,n,o,a){a===void 0&&(a=Promise);var r=new U(F(t,e,n,o),a);return m.isGeneratorFunction(e)?r:r.next().then(function(d){return d.done?d.value:r.next()})},M(O),p(O,k,"Generator"),p(O,G,function(){return this}),p(O,"toString",function(){return"[object Generator]"}),m.keys=function(t){var e=Object(t),n=[];for(var o in e)n.push(o);return n.reverse(),function a(){for(;n.length;){var r=n.pop();if(r in e)return a.value=r,a.done=!1,a}return a.done=!0,a}},m.values=I,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(L),!e)for(var n in this)n.charAt(0)==="t"&&P.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=g)},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 o(b,A){return d.type="throw",d.arg=e,n.next=b,A&&(n.method="next",n.arg=g),!!A}for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a],d=r.completion;if(r.tryLoc==="root")return o("end");if(r.tryLoc<=this.prev){var _=P.call(r,"catchLoc"),h=P.call(r,"finallyLoc");if(_&&h){if(this.prev<r.catchLoc)return o(r.catchLoc,!0);if(this.prev<r.finallyLoc)return o(r.finallyLoc)}else if(_){if(this.prev<r.catchLoc)return o(r.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return o(r.finallyLoc)}}}},abrupt:function(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o];if(a.tryLoc<=this.prev&&P.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var r=a;break}}r&&(e==="break"||e==="continue")&&r.tryLoc<=n&&n<=r.finallyLoc&&(r=null);var d=r?r.completion:{};return d.type=e,d.arg=n,r?(this.method="next",this.next=r.finallyLoc,i):this.complete(d)},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),i},finish:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),L(o),i}},catch:function(e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc===e){var a=o.completion;if(a.type==="throw"){var r=a.arg;L(o)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,o){return this.delegate={iterator:I(e),resultName:n,nextLoc:o},this.method==="next"&&(this.arg=g),i}},m}var _e=function(m){var D,P,w,E=m.user,G=Object(V.a)(m,["user"]),te=Object(T.useState)(1),k=Object(B.a)(te,2),p=k[0],F=k[1],S=Object(T.useState)(!1),H=Object(B.a)(S,2),ne=H[0],J=H[1],X=Object(T.useState)(!1),i=Object(B.a)(X,2),l=i[0],c=i[1],u=Object(T.useState)(""),f=Object(B.a)(u,2),v=f[0],y=f[1],O=Object(T.useState)(!0),M=Object(B.a)(O,2),U=M[0],C=M[1],W=Object(T.useState)([{},{}]),Y=Object(B.a)(W,2),L=Y[0],N=Y[1],I=Object(Z.l)(),t=I.pathname;console.log(I,"location"),Object(T.useEffect)(function(){var a;(E==null||((a=E.userInfo)===null||a===void 0)?void 0:a.identity)&&e()},[E==null||((D=E.userInfo)===null||D===void 0)?void 0:D.identity]),Object(T.useEffect)(function(){n()},[]);var e=function(){if(t.includes("classrooms")){var r;(E==null||((r=E.userInfo)===null||r===void 0)?void 0:r.identity)==="student"&&(J(!0),F(2));return}if(t.includes("paths")){c(!0);return}},n=function(){var a=Object(se.a)(ee().mark(function r(d){var _,h,b,A;return ee().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(le.a)("/api/introductions.json",{method:"get"});case 2:_=re.sent,(_==null?void 0:_.introductions)&&(h=null,t.includes("classrooms")&&(h="course",y("\u6559\u5B66\u8BFE\u5802")),t.includes("paths")&&(h="subject",y("\u5B9E\u8DF5\u8BFE\u7A0B")),b=_.introductions,A=[b==null?void 0:b.find(function(ae){return ae.clazz==="teacher"&&ae.page_type===h}),b==null?void 0:b.find(function(ae){return ae.clazz==="student"&&ae.page_type===h})],N(A)),C(!1);case 5:case"end":return re.stop()}},r)}));return function(d){return a.apply(this,arguments)}}(),o=function(){var r,d,_=q.a.API_SERVER+"/api/attachments/"+(p===1?(r=L[0])===null||r===void 0?void 0:r.attachment_id:(d=L[1])===null||d===void 0?void 0:d.attachment_id);Object(R.s)("",_)};return x.a.createElement("section",{className:j.a.guidance},x.a.createElement($.a,{loading:U,active:!0,paragraph:{rows:5}},x.a.createElement("div",{className:j.a.title},v,"\u65B0\u624B\u6307\u5F15"),x.a.createElement("ul",{className:j.a.u},!ne&&x.a.createElement("li",{onClick:function(){return F(1)},className:p===1?j.a.active:""},"\u6559\u5E08\u7248"),!l&&x.a.createElement("li",{onClick:function(){return F(2)},className:p===2?j.a.active:""},"\u5B66\u751F\u7248")),p===1&&x.a.createElement("div",{className:j.a.content},x.a.createElement(ue.a,{value:((P=L[0])===null||P===void 0?void 0:P.content)||""})),p===2&&x.a.createElement("div",{className:j.a.content},x.a.createElement(ue.a,{value:((w=L[1])===null||w===void 0?void 0:w.content)||""})),x.a.createElement("div",{className:j.a.btn},x.a.createElement(fe.a,{type:"primary",onClick:o},"\u4E0B\u8F7D\u7528\u6237\u624B\u518C"))))};Q.default=Object(z.a)(function(g){var m=g.user;return{user:m}})(_e)}}]);
|